From 0bbac490ca56082b1a0cb478c2071e81970c4cd7 Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 21 Jan 2019 17:45:55 +0100 Subject: [PATCH] Provisory work with new lago for exposure --- rtdata/languages/default | 2 + rtengine/curves.cc | 2 - rtengine/improccoordinator.cc | 2 +- rtengine/iplocallab.cc | 189 ++++++++++++++++++++++++---------- rtengine/procevents.h | 1 + rtengine/procparams.cc | 6 +- rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 3 +- rtgui/locallab.cc | 26 ++++- rtgui/locallab.h | 1 + rtgui/paramsedited.cc | 7 ++ rtgui/paramsedited.h | 1 + 12 files changed, 178 insertions(+), 63 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index eec87448c..09f69f1b1 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -869,6 +869,7 @@ HISTORY_MSG_613;Local - Exp Structure HISTORY_MSG_614;Local - Exp Mask H HISTORY_MSG_615;Local - Blend color HISTORY_MSG_616;Local - Blend Exp +HISTORY_MSG_617;Local - Blur Exp HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -1940,6 +1941,7 @@ TP_LOCALLAB_BILATERAL;Bilateral filter TP_LOCALLAB_BLENDMASKCOL;Blend TP_LOCALLAB_BLMETHOD_TOOLTIP;Normal - direct blur and noise with all settings.\nInverse - Inverse blur and noise without scope and whithout enhanced algorithm.\nSymmetric - inverse blur and noise with all settings. Be careful some results may be curious TP_LOCALLAB_BLUFR;Blur & Noise +TP_LOCALLAB_BLURDE;Blur Shape detection TP_LOCALLAB_BLNORM;Normal TP_LOCALLAB_BLINV;Inverse TP_LOCALLAB_BLSYM;Symmetric diff --git a/rtengine/curves.cc b/rtengine/curves.cc index 722b98ccd..7d6f95bdb 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -1621,8 +1621,6 @@ void LocHHmaskexpCurve::Set(const std::vector &curvePoints) - - LocLLmaskexpCurve::LocLLmaskexpCurve() : sum(0.f) {}; void LocLLmaskexpCurve::Reset() diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index be1896b0a..3beb789e7 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -813,7 +813,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, huere, chromare, lumare, sobelre, lhist16loc, avg); } - printf("improc avg=%f\n", avg); +// printf("improc avg=%f\n", avg); huerblu = huerefblurs[sp] = huerefblu; huer = huerefs[sp] = huere; chromar = chromarefs[sp] = chromare; diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index f6a28b871..872f23e64 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -161,6 +161,7 @@ struct local_params { float blendmacol; float blendmaexp; float struexp; + float blurexp; float ligh; int shamo, shdamp, shiter, senssha, sensv; float neig; @@ -478,6 +479,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float blendmaskcolor = ((float) locallab.spots.at(sp).blendmaskcol) / 100.f ; float blendmaskexpo = ((float) locallab.spots.at(sp).blendmaskexp) / 100.f ; float structexpo = (float) locallab.spots.at(sp).structexp; + float blurexpo = (float) locallab.spots.at(sp).blurexpde; int local_transit = locallab.spots.at(sp).transit; double radius = (double) locallab.spots.at(sp).radius; double sharradius = ((double) locallab.spots.at(sp).sharradius) / 100. ; @@ -516,6 +518,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.blendmacol = blendmaskcolor; lp.blendmaexp = blendmaskexpo; lp.struexp = structexpo; + lp.blurexp = blurexpo; lp.sens = local_sensi; lp.sensh = local_sensih; lp.dehaze = local_dehaze; @@ -5137,7 +5140,8 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La origblur = new LabImage(GW, GH); LabImage *origblurmask = nullptr; - float radius = 3.f / sk; + float radius = (2.f + 0.2f * lp.blurexp) / sk; + bool usemask = (lp.showmaskexpmet == 2 || lp.showmaskexpmet == 3 || lp.showmaskexpmet == 4) && senstype == 1; if (usemask) @@ -5525,33 +5529,35 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La if (hueref < -1.1f && hueref > -2.8f) { // detect blue sky if (chromaref > 0.f && chromaref < 35.f * multchro) { // detect blue sky if ((rhue > -2.79f && rhue < -1.11f) && (rchro < 35.f * multchro)) { - realstr *= 0.9f; + cli *= 0.9f; } else { - realstr = 1.f; + // cli = 1.f; } } } else { - realstr = cli; + //realstr = cli; } if (varsens < 50.f) { //&& lp.chro > 0.f if (hueref > -0.1f && hueref < 1.6f) { // detect skin if (chromaref > 0.f && chromaref < 55.f * multchroskin) { // detect skin if ((rhue > -0.09f && rhue < 1.59f) && (rchro < 55.f * multchroskin)) { - realstr *= 0.7f; + cli *= 0.7f; } else { - realstr = 1.f; + // realstr = 1.f; } } } else { - realstr = cli; + // realstr = cli; } } } } + float kcr = 100.f * lp.thr; + float falL = 1.f; if (rchro < kcr && chromaref > kcr) { // reduce artifacts in grey tones near hue spot and improve algorithm @@ -5564,6 +5570,32 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La fach = 1.f; } + + float reducdE = 0.f; + float mindE = 2.f + 0.05f * varsens;//between 2 and 7 + float maxdE = 5.f + 1.5f * varsens; // between 5 and 150, we can chnage this values + + float ar = 1.f / (mindE - maxdE); + + float br = - ar * maxdE; + + if (dE > maxdE) { + reducdE = 0.f; + } + + if (dE > mindE && dE <= maxdE) { + reducdE = ar * dE + br; + } + + if (dE <= mindE) { + reducdE = 1.f; + } + + float realstrdE = reducdE * cli; + float realstradE = reducdE * cla; + float realstrbdE = reducdE * clb; + float realstrchdE = reducdE * clc; + if (rL > 0.1f) { //to avoid crash with very low gamut in rare cases ex : L=0.01 a=0.5 b=-0.9 @@ -5582,9 +5614,19 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La float fli = 1.f; fli = ((100.f + realstr * falL) / 100.f); float diflc = lightc * fli - original->L[y][x]; - diflc *= kch; + diflc *= (kch * fach); diflc *= factorx; - transformed->L[y][x] = CLIP(original->L[y][x] + diflc); + + if (varsens < 0.f) { + transformed->L[y][x] = CLIP(original->L[y][x] + diflc); + } else { + transformed->L[y][x] = CLIP(original->L[y][x] + 328.f * factorx * realstrdE * kch * fach); + diflc = 328.f * factorx * realstrdE * kch * fach; + } + + if ((lp.showmaskexpmet == 1 || lp.showmaskexpmet == 2) && senstype == 1) { + transformed->L[y][x] = CLIP(12000.f + diflc); + } float flia = 1.f; float flib = 1.f; @@ -5600,15 +5642,25 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La float difa = chra * flia - original->a[y][x]; float difb = chrb * flib - original->b[y][x]; - difa *= factorx; - difb *= factorx; - difa *= kch * fach; - difb *= kch * fach; - transformed->a[y][x] = CLIPC(original->a[y][x] + difa); - transformed->b[y][x] = CLIPC(original->b[y][x] + difb); + difa *= (kch * factorx * fach); + difb *= (kch * factorx * fach); + + if (varsens < 0.f) { + transformed->a[y][x] = CLIPC(original->a[y][x] + difa); + transformed->b[y][x] = CLIPC(original->b[y][x] + difb); + } else { + if (senstype != 1) { + // transformed->a[y][x] = CLIPC(original->a[y][x] + 328.f * factorx * realstrchdE * kch * fach); + // transformed->b[y][x] = CLIPC(original->b[y][x] + 328.f * factorx * realstrchdE * kch * fach); + } else { + transformed->a[y][x] = CLIPC(original->a[y][x] + 328.f * factorx * realstradE * kch * fach); + transformed->b[y][x] = CLIPC(original->b[y][x] + 328.f * factorx * realstrbdE * kch * fach); + difa = 328.f * factorx * realstradE * kch * fach; + difb = 328.f * factorx * realstrbdE * kch * fach; + } + } if ((lp.showmaskexpmet == 1 || lp.showmaskexpmet == 2) && senstype == 1) { - transformed->L[y][x] = CLIP(12000.f + diflc); transformed->a[y][x] = CLIPC(difa); transformed->b[y][x] = CLIPC(difb); } @@ -5622,10 +5674,20 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La float fli = 1.f; fli = ((100.f + realstr * falL) / 100.f); //luma transition float diflc = lightc * fli - original->L[y][x]; - diflc *= kch; - transformed->L[y][x] = CLIP(original->L[y][x] + diflc); + diflc *= (kch * fach); + if (varsens < 0.f) { + transformed->L[y][x] = CLIP(original->L[y][x] + diflc); + } else { + transformed->L[y][x] = CLIP(original->L[y][x] + 328.f * realstrdE * kch * fach); + diflc = 328.f * realstrdE * kch * fach; + } + + if (lp.showmaskexpmet == 1 || lp.showmaskexpmet == 2) { + transformed->L[y][x] = CLIP(12000.f + diflc); + } + float flia = 1.f; float flib = 1.f; float chra = bufexporig->a[loy - begy][lox - begx]; @@ -5636,27 +5698,39 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La } else { flia = ((100.f + realstra * falu * falL) / 100.f); flib = ((100.f + realstrb * falu * falL) / 100.f); - } - float difa = chra * flia - original->a[y][x]; - float difb = chrb * flib - original->b[y][x]; - difa *= kch * fach; - difb *= kch * fach; - transformed->a[y][x] = CLIPC(original->a[y][x] + difa); - transformed->b[y][x] = CLIPC(original->b[y][x] + difb); + float difa = chra * flia - original->a[y][x]; + float difb = chrb * flib - original->b[y][x]; + difa *= kch * fach; + difb *= kch * fach; - if ((lp.showmaskexpmet == 1 || lp.showmaskexpmet == 2) && senstype == 1) { - transformed->L[y][x] = CLIP(12000.f + diflc); - transformed->a[y][x] = CLIPC(difa); - transformed->b[y][x] = CLIPC(difb); + + if (varsens < 0.f) { + transformed->a[y][x] = CLIPC(original->a[y][x] + difa); + transformed->b[y][x] = CLIPC(original->b[y][x] + difb); + } else { + if (senstype != 1) { + transformed->a[y][x] = CLIPC(original->a[y][x] + 328.f * realstrchdE * kch * fach); + transformed->b[y][x] = CLIPC(original->b[y][x] + 328.f * realstrchdE * kch * fach); + } else { + transformed->a[y][x] = CLIPC(original->a[y][x] + 328.f * realstradE * kch * fach); + transformed->b[y][x] = CLIPC(original->b[y][x] + 328.f * realstrbdE * kch * fach); + difa = 328.f * realstradE * kch * fach; + difb = 328.f * realstrbdE * kch * fach; + } + } + + if ((lp.showmaskexpmet == 1 || lp.showmaskexpmet == 2) && senstype == 1) { + transformed->a[y][x] = CLIPC(difa); + transformed->b[y][x] = CLIPC(difb); + } } } + + } - - } - } } @@ -5706,7 +5780,7 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabImage * bufcolorig, LabImage * originalmask, float ** buflight, float ** bufchro, float ** bufchroslid, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, float sobelref, float ** blend2, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, LUTf & lightCurveloc, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) { BENCHFUN -// chroma and lightness +// chroma and lightnesse const float ach = (float)lp.trans / 100.f; //chroma @@ -6353,6 +6427,7 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm sincosval.y = 1.f; sincosval.x = 0.0f; float ddhue = 0.f; +// printf("kch=%f ", kch); if (rL > th_r) { //to avoid crash with very low gamut in rare cases ex : L=0.01 a=0.5 b=-0.9 switch (zone) { @@ -7159,8 +7234,9 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform nc2++; } } + avg2 /= 32768.f; - avg = avg2/nc2; + avg = avg2 / nc2; // printf("calc avg=%f \n", avg); //claculate histogram for area selected #ifdef _OPENMP @@ -10273,6 +10349,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o // buforigchro[loy - begy][lox - begx] = sqrt(SQR(original->a[y][x]) + SQR(original->b[y][x])); } } + const float radius = 3.f / (sk * 1.4f); int spotSi = 1 + 2 * max(1, lp.cir / sk); @@ -10485,13 +10562,15 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { if (zone > 0) { - bufcolorig->L[loy - begy][lox - begx] += CLIPLOC(lp.blendmacol * bufmaskorig->L[loy - begy][lox - begx]); + + bufcolorig->L[loy - begy][lox - begx] += CLIP(lp.blendmacol * bufmaskorig->L[loy - begy][lox - begx]); bufcolorig->a[loy - begy][lox - begx] += CLIPC(lp.blendmacol * bufmaskorig->a[loy - begy][lox - begx]); bufcolorig->b[loy - begy][lox - begx] += CLIPC(lp.blendmacol * bufmaskorig->b[loy - begy][lox - begx]); - originalmask->L[y][x] = CLIPLOC(bufcolorig->L[loy - begy][lox - begx] - (lp.blendmacol + 1.f) * bufmaskorig->L[loy - begy][lox - begx]); + originalmask->L[y][x] = CLIP(bufcolorig->L[loy - begy][lox - begx] - (lp.blendmacol + 1.f) * bufmaskorig->L[loy - begy][lox - begx]); originalmask->a[y][x] = CLIPC(bufcolorig->a[loy - begy][lox - begx] - (lp.blendmacol + 1.f) * bufmaskorig->a[loy - begy][lox - begx]); - originalmask->b[y][x] = CLIPC(bufcolorig->L[loy - begy][lox - begx] - (lp.blendmacol + 1.f) * bufmaskorig->b[loy - begy][lox - begx]); + originalmask->b[y][x] = CLIPC(bufcolorig->b[loy - begy][lox - begx] - (lp.blendmacol + 1.f) * bufmaskorig->b[loy - begy][lox - begx]); + } } } @@ -10863,11 +10942,11 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bufmaskblur->a[loy - begy][lox - begx] = original->a[y][x]; bufmaskblur->b[loy - begy][lox - begx] = original->b[y][x]; - float valLL = 0.f; + float valLLexp = 0.f; float valCC = 0.f; float valHH = 0.f; float2 sincosval; - float kmaskL = 0; + float kmaskLexp = 0; float kmaskCa = 0; float kmaskCb = 0; @@ -10879,9 +10958,9 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lp.showmaskexpmet == 2 || lp.showmaskexpmet == 3 || lp.showmaskexpmet == 4) { if (locllmasexpCurve) { - valLL = (float)(locllmasexpCurve[500.f * (bufexporig->L[loy - begy][lox - begx]) / 32768.f]); - valLL = 1.f - valLL; - kmaskL = 32768.f * valLL; + valLLexp = (float)(locllmasexpCurve[500.f * (bufexporig->L[loy - begy][lox - begx]) / 32768.f]); + valLLexp = 1.f - valLLexp; + kmaskLexp = 32768.f * valLLexp; } if (locccmasexpCurve) { @@ -10895,6 +10974,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o kmaskCb = 45000.f * valCC * sincosval.x; } + if (lochhmasexpCurve) { float huema = xatan2f(bufexporig->b[loy - begy][lox - begx], bufexporig->a[loy - begy][lox - begx]); float h = Color::huelab_to_huehsv2(huema); @@ -10914,7 +10994,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o kmaskHL = 32768.f * valHH; } - bufmaskblur->L[loy - begy][lox - begx] = CLIPLOC(kmaskL + kmaskHL); + bufmaskblur->L[loy - begy][lox - begx] = CLIP(kmaskLexp + kmaskHL); bufmaskblur->a[loy - begy][lox - begx] = CLIPC(kmaskCa + kmaskHa); bufmaskblur->b[loy - begy][lox - begx] = CLIPC(kmaskCb + kmaskHb); @@ -10945,7 +11025,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lp.showmaskexpmet == 2 || lp.showmaskexpmet == 3) { #ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) +// #pragma omp parallel for schedule(dynamic,16) #endif for (int y = 0; y < transformed->H ; y++) //{ @@ -10965,13 +11045,14 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { if (zone > 0) { - bufexporig->L[loy - begy][lox - begx] += CLIPLOC(lp.blendmaexp * bufmaskorig->L[loy - begy][lox - begx]); + + bufexporig->L[loy - begy][lox - begx] += CLIP(lp.blendmaexp * bufmaskorig->L[loy - begy][lox - begx]); bufexporig->a[loy - begy][lox - begx] += CLIPC(lp.blendmaexp * bufmaskorig->a[loy - begy][lox - begx]); bufexporig->b[loy - begy][lox - begx] += CLIPC(lp.blendmaexp * bufmaskorig->b[loy - begy][lox - begx]); - bufexporig->L[loy - begy][lox - begx] = CLIPLOC(bufexporig->L[loy - begy][lox - begx]); - originalmask->L[y][x] = CLIPLOC(bufexporig->L[loy - begy][lox - begx] - (lp.blendmaexp + 1.f) * bufmaskorig->L[loy - begy][lox - begx]); + + originalmask->L[y][x] = CLIP(bufexporig->L[loy - begy][lox - begx] - (lp.blendmaexp + 1.f) * bufmaskorig->L[loy - begy][lox - begx]); originalmask->a[y][x] = CLIPC(bufexporig->a[loy - begy][lox - begx] - (lp.blendmaexp + 1.f) * bufmaskorig->a[loy - begy][lox - begx]); - originalmask->b[y][x] = CLIPC(bufexporig->L[loy - begy][lox - begx] - (lp.blendmaexp + 1.f) * bufmaskorig->b[loy - begy][lox - begx]); + originalmask->b[y][x] = CLIPC(bufexporig->b[loy - begy][lox - begx] - (lp.blendmaexp + 1.f) * bufmaskorig->b[loy - begy][lox - begx]); } } @@ -11021,12 +11102,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - bufexptemp->L[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas - bufexptemp->a[loy - begy][lox - begx] = original->a[y][x];//fill square buffer with datas - bufexptemp->b[loy - begy][lox - begx] = original->b[y][x];//fill square buffer with datas - bufexpfin->L[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas - bufexpfin->a[loy - begy][lox - begx] = original->a[y][x];//fill square buffer with datas - bufexpfin->b[loy - begy][lox - begx] = original->b[y][x];//fill square buffer with datas + bufexptemp->L[loy - begy][lox - begx] = original->L[y][x]; + bufexptemp->a[loy - begy][lox - begx] = original->a[y][x]; + bufexptemp->b[loy - begy][lox - begx] = original->b[y][x]; + bufexpfin->L[loy - begy][lox - begx] = original->L[y][x]; + bufexpfin->a[loy - begy][lox - begx] = original->a[y][x]; + bufexpfin->b[loy - begy][lox - begx] = original->b[y][x]; } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index c13f2745e..f863fef9a 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -643,6 +643,7 @@ enum ProcEventCode { EvlocallabHHmaskexpshape = 613, Evlocallabblendmaskcol = 614, Evlocallabblendmaskexp = 615, + Evlocallabblurexpde = 616, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 04f960609..961d70487 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2382,8 +2382,9 @@ LocallabParams::LocallabSpot::LocallabSpot() : black(0), shcompr(50), warm(0), - sensiex(19), + sensiex(15), structexp(0), + blurexpde(5), excurve{(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}, showmaskexpMethod("none"), CCmaskexpcurve{(double)FCT_MinMaxCPoints, 0., 1., 0.35, 0.35, 1., 1., 0.35, 0.35}, @@ -2525,6 +2526,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && warm == other.warm && sensiex == other.sensiex && structexp == other.structexp + && blurexpde == other.blurexpde && excurve == other.excurve && showmaskexpMethod == other.showmaskexpMethod && CCmaskexpcurve == other.CCmaskexpcurve @@ -3618,6 +3620,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).warm, "Locallab", "Warm_" + std::to_string(i), spot.warm, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensiex, "Locallab", "Sensiex_" + std::to_string(i), spot.sensiex, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).structexp, "Locallab", "Structexp_" + std::to_string(i), spot.structexp, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blurexpde, "Locallab", "Blurexpde_" + std::to_string(i), spot.blurexpde, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).excurve, "Locallab", "ExCurve_" + std::to_string(i), spot.excurve, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).showmaskexpMethod, "Locallab", "ShowmaskexpMethod_" + std::to_string(i), spot.showmaskexpMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).CCmaskexpcurve, "Locallab", "CCmaskexpCurve_" + std::to_string(i), spot.CCmaskexpcurve, keyFile); @@ -4838,6 +4841,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Warm_" + std::to_string(i), pedited, spot.warm, spotEdited.warm); assignFromKeyfile(keyFile, "Locallab", "Sensiex_" + std::to_string(i), pedited, spot.sensiex, spotEdited.sensiex); assignFromKeyfile(keyFile, "Locallab", "Structexp_" + std::to_string(i), pedited, spot.structexp, spotEdited.structexp); + assignFromKeyfile(keyFile, "Locallab", "Blurexpde_" + std::to_string(i), pedited, spot.blurexpde, spotEdited.blurexpde); assignFromKeyfile(keyFile, "Locallab", "ExCurve_" + std::to_string(i), pedited, spot.excurve, spotEdited.excurve); assignFromKeyfile(keyFile, "Locallab", "ShowmaskexpMethod_" + std::to_string(i), pedited, spot.showmaskexpMethod, spotEdited.showmaskexpMethod); assignFromKeyfile(keyFile, "Locallab", "CCmaskexpCurve_" + std::to_string(i), pedited, spot.CCmaskexpcurve, spotEdited.CCmaskexpcurve); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 0da62de5c..0941d2549 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -981,6 +981,7 @@ struct LocallabParams { int warm; int sensiex; int structexp; + int blurexpde; std::vector excurve; Glib::ustring showmaskexpMethod; std::vector CCmaskexpcurve; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index d52933343..354900818 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -642,7 +642,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabstructexp LUMINANCECURVE, //EvlocallabHHmaskexpshape LUMINANCECURVE, //Evlocallabblendmaskcol - LUMINANCECURVE //Evlocallabblendmaskexp + LUMINANCECURVE, //Evlocallabblendmaskexp + LUMINANCECURVE //Evlocallabblurexpde }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index c73fd1658..728973a39 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -77,17 +77,18 @@ Locallab::Locallab(): chroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMA"), -100, 150, 1, 0))), sensi(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 19))), structcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), - blendmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -150, 100, 1, -100))), + blendmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -200, 100, 1, -100))), // Exposure - expcomp(Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -200, 800, 5, 0))), + expcomp(Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -200, 400, 5, 0))), hlcompr(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 60))), hlcomprthresh(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 33))), black(Gtk::manage(new Adjuster(M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 50, 0))), shcompr(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRSHADOWS"), 0, 100, 1, 50))), warm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_WARM"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-small.png")), Gtk::manage(new RTImage("circle-orange-small.png"))))), - sensiex(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 19))), + sensiex(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), structexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), - blendmaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -150, 100, 1, -100))), + blurexpde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), + blendmaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -200, 100, 1, -100))), // Vibrance saturated(Gtk::manage(new Adjuster(M("TP_VIBRANCE_SATURATED"), -100., 100., 1., 0.))), pastels(Gtk::manage(new Adjuster(M("TP_VIBRANCE_PASTELS"), -100., 100., 1., 0.))), @@ -378,6 +379,7 @@ Locallab::Locallab(): sensiex->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); sensiex->setAdjusterListener(this); structexp->setAdjusterListener(this); + blurexpde->setAdjusterListener(this); blendmaskexp->setAdjusterListener(this); curveEditorG->setCurveListener(this); @@ -448,6 +450,7 @@ Locallab::Locallab(): exposeBox->pack_start(*warm); exposeBox->pack_start(*sensiex); exposeBox->pack_start(*structexp); + exposeBox->pack_start(*blurexpde); exposeBox->pack_start(*curveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor exposeBox->pack_start(*maskexpFrame); @@ -1531,6 +1534,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).HHmaskcurve = HHmaskshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).invers = invers->get_active(); pp->locallab.spots.at(pp->locallab.selspot).structexp = structexp->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).blurexpde = blurexpde->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).blendmaskexp = blendmaskexp->getIntValue(); // Exposure pp->locallab.spots.at(pp->locallab.selspot).expexpose = expexpose->getEnabled(); @@ -1711,6 +1715,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).warm = pe->locallab.spots.at(pp->locallab.selspot).warm || warm->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensiex = pe->locallab.spots.at(pp->locallab.selspot).sensiex || sensiex->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).structexp = pe->locallab.spots.at(pp->locallab.selspot).structexp || structexp->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).blurexpde = pe->locallab.spots.at(pp->locallab.selspot).blurexpde || blurexpde->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).excurve = pe->locallab.spots.at(pp->locallab.selspot).excurve || !shapeexpos->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).showmaskexpMethod = pe->locallab.spots.at(pp->locallab.selspot).showmaskexpMethod || showmaskexpMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve || !CCmaskexpshape->isUnChanged(); @@ -1856,6 +1861,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).warm = pedited->locallab.spots.at(pp->locallab.selspot).warm || warm->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensiex = pedited->locallab.spots.at(pp->locallab.selspot).sensiex || sensiex->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).structexp = pedited->locallab.spots.at(pp->locallab.selspot).structexp || structexp->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).blurexpde = pedited->locallab.spots.at(pp->locallab.selspot).blurexpde || blurexpde->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).excurve = pedited->locallab.spots.at(pp->locallab.selspot).excurve || !shapeexpos->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).showmaskexpMethod = pedited->locallab.spots.at(pp->locallab.selspot).showmaskexpMethod || showmaskexpMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve || !CCmaskexpshape->isUnChanged(); @@ -2482,6 +2488,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe warm->setDefault((double)defSpot->warm); sensiex->setDefault((double)defSpot->sensiex); structexp->setDefault((double)defSpot->structexp); + blurexpde->setDefault((double)defSpot->blurexpde); blendmaskexp->setDefault((double)defSpot->blendmaskexp); // Vibrance saturated->setDefault((double)defSpot->saturated); @@ -2560,6 +2567,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe warm->setDefaultEditedState(Irrelevant); sensiex->setDefaultEditedState(Irrelevant); structexp->setDefaultEditedState(Irrelevant); + blurexpde->setDefaultEditedState(Irrelevant); blendmaskexp->setDefaultEditedState(Irrelevant); // Vibrance saturated->setDefaultEditedState(Irrelevant); @@ -2642,6 +2650,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe warm->setDefaultEditedState(defSpotState->warm ? Edited : UnEdited); sensiex->setDefaultEditedState(defSpotState->sensiex ? Edited : UnEdited); structexp->setDefaultEditedState(defSpotState->structexp ? Edited : UnEdited); + blurexpde->setDefaultEditedState(defSpotState->blurexpde ? Edited : UnEdited); blendmaskexp->setDefaultEditedState(defSpotState->blendmaskexp ? Edited : UnEdited); // Vibrance saturated->setDefaultEditedState(defSpotState->saturated ? Edited : UnEdited); @@ -2842,6 +2851,12 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == blurexpde) { + if (listener) { + listener->panelChanged(Evlocallabblurexpde, blurexpde->getTextValue()); + } + } + if (a == blendmaskexp) { if (listener) { listener->panelChanged(Evlocallabblendmaskexp, blendmaskexp->getTextValue()); @@ -3244,6 +3259,7 @@ void Locallab::setBatchMode(bool batchMode) warm->showEditedCB(); sensiex->showEditedCB(); structexp->showEditedCB(); + blurexpde->showEditedCB(); blendmaskexp->showEditedCB(); // Vibrance saturated->showEditedCB(); @@ -3591,6 +3607,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con warm->setValue(pp->locallab.spots.at(index).warm); sensiex->setValue(pp->locallab.spots.at(index).sensiex); structexp->setValue(pp->locallab.spots.at(index).structexp); + blurexpde->setValue(pp->locallab.spots.at(index).blurexpde); shapeexpos->setCurve(pp->locallab.spots.at(index).excurve); if (pp->locallab.spots.at(index).showmaskexpMethod == "none") { showmaskexpMethod->set_active(0); @@ -3790,6 +3807,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con shcompr->setEditedState(spotState->shcompr ? Edited : UnEdited); sensiex->setEditedState(spotState->sensiex ? Edited : UnEdited); structexp->setEditedState(spotState->structexp ? Edited : UnEdited); + blurexpde->setEditedState(spotState->blurexpde ? Edited : UnEdited); shapeexpos->setUnChanged(!spotState->excurve); if (!spotState->showmaskexpMethod) { showmaskexpMethod->set_active_text(M("GENERAL_UNCHANGED")); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 185b9544d..10afb24c1 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -105,6 +105,7 @@ private: Adjuster* const warm; Adjuster* const sensiex; Adjuster* const structexp; + Adjuster* const blurexpde; Adjuster* const blendmaskexp; // Vibrance Adjuster* const saturated; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 8c41192c2..b8dc98da3 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -970,6 +970,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).warm = locallab.spots.at(j).warm && pSpot.warm == otherSpot.warm; locallab.spots.at(j).sensiex = locallab.spots.at(j).sensiex && pSpot.sensiex == otherSpot.sensiex; locallab.spots.at(j).structexp = locallab.spots.at(j).structexp && pSpot.structexp == otherSpot.structexp; + locallab.spots.at(j).blurexpde = locallab.spots.at(j).blurexpde && pSpot.blurexpde == otherSpot.blurexpde; locallab.spots.at(j).excurve = locallab.spots.at(j).excurve && pSpot.excurve == otherSpot.excurve; locallab.spots.at(j).showmaskexpMethod = locallab.spots.at(j).showmaskexpMethod && pSpot.showmaskexpMethod == otherSpot.showmaskexpMethod; locallab.spots.at(j).CCmaskexpcurve = locallab.spots.at(j).CCmaskexpcurve && pSpot.CCmaskexpcurve == otherSpot.CCmaskexpcurve; @@ -2665,6 +2666,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).structexp = mods.locallab.spots.at(i).structexp; } + if (locallab.spots.at(i).blurexpde) { + toEdit.locallab.spots.at(i).blurexpde = mods.locallab.spots.at(i).blurexpde; + } + if (locallab.spots.at(i).excurve) { toEdit.locallab.spots.at(i).excurve = mods.locallab.spots.at(i).excurve; } @@ -3962,6 +3967,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : warm(v), sensiex(v), structexp(v), + blurexpde(v), excurve(v), showmaskexpMethod(v), CCmaskexpcurve(v), @@ -4099,6 +4105,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) warm = v; sensiex = v; structexp = v; + blurexpde = v; excurve = v; showmaskexpMethod = v; CCmaskexpcurve = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index b3c0ef036..091083ea5 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -509,6 +509,7 @@ public: bool warm; bool sensiex; bool structexp; + bool blurexpde; bool excurve; bool showmaskexpMethod; bool CCmaskexpcurve;