Skip to content

Commit

Permalink
fix(IBA): demosaic - fix roi channels (#4602)
Browse files Browse the repository at this point in the history
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 <antond@wetafx.co.nz>
  • Loading branch information
antond-weta authored Jan 21, 2025
1 parent a50e7c7 commit 6206364
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/libOpenImageIO/imagebufalgo_demosaic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,12 +1019,11 @@ demosaic(ImageBuf& dst, const ImageBuf& src, KWArgs options, ROI roi,

ROI dst_roi = roi;
if (!dst_roi.defined()) {
dst_roi = src.roi();
dst_roi = src.roi();
dst_roi.chbegin = 0;
dst_roi.chend = 3;
}

dst_roi.chbegin = 0;
dst_roi.chend = 2;

ImageSpec dst_spec = src.spec();
dst_spec.nchannels = 3;
dst_spec.default_channel_names();
Expand Down Expand Up @@ -1071,7 +1070,7 @@ demosaic(ImageBuf& dst, const ImageBuf& src, KWArgs options, ROI roi,
dst.errorfmt("ImageBufAlgo::demosaic() invalid pattern");
}

return true;
return ok;
}

ImageBuf
Expand Down

0 comments on commit 6206364

Please sign in to comment.