Skip to content

Commit a07bddf

Browse files
committed
feat(IBA) scale - add KWArgs parameter
Signed-off-by: Anton Dukhovnikov <[email protected]>
1 parent 39957b6 commit a07bddf

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/include/OpenImageIO/imagebufalgo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -957,11 +957,11 @@ bool OIIO_API abs (ImageBuf &dst, const ImageBuf &A, ROI roi={}, int nthreads=0)
957957
///
958958
/// All channels of one of the images get multiplied by the value in the only channel of the other image.
959959
/// Either `A` or `B` must be a single channel image.
960-
ImageBuf OIIO_API scale (const ImageBuf &A, const ImageBuf &B, ROI roi={},
961-
int nthreads=0);
960+
ImageBuf OIIO_API scale (const ImageBuf &A, const ImageBuf &B,
961+
KWArgs options = {}, ROI roi={}, int nthreads=0);
962962
/// Write to an existing image `dst` (allocating if it is uninitialized).
963963
bool OIIO_API scale (ImageBuf &dst, const ImageBuf &A, const ImageBuf &B,
964-
ROI roi={}, int nthreads=0);
964+
KWArgs options = {}, ROI roi={}, int nthreads=0);
965965

966966

967967
/// Compute per-pixel product `A * B`, returning the result image.

src/libOpenImageIO/imagebufalgo_muldiv.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ scale_impl(ImageBuf& R, const ImageBuf& A, const ImageBuf& B, ROI roi,
4545

4646
bool
4747
ImageBufAlgo::scale(ImageBuf& dst, const ImageBuf& A, const ImageBuf& B,
48-
ROI roi, int nthreads)
48+
KWArgs options, ROI roi, int nthreads)
4949
{
5050
pvt::LoggedTimer logtime("IBA::scale");
5151
bool ok = false;
@@ -72,10 +72,11 @@ ImageBufAlgo::scale(ImageBuf& dst, const ImageBuf& A, const ImageBuf& B,
7272

7373

7474
ImageBuf
75-
ImageBufAlgo::scale(const ImageBuf& A, const ImageBuf& B, ROI roi, int nthreads)
75+
ImageBufAlgo::scale(const ImageBuf& A, const ImageBuf& B, KWArgs options,
76+
ROI roi, int nthreads)
7677
{
7778
ImageBuf result;
78-
bool ok = scale(result, A, B, roi, nthreads);
79+
bool ok = scale(result, A, B, options, roi, nthreads);
7980
if (!ok && !result.has_error())
8081
result.errorfmt("ImageBufAlgo::scale() error");
8182
return result;
@@ -149,8 +150,6 @@ ImageBufAlgo::mul(ImageBuf& dst, Image_or_Const A_, Image_or_Const B_, ROI roi,
149150
pvt::LoggedTimer logtime("IBA::mul");
150151
if (A_.is_img() && B_.is_img()) {
151152
const ImageBuf &A(A_.img()), &B(B_.img());
152-
if (A.nchannels() == 1 || B.nchannels() == 1)
153-
return scale(dst, A, B, roi, nthreads);
154153
if (!IBAprep(roi, &dst, &A, &B, IBAprep_CLAMP_MUTUAL_NCHANNELS))
155154
return false;
156155
bool ok;

0 commit comments

Comments
 (0)