diff --git a/rtdata/languages/default b/rtdata/languages/default index cbcdebac3..24f3c3b5d 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1249,6 +1249,10 @@ HISTORY_MSG_1001;Local - Log recovery threshold HISTORY_MSG_1002;Local - Log threshold mask low HISTORY_MSG_1003;Local - Log threshold mask high HISTORY_MSG_1004;Local - Log decay +HISTORY_MSG_1005;Local - Exp recovery threshold +HISTORY_MSG_1006;Local - Exp threshold mask low +HISTORY_MSG_1007;Local - Exp threshold mask high +HISTORY_MSG_1008;Local - Exp decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2787,9 +2791,11 @@ TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the im TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained, unless you act on the slider "Gray area denoise". TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied +TP_LOCALLAB_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied TP_LOCALLAB_MASKRELOG_TOOLTIP;Used to modulate the effect of the Log encoding settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Log encoding settings - can be used to restore highlights reconstructed by Color propagation \n In between these two areas, the full value of the Log encoding settings will be applied TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. -TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'Blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP;Light-tone limit above which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Light-tone limit above which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light-tone limit above which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Light-tone limit above which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 @@ -2798,8 +2804,9 @@ TP_LOCALLAB_MASKLCTHRLOW;Dark area luminance threshold TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark and light areas TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;Dark-tone limit below which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Dark-tone limit below which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 -TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP;Dark-tone limit below which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLCTHRMID;Gray area denoise TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 18b1bc79a..28d5d847c 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -591,6 +591,10 @@ struct local_params { float lowthrc; float higthrc; float decayc; + float recothre; + float lowthre; + float higthre; + float decaye; float recothrl; float lowthrl; float higthrl; @@ -1055,6 +1059,12 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_lowthrc = (float)locallab.spots.at(sp).lowthresc; float local_higthrc = (float)locallab.spots.at(sp).higthresc; float local_decayc = (float)locallab.spots.at(sp).decayc; + + float local_recothre = (float)locallab.spots.at(sp).recothrese; + float local_lowthre = (float)locallab.spots.at(sp).lowthrese; + float local_higthre = (float)locallab.spots.at(sp).higthrese; + float local_decaye = (float)locallab.spots.at(sp).decaye; + float local_recothrl = (float)locallab.spots.at(sp).recothresl; float local_lowthrl = (float)locallab.spots.at(sp).lowthresl; float local_higthrl = (float)locallab.spots.at(sp).higthresl; @@ -1418,6 +1428,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthrc = local_lowthrc; lp.higthrc = local_higthrc; lp.decayc = local_decayc; + lp.recothre = local_recothre; + lp.lowthre = local_lowthre; + lp.higthre = local_higthre; + lp.decaye = local_decaye; + lp.recothrl = local_recothrl; lp.lowthrl = local_lowthrl; lp.higthrl = local_higthrl; @@ -8743,6 +8758,7 @@ void ImProcFunctions::fftw_denoise(int sk, int GW, int GH, int max_numblox_W, in } for (int i = 0; i < 3; ++i) { boxblur(static_cast(mask), static_cast(mask), 10 / sk, GW, GH, false); + } for (int i = 0; i < GH; ++i) { for (int j = 0; j < GW; ++j) { @@ -10529,6 +10545,79 @@ void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * or } } +void maskrecov(const LabImage * bufcolfin, LabImage * original, LabImage * bufmaskblurcol, int bfh, int bfw, int ystart, int xstart, float hig, float low, float recoth, float decay, bool invmask, int sk, bool multiThread) +{ + LabImage tmp3(bfw, bfh); + + for (int y = 0; y < bfh; y++){ + for (int x = 0; x < bfw; x++) { + tmp3.L[y][x] = original->L[y + ystart][x + xstart]; + tmp3.a[y][x] = original->a[y + ystart][x + xstart]; + tmp3.b[y][x] = original->b[y + ystart][x + xstart]; + } + } + array2D masklum; + masklum(bfw, bfh); + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + masklum[ir][jr] = 1.f; + } + + float higc; + calcdif(hig, higc); + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (recoth - 1.f); + float ahigh = th / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + + float alow = th / lowc; + float blow = 1.f - th; +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + const float lM = bufmaskblurcol->L[ir][jr]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lowc) { + masklum[ir][jr] = alow * lmr + blow; + } else if (lM < 327.68f * higc) { + //nothing...but we can.. + } else { + masklum[ir][jr] = ahigh * lmr + bhigh; + } + float k = masklum[ir][jr]; + if(invmask == false) { + masklum[ir][jr] = 1 - pow(k, decay); + } else { + masklum[ir][jr] = pow(k, decay); + } + + } + + for (int i = 0; i < 3; ++i) { + boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int i = 0; i < bfh; ++i) { + for (int j = 0; j < bfw; ++j) { + bufcolfin->L[i][j] = (tmp3.L[i][j] - bufcolfin->L[i][j]) * LIM01(masklum[i][j]) + bufcolfin->L[i][j]; + bufcolfin->a[i][j] = (tmp3.a[i][j] - bufcolfin->a[i][j]) * LIM01(masklum[i][j]) + bufcolfin->a[i][j]; + bufcolfin->b[i][j] = (tmp3.b[i][j] - bufcolfin->b[i][j]) * LIM01(masklum[i][j]) + bufcolfin->b[i][j]; + } + } + masklum.free(); +} + + void ImProcFunctions::Lab_Local( int call, int sp, float** shbuffer, LabImage * original, LabImage * transformed, LabImage * reserved, LabImage * lastorig, int cx, int cy, int oW, int oH, int sk, @@ -10829,84 +10918,17 @@ void ImProcFunctions::Lab_Local( } } } + //end graduated if(lp.enaLMask && lp.recothrl != 1.f) { - LabImage tmp3(bfw, bfh); - - for (int y = 0; y < bfh; y++){ - for (int x = 0; x < bfw; x++) { - tmp3.L[y][x] = original->L[y + ystart][x + xstart]; - tmp3.a[y][x] = original->a[y + ystart][x + xstart]; - tmp3.b[y][x] = original->b[y + ystart][x + xstart]; - } - } - array2D masklum; - masklum(bfw, bfh); - for (int ir = 0; ir < bfh; ir++) - for (int jr = 0; jr < bfw; jr++) { - masklum[ir][jr] = 1.f; - } - float hig = lp.higthrl; - float higc; - calcdif(hig, higc); float low = lp.lowthrl; - float lowc; - calcdif(low, lowc); - - if(higc < lowc) { - higc = lowc + 0.01f; - } - float th = (lp.recothrl - 1.f); - float ahigh = th / (higc - 100.f); - float bhigh = 1.f - higc * ahigh; - - float alow = th / lowc; - float blow = 1.f - th; - bool invmaskl = false; -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int ir = 0; ir < bfh; ir++) - for (int jr = 0; jr < bfw; jr++) { - const float lM = bufmaskoriglog->L[ir][jr]; - const float lmr = lM / 327.68f; - if (lM < 327.68f * lowc) { - masklum[ir][jr] = alow * lmr + blow; - } else if (lM < 327.68f * higc) { - - } else { - masklum[ir][jr] = ahigh * lmr + bhigh; - } - float k = masklum[ir][jr]; - if(invmaskl == false) { - masklum[ir][jr] = 1 - pow(k, lp.decayl); - } else { - masklum[ir][jr] = pow(k, lp.decayl); - } - - } - - for (int i = 0; i < 3; ++i) { - boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); - } - -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int i = 0; i < bfh; ++i) { - for (int j = 0; j < bfw; ++j) { - bufexpfin->L[i][j] = (tmp3.L[i][j] - bufexpfin->L[i][j]) * LIM01(masklum[i][j]) + bufexpfin->L[i][j]; - bufexpfin->a[i][j] = (tmp3.a[i][j] - bufexpfin->a[i][j]) * LIM01(masklum[i][j]) + bufexpfin->a[i][j]; - bufexpfin->b[i][j] = (tmp3.b[i][j] - bufexpfin->b[i][j]) * LIM01(masklum[i][j]) + bufexpfin->b[i][j]; - } - } - masklum.free(); - + float recoth = lp.recothrl; + float decay = lp.decayl; + bool invmask = false; + maskrecov(bufexpfin.get(), original, bufmaskoriglog.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); } - - //end graduated transit_shapedetect2(call, 11, bufexporig.get(), bufexpfin.get(), originalmasklog.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); } @@ -14307,6 +14329,16 @@ void ImProcFunctions::Lab_Local( if (lp.softradiusexp > 0.f && lp.expmet == 0) { softproc(buforig.get(), bufexpfin.get(), lp.softradiusexp, bfh, bfw, 0.1, 0.001, 0.5f, sk, multiThread, 1); } + + if(lp.enaExpMask && lp.recothre != 1.f) { + float hig = lp.higthre; + float low = lp.lowthre; + float recoth = lp.recothre; + float decay = lp.decaye; + bool invmask = false; + maskrecov(bufexpfin.get(), original, bufmaskblurexp.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); + } + float meansob = 0.f; transit_shapedetect2(call, 1, bufexporig.get(), bufexpfin.get(), originalmaskexp.get(), hueref, chromaref, lumaref, sobelref, meansob, blend2, lp, original, transformed, cx, cy, sk); } @@ -15455,78 +15487,12 @@ void ImProcFunctions::Lab_Local( //mask recovery if(lp.enaColorMask && lp.recothrc != 1.f) { - LabImage tmp3(bfw, bfh); - - for (int y = 0; y < bfh; y++){ - for (int x = 0; x < bfw; x++) { - tmp3.L[y][x] = original->L[y + ystart][x + xstart]; - tmp3.a[y][x] = original->a[y + ystart][x + xstart]; - tmp3.b[y][x] = original->b[y + ystart][x + xstart]; - } - } - array2D masklum; - masklum(bfw, bfh); - for (int ir = 0; ir < bfh; ir++) - for (int jr = 0; jr < bfw; jr++) { - masklum[ir][jr] = 1.f; - } - float hig = lp.higthrc; - float higc; - calcdif(hig, higc); float low = lp.lowthrc; - float lowc; - calcdif(low, lowc); - - if(higc < lowc) { - higc = lowc + 0.01f; - } - float th = (lp.recothrc - 1.f); - float ahigh = th / (higc - 100.f); - float bhigh = 1.f - higc * ahigh; - - float alow = th / lowc; - float blow = 1.f - th; - bool invmaskc = false; -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int ir = 0; ir < bfh; ir++) - for (int jr = 0; jr < bfw; jr++) { - const float lM = bufmaskblurcol->L[ir][jr]; - const float lmr = lM / 327.68f; - if (lM < 327.68f * lowc) { - masklum[ir][jr] = alow * lmr + blow; - } else if (lM < 327.68f * higc) { - - } else { - masklum[ir][jr] = ahigh * lmr + bhigh; - } - float k = masklum[ir][jr]; - if(invmaskc == false) { - masklum[ir][jr] = 1 - pow(k, lp.decayc); - } else { - masklum[ir][jr] = pow(k, lp.decayc); - } - - } - - for (int i = 0; i < 3; ++i) { - boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); - } - -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int i = 0; i < bfh; ++i) { - for (int j = 0; j < bfw; ++j) { - bufcolfin->L[i][j] = (tmp3.L[i][j] - bufcolfin->L[i][j]) * LIM01(masklum[i][j]) + bufcolfin->L[i][j]; - bufcolfin->a[i][j] = (tmp3.a[i][j] - bufcolfin->a[i][j]) * LIM01(masklum[i][j]) + bufcolfin->a[i][j]; - bufcolfin->b[i][j] = (tmp3.b[i][j] - bufcolfin->b[i][j]) * LIM01(masklum[i][j]) + bufcolfin->b[i][j]; - } - } - masklum.free(); - + float recoth = lp.recothrc; + float decay = lp.decayc; + bool invmask = false; + maskrecov(bufcolfin.get(), original, bufmaskblurcol.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); } float meansob = 0.f; transit_shapedetect2(call, 0, bufcolorig.get(), bufcolfin.get(), originalmaskcol.get(), hueref, chromaref, lumaref, sobelref, meansob, blend2, lp, original, transformed, cx, cy, sk); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 8bad0a588..31e1da96d 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1027,6 +1027,10 @@ enum ProcEventCode { Evlocallablowthresl = 1001, Evlocallabhigthresl = 1002, Evlocallabdecayl = 1003, + Evlocallabrecothrese = 1004, + Evlocallablowthrese = 1005, + Evlocallabhigthrese = 1006, + Evlocallabdecaye = 1007, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 3698518ee..ef2ac7a88 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3126,6 +3126,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : fatdetail(40.0), fatanchor(1.0), fatlevel(1.), + recothrese(1.), + lowthrese(12.), + higthrese(85.), + decaye(2.), // Shadow highlight visishadhigh(false), expshadhigh(false), @@ -4278,6 +4282,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && fatdetail == other.fatdetail && fatanchor == other.fatanchor && fatlevel == other.fatlevel + && recothrese == other.recothrese + && lowthrese == other.lowthrese + && higthrese == other.higthrese + && decaye == other.decaye // Shadow highlight && visishadhigh == other.visishadhigh && expshadhigh == other.expshadhigh @@ -5883,6 +5891,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->fatdetail, "Locallab", "Fatdetail_" + index_str, spot.fatdetail, keyFile); saveToKeyfile(!pedited || spot_edited->fatanchor, "Locallab", "Fatanchor_" + index_str, spot.fatanchor, keyFile); saveToKeyfile(!pedited || spot_edited->fatlevel, "Locallab", "Fatlevel_" + index_str, spot.fatlevel, keyFile); + saveToKeyfile(!pedited || spot_edited->recothrese, "Locallab", "Recothrese_" + index_str, spot.recothrese, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthrese, "Locallab", "Lowthrese_" + index_str, spot.lowthrese, keyFile); + saveToKeyfile(!pedited || spot_edited->higthrese, "Locallab", "Higthrese_" + index_str, spot.higthrese, keyFile); + saveToKeyfile(!pedited || spot_edited->decaye, "Locallab", "Decaye_" + index_str, spot.decaye, keyFile); } // Shadow highlight if ((!pedited || spot_edited->visishadhigh) && spot.visishadhigh) { @@ -7679,6 +7691,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Fatdetail_" + index_str, pedited, spot.fatdetail, spotEdited.fatdetail); assignFromKeyfile(keyFile, "Locallab", "Fatanchor_" + index_str, pedited, spot.fatanchor, spotEdited.fatanchor); assignFromKeyfile(keyFile, "Locallab", "Fatlevel_" + index_str, pedited, spot.fatlevel, spotEdited.fatlevel); + assignFromKeyfile(keyFile, "Locallab", "Recothrese_" + index_str, pedited, spot.recothrese, spotEdited.recothrese); + assignFromKeyfile(keyFile, "Locallab", "Lowthrese_" + index_str, pedited, spot.lowthrese, spotEdited.lowthrese); + assignFromKeyfile(keyFile, "Locallab", "Higthrese_" + index_str, pedited, spot.higthrese, spotEdited.higthrese); + assignFromKeyfile(keyFile, "Locallab", "Decaye_" + index_str, pedited, spot.decaye, spotEdited.decaye); // Shadow highlight spot.visishadhigh = assignFromKeyfile(keyFile, "Locallab", "Expshadhigh_" + index_str, pedited, spot.expshadhigh, spotEdited.expshadhigh); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index fd5726646..659ccb652 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1131,6 +1131,10 @@ struct LocallabParams { double fatdetail; double fatanchor; double fatlevel; + double recothrese; + double lowthrese; + double higthrese; + double decaye; // Shadow highlight bool visishadhigh; bool expshadhigh; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index d97dc1ce2..6e7c6a3d2 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1030,7 +1030,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothresl LUMINANCECURVE, // Evlocallablowthresl LUMINANCECURVE, // Evlocallabhigthresl - LUMINANCECURVE // Evlocallabdecayl + LUMINANCECURVE, // Evlocallabdecayl + LUMINANCECURVE, // Evlocallabrecothrese + LUMINANCECURVE, // Evlocallablowthrese + LUMINANCECURVE, // Evlocallabhigthrese + LUMINANCECURVE // Evlocallabdecaye }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 2641d404e..bf8b2e344 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -2496,6 +2496,13 @@ LocallabExposure::LocallabExposure(): expchroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EXPCHROMA"), -50, 100, 1, 5))), curveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_CURVEEDITOR_TONES_LABEL"))), shapeexpos(static_cast(curveEditorG->addCurve(CT_Diagonal, ""))), + exprecove(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusablee(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusablee(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothrese(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthrese(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthrese(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decaye(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), expgradexp(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_EXPGRAD")))), strexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -4., 4., 0.05, 0.))), angexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -180, 180, 0.1, 0.))), @@ -2597,6 +2604,11 @@ LocallabExposure::LocallabExposure(): softradiusexp->setLogScale(10, 0); softradiusexp->setAdjusterListener(this); + recothrese->setAdjusterListener(this); + lowthrese->setAdjusterListener(this); + higthrese->setAdjusterListener(this); + decaye->setAdjusterListener(this); + setExpandAlignProperties(exprecove, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); inversexConn = inversex->signal_toggled().connect(sigc::mem_fun(*this, &LocallabExposure::inversexChanged)); inversex->set_tooltip_text(M("TP_LOCALLAB_INVERS_TOOLTIP")); @@ -2706,6 +2718,16 @@ LocallabExposure::LocallabExposure(): toolBox->pack_start(*curveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor exptoolexp->add(*toolBox, false); pack_start(*exptoolexp); + ToolParamBlock* const expBox3 = Gtk::manage(new ToolParamBlock()); + expBox3->pack_start(*maskusablee, Gtk::PACK_SHRINK, 0); + expBox3->pack_start(*maskunusablee, Gtk::PACK_SHRINK, 0); + expBox3->pack_start(*recothrese); + expBox3->pack_start(*lowthrese); + expBox3->pack_start(*higthrese); + expBox3->pack_start(*decaye); + exprecove->add(*expBox3, false); + pack_start(*exprecove, false, false); + ToolParamBlock* const gradBox = Gtk::manage(new ToolParamBlock()); gradBox->pack_start(*strexp); gradBox->pack_start(*angexp); @@ -2772,6 +2794,10 @@ void LocallabExposure::updateAdviceTooltips(const bool showTooltips) // expMethod->set_tooltip_text(M("TP_LOCALLAB_EXPMETHOD_TOOLTIP")); // pdeFrame->set_tooltip_text(M("TP_LOCALLAB_PDEFRAME_TOOLTIP")); exppde->set_tooltip_text(M("TP_LOCALLAB_PDEFRAME_TOOLTIP")); + exprecove->set_tooltip_markup(M("TP_LOCALLAB_MASKREEXP_TOOLTIP")); + decaye->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthrese->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP")); + higthrese->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP")); blurexpde->set_tooltip_text(M("TP_LOCALLAB_BLURCOLDE_TOOLTIP")); laplacexp->set_tooltip_text(M("TP_LOCALLAB_EXPLAP_TOOLTIP")); linear->set_tooltip_text(M("TP_LOCALLAB_EXPLAPLIN_TOOLTIP")); @@ -2806,6 +2832,7 @@ void LocallabExposure::updateAdviceTooltips(const bool showTooltips) exp->set_tooltip_text(""); exppde->set_tooltip_text(""); blurexpde->set_tooltip_text(""); + exprecove->set_tooltip_markup(""); laplacexp->set_tooltip_text(""); linear->set_tooltip_text(""); balanexp->set_tooltip_text(""); @@ -2838,6 +2865,7 @@ void LocallabExposure::updateAdviceTooltips(const bool showTooltips) void LocallabExposure::setDefaultExpanderVisibility() { exptoolexp->set_expanded(false); + exprecove->set_expanded(false); exppde->set_expanded(false); expfat->set_expanded(false); expgradexp->set_expanded(false); @@ -2906,6 +2934,11 @@ void LocallabExposure::read(const rtengine::procparams::ProcParams* pp, const Pa exnoiseMethod->set_active(2); } + recothrese->setValue((double)spot.recothrese); + lowthrese->setValue((double)spot.lowthrese); + higthrese->setValue((double)spot.higthrese); + decaye->setValue((double)spot.decaye); + fatamount->setValue(spot.fatamount); fatdetail->setValue(spot.fatdetail); fatlevel->setValue(spot.fatlevel); @@ -2988,6 +3021,10 @@ void LocallabExposure::write(rtengine::procparams::ProcParams* pp, ParamsEdited* } else if (exnoiseMethod->get_active_row_number() == 2) { spot.exnoiseMethod = "medhi"; } + spot.recothrese = recothrese->getValue(); + spot.lowthrese = lowthrese->getValue(); + spot.higthrese = higthrese->getValue(); + spot.decaye = decaye->getValue(); spot.fatamount = fatamount->getValue(); spot.fatdetail = fatdetail->getValue(); @@ -3064,6 +3101,10 @@ void LocallabExposure::setDefaults(const rtengine::procparams::ProcParams* defPa slomaskexp->setDefault(defSpot.slomaskexp); strmaskexp->setDefault(defSpot.strmaskexp); angmaskexp->setDefault(defSpot.angmaskexp); + recothrese->setDefault((double)defSpot.recothrese); + lowthrese->setDefault((double)defSpot.lowthrese); + higthrese->setDefault((double)defSpot.higthrese); + decaye->setDefault((double)defSpot.decaye); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -3133,6 +3174,34 @@ void LocallabExposure::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothrese) { + if (listener) { + listener->panelChanged(Evlocallabrecothrese, + recothrese->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthrese) { + if (listener) { + listener->panelChanged(Evlocallablowthrese, + lowthrese->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthrese) { + if (listener) { + listener->panelChanged(Evlocallabhigthrese, + higthrese->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decaye) { + if (listener) { + listener->panelChanged(Evlocallabdecaye, + decaye->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == sensiex) { if (listener) { listener->panelChanged(Evlocallabsensiex, @@ -3352,6 +3421,7 @@ void LocallabExposure::convertParamToNormal() slomaskexp->setValue(defSpot.slomaskexp); strmaskexp->setValue(defSpot.strmaskexp); angmaskexp->setValue(defSpot.angmaskexp); + decaye->setValue(defSpot.decaye); // Enable all listeners enableListener(); @@ -3377,6 +3447,10 @@ void LocallabExposure::convertParamToSimple() // radmaskexp->setValue(defSpot.radmaskexp); // chromaskexp->setValue(defSpot.chromaskexp); // Lmaskexpshape->setCurve(defSpot.Lmaskexpcurve); + recothrese->setValue(defSpot.recothrese); + lowthrese->setValue(defSpot.lowthrese); + higthrese->setValue(defSpot.higthrese); + decaye->setValue(defSpot.decaye); // Enable all listeners enableListener(); @@ -3391,6 +3465,10 @@ void LocallabExposure::updateGUIToMode(const modeType new_type) blurexpde->hide(); expgradexp->hide(); softradiusexp->hide(); + exprecove->hide(); + maskusablee->hide(); + maskunusablee->hide(); + decaye->hide(); expmaskexp->hide(); break; @@ -3403,14 +3481,25 @@ void LocallabExposure::updateGUIToMode(const modeType new_type) gammaskexp->hide(); slomaskexp->hide(); gradFramemask->hide(); + exprecove->show(); + if (enaExpMask->get_active()) { + maskusablee->show(); + maskunusablee->hide(); + + } else { + maskusablee->hide(); + maskunusablee->show(); + } // Specific Simple mode widgets are shown in Normal mode if (!inversex->get_active()) { // Keep widget hidden when invers is toggled expgradexp->show(); softradiusexp->show(); + exprecove->show(); } expmaskexp->show(); + decaye->hide(); break; @@ -3425,6 +3514,15 @@ void LocallabExposure::updateGUIToMode(const modeType new_type) if (!inversex->get_active()) { // Keep widget hidden when invers is toggled expgradexp->show(); softradiusexp->show(); + exprecove->show(); + } + if (enaExpMask->get_active()) { + maskusablee->show(); + maskunusablee->hide(); + + } else { + maskusablee->hide(); + maskunusablee->show(); } expmaskexp->show(); @@ -3432,6 +3530,7 @@ void LocallabExposure::updateGUIToMode(const modeType new_type) gammaskexp->show(); slomaskexp->show(); gradFramemask->show(); + decaye->show(); } } @@ -3538,6 +3637,14 @@ void LocallabExposure::showmaskexpMethodChangedinv() void LocallabExposure::enaExpMaskChanged() { + if (enaExpMask->get_active()) { + maskusablee->show(); + maskunusablee->hide(); + } else { + maskusablee->hide(); + maskunusablee->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enaExpMask->get_active()) { @@ -3605,6 +3712,7 @@ void LocallabExposure::updateExposureGUI3() if (inversex->get_active()) { expMethod->hide(); expcomp->setLabel(M("TP_LOCALLAB_EXPCOMPINV")); + exprecove->hide(); // Manage specific case where expMethod is different from 0 if (expMethod->get_active_row_number() > 0) { @@ -3631,6 +3739,7 @@ void LocallabExposure::updateExposureGUI3() if (mode == Expert || mode == Normal) { // Keep widgets hidden in Simple mode softradiusexp->show(); expgradexp->show(); + exprecove->show(); } showmaskexpMethodinv->hide(); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 56b4e0b20..d8378748a 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -354,6 +354,14 @@ private: Adjuster* const expchroma; CurveEditorGroup* const curveEditorG; DiagonalCurveEditor* shapeexpos; + MyExpander* const exprecove; + Gtk::Label* const maskusablee; + Gtk::Label* const maskunusablee; + Adjuster* const recothrese; + Adjuster* const lowthrese; + Adjuster* const higthrese; + Adjuster* const decaye; + MyExpander* const expgradexp; Adjuster* const strexp; Adjuster* const angexp; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index d32e75488..f7ea7f554 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1198,6 +1198,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).fatdetail = locallab.spots.at(j).fatdetail && pSpot.fatdetail == otherSpot.fatdetail; locallab.spots.at(j).fatanchor = locallab.spots.at(j).fatanchor && pSpot.fatanchor == otherSpot.fatanchor; locallab.spots.at(j).fatlevel = locallab.spots.at(j).fatlevel && pSpot.fatlevel == otherSpot.fatlevel; + locallab.spots.at(j).recothrese = locallab.spots.at(j).recothrese && pSpot.recothrese == otherSpot.recothrese; + locallab.spots.at(j).lowthrese = locallab.spots.at(j).lowthrese && pSpot.lowthrese == otherSpot.lowthrese; + locallab.spots.at(j).higthrese = locallab.spots.at(j).higthrese && pSpot.higthrese == otherSpot.higthrese; + locallab.spots.at(j).decaye = locallab.spots.at(j).decaye && pSpot.decaye == otherSpot.decaye; // Shadow highlight locallab.spots.at(j).visishadhigh = locallab.spots.at(j).visishadhigh && pSpot.visishadhigh == otherSpot.visishadhigh; locallab.spots.at(j).expshadhigh = locallab.spots.at(j).expshadhigh && pSpot.expshadhigh == otherSpot.expshadhigh; @@ -3756,6 +3760,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).fatlevel = mods.locallab.spots.at(i).fatlevel; } + if (locallab.spots.at(i).recothrese) { + toEdit.locallab.spots.at(i).recothrese = mods.locallab.spots.at(i).recothrese; + } + + if (locallab.spots.at(i).lowthrese) { + toEdit.locallab.spots.at(i).lowthrese = mods.locallab.spots.at(i).lowthrese; + } + + if (locallab.spots.at(i).higthrese) { + toEdit.locallab.spots.at(i).higthrese = mods.locallab.spots.at(i).higthrese; + } + + if (locallab.spots.at(i).decaye) { + toEdit.locallab.spots.at(i).decaye = mods.locallab.spots.at(i).decaye; + } + // Shadow highlight if (locallab.spots.at(i).visishadhigh) { toEdit.locallab.spots.at(i).visishadhigh = mods.locallab.spots.at(i).visishadhigh; @@ -6596,6 +6616,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : fatdetail(v), fatanchor(v), fatlevel(v), + recothrese(v), + lowthrese(v), + higthrese(v), + decaye(v), // Shadow highlight visishadhigh(v), expshadhigh(v), @@ -7129,6 +7153,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) fatdetail = v; fatanchor = v; fatlevel = v; + recothrese = v; + lowthrese = v; + higthrese = v; + decaye = v; // Shadow highlight visishadhigh = v; expshadhigh = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 70eb19f75..a30fa2022 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -539,6 +539,10 @@ public: bool fatdetail; bool fatanchor; bool fatlevel; + bool recothrese; + bool lowthrese; + bool higthrese; + bool decaye; // Shadow highlight bool visishadhigh; bool expshadhigh;