From 9d31c6ad190af50975f9f5b44e50611fefc7761d Mon Sep 17 00:00:00 2001 From: Emil Martinec Date: Sun, 17 Oct 2010 14:55:40 -0500 Subject: [PATCH] Changes to Exposure tab. Exposure controls (blackpoint, brightness, contrast, S/H compression) are now implemented with NURBS curves. Brightness bug seems fixed as a consequence. Luminance tone curve has been expanded to separate curves for L,a,b; saturation slider has been added, but at the moment saturation limiting has not been implemented in the modified tool. --- rtdata/languages/default | 14 +- rtengine/curves.cc | 371 +++++++++++++++++++++++++++++++++- rtengine/curves.h | 6 +- rtengine/dcraw.cc | 4 +- rtengine/dcrop.cc | 5 +- rtengine/improccoordinator.cc | 16 +- rtengine/improccoordinator.h | 4 +- rtengine/improcfun.cc | 18 +- rtengine/improcfun.h | 1 + rtengine/procevents.h | 9 +- rtengine/procparams.cc | 40 ++-- rtengine/procparams.h | 7 +- rtengine/refreshmap.cc | 9 +- rtengine/rtthumbnail.cc | 8 +- rtengine/simpleprocess.cc | 7 +- rtgui/CMakeLists.txt | 2 +- rtgui/addsetids.h | 2 + rtgui/batchqueue.cc | 4 +- rtgui/batchtoolpanelcoord.cc | 9 +- rtgui/paramsedited.cc | 29 ++- rtgui/paramsedited.h | 7 +- rtgui/partialpastedlg.cc | 14 +- rtgui/partialpastedlg.h | 4 +- rtgui/preferences.cc | 7 +- rtgui/tonecurve.cc | 4 +- rtgui/toolpanelcoord.cc | 2 +- rtgui/toolpanelcoord.h | 2 +- 27 files changed, 517 insertions(+), 88 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 43b0c5f56..f5cdf0829 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -367,7 +367,7 @@ PARTIALPASTE_HLRECOVERY;Highlight recovery PARTIALPASTE_ICMSETTINGS;ICM settings PARTIALPASTE_IPTCINFO;IPTC info PARTIALPASTE_LENSGROUP;Lens related settings -PARTIALPASTE_LUMACURVE;Luminance curve +PARTIALPASTE_LABCURVE;Luminance curve PARTIALPASTE_LUMADENOISE;Luminance noise reduction PARTIALPASTE_LUMINANCEGROUP;Luminance related settings PARTIALPASTE_METAICMGROUP;Metadata/ICM settings @@ -626,13 +626,11 @@ TP_IMPULSEDENOISE_THRESH;Threshold TP_LENSGEOM_AUTOCROP;Auto Crop TP_LENSGEOM_FILL;Auto Fill TP_LENSGEOM_LABEL;Lens / Geometry -TP_LUMACURVE_BLACKLEVEL;Black -TP_LUMACURVE_BRIGHTNESS;Brightness -TP_LUMACURVE_COMPRHIGHLIGHTS;Highlight compression -TP_LUMACURVE_COMPRSHADOWS;Shadow compression -TP_LUMACURVE_CONTRAST;Contrast -TP_LUMACURVE_CURVEEDITOR;Luminance Curve -TP_LUMACURVE_LABEL;Luminance Curve +TP_LABCURVE_BRIGHTNESS;Brightness +TP_LABCURVE_CONTRAST;Contrast +TP_LABCURVE_CURVEEDITOR;Luminance Curve +TP_LABCURVE_LABEL;Luminance Curve +TP_LABCURVE_SATURATION;Saturation TP_LUMADENOISE_EDGETOLERANCE;Edge Tolerance TP_LUMADENOISE_LABEL;Luminance Noise Reduction TP_LUMADENOISE_RADIUS;Radius diff --git a/rtengine/curves.cc b/rtengine/curves.cc index baccb69f8..c1c1eded2 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -421,8 +421,11 @@ if (igamma) { delete [] dcurve; }*/ +/* void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, double shcompr, double br, double contr, double defmul, double gamma_, bool igamma, const std::vector& curvePoints, unsigned int* histogram, int* outCurve, unsigned int* outBeforeCCurveHistogram, int skip) { + printf ("ecomp= %f black= %f hlcompr= %f shcompr= %f br= %f contr= %f defmul= %f gamma= %f, skip= %d \n",ecomp,black,hlcompr,shcompr,br,contr,defmul,gamma_,skip); + double def_mul = pow (2.0, defmul); // compute parameters of the gamma curve @@ -432,7 +435,7 @@ void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, dou double add = 0.099; // theoretical maximum of the curve - double D = /* gamma_>0 ? gamma (def_mul, gamma_, start, slope, mul, add) : */ def_mul; + double D = def_mul; // a: slope of the curve, black: starting point at the x axis double a = pow (2.0, ecomp); @@ -454,9 +457,6 @@ void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, dou // clear array that stores histogram valid before applying the custom curve if (outBeforeCCurveHistogram) memset (outBeforeCCurveHistogram, 0, 256*sizeof(int)); - - //float atmp=a; - //a = 1; for (int i=0; i<=0xffff; i+= i<0xffff-skip ? skip : 1 ) { @@ -465,13 +465,7 @@ void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, dou // apply default multiplier (that is >1 if highlight recovery is on) val *= def_mul; - - //exposure compensation - //val *= atmp; - //black *= atmp; - //D *= atmp; - - + // apply base curve, thus, exposure compensation and black point with shadow and highlight protection val = basecurve (val, a, black, D, hlcompr/100.0, shcompr/100.0); @@ -543,7 +537,362 @@ void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, dou outCurve[i] = (int) (65535.0 * dcurve[i]); delete [] dcurve; } +*/ +/* + void CurveFactory::complexsgnCurve (double satclip, double satcompr, double saturation, double colormult, const std::vector& curvePoints, int* outCurve, int skip) { + + //colormult = chroma_scale for Lab manipulations + + bool needsaturation = (saturation<-0.0001 || saturation>0.0001); + + // curve without contrast + double* dcurve = new double[65536]; + + // create a curve if needed + Curve* tcurve = NULL; + if (curvePoints.size()>0 && curvePoints[0]!=0) + tcurve = new Curve (curvePoints, CURVES_MIN_POLY_POINTS/skip); + + for (int i=0; i<=0xffff; i+= i<0xffff-skip ? skip : 1 ) { + + // change to [0,1] range + double val = (double)i / 65535.0; + + // apply default multiplier (that is >1 if highlight recovery is on) + val *= colormult; + + // apply base curve, thus, exposure compensation and black point with shadow and highlight protection + //val = basecurve (val, 1.0, 0, colormult, satcompr/100.0, satcompr/100.0); + + // apply custom/parametric/NURBS curve, if any + if (tcurve) { + val = tcurve->getVal (val); + } + + // store result in a temporary array + dcurve[i] = CLIPD(val); + } + delete tcurve; + + // if skip>1, let apply linear interpolation in the skipped points of the curve + int prev = 0; + for (int i=1; i<=0xffff-skip; i++) { + if (i%skip==0) { + prev+=skip; + continue; + } + dcurve[i] = ( dcurve[prev] * (skip - i%skip) + dcurve[prev+skip] * (i%skip) ) / skip; + } + + if (needsaturation) { + float avg = 0.5; + + // compute contrast parameter + double saturation_b = saturation / 20; + if (saturation_b>=0 && saturation_b < 0.00001) + saturation_b = 0.00001; + else if (saturation_b<0 && saturation_b > -0.00001) + saturation_b = -0.00001; + + // apply contrast enhancement + for (int i=0; i<=0xffff; i++) { + double val = centercontrast (dcurve[i], saturation_b, avg); + outCurve[i] = (int) (65535.0 * CLIPD(val)); + } + } + else + for (int i=0; i<=0xffff; i++) + outCurve[i] = (int) (65535.0 * dcurve[i]); + delete [] dcurve; + } + */ + void CurveFactory::complexsgnCurve (double satclip, double satcompr, double saturation, double colormult, const std::vector& curvePoints, int* outCurve, int skip) { + + //colormult = chroma_scale for Lab manipulations + + // check if contrast curve is needed + bool needsaturation = (saturation<-0.0001 || saturation>0.0001); + + // curve without contrast + double* dcurve = new double[65536]; + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + std::vector satcurvePoints; + satcurvePoints.push_back((double)((CurveType)NURBS)); + if (saturation>-99.5) { + satcurvePoints.push_back(0); //black point. Value in [0 ; 1] range + satcurvePoints.push_back(0); //black point. Value in [0 ; 1] range + + satcurvePoints.push_back(0.25+saturation/500.0); //toe point + satcurvePoints.push_back(0.25-saturation/500.0); //value at toe point + + satcurvePoints.push_back(0.75-saturation/500.0); //shoulder point + satcurvePoints.push_back(0.75+saturation/500.0); //value at shoulder point + + satcurvePoints.push_back(1); // white point + satcurvePoints.push_back(1); // value at white point + } else { + satcurvePoints.push_back(0); + satcurvePoints.push_back(0.5); + + satcurvePoints.push_back(1); + satcurvePoints.push_back(0.5); + } + Curve* satcurve = NULL; + satcurve = new Curve (satcurvePoints, CURVES_MIN_POLY_POINTS/skip); // Actually, CURVES_MIN_POLY_POINTS = 1000, + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + // create a curve if needed + Curve* tcurve = NULL; + if (curvePoints.size()>0 && curvePoints[0]!=0) + tcurve = new Curve (curvePoints, CURVES_MIN_POLY_POINTS/skip); + + for (int i=0; i<=0xffff; i+= i<0xffff-skip ? skip : 1 ) { + + // change to [0,1] range + double val = (double)i / 65535.0; + + // apply default multiplier (that is >1 if highlight recovery is on) + val *= colormult; + + // apply saturation curve + if (needsaturation) + val = satcurve->getVal (val); + + // apply custom/parametric/NURBS curve, if any + if (tcurve) { + val = tcurve->getVal (val); + } + + // store result in a temporary array + dcurve[i] = CLIPD(val); + } + delete tcurve; + + // if skip>1, let apply linear interpolation in the skipped points of the curve + int prev = 0; + for (int i=1; i<=0xffff-skip; i++) { + if (i%skip==0) { + prev+=skip; + continue; + } + dcurve[i] = ( dcurve[prev] * (skip - i%skip) + dcurve[prev+skip] * (i%skip) ) / skip; + } + + for (int i=0; i<=0xffff; i++) + outCurve[i] = (int) (65535.0 * dcurve[i]); + delete [] dcurve; + delete satcurve; + } + + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, double shcompr, double br, double contr, double defmul, double gamma_, bool igamma, const std::vector& curvePoints, unsigned int* histogram, int* outCurve, unsigned int* outBeforeCCurveHistogram, int skip) { + + printf ("ecomp= %f black= %f hlcompr= %f shcompr= %f br= %f contr= %f defmul= %f gamma= %f, skip= %d \n",ecomp,black,hlcompr,shcompr,br,contr,defmul,gamma_,skip); + + double def_mul = pow (2.0, defmul); + + // compute parameters of the gamma curve + double start = exp(gamma_*log( -0.099 / ((1.0/gamma_-1.0)*1.099 ))); + double slope = 1.099 * pow (start, 1.0/gamma_-1) - 0.099/start; + double mul = 1.099; + double add = 0.099; + + // theoretical maximum of the curve + double D = def_mul; + + // a: slope of the curve, black: starting point at the x axis + double a = pow (2.0, ecomp); + + // curve without contrast + double* dcurve = new double[65536]; + + // check if contrast curve is needed + bool needcontrast = contr>0.00001 || contr<-0.00001; + + // check if inverse gamma is needed at the end + bool needigamma = !needcontrast && igamma && gamma_>0; + + // create a curve if needed + Curve* tcurve = NULL; + if (curvePoints.size()>0 && curvePoints[0]!=0) + tcurve = new Curve (curvePoints, CURVES_MIN_POLY_POINTS/skip); + + // clear array that stores histogram valid before applying the custom curve + if (outBeforeCCurveHistogram) + memset (outBeforeCCurveHistogram, 0, 256*sizeof(int)); + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + // tone curve base. a: slope (from exp.comp.), b: black, D: max. x value (can be>1), hr,sr: highlight,shadow recovery + + std::vector basecurvePoints; + basecurvePoints.push_back((double)((CurveType)NURBS)); + float toex = black/a; + float toey = black*(1-shcompr/100.0); + float shoulderx = toex+(1-toey)/a; + float shouldery; + if (shoulderx<1) { + shouldery = 1-(1-shoulderx)*(1-hlcompr/100.0); + shoulderx = shoulderx - (1-shouldery)/a; + } else { + shoulderx = 1; + shouldery = toey + (1-toex)*a; + } + + basecurvePoints.push_back(0); //black point. Value in [0 ; 1] range + basecurvePoints.push_back(0); //black point. Value in [0 ; 1] range + + basecurvePoints.push_back(toex); //toe point + basecurvePoints.push_back(toey); //value at toe point + + basecurvePoints.push_back(0.25*toex+0.75*shoulderx); //toe point + basecurvePoints.push_back(0.25*toey+0.75*shouldery); //value at toe point + + basecurvePoints.push_back(shoulderx); //shoulder point + basecurvePoints.push_back(shouldery); //value at shoulder point + + basecurvePoints.push_back(1); // white point + basecurvePoints.push_back(1); // value at white point + + Curve* basecurve = NULL; + basecurve = new Curve (basecurvePoints, CURVES_MIN_POLY_POINTS/skip); // Actually, CURVES_MIN_POLY_POINTS = 1000, + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + std::vector brightcurvePoints; + brightcurvePoints.push_back((double)((CurveType)NURBS)); + + brightcurvePoints.push_back(0); //black point. Value in [0 ; 1] range + brightcurvePoints.push_back(0); //black point. Value in [0 ; 1] range + + brightcurvePoints.push_back(0.1); //toe point + brightcurvePoints.push_back(0.1+br/150.0); //value at toe point + + brightcurvePoints.push_back(0.7); //shoulder point + brightcurvePoints.push_back(MIN(1.0,0.7+br/300.0)); //value at shoulder point + + brightcurvePoints.push_back(1); // white point + brightcurvePoints.push_back(1); // value at white point + + Curve* brightcurve = NULL; + brightcurve = new Curve (brightcurvePoints, CURVES_MIN_POLY_POINTS/skip); // Actually, CURVES_MIN_POLY_POINTS = 1000, + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + for (int i=0; i<=0xffff; i+= i<0xffff-skip ? skip : 1 ) { + + // change to [0,1] range + double val = (double)i / 65535.0; + + // apply default multiplier (that is >1 if highlight recovery is on) + val *= def_mul; + + // apply base curve, thus, exposure compensation and black point with shadow and highlight protection + //val = basecurve (val, a, black, D, hlcompr/100.0, shcompr/100.0); + val = basecurve->getVal (val); + + // gamma correction + if (gamma_>0) + val = gamma (val, gamma_, start, slope, mul, add); + + // apply brightness curve + //val = brightness (val, br/100.0); + val = brightcurve->getVal (val); + + // apply custom/parametric/NURBS curve, if any + if (tcurve) { + if (outBeforeCCurveHistogram) { + double hval = val; + //if (needigamma) + // hval = igamma2 (hval); + int hi = (int)(255.0*CLIPD(hval)); + outBeforeCCurveHistogram[hi]+=histogram[i] ; + } + val = tcurve->getVal (val); + } + + // if inverse gamma is needed, do it (standard sRGB inverse gamma is applied) + if (needigamma) + val = igamma2 (val); + + // store result in a temporary array + dcurve[i] = CLIPD(val); + } + delete tcurve; + + delete basecurve; // ...when you don't need it anymore + delete brightcurve; + + // if skip>1, let apply linear interpolation in the skipped points of the curve + int prev = 0; + for (int i=1; i<=0xffff-skip; i++) { + if (i%skip==0) { + prev+=skip; + continue; + } + dcurve[i] = ( dcurve[prev] * (skip - i%skip) + dcurve[prev+skip] * (i%skip) ) / skip; + } + + if (needcontrast) { + // compute mean luminance of the image with the curve applied + int sum = 0; + double avg = 0; + //double sqavg = 0; + for (int i=0; i<=0xffff; i++) { + avg += dcurve[i] * histogram[i]; + //sqavg += dcurve[i]*dcurve[i] * histogram[i]; + sum += histogram[i]; + } + avg /= sum; + //sqavg /= sum; + //double stddev = sqrt(sqavg-avg*avg); + float contrslope = (50)/(50-0.25*contr); + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + std::vector contrastcurvePoints; + contrastcurvePoints.push_back((double)((CurveType)NURBS)); + + contrastcurvePoints.push_back(0); //black point. Value in [0 ; 1] range + contrastcurvePoints.push_back(0); //black point. Value in [0 ; 1] range + + contrastcurvePoints.push_back(avg*(1-1/contrslope)); //toe point + contrastcurvePoints.push_back(0); //value at toe point + + contrastcurvePoints.push_back(avg); //mid point + contrastcurvePoints.push_back(avg); //value at mid point + + contrastcurvePoints.push_back(avg+(1-avg)/contrslope); // shoulder point + contrastcurvePoints.push_back(1); // value at shoulder point + + contrastcurvePoints.push_back(1); // white point + contrastcurvePoints.push_back(1); // value at white point + + Curve* contrastcurve = NULL; + contrastcurve = new Curve (contrastcurvePoints, CURVES_MIN_POLY_POINTS/skip); // Actually, CURVES_MIN_POLY_POINTS = 1000, + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + // apply contrast enhancement + for (int i=0; i<=0xffff; i++) { + //double val = centercontrast (dcurve[i], contr_b, avg); + double val = contrastcurve->getVal (dcurve[i]); + if (igamma && gamma_>0) + val = igamma2 (val); + outCurve[i] = (int) (65535.0 * CLIPD(val)); + } + } + else + for (int i=0; i<=0xffff; i++) + outCurve[i] = (int) (65535.0 * dcurve[i]); + delete [] dcurve; + } + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + int CurveFactory::gammatab [65536]; int CurveFactory::igammatab_srgb [65536]; diff --git a/rtengine/curves.h b/rtengine/curves.h index 59b3a326d..827f997e2 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -75,7 +75,7 @@ class CurveFactory { return 1.0 - cupper(1.0-x, m, sr); } // tone curve base. a: slope (from exp.comp.), b: black, D: max. x value (can be>1), hr,sr: highlight,shadow recovery - static inline double basecurve (double x, double a, double b, double D, double hr, double sr) { + /* static inline double basecurve (double x, double a, double b, double D, double hr, double sr) { double m = b+0.5/a& cpoints, double defmul, double ecomp, int black, double hlcompr, double shcompr, double br, double contr, double gamma_, bool igamma, int skip=1); static void complexCurve (double ecomp, double black, double hlcompr, double shcompr, double br, double contr, double defmul, double gamma_, bool igamma, const std::vector& curvePoints, unsigned int* histogram, int* outCurve, unsigned int* outBeforeCCurveHistogram, int skip=1); + static void complexsgnCurve (double satclip, double satcompr, double saturation, double colormult, const std::vector& curvePoints, int* outCurve, int skip); }; diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index e5b732581..6e20f50fd 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -6892,6 +6892,8 @@ void CLASS identify() if (height == 3136 && width == 4736) /* Pentax K-7 */ { height = 3122; width = 4684; top_margin = 2; filters = 0x16161616; } + if (height == 2868 && width == 4352) /* Pentax K-x */ + width = 4308; if (height == 3014 && width == 4096) /* Ricoh GX200 */ width = 4014; if (dng_version) { @@ -7439,7 +7441,7 @@ konica_400z: } else if (!strcmp(model,"K20D")) { filters = 0x16161616; } else if (!strcmp(model,"K-x")) { - width = 4309; + width = 4308; filters = 0x16161616; } else if (!strcmp(model,"Optio S")) { if (fsize == 3178560) { diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index a0462594d..3d873c396 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -164,7 +164,10 @@ void Crop::update (int todo, bool internal) { // apply luminance operations if (todo & (M_LUMINANCE+M_COLOR)) { parent->ipf.luminanceCurve (laboCrop, labnCrop, parent->lumacurve, 0, croph); - parent->ipf.colorCurve (laboCrop, labnCrop); + parent->ipf.chrominanceCurve (laboCrop, labnCrop, 0, parent->chroma_acurve, 0, croph); + parent->ipf.chrominanceCurve (laboCrop, labnCrop, 1, parent->chroma_bcurve, 0, croph); + + //parent->ipf.colorCurve (laboCrop, labnCrop); if (skip==1) { parent->ipf.impulsedenoise (labnCrop); diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 38b9d5b1d..c3f3fe67d 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -155,9 +155,13 @@ void ImProcCoordinator::updatePreviewImage (int todo) { } readyphase++; - if (todo & M_LUMACURVE) - CurveFactory::complexCurve (0.0, 0.0, 0.0, 0.0, params.lumaCurve.brightness, params.lumaCurve.contrast, 0.0, 0.0, false, params.lumaCurve.curve, lhist16, lumacurve, bcLhist, scale==1 ? 1 : 16); - + if (todo & M_LUMACURVE) { + CurveFactory::complexCurve (0.0, 0.0, 0.0, 0.0, params.labCurve.brightness, params.labCurve.contrast, 0.0, 0.0, false, params.labCurve.lcurve, lhist16, lumacurve, bcLhist, scale==1 ? 1 : 16); + CurveFactory::complexsgnCurve (0.0, 100.0, params.labCurve.saturation, 1.0, params.labCurve.acurve, chroma_acurve, scale==1 ? 1 : 16); + CurveFactory::complexsgnCurve (0.0, 100.0, params.labCurve.saturation, 1.0, params.labCurve.bcurve, chroma_bcurve, scale==1 ? 1 : 16); + } + + /* if (todo & M_LUMINANCE) { progress ("Applying Luminance Curve...",100*readyphase/numofphases); @@ -209,9 +213,13 @@ void ImProcCoordinator::updatePreviewImage (int todo) { if (todo & (M_LUMINANCE+M_COLOR) ) { progress ("Applying Luminance Curve...",100*readyphase/numofphases); ipf.luminanceCurve (oprevl, nprevl, lumacurve, 0, pH); + readyphase++; progress ("Applying Color Boost...",100*readyphase/numofphases); - ipf.colorCurve (oprevl, nprevl); + //ipf.colorCurve (oprevl, nprevl); + ipf.chrominanceCurve (oprevl, nprevl, 0, chroma_acurve, 0, pH); + ipf.chrominanceCurve (oprevl, nprevl, 1, chroma_bcurve, 0, pH); + readyphase++; if (scale==1) { progress ("Denoising luminance impulse...",100*readyphase/numofphases); diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 01be6df96..49ef294d0 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -63,11 +63,13 @@ class ImProcCoordinator : public StagedImageProcessor { int tonecurve [65536]; int lumacurve [65536]; + int chroma_acurve [65536]; + int chroma_bcurve [65536]; unsigned int vhist16[65536]; unsigned int lhist16[65536]; - unsigned int rhist[256], ghist[256], bhist[256], Lhist[256], bcrgbhist[256], bcLhist[256]; + unsigned int rhist[256], ghist[256], bhist[256], Lhist[256], bcrgbhist[256], bcLhist[256], bcabhist[256]; int fw, fh, tr, fullw, fullh; int pW, pH; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 7b11e1a79..ead3807df 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -344,11 +344,27 @@ void ImProcFunctions::rgbProc (Image16* working, LabImage* lab, int* tonecurve, void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, int* curve, int row_from, int row_to) { int W = lold->W; - int H = lold->H; + //int H = lold->H; for (int i=row_from; iL[i][j] = curve[lold->L[i][j]]; } + + void ImProcFunctions::chrominanceCurve (LabImage* lold, LabImage* lnew, int channel, int* curve, int row_from, int row_to) { + + int W = lold->W; + //int H = lold->H; + if (channel==0) { + for (int i=row_from; ia[i][j] = curve[lold->a[i][j]+32768]-32768; + } + if (channel==1) { + for (int i=row_from; ib[i][j] = curve[lold->b[i][j]+32768]-32768; + } + } #include "cubic.cc" diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index d065cfac3..cdef8b7b2 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -81,6 +81,7 @@ class ImProcFunctions { void firstAnalysis (Image16* working, const ProcParams* params, unsigned int* vhist16, double gamma); void rgbProc (Image16* working, LabImage* lab, int* tonecurve, SHMap* shmap); void luminanceCurve (LabImage* lold, LabImage* lnew, int* curve, int row_from, int row_to); + void chrominanceCurve (LabImage* lold, LabImage* lnew, int channel, int* curve, int row_from, int row_to); void colorCurve (LabImage* lold, LabImage* lnew); void sharpening (LabImage* lab, unsigned short** buffer); void lumadenoise (LabImage* lab, int** buffer); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 65e1d79ba..606f71d3b 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -21,7 +21,7 @@ #include -#define NUMOFEVENTS 94 +#define NUMOFEVENTS 97 namespace rtengine { @@ -45,7 +45,7 @@ enum ProcEvent { EvLBlack=15, EvLHLCompr=16, EvLSHCompr=17, - EvLCurve=18, + EvLLCurve=18, EvShrEnabled=19, EvShrRadius=20, EvShrAmount=21, @@ -120,7 +120,10 @@ enum ProcEvent { EvDPDNChroma=90, EvDPDNGamma=91, EvDirPyrEqualizer=92, - EvDirPyrEqlEnabled=93 + EvDirPyrEqlEnabled=93, + EvLSaturation=94, + EvLaCurve=95, + EvLbCurve=96, }; } #endif diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 8e1655b4e..9171e7e1d 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -55,9 +55,12 @@ void ProcParams::setDefaults () { toneCurve.shcompr = 85; toneCurve.curve.clear (); - lumaCurve.brightness = 0; - lumaCurve.contrast = 0; - lumaCurve.curve.clear (); + labCurve.brightness = 0; + labCurve.contrast = 0; + labCurve.saturation = 0; + labCurve.lcurve.clear (); + labCurve.acurve.clear (); + labCurve.bcurve.clear (); sharpening.enabled = true; sharpening.radius = 1.0; @@ -212,10 +215,15 @@ int ProcParams::save (Glib::ustring fname) const { keyFile.set_integer_list("Channel Mixer", "Blue", bmix); // save luma curve - keyFile.set_integer ("Luminance Curve", "Brightness", lumaCurve.brightness); - keyFile.set_integer ("Luminance Curve", "Contrast", lumaCurve.contrast); - Glib::ArrayHandle lcurve = lumaCurve.curve; - keyFile.set_double_list("Luminance Curve", "Curve", lcurve); + keyFile.set_integer ("Luminance Curve", "Brightness", labCurve.brightness); + keyFile.set_integer ("Luminance Curve", "Contrast", labCurve.contrast); + keyFile.set_integer ("Luminance Curve", "Saturation", labCurve.saturation); + Glib::ArrayHandle lcurve = labCurve.lcurve; + Glib::ArrayHandle acurve = labCurve.acurve; + Glib::ArrayHandle bcurve = labCurve.bcurve; + keyFile.set_double_list("Luminance Curve", "LCurve", lcurve); + keyFile.set_double_list("Luminance Curve", "aCurve", acurve); + keyFile.set_double_list("Luminance Curve", "bCurve", bcurve); // save sharpening keyFile.set_boolean ("Sharpening", "Enabled", sharpening.enabled); @@ -427,10 +435,13 @@ if (keyFile.has_group ("Channel Mixer")) { // load luma curve if (keyFile.has_group ("Luminance Curve")) { - if (keyFile.has_key ("Luminance Curve", "Brightness")) lumaCurve.brightness = keyFile.get_integer ("Luminance Curve", "Brightness"); - if (keyFile.has_key ("Luminance Curve", "Contrast")) lumaCurve.contrast = keyFile.get_integer ("Luminance Curve", "Contrast"); + if (keyFile.has_key ("Luminance Curve", "Brightness")) labCurve.brightness = keyFile.get_integer ("Luminance Curve", "Brightness"); + if (keyFile.has_key ("Luminance Curve", "Contrast")) labCurve.contrast = keyFile.get_integer ("Luminance Curve", "Contrast"); + if (keyFile.has_key ("Luminance Curve", "Saturation")) labCurve.saturation = keyFile.get_integer ("Luminance Curve", "Saturation"); if (version>200) - if (keyFile.has_key ("Luminance Curve", "Curve")) lumaCurve.curve = keyFile.get_double_list ("Luminance Curve", "Curve"); + if (keyFile.has_key ("Luminance Curve", "LCurve")) labCurve.lcurve = keyFile.get_double_list ("Luminance Curve", "LCurve"); + if (keyFile.has_key ("Luminance Curve", "aCurve")) labCurve.acurve = keyFile.get_double_list ("Luminance Curve", "aCurve"); + if (keyFile.has_key ("Luminance Curve", "bCurve")) labCurve.bcurve = keyFile.get_double_list ("Luminance Curve", "bCurve"); } // load sharpening @@ -692,9 +703,12 @@ bool ProcParams::operator== (const ProcParams& other) { && toneCurve.autoexp == other.toneCurve.autoexp && toneCurve.clip == other.toneCurve.clip && toneCurve.expcomp == other.toneCurve.expcomp - && lumaCurve.curve == other.lumaCurve.curve - && lumaCurve.brightness == other.lumaCurve.brightness - && lumaCurve.contrast == other.lumaCurve.contrast + && labCurve.lcurve == other.labCurve.lcurve + && labCurve.acurve == other.labCurve.acurve + && labCurve.bcurve == other.labCurve.bcurve + && labCurve.brightness == other.labCurve.brightness + && labCurve.contrast == other.labCurve.contrast + && labCurve.saturation == other.labCurve.saturation && sharpening.enabled == other.sharpening.enabled && sharpening.radius == other.sharpening.radius && sharpening.amount == other.sharpening.amount diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 3a6f4ea28..cb7d0253c 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -48,9 +48,12 @@ class ToneCurveParams { class LCurveParams { public: - std::vector curve; + std::vector lcurve; + std::vector acurve; + std::vector bcurve; int brightness; int contrast; + int saturation; }; /** @@ -352,7 +355,7 @@ class ProcParams { public: ToneCurveParams toneCurve; ///< Tone curve parameters - LCurveParams lumaCurve; ///< CIELAB luminance curve parameters + LCurveParams labCurve; ///< CIELAB luminance curve parameters SharpeningParams sharpening; ///< Sharpening parameters ColorBoostParams colorBoost; ///< Color boost parameters WBParams wb; ///< White balance parameters diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index a0c478b61..ea367081f 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -37,7 +37,7 @@ LUMINANCECURVE, // EvLContrast, LUMINANCECURVE, // EvLBlack, LUMINANCECURVE, // EvLHLCompr, LUMINANCECURVE, // EvLSHCompr, -LUMINANCECURVE, // EvLCurve, +LUMINANCECURVE, // EvLLCurve, SHARPENING, // EvShrEnabled, SHARPENING, // EvShrRadius, SHARPENING, // EvShrAmount, @@ -111,7 +111,10 @@ DIRPYRDENOISE, // EvDPDNEnabled, DIRPYRDENOISE, // EvDPDNLuma, DIRPYRDENOISE, // EvDPDNChroma, DIRPYRDENOISE, // EvDPDNGamma, -DIRPYREQUALIZER, // EvDirPyrEqualizer -DIRPYREQUALIZER // EvDirPyrEqlEnabled +DIRPYREQUALIZER, // EvDirPyrEqualizer, +DIRPYREQUALIZER, // EvDirPyrEqlEnabled, +LUMINANCECURVE, // EvLSaturation, +LUMINANCECURVE, // EvLaCurve, +LUMINANCECURVE, // EvLbCurve }; diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 2f7c182bb..5d18a31ce 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -327,9 +327,13 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei hist16[labView->L[i][j]]++; // luminance processing - CurveFactory::complexCurve (0.0, 0.0, 0.0, 0.0, params.lumaCurve.brightness, params.lumaCurve.contrast, 0.0, 0.0, false, params.lumaCurve.curve, hist16, curve, NULL, 16); - + CurveFactory::complexCurve (0.0, 0.0, 0.0, 0.0, params.labCurve.brightness, params.labCurve.contrast, 0.0, 0.0, false, params.labCurve.lcurve, hist16, curve, NULL, 16); ipf.luminanceCurve (labView, labView, curve, 0, fh); + CurveFactory::complexsgnCurve (0.0, 100.0, params.labCurve.saturation, 1.0, params.labCurve.acurve, curve, 16); + ipf.chrominanceCurve (labView, labView, 0, curve, 0, fh); + CurveFactory::complexsgnCurve (0.0, 100.0, params.labCurve.saturation, 1.0, params.labCurve.bcurve, curve, 16); + ipf.chrominanceCurve (labView, labView, 1, curve, 0, fh); + delete [] curve; delete [] hist16; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index d9abb1082..3c78081a9 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -150,8 +150,13 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p hist16[labView->L[i][j]]++; // luminance processing - CurveFactory::complexCurve (0.0, 0.0, 0.0, 0.0, params.lumaCurve.brightness, params.lumaCurve.contrast, 0.0, 0.0, false, params.lumaCurve.curve, hist16, curve, NULL); + CurveFactory::complexCurve (0.0, 0.0, 0.0, 0.0, params.labCurve.brightness, params.labCurve.contrast, 0.0, 0.0, false, params.labCurve.lcurve, hist16, curve, NULL); ipf.luminanceCurve (labView, labView, curve, 0, fh); + CurveFactory::complexsgnCurve (0.0, 100.0, params.labCurve.saturation, 1.0, params.labCurve.acurve, curve, NULL); + ipf.chrominanceCurve (labView, labView, 0, curve, 0, fh); + CurveFactory::complexsgnCurve (0.0, 100.0, params.labCurve.saturation, 1.0, params.labCurve.bcurve, curve, NULL); + ipf.chrominanceCurve (labView, labView, 1, curve, 0, fh); + ipf.impulsedenoise (labView); ipf.lumadenoise (labView, buffer); ipf.sharpening (labView, (unsigned short**)buffer); diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index e6dd87a71..221521cb1 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -15,7 +15,7 @@ set (BASESOURCEFILES crophandler.cc curveeditor.cc dirbrowser.cc filecatalog.cc histogrampanel.cc history.cc imagearea.cc - imageareapanel.cc iptcpanel.cc lcurve.cc lumadenoise.cc main.cc + imageareapanel.cc iptcpanel.cc labcurve.cc lumadenoise.cc main.cc multilangmgr.cc mycurve.cc options.cc preferences.cc profilepanel.cc safegtk.cc saveasdlg.cc saveformatpanel.cc splash.cc diff --git a/rtgui/addsetids.h b/rtgui/addsetids.h index ed5192d8a..18cfe6339 100644 --- a/rtgui/addsetids.h +++ b/rtgui/addsetids.h @@ -25,4 +25,6 @@ #define ADDSET_PARAM_NUM 21 +#define ADDSET_LC_SATURATION 22 + #endif diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index 01da0ab11..62d578bc4 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -351,7 +351,7 @@ Glib::ustring BatchQueue::autoCompleteFileName (const Glib::ustring& fileName, c int fileExists=Glib::file_test (fname, Glib::FILE_TEST_EXISTS); - if (inOverwriteMode && fileExists) { + /*if (inOverwriteMode && fileExists) { if (g_remove(safe_locale_from_utf8(fname).c_str ()) == -1) inOverwriteMode = false; // failed to delete- revert to old naming scheme else @@ -360,7 +360,7 @@ Glib::ustring BatchQueue::autoCompleteFileName (const Glib::ustring& fileName, c if (!fileExists) { return fname; - } + }*/ } } diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 8ad08c61e..a4fe97d94 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -121,7 +121,7 @@ void BatchToolPanelCoordinator::initSession () { coarse->initBatchBehavior (); curve->setAdjusterBehavior (options.baBehav[ADDSET_TC_EXPCOMP], options.baBehav[ADDSET_TC_BRIGHTNESS], options.baBehav[ADDSET_TC_BLACKLEVEL], options.baBehav[ADDSET_TC_CONTRAST]); - lcurve->setAdjusterBehavior (options.baBehav[ADDSET_LC_BRIGHTNESS], options.baBehav[ADDSET_LC_CONTRAST]); + lcurve->setAdjusterBehavior (options.baBehav[ADDSET_LC_BRIGHTNESS], options.baBehav[ADDSET_LC_CONTRAST], options.baBehav[ADDSET_LC_SATURATION]); whitebalance->setAdjusterBehavior (options.baBehav[ADDSET_WB_TEMPERATURE], options.baBehav[ADDSET_WB_GREEN]); vignetting->setAdjusterBehavior (options.baBehav[ADDSET_VIGN_AMOUNT]); rotate->setAdjusterBehavior (options.baBehav[ADDSET_ROTATE_DEGREE]); @@ -143,9 +143,10 @@ void BatchToolPanelCoordinator::initSession () { if (options.baBehav[ADDSET_SH_SHADOWS]) pparams.sh.shadows = 0; if (options.baBehav[ADDSET_SH_LOCALCONTRAST]) pparams.sh.localcontrast = 0; - if (options.baBehav[ADDSET_LC_BRIGHTNESS]) pparams.lumaCurve.brightness = 0; - if (options.baBehav[ADDSET_LC_CONTRAST]) pparams.lumaCurve.contrast = 0; - + if (options.baBehav[ADDSET_LC_BRIGHTNESS]) pparams.labCurve.brightness = 0; + if (options.baBehav[ADDSET_LC_CONTRAST]) pparams.labCurve.contrast = 0; + if (options.baBehav[ADDSET_LC_SATURATION]) pparams.labCurve.saturation = 0; + if (options.baBehav[ADDSET_SHARP_AMOUNT]) pparams.sharpening.amount = 0; if (options.baBehav[ADDSET_LD_EDGETOLERANCE]) pparams.lumaDenoise.edgetolerance = 0; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 420fa6af4..41ddd4a68 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -37,9 +37,12 @@ void ParamsEdited::set (bool v) { toneCurve.autoexp = v; toneCurve.clip = v; toneCurve.expcomp = v; - lumaCurve.curve = v; - lumaCurve.brightness = v; - lumaCurve.contrast = v; + labCurve.lcurve = v; + labCurve.acurve = v; + labCurve.bcurve = v; + labCurve.brightness = v; + labCurve.contrast = v; + labCurve.saturation = v; sharpening.enabled = v; sharpening.radius = v; sharpening.amount = v; @@ -158,10 +161,13 @@ void ParamsEdited::initFrom (const std::vector toneCurve.autoexp = toneCurve.autoexp && p.toneCurve.autoexp == other.toneCurve.autoexp; toneCurve.clip = toneCurve.clip && p.toneCurve.clip == other.toneCurve.clip; toneCurve.expcomp = toneCurve.expcomp && p.toneCurve.expcomp == other.toneCurve.expcomp; - lumaCurve.curve = lumaCurve.curve && p.lumaCurve.curve == other.lumaCurve.curve; - lumaCurve.brightness = lumaCurve.brightness && p.lumaCurve.brightness == other.lumaCurve.brightness; - lumaCurve.contrast = lumaCurve.contrast && p.lumaCurve.contrast == other.lumaCurve.contrast; - sharpening.enabled = sharpening.enabled && p.sharpening.enabled == other.sharpening.enabled; + labCurve.lcurve = labCurve.lcurve && p.labCurve.lcurve == other.labCurve.lcurve; + labCurve.acurve = labCurve.acurve && p.labCurve.acurve == other.labCurve.acurve; + labCurve.bcurve = labCurve.bcurve && p.labCurve.bcurve == other.labCurve.bcurve; + labCurve.brightness = labCurve.brightness && p.labCurve.brightness == other.labCurve.brightness; + labCurve.contrast = labCurve.contrast && p.labCurve.contrast == other.labCurve.contrast; + labCurve.saturation = labCurve.saturation && p.labCurve.saturation == other.labCurve.saturation; + sharpening.enabled = sharpening.enabled && p.sharpening.enabled == other.sharpening.enabled; sharpening.radius = sharpening.radius && p.sharpening.radius == other.sharpening.radius; sharpening.amount = sharpening.amount && p.sharpening.amount == other.sharpening.amount; sharpening.threshold = sharpening.threshold && p.sharpening.threshold == other.sharpening.threshold; @@ -273,9 +279,12 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (toneCurve.autoexp) toEdit.toneCurve.autoexp = mods.toneCurve.autoexp; if (toneCurve.clip) toEdit.toneCurve.clip = mods.toneCurve.clip; if (toneCurve.expcomp) toEdit.toneCurve.expcomp = options.baBehav[ADDSET_TC_EXPCOMP] ? toEdit.toneCurve.expcomp + mods.toneCurve.expcomp : mods.toneCurve.expcomp; - if (lumaCurve.curve) toEdit.lumaCurve.curve = mods.lumaCurve.curve; - if (lumaCurve.brightness) toEdit.lumaCurve.brightness = options.baBehav[ADDSET_LC_BRIGHTNESS] ? toEdit.lumaCurve.brightness + mods.lumaCurve.brightness : mods.lumaCurve.brightness; - if (lumaCurve.contrast) toEdit.lumaCurve.contrast = options.baBehav[ADDSET_LC_CONTRAST] ? toEdit.lumaCurve.contrast + mods.lumaCurve.contrast : mods.lumaCurve.contrast; + if (labCurve.lcurve) toEdit.labCurve.lcurve = mods.labCurve.lcurve; + if (labCurve.acurve) toEdit.labCurve.acurve = mods.labCurve.acurve; + if (labCurve.bcurve) toEdit.labCurve.bcurve = mods.labCurve.bcurve; + if (labCurve.brightness) toEdit.labCurve.brightness = options.baBehav[ADDSET_LC_BRIGHTNESS] ? toEdit.labCurve.brightness + mods.labCurve.brightness : mods.labCurve.brightness; + if (labCurve.contrast) toEdit.labCurve.contrast = options.baBehav[ADDSET_LC_CONTRAST] ? toEdit.labCurve.contrast + mods.labCurve.contrast : mods.labCurve.contrast; + if (labCurve.saturation) toEdit.labCurve.saturation = options.baBehav[ADDSET_LC_SATURATION] ? toEdit.labCurve.saturation + mods.labCurve.saturation : mods.labCurve.saturation; if (sharpening.enabled) toEdit.sharpening.enabled = mods.sharpening.enabled; if (sharpening.radius) toEdit.sharpening.radius = mods.sharpening.radius; if (sharpening.amount) toEdit.sharpening.amount = options.baBehav[ADDSET_SHARP_AMOUNT] ? toEdit.sharpening.amount + mods.sharpening.amount : mods.sharpening.amount; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index f7c28385c..11f060d0f 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -43,7 +43,10 @@ class LCurveParamsEdited { public: bool brightness; bool contrast; - bool curve; + bool saturation; + bool lcurve; + bool acurve; + bool bcurve; }; class SharpeningParamsEdited { @@ -264,7 +267,7 @@ class ParamsEdited { public: ToneCurveParamsEdited toneCurve; - LCurveParamsEdited lumaCurve; + LCurveParamsEdited labCurve; SharpeningParamsEdited sharpening; ColorBoostParamsEdited colorBoost; WBParamsEdited wb; diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index 1310d9c84..b903365af 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -40,7 +40,7 @@ PartialPasteDlg::PartialPasteDlg () { sharpen = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_SHARPENING"))); impden = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_IMPULSEDENOISE"))); lumaden = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_LUMADENOISE"))); - lumacurve = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_LUMACURVE"))); + labcurve = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_LABCURVE"))); sh = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_SHADOWSHIGHLIGHTS"))); dirpyreq = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_DIRPYREQUALIZER"))); waveq = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_WAVELETEQUALIZER"))); @@ -87,7 +87,7 @@ PartialPasteDlg::PartialPasteDlg () { vboxes[1]->pack_start (*sharpen, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*impden, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*lumaden, Gtk::PACK_SHRINK, 2); - vboxes[1]->pack_start (*lumacurve, Gtk::PACK_SHRINK, 2); + vboxes[1]->pack_start (*labcurve, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*sh, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*dirpyreq, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*waveq, Gtk::PACK_SHRINK, 2); @@ -152,7 +152,7 @@ PartialPasteDlg::PartialPasteDlg () { sharpenConn = sharpen->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); impdenConn = impden->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); lumadenConn = lumaden->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); - lumacurveConn = lumacurve->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); + labcurveConn = labcurve->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); shConn = sh->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); dirpyreqConn = dirpyreq->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); waveqConn = waveq->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); @@ -205,7 +205,7 @@ void PartialPasteDlg::luminanceToggled () { sharpenConn.block (true); impdenConn.block (true); lumadenConn.block (true); - lumacurveConn.block (true); + labcurveConn.block (true); shConn.block (true); dirpyreqConn.block (true); waveqConn.block (true); @@ -215,7 +215,7 @@ void PartialPasteDlg::luminanceToggled () { sharpen->set_active (luminance->get_active ()); impden->set_active (luminance->get_active ()); lumaden->set_active (luminance->get_active ()); - lumacurve->set_active (luminance->get_active ()); + labcurve->set_active (luminance->get_active ()); sh->set_active (luminance->get_active ()); dirpyreq->set_active (luminance->get_active ()); waveq->set_active (luminance->get_active ()); @@ -223,7 +223,7 @@ void PartialPasteDlg::luminanceToggled () { sharpenConn.block (false); impdenConn.block (false); lumadenConn.block (false); - lumacurveConn.block (false); + labcurveConn.block (false); shConn.block (false); dirpyreqConn.block (false); waveqConn.block (false); @@ -316,7 +316,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dst, const r if (sharpen->get_active ()) dst->sharpening = src->sharpening; if (impden->get_active ()) dst->impulseDenoise = src->impulseDenoise; if (lumaden->get_active ()) dst->lumaDenoise = src->lumaDenoise; - if (lumacurve->get_active ()) dst->lumaCurve = src->lumaCurve; + if (labcurve->get_active ()) dst->labCurve = src->labCurve; if (sh->get_active ()) dst->sh = src->sh; if (dirpyreq->get_active ()) dst->dirpyrequalizer = src->dirpyrequalizer; if (waveq->get_active ()) dst->equalizer = src->equalizer; diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 3c4dcb152..2ea23772a 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -42,7 +42,7 @@ class PartialPasteDlg : public Gtk::Dialog { Gtk::CheckButton* sharpen; Gtk::CheckButton* impden; Gtk::CheckButton* lumaden; - Gtk::CheckButton* lumacurve; + Gtk::CheckButton* labcurve; Gtk::CheckButton* sh; Gtk::CheckButton* dirpyreq; Gtk::CheckButton* waveq; @@ -73,7 +73,7 @@ class PartialPasteDlg : public Gtk::Dialog { sigc::connection basicConn, luminanceConn, colorConn, lensConn, compositionConn, metaicmConn; sigc::connection wbConn, exposureConn, hlrecConn; - sigc::connection sharpenConn, impdenConn, lumadenConn, lumacurveConn, shConn, dirpyreqConn, waveqConn; + sigc::connection sharpenConn, impdenConn, lumadenConn, labcurveConn, shConn, dirpyreqConn, waveqConn; sigc::connection colormixerConn, colorshiftConn, colorboostConn, colordenConn, dirpyrdenConn; sigc::connection distortionConn, cacorrConn, vignettingConn; sigc::connection coarserotConn, finerotConn, cropConn, resizeConn; diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 35b7611a5..f1646bae0 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -139,9 +139,10 @@ Gtk::Widget* Preferences::getBatchProcPanel () { appendBehavList (mi, M("TP_SHADOWSHLIGHTS_LOCALCONTR"), ADDSET_SH_LOCALCONTRAST, false); mi = behModel->append (); - mi->set_value (behavColumns.label, M("TP_LUMACURVE_LABEL")); - appendBehavList (mi, M("TP_LUMACURVE_BRIGHTNESS"), ADDSET_LC_BRIGHTNESS, false); - appendBehavList (mi, M("TP_LUMACURVE_CONTRAST"), ADDSET_LC_CONTRAST, false); + mi->set_value (behavColumns.label, M("TP_LABCURVE_LABEL")); + appendBehavList (mi, M("TP_LABCURVE_BRIGHTNESS"), ADDSET_LC_BRIGHTNESS, false); + appendBehavList (mi, M("TP_LABCURVE_CONTRAST"), ADDSET_LC_CONTRAST, false); + appendBehavList (mi, M("TP_LABCURVE_SATURATION"), ADDSET_LC_SATURATION, false); mi = behModel->append (); mi->set_value (behavColumns.label, M("TP_SHARPENING_LABEL")); diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index c0efb25f6..fd5dd1efe 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -51,13 +51,13 @@ ToneCurve::ToneCurve () : ToolPanel(), expAdd(false), blackAdd(false), brAdd(fal //----------- Exposure Compensation ------------------------ expcomp = Gtk::manage (new Adjuster (M("TP_EXPOSURE_EXPCOMP"), -5, 5, 0.01, 0)); pack_start (*expcomp); - hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 150, 1, 0)); + hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 100, 1, 100)); pack_start (*hlcompr); //----------- Black Level ---------------------------------- black = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BLACKLEVEL"), 0, 32768, 1, 0)); pack_start (*black); - shcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRSHADOWS"), 0, 150, 1, 0)); + shcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRSHADOWS"), -100, 100, 1, 0)); pack_start (*shcompr); pack_start (*Gtk::manage (new Gtk::HSeparator())); diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 51837a727..7e31b6dd1 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -66,7 +66,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) { addPanel (detailsPanel, sharpening, M("TP_SHARPENING_LABEL")); toolPanels.push_back (sharpening); addPanel (colorPanel, colorboost, M("TP_COLORBOOST_LABEL")); toolPanels.push_back (colorboost); addPanel (colorPanel, colorshift, M("TP_COLORSHIFT_LABEL")); toolPanels.push_back (colorshift); - addPanel (exposurePanel, lcurve, M("TP_LUMACURVE_LABEL")); toolPanels.push_back (lcurve); + addPanel (exposurePanel, lcurve, M("TP_LABCURVE_LABEL")); toolPanels.push_back (lcurve); addPanel (detailsPanel, impulsedenoise, M("TP_IMPULSEDENOISE_LABEL")); toolPanels.push_back (impulsedenoise); addPanel (detailsPanel, lumadenoise, M("TP_LUMADENOISE_LABEL")); toolPanels.push_back (lumadenoise); addPanel (detailsPanel, colordenoise, M("TP_COLORDENOISE_LABEL")); toolPanels.push_back (colordenoise); diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index d9ba10a1e..c9338b90e 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include