Skip to content

Commit

Permalink
GenericReader: also pass remappedComponents to decodePlane()
Browse files Browse the repository at this point in the history
trying to fix NatronGitHub/Natron#756 which is caused by the change introduced in d48adf0 to fix NatronGitHub/Natron#714
  • Loading branch information
devernay committed Jan 21, 2022
1 parent 2e2bffd commit c6ad47b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions IOSupport/GenericReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,7 @@ GenericReaderPlugin::render(const RenderArguments &args)
if (!_isMultiPlanar) {
decode(filename, sequenceTime, args.renderView, args.sequentialRenderStatus, args.renderWindow, args.renderScale, it->pixelData, firstBounds, it->comps, it->numChans, it->rowBytes);
} else {
decodePlane(filename, sequenceTime, args.renderView, args.sequentialRenderStatus, args.renderWindow, args.renderScale, it->pixelData, firstBounds, it->comps, it->numChans, it->rawComps, it->rowBytes);
decodePlane(filename, sequenceTime, args.renderView, args.sequentialRenderStatus, args.renderWindow, args.renderScale, it->pixelData, firstBounds, it->comps, remappedComponents, it->numChans, it->rawComps, it->rowBytes);
}
} else {
int pixelBytes;
Expand Down Expand Up @@ -1836,7 +1836,7 @@ GenericReaderPlugin::render(const RenderArguments &args)
if (!_isMultiPlanar) {
decode(filename, sequenceTime, args.renderView, args.sequentialRenderStatus, renderWindowFullRes, args.renderScale, tmpPixelData, renderWindowFullRes, it->comps, it->numChans, tmpRowBytes);
} else {
decodePlane(filename, sequenceTime, args.renderView, args.sequentialRenderStatus, renderWindowFullRes, args.renderScale, tmpPixelData, renderWindowFullRes, it->comps, it->numChans, it->rawComps, tmpRowBytes);
decodePlane(filename, sequenceTime, args.renderView, args.sequentialRenderStatus, renderWindowFullRes, args.renderScale, tmpPixelData, renderWindowFullRes, it->comps, remappedComponents, it->numChans, it->rawComps, tmpRowBytes);
}

if ( abort() ) {
Expand Down Expand Up @@ -1939,6 +1939,7 @@ GenericReaderPlugin::decodePlane(const string& /*filename*/,
float */*pixelData*/,
const OfxRectI& /*bounds*/,
PixelComponentEnum /*pixelComponents*/,
PixelComponentEnum /*remappedComponents*/,
int /*pixelComponentCount*/,
const string& /*rawComponents*/,
int /*rowBytes*/)
Expand Down
3 changes: 2 additions & 1 deletion IOSupport/GenericReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ class GenericReaderPlugin
**/
virtual void decode(const std::string& filename, OfxTime time, int view, bool isPlayback, const OfxRectI& renderWindow, const OfxPointD& renderScale, float *pixelData, const OfxRectI& bounds, OFX::PixelComponentEnum pixelComponents, int pixelComponentCount, int rowBytes);
virtual void decodePlane(const std::string& filename, OfxTime time, int view, bool isPlayback, const OfxRectI& renderWindow, const OfxPointD& renderScale, float *pixelData, const OfxRectI& bounds,
OFX::PixelComponentEnum pixelComponents, int pixelComponentCount, const std::string& rawComponents, int rowBytes);
OFX::PixelComponentEnum pixelComponents, OFX::PixelComponentEnum remappedComponents,
int pixelComponentCount, const std::string& rawComponents, int rowBytes);


/**
Expand Down
6 changes: 4 additions & 2 deletions OIIO/ReadOIIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,12 @@ class ReadOIIOPlugin

return;
}
decodePlane(filename, time, view, isPlayback, renderWindow, renderScale, pixelData, bounds, pixelComponents, pixelComponentCount, rawComps, rowBytes);
decodePlane(filename, time, view, isPlayback, renderWindow, renderScale, pixelData, bounds, pixelComponents, pixelComponents, pixelComponentCount, rawComps, rowBytes);
}

virtual void decodePlane(const string& filename, OfxTime time, int view, bool isPlayback, const OfxRectI& renderWindow, const OfxPointD& renderScale, float *pixelData, const OfxRectI& bounds,
PixelComponentEnum pixelComponents, int pixelComponentCount, const string& rawComponents, int rowBytes) OVERRIDE FINAL;
PixelComponentEnum pixelComponents, PixelComponentEnum remappedComponents,
int pixelComponentCount, const string& rawComponents, int rowBytes) OVERRIDE FINAL;

void getOIIOChannelIndexesFromLayerName(const string& filename, int view, const string& layerName, PixelComponentEnum pixelComponents, const vector<ImageSpec>& subimages, vector<int>& channels, int& numChannels, int& subImageIndex);

Expand Down Expand Up @@ -2245,6 +2246,7 @@ ReadOIIOPlugin::decodePlane(const string& filename,
float *pixelData,
const OfxRectI& bounds,
PixelComponentEnum pixelComponents,
PixelComponentEnum remappedComponents,
int pixelComponentCount,
const string& rawComponents,
int rowBytes)
Expand Down

0 comments on commit c6ad47b

Please sign in to comment.