From 9da57ecb83246fd34ae371c82d0fb89ba7f459d5 Mon Sep 17 00:00:00 2001 From: jdc Date: Mon, 14 Apr 2014 07:12:23 +0200 Subject: [PATCH] Pipette in Lab Mode and improving data Navigator and histogram panel issue2327 --- rtdata/languages/default | 2 + rtengine/curves.cc | 13 ++-- rtengine/curves.h | 2 +- rtengine/dcrop.cc | 9 ++- rtengine/improccoordinator.cc | 24 +++++-- rtengine/improcfun.cc | 80 ++++++++++++++++----- rtengine/rtengine.h | 2 +- rtengine/rtthumbnail.cc | 2 +- rtengine/settings.h | 1 + rtengine/simpleprocess.cc | 2 +- rtgui/colorappearance.cc | 2 +- rtgui/colorappearance.h | 2 +- rtgui/cropwindow.cc | 18 +++-- rtgui/editid.h | 8 +++ rtgui/editorpanel.cc | 4 +- rtgui/editorpanel.h | 2 +- rtgui/histogrampanel.cc | 127 +++++++++++++++++++++++----------- rtgui/histogrampanel.h | 6 +- rtgui/labcurve.cc | 27 +++++++- rtgui/labcurve.h | 2 +- rtgui/navigator.cc | 114 +++++++++++++++++++++--------- rtgui/navigator.h | 4 +- rtgui/options.cc | 4 ++ rtgui/options.h | 27 ++++---- rtgui/pointermotionlistener.h | 2 +- rtgui/preferences.cc | 8 +++ rtgui/preferences.h | 1 + rtgui/rgbcurves.cc | 2 +- rtgui/rgbcurves.h | 2 +- rtgui/tonecurve.cc | 2 +- rtgui/tonecurve.h | 2 +- rtgui/toolpanelcoord.cc | 10 +-- rtgui/toolpanelcoord.h | 2 +- 33 files changed, 368 insertions(+), 147 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 7ff0427d8..2d68ceaef 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -742,6 +742,8 @@ PREFERENCES_GREY30;Yb=30 CIE L#60 PREFERENCES_GREY40;Yb=40 CIE L#70 PREFERENCES_GREY;Output device's Yb luminance (%) PREFERENCES_HISTOGRAMPOSITIONLEFT;Histogram in left panel +PREFERENCES_HISTOGRAMWORKING;Histogram and Navigator using Working Profile +PREFERENCES_HISTOGRAM_TOOLTIP;if enabled use Working Profile instead of Output Profile (with gamma), for Navigator and histogram display PREFERENCES_HLTHRESHOLD;Threshold for clipped highlights PREFERENCES_ICCDIR;Directory containing color profiles PREFERENCES_IMPROCPARAMS;Default Image Processing Parameters diff --git a/rtengine/curves.cc b/rtengine/curves.cc index e7177d45e..60afbf8fe 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -390,7 +390,7 @@ void CurveFactory::curveCL ( bool & clcutili,const std::vector& clcurveP } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - void CurveFactory::complexsgnCurve ( bool & autili, bool & butili, bool & ccutili, bool & cclutili, double saturation, double rstprotection, + void CurveFactory::complexsgnCurve (float adjustr, 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, LUTu & histogramC, LUTu & histogramLC, LUTu & outBeforeCCurveHistogram,LUTu & outBeforeLCurveHistogram, //for chroma @@ -402,10 +402,11 @@ void CurveFactory::curveCL ( bool & clcutili,const std::vector& clcurveP bool needed; DiagonalCurve* dCurve = NULL; LUTf dCcurve(65536,0); - - for (int i=0; i<48000; i++) { //# 32768*1.414 approximation maxi for chroma - dCcurve[i] = (float)i / 47999.0; + int k=48000;//32768*1.41 + for (int i=0; i& clcurveP if (dCurve && !dCurve->isIdentity()) {needed = true;ccutili=true;} } - for (int i=0; i<48000; i++) {//32768*1.414 + ... + for (int i=0; i& clcurveP if (dCurve && !dCurve->isIdentity()) {needed = true;cclutili=true;} } - for (int i=0; i<48000; i++) {//32768*1.414 + ... + for (int i=0; i& clcurvePoints, LUTf & clCurve, LUTu & histogramcl, LUTu & outBeforeCLurveHistogram, int skip); - static void complexsgnCurve ( bool & autili, bool & butili, bool & ccutili, bool & clcutili, double saturation, double rstprotection, const std::vector& acurvePoints, + static void complexsgnCurve ( float adjustr, bool & autili, bool & butili, bool & ccutili, bool & clcutili, 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, LUTu & histogramC, LUTu & histogramLC, LUTu & outBeforeCCurveHistogram,LUTu & outBeforeLCurveHistogram,///for chroma int skip=1); diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index d12755379..378f01782 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -352,8 +352,13 @@ void Crop::update (int todo) { if (cropImageListener) { // this in output space held in parallel to allow analysis like shadow/highlight Glib::ustring outProfile=params.icm.output; - if (params.icm.output=="" || params.icm.output==ColorManagementParams::NoICMString) outProfile="sRGB"; - Image8 *cropImgtrue = parent->ipf.lab2rgb (labnCrop, 0,0,cropw,croph, outProfile, false); + Glib::ustring workProfile=params.icm.working; + Image8 *cropImgtrue; + if(settings->HistogramWorking) cropImgtrue = parent->ipf.lab2rgb (labnCrop, 0,0,cropw,croph, workProfile, false); + else { + if (params.icm.output=="" || params.icm.output==ColorManagementParams::NoICMString) outProfile="sRGB"; + cropImgtrue = parent->ipf.lab2rgb (labnCrop, 0,0,cropw,croph, outProfile, false); + } int finalW = rqcropw; if (cropImg->getWidth()-leftBorder < finalW) diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index d3e4b148d..98c93f729 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -370,8 +370,19 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { clcutili=false; CurveFactory::curveCL(clcutili, params.labCurve.clcurve, clcurve, lhist16CLlad, histCLurve, scale==1 ? 1 : 16); + float adjustr=1.0f, adjustbg=1.0f; - CurveFactory::complexsgnCurve (autili, butili,ccutili,cclutili, params.labCurve.chromaticity, params.labCurve.rstprotection, + +/* if (params.icm.working=="ProPhoto") {adjustr = adjustbg = 1.2f;}// 1.2 instead 1.0 because it's very rare to have C>170.. + else if (params.icm.working=="Adobe RGB") {adjustr = 1.8f; adjustbg = 1.4f;} + else if (params.icm.working=="sRGB") {adjustr = 2.0f; adjustbg = 1.7f;} + else if (params.icm.working=="WideGamut") {adjustr = adjustbg = 1.2f;} + else if (params.icm.working=="Beta RGB") {adjustr = adjustbg = 1.4f;} + else if (params.icm.working=="BestRGB") {adjustr = adjustbg = 1.4f;} + else if (params.icm.working=="BruceRGB") {adjustr = 1.8f; adjustbg = 1.5f;} +*/ + adjustr=1.f; + CurveFactory::complexsgnCurve (adjustr, autili, butili,ccutili,cclutili, params.labCurve.chromaticity, params.labCurve.rstprotection, params.labCurve.acurve, params.labCurve.bcurve,params.labCurve.cccurve,params.labCurve.lccurve,chroma_acurve, chroma_bcurve, satcurve,lhskcurve, lhist16Clad, lhist16LLClad, histCCurve, histLLCurve, scale==1 ? 1 : 16); } @@ -535,8 +546,13 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { ipf.lab2monitorRgb (nprevl, previmg); delete workimg; Glib::ustring outProfile=params.icm.output; - if (params.icm.output=="" || params.icm.output==ColorManagementParams::NoICMString) outProfile="sRGB"; - workimg = ipf.lab2rgb (nprevl, 0,0,pW,pH, outProfile, true); + Glib::ustring workProfile=params.icm.working; + + if(settings->HistogramWorking) workimg = ipf.lab2rgb (nprevl, 0,0,pW,pH, workProfile, true); + else { + if (params.icm.output=="" || params.icm.output==ColorManagementParams::NoICMString) outProfile="sRGB"; + workimg = ipf.lab2rgb (nprevl, 0,0,pW,pH, outProfile, false); + } } catch(char * str) { @@ -557,7 +573,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { if (hListener) { updateLRGBHistograms (); - hListener->histogramChanged (histRed, histGreen, histBlue, histLuma, histToneCurve, histLCurve,histCCurve, histCLurve, histLLCurve, histLCAM, histCCAM, histRedRaw, histGreenRaw, histBlueRaw, histChroma); + hListener->histogramChanged (histRed, histGreen, histBlue, histLuma, histToneCurve, histLCurve,histCCurve, /*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRedRaw, histGreenRaw, histBlueRaw, histChroma); } } diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index fd87cae0c..cc12f0d16 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -3228,8 +3228,9 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI LUTf dLcurve; LUTu hist16Clad; - LUTu hist16CLlad; - LUTu hist16LLClad; +// LUTu hist16CLlad; +// LUTu hist16LLClad; + LUTu hist16Llad; bool chrop=false; float val; @@ -3238,21 +3239,28 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI dCcurve(65536,0); dLcurve(65536,0); hist16Clad(65536); - hist16CLlad(65536); - hist16LLClad(65536); +// hist16CLlad(65536); +// hist16LLClad(65536); + hist16Llad(65536); + chrop = true; for (int i=0; i<48000; i++) { //# 32768*1.414 approximation maxi for chroma val = (double)i / 47999.0; dCcurve[i] = CLIPD(val); } + // for (int i=0; i<65535; i++) { // a + // val = (double)i / 65534.0; + // dLcurve[i] = CLIPD(val); + // } for (int i=0; i<65535; i++) { // a val = (double)i / 65534.0; dLcurve[i] = CLIPD(val); } hist16Clad.clear(); - hist16CLlad.clear(); - hist16LLClad.clear(); + // hist16CLlad.clear(); + // hist16LLClad.clear(); + hist16Llad.clear(); } #ifdef _DEBUG @@ -3276,6 +3284,7 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI else if (params->icm.working=="BestRGB") {adjustr = adjustbg = 1.4f;} else if (params->icm.working=="BruceRGB") {adjustr = 1.8f; adjustbg = 1.5f;} + //adjustr=1.f; // reference to the params structure has to be done outside of the parallelization to avoid CPU cache problem bool highlight = params->toneCurve.hrenabled; //Get the value if "highlight reconstruction" is activated @@ -3361,13 +3370,20 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI float Lin=lold->L[i][j]; float Lprov2=Lin/327.68f; - if (editID == EUID_Lab_LCurve) - editWhatever->v(i,j) = LIM01(Lin/32768.0f); + if (editID == EUID_Lab_LCurve) + editWhatever->v(i,j) = LIM01(Lin/32768.0f);// Lab L pipette lnew->L[i][j] = curve[Lin]; float Lprov1=(lnew->L[i][j])/327.68f; float chromaChfactor=1.0f; + if (editID == EUID_Lab_aCurve){ + float chromapipa =lold->a[i][j]+(32768.f*1.28f); + editWhatever->v(i,j) = LIM01((chromapipa)/(65536.f*1.28f));}// Lab a pipette + if (editID == EUID_Lab_bCurve){ + float chromapipb =lold->b[i][j]+(32768.f*1.28f); + editWhatever->v(i,j) = LIM01((chromapipb)/(65536.f*1.28f));}//Lab b pipette + float atmp = acurve[lold->a[i][j]+32768.0f]-32768.0f;// curves Lab a float btmp = bcurve[lold->b[i][j]+32768.0f]-32768.0f;// curves Lab b float Chprov2=Chprov1; @@ -3375,6 +3391,13 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI bool inRGB; const float ClipLevel = 65535.0f; + if (editID == EUID_Lab_LHCurve || editID == EUID_Lab_CHCurve || editID == EUID_Lab_HHCurve) {//H pipette + float valpar =Color::huelab_to_huehsv2(HH); + editWhatever->v(i,j) = valpar; + } + + + if (lhutili) { // L=f(H) float l_r;//Luminance Lab in 0..1 l_r = Lprov1/100.f; @@ -3457,7 +3480,7 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI else if(Lprov1<75.0f) dred = -3.0f*Lprov1 +265.0f; else dred = 40.0f; // end pyramid - if(params->dirpyrDenoise.enabled && chromaticity ==0) chromaticity = 0.5f; + // if(params->dirpyrDenoise.enabled && chromaticity ==0) chromaticity = 0.5f; if(!bwToning){ float factorskin, factorsat, factor, factorskinext, interm; @@ -3503,6 +3526,8 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI Color::transitred ( HH, Chprov1, dred, factorskin, protect_red, factorskinext, deltaHH, factorsat, factor); atmp *= factor; btmp *= factor; + if (editID == EUID_Lab_CLCurve) + editWhatever->v(i,j) = LIM01(Lprov2/100.f);// Lab C=f(L) pipette if (clut) { // begin C=f(L) float factorskin,factorsat,factor,factorskinext,interm; @@ -3540,8 +3565,14 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI btmp *= factor; } // end C=f(L) + // if (editID == EUID_Lab_CLCurve) + // editWhatever->v(i,j) = LIM01(Lprov2/100.f);// Lab C=f(L) pipette // I have placed C=f(C) after all C treatments to assure maximum amplitude of "C" + if (editID == EUID_Lab_CCurve){ + float chromapip = sqrt(SQR(atmp)+SQR(btmp)+0.001f); + editWhatever->v(i,j) = LIM01((chromapip)/(48000.f));}//Lab C=f(C) pipette + if (ccut) { float factorskin,factorsat,factor,factorskinext,interm; float chroma = sqrt(SQR(atmp)+SQR(btmp)+0.001f); @@ -3579,6 +3610,10 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI atmp *= factor; btmp *= factor; } + // if (editID == EUID_Lab_CCurve){ + // float chromapip = sqrt(SQR(atmp)+SQR(btmp)+0.001f); + // editWhatever->v(i,j) = LIM01((chromapip)/(48000.f));}//Lab C=f(C) pipette + } // end chroma C=f(C) @@ -3586,9 +3621,16 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI if(pW!=1){//only with improccoordinator posp=CLIP((int)sqrt((atmp*atmp + btmp*btmp))); hist16Clad[posp]++; - hist16CLlad[posp]++; + // hist16CLlad[posp]++; + // hist16LLClad[posp]++; + } + if (editID == EUID_Lab_LCCurve){ + float chromapiplc = sqrt(SQR(atmp)+SQR(btmp)+0.001f); + editWhatever->v(i,j) = LIM01((chromapiplc)/(48000.f));}//Lab L=f(C) pipette + + if (!bwToning) { //apply curve L=f(C) for skin and rd...but also for extended color ==> near green and blue (see 'curf') const float xx=0.25f;//soft : between 0.2 and 0.4 @@ -3618,10 +3660,14 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI Lc=(Lc-1.0f)*zz+1.0f;//reduct action Lprov1*=Lc;//adjust luminance } - //update histo L + //update histo LC if(pW!=1){//only with improccoordinator - posl=CLIP((int(Lprov1*327.68f))); - hist16LLClad[posl]++; + posl=CLIP((int(Lprov1*327.68f))); + int posll=CLIP((int(Chprov1*327.68f))); + + //hist16LLClad[posll]++; + hist16Llad[posl]++; + } Chprov1 = sqrt(SQR(atmp/327.68f)+SQR(btmp/327.68f)); @@ -3713,7 +3759,9 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI float hval = dCcurve[i]; int hi = (int)(255.0*CLIPD(hval)); // histCCurve[hi] += hist16Clad[i] ; - histCLurve[hi] += hist16CLlad[i] ; + // histCLurve[hi] += hist16CLlad[i] ; + // histLLCurve[hi] += hist16LLClad[i] ; + } } //update histogram L with data luminance @@ -3721,8 +3769,8 @@ void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabI if (chrop) { float hlval = dLcurve[i]; int hli = (int)(255.0*CLIPD(hlval)); - histLLCurve[hli] += hist16LLClad[i] ; - histLCurve[hli] += hist16LLClad[i] ; + histLCurve[hli] += hist16Llad[i] ; + // histLLCurve[hli] += hist16LLClad[i] ; } } diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index a10f4bac0..430dae767 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -233,7 +233,7 @@ 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 & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, + virtual void histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve,LUTu & histLLCurve, */LUTu & histLCAM, LUTu & histCCAM, LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw, LUTu & histChroma) {} }; diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 18dc09916..74d34a94f 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -793,7 +793,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei CurveFactory::curveCL(clcutili, params.labCurve.clcurve, clcurve, hist16C, dummy, 16); - CurveFactory::complexsgnCurve (autili, butili, ccutili, cclutili,params.labCurve.chromaticity, params.labCurve.rstprotection, + CurveFactory::complexsgnCurve (1.f, 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, hist16C, hist16C, dummy, dummy, 16); diff --git a/rtengine/settings.h b/rtengine/settings.h index 8a57e593b..39ae44700 100644 --- a/rtengine/settings.h +++ b/rtengine/settings.h @@ -50,6 +50,7 @@ namespace rtengine { bool gamutICC; // no longer used bool gamutLch; bool ciecamfloat; + bool HistogramWorking; int amchroma; int protectred; double protectredh; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index eafc8ee0a..29f807df9 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -273,7 +273,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p CurveFactory::complexLCurve (params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve,hist16, hist16, lumacurve, dummy, 1, utili); CurveFactory::curveCL(clcutili, params.labCurve.clcurve, clcurve, hist16C, dummy, 1); - CurveFactory::complexsgnCurve (autili, butili, ccutili, cclutili, params.labCurve.chromaticity, params.labCurve.rstprotection, + CurveFactory::complexsgnCurve (1.f, 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, hist16C, hist16C, dummy,dummy, 1); diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index b622a814c..b0cb8c031 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -1173,7 +1173,7 @@ void ColorAppearance::setBatchMode (bool batchMode) { curveEditorG3->setBatchMode (batchMode); } -void ColorAppearance::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma){ +void ColorAppearance::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma){ shape->updateBackgroundHistogram (histLCAM); shape3->updateBackgroundHistogram (histCCAM); diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index 3129e995c..3fd053076 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -133,7 +133,7 @@ class ColorAppearance : public ToolParamBlock, public AdjusterListener, public F void setAdjusterBehavior (bool degreeadd, bool adapscenadd, bool adaplumadd, bool badpixsladd, 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 & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ 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/cropwindow.cc b/rtgui/cropwindow.cc index e9bc5fb19..ae603293d 100755 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -672,8 +672,16 @@ void CropWindow::pointerMoved (int bstate, int x, int y) { screenCoordToImage (x, y, mx, my); if (!onArea (CropImage, x, y) || !cropHandler.cropPixbuf) { cropHandler.getFullImageSize(mx,my); - pmlistener->pointerMoved (false, cropHandler.colorParams.working, mx, my, -1, -1, -1); - if (pmhlistener) pmhlistener->pointerMoved (false, cropHandler.colorParams.working, mx, my, -1, -1, -1); + // pmlistener->pointerMoved (false, cropHandler.colorParams.working, mx, my, -1, -1, -1); + // if (pmhlistener) pmhlistener->pointerMoved (false, cropHandler.colorParams.working, mx, my, -1, -1, -1); + /* Glib::ustring outputProfile; + outputProfile =cropHandler.colorParams.output ; + printf("Using \"%s\" output\n", outputProfile.c_str()); + if(outputProfile=="RT_sRGB") printf("OK SRGB2"); + */ + pmlistener->pointerMoved (false, cropHandler.colorParams.output,cropHandler.colorParams.working, mx, my, -1, -1, -1); + if (pmhlistener) pmhlistener->pointerMoved (false, cropHandler.colorParams.output,cropHandler.colorParams.working, mx, my, -1, -1, -1); + } else { /*MyMutex::MyLock lock(cropHandler.cimg); @@ -696,9 +704,11 @@ void CropWindow::pointerMoved (int bstate, int x, int y) { int imheight = cropHandler.cropPixbuf->get_height(); guint8* pix = cropHandler.cropPixbuftrue->get_pixels() + vy*cropHandler.cropPixbuf->get_rowstride() + vx*3; if (vx < imwidth && vy < imheight) { - pmlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]); + // pmlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]); + pmlistener->pointerMoved (true, cropHandler.colorParams.output, cropHandler.colorParams.working,mx, my, pix[0], pix[1], pix[2]); if (pmhlistener) - pmhlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]); + // pmhlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]); + pmhlistener->pointerMoved (true, cropHandler.colorParams.output, cropHandler.colorParams.working,mx, my, pix[0], pix[1], pix[2]); } cropHandler.cimg.unlock (); } diff --git a/rtgui/editid.h b/rtgui/editid.h index fee08ac9a..a1c43201a 100644 --- a/rtgui/editid.h +++ b/rtgui/editid.h @@ -27,6 +27,14 @@ enum EditUniqueID { EUID_ToneCurve1, EUID_ToneCurve2, EUID_Lab_LCurve, + EUID_Lab_CCurve, + EUID_Lab_LCCurve, + EUID_Lab_CLCurve, + EUID_Lab_LHCurve, + EUID_Lab_CHCurve, + EUID_Lab_HHCurve, + EUID_Lab_aCurve, + EUID_Lab_bCurve, EUID_RGB_R, EUID_RGB_G, EUID_RGB_B, diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 551cdc2ee..f2fa4770c 100755 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1508,11 +1508,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 & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, +void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw , LUTu & histChroma) { if (histogramPanel) histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw, histChroma); - tpc->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve, histCLurve, histLLCurve, histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma); + tpc->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve,/*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma); } bool EditorPanel::CheckSidePanelsVisibility() { diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 5ab7319ab..08ed55647 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -164,7 +164,7 @@ 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 & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, + void histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw, LUTu & histChroma); // event handlers diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 79a54cd94..2c9794f1d 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -26,6 +26,9 @@ #include "../rtengine/improccoordinator.h" #include "../rtengine/color.h" + +using namespace rtengine; + extern Glib::ustring argv0; extern Options options; @@ -278,7 +281,7 @@ void HistogramPanel::toggleFreeze () { return; } -void HistogramPanel::pointerMoved (bool validPos, Glib::ustring profile, int x, int y, int r, int g, int b) { +void HistogramPanel::pointerMoved (bool validPos, Glib::ustring profile, Glib::ustring profileW,int x, int y, int r, int g, int b) { if (!validPos) { // do something to un-show vertical bars @@ -287,7 +290,7 @@ void HistogramPanel::pointerMoved (bool validPos, Glib::ustring profile, int x, } else { // do something to show vertical bars - histogramRGBArea->renderRGBMarks(r, g, b, profile); + histogramRGBArea->renderRGBMarks(r, g, b, profile, profileW); histogramRGBArea->queue_draw (); } } @@ -343,7 +346,7 @@ void HistogramRGBArea::updateFreeze (bool f) { return; } -void HistogramRGBArea::renderRGBMarks (int r, int g, int b, Glib::ustring profile) { +void HistogramRGBArea::renderRGBMarks (int r, int g, int b, Glib::ustring profile, Glib::ustring profileW) { if (!is_realized ()) return; @@ -404,7 +407,7 @@ void HistogramRGBArea::renderRGBMarks (int r, int g, int b, Glib::ustring profil } if(needLuma || needChroma) { float Lab_L,Lab_a,Lab_b; - rgb2lab( profile, r,g,b,Lab_L,Lab_a,Lab_b); + rgb2lab( profile, profileW, r,g,b,Lab_L,Lab_a,Lab_b); if (needLuma) { // Luma cr->set_source_rgb(1.0, 1.0, 1.0); @@ -415,7 +418,8 @@ void HistogramRGBArea::renderRGBMarks (int r, int g, int b, Glib::ustring profil if (needChroma) { // Chroma float chromaval = sqrt(Lab_a*Lab_a + Lab_b*Lab_b)/1.8; - cr->set_source_rgb(0.0, 0.0, 0.0); + // float chromaval = sqrt(Lab_a*Lab_a + Lab_b*Lab_b); + cr->set_source_rgb(0.0, 0.0, 0.0); cr->move_to((int)(chromaval*(winw/100.0)), 0); cr->line_to((int)(chromaval*(winw/100.0)), winh-0); cr->stroke(); @@ -424,7 +428,7 @@ void HistogramRGBArea::renderRGBMarks (int r, int g, int b, Glib::ustring profil } } -void HistogramRGBArea::rgb2lab (Glib::ustring profile, int r, int g, int b, float &LAB_l, float &LAB_a, float &LAB_b) { +void HistogramRGBArea::rgb2lab (Glib::ustring profile, Glib::ustring profileW, int r, int g, int b, float &LAB_l, float &LAB_a, float &LAB_b) { double xyz_rgb[3][3]; const double ep=216.0/24389.0; const double ka=24389.0/27.0; @@ -433,49 +437,94 @@ void HistogramRGBArea::rgb2lab (Glib::ustring profile, int r, int g, int b, floa double var_G = g / 255.0; double var_B = b / 255.0; - if (profile=="sRGB") {//apply sRGB inverse gamma + Glib::ustring profileCalc; + profileCalc="sRGB";//default + if(options.rtSettings.HistogramWorking) profileCalc=profileW;//display working + + else {// if you want display = output space + if (profile=="RT_sRGB" || profile=="RT_sRGB_gBT709" || profile=="RT_sRGB_g10") profileCalc="sRGB"; + if (profile=="ProPhoto" || profile=="RT_Large_gBT709" || profile=="RT_Large_g10" || profile=="RT_Large_gsRGB") profileCalc="ProPhoto"; + if (profile=="AdobeRGB1998" || profile=="RT_Medium_gsRGB") profileCalc="Adobe RGB"; + if (profile=="WideGamutRGB") profileCalc="WideGamut"; + } + if(options.rtSettings.HistogramWorking) {//display working + if (profileW=="sRGB") {//apply sRGB inverse gamma - // -// if you want display = working space -// today as the gamma output can not be configured -// it is better that the user has the gamma of the output space - if ( var_R > 0.04045 ) - var_R = pow ( ( ( var_R + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); - else - var_R = var_R / 12.92; - if ( var_G > 0.04045 ) - var_G = pow ( ( ( var_G + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); - else - var_G = var_G / 12.92; - if ( var_B > 0.04045 ) - var_B = pow ( ( ( var_B + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); - else - var_B = var_B / 12.92; + if ( var_R > 0.04045 ) + var_R = pow ( ( ( var_R + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_R = var_R / 12.92; + if ( var_G > 0.04045 ) + var_G = pow ( ( ( var_G + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_G = var_G / 12.92; + if ( var_B > 0.04045 ) + var_B = pow ( ( ( var_B + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_B = var_B / 12.92; + } + else + if (profileW=="ProPhoto") {// apply inverse gamma 1.8 + var_R = pow ( var_R, 1.8); + var_G = pow ( var_G, 1.8); + var_B = pow ( var_B, 1.8); + } + else {// apply inverse gamma 2.2 + var_R = pow ( var_R, 2.2); + var_G = pow ( var_G, 2.2); + var_B = pow ( var_B, 2.2); + } + } + else {//display outout profile + + if (profile=="RT_sRGB" || profile=="RT_Large_gsRGB" || profile=="RT_Medium_gsRGB") {//apply sRGB inverse gamma + if ( var_R > 0.04045 ) + var_R = pow ( ( ( var_R + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_R = var_R / 12.92; + if ( var_G > 0.04045 ) + var_G = pow ( ( ( var_G + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_G = var_G / 12.92; + if ( var_B > 0.04045 ) + var_B = pow ( ( ( var_B + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_B = var_B / 12.92; } -// if you want display = output space - else - if (profile=="ProPhoto") {// apply inverse gamma 1.8 + + else if (profile=="RT_sRGB_gBT709" || profile=="RT_Large_gBT709") {// + if ( var_R > 0.0795 ) + var_R = pow ( ( ( var_R + 0.0954 ) / 1.0954 ), 2.2);else var_R=var_R/4.5; + + if ( var_G > 0.0795 ) + var_G = pow ( ( ( var_G + 0.0954 ) / 1.0954 ), 2.2);else var_G=var_G/4.5; + + if ( var_B > 0.0795 ) + var_B = pow ( ( ( var_B + 0.0954 ) / 1.0954 ), 2.2);else var_B=var_B/4.5; + + } + else if (profile=="ProPhoto") {// apply inverse gamma 1.8 + var_R = pow ( var_R, 1.8); var_G = pow ( var_G, 1.8); var_B = pow ( var_B, 1.8); } + else if (profile=="RT_sRGB_g10" || profile=="RT_Large_g10") {// apply inverse gamma 1.8 + + var_R = pow ( var_R, 1.); + var_G = pow ( var_G, 1.); + var_B = pow ( var_B, 1.); + } + else {// apply inverse gamma 2.2 var_R = pow ( var_R, 2.2); var_G = pow ( var_G, 2.2); var_B = pow ( var_B, 2.2); } + } + // TMatrix wprof = rtengine::ICCStore::getInstance()->workingSpaceMatrix (profileW); - /*for (int i=0; iworkingSpaceMatrix (profile); + TMatrix wprof = rtengine::ICCStore::getInstance()->workingSpaceMatrix (profileCalc); for (int m=0; m<3; m++) for (int n=0; n<3; n++) { @@ -483,9 +532,9 @@ void HistogramRGBArea::rgb2lab (Glib::ustring profile, int r, int g, int b, floa } double varxx,varyy,varzz; - double var_X = ( xyz_rgb[0][0]*var_R + xyz_rgb[0][1]*var_G + xyz_rgb[0][2]*var_B ) / rtengine::Color::D50x; + double var_X = ( xyz_rgb[0][0]*var_R + xyz_rgb[0][1]*var_G + xyz_rgb[0][2]*var_B ) / Color::D50x; double var_Y = ( xyz_rgb[1][0]*var_R + xyz_rgb[1][1]*var_G + xyz_rgb[1][2]*var_B ) ; - double var_Z = ( xyz_rgb[2][0]*var_R + xyz_rgb[2][1]*var_G + xyz_rgb[2][2]*var_B ) / rtengine::Color::D50z; + double var_Z = ( xyz_rgb[2][0]*var_R + xyz_rgb[2][1]*var_G + xyz_rgb[2][2]*var_B ) / Color::D50z; varxx = var_X>ep?cbrt(var_X):( ka * var_X + 16.0) / 116.0 ; varyy = var_Y>ep?cbrt(var_Y):( ka * var_Y + 16.0) / 116.0 ; diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 582879e37..1fd0ec906 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -85,7 +85,7 @@ class HistogramRGBArea : public Gtk::DrawingArea { HistogramRGBArea(); ~HistogramRGBArea(); - void renderRGBMarks (int r, int g, int b, Glib::ustring profile = ""); + void renderRGBMarks (int r, int g, int b, Glib::ustring profile = "", Glib::ustring profileW = ""); void updateFreeze (bool f); bool getFreeze (); bool getShow (); @@ -99,7 +99,7 @@ class HistogramRGBArea : public Gtk::DrawingArea { bool on_button_press_event (GdkEventButton* event); void on_style_changed (const Glib::RefPtr& style); private: - void rgb2lab (Glib::ustring profile, int r, int g, int b, float &LAB_l, float &LAB_a, float &LAB_b); + void rgb2lab (Glib::ustring profile, Glib::ustring profileW,int r, int g, int b, float &LAB_l, float &LAB_a, float &LAB_b); // Some ... }; @@ -203,7 +203,7 @@ class HistogramPanel : public Gtk::HBox, public PointerMotionListener, public Fu 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); + void pointerMoved (bool validPos, Glib::ustring profile, Glib::ustring profileW,int x, int y, int r, int g, int b); // added pointermotionlistener interface void toggleFreeze(); // TODO should be protected diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index 9301ec0b4..244b603f7 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -83,6 +83,8 @@ LCurve::LCurve () : FoldableToolPanel(this) { lshape->setEditID(EUID_Lab_LCurve, BT_SINGLEPLANE_FLOAT); ashape = static_cast(curveEditorG->addCurve(CT_Diagonal, "a")); + ashape->setEditID(EUID_Lab_aCurve, BT_SINGLEPLANE_FLOAT); + ashape->setRangeLabels( M("TP_LABCURVE_CURVEEDITOR_A_RANGE1"), M("TP_LABCURVE_CURVEEDITOR_A_RANGE2"), M("TP_LABCURVE_CURVEEDITOR_A_RANGE3"), M("TP_LABCURVE_CURVEEDITOR_A_RANGE4") @@ -100,6 +102,8 @@ LCurve::LCurve () : FoldableToolPanel(this) { M("TP_LABCURVE_CURVEEDITOR_B_RANGE1"), M("TP_LABCURVE_CURVEEDITOR_B_RANGE2"), M("TP_LABCURVE_CURVEEDITOR_B_RANGE3"), M("TP_LABCURVE_CURVEEDITOR_B_RANGE4") ); + bshape->setEditID(EUID_Lab_bCurve, BT_SINGLEPLANE_FLOAT); + //from blue to yellow milestones.clear(); milestones.push_back( GradientMilestone(0., 0., 0., 1.) ); @@ -113,21 +117,25 @@ LCurve::LCurve () : FoldableToolPanel(this) { lhshape = static_cast(curveEditorG->addCurve(CT_Flat, M("TP_LABCURVE_CURVEEDITOR_LH"))); lhshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_LH_TOOLTIP")); lhshape->setCurveColorProvider(this, 4); + lhshape->setEditID(EUID_Lab_LHCurve, BT_SINGLEPLANE_FLOAT); chshape = static_cast(curveEditorG->addCurve(CT_Flat, M("TP_LABCURVE_CURVEEDITOR_CH"))); chshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_CH_TOOLTIP")); chshape->setCurveColorProvider(this, 1); + chshape->setEditID(EUID_Lab_CHCurve, BT_SINGLEPLANE_FLOAT); hhshape = static_cast(curveEditorG->addCurve(CT_Flat, M("TP_LABCURVE_CURVEEDITOR_HH"))); hhshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_HH_TOOLTIP")); hhshape->setCurveColorProvider(this, 5); + hhshape->setEditID(EUID_Lab_HHCurve, BT_SINGLEPLANE_FLOAT); curveEditorG->newLine(); // ------------------------------------------------ 3rd line ccshape = static_cast(curveEditorG->addCurve(CT_Diagonal, M("TP_LABCURVE_CURVEEDITOR_CC"))); ccshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_CC_TOOLTIP")); + ccshape->setEditID(EUID_Lab_CCurve, BT_SINGLEPLANE_FLOAT); ccshape->setRangeLabels( M("TP_LABCURVE_CURVEEDITOR_CC_RANGE1"), M("TP_LABCURVE_CURVEEDITOR_CC_RANGE2"), M("TP_LABCURVE_CURVEEDITOR_CC_RANGE3"), M("TP_LABCURVE_CURVEEDITOR_CC_RANGE4") @@ -139,6 +147,8 @@ LCurve::LCurve () : FoldableToolPanel(this) { lcshape = static_cast(curveEditorG->addCurve(CT_Diagonal, M("TP_LABCURVE_CURVEEDITOR_LC"))); lcshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_LC_TOOLTIP")); + lcshape->setEditID(EUID_Lab_LCCurve, BT_SINGLEPLANE_FLOAT); + // left and bottom bar uses the same caller id because the will display the same content lcshape->setBottomBarColorProvider(this, 2); lcshape->setRangeLabels( @@ -149,6 +159,8 @@ LCurve::LCurve () : FoldableToolPanel(this) { clshape = static_cast(curveEditorG->addCurve(CT_Diagonal, M("TP_LABCURVE_CURVEEDITOR_CL"))); clshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_CL_TOOLTIP")); + clshape->setEditID(EUID_Lab_CLCurve, BT_SINGLEPLANE_FLOAT); + clshape->setLeftBarColorProvider(this, 2); clshape->setRangeDefaultMilestones(0.25, 0.5, 0.75); milestones.push_back( GradientMilestone(0., 0., 0., 0.) ); @@ -277,6 +289,15 @@ void LCurve::autoOpenCurve () { void LCurve::setEditProvider (EditDataProvider *provider) { lshape->setEditProvider(provider); + ccshape->setEditProvider(provider); + lcshape->setEditProvider(provider); + clshape->setEditProvider(provider); + lhshape->setEditProvider(provider); + chshape->setEditProvider(provider); + hhshape->setEditProvider(provider); + ashape->setEditProvider(provider); + bshape->setEditProvider(provider); + } @@ -530,12 +551,12 @@ void LCurve::setBatchMode (bool batchMode) { } -void LCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma){ +void LCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma){ lshape->updateBackgroundHistogram (histLCurve); ccshape->updateBackgroundHistogram (histCCurve); - clshape->updateBackgroundHistogram (histCLurve); - lcshape->updateBackgroundHistogram (histLLCurve); +// clshape->updateBackgroundHistogram (histCLurve); +// lcshape->updateBackgroundHistogram (histLLCurve); } diff --git a/rtgui/labcurve.h b/rtgui/labcurve.h index 41cb522dd..7be63adfe 100644 --- a/rtgui/labcurve.h +++ b/rtgui/labcurve.h @@ -73,7 +73,7 @@ class LCurve : public ToolParamBlock, public AdjusterListener, public FoldableTo void avoidcolorshift_toggled (); void lcredsk_toggled(); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ 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/navigator.cc b/rtgui/navigator.cc index 1c2910551..2881e5b0e 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -24,6 +24,7 @@ #include "../rtengine/curves.h" #include "../rtengine/color.h" #include "../rtengine/rt_math.h" +#include "options.h" using namespace rtengine; @@ -202,7 +203,7 @@ void Navigator::setInvalid (int fullWidth, int fullHeight) { } // if !validPos then x/y contain the full image size -void Navigator::pointerMoved (bool validPos, Glib::ustring profile, int x, int y, int r, int g, int b) { +void Navigator::pointerMoved (bool validPos, Glib::ustring profile,Glib::ustring profileW, int x, int y, int r, int g, int b) { if (!validPos) setInvalid (x,y); @@ -221,7 +222,7 @@ void Navigator::pointerMoved (bool validPos, Glib::ustring profile, int x, int y float LAB_a, LAB_b, LAB_l; //rgb2lab (r, g, b, LAB_l, LAB_a, LAB_b); - rgb2lab (profile, r, g, b, LAB_l, LAB_a, LAB_b); // TODO: Really sure this function works? + rgb2lab (profile, profileW, r, g, b, LAB_l, LAB_a, LAB_b); // TODO: Really sure this function works? LAB_A->set_text (Glib::ustring::format(std::fixed, std::setprecision(1), LAB_a)); LAB_B->set_text (Glib::ustring::format(std::fixed, std::setprecision(1), LAB_b)); LAB_L->set_text (Glib::ustring::format(std::fixed, std::setprecision(1), LAB_l)); @@ -229,7 +230,7 @@ void Navigator::pointerMoved (bool validPos, Glib::ustring profile, int x, int y } -void Navigator::rgb2lab (Glib::ustring profile, int r, int g, int b, float &LAB_l, float &LAB_a, float &LAB_b) { +void Navigator::rgb2lab (Glib::ustring profile, Glib::ustring profileW, int r, int g, int b, float &LAB_l, float &LAB_a, float &LAB_b) { double xyz_rgb[3][3]; const double ep=216.0/24389.0; const double ka=24389.0/27.0; @@ -238,49 +239,94 @@ void Navigator::rgb2lab (Glib::ustring profile, int r, int g, int b, float &LAB_ double var_G = g / 255.0; double var_B = b / 255.0; - if (profile=="sRGB") {//apply sRGB inverse gamma + Glib::ustring profileCalc; + profileCalc="sRGB";//default + if(options.rtSettings.HistogramWorking) profileCalc=profileW;//display working + + else {// if you want display = output space + if (profile=="RT_sRGB" || profile=="RT_sRGB_gBT709" || profile=="RT_sRGB_g10") profileCalc="sRGB"; + if (profile=="ProPhoto" || profile=="RT_Large_gBT709" || profile=="RT_Large_g10" || profile=="RT_Large_gsRGB") profileCalc="ProPhoto"; + if (profile=="AdobeRGB1998" || profile=="RT_Medium_gsRGB") profileCalc="Adobe RGB"; + if (profile=="WideGamutRGB") profileCalc="WideGamut"; + } + if(options.rtSettings.HistogramWorking) {//display working + if (profileW=="sRGB") {//apply sRGB inverse gamma - // -// if you want display = working space -// today as the gamma output can not be configured -// it is better that the user has the gamma of the output space - if ( var_R > 0.04045 ) - var_R = pow ( ( ( var_R + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); - else - var_R = var_R / 12.92; - if ( var_G > 0.04045 ) - var_G = pow ( ( ( var_G + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); - else - var_G = var_G / 12.92; - if ( var_B > 0.04045 ) - var_B = pow ( ( ( var_B + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); - else - var_B = var_B / 12.92; + if ( var_R > 0.04045 ) + var_R = pow ( ( ( var_R + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_R = var_R / 12.92; + if ( var_G > 0.04045 ) + var_G = pow ( ( ( var_G + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_G = var_G / 12.92; + if ( var_B > 0.04045 ) + var_B = pow ( ( ( var_B + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_B = var_B / 12.92; + } + else + if (profileW=="ProPhoto") {// apply inverse gamma 1.8 + var_R = pow ( var_R, 1.8); + var_G = pow ( var_G, 1.8); + var_B = pow ( var_B, 1.8); + } + else {// apply inverse gamma 2.2 + var_R = pow ( var_R, 2.2); + var_G = pow ( var_G, 2.2); + var_B = pow ( var_B, 2.2); + } + } + else {//display outout profile + + if (profile=="RT_sRGB" || profile=="RT_Large_gsRGB" || profile=="RT_Medium_gsRGB") {//apply sRGB inverse gamma + if ( var_R > 0.04045 ) + var_R = pow ( ( ( var_R + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_R = var_R / 12.92; + if ( var_G > 0.04045 ) + var_G = pow ( ( ( var_G + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_G = var_G / 12.92; + if ( var_B > 0.04045 ) + var_B = pow ( ( ( var_B + 0.055 ) / 1.055 ), rtengine::Color::sRGBGammaCurve); + else + var_B = var_B / 12.92; } -// if you want display = output space - else - if (profile=="ProPhoto") {// apply inverse gamma 1.8 + + else if (profile=="RT_sRGB_gBT709" || profile=="RT_Large_gBT709") {// + if ( var_R > 0.0795 ) + var_R = pow ( ( ( var_R + 0.0954 ) / 1.0954 ), 2.2);else var_R=var_R/4.5; + + if ( var_G > 0.0795 ) + var_G = pow ( ( ( var_G + 0.0954 ) / 1.0954 ), 2.2);else var_G=var_G/4.5; + + if ( var_B > 0.0795 ) + var_B = pow ( ( ( var_B + 0.0954 ) / 1.0954 ), 2.2);else var_B=var_B/4.5; + + } + else if (profile=="ProPhoto") {// apply inverse gamma 1.8 + var_R = pow ( var_R, 1.8); var_G = pow ( var_G, 1.8); var_B = pow ( var_B, 1.8); } + else if (profile=="RT_sRGB_g10" || profile=="RT_Large_g10") {// apply inverse gamma 1.8 + + var_R = pow ( var_R, 1.); + var_G = pow ( var_G, 1.); + var_B = pow ( var_B, 1.); + } + else {// apply inverse gamma 2.2 var_R = pow ( var_R, 2.2); var_G = pow ( var_G, 2.2); var_B = pow ( var_B, 2.2); } + } + // TMatrix wprof = rtengine::ICCStore::getInstance()->workingSpaceMatrix (profileW); - /*for (int i=0; iworkingSpaceMatrix (profile); + TMatrix wprof = rtengine::ICCStore::getInstance()->workingSpaceMatrix (profileCalc); for (int m=0; m<3; m++) for (int n=0; n<3; n++) { diff --git a/rtgui/navigator.h b/rtgui/navigator.h index ca1939bd8..999e1a3b1 100644 --- a/rtgui/navigator.h +++ b/rtgui/navigator.h @@ -38,7 +38,7 @@ class Navigator : public Gtk::Frame, public PointerMotionListener { Gtk::Label *lH, *lS, *lV; Gtk::Label *lLAB_A, *lLAB_B, *lLAB_L; - void rgb2lab (Glib::ustring profile, int r, int g, int b, float &LAB_l, float &LAB_a, float &LAB_b); + void rgb2lab (Glib::ustring profile, Glib::ustring profileW, int r, int g, int b, float &LAB_l, float &LAB_a, float &LAB_b); void setInvalid (int fullWidth=-1, int fullHeight=-1); @@ -49,7 +49,7 @@ class Navigator : public Gtk::Frame, public PointerMotionListener { // pointermotionlistener interface // void pointerMoved (bool validPos, int x, int y, int r, int g, int b); - void pointerMoved (bool validPos, Glib::ustring profile, int x, int y, int r, int g, int b); + void pointerMoved (bool validPos, Glib::ustring profile, Glib::ustring profileW,int x, int y, int r, int g, int b); }; diff --git a/rtgui/options.cc b/rtgui/options.cc index 28ae8e313..8bc294d41 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -529,6 +529,7 @@ void Options::setDefaults () { rtSettings.CRI_color =0; rtSettings.autocielab=true; rtSettings.denoiselabgamma=2; + rtSettings.HistogramWorking = false; // rtSettings.ciebadpixgauss=false; rtSettings.rgbcurveslumamode_gamut=true; @@ -738,6 +739,8 @@ if (keyFile.has_group ("GUI")) { if (keyFile.has_key ("GUI", "FileBrowserToolbarSingleRow")) FileBrowserToolbarSingleRow = keyFile.get_boolean ("GUI", "FileBrowserToolbarSingleRow"); if (keyFile.has_key ("GUI", "HideTPVScrollbar")) hideTPVScrollbar = keyFile.get_boolean ("GUI", "HideTPVScrollbar"); if (keyFile.has_key ("GUI", "UseIconNoText")) UseIconNoText = keyFile.get_boolean ("GUI", "UseIconNoText"); + if( keyFile.has_key ("GUI", "HistogramWorking")) rtSettings.HistogramWorking = keyFile.get_boolean("GUI", "HistogramWorking"); + } if (keyFile.has_group ("Crop Settings")) { @@ -1026,6 +1029,7 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_boolean ("GUI", "FileBrowserToolbarSingleRow", FileBrowserToolbarSingleRow); keyFile.set_boolean ("GUI", "HideTPVScrollbar", hideTPVScrollbar); keyFile.set_boolean ("GUI", "UseIconNoText", UseIconNoText); + keyFile.set_boolean ("GUI", "HistogramWorking", rtSettings.HistogramWorking); //Glib::ArrayHandle crvopen = crvOpen; //keyFile.set_integer_list ("GUI", "CurvePanelsExpanded", crvopen); diff --git a/rtgui/options.h b/rtgui/options.h index e7d5b7579..9b97b541a 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -38,19 +38,19 @@ // Profile name to use for internal values' profile #define DEFPROFILE_INTERNAL "Neutral" -class SaveFormat { - - public: - Glib::ustring format; - int pngBits; - int pngCompression; - int jpegQuality; - int jpegSubSamp; // 1=best compression, 3=best quality - int tiffBits; - bool tiffUncompressed; - bool saveParams; - SaveFormat () : format("jpg"), jpegQuality(90), jpegSubSamp(2), pngCompression(6), pngBits(8), tiffBits(8), tiffUncompressed(true), saveParams(true) {}; -}; +class SaveFormat { + + public: + Glib::ustring format; + int pngBits; + int pngCompression; + int jpegQuality; + int jpegSubSamp; // 1=best compression, 3=best quality + int tiffBits; + bool tiffUncompressed; + bool saveParams; + SaveFormat () : format("jpg"), jpegQuality(90), jpegSubSamp(2), pngCompression(6), pngBits(8), tiffBits(8), tiffUncompressed(true), saveParams(true) {}; +}; enum ThFileType {FT_Invalid=-1, FT_None=0, FT_Raw=1, FT_Jpeg=2, FT_Tiff=3, FT_Png=4, FT_Custom=5, FT_Tiff16=6, FT_Png16=7, FT_Custom16=8}; enum PPLoadLocation {PLL_Cache=0, PLL_Input=1}; @@ -197,6 +197,7 @@ class Options { bool tunnelMetaData; // Pass through IPTC and XMP unchanged int histogramPosition; // 0=disabled, 1=left pane, 2=right pane +// int histogramWorking; // 0=disabled, 1=left pane, 2=right pane bool histogramBar; bool histogramFullMode; bool showProfileSelector; diff --git a/rtgui/pointermotionlistener.h b/rtgui/pointermotionlistener.h index 16c75623d..422b25551 100644 --- a/rtgui/pointermotionlistener.h +++ b/rtgui/pointermotionlistener.h @@ -23,7 +23,7 @@ class PointerMotionListener { public: // virtual void pointerMoved (bool validPos, int x, int y, int r, int g, int b) {} - virtual void pointerMoved (bool validPos, Glib::ustring profile, int x, int y, int r, int g, int b) {} + virtual void pointerMoved (bool validPos, Glib::ustring profile, Glib::ustring profileW,int x, int y, int r, int g, int b) {} virtual void toggleFreeze () {} }; diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 5647ceb20..b054d2f88 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -601,6 +601,10 @@ Gtk::Widget* Preferences::getGeneralPanel () { Gtk::HBox* hbworkflow2 = Gtk::manage( new Gtk::HBox () ); ckbHistogramPositionLeft = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_HISTOGRAMPOSITIONLEFT")) ); hbworkflow2->pack_start (*ckbHistogramPositionLeft, Gtk::PACK_SHRINK, 4); + ckbHistogramWorking = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_HISTOGRAMWORKING")) ); + ckbHistogramWorking->set_tooltip_markup (M("PREFERENCES_HISTOGRAM_TOOLTIP")); + + hbworkflow2->pack_start (*ckbHistogramWorking, Gtk::PACK_SHRINK, 4); ckbShowProfileSelector = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_SHOWPROFILESELECTOR")) ); hbworkflow2->pack_start (*ckbShowProfileSelector, Gtk::PACK_SHRINK, 4); ckbSquareDetailWindow = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_SQUAREDETAILWINDOW")) ); @@ -1168,6 +1172,7 @@ void Preferences::storePreferences () { moptions.rtSettings.viewingdevicegrey = grey->get_active_row_number (); // moptions.rtSettings.autocielab = cbAutocielab->get_active (); moptions.rtSettings.ciecamfloat = cbciecamfloat->get_active (); + moptions.rtSettings.HistogramWorking = ckbHistogramWorking->get_active (); if (sdcurrent->get_active ()) moptions.startupDir = STARTUPDIR_CURRENT; @@ -1263,6 +1268,7 @@ void Preferences::fillPreferences () { grey->set_active (moptions.rtSettings.viewingdevicegrey); // cbAutocielab->set_active (moptions.rtSettings.autocielab); cbciecamfloat->set_active (moptions.rtSettings.ciecamfloat); + ckbHistogramWorking->set_active (moptions.rtSettings.HistogramWorking); languages->set_active_text (moptions.language); ckbLangAutoDetect->set_active (moptions.languageAutoDetect); theme->set_active_text (moptions.theme); @@ -1348,6 +1354,7 @@ void Preferences::fillPreferences () { editorLayout->set_active(moptions.multiDisplayMode ? 3 : 2); ckbHistogramPositionLeft->set_active(moptions.histogramPosition==1); + // ckbHistogramWorking->set_active(moptions.histogramWorking==1); ckbShowProfileSelector->set_active(moptions.showProfileSelector); ckbSquareDetailWindow->set_active(moptions.squareDetailWindow); ckbFileBrowserToolbarSingleRow->set_active(moptions.FileBrowserToolbarSingleRow); @@ -1648,6 +1655,7 @@ void Preferences::workflowUpdate (){ // Update the position of the Histogram parent->updateHistogramPosition(options.histogramPosition, moptions.histogramPosition); } + if(moptions.showProfileSelector != options.showProfileSelector) { // Update the position of the Profile selector parent->updateTPProfileSelector(moptions.showProfileSelector); diff --git a/rtgui/preferences.h b/rtgui/preferences.h index a21576412..80cbeacbf 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -145,6 +145,7 @@ class Preferences : public Gtk::Dialog, public ProfileStoreListener { Gtk::ComboBoxText* custProfBuilderLabelType; Gtk::CheckButton* ckbHistogramPositionLeft; + Gtk::CheckButton* ckbHistogramWorking; Gtk::CheckButton* ckbShowProfileSelector; Gtk::CheckButton* ckbFileBrowserToolbarSingleRow; Gtk::CheckButton* ckbHideTPVScrollbar; diff --git a/rtgui/rgbcurves.cc b/rtgui/rgbcurves.cc index a03080298..d2f34c730 100644 --- a/rtgui/rgbcurves.cc +++ b/rtgui/rgbcurves.cc @@ -172,7 +172,7 @@ void RGBCurves::setBatchMode (bool batchMode) { } -void RGBCurves::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { +void RGBCurves::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { // Rshape->updateBackgroundHistogram (histRed); // Gshape->updateBackgroundHistogram (histGreen); diff --git a/rtgui/rgbcurves.h b/rtgui/rgbcurves.h index 739ff0c0c..9d5498705 100644 --- a/rtgui/rgbcurves.h +++ b/rtgui/rgbcurves.h @@ -50,7 +50,7 @@ class RGBCurves : public ToolParamBlock, public AdjusterListener, public Foldabl void autoOpenCurve (); void curveChanged (CurveEditor* ce); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); void lumamodeChanged (); }; diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 8558f9145..2e439e1f3 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -721,7 +721,7 @@ void ToneCurve::trimValues (rtengine::procparams::ProcParams* pp) { saturation->trimValue(pp->toneCurve.saturation); } -void ToneCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { +void ToneCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ 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 d823ec33d..b30cd46ed 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -101,7 +101,7 @@ class ToneCurve : public ToolParamBlock, public AdjusterListener, public Foldabl bool curveMode2Changed_ (); void expandCurve (bool isExpanded); bool isCurveExpanded (); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); void setRaw (bool raw); diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 5cfc462d7..6f9c441a6 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -533,11 +533,11 @@ int ToolPanelCoordinator::getSpotWBRectSize () { return whitebalance->getSize (); } -void ToolPanelCoordinator::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { - colorappearance->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve, histCLurve, histLLCurve, histLCAM, histCCAM,histRed, histGreen, histBlue, histLuma); - toneCurve->updateCurveBackgroundHistogram (histToneCurve, histLCurve,histCCurve, histCLurve, histLLCurve, histLCAM, histCCAM,histRed, histGreen, histBlue, histLuma); - lcurve->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve, histCLurve, histLLCurve, histLCAM, histCCAM,histRed, histGreen, histBlue, histLuma); - rgbcurves->updateCurveBackgroundHistogram(histToneCurve, histLCurve, histCCurve, histCLurve, histLLCurve, histLCAM, histCCAM,histRed,histGreen, histBlue, histLuma); +void ToolPanelCoordinator::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma) { + colorappearance->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve, /*histCLurve, histLLCurve,*/ histLCAM, histCCAM,histRed, histGreen, histBlue, histLuma); + toneCurve->updateCurveBackgroundHistogram (histToneCurve, histLCurve,histCCurve,/* histCLurve, histLLCurve,*/ histLCAM, histCCAM,histRed, histGreen, histBlue, histLuma); + lcurve->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve, /*histCLurve, histLLCurve,*/ histLCAM, histCCAM,histRed, histGreen, histBlue, histLuma); + rgbcurves->updateCurveBackgroundHistogram(histToneCurve, histLCurve, histCCurve,/* histCLurve, histLLCurve, */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 ecb199347..9eb65e5ed 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -189,7 +189,7 @@ class ToolPanelCoordinator : public ToolPanelListener, virtual ~ToolPanelCoordinator (); bool getChangedState () { return hasChanged; } - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve,LUTu & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve,LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ 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)