diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 3afca58db..93ed24257 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -1429,11 +1429,12 @@ void DCPProfile::setStep2ApplyState(Glib::ustring workingSpace, bool useToneCurv } } -void DCPProfile::step2ApplyTile(float *rc, float *gc, float *bc, int width, int height, int tileWidth, float exp_scale) const { +void DCPProfile::step2ApplyTile(float *rc, float *gc, float *bc, int width, int height, int tileWidth) const { #define FCLIP(a) ((a)>0.0?((a)<65535.5?(a):65535.5):0.0) #define CLIP01(a) ((a)>0?((a)<1?(a):1):0) + float exp_scale = 1.0; exp_scale *= applyState.blScale; if (!applyState.useToneCurve && !applyState.applyLookTable) { if (exp_scale == 1.0) { diff --git a/rtengine/dcp.h b/rtengine/dcp.h index 0ce82b590..aeeb97e8b 100644 --- a/rtengine/dcp.h +++ b/rtengine/dcp.h @@ -87,7 +87,7 @@ namespace rtengine { void getIlluminants(int &i1, double &temp1, int &i2, double &temp2, bool &willInterpolate_) { i1 = iLightSource1; i2 = iLightSource2; temp1 = temperature1, temp2 = temperature2; willInterpolate_ = willInterpolate; }; void Apply(Imagefloat *pImg, int preferredIlluminant, Glib::ustring workingSpace, ColorTemp &wb, double pre_mul[3], double camMatrix[3][3], bool useToneCurve=false, bool applyHueSatMap=true, bool applyLookTable=false) const; void setStep2ApplyState(Glib::ustring workingSpace, bool useToneCurve, bool applyLookTable, bool applyBaselineExposure); - void step2ApplyTile(float *r, float *g, float *b, int width, int height, int tileWidth, float exp_scale) const; + void step2ApplyTile(float *r, float *g, float *b, int width, int height, int tileWidth) const; }; class DCPStore { diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 8deffe19e..cba394658 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -356,7 +356,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { //complexCurve also calculated pre-curves histogram depending on crop ipf.g = imgsrc->getGamma(); ipf.iGamma = true; - CurveFactory::complexCurve (/*params.toneCurve.expcomp*/ 0.0, params.toneCurve.black/65535.0, + CurveFactory::complexCurve (params.toneCurve.expcomp, params.toneCurve.black/65535.0, params.toneCurve.hlcompr, params.toneCurve.hlcomprthresh, params.toneCurve.shcompr, params.toneCurve.brightness, params.toneCurve.contrast, ipf.g, !ipf.iGamma, params.toneCurve.curveMode, params.toneCurve.curve, params.toneCurve.curveMode2, params.toneCurve.curve2, diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index c1ed06bea..9de6ac34c 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -2824,10 +2824,11 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, EditBuffer *e //TODO: proper treatment of out-of-gamut colors //float tonefactor = hltonecurve[(0.299f*r+0.587f*g+0.114f*b)]; - float tonefactor=((rstep2ApplyTile(rtemp, gtemp, btemp, tW-jstart, tH-istart, TS, exp_scale); + dcpProf->step2ApplyTile(rtemp, gtemp, btemp, tW-jstart, tH-istart, TS); } for (int i=istart,ti=0; igetGamma(); ipf.iGamma = true; - CurveFactory::complexCurve (0.0, black/65535.0, hlcompr, hlcomprthresh, params.toneCurve.shcompr, bright, contr, ipf.g, !ipf.iGamma, + CurveFactory::complexCurve (expcomp, black/65535.0, hlcompr, hlcomprthresh, params.toneCurve.shcompr, bright, contr, ipf.g, !ipf.iGamma, params.toneCurve.curveMode, params.toneCurve.curve, params.toneCurve.curveMode2, params.toneCurve.curve2, hist16, dummy, curve1, curve2, curve, dummy, customToneCurve1, customToneCurve2 );