Skip to content

Commit

Permalink
Move function into anonymous namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Lawrence37 committed Jun 23, 2024
1 parent 91dc97e commit 51277dc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions rtengine/rawimagesource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,16 @@ void transLineD1x(const float* const red, const float* const green, const float*
}
}

bool checkRawDataDimensions(const array2D<float> &rawData, const rtengine::RawImage &rawImage, int width, int height)
{
const int colors = (rawImage.getSensorType() == rtengine::ST_BAYER ||
rawImage.getSensorType() == rtengine::ST_FUJI_XTRANS ||
rawImage.get_colors() == 1)
? 1
: 3;
return rawData.getHeight() == height && rawData.getWidth() == colors * width;
}

}


Expand Down Expand Up @@ -742,16 +752,6 @@ void RawImageSource::getWBMults(const ColorTemp &ctemp, const RAWParams &raw, st
autoGainComp = camInitialGain / initialGain;
}

bool checkRawDataDimensions(const array2D<float> &rawData, const RawImage &rawImage, int width, int height)
{
const int colors = (rawImage.getSensorType() == rtengine::ST_BAYER ||
rawImage.getSensorType() == rtengine::ST_FUJI_XTRANS ||
rawImage.get_colors() == 1)
? 1
: 3;
return rawData.getHeight() == height && rawData.getWidth() == colors * width;
}

void RawImageSource::getImage(const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hrp, const RAWParams &raw)
{
assert(checkRawDataDimensions(rawData, *ri, W, H));
Expand Down

0 comments on commit 51277dc

Please sign in to comment.