Skip to content

Commit

Permalink
hioOiio: update usage of deprecated version of ImageInput::read_image()
Browse files Browse the repository at this point in the history
As of OpenImageIO v3.0.0.3, a set of deprecated overloads of
ImageInput::read_image() were removed. This change unrolls
the overload that was being used into its equivalent in the
current API.
  • Loading branch information
mattyjams committed Nov 11, 2024
1 parent 29d955f commit 4b919c6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions pxr/imaging/plugin/hioOiio/oiioImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,13 +713,27 @@ HioOIIO_Image::ReadCropped(int const cropTop,
// If needed, convert double precision images to float
bool res = false;
if (imageInput->spec().format == TypeDesc::DOUBLE) {
res = imageInput->read_image(TypeDesc::FLOAT,
res = imageInput->read_image(
#if OIIO_VERSION >= 30000
imageInput->current_subimage(),
imageInput->current_miplevel(),
0,
-1,
#endif
TypeDesc::FLOAT,
start,
AutoStride,
readStride,
AutoStride);
} else{
res = imageInput->read_image(imageInput->spec().format,
res = imageInput->read_image(
#if OIIO_VERSION >= 30000
imageInput->current_subimage(),
imageInput->current_miplevel(),
0,
-1,
#endif
imageInput->spec().format,
start,
AutoStride,
readStride,
Expand Down

0 comments on commit 4b919c6

Please sign in to comment.