-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imagebuf docs examples: c++ examples, outfile, run script, and doc (#3992) #4020
base: main
Are you sure you want to change the base?
imagebuf docs examples: c++ examples, outfile, run script, and doc (#3992) #4020
Conversation
|
Signed-off-by: Carroll, Michael R <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chapter). You could rewrite the example even more simply:: | |
chapter). You could rewrite the example even more simply: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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.cpp
as 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.