Skip to content

Commit

Permalink
Fix argument order mismatch on IBA::ociolook and ociofiletransform (A…
Browse files Browse the repository at this point in the history
…cademySoftwareFoundation#2844)

Ugh, the argument order of the headers and documentation didn't match
that of the implementation, with the inverse and unpremult args swapped.
  • Loading branch information
lgritz committed Jan 28, 2021
1 parent a2d5cd9 commit 0234b6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/libOpenImageIO/color_ocio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,8 +1657,8 @@ ImageBufAlgo::colorconvert(const ImageBuf& src, const ColorProcessor* processor,

bool
ImageBufAlgo::ociolook(ImageBuf& dst, const ImageBuf& src, string_view looks,
string_view from, string_view to, bool inverse,
bool unpremult, string_view key, string_view value,
string_view from, string_view to, bool unpremult,
bool inverse, string_view key, string_view value,
ColorConfig* colorconfig, ROI roi, int nthreads)
{
pvt::LoggedTimer logtime("IBA::ociolook");
Expand Down Expand Up @@ -1701,12 +1701,12 @@ ImageBufAlgo::ociolook(ImageBuf& dst, const ImageBuf& src, string_view looks,

ImageBuf
ImageBufAlgo::ociolook(const ImageBuf& src, string_view looks, string_view from,
string_view to, bool inverse, bool unpremult,
string_view to, bool unpremult, bool inverse,
string_view key, string_view value,
ColorConfig* colorconfig, ROI roi, int nthreads)
{
ImageBuf result;
bool ok = ociolook(result, src, looks, from, to, inverse, unpremult, key,
bool ok = ociolook(result, src, looks, from, to, unpremult, inverse, key,
value, colorconfig, roi, nthreads);
if (!ok && !result.has_error())
result.errorf("ImageBufAlgo::ociolook() error");
Expand Down Expand Up @@ -1775,7 +1775,7 @@ ImageBufAlgo::ociodisplay(const ImageBuf& src, string_view display,

bool
ImageBufAlgo::ociofiletransform(ImageBuf& dst, const ImageBuf& src,
string_view name, bool inverse, bool unpremult,
string_view name, bool unpremult, bool inverse,
ColorConfig* colorconfig, ROI roi, int nthreads)
{
pvt::LoggedTimer logtime("IBA::ociofiletransform");
Expand Down Expand Up @@ -1811,11 +1811,11 @@ ImageBufAlgo::ociofiletransform(ImageBuf& dst, const ImageBuf& src,

ImageBuf
ImageBufAlgo::ociofiletransform(const ImageBuf& src, string_view name,
bool inverse, bool unpremult,
bool unpremult, bool inverse,
ColorConfig* colorconfig, ROI roi, int nthreads)
{
ImageBuf result;
bool ok = ociofiletransform(result, src, name, inverse, unpremult,
bool ok = ociofiletransform(result, src, name, unpremult, inverse,
colorconfig, roi, nthreads);
if (!ok && !result.has_error())
result.errorf("ImageBufAlgo::ociofiletransform() error");
Expand Down
4 changes: 2 additions & 2 deletions src/oiiotool/oiiotool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2164,8 +2164,8 @@ OIIOTOOL_OP(ociofiletransform, 1, [](OiiotoolOp& op, span<ImageBuf*> img) {
string_view name = op.args(1);
bool inverse = op.options().get_int("inverse");
bool unpremult = op.options().get_int("unpremult");
return ImageBufAlgo::ociofiletransform(*img[0], *img[1], name, inverse,
unpremult, &ot.colorconfig);
return ImageBufAlgo::ociofiletransform(*img[0], *img[1], name, unpremult,
inverse, &ot.colorconfig);
});


Expand Down

0 comments on commit 0234b6d

Please sign in to comment.