imagebuf docs examples: c++ examples, outfile, run script, and doc (#3992)#4020
Conversation
|
Signed-off-by: Carroll, Michael R <michael.r.carroll@intel.com>
f9a8b45 to
e3f6e40
Compare
|
Forgot to sign with -s, so I amended previous commit and force pushed. |
|
I believe that the CI failures are all because docs-examples-cpp/ref/out.txt needs to be updated. |
| :start-after: BEGIN-imagebuf-get-pixel-average | ||
| :end-before: END-imagebuf-get-pixel-average |
There was a problem hiding this comment.
In the C++ code, you called this BEGIN/END-imagebuf-get-pixel-avg
| :language: c++ | ||
| :start-after: BEGIN-imagebuf-set-region-black | ||
| :end-before: END-imagebuf-set-region-black | ||
| :dedent: 4 |
There was a problem hiding this comment.
It's important not to us dedent here, because the code you're cutting from already starts in column 0.
| } | ||
| return true; | ||
| } | ||
| .. tabs:: |
There was a problem hiding this comment.
This needs to be
| .. tabs:: | |
| .. tabs: |
In Sphinx rst, a :: ending a text sentence means "the next indented region is code". So if we replace the ":: followed by indented region" with a .. tab:: section, we don't want that treated as a code example, we want it interpreted as commands.
| @@ -474,37 +445,14 @@ Strategy 2: Template your iterating functions based on buffer type | |||
| Consider the following alternate version of the `make_black` function | |||
| from Section `Example: Set all pixels in a region to black`_ :: | |||
There was a problem hiding this comment.
Another spot where the :: needs to change to : because we replaced intended code itself with .. tabs:: commands.
| @@ -515,22 +463,14 @@ In fact, :file:`imagebufalgo_util.h` provides a macro to do this (and | |||
| several variants, which will be discussed in more detail in the next | |||
| chapter). You could rewrite the example even more simply:: | |||
There was a problem hiding this comment.
| chapter). You could rewrite the example even more simply:: | |
| chapter). You could rewrite the example even more simply: |
lgritz
left a comment
There was a problem hiding this comment.
The bones of this are great. I made some comments to point out fixes to problems I saw when I built the docs on my end: some :: -> :, and one place where the begin/end clipping strings didn't match between the code and the docs referencing the code.
Fix those up, and the reference output of that test and we should be good to go.
|
I'm going to tackle the make texture example in the imagebufalgo doc. |
|
This PR has idled for a long time without any response to the review comments. The changes requested were fairly straightforward (though with all the time passed, it probably needs to be rebased on the current main and have any minor merge conflicts fixed up). @MichaelRCarroll-Intel Is this something you are inclined to return to? |
Description
This PR address the docs files with accompanying examples #3992.
The initial commit has c++ only to check if the PR is on the right track. Python can be added next.
docs-examples-imagebuf.cppas a one off and get sensible results.As of time of submission my company is still getting the CLA together. Expectation is this PR will help for review but be blocked from merge until CLA is resolved. Reference the #devdays slack channel 11:47a california time 20231013 Sean McDuffe thread.
Sidebar: A linux foundation appropriately put a contribution on this PR into pending. This PR is from a colleague at my company.
Thanks.
Tests
Testing was performed on Ubuntu 22.04 w/ GNU 11.4 system compiler.
Result image info and SHAs were generated with oiiotool from a build from yesterday's master branch.
Checklist:
(adding new test cases if necessary).
corresponding Python bindings (and if altering ImageBufAlgo functions, also
exposed the new functionality as oiiotool options).
already run clang-format before submitting, I definitely will look at the CI
test that runs clang-format and fix anything that it highlights as being
nonconforming.