Skip to content

Commit 6206364

Browse files
authored
fix(IBA): demosaic - fix roi channels (#4602)
Fixes a bug in demosaicing where the code ignores the ROI channels. The old behaviour was to always decode into the first 3 channels. Signed-off-by: Anton Dukhovnikov <[email protected]>
1 parent a50e7c7 commit 6206364

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/libOpenImageIO/imagebufalgo_demosaic.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,12 +1019,11 @@ demosaic(ImageBuf& dst, const ImageBuf& src, KWArgs options, ROI roi,
10191019

10201020
ROI dst_roi = roi;
10211021
if (!dst_roi.defined()) {
1022-
dst_roi = src.roi();
1022+
dst_roi = src.roi();
1023+
dst_roi.chbegin = 0;
1024+
dst_roi.chend = 3;
10231025
}
10241026

1025-
dst_roi.chbegin = 0;
1026-
dst_roi.chend = 2;
1027-
10281027
ImageSpec dst_spec = src.spec();
10291028
dst_spec.nchannels = 3;
10301029
dst_spec.default_channel_names();
@@ -1071,7 +1070,7 @@ demosaic(ImageBuf& dst, const ImageBuf& src, KWArgs options, ROI roi,
10711070
dst.errorfmt("ImageBufAlgo::demosaic() invalid pattern");
10721071
}
10731072

1074-
return true;
1073+
return ok;
10751074
}
10761075

10771076
ImageBuf

0 commit comments

Comments
 (0)