Skip to content

Commit 8def63c

Browse files
authored
fix(api/docs): Fix IBA::set_pixels declaration and docs (#4926)
Two places where the docs and header for ImageBuf::set_pixels did not match. In one case, the docs were right, the declaration was supposed to have a parameter that was a `const image_span<T>&` but the `&` was left out. Now, if this was an actual linkable function, we wouldn't be able to fix it until a compatibility-breaking boundary. But because it's a template and inline, I believe it is actually safe to fix it in situ without breaking ABI compatibility (and it seems to pass our ABI check in CI). In the second case, the header was correct but the docs used the wrong declaration (leaving out a `const`) and made the docs fail to pull in the right explanation. Fixes #4923 Signed-off-by: Larry Gritz <[email protected]>
1 parent f6be156 commit 8def63c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/doc/imagebuf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Getting and setting pixel values
182182
.. doxygenfunction:: OIIO::ImageBuf::get_pixels(ROI, const image_span<T>&) const
183183
.. doxygenfunction:: OIIO::ImageBuf::get_pixels(ROI, TypeDesc, const image_span<std::byte>&) const
184184
.. doxygenfunction:: OIIO::ImageBuf::set_pixels(ROI, const image_span<T>&)
185-
.. doxygenfunction:: OIIO::ImageBuf::set_pixels(ROI, TypeDesc, const image_span<std::byte>&)
185+
.. doxygenfunction:: OIIO::ImageBuf::set_pixels(ROI, TypeDesc, const image_span<const std::byte>&)
186186

187187
|
188188

src/include/OpenImageIO/imagebuf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ class OIIO_API ImageBuf {
10941094
/// Return true if the operation could be completed,
10951095
/// otherwise return false.
10961096
///
1097-
template<typename T> bool set_pixels(ROI roi, const image_span<T> buffer)
1097+
template<typename T> bool set_pixels(ROI roi, const image_span<T>& buffer)
10981098
{
10991099
return set_pixels(roi, TypeDescFromC<T>::value(),
11001100
as_image_span_bytes(buffer));

0 commit comments

Comments
 (0)