From 959843b4cbd806db31f1d5583475947442d93eb6 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 26 Nov 2012 22:01:53 -0500 Subject: [PATCH] Adding histograms to curves in Lab and CIECAM; on behalf of Jacques (see issue 1630) --- .hgignore | 3 + rtdata/images/Dark/actions/histChro.png | Bin 0 -> 715 bytes rtdata/images/Dark/actions/histChrog.png | Bin 0 -> 728 bytes rtdata/images/Light/actions/histChro.png | Bin 0 -> 716 bytes rtdata/images/Light/actions/histChrog.png | Bin 0 -> 697 bytes rtdata/languages/Francais | 6 +- rtdata/languages/default | 19 +-- rtengine/curves.cc | 164 +++++++++++++--------- rtengine/curves.h | 12 +- rtengine/dcrop.cc | 11 +- rtengine/improccoordinator.cc | 108 ++++++++++---- rtengine/improccoordinator.h | 15 +- rtengine/improcfun.cc | 30 ++-- rtengine/rtengine.h | 4 +- rtengine/rtthumbnail.cc | 21 ++- rtengine/simpleprocess.cc | 20 ++- rtgui/colorappearance.cc | 10 ++ rtgui/colorappearance.h | 2 +- rtgui/editorpanel.cc | 8 +- rtgui/editorpanel.h | 4 +- rtgui/histogrampanel.cc | 72 ++++++++-- rtgui/histogrampanel.h | 24 ++-- rtgui/labcurve.cc | 6 +- rtgui/labcurve.h | 2 +- rtgui/options.cc | 1 + rtgui/rgbcurves.cc | 8 +- rtgui/rgbcurves.h | 2 +- rtgui/tonecurve.cc | 2 +- rtgui/tonecurve.h | 2 +- rtgui/toolpanelcoord.cc | 11 +- rtgui/toolpanelcoord.h | 2 +- 31 files changed, 389 insertions(+), 180 deletions(-) create mode 100644 rtdata/images/Dark/actions/histChro.png create mode 100644 rtdata/images/Dark/actions/histChrog.png create mode 100644 rtdata/images/Light/actions/histChro.png create mode 100644 rtdata/images/Light/actions/histChrog.png diff --git a/.hgignore b/.hgignore index e93bfaffa..19d6886d9 100644 --- a/.hgignore +++ b/.hgignore @@ -22,3 +22,6 @@ rtgui/rawtherapee rtgui/rawtherapee.exe install_manifest.txt AboutThisBuild.txt + +syntax: regexp +^Win32CMakeOptions-MK1\.txt$ \ No newline at end of file diff --git a/rtdata/images/Dark/actions/histChro.png b/rtdata/images/Dark/actions/histChro.png new file mode 100644 index 0000000000000000000000000000000000000000..7aa27f3710e3a04409614f1e06e47226845a2850 GIT binary patch literal 715 zcmV;+0yO=JP)KLZ*U+0v@6o#Kk zBy~|skq9maHzpVb!A%szeAFnH;fC8TlHlg{&NR8$`@v*xZFhqH4E+Z#x^m|~@B=Bh z_D6`z#6^szN*C?3dS~Xmobz%9%J006+AeKEk~$mo+Hx=)$+gd{Be=?au7%MwSKE(w z06f3j3Vfybi-4cs5CA8)JipuGe5^;gbs(z16K$puh-bj77cO@oz5`Xe6LdiQ05--e zdUr+J!EgknOF(tJ(ARjGpDr!D|DP|)O23KLZ*U+0v@6o#Kk zBy~|skq9maHzpVb!A%szeAFnH;fC8TlHlg{&NR8$`@v*xZFhqH4E+Z#x^m|~@B=Bh z_D6`z#6^szN*C?3dS~Xmobz%9%J006+AeKEk~$mo+Hx=)$+gd{Be=?au7%MwSKE(w z06f3j3Vfybi-4cs5CA8)JipuGe5^;gbs(z16K$puh-bj77cO@oz5`Xe6LdiQ05--e zdUr+J!EgknOF(tJ(ARjGpDr!D|DP|)O23KLZ*U+0v@6o#Kk zBy~|skq9maHzpVb!A%szeAFnH;fC8TlHlg{&NR8$`@v*xZFhqH4E+Z#x^m|~@B=Bh z_D6`z#6^szN*C?3dS~Xmobz%9%J006+AeKEk~$mo+Hx=)$+gd{Be=?au7%MwSKE(w z06f3j3Vfybi-4cs5CA8)JipuGe5^;gbs(z16K$puh-bj77cO@oz5`Xe6LdiQ05--e zdUr+J!EgknOF(tJ(ARjGpDr!D|DP|)O23twy{RFxT)HiQs1AOX>$0%Q@X08Uk#v;*s7(Fq(PQoRLfAYoYo yXkz@R7klv+-xYtO^kTN+435e7)zj~p;Tiy-y(9;$`O5JC0000KLZ*U+0v@6o#Kk zBy~|skq9maHzpVb!A%szeAFnH;fC8TlHlg{&NR8$`@v*xZFhqH4E+Z#x^m|~@B=Bh z_D6`z#6^szN*C?3dS~Xmobz%9%J006+AeKEk~$mo+Hx=)$+gd{Be=?au7%MwSKE(w z06f3j3Vfybi-4cs5CA8)JipuGe5^;gbs(z16K$puh-bj77cO@oz5`Xe6LdiQ05--e zdUr+J!EgknOF(tJ(ARjGpDr!D|DP|)O239uI06O$UG5Sc^=-e$00000NkvXXu0mjfLK-pw literal 0 HcmV?d00001 diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 56553b07d..e28b180b9 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -951,8 +951,9 @@ TP_COLORAPP_TCMODE_LIGHTNESS;Luminosité TP_COLORAPP_TCMODE_LABEL1;Courbe mode 1 TP_COLORAPP_TCMODE_LABEL2;Courbe mode 2 TP_COLORAPP_TCMODE_LABEL3;Courbe chroma mode +TP_COLORAPP_CURVEEDITOR1_TOOLTIP;Histogramme affiche L (lab) avant CIECAM.\n On peut voir le résultat dans la fenêtre histogramme TP_COLORAPP_CURVEEDITOR2_TOOLTIP;usage similaire aux courbes tonales exposition -TP_COLORAPP_CURVEEDITOR3_TOOLTIP;Vous pouvez choisir entre chroma -saturation- niveau couleurs +TP_COLORAPP_CURVEEDITOR3_TOOLTIP;Vous pouvez choisir entre chroma -saturation- niveau couleurs.\n Histogramme affiche la chromaticité Lab.\n On peut voir le résultat dans la fenêtre histogramme TP_CROP_FIXRATIO;Ratio fixe: TP_CROP_GTDIAGONALS;Règle des diagonales TP_CROP_GTEPASSPORT;Passeport biométrique @@ -1107,7 +1108,8 @@ TP_LABCURVE_CURVEEDITOR_CC_RANGE1;Neutre TP_LABCURVE_CURVEEDITOR_CC_RANGE2;Terne TP_LABCURVE_CURVEEDITOR_CC_RANGE3;Pastel TP_LABCURVE_CURVEEDITOR_CC_RANGE4;Saturé -TP_LABCURVE_CURVEEDITOR_CC_TOOLTIP;Chromaticité en fonction de la Chromaticité +TP_LABCURVE_CURVEEDITOR_LL_TOOLTIP;Luminance Lab L=f(L).\n Avant ajustements Lab.\n on peut voir le résultat dans la fenêtre Histogramme +TP_LABCURVE_CURVEEDITOR_CC_TOOLTIP;Chromaticité en fonction de la Chromaticité.\n C=f(C) On peut voir le résultat dans la fenêtre Histogramme TP_LABCURVE_CURVEEDITOR_CH;CT TP_LABCURVE_CURVEEDITOR_CH_TOOLTIP;Chromaticité en fonction de la Teinte TP_LABCURVE_CURVEEDITOR_LC;LC diff --git a/rtdata/languages/default b/rtdata/languages/default index 95ca96208..f1999f25c 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -217,6 +217,7 @@ HISTOGRAM_TOOLTIP_B;Show/Hide blue histogram HISTOGRAM_TOOLTIP_FULL;Toggle full or scaled histogram HISTOGRAM_TOOLTIP_G;Show/Hide green histogram HISTOGRAM_TOOLTIP_L;Show/Hide CIELAB Luminance histogram +HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram HISTOGRAM_TOOLTIP_R;Show/Hide red histogram HISTORY_CHANGED;Changed @@ -228,7 +229,7 @@ HISTORY_MSG_1;Photo Loaded HISTORY_MSG_2;PP3 Loaded HISTORY_MSG_3;PP3 Changed HISTORY_MSG_4;History Browsing -HISTORY_MSG_5;Brightness +HISTORY_MSG_5;Lightness HISTORY_MSG_6;Contrast HISTORY_MSG_7;Black HISTORY_MSG_8;Exposure Compensation @@ -237,7 +238,7 @@ HISTORY_MSG_10;Shadow Compression HISTORY_MSG_11;Tone Curve 1 HISTORY_MSG_12;Auto Exposure HISTORY_MSG_13;Exposure Clipping -HISTORY_MSG_14;Luminance Brightness +HISTORY_MSG_14;Luminance Lightness HISTORY_MSG_15;Luminance Contrast HISTORY_MSG_16;Luminance Black HISTORY_MSG_17;Luminance Highlight Compr. @@ -940,7 +941,7 @@ TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] TP_COLORAPP_WBRT;WB [RT] + [output] TP_COLORAPP_CURVEEDITOR1;Tone curve 1 TP_COLORAPP_CURVEEDITOR2;Tone curve 2 -TP_COLORAPP_CURVEEDITOR3;Chroma curve +TP_COLORAPP_CURVEEDITOR3;Color curve TP_COLORAPP_TCMODE_CHROMA;Chroma TP_COLORAPP_TCMODE_SATUR;Saturation TP_COLORAPP_TCMODE_COLORF;Colorfullness @@ -949,8 +950,9 @@ TP_COLORAPP_TCMODE_LIGHTNESS;Lightness TP_COLORAPP_TCMODE_LABEL1;Curve mode 1 TP_COLORAPP_TCMODE_LABEL2;Curve mode 2 TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode -TP_COLORAPP_CURVEEDITOR2_TOOLTIP;Same usage as exposure tone curve -TP_COLORAPP_CURVEEDITOR3_TOOLTIP;You can select between chroma saturation colorfullness +TP_COLORAPP_CURVEEDITOR1_TOOLTIP;Histogram of L (Lab) before CIECAM.\n For final output refer to the Histogram panel +TP_COLORAPP_CURVEEDITOR2_TOOLTIP;Same usage as with the second exposure tone curve. +TP_COLORAPP_CURVEEDITOR3_TOOLTIP;Adjust either chroma, saturation or colorfullness.\n Histogram shows chromaticity (Lab) before CIECAM.\n For final output refer to the Histogram panel TP_CROP_FIXRATIO;Fix ratio: TP_CROP_GTDIAGONALS;Rule of Diagonals TP_CROP_GTEPASSPORT;Biometric Passport @@ -1000,7 +1002,7 @@ TP_EXPOSCORR_LABEL;Raw White & Black Points TP_EXPOSURE_AUTOLEVELS;Auto Levels TP_EXPOSURE_AUTOLEVELS_TIP;Toggle execution of auto levels to automatically set parameter values based on image analysis TP_EXPOSURE_BLACKLEVEL;Black -TP_EXPOSURE_BRIGHTNESS;Brightness +TP_EXPOSURE_BRIGHTNESS;Lightness TP_EXPOSURE_CLIP;Clip TP_EXPOSURE_CLIP_TIP;The fraction of pixels to be clipped in auto level's operation TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD;Highlight Recovery Threshold @@ -1079,7 +1081,7 @@ TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color s TP_LABCURVE_RSTPRO_TOOLTIP;Can be used with the Chromaticity slider and the CC curve. TP_LABCURVE_LCREDSK;Restrict LC to red and skin tones TP_LABCURVE_LCREDSK_TIP;If enabled, LC Curve (Luminance According to Chromaticity) is limited to red and skin tones\nIf disabled, applies on all tones -TP_LABCURVE_BRIGHTNESS;Brightness +TP_LABCURVE_BRIGHTNESS;Lightness TP_LABCURVE_BWTONING;B&W toning TP_LABCURVE_BWTONING_TIP;With the B&W toning option enabled, the Lab Chromaticity, CC, CH and LC curves are not in effect.\nToning can be achieved using the a and b curves TP_LABCURVE_CHROMATICITY;Chromaticity @@ -1098,11 +1100,12 @@ TP_LABCURVE_CURVEEDITOR_CC_RANGE1;Neutral TP_LABCURVE_CURVEEDITOR_CC_RANGE2;Dull TP_LABCURVE_CURVEEDITOR_CC_RANGE3;Pastel TP_LABCURVE_CURVEEDITOR_CC_RANGE4;Saturated -TP_LABCURVE_CURVEEDITOR_CC_TOOLTIP;Chromaticity according to the chromaticity +TP_LABCURVE_CURVEEDITOR_CC_TOOLTIP;Chromaticity C=f(C).\n Histogram of Chromaticity before Lab adjustements.\n For final output refer to the Histogram panel TP_LABCURVE_CURVEEDITOR_CH;CH TP_LABCURVE_CURVEEDITOR_CH_TOOLTIP;Chromaticity according to the hue TP_LABCURVE_CURVEEDITOR_LC;LC TP_LABCURVE_CURVEEDITOR_LC_TOOLTIP;Luminance according to the chromaticity +TP_LABCURVE_CURVEEDITOR_LL_TOOLTIP;Luminance Lab L=f(L).\n Histogram of L before Lab adjustements.\n For final output refer to the Histogram panel TP_LABCURVE_LABEL;Lab Adjustments TP_LABCURVE_RSTPROTECTION;Red and Skin Tones Protection TP_LENSGEOM_AUTOCROP;Auto Crop diff --git a/rtengine/curves.cc b/rtengine/curves.cc index 17e1a62d8..1da822266 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -153,23 +153,74 @@ namespace rtengine { } } +void CurveFactory::updatechroma ( + const std::vector& cccurvePoints, + LUTu & histogramC, LUTu & histogramCroppedC, LUTu & outBeforeCCurveHistogramC,//for chroma + int skip) +{ + LUTf dCcurve(65536,0); + float val; + for (int i=0; i<48000; i++) {//32768*1.414 + ... + val = (double)i / 47999.0; + dCcurve[i] = CLIPD(val); + } + + outBeforeCCurveHistogramC.clear(); + bool histNeededC = false; + + + if (!cccurvePoints.empty() && cccurvePoints[0]!=0) { + if (outBeforeCCurveHistogramC /*&& histogramCropped*/) + histNeededC = true; + } + for (int i=0; i<=48000; i++) {//32768*1.414 + ... + float val; + if (histNeededC) { + float hval = dCcurve[i]; + int hi = (int)(255.0*CLIPD(hval)); // + outBeforeCCurveHistogramC[hi] += histogramC[i] ; + } + } +} + + void CurveFactory::curveLightBrightColor ( ColorAppearanceParams::eTCModeId curveMode1, const std::vector& curvePoints1, ColorAppearanceParams::eTCModeId curveMode2, const std::vector& curvePoints2, ColorAppearanceParams::eCTCModeId curveMode3, const std::vector& curvePoints3, - + LUTu & histogram, LUTu & histogramCropped, LUTu & outBeforeCCurveHistogram,//for Luminance + LUTu & histogramC, LUTu & histogramCroppedC, LUTu & outBeforeCCurveHistogramC,//for chroma ColorAppearance & customColCurve1, ColorAppearance & customColCurve2, ColorAppearance & customColCurve3, - int skip) { + LUTf dcurve(65536,0); + LUTf dCcurve(65536,0); + + float val; + for (int i=0; i<32768; i++) { + val = (double)i / 32767.0; + dcurve[i] = CLIPD(val); + } + for (int i=0; i<48000; i++) { //# 32768*1.414 approximation maxi for chroma + val = (double)i / 47999.0; + dCcurve[i] = CLIPD(val); + } + outBeforeCCurveHistogram.clear(); + outBeforeCCurveHistogramC.clear(); + bool histNeededC = false; + + bool histNeeded = false; DiagonalCurve* tcurve = NULL; customColCurve3.Reset(); if (!curvePoints3.empty() && curvePoints3[0]>DCT_Linear && curvePoints3[0]isIdentity()) { @@ -186,6 +237,9 @@ void CurveFactory::curveLightBrightColor ( if (!curvePoints2.empty() && curvePoints2[0]>DCT_Linear && curvePoints2[0]isIdentity()) { @@ -202,6 +256,9 @@ void CurveFactory::curveLightBrightColor ( if (!curvePoints1.empty() && curvePoints1[0]>DCT_Linear && curvePoints1[0]isIdentity()) { @@ -214,6 +271,24 @@ void CurveFactory::curveLightBrightColor ( tcurve = NULL; } } + for (int i=0; i<=32768; i++) { + float val; + + if (histNeeded) { + float hval = dcurve[i]; + int hi = (int)(255.0*CLIPD(hval)); + outBeforeCCurveHistogram[hi] += histogram[i] ; + } + } + for (int i=0; i<=48000; i++) {//32768*1.414 + ... + float val; + if (histNeededC) { + float hval = dCcurve[i]; + int hi = (int)(255.0*CLIPD(hval)); // + outBeforeCCurveHistogramC[hi] += histogramC[i] ; + } + } + if (tcurve) delete tcurve; } @@ -221,75 +296,24 @@ void CurveFactory::curveLightBrightColor ( //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void CurveFactory::complexsgnCurve ( bool & autili, bool & butili, bool & ccutili, bool & cclutili, double saturation, double rstprotection, const std::vector& acurvePoints, const std::vector& bcurvePoints,const std::vector& cccurvePoints, - const std::vector& lccurvePoints, LUTf & aoutCurve, LUTf & boutCurve, LUTf & satCurve, LUTf & lhskCurve, int skip) { + const std::vector& lccurvePoints, LUTf & aoutCurve, LUTf & boutCurve, LUTf & satCurve, LUTf & lhskCurve, + LUTu & histogramC, LUTu & histogramCroppedC, LUTu & outBeforeCCurveHistogram,//for chroma + int skip) { - //colormult = chroma_scale for Lab manipulations //----------------------------------------------------- bool needed; DiagonalCurve* dCurve = NULL; -/* - // check if contrast curve is needed - needed = (saturation<-0.0001 || saturation>0.0001); - - // Filling the curve if needed - if (needed) { - - //%%%%%%%%%%%%%%%%% Saturation curve's control points %%%%%%%%%%%%%%%%% - std::vector satcurvePoints; - satcurvePoints.push_back((double)DCT_NURBS); - if (saturation>0) { - double satslope = (0.5+2*saturation/500.0)/(0.5-2*saturation/500.0); - double scale = (satlimthresh/100.1); - if (!satlimit) scale=100/100.1; - - satcurvePoints.push_back(0); //black point. Value in [0 ; 1] range - satcurvePoints.push_back(0); //black point. Value in [0 ; 1] range - - //if (satlimit) { - satcurvePoints.push_back(0.5-0.5*scale); //toe point - satcurvePoints.push_back(0.5-0.5*scale); //value at toe point - - satcurvePoints.push_back(0.5-(0.5/satslope)*scale); //toe point - satcurvePoints.push_back(0.5-0.5*scale); //value at toe point - - satcurvePoints.push_back(0.5+(0.5/satslope)*scale); //shoulder point - satcurvePoints.push_back(0.5+0.5*scale); //value at shoulder point - - satcurvePoints.push_back(0.5+0.5*scale); //shoulder point - satcurvePoints.push_back(0.5+0.5*scale); //value at shoulder point - / Commented out... - } else { - 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(-(saturation/200.0)); - - satcurvePoints.push_back(1); - satcurvePoints.push_back(1+saturation/200.0); - } - dCurve = new DiagonalCurve (satcurvePoints, CURVES_MIN_POLY_POINTS/skip); - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - fillCurveArray(dCurve, satCurve, skip, needed); - - delete dCurve; - dCurve = NULL; + LUTf dCcurve(65536,0); + + float val; + for (int i=0; i<48000; i++) { //# 32768*1.414 approximation maxi for chroma + dCcurve[i] = (float)i / 47999.0; } - else { - fillCurveArray(NULL, satCurve, skip, needed); - } -*/ + if (outBeforeCCurveHistogram) + outBeforeCCurveHistogram.clear(); + bool histNeededC = false; //----------------------------------------------------- needed = false; @@ -329,9 +353,21 @@ void CurveFactory::curveLightBrightColor ( needed = false; if (!cccurvePoints.empty() && cccurvePoints[0]!=0) { dCurve = new DiagonalCurve (cccurvePoints, CURVES_MIN_POLY_POINTS/skip); + if (outBeforeCCurveHistogram /*&& histogramCropped*/) + histNeededC = true; + if (dCurve && !dCurve->isIdentity()) {needed = true;ccutili=true;} } + for (int i=0; i<=48000; i++) {//32768*1.414 + ... + float val; + if (histNeededC) { + float hval = dCcurve[i]; + int hi = (int)(255.0*CLIPD(hval)); // + outBeforeCCurveHistogram[hi] += histogramC[i] ; + } + } + fillCurveArray(dCurve, satCurve, skip, needed); if (dCurve) { delete dCurve; diff --git a/rtengine/curves.h b/rtengine/curves.h index 91a1eb164..28e363431 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -182,13 +182,23 @@ class CurveFactory { double gamma_, bool igamma_, ToneCurveParams::eTCModeId curveMode, const std::vector& curvePoints, ToneCurveParams::eTCModeId curveMode2, const std::vector& curvePoints2, LUTu & histogram, LUTu & histogramCropped, LUTf & hlCurve, LUTf & shCurve,LUTf & outCurve, LUTu & outBeforeCCurveHistogram, ToneCurve & outToneCurve, ToneCurve & outToneCurve2, int skip=1); static void complexsgnCurve ( bool & autili, bool & butili, bool & ccutili, bool & cclutili, double saturation, double rstprotection, const std::vector& acurvePoints, - const std::vector& bcurvePoints,const std::vector& cccurvePoints,const std::vector& cclurvePoints, LUTf & aoutCurve, LUTf & boutCurve, LUTf & satCurve, LUTf & lhskCurve, int skip=1); + const std::vector& bcurvePoints,const std::vector& cccurvePoints,const std::vector& cclurvePoints, LUTf & aoutCurve, LUTf & boutCurve, LUTf & satCurve, LUTf & lhskCurve, + LUTu & histogramC, LUTu & histogramCroppedC, LUTu & outBeforeCCurveHistogramC,//for chroma + int skip=1); static void complexLCurve (double br, double contr, const std::vector& curvePoints, LUTu & histogram, LUTu & histogramCropped, LUTf & outCurve, LUTu & outBeforeCCurveHistogram, int skip, bool & utili); + + static void updatechroma ( + const std::vector& cccurvePoints, + LUTu & histogramC, LUTu & histogramCroppedC, LUTu & outBeforeCCurveHistogramC,//for chroma + int skip=1); + static void curveLightBrightColor ( ColorAppearanceParams::eTCModeId curveMode, const std::vector& curvePoints, ColorAppearanceParams::eTCModeId curveMode2, const std::vector& curvePoints2, ColorAppearanceParams::eCTCModeId curveMode3, const std::vector& curvePoints3, + LUTu & histogram, LUTu & histogramCropped, LUTu & outBeforeCCurveHistogram, + LUTu & histogramC, LUTu & histogramCroppedC, LUTu & outBeforeCCurveHistogramC, ColorAppearance & outColCurve1, ColorAppearance & outColCurve2, ColorAppearance & outColCurve3, diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index b65b9d06c..f9d9884c4 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -174,8 +174,8 @@ void Crop::update (int todo) { if (todo & (M_LUMINANCE+M_COLOR)) { //I made a little change here. Rather than have luminanceCurve (and others) use in/out lab images, we can do more if we copy right here. labnCrop->CopyFrom(laboCrop); +// parent->ipf.EPDToneMap(labnCrop, 5, 1); //Go with much fewer than normal iterates for fast redisplay. - parent->ipf.EPDToneMap(labnCrop, 5, 1); //Go with much fewer than normal iterates for fast redisplay. // parent->ipf.luminanceCurve (labnCrop, labnCrop, parent->lumacurve); bool utili=false; @@ -183,12 +183,17 @@ void Crop::update (int todo) { bool butili=false; bool ccutili=false; bool cclutili=false; + LUTu dummy; + CurveFactory::complexsgnCurve (autili, butili,ccutili,cclutili, params.labCurve.chromaticity, params.labCurve.rstprotection, - params.labCurve.acurve, params.labCurve.bcurve,params.labCurve.cccurve,params.labCurve.lccurve, parent->chroma_acurve, parent->chroma_bcurve, parent->satcurve,parent->lhskcurve, 1); + params.labCurve.acurve, params.labCurve.bcurve,params.labCurve.cccurve,params.labCurve.lccurve, parent->chroma_acurve, parent->chroma_bcurve, parent->satcurve,parent->lhskcurve, + dummy, dummy, dummy, + 1); parent->ipf.chromiLuminanceCurve (labnCrop, labnCrop, parent->chroma_acurve, parent->chroma_bcurve, parent->satcurve, parent->lhskcurve, parent->lumacurve, utili, autili, butili, ccutili,cclutili); - //parent->ipf.colorCurve (labnCrop, labnCrop); + // parent->ipf.EPDToneMap(labnCrop, 5, 1); //Go with much fewer than normal iterates for fast redisplay. parent->ipf.vibrance (labnCrop); + parent->ipf.EPDToneMap(labnCrop, 5, 1); //Go with much fewer than normal iterates for fast redisplay. if (skip==1) { parent->ipf.impulsedenoise (labnCrop); diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 0eb162a02..22f4375d1 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -44,14 +44,22 @@ ImProcCoordinator::ImProcCoordinator () vhist16(65536), lhist16(65536), lhist16Cropped(65536), + lhist16CAM(65536), lhist16CroppedCAM(65536), + lhist16CCAM(65536), lhist16CroppedCCAM(65536), + lhist16CCAMAF(65536), lhist16ClabAF(65536), histCropped(65536), + lhist16Clad(65536),lhist16CroppedClad(65536), histRed(256), histRedRaw(256), histGreen(256), histGreenRaw(256), histBlue(256), histBlueRaw(256), - histLuma(256), + histLuma(256), histChroma(256), histToneCurve(256), histLCurve(256), + histCCurve(256), + histLCAM(256), + histCCAM(256), + histClad(256), bcabhist(256), rCurve(), @@ -301,49 +309,60 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { } // compute L channel histogram - int x1, y1, x2, y2, pos; + int x1, y1, x2, y2, pos, poscc; params.crop.mapToResized(pW, pH, scale, x1, x2, y1, y2); - lhist16.clear(); lhist16Cropped.clear(); + lhist16Clad.clear(); lhist16CroppedClad.clear(); + lhist16ClabAF.clear(); for (int x=0; xL[x][y])); lhist16[pos]++; - - if (y>=y1 && y=x1 && xa[x][y]*oprevl->a[x][y] + oprevl->b[x][y]*oprevl->b[x][y])); + lhist16Clad[poscc]++; + if (y>=y1 && y=x1 && xCopyFrom(oprevl); - - ipf.EPDToneMap(nprevl,0,scale); - - //progress ("Applying Luminance Curve...",100*readyphase/numofphases); - - //ipf.luminanceCurve (nprevl, nprevl, lumacurve); - - //readyphase++; + // ipf.EPDToneMap(nprevl,0,scale); + progress ("Applying Color Boost...",100*readyphase/numofphases); + int poscc; + + ipf.chromiLuminanceCurve (nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve,lhskcurve, lumacurve, utili, autili, butili, ccutili,cclutili); - //ipf.colorCurve (nprevl, nprevl); + if(!ccutili){ + for (int x=0; xa[x][y]*nprevl->a[x][y] + nprevl->b[x][y]*nprevl->b[x][y])); + lhist16ClabAF[poscc]++; + } + CurveFactory::updatechroma ( + params.labCurve.cccurve, + lhist16ClabAF, lhist16CroppedCCAM,histCCurve, + scale==1 ? 1 : 16); + } ipf.vibrance(nprevl); + ipf.EPDToneMap(nprevl,0,scale); readyphase++; if (scale==1) { @@ -382,18 +401,48 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { ipf.dirpyrequalizer (nprevl); readyphase++; } - } + //L histo and Chroma histo for ciecam + // histogram well be for Lab (Lch) values, because very difficult to do with J,Q, M, s, C + int x1, y1, x2, y2, pos, posc; + params.crop.mapToResized(pW, pH, scale, x1, x2, y1, y2); + lhist16CAM.clear(); lhist16CroppedCAM.clear(); + lhist16CCAM.clear(); lhist16CroppedCCAM.clear(); + lhist16CCAMAF.clear(); + for (int x=0; xL[x][y])); + posc=CLIP((int)sqrt(nprevl->a[x][y]*nprevl->a[x][y] + nprevl->b[x][y]*nprevl->b[x][y])); + lhist16CCAM[posc]++; + lhist16CAM[pos]++; + if (y>=y1 && y=x1 && xa[x][y]*nprevl->a[x][y] + nprevl->b[x][y]*nprevl->b[x][y])); + lhist16CCAMAF[posc]++; + } + CurveFactory::updatechroma( + params.colorappearance.curve3, + lhist16CCAMAF, lhist16CroppedCCAM,histCCAM, + scale==1 ? 1 : 1); + //end update histogram chroma + } */ + } // process crop, if needed for (size_t i=0; ihasListener () && cropCall != crops[i] ) @@ -430,7 +479,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { if (hListener) { updateLRGBHistograms (); - hListener->histogramChanged (histRed, histGreen, histBlue, histLuma, histToneCurve, histLCurve, histRedRaw, histGreenRaw, histBlueRaw); + hListener->histogramChanged (histRed, histGreen, histBlue, histLuma, histToneCurve, histLCurve,histCCurve, histLCAM, histCCAM, histRedRaw, histGreenRaw, histBlueRaw, histChroma); } mProcessing.unlock (); @@ -533,10 +582,13 @@ void ImProcCoordinator::updateLRGBHistograms () { } } - histLuma.clear(); + histLuma.clear(); + histChroma.clear(); for (int i=y1; iL[i][j]/128)]++; + histChroma[(int)(sqrt(nprevl->a[i][j]*nprevl->a[i][j] + nprevl->b[i][j]*nprevl->b[i][j]))/188]++;//188 = 48000/256 + histLuma[(int)(nprevl->L[i][j]/128)]++; + } /*for (int i=0; i<256; i++) { diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index b562dc72f..af19c4d5b 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -78,16 +78,25 @@ class ImProcCoordinator : public StagedImageProcessor { LUTu vhist16; LUTu lhist16,lhist16Cropped; - LUTu histCropped; - + LUTu lhist16CAM,lhist16CroppedCAM; + LUTu lhist16CCAM,lhist16CroppedCCAM; + LUTu lhist16CCAMAF; + LUTu lhist16ClabAF; + LUTu histCropped; + LUTu lhist16Clad,lhist16CroppedClad; LUTu histRed, histRedRaw; LUTu histGreen, histGreenRaw; LUTu histBlue, histBlueRaw; - LUTu histLuma, histToneCurve, histLCurve, bcabhist; + LUTu histLuma, histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM, histClad, bcabhist, histChroma; LUTf rCurve; LUTf gCurve; LUTf bCurve; + bool utili; + bool autili; + bool butili; + bool ccutili; + bool cclutili; ToneCurve customToneCurve1; ToneCurve customToneCurve2; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index d447df3ab..84229ed8e 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -357,7 +357,7 @@ if(params->colorappearance.enabled) { //evaluate lightness, contrast - ColorTemp::curveJ (jli, contra, 1, bright_curve, hist16J);//lightness and contrast J + ColorTemp::curveJ (jli, contra, 1, bright_curve,hist16J);//lightness and contrast J ColorTemp::curveJ (qbri, qcontra, 1, bright_curveQ, hist16Q);//brightness and contrast Q int gamu=0; bool highlight = params->hlrecovery.enabled; //Get the value if "highlight reconstruction" is activated @@ -540,7 +540,7 @@ if(params->colorappearance.enabled) { if (hasColCurve3) {//curve 3 with chroma saturation colorfullness if (curveMode3==ColorAppearanceParams::TC_MODE_CHROMA){ - double parsat=1.; + double parsat=0.8;//0.68; double coef=327.68/parsat; float Cc=(float) Cpro*coef; float Ccold=Cc; @@ -555,13 +555,13 @@ if(params->colorappearance.enabled) { c1C=1; } else if (curveMode3==ColorAppearanceParams::TC_MODE_SATUR){ // - double parsat=0.8; + double parsat=0.8;//0.6 double coef=327.68/parsat; float Ss=(float) spro*coef; float Sold=Ss; const Saturcurve& userColCurve = static_cast(customColCurve3); userColCurve.Apply(Ss); - Ss=0.7f*(Ss-Sold)+Sold;//divide sensibility saturation + Ss=0.6f*(Ss-Sold)+Sold;//divide sensibility saturation double coe=pow(fl,0.25); float dred=100.f;// in C mode float protect_red=80.0f; // in C mode @@ -576,7 +576,7 @@ if(params->colorappearance.enabled) { } else if (curveMode3==ColorAppearanceParams::TC_MODE_COLORF){ // - double parsat=1.; + double parsat=0.8;//0.68; double coef=327.68/parsat; float Mm=(float) Mpro*coef; float Mold=Mm; @@ -1622,11 +1622,15 @@ void ImProcFunctions::colorCurve (LabImage* lold, LabImage* lnew) { #include "EdgePreservingDecomposition.cc" void ImProcFunctions::EPDToneMap(LabImage *lab, unsigned int Iterates, int skip){ //Hasten access to the parameters. - EPDParams *p = (EPDParams *)(¶ms->edgePreservingDecompositionUI); +// EPDParams *p = (EPDParams *)(¶ms->edgePreservingDecompositionUI); //Enabled? Leave now if not. - if(!p->enabled) return; - +// if(!p->enabled) return; +if(!params->edgePreservingDecompositionUI.enabled) return; +float stren=params->edgePreservingDecompositionUI.Strength; +float edgest=params->edgePreservingDecompositionUI.EdgeStopping; +float sca=params->edgePreservingDecompositionUI.Scale; +float rew=params->edgePreservingDecompositionUI.ReweightingIterates; //Pointers to whole data and size of it. float *L = lab->L[0]; float *a = lab->a[0]; @@ -1645,12 +1649,12 @@ void ImProcFunctions::EPDToneMap(LabImage *lab, unsigned int Iterates, int skip) L[i] = (L[i] - minL)/32767.0f; //Some interpretations. - float Compression = expf(-p->Strength); //This modification turns numbers symmetric around 0 into exponents. - float DetailBoost = p->Strength; - if(p->Strength < 0.0f) DetailBoost = 0.0f; //Go with effect of exponent only if uncompressing. + float Compression = expf(-stren); //This modification turns numbers symmetric around 0 into exponents. + float DetailBoost = stren; + if(stren < 0.0f) DetailBoost = 0.0f; //Go with effect of exponent only if uncompressing. //Auto select number of iterates. Note that p->EdgeStopping = 0 makes a Gaussian blur. - if(Iterates == 0) Iterates = (unsigned int)(p->EdgeStopping*15.0); + if(Iterates == 0) Iterates = (unsigned int)(edgest*15.0); /* Debuggery. Saves L for toying with outside of RT. char nm[64]; @@ -1659,7 +1663,7 @@ FILE *f = fopen(nm, "wb"); fwrite(L, N, sizeof(float), f); fclose(f);*/ - epd.CompressDynamicRange(L, (float)p->Scale/skip, (float)p->EdgeStopping, Compression, DetailBoost, Iterates, p->ReweightingIterates, L); + epd.CompressDynamicRange(L, (float)sca/skip, (float)edgest, Compression, DetailBoost, Iterates, rew, L); //Restore past range, also desaturate a bit per Mantiuk's Color correction for tone mapping. float s = (1.0f + 38.7889f)*powf(Compression, 1.5856f)/(1.0f + 38.7889f*powf(Compression, 1.5856f)); diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 3740c787f..d89082b24 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -221,8 +221,8 @@ namespace rtengine { * @param histBlue is the array of size 256 containing the histogram of the blue channel * @param histLuma is the array of size 256 containing the histogram of the luminance channel * other for curves backgrounds, histRAW is RAW without colors */ - virtual void histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, - LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw) {} + virtual void histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, + LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw, LUTu & histChroma) {} }; /** This listener is used when the auto exposure has been recomputed (e.g. when the clipping ratio changed). */ diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 16dedef75..4a73d4e97 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -697,6 +697,8 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei ipf.setScale (sqrt(double(fw*fw+fh*fh))/sqrt(double(thumbImg->width*thumbImg->width+thumbImg->height*thumbImg->height))*scale); LUTu hist16 (65536); + LUTu hist16C (65536); + double gamma = isRaw ? Color::sRGBGamma : 0; // usually in ImageSource, but we don't have that here ipf.firstAnalysis (baseImg, ¶ms, hist16, gamma); @@ -768,13 +770,15 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei delete shmap; // luminance histogram update - hist16.clear(); + hist16.clear();hist16C.clear(); for (int i=0; iL[i][j])))]++; - + hist16C=CLIP((int)sqrt(labView->a[i][j]*labView->a[i][j] + labView->b[i][j]*labView->b[i][j])); + } // luminance processing - ipf.EPDToneMap(labView,0,6); +// ipf.EPDToneMap(labView,0,6); + bool utili=false; bool autili=false; bool butili=false; @@ -783,15 +787,20 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei CurveFactory::complexLCurve (params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, hist16, hist16, curve, dummy, 16, utili); CurveFactory::complexsgnCurve (autili, butili, ccutili, cclutili, params.labCurve.chromaticity, params.labCurve.rstprotection, - params.labCurve.acurve, params.labCurve.bcurve,params.labCurve.cccurve,params.labCurve.lccurve, curve1, curve2, satcurve,lhskcurve, 16); + params.labCurve.acurve, params.labCurve.bcurve,params.labCurve.cccurve,params.labCurve.lccurve, curve1, curve2, satcurve,lhskcurve, + hist16C, hist16C, dummy, + 16); //ipf.luminanceCurve (labView, labView, curve); ipf.chromiLuminanceCurve (labView, labView, curve1, curve2, satcurve,lhskcurve, curve, utili, autili, butili, ccutili,cclutili); ipf.vibrance(labView); + ipf.EPDToneMap(labView,0,6); + CurveFactory::curveLightBrightColor ( params.colorappearance.curveMode, params.colorappearance.curve, params.colorappearance.curveMode2, params.colorappearance.curve2, params.colorappearance.curveMode3, params.colorappearance.curve3, - + hist16, hist16, dummy, + hist16C, hist16C, dummy, customColCurve1, customColCurve2, customColCurve3, diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 943db17fb..ef12e0e60 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -117,6 +117,8 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p // perform first analysis LUTu hist16 (65536); + LUTu hist16C (65536); + ipf.firstAnalysis (baseImg, ¶ms, hist16, imgsrc->getGamma()); // perform transform (excepted resizing) @@ -200,14 +202,14 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p // start tile processing...??? // luminance histogram update - hist16.clear(); + hist16.clear(); hist16C.clear(); for (int i=0; iL[i][j])))]++; - + hist16C=CLIP((int)sqrt(labView->a[i][j]*labView->a[i][j] + labView->b[i][j]*labView->b[i][j])); + } // luminance processing - - ipf.EPDToneMap(labView); +// ipf.EPDToneMap(labView); bool utili=false; bool autili=false; bool butili=false; @@ -216,9 +218,13 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p CurveFactory::complexLCurve (params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, hist16, hist16, curve, dummy, 1, utili); CurveFactory::complexsgnCurve (autili, butili, ccutili, cclutili, params.labCurve.chromaticity, params.labCurve.rstprotection, - params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve,params.labCurve.lccurve,curve1, curve2, satcurve,lhskcurve, 1); + params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve,params.labCurve.lccurve,curve1, curve2, satcurve,lhskcurve, + hist16C, hist16C,dummy, + 1); //ipf.luminanceCurve (labView, labView, curve); ipf.chromiLuminanceCurve (labView, labView, curve1, curve2, satcurve,lhskcurve,curve, utili, autili, butili, ccutili,cclutili); + ipf.EPDToneMap(labView); + ipf.vibrance(labView); ipf.impulsedenoise (labView); @@ -248,6 +254,8 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p params.colorappearance.curveMode, params.colorappearance.curve, params.colorappearance.curveMode2, params.colorappearance.curve2, params.colorappearance.curveMode3, params.colorappearance.curve3, + hist16, hist16,dummy, + hist16C, hist16C,dummy, customColCurve1, customColCurve2, customColCurve3, diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 608c21724..bc162d1fd 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -186,6 +186,7 @@ ColorAppearance::ColorAppearance () : Gtk::VBox(), FoldableToolPanel(this) { curveEditorG = new CurveEditorGroup (options.lastToneCurvesDir, M("TP_COLORAPP_CURVEEDITOR1")); curveEditorG->setCurveListener (this); + curveEditorG->setTooltip(M("TP_COLORAPP_CURVEEDITOR1_TOOLTIP")); shape = static_cast(curveEditorG->addCurve(CT_Diagonal, "", toneCurveMode)); @@ -923,6 +924,15 @@ void ColorAppearance::setBatchMode (bool batchMode) { // curveEditorG3->setBatchMode (batchMode); } +void ColorAppearance::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma){ + + shape->updateBackgroundHistogram (histLCAM); + shape3->updateBackgroundHistogram (histCCAM); + +} + + + void ColorAppearance::setAdjusterBehavior (bool degreeadd, bool adapscenadd, bool adaplumadd, bool jlightadd, bool chromaadd, bool contrastadd, bool rstprotectionadd, bool qbrightadd, bool qcontrastadd, bool schromaadd, bool mchromaadd, bool colorhadd) { degree->setAddMode(degreeadd); diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index e0c6025c3..08690f028 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -114,7 +114,7 @@ class ColorAppearance : public Gtk::VBox, public AdjusterListener, public Foldab void setAdjusterBehavior (bool degreeadd, bool adapscenadd, bool adaplumadd, bool jlightadd, bool chromaadd, bool contrastadd, bool rstprotectionadd, bool qbrightadd, bool qcontrastadd, bool schromaadd, bool mchromaadd, bool colorhadd); void trimValues (rtengine::procparams::ProcParams* pp); - + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); virtual void colorForValue (double valX, double valY, int callerId, ColorCaller *caller); }; diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index b65890e59..3ccbd0dec 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1385,11 +1385,11 @@ void EditorPanel::tbBeforeLock_toggled () { tbBeforeLock->get_active()? tbBeforeLock->set_image (*iBeforeLockON) : tbBeforeLock->set_image (*iBeforeLockOFF); } -void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, - LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw) { +void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, + LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw , LUTu & histChroma) { - if (histogramPanel) histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw); - tpc->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histRed, histGreen, histBlue, histLuma); + if (histogramPanel) histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw, histChroma); + tpc->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma); } bool EditorPanel::CheckSidePanelsVisibility() { diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 46d8dc557..a3fa24823 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -160,8 +160,8 @@ class EditorPanel : public Gtk::VBox, void historyBeforeLineChanged (const rtengine::procparams::ProcParams& params); // HistogramListener - void histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, - LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw); + void histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, + LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw, LUTu & histChroma); // event handlers void info_toggled (); diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index ec092ac04..a672edb84 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -23,6 +23,7 @@ #include #include "../rtengine/LUT.h" #include "rtimage.h" +#include "../rtengine/improccoordinator.h" extern Glib::ustring argv0; extern Options options; @@ -47,6 +48,7 @@ HistogramPanel::HistogramPanel () { greenImage = new RTImage ("histGreen.png"); blueImage = new RTImage ("histBlue.png"); valueImage = new RTImage ("histValue.png"); + chroImage = new RTImage ("histChro.png"); rawImage = new RTImage ("histRaw.png"); fullImage = new RTImage ("histFull.png"); barImage = new RTImage ("histBar.png"); @@ -55,6 +57,7 @@ HistogramPanel::HistogramPanel () { greenImage_g = new RTImage ("histGreeng.png"); blueImage_g = new RTImage ("histBlueg.png"); valueImage_g = new RTImage ("histValueg.png"); + chroImage_g = new RTImage ("histChrog.png"); rawImage_g = new RTImage ("histRawg.png"); fullImage_g = new RTImage ("histFullg.png"); barImage_g = new RTImage ("histBarg.png"); @@ -63,6 +66,7 @@ HistogramPanel::HistogramPanel () { showGreen = Gtk::manage (new Gtk::ToggleButton ()); showBlue = Gtk::manage (new Gtk::ToggleButton ()); showValue = Gtk::manage (new Gtk::ToggleButton ()); + showChro = Gtk::manage (new Gtk::ToggleButton ()); showRAW = Gtk::manage (new Gtk::ToggleButton ()); showFull = Gtk::manage (new Gtk::ToggleButton ()); showBAR = Gtk::manage (new Gtk::ToggleButton ()); @@ -71,6 +75,7 @@ HistogramPanel::HistogramPanel () { showGreen->set_name("histButton"); showGreen->set_can_focus(false); showBlue->set_name("histButton"); showBlue->set_can_focus(false); showValue->set_name("histButton"); showValue->set_can_focus(false); + showChro->set_name("histButton"); showChro->set_can_focus(false); showRAW->set_name("histButton"); showRAW->set_can_focus(false); showFull->set_name("fullButton"); showFull->set_can_focus(false); showBAR->set_name("histButton"); showBAR->set_can_focus(false); @@ -79,6 +84,7 @@ HistogramPanel::HistogramPanel () { showGreen->set_relief (Gtk::RELIEF_NONE); showBlue->set_relief (Gtk::RELIEF_NONE); showValue->set_relief (Gtk::RELIEF_NONE); + showChro->set_relief (Gtk::RELIEF_NONE); showRAW->set_relief (Gtk::RELIEF_NONE); showFull->set_relief (Gtk::RELIEF_NONE); showBAR->set_relief (Gtk::RELIEF_NONE); @@ -87,6 +93,7 @@ HistogramPanel::HistogramPanel () { showGreen->set_tooltip_text (M("HISTOGRAM_TOOLTIP_G")); showBlue->set_tooltip_text (M("HISTOGRAM_TOOLTIP_B")); showValue->set_tooltip_text (M("HISTOGRAM_TOOLTIP_L")); + showChro->set_tooltip_text (M("HISTOGRAM_TOOLTIP_CHRO")); showRAW->set_tooltip_text (M("HISTOGRAM_TOOLTIP_RAW")); showFull->set_tooltip_text (M("HISTOGRAM_TOOLTIP_FULL")); showBAR->set_tooltip_text (M("HISTOGRAM_TOOLTIP_BAR")); @@ -96,6 +103,7 @@ HistogramPanel::HistogramPanel () { showGreen->set_active (true); showBlue->set_active (true); showValue->set_active (true); + showChro->set_active (true); showRAW->set_active (false); showFull->set_active (!options.histogramFullMode); showBAR->set_active (options.histogramBar); @@ -104,6 +112,7 @@ HistogramPanel::HistogramPanel () { showGreen->set_image (showGreen->get_active() ? *greenImage : *greenImage_g); showBlue->set_image (showBlue->get_active() ? *blueImage : *blueImage_g); showValue->set_image (showValue->get_active() ? *valueImage : *valueImage_g); + showChro->set_image (showChro->get_active() ? *chroImage : *chroImage_g); showRAW->set_image (showRAW->get_active() ? *rawImage : *rawImage_g); showFull->set_image (showFull->get_active() ? *fullImage : *fullImage_g); showBAR->set_image (showBAR->get_active() ? *barImage : *barImage_g); @@ -112,6 +121,7 @@ HistogramPanel::HistogramPanel () { showGreen->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::green_toggled), showGreen ); showBlue->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::blue_toggled), showBlue ); showValue->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::value_toggled), showValue ); + showChro->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::chro_toggled), showChro ); showRAW->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::raw_toggled), showRAW ); showFull->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::full_toggled), showFull ); showBAR->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::bar_toggled), showBAR ); @@ -120,7 +130,8 @@ HistogramPanel::HistogramPanel () { buttonVBox->pack_start (*showGreen, Gtk::PACK_SHRINK, 0); buttonVBox->pack_start (*showBlue, Gtk::PACK_SHRINK, 0); buttonVBox->pack_start (*showValue, Gtk::PACK_SHRINK, 0); - buttonVBox->pack_start (*showRAW, Gtk::PACK_SHRINK, 0); + buttonVBox->pack_start (*showChro, Gtk::PACK_SHRINK, 0); + buttonVBox->pack_start (*showRAW, Gtk::PACK_SHRINK, 0); buttonVBox->pack_start (*showFull, Gtk::PACK_SHRINK, 0); buttonVBox->pack_start (*showBAR, Gtk::PACK_SHRINK, 0); @@ -144,6 +155,7 @@ HistogramPanel::~HistogramPanel () { delete greenImage; delete blueImage; delete valueImage; + delete chroImage; delete rawImage; delete fullImage; delete barImage; @@ -152,9 +164,11 @@ HistogramPanel::~HistogramPanel () { delete greenImage_g; delete blueImage_g; delete valueImage_g; + delete chroImage_g; delete rawImage_g; delete fullImage_g; delete barImage_g; + } void HistogramPanel::resized (Gtk::Allocation& req) { @@ -206,14 +220,23 @@ void HistogramPanel::value_toggled () { showValue->set_image(showValue->get_active() ? *valueImage : *valueImage_g); rgbv_toggled(); } +void HistogramPanel::chro_toggled () { + removeIfThere(showChro, chroImage, false); + removeIfThere(showChro, chroImage_g, false); + showChro->set_image(showChro->get_active() ? *chroImage : *chroImage_g); + rgbv_toggled(); +} + void HistogramPanel::raw_toggled () { if (showRAW->get_active()) { showRAW->set_image(*rawImage); showValue->set_sensitive(false); + showChro->set_sensitive(false); } else { showRAW->set_image(*rawImage_g); showValue->set_sensitive(true); + showChro->set_sensitive(true); } rgbv_toggled(); } @@ -226,13 +249,12 @@ void HistogramPanel::bar_toggled () { showBAR->set_image(showBAR->get_active() ? *barImage : *barImage_g); rgbv_toggled(); } - void HistogramPanel::rgbv_toggled () { // Update Display - histogramArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showRAW->get_active(), showFull->get_active()); + histogramArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showRAW->get_active(), showFull->get_active(), showChro->get_active()); histogramArea->queue_draw (); - histogramRGBArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showRAW->get_active(), showBAR->get_active()); + histogramRGBArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showRAW->get_active(), showBAR->get_active(), showChro->get_active()); histogramRGBArea->renderRGBMarks (0,0,0); histogramArea->queue_draw (); } @@ -290,7 +312,7 @@ void HistogramPanel::toggle_button_full () { // // HistogramRGBArea HistogramRGBArea::HistogramRGBArea () : - frozen(false), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(true), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar) { + frozen(false), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(true), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(true){ harih = new HistogramRGBAreaIdleHelper; harih->harea = this; @@ -384,6 +406,14 @@ void HistogramRGBArea::renderRGBMarks (int r, int g, int b) { cr->line_to((int)((r+g+b)/3*(winw/256.0)), winh-0); cr->stroke(); } + if (needChroma) { + // Luma + cr->set_source_rgb(1.0, 1.0, 1.0); + cr->move_to((int)((r+g+b)/3*(winw/256.0)), 0); + cr->line_to((int)((r+g+b)/3*(winw/256.0)), winh-0); + cr->stroke(); + } + } } @@ -427,7 +457,7 @@ void HistogramRGBArea::update (int valh, int rh, int gh, int bh) { g_idle_add (histrgbupdate, harih); } -void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool bar) { +void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool bar, bool c) { needRed = r; needGreen = g; @@ -435,6 +465,7 @@ void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, needLuma = l; rawMode = raw; showMode = bar; + needChroma = c; // Histogram RGB BAR button logic goes here @@ -516,12 +547,13 @@ void HistogramRGBArea::styleChanged (const Glib::RefPtr& style) { // // HistogramArea HistogramArea::HistogramArea (FullModeListener *fml) : - valid(false), fullMode(options.histogramFullMode), myFullModeListener(fml), oldwidth(-1), needLuma(true), needRed(true), needGreen(true), needBlue(true), rawMode(false) { + valid(false), fullMode(options.histogramFullMode), myFullModeListener(fml), oldwidth(-1), needLuma(true), needRed(true), needGreen(true), needBlue(true), rawMode(false), needChroma(true) { lhist(256); rhist(256); ghist(256); bhist(256); + chist(256); haih = new HistogramAreaIdleHelper; haih->harea = this; @@ -540,7 +572,7 @@ HistogramArea::~HistogramArea () { } -void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool full) { +void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool full, bool c) { needRed = r; needGreen = g; @@ -548,6 +580,7 @@ void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, boo needLuma = l; rawMode = raw; fullMode = !full; + needChroma = c; renderHistogram (); } @@ -573,10 +606,10 @@ int histupdateUI (void* data) { return 0; } -void HistogramArea::update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) { +void HistogramArea::update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma) { if (histRed) { - lhist=histLuma; + lhist=histLuma;chist=histChroma; rhist=histRed; ghist=histGreen; bhist=histBlue; rhistRaw=histRedRaw; ghistRaw=histGreenRaw; bhistRaw=histBlueRaw; @@ -619,6 +652,8 @@ void HistogramArea::renderHistogram () { for (int i=1; i<255; i++) { if (needLuma && lhist[i]>fullhistheight) fullhistheight = lhist[i]; + if (needChroma && chist[i]>fullhistheight) + fullhistheight = chist[i]; if (needRed && (rawMode?rhistRaw:rhist)[i]>fullhistheight) fullhistheight = rh[i]; if (needGreen && (rawMode?ghistRaw:ghist)[i]>fullhistheight) @@ -633,7 +668,7 @@ void HistogramArea::renderHistogram () { int area = 0; for (int i=0; ii) || (needRed && rh[j]>i) || (needGreen && gh[j]>i) || (needBlue && bh[j]>i)) + if ((needLuma && !rawMode && lhist[j]>i) || (needChroma && !rawMode && chist[j]>i) || (needRed && rh[j]>i) || (needGreen && gh[j]>i) || (needBlue && bh[j]>i)) area++; if ((double)area / (256*(i+1)) < 0.3) { realhistheight = i; @@ -654,12 +689,23 @@ void HistogramArea::renderHistogram () { if (needLuma && !rawMode) { drawCurve(cr, lhist, realhistheight, winw, winh); cr->set_source_rgb (0.75, 0.75, 0.75); - cr->fill_preserve (); + cr->fill_preserve (); cr->set_source_rgb (0.5, 0.5, 0.5); - cr->stroke (); + cr->stroke (); drawMarks(cr, lhist, realhistheight, winw, ui, oi); } + if (needChroma && !rawMode) { + drawCurve(cr, chist, realhistheight, winw, winh); + cr->set_source_rgb (1.0, 1.0, 1.0); + cr->fill_preserve (); + cr->set_source_rgb (0.2, 0.2, 0.1); + cr->stroke (); + + drawMarks(cr, lhist, realhistheight, winw, ui, oi); + } + + if (needRed) { drawCurve(cr, rh, realhistheight, winw, winh); cr->set_source_rgb (1.0, 0.0, 0.0); diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 0ae4c481e..6e32a52ac 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -23,6 +23,7 @@ #include #include #include "../rtengine/LUT.h" +#include "../rtengine/improccoordinator.h" #include "pointermotionlistener.h" @@ -71,6 +72,7 @@ class HistogramRGBArea : public Gtk::DrawingArea { bool rawMode; bool showMode; bool barDisplayed; + bool needChroma; Gtk::VBox* parent; @@ -88,7 +90,7 @@ class HistogramRGBArea : public Gtk::DrawingArea { void setParent (Gtk::VBox* p) { parent = p; }; void update (int val, int rh, int gh, int bh); - void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool show); + void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool show, bool c); void on_realize(); bool on_expose_event(GdkEventExpose* event); @@ -104,7 +106,7 @@ class FullModeListener { virtual void toggle_button_full () {} }; -class HistogramArea : public Gtk::DrawingArea { +class HistogramArea : public Gtk::DrawingArea{ protected: @@ -119,7 +121,7 @@ class HistogramArea : public Gtk::DrawingArea { Gdk::Color lgray; Gdk::Color mgray; Gdk::Color dgray; - LUTu lhist, rhist, ghist, bhist; + LUTu lhist, rhist, ghist, bhist, chist; LUTu lhistRaw, rhistRaw, ghistRaw, bhistRaw; bool valid; @@ -127,7 +129,7 @@ class HistogramArea : public Gtk::DrawingArea { FullModeListener *myFullModeListener; int oldwidth, oldheight; - bool needLuma, needRed, needGreen, needBlue, rawMode; + bool needLuma, needRed, needGreen, needBlue, rawMode, needChroma; HistogramAreaIdleHelper* haih; @@ -137,8 +139,8 @@ class HistogramArea : public Gtk::DrawingArea { ~HistogramArea(); void renderHistogram (); - void update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw); - void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool full); + void update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma); + void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool full , bool c); void on_realize(); bool on_expose_event(GdkEventExpose* event); bool on_button_press_event (GdkEventButton* event); @@ -165,6 +167,7 @@ class HistogramPanel : public Gtk::HBox, public PointerMotionListener, public Fu Gtk::ToggleButton* showRAW; Gtk::ToggleButton* showFull; Gtk::ToggleButton* showBAR; + Gtk::ToggleButton* showChro; Gtk::Image *redImage; Gtk::Image *greenImage; @@ -173,6 +176,7 @@ class HistogramPanel : public Gtk::HBox, public PointerMotionListener, public Fu Gtk::Image *rawImage; Gtk::Image *fullImage; Gtk::Image *barImage; + Gtk::Image *chroImage; Gtk::Image *redImage_g; Gtk::Image *greenImage_g; @@ -181,6 +185,7 @@ class HistogramPanel : public Gtk::HBox, public PointerMotionListener, public Fu Gtk::Image *rawImage_g; Gtk::Image *fullImage_g; Gtk::Image *barImage_g; + Gtk::Image *chroImage_g; sigc::connection rconn; @@ -191,8 +196,8 @@ class HistogramPanel : public Gtk::HBox, public PointerMotionListener, public Fu HistogramPanel (); ~HistogramPanel (); - void histogramChanged (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) { - histogramArea->update (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw); + void histogramChanged (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma) { + histogramArea->update (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw, histChroma); } // pointermotionlistener interface void pointerMoved (bool validPos, Glib::ustring profile, int x, int y, int r, int g, int b); @@ -208,7 +213,8 @@ class HistogramPanel : public Gtk::HBox, public PointerMotionListener, public Fu void value_toggled (); void raw_toggled (); void full_toggled (); - void bar_toggled (); + void chro_toggled (); + void bar_toggled (); void rgbv_toggled (); void resized (Gtk::Allocation& req); diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index 7167b705f..4cc81855f 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -84,6 +84,8 @@ LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) { curveEditorG->setCurveListener (this); lshape = static_cast(curveEditorG->addCurve(CT_Diagonal, "L")); + lshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_LL_TOOLTIP")); + ashape = static_cast(curveEditorG->addCurve(CT_Diagonal, "a")); ashape->setRangeLabels( M("TP_LABCURVE_CURVEEDITOR_A_RANGE1"), M("TP_LABCURVE_CURVEEDITOR_A_RANGE2"), @@ -494,9 +496,11 @@ void LCurve::setBatchMode (bool batchMode) { } -void LCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma){ +void LCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma){ lshape->updateBackgroundHistogram (histLCurve); + ccshape->updateBackgroundHistogram (histCCurve); + } void LCurve::setAdjusterBehavior (bool bradd, bool contradd, bool satadd) { diff --git a/rtgui/labcurve.h b/rtgui/labcurve.h index 91fc56402..ff816f490 100644 --- a/rtgui/labcurve.h +++ b/rtgui/labcurve.h @@ -70,7 +70,7 @@ class LCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPan void bwtoning_toggled(); void lcredsk_toggled(); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); virtual void colorForValue (double valX, double valY, int callerId, ColorCaller* caller); }; diff --git a/rtgui/options.cc b/rtgui/options.cc index 7d5116dd5..d4fc3002d 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -302,6 +302,7 @@ void Options::setDefaults () { histogramPosition = 2; histogramBar = true; histogramFullMode = false; + showProfileSelector = true; FileBrowserToolbarSingleRow = false; hideTPVScrollbar = false; diff --git a/rtgui/rgbcurves.cc b/rtgui/rgbcurves.cc index 4fd0709bc..d7dbd14f8 100644 --- a/rtgui/rgbcurves.cc +++ b/rtgui/rgbcurves.cc @@ -121,10 +121,10 @@ void RGBCurves::setBatchMode (bool batchMode) { } -void RGBCurves::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { +void RGBCurves::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { - //Rshape->updateBackgroundHistogram (histRed); - //Gshape->updateBackgroundHistogram (histGreen); - //Bshape->updateBackgroundHistogram (histBlue); + // Rshape->updateBackgroundHistogram (histRed); + // Gshape->updateBackgroundHistogram (histGreen); + // Bshape->updateBackgroundHistogram (histBlue); } diff --git a/rtgui/rgbcurves.h b/rtgui/rgbcurves.h index 316c5e4d1..ee32d0077 100644 --- a/rtgui/rgbcurves.h +++ b/rtgui/rgbcurves.h @@ -45,7 +45,7 @@ class RGBCurves : public Gtk::VBox, public AdjusterListener, public FoldableTool void autoOpenCurve (); void curveChanged (CurveEditor* ce); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); }; #endif diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index ea89c653a..e35c4018f 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -576,7 +576,7 @@ void ToneCurve::trimValues (rtengine::procparams::ProcParams* pp) { saturation->trimValue(pp->toneCurve.saturation); } -void ToneCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { +void ToneCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { shape->updateBackgroundHistogram (histToneCurve); } diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index bd0e8649a..91f98dc59 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -91,7 +91,7 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool bool curveMode2Changed_ (); void expandCurve (bool isExpanded); bool isCurveExpanded (); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); }; #endif diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 98851937f..41ff8a6b7 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -90,6 +90,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) { addPanel (colorPanel, rgbcurves, M("TP_RGBCURVES_LABEL")); toolPanels.push_back (rgbcurves); addPanel (exposurePanel, edgePreservingDecompositionUI, M("TP_EPD_LABEL")); toolPanels.push_back (edgePreservingDecompositionUI); addPanel (exposurePanel, lcurve, M("TP_LABCURVE_LABEL")); toolPanels.push_back (lcurve); +// addPanel (exposurePanel, edgePreservingDecompositionUI, M("TP_EPD_LABEL")); toolPanels.push_back (edgePreservingDecompositionUI); addPanel (exposurePanel, colorappearance, M("TP_COLORAPP_LABEL")); toolPanels.push_back (colorappearance); addPanel (detailsPanel, impulsedenoise, M("TP_IMPULSEDENOISE_LABEL")); toolPanels.push_back (impulsedenoise); addPanel (detailsPanel, dirpyrdenoise, M("TP_DIRPYRDENOISE_LABEL")); toolPanels.push_back (dirpyrdenoise); @@ -517,11 +518,11 @@ int ToolPanelCoordinator::getSpotWBRectSize () { return whitebalance->getSize (); } -void ToolPanelCoordinator::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { - - toneCurve->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histRed, histGreen, histBlue, histLuma); - rgbcurves->updateCurveBackgroundHistogram(histToneCurve, histLCurve,histRed,histGreen, histBlue, histLuma); - lcurve->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histRed, histGreen, histBlue, histLuma); +void ToolPanelCoordinator::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { + colorappearance->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM,histRed, histGreen, histBlue, histLuma); + toneCurve->updateCurveBackgroundHistogram (histToneCurve, histLCurve,histCCurve, histLCAM, histCCAM,histRed, histGreen, histBlue, histLuma); + lcurve->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM,histRed, histGreen, histBlue, histLuma); + rgbcurves->updateCurveBackgroundHistogram(histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM,histRed,histGreen, histBlue, histLuma); } void ToolPanelCoordinator::foldAllButOne (Gtk::Box* parent, FoldableToolPanel* openedSection) { diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index 857330a70..a37504193 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -179,7 +179,7 @@ class ToolPanelCoordinator : public ToolPanelListener, virtual ~ToolPanelCoordinator (); bool getChangedState () { return hasChanged; } - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve,LUTu & histCCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); void foldAllButOne (Gtk::Box* parent, FoldableToolPanel* openedSection); // multiple listeners can be added that are notified on changes (typical: profile panel and the history)