Skip to content

Commit

Permalink
Expose bitdepth to ImProcCoordinator
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanatomanic committed Jun 12, 2021
1 parent df60590 commit a11dffd
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 1 deletion.
5 changes: 5 additions & 0 deletions rtengine/imagesource.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ class ImageSource : public InitialImage
virtual void WBauto(double &tempref, double &greenref, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &studgood, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw) = 0;
virtual void getrgbloc(int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w) = 0;

virtual unsigned int getBitDepth() const
{
return 0;
}

virtual double getDefGain () const
{
return 1.0;
Expand Down
4 changes: 3 additions & 1 deletion rtengine/improccoordinator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ ImProcCoordinator::ImProcCoordinator() :
histGreen(65536), histGreenRaw(65536),
histBlue(65536), histBlueRaw(65536),
histLuma(65536),
histChroma(65536),

histToneCurve(256),
histToneCurveBW(256),
Expand All @@ -117,6 +116,7 @@ ImProcCoordinator::ImProcCoordinator() :
histCCAM(256),
histClad(256),
bcabhist(256),
histChroma(65536),

histLRETI(256),

Expand Down Expand Up @@ -1810,6 +1810,8 @@ void ImProcCoordinator::notifyHistogramChanged()
bool ImProcCoordinator::updateLRGBHistograms()
{

printf("%u bit image - update histogram\n",imgsrc->getBitDepth());

if (!hist_lrgb_dirty) {
return false;
}
Expand Down
5 changes: 5 additions & 0 deletions rtengine/rawimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ class RawImage: public DCraw
{
return fuji_width;
}

unsigned int get_bitdepth() const
{
return tiff_bps;
}

float const * get_FloatRawImage() const
{
Expand Down
5 changes: 5 additions & 0 deletions rtengine/rawimagesource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,11 @@ int RawImageSource::getRotateDegree() const
return ri->get_rotateDegree();
}

unsigned int RawImageSource::getBitDepth() const
{
return ri->get_bitdepth();
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

void RawImageSource::transformRect (const PreviewProps &pp, int tran, int &ssx1, int &ssy1, int &width, int &height, int &fw)
Expand Down
2 changes: 2 additions & 0 deletions rtengine/rawimagesource.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ class RawImageSource final : public ImageSource
void getSize (const PreviewProps &pp, int& w, int& h) override;
int getRotateDegree() const override;

unsigned int getBitDepth() const override;

ImageMatrices* getImageMatrices () override
{
return &imatrices;
Expand Down
5 changes: 5 additions & 0 deletions rtengine/stdimagesource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ void StdImageSource::getSize (const PreviewProps &pp, int& w, int& h)
h = pp.getHeight() / pp.getSkip() + (pp.getHeight() % pp.getSkip() > 0);
}

unsigned int StdImageSource::getBitDepth() const
{
return img->getBPS();
}

void StdImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr)
{
if (img->getType() == sImage8) {
Expand Down
2 changes: 2 additions & 0 deletions rtengine/stdimagesource.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ class StdImageSource : public ImageSource
void getFullSize (int& w, int& h, int tr = TR_NONE) override;
void getSize (const PreviewProps &pp, int& w, int& h) override;

unsigned int getBitDepth() const override;

ImageIO* getImageIO ()
{
return img;
Expand Down

0 comments on commit a11dffd

Please sign in to comment.