From e530d2b0d4733b14c87ed5f52024fc8e9cee6c0d Mon Sep 17 00:00:00 2001 From: jdc Date: Wed, 20 Nov 2013 10:57:15 +0100 Subject: [PATCH] Lab curves - update background histogram for L and C --- rtdata/languages/default | 12 ++++++------ rtengine/dcrop.cc | 2 +- rtengine/improccoordinator.cc | 2 +- rtengine/improcfun.cc | 6 ++++-- rtengine/improcfun.h | 2 +- rtengine/rtthumbnail.cc | 2 +- rtengine/simpleprocess.cc | 2 +- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 0396dc847..46f5d2b88 100755 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1266,12 +1266,12 @@ TP_LABCURVE_AVOIDCOLORSHIFT;Avoid color shift TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction 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_BWTONING_TIP;With the B&W toning option enabled, the Lab Chromaticity, CC, CH, LC and CL curves are not in effect.\nToning can be achieved using the a and b curves TP_LABCURVE_CHROMATICITY;Chromaticity TP_LABCURVE_CONTRAST;Contrast TP_LABCURVE_CURVEEDITOR;Luminance Curve TP_LABCURVE_CURVEEDITOR_CL;CL -TP_LABCURVE_CURVEEDITOR_CL_TOOLTIP;Chromaticity according to the luminance +TP_LABCURVE_CURVEEDITOR_CL_TOOLTIP;Chromaticity according to luminance C=f(L) TP_LABCURVE_CURVEEDITOR_A_RANGE1;Green Saturated TP_LABCURVE_CURVEEDITOR_A_RANGE2;Green Pastel TP_LABCURVE_CURVEEDITOR_A_RANGE3;Red Pastel @@ -1285,12 +1285,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 C=f(C).\n\nShows the histogram of chromaticity before curve adjustements.\nFor final output refer to the main histogram panel +TP_LABCURVE_CURVEEDITOR_CC_TOOLTIP;Chromaticity according to chromaticity C=f(C) TP_LABCURVE_CURVEEDITOR_CH;CH -TP_LABCURVE_CURVEEDITOR_CH_TOOLTIP;Chromaticity according to the hue +TP_LABCURVE_CURVEEDITOR_CH_TOOLTIP;Chromaticity according to hue C=f(H) 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\nShows the histogram of L before curve adjustements.\nnFor final output refer to the main histogram panel +TP_LABCURVE_CURVEEDITOR_LC_TOOLTIP;Luminance according to chromaticity L=f(C) +TP_LABCURVE_CURVEEDITOR_LL_TOOLTIP;Luminance according to luminance L=f(L) TP_LABCURVE_LABEL;Lab Adjustments 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 to all tones diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 3701a9cba..3cde2a1dd 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -202,7 +202,7 @@ void Crop::update (int todo) { LUTu dummy; - parent->ipf.chromiLuminanceCurve (1,labnCrop, labnCrop, parent->chroma_acurve, parent->chroma_bcurve, parent->satcurve, parent->lhskcurve, parent->clcurve, parent->lumacurve, utili, autili, butili, ccutili,cclutili, clcutili, dummy, dummy, dummy); + parent->ipf.chromiLuminanceCurve (1,labnCrop, labnCrop, parent->chroma_acurve, parent->chroma_bcurve, parent->satcurve, parent->lhskcurve, parent->clcurve, parent->lumacurve, utili, autili, butili, ccutili,cclutili, clcutili, dummy, dummy, dummy, dummy); parent->ipf.vibrance (labnCrop); if((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled)) parent->ipf.EPDToneMap(labnCrop,5,1); //parent->ipf.EPDToneMap(labnCrop, 5, 1); //Go with much fewer than normal iterates for fast redisplay. diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 5dfb4b35e..0590432e3 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -352,7 +352,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { progress ("Applying Color Boost...",100*readyphase/numofphases); - ipf.chromiLuminanceCurve (pW,nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili,cclutili,clcutili, histCCurve, histCLurve, histLLCurve); + ipf.chromiLuminanceCurve (pW,nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili,cclutili,clcutili, histCCurve, histCLurve, histLLCurve, histLCurve); ipf.vibrance(nprevl); if((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled)) ipf.EPDToneMap(nprevl,5,1); // for all treatments Defringe, Sharpening, Contrast detail , Microcontrast they are activated if "CIECAM" function are disabled diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index a6ba4d628..057567965 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -2818,7 +2818,7 @@ void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, LUTf & cur -void ImProcFunctions::chromiLuminanceCurve (int pW, LabImage* lold, LabImage* lnew, LUTf & acurve, LUTf & bcurve, LUTf & satcurve,LUTf & lhskcurve, LUTf & clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histCLurve, LUTu &histLLCurve) { +void ImProcFunctions::chromiLuminanceCurve (int pW, LabImage* lold, LabImage* lnew, LUTf & acurve, LUTf & bcurve, LUTf & satcurve,LUTf & lhskcurve, LUTf & clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histCLurve, LUTu &histLLCurve, LUTu &histLCurve) { int W = lold->W; int H = lold->H; // lhskcurve.dump("lh_curve"); @@ -3234,7 +3234,9 @@ void ImProcFunctions::chromiLuminanceCurve (int pW, LabImage* lold, LabImage* ln if (chrop) { float hlval = dLcurve[i]; int hli = (int)(255.0*CLIPD(hlval)); - histLLCurve[hli] += hist16LLClad[i] ; + histLLCurve[hli] += hist16LLClad[i] ; + histLCurve[hli] += hist16LLClad[i] ; + } } diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index c6ff9493e..6258b4d91 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -202,7 +202,7 @@ class ImProcFunctions { void luminanceCurve (LabImage* lold, LabImage* lnew, LUTf &curve); void ciecam_02float (CieImage* ncie, float adap, int begh, int endh, int pW, int pwb, LabImage* lab, const ProcParams* params , const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve, const ColorAppearance & customColCurve3, LUTu &histLCAM, LUTu &histCCAM,int Iterates, int scale, float** buffer, bool execsharp, float &d); void ciecam_02 (CieImage* ncie, double adap, int begh, int endh, int pW, int pwb, LabImage* lab, const ProcParams* params , const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve, const ColorAppearance & customColCurve3, LUTu &histLCAM, LUTu &histCCAM,int Iterates, int scale, float** buffer, bool execsharp, double &d); - void chromiLuminanceCurve (int pW, LabImage* lold, LabImage* lnew, LUTf &acurve, LUTf &bcurve, LUTf & satcurve,LUTf & satclcurve, LUTf &clcurve, LUTf &curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histCLurve, LUTu &histLCurve); + void chromiLuminanceCurve (int pW, LabImage* lold, LabImage* lnew, LUTf &acurve, LUTf &bcurve, LUTf & satcurve,LUTf & satclcurve, LUTf &clcurve, LUTf &curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histCLurve, LUTu &histLCurve, LUTu &histLurve); void vibrance (LabImage* lab);//Jacques' vibrance void colorCurve (LabImage* lold, LabImage* lnew); void sharpening (LabImage* lab, float** buffer); diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index b1bba2571..901996b91 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -802,7 +802,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei hist16C, hist16C, hist16C, dummy, dummy, 16); //ipf.luminanceCurve (labView, labView, curve); - ipf.chromiLuminanceCurve (1,labView, labView, curve1, curve2, satcurve,lhskcurve, clcurve, curve, utili, autili, butili, ccutili,cclutili, clcutili, dummy, dummy, dummy); + ipf.chromiLuminanceCurve (1,labView, labView, curve1, curve2, satcurve,lhskcurve, clcurve, curve, utili, autili, butili, ccutili,cclutili, clcutili, dummy, dummy, dummy, dummy); ipf.vibrance(labView); int begh = 0, endh = labView->H; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 324dc8c72..bb05ea3db 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -256,7 +256,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p hist16C, hist16C, hist16C, dummy,dummy, 1); - ipf.chromiLuminanceCurve (1,labView, labView, curve1, curve2, satcurve,lhskcurve,clcurve, lumacurve, utili, autili, butili, ccutili,cclutili, clcutili, dummy, dummy, dummy); + ipf.chromiLuminanceCurve (1,labView, labView, curve1, curve2, satcurve,lhskcurve,clcurve, lumacurve, utili, autili, butili, ccutili,cclutili, clcutili, dummy, dummy, dummy, dummy); if((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled))ipf.EPDToneMap(labView,5,1);