From 94f54b644380f2cb57a44368e6446e1a783a7cf6 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 27 Dec 2020 08:14:51 +0100 Subject: [PATCH] Local adjustments - Denoise and Guided Filter - Recovery based on luminance mask (#6032) * Slider recovery threshold guidedfilter * Enable GuidedFilter recovery based on mask * Enable inverse GF recovery * Small changes GUI * Recovery GUI denoise LA * Enable recovery denoise with mask luminance * Fixed bad compilation error * Fixed bad behavior GUI expert - basic * Another fixed bad behavior GUI * First changes and verifications algo and GUI * Others GUI modifications * Fixed bug compilation and reset and clean code * Some changes in algo - new tooltip * Added calcdif to denoise - prepare GUI - change some tooltips * Change tooltips * Change some settings * Small Change settings default curve denoise --- rtdata/languages/default | 30 ++- rtengine/iplocallab.cc | 399 +++++++++++++++++++++++++++++++++++++-- rtengine/procevents.h | 11 +- rtengine/procparams.cc | 40 +++- rtengine/procparams.h | 9 + rtengine/refreshmap.cc | 12 +- rtgui/locallabtools.cc | 320 ++++++++++++++++++++++++++++++- rtgui/locallabtools.h | 21 ++- rtgui/paramsedited.cc | 63 +++++++ rtgui/paramsedited.h | 9 + 10 files changed, 882 insertions(+), 32 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 33d260c31..4b91668cc 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1231,6 +1231,14 @@ HISTORY_MSG_983;Local - denoise threshold mask high HISTORY_MSG_984;Local - denoise threshold mask low HISTORY_MSG_985;Local - denoise Laplacian HISTORY_MSG_986;Local - denoise reinforce +HISTORY_MSG_987;Local - GF recovery threshold +HISTORY_MSG_988;Local - GF threshold mask low +HISTORY_MSG_989;Local - GF threshold mask high +HISTORY_MSG_990;Local - Denoise recovery threshold +HISTORY_MSG_991;Local - Denoise threshold mask low +HISTORY_MSG_992;Local - Denoise threshold mask high +HISTORY_MSG_993;Local - Denoise Inverse algo +HISTORY_MSG_994;Local - GF Inverse algo HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2551,6 +2559,7 @@ TP_LOCALLAB_DENOICHROF_TOOLTIP;Allows you to adjust fine-detail chrominance nois TP_LOCALLAB_DENOIEQUALCHRO_TOOLTIP;Allows you to direct the chroma noise reduction towards either the blue-yellow or red-green colors. TP_LOCALLAB_DENOIEQUAL_TOOLTIP;Allows you to carry out more or less noise reduction in either the shadows or the highlights. TP_LOCALLAB_DENOI1_EXP;Denoise based on luminance mask +TP_LOCALLAB_DENOI2_EXP;Recovery based on luminance mask TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP;Allows you to recover luminance detail by progressively applying a Fourier transform (DCT). TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservative mode preserves low frequency detail. “Aggressive” mode removes low frequency detail. TP_LOCALLAB_DENOIS;Ψ Denoise @@ -2672,6 +2681,7 @@ TP_LOCALLAB_INVBL;Inverse TP_LOCALLAB_INVBL_TOOLTIP;Alternative to ‘Inverse’ mode: use two spots\nFirst Spot:\n full image - delimiter outside preview\n RT-spot shape: rectangle. Transition 100\n\nSecond spot : Excluding spot TP_LOCALLAB_INVERS;Inverse TP_LOCALLAB_INVERS_TOOLTIP;Fewer possibilities if selected (Inverse).\n\nAlternative: use two spots\nFirst Spot:\n full image - delimiter outside preview\n RT-spot shape: rectangle. Transition 100\n\nSecond spot: Excluding spot +TP_LOCALLAB_INVMASK;Inverse algorithm TP_LOCALLAB_ISOGR;Coarseness (ISO) TP_LOCALLAB_LABBLURM;Blur Mask TP_LOCALLAB_LABEL;Local Adjustments @@ -2760,13 +2770,25 @@ TP_LOCALLAB_MASKCOM;Common Color Mask TP_LOCALLAB_MASKCOM_TOOLNAME;Common Color Mask - 13 TP_LOCALLAB_MASKCOM_TOOLTIP;A tool in its own right.\nCan be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope. TP_LOCALLAB_MASKCURVE_TOOLTIP;The 3 curves are set to 1 (maximum) by default:\nC=f(C) the chroma varies according to the chrominance. You can decrease the chroma to improve the selection. By setting this curve close to zero (with a low value of C to activate the curve) you can desaturate the background in Inverse mode.\nL=f(L) the luminance varies according to the luminance, so you can decrease the brightness to improve the selection.\nL and C = f(H) luminance and chroma vary with hue, so you can decrease luminance and chroma to improve selection +TP_LOCALLAB_MASKDDECAY;Decay strength +TP_LOCALLAB_MASKDECAY_TOOLTIP;Manages the rate of decay for the gray levels in the mask.\n Decay = 1 linear, Decay > 1 sharper parabolic transitions, Decay < 1 more gradual transitions TP_LOCALLAB_MASKH;Hue curve -TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (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 very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. -TP_LOCALLAB_MASKLCTHR;Light area luminance % threshold -TP_LOCALLAB_MASKLCTHRLOW; Dark area luminance % threshold -TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark areas +TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (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 very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. +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. +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_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. +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 +TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Light limit above which the GuidedFilter will be applied progressively.\n You can used some tools in 'mask and modifications' to change the gray levels: 'structure mask', 'Smooth radius', 'Gamma and slope', 'Contrast curve', 'Local contrast wavelet'.\n You can use 'lockable color picker' on mask to see what areas will be take into account. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light limit above which the denoise will be applied progressively.\n You can used some tools in 'mask and modifications' to change the gray levels: 'structure mask', 'Smooth radius', 'Gamma and slope', 'Contrast curve', 'Local contrast wavelet'.\n You can use 'lockable color picker' on mask to see what areas will be take into account. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLCTHR;Light area luminance threshold +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_MASKUSABLE;Mask enabled (Mask & modifications) TP_LOCALLAB_MASKUNUSABLE;Mask disabled (Mask & modifications) +TP_LOCALLAB_MASKRECOTHRES;Recovery threshold TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a tool by activating another tool and using only the mask (set the tool sliders to 0 ).\n\nYou can also duplicate the RT-spot and place it close to the first spot. The small variations in the spot references allows you to make fine adjustments. TP_LOCALLAB_MED;Medium TP_LOCALLAB_MEDIAN;Median Low diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 7738f3d7a..f19deeeca 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -150,6 +150,26 @@ constexpr float exclusion(float a, float b) return a + b - 2.f * a * b; } +void calcdif(float lmr, float &lmrc) +{ //approximative change between gamma sRGB g=2.4 s=12.92 and gamma LAB g=3.0 s=9.03 + //useful to calculate action with dark and light area mask + //differences in 3 parts linear...very small diffrences with real... + float a0 = 7.6f / 11.6f;//11.6 sRGB - 7.6 Lab...11.6 max difference + float a01 = 62.f - 7.6f; //60 sRGB 62 Lab 60 max difference + float a11 = 60.f - 11.6f; + float a1 = a01 / a11; + float b1 = 62.f - a1 * 60.f; + float a2 = (100.f - 62.f) / (100.f - 60.f); + float b2 = 100.f - a2 * 100.f; + if(lmr < 11.6f) { + lmrc = a0 * lmr; + } else if (lmr < 60.) { + lmrc = a1 * lmr + b1; + } else { + lmrc = a2 * lmr + b2; + } +} + void calcGammaLut(double gamma, double ts, LUTf &gammaLut) { double pwr = 1.0 / gamma; @@ -546,6 +566,8 @@ struct local_params { int softmet; int blurmet; int blmet; + bool invmaskd; + bool invmask; int smasktyp; int chromet; int quamet; @@ -557,6 +579,13 @@ struct local_params { float noiself2; float noiseldetail; int detailthr; + float recothr; + float lowthr; + float higthr; + float recothrd; + float lowthrd; + float higthrd; + float decayd; int noiselequal; float noisechrodetail; float bilat; @@ -846,6 +875,19 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.blurmet = 1; } + if (locallab.spots.at(sp).invmask == false) { + lp.invmask = false; + } else if (locallab.spots.at(sp).invmask == true) { + lp.invmask = true; + } + + if (locallab.spots.at(sp).invmaskd == false) { + lp.invmaskd = false; + } else if (locallab.spots.at(sp).invmaskd == true) { + lp.invmaskd = true; + } + + if (locallab.spots.at(sp).showmaskblMethodtyp == "blur") { lp.smasktyp = 0; } else if (locallab.spots.at(sp).showmaskblMethodtyp == "nois") { @@ -982,7 +1024,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall if (lp.denoiena) { local_noiself0 = 250.f * locwavCurveden[0]; local_noiself = 250.f * locwavCurveden[166]; - local_noiself2 = 250.f * locwavCurveden[323]; + local_noiself2 = 250.f * locwavCurveden[333]; local_noiselc = 200.f * locwavCurveden[500]; } } @@ -992,6 +1034,13 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_noisechrodetail = (float)locallab.spots.at(sp).noisechrodetail; int local_sensiden = locallab.spots.at(sp).sensiden; float local_detailthr = (float)locallab.spots.at(sp).detailthr; + float local_recothr = (float)locallab.spots.at(sp).recothres; + float local_lowthr = (float)locallab.spots.at(sp).lowthres; + float local_higthr = (float)locallab.spots.at(sp).higthres; + float local_recothrd = (float)locallab.spots.at(sp).recothresd; + float local_lowthrd = (float)locallab.spots.at(sp).lowthresd; + float local_higthrd = (float)locallab.spots.at(sp).higthresd; + float local_decayd = (float)locallab.spots.at(sp).decayd; float local_noisecf = ((float)locallab.spots.at(sp).noisechrof) / 10.f; float local_noisecc = ((float)locallab.spots.at(sp).noisechroc) / 10.f; @@ -1339,6 +1388,13 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.noiself2 = local_noiself2; lp.noiseldetail = local_noiseldetail; lp.detailthr = local_detailthr; + lp.recothr = local_recothr; + lp.lowthr = local_lowthr; + lp.higthr = local_higthr; + lp.recothrd = local_recothrd; + lp.lowthrd = local_lowthrd; + lp.higthrd = local_higthrd; + lp.decayd = local_decayd; lp.noiselequal = local_noiselequal; lp.noisechrodetail = local_noisechrodetail; lp.noiselc = local_noiselc; @@ -8933,14 +8989,22 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if(lp.enablMask && lp.lnoiselow !=1.f && lp.smasktyp != 0) { //this code has been reviewed by Ingo in september 2020 PR5903 + float higc; float hig = lp.thrhigh; - if(lp.thrhigh < lp.thrlow) { - hig = lp.thrlow + 0.01f; + calcdif(hig, higc); + float low = lp.thrlow; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; } - float alow = -(lp.lnoiselow - 1.f) / lp.thrlow; + + float alow = -(lp.lnoiselow - 1.f) / lowc; float blow = lp.lnoiselow; - float ahigh = 0.9999f / (hig - 100.f); - float bhigh = 1.f - hig * ahigh; + float ahigh = 0.9999f / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif @@ -8949,12 +9013,12 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl const float lM = bufmaskblurbl->L[ir][jr]; const float lmr = lM / 327.68f; - if (lM < 327.68f * lp.thrlow) { - noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= alow * lmr + blow; //3.f;//increase denoise - } else if (lM < 327.68f * hig) { + if (lM < 327.68f * lowc) { + noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= alow * lmr + blow; + } else if (lM < 327.68f * higc) { // do nothing - denoise not change } else { - noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= ahigh * lmr + bhigh; //0.01f;//quasi suppress denoise + noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= ahigh * lmr + bhigh; } } } @@ -9348,8 +9412,81 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } - // DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); if(lp.smasktyp != 0) { + if(lp.enablMask && lp.recothrd != 1.f && lp.smasktyp != 0) { + LabImage tmp3(GW, GH); + + for (int ir = 0; ir < GH; ir++){ + for (int jr = 0; jr < GW; jr++) { + tmp3.L[ir][jr] = original->L[ir][jr]; + tmp3.a[ir][jr] = original->a[ir][jr]; + tmp3.b[ir][jr] = original->b[ir][jr]; + } + } + + array2D masklum; + masklum(GW, GH); + for (int ir = 0; ir < GH; ir++) + for (int jr = 0; jr < GW; jr++) { + masklum[ir][jr] = 1.f; + } + + float hig = lp.higthrd; + float higc; + calcdif(hig, higc); + float low = lp.lowthrd; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothrd - 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 < GH; ir++) + for (int jr = 0; jr < GW; jr++) { + const float lM = bufmaskblurbl->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(lp.invmaskd == true) { + masklum[ir][jr] = 1 - pow(k, lp.decayd); + } else { + masklum[ir][jr] = pow(k, lp.decayd); + } + + } + + for (int i = 0; i < 3; ++i) { + boxblur(masklum, masklum, 10 / sk, GW, GH, false); + } +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int i = 0; i < GH; ++i) { + for (int j = 0; j < GW; ++j) { + tmp1.L[i][j] = (tmp3.L[i][j] - tmp1.L[i][j]) * LIM01(masklum[i][j]) + tmp1.L[i][j]; + tmp1.a[i][j] = (tmp3.a[i][j] - tmp1.a[i][j]) * LIM01(masklum[i][j]) + tmp1.a[i][j]; + tmp1.b[i][j] = (tmp3.b[i][j] - tmp1.b[i][j]) * LIM01(masklum[i][j]) + tmp1.b[i][j]; + } + } + masklum.free(); + + } + DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); } else { DeNoise_Local(call, lp, original, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); @@ -9535,15 +9672,21 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if(lp.enablMask && lp.lnoiselow != 1.f && lp.smasktyp != 0) { //this code has been reviewed by Ingo in september 2020 PR5903 //i just change parameters to better progressivity + float higc; float hig = lp.thrhigh; - if(lp.thrhigh < lp.thrlow) { - hig = lp.thrlow + 0.01f; + calcdif(hig, higc); + float low = lp.thrlow; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; } - float alow = -(lp.lnoiselow - 1.f) / lp.thrlow; + float alow = -(lp.lnoiselow - 1.f) / lowc; float blow = lp.lnoiselow; - float ahigh = 0.9999f / (hig - 100.f); - float bhigh = 1.f - hig * ahigh; + float ahigh = 0.9999f / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; #ifdef _OPENMP @@ -9553,9 +9696,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl for (int jr = 0; jr < bfw; jr++) { const float lM = bufmaskblurbl->L[ir + ystart][jr + xstart]; const float lmr = lM / 327.68f; - if (lM < 327.68f * lp.thrlow) { + if (lM < 327.68f * lowc) { noisevarlum[(ir >> 1) * bfw2 + (jr >> 1)] *= alow * lmr + blow; - } else if (lM < 327.68f * hig) { + } else if (lM < 327.68f * higc) { // do nothing } else { noisevarlum[(ir >> 1) * bfw2 + (jr >> 1)] *= ahigh * lmr + bhigh; @@ -9948,6 +10091,91 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } if (lp.smasktyp != 0) { + if(lp.enablMask && lp.recothrd != 1.f && lp.smasktyp != 0) { + LabImage tmp3(bfw, bfh); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + for (int y = 0; y < transformed->H ; y++) { + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + tmp3.L[loy - begy][lox - begx] = original->L[y][x]; + tmp3.a[loy - begy][lox - begx] = original->a[y][x]; + tmp3.b[loy - begy][lox - begx] = original->b[y][x]; + } + + } + } + + 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.higthrd; + float higc; + calcdif(hig, higc); + float low = lp.lowthrd; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothrd - 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 y = ystart; y < yend; y++) { + for (int x = xstart, lox = cx + x; x < xend; x++, lox++) { + + const float lM = bufmaskblurbl->L[y][x]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lowc) { + masklum[y-ystart][x-xstart] = alow * lmr + blow; + } else if (lM < 327.68f * higc) { + + } else { + masklum[y-ystart][x-xstart] = ahigh * lmr + bhigh; + } + float k = masklum[y-ystart][x-xstart]; + if(lp.invmaskd == true) { + masklum[y-ystart][x-xstart] = 1 - pow(k, lp.decayd); + } else { + masklum[y-ystart][x-xstart] = pow(k, lp.decayd); + } + } + } + for (int i = 0; i < 3; ++i) { + boxblur(masklum, masklum, 10 / sk, bfw, bfh, false); + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int y = 0; y < bfh; y++) { + for (int x = 0; x < bfw; x++) { + bufwv.L[y][x] = (tmp3.L[y][x] - bufwv.L[y][x]) * LIM01(masklum[y][x]) + bufwv.L[y][x]; + bufwv.a[y][x] = (tmp3.a[y][x] - bufwv.a[y][x]) * LIM01(masklum[y][x]) + bufwv.a[y][x]; + bufwv.b[y][x] = (tmp3.b[y][x] - bufwv.b[y][x]) * LIM01(masklum[y][x]) + bufwv.b[y][x]; + } + } + + masklum.free(); + } + DeNoise_Local2(lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, bufwv, cx, cy, sk); } else { DeNoise_Local2(lp, original, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, bufwv, cx, cy, sk); @@ -10705,6 +10933,8 @@ void ImProcFunctions::Lab_Local( // if (((radius > 1.5 * GAUSS_SKIP && lp.rad > 1.6) || lp.stren > 0.1 || lp.blmet == 1 || lp.guidb > 0 || lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) && lp.blurena) { // radius < GAUSS_SKIP means no gauss, just copy of original image std::unique_ptr tmp1; std::unique_ptr tmp2; + std::unique_ptr tmp3; + std::unique_ptr maskk; int ystart = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); int yend = rtengine::min(static_cast(lp.yc + lp.ly) - cy, original->H); int xstart = rtengine::max(static_cast(lp.xc - lp.lxL) - cx, 0); @@ -10734,6 +10964,8 @@ void ImProcFunctions::Lab_Local( if (lp.blurmet == 0) { if (bfw > 0 && bfh > 0) { tmp1.reset(new LabImage(bfw, bfh)); + tmp3.reset(new LabImage(bfw, bfh)); + maskk.reset(new LabImage(bfw, bfh)); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -10748,12 +10980,16 @@ void ImProcFunctions::Lab_Local( } else if (lp.blurmet == 1) { tmp1.reset(new LabImage(transformed->W, transformed->H)); tmp2.reset(new LabImage(transformed->W, transformed->H)); + tmp3.reset(new LabImage(transformed->W, transformed->H)); for (int y = 0; y < GH ; y++) { for (int x = 0; x < GW; x++) { tmp2->L[y][x] = original->L[y][x]; tmp2->a[y][x] = original->a[y][x]; tmp2->b[y][x] = original->b[y][x]; + tmp3->L[y][x] = original->L[y][x]; + tmp3->a[y][x] = original->a[y][x]; + tmp3->b[y][x] = original->b[y][x]; tmp1->L[y][x] = original->L[y][x]; tmp1->a[y][x] = original->a[y][x]; tmp1->b[y][x] = original->b[y][x]; @@ -10968,6 +11204,9 @@ void ImProcFunctions::Lab_Local( tmp1->L[y - ystart][x - xstart] = original->L[y][x]; tmp1->a[y - ystart][x - xstart] = original->a[y][x]; tmp1->b[y - ystart][x - xstart] = original->b[y][x]; + tmp3->L[y - ystart][x - xstart] = original->L[y][x]; + tmp3->a[y - ystart][x - xstart] = original->a[y][x]; + tmp3->b[y - ystart][x - xstart] = original->b[y][x]; bufgb->L[y - ystart][x - xstart] = original->L[y][x]; } } @@ -11044,6 +11283,67 @@ void ImProcFunctions::Lab_Local( } } } + if(lp.enablMask && lp.recothr != 1.f && lp.smasktyp != 1) { + 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.higthr; + float higc; + calcdif(hig, higc); + float low = lp.lowthr; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothr - 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 = bufmaskblurbl->L[ir + ystart][jr + xstart]; + 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; + } + if(lp.invmask == true) { + float k = masklum[ir][jr]; + masklum[ir][jr] = 1 - k*k; + } + } + + for (int i = 0; i < 3; ++i) { + boxblur(masklum, 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) { + tmp1->L[i][j] = (tmp3->L[i][j] - tmp1->L[i][j]) * LIM01(masklum[i][j]) + tmp1->L[i][j]; + tmp1->a[i][j] = (tmp3->a[i][j] - tmp1->a[i][j]) * LIM01(masklum[i][j]) + tmp1->a[i][j]; + tmp1->b[i][j] = (tmp3->b[i][j] - tmp1->b[i][j]) * LIM01(masklum[i][j]) + tmp1->b[i][j]; + } + } + masklum.free(); + } delete tmpImage; } @@ -11060,6 +11360,9 @@ void ImProcFunctions::Lab_Local( tmp1->a[y][x] = original->a[y][x]; tmp1->b[y][x] = original->b[y][x]; tmp2->L[y][x] = original->L[y][x]; + tmp3->L[y][x] = original->L[y][x]; + tmp3->a[y][x] = original->a[y][x]; + tmp3->b[y][x] = original->b[y][x]; } } @@ -11135,6 +11438,66 @@ void ImProcFunctions::Lab_Local( } } } + if(lp.enablMask && lp.recothr != 1.f && lp.smasktyp != 1) { + array2D masklum; + masklum(GW, GH); + for (int ir = 0; ir < GH; ir++) + for (int jr = 0; jr < GW; jr++) { + masklum[ir][jr] = 1.f; + } + + float hig = lp.higthr; + float higc; + calcdif(hig, higc); + float low = lp.lowthr; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothr - 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 < GH; ir++) + for (int jr = 0; jr < GW; jr++) { + const float lM = bufmaskblurbl->L[ir][jr]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lowc) { + masklum[ir][jr] = alow * lmr + blow; + masklum[ir][jr] = alow * lmr + blow; + } else if (lM < 327.68f * higc) { + + } else { + masklum[ir][jr] = (ahigh * lmr + bhigh); + } + } + + for (int i = 0; i < 3; ++i) { + boxblur(masklum, masklum, 10 / sk, GW, GH, false); + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int i = 0; i < GH; ++i) { + for (int j = 0; j < GW; ++j) { + tmp1->L[i][j] = (tmp3->L[i][j] - tmp1->L[i][j]) * LIM01(masklum[i][j]) + tmp1->L[i][j]; + tmp1->a[i][j] = (tmp3->a[i][j] - tmp1->a[i][j]) * LIM01(masklum[i][j]) + tmp1->a[i][j]; + tmp1->b[i][j] = (tmp3->b[i][j] - tmp1->b[i][j]) * LIM01(masklum[i][j]) + tmp1->b[i][j]; + } + } + masklum.free(); + + } + delete tmpImage; } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index aae82f3b9..8ae9e1e4e 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1007,8 +1007,17 @@ enum ProcEventCode { EvlocallabwavCurvehue = 981, Evlocallablevelthr = 982, Evlocallablevelthrlow = 983, - Evlocallabusemask1 = 984, + Evlocallabusemask1 = 984, Evlocallablnoiselow = 985, + Evlocallabrecothres = 986, + Evlocallablowthres = 987, + Evlocallabhigthres = 988, + Evlocallabrecothresd = 989, + Evlocallablowthresd = 990, + Evlocallabhigthresd = 991, + Evlocallabinvmaskd = 992, + Evlocallabinvmask = 993, + Evlocallabdecayd = 994, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 64374f4c3..9037484ef 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3298,6 +3298,13 @@ LocallabParams::LocallabSpot::LocallabSpot() : itera(1), guidbl(0), strbl(50), + recothres(1.), + lowthres(12.), + higthres(85.), + recothresd(1.), + lowthresd(12.), + higthresd(85.), + decayd(2.), isogr(400), strengr(0), scalegr(100), @@ -3308,7 +3315,9 @@ LocallabParams::LocallabSpot::LocallabSpot() : blurMethod("norm"), medMethod("33"), usemask(false), - levelthr(40.), + invmaskd(false), + invmask(false), + levelthr(85.), lnoiselow(1.), levelthrlow(12.), activlum(true), @@ -3331,7 +3340,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : 0.0, 0.0, 0.35, - 0.5, + 0.66, 0., 0.35, 0.35, @@ -4342,6 +4351,13 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && itera == other.itera && guidbl == other.guidbl && strbl == other.strbl + && recothres == other.recothres + && lowthres == other.lowthres + && higthres == other.higthres + && recothresd == other.recothresd + && lowthresd == other.lowthresd + && higthresd == other.higthresd + && decayd == other.decayd && isogr == other.isogr && strengr == other.strengr && scalegr == other.scalegr @@ -4351,6 +4367,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && quamethod == other.quamethod && blurMethod == other.blurMethod && usemask == other.usemask + && invmaskd == other.invmaskd + && invmask == other.invmask && levelthr == other.levelthr && lnoiselow == other.lnoiselow && levelthrlow == other.levelthrlow @@ -5928,6 +5946,13 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->itera, "Locallab", "Iteramed_" + index_str, spot.itera, keyFile); saveToKeyfile(!pedited || spot_edited->guidbl, "Locallab", "Guidbl_" + index_str, spot.guidbl, keyFile); saveToKeyfile(!pedited || spot_edited->strbl, "Locallab", "Strbl_" + index_str, spot.strbl, keyFile); + saveToKeyfile(!pedited || spot_edited->recothres, "Locallab", "Recothres_" + index_str, spot.recothres, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthres, "Locallab", "Lowthres_" + index_str, spot.lowthres, keyFile); + saveToKeyfile(!pedited || spot_edited->higthres, "Locallab", "Higthres_" + index_str, spot.higthres, keyFile); + saveToKeyfile(!pedited || spot_edited->recothresd, "Locallab", "Recothresd_" + index_str, spot.recothresd, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthresd, "Locallab", "Lowthresd_" + index_str, spot.lowthresd, keyFile); + saveToKeyfile(!pedited || spot_edited->higthresd, "Locallab", "Higthresd_" + index_str, spot.higthresd, keyFile); + saveToKeyfile(!pedited || spot_edited->decayd, "Locallab", "Decayd_" + index_str, spot.decayd, keyFile); saveToKeyfile(!pedited || spot_edited->isogr, "Locallab", "Isogr_" + index_str, spot.isogr, keyFile); saveToKeyfile(!pedited || spot_edited->strengr, "Locallab", "Strengr_" + index_str, spot.strengr, keyFile); saveToKeyfile(!pedited || spot_edited->scalegr, "Locallab", "Scalegr_" + index_str, spot.scalegr, keyFile); @@ -5937,6 +5962,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->quamethod, "Locallab", "QuaMethod_" + index_str, spot.quamethod, keyFile); saveToKeyfile(!pedited || spot_edited->blurMethod, "Locallab", "BlurMethod_" + index_str, spot.blurMethod, keyFile); saveToKeyfile(!pedited || spot_edited->usemask, "Locallab", "Usemaskb_" + index_str, spot.usemask, keyFile); + saveToKeyfile(!pedited || spot_edited->invmaskd, "Locallab", "Invmaskd_" + index_str, spot.invmaskd, keyFile); + saveToKeyfile(!pedited || spot_edited->invmask, "Locallab", "Invmask_" + index_str, spot.invmask, keyFile); saveToKeyfile(!pedited || spot_edited->levelthr, "Locallab", "Levelthr_" + index_str, spot.levelthr, keyFile); saveToKeyfile(!pedited || spot_edited->lnoiselow, "Locallab", "Lnoiselow_" + index_str, spot.lnoiselow, keyFile); saveToKeyfile(!pedited || spot_edited->levelthrlow, "Locallab", "Levelthrlow_" + index_str, spot.levelthrlow, keyFile); @@ -7730,6 +7757,13 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Iteramed_" + index_str, pedited, spot.itera, spotEdited.itera); assignFromKeyfile(keyFile, "Locallab", "Guidbl_" + index_str, pedited, spot.guidbl, spotEdited.guidbl); assignFromKeyfile(keyFile, "Locallab", "Strbl_" + index_str, pedited, spot.strbl, spotEdited.strbl); + assignFromKeyfile(keyFile, "Locallab", "Recothres_" + index_str, pedited, spot.recothres, spotEdited.recothres); + assignFromKeyfile(keyFile, "Locallab", "Lowthres_" + index_str, pedited, spot.lowthres, spotEdited.lowthres); + assignFromKeyfile(keyFile, "Locallab", "Higthres_" + index_str, pedited, spot.higthres, spotEdited.higthres); + assignFromKeyfile(keyFile, "Locallab", "Recothresd_" + index_str, pedited, spot.recothresd, spotEdited.recothresd); + assignFromKeyfile(keyFile, "Locallab", "Lowthresd_" + index_str, pedited, spot.lowthresd, spotEdited.lowthresd); + assignFromKeyfile(keyFile, "Locallab", "Higthresd_" + index_str, pedited, spot.higthresd, spotEdited.higthresd); + assignFromKeyfile(keyFile, "Locallab", "Decayd_" + index_str, pedited, spot.decayd, spotEdited.decayd); assignFromKeyfile(keyFile, "Locallab", "Isogr_" + index_str, pedited, spot.isogr, spotEdited.isogr); assignFromKeyfile(keyFile, "Locallab", "Strengr_" + index_str, pedited, spot.strengr, spotEdited.strengr); assignFromKeyfile(keyFile, "Locallab", "Scalegr_" + index_str, pedited, spot.scalegr, spotEdited.scalegr); @@ -7739,6 +7773,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "QuaMethod_" + index_str, pedited, spot.quamethod, spotEdited.quamethod); assignFromKeyfile(keyFile, "Locallab", "BlurMethod_" + index_str, pedited, spot.blurMethod, spotEdited.blurMethod); assignFromKeyfile(keyFile, "Locallab", "Usemaskb_" + index_str, pedited, spot.usemask, spotEdited.usemask); + assignFromKeyfile(keyFile, "Locallab", "Invmaskd_" + index_str, pedited, spot.invmaskd, spotEdited.invmaskd); + assignFromKeyfile(keyFile, "Locallab", "Invmask_" + index_str, pedited, spot.invmask, spotEdited.invmask); assignFromKeyfile(keyFile, "Locallab", "Levelthr_" + index_str, pedited, spot.levelthr, spotEdited.levelthr); assignFromKeyfile(keyFile, "Locallab", "Lnoiselow_" + index_str, pedited, spot.lnoiselow, spotEdited.lnoiselow); assignFromKeyfile(keyFile, "Locallab", "Levelthrlow_" + index_str, pedited, spot.levelthrlow, spotEdited.levelthrlow); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index b5e241f51..7a7f7f8d5 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1205,6 +1205,13 @@ struct LocallabParams { int itera; int guidbl; int strbl; + double recothres; + double lowthres; + double higthres; + double recothresd; + double lowthresd; + double higthresd; + double decayd; int isogr; int strengr; int scalegr; @@ -1215,6 +1222,8 @@ struct LocallabParams { Glib::ustring blurMethod; // norm, inv Glib::ustring medMethod; // none, 33, 55, 77, 99 bool usemask; + bool invmaskd; + bool invmask; double levelthr; double lnoiselow; double levelthrlow; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 129afdca9..d6079456f 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1012,7 +1012,17 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallablevelthr LUMINANCECURVE, // Evlocallablevelthrlow LUMINANCECURVE, //Evlocallabusemask1 - LUMINANCECURVE // Evlocallablnoiselow + LUMINANCECURVE, // Evlocallablnoiselow + LUMINANCECURVE, // Evlocallabrecothres + LUMINANCECURVE, // Evlocallablowthres + LUMINANCECURVE, // Evlocallabhigthres + LUMINANCECURVE, // Evlocallabrecothresd + LUMINANCECURVE, // Evlocallablowthresd + LUMINANCECURVE, // Evlocallabhigthresd + LUMINANCECURVE, // Evlocallabinvmaskd + LUMINANCECURVE, // Evlocallabinvmask + LUMINANCECURVE // Evlocallabdecayd + }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 97fa9111d..217096cac 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5751,6 +5751,10 @@ LocallabBlur::LocallabBlur(): guidbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GUIDBL"), 0, 1000, 1, 0))), strbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRBL"), 0, 100, 1, 50))), epsbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EPSBL"), -10, 10, 1, 0))), + expdenoise2(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + recothres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), sensibn(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 40))), blurMethod(Gtk::manage(new MyComboBoxText())), invbl(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVBL")))), @@ -5763,10 +5767,14 @@ LocallabBlur::LocallabBlur(): expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), maskusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), maskunusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + maskusable2(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusable2(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + maskusable3(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusable3(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), lnoiselow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLNOISELOW"), 0.7, 2., 0.01, 1.))), - levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 10., 100., 1., 40.))), - levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 100., 1., 12.))), + levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), noiselumf0(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINEZERO"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf2(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINETWO"), MINCHRO, MAXCHRO, 0.01, 0.))), @@ -5781,6 +5789,13 @@ LocallabBlur::LocallabBlur(): detailFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_DETAILFRA")))), detailthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAILTHR"), 0, 100, 1, 50))), adjblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ADJ"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-yellow-small.png")), Gtk::manage(new RTImage("circle-red-green-small.png"))))), + expdenoise3(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + recothresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decayd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), + invmaskd(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), + invmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), bilateral(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BILATERAL"), 0, 100, 1, 0))), sensiden(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), neutral(Gtk::manage (new Gtk::Button (M ("TP_RETINEX_NEUTRAL")))), @@ -5832,6 +5847,8 @@ LocallabBlur::LocallabBlur(): fftwblConn = fftwbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::fftwblChanged)); usemaskConn = usemask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::usemaskChanged)); invblConn = invbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::invblChanged)); + invmaskdConn = invmaskd->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::invmaskdChanged)); + invmaskConn = invmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::invmaskChanged)); radius->setAdjusterListener(this); @@ -5861,6 +5878,10 @@ LocallabBlur::LocallabBlur(): strbl->setAdjusterListener(this); epsbl->setAdjusterListener(this); + setExpandAlignProperties(expdenoise2, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + recothres->setAdjusterListener(this); + lowthres->setAdjusterListener(this); + higthres->setAdjusterListener(this); sensibn->setAdjusterListener(this); @@ -5936,6 +5957,11 @@ LocallabBlur::LocallabBlur(): detailthr->setAdjusterListener(this); adjblur->setAdjusterListener(this); + setExpandAlignProperties(expdenoise3, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + recothresd->setAdjusterListener(this); + lowthresd->setAdjusterListener(this); + higthresd->setAdjusterListener(this); + decayd->setAdjusterListener(this); bilateral->setAdjusterListener(this); @@ -6039,6 +6065,15 @@ LocallabBlur::LocallabBlur(): blnoisebox->pack_start(*guidbl); blnoisebox->pack_start(*strbl); blnoisebox->pack_start(*epsbl); + ToolParamBlock* const wavBox2 = Gtk::manage(new ToolParamBlock()); + wavBox2->pack_start(*maskusable2, Gtk::PACK_SHRINK, 0); + wavBox2->pack_start(*maskunusable2, Gtk::PACK_SHRINK, 0); + wavBox2->pack_start(*recothres); + wavBox2->pack_start(*lowthres); + wavBox2->pack_start(*higthres); + wavBox2->pack_start(*invmask); + expdenoise2->add(*wavBox2, false); + blnoisebox->pack_start(*expdenoise2); blnoisebox->pack_start(*sensibn); // blnoisebox->pack_start(*blurMethod); blnoisebox->pack_start(*invbl); @@ -6077,6 +6112,16 @@ LocallabBlur::LocallabBlur(): wavBox->pack_start(*detailFrame); wavFrame->add(*wavBox); denoisebox->pack_start(*wavFrame); + ToolParamBlock* const wavBox3 = Gtk::manage(new ToolParamBlock()); + wavBox3->pack_start(*maskusable3, Gtk::PACK_SHRINK, 0); + wavBox3->pack_start(*maskunusable3, Gtk::PACK_SHRINK, 0); + wavBox3->pack_start(*recothresd); + wavBox3->pack_start(*lowthresd); + wavBox3->pack_start(*higthresd); + wavBox3->pack_start(*decayd); + wavBox3->pack_start(*invmaskd); + expdenoise3->add(*wavBox3, false); + denoisebox->pack_start(*expdenoise3); denoisebox->pack_start(*bilateral); denoisebox->pack_start(*sensiden); denoisebox->pack_start(*neutral); @@ -6158,6 +6203,10 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) wavshapeden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); wavhue->setTooltip(M("TP_LOCALLAB_WAVHUE_TOOLTIP")); expdenoise1->set_tooltip_markup(M("TP_LOCALLAB_MASKLC_TOOLTIP")); + expdenoise2->set_tooltip_markup(M("TP_LOCALLAB_MASKGF_TOOLTIP")); + expdenoise3->set_tooltip_markup(M("TP_LOCALLAB_MASKDE_TOOLTIP")); + invmask->set_tooltip_text(M("TP_LOCALLAB_MASKDEINV_TOOLTIP")); + invmaskd->set_tooltip_text(M("TP_LOCALLAB_MASKDEINV_TOOLTIP")); LocalcurveEditorwavden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); noiselequal->set_tooltip_text(M("TP_LOCALLAB_DENOIEQUAL_TOOLTIP")); noiselumdetail->set_tooltip_text(M("TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP")); @@ -6190,6 +6239,11 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) lapmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD1_TOOLTIP")); csThresholdblur->set_tooltip_text(M("TP_LOCALLAB_WAVEMASK_LEVEL_TOOLTIP")); sensiden->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); + lowthres->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRES_TOOLTIP")); + lowthresd->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP")); + higthresd->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP")); + higthres->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRES_TOOLTIP")); + decayd->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); } else { expblnoise->set_tooltip_markup(""); @@ -6207,6 +6261,10 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) quamethod->set_tooltip_markup(""); wavhue->setTooltip(""); expdenoise1->set_tooltip_markup(""); + expdenoise2->set_tooltip_markup(""); + expdenoise3->set_tooltip_markup(""); + invmask->set_tooltip_text(""); + invmaskd->set_tooltip_text(""); LocalcurveEditorwavden->setTooltip(""); noiselequal->set_tooltip_text(""); noiselumdetail->set_tooltip_text(""); @@ -6242,6 +6300,11 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) shadmaskblsha->set_tooltip_text(""); csThresholdblur->set_tooltip_text(""); sensiden->set_tooltip_text(""); + lowthres->set_tooltip_text(""); + lowthresd->set_tooltip_text(""); + higthresd->set_tooltip_text(""); + higthres->set_tooltip_text(""); + decayd->set_tooltip_text(""); } } @@ -6266,6 +6329,17 @@ void LocallabBlur::neutral_pressed () wavshapeden->setCurve(defSpot.locwavcurveden); wavhue->setCurve(defSpot.locwavcurvehue); usemask->set_active(defSpot.usemask); + invmaskd->set_active(defSpot.invmaskd); + invmask->set_active(defSpot.invmask); + recothresd->setValue(defSpot.recothresd); + lowthresd->setValue(defSpot.lowthresd); + higthresd->setValue(defSpot.higthresd); + decayd->setValue(defSpot.decayd); + recothres->setValue(defSpot.recothres); + lowthres->setValue(defSpot.lowthres); + higthres->setValue(defSpot.higthres); + + } void LocallabBlur::setDefaultExpanderVisibility() @@ -6273,6 +6347,8 @@ void LocallabBlur::setDefaultExpanderVisibility() expblnoise->set_expanded(false); expdenoise->set_expanded(false); expdenoise1->set_expanded(false); + expdenoise2->set_expanded(false); + expdenoise3->set_expanded(false); expmaskbl->set_expanded(false); } @@ -6283,6 +6359,8 @@ void LocallabBlur::disableListener() blMethodConn.block(true); fftwblConn.block(true); usemaskConn.block(true); + invmaskdConn.block(true); + invmaskConn.block(true); invblConn.block(true); medMethodConn.block(true); blurMethodConn.block(true); @@ -6302,6 +6380,8 @@ void LocallabBlur::enableListener() blMethodConn.block(false); fftwblConn.block(false); usemaskConn.block(false); + invmaskdConn.block(false); + invmaskConn.block(false); invblConn.block(false); medMethodConn.block(false); blurMethodConn.block(false); @@ -6341,6 +6421,8 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params fftwbl->set_active(spot.fftwbl); usemask->set_active(spot.usemask); + invmaskd->set_active(spot.invmaskd); + invmask->set_active(spot.invmask); invbl->set_active(spot.invbl); radius->setValue(spot.radius); strength->setValue(spot.strength); @@ -6363,8 +6445,15 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params itera->setValue((double)spot.itera); guidbl->setValue((double)spot.guidbl); strbl->setValue((double)spot.strbl); + recothres->setValue((double)spot.recothres); + lowthres->setValue((double)spot.lowthres); + higthres->setValue((double)spot.higthres); epsbl->setValue((double)spot.epsbl); sensibn->setValue((double)spot.sensibn); + recothresd->setValue((double)spot.recothresd); + lowthresd->setValue((double)spot.lowthresd); + higthresd->setValue((double)spot.higthresd); + decayd->setValue((double)spot.decayd); if (spot.blurMethod == "norm") { blurMethod->set_active(0); @@ -6466,6 +6555,8 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.fftwbl = fftwbl->get_active(); spot.usemask = usemask->get_active(); + spot.invmaskd = invmaskd->get_active(); + spot.invmask = invmask->get_active(); spot.invbl = invbl->get_active(); spot.radius = radius->getValue(); spot.strength = strength->getIntValue(); @@ -6488,8 +6579,15 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.itera = itera->getIntValue(); spot.guidbl = guidbl->getIntValue(); spot.strbl = strbl->getIntValue(); + spot.recothres = recothres->getValue(); + spot.lowthres = lowthres->getValue(); + spot.higthres = higthres->getValue(); spot.epsbl = epsbl->getIntValue(); spot.sensibn = sensibn->getIntValue(); + spot.recothresd = recothresd->getValue(); + spot.lowthresd = lowthresd->getValue(); + spot.higthresd = higthresd->getValue(); + spot.decayd = decayd->getValue(); if (blurMethod->get_active_row_number() == 0) { spot.blurMethod = "norm"; @@ -6578,8 +6676,15 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams itera->setDefault((double)defSpot.itera); guidbl->setDefault((double)defSpot.guidbl); strbl->setDefault((double)defSpot.strbl); + recothres->setDefault((double)defSpot.recothres); + lowthres->setDefault((double)defSpot.lowthres); + higthres->setDefault((double)defSpot.higthres); epsbl->setDefault((double)defSpot.epsbl); sensibn->setDefault((double)defSpot.sensibn); + recothresd->setDefault((double)defSpot.recothresd); + lowthresd->setDefault((double)defSpot.lowthresd); + higthresd->setDefault((double)defSpot.higthresd); + decayd->setDefault((double)defSpot.decayd); noiselumf0->setDefault(defSpot.noiselumf0); noiselumf->setDefault(defSpot.noiselumf); noiselumf2->setDefault(defSpot.noiselumf2); @@ -6670,6 +6775,67 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothres) { + if(recothres->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 1) { + showmaskblMethodtyp->set_active(2); + } + } + + if (listener) { + listener->panelChanged(Evlocallabrecothres, + recothres->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthres) { + if (listener) { + listener->panelChanged(Evlocallablowthres, + lowthres->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthres) { + if (listener) { + listener->panelChanged(Evlocallabhigthres, + higthres->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == recothresd) { + if(recothresd->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } + + if (listener) { + listener->panelChanged(Evlocallabrecothresd, + recothresd->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthresd) { + if (listener) { + listener->panelChanged(Evlocallablowthresd, + lowthresd->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthresd) { + if (listener) { + listener->panelChanged(Evlocallabhigthresd, + higthresd->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decayd) { + if (listener) { + listener->panelChanged(Evlocallabdecayd, + decayd->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == epsbl) { if (listener) { listener->panelChanged(Evlocallabepsbl, @@ -6954,11 +7120,13 @@ void LocallabBlur::convertParamToNormal() // Disable all listeners disableListener(); - + invmask->set_active(defSpot.invmask); + invmaskd->set_active(defSpot.invmaskd); // Set hidden GUI widgets in Normal mode to default spot values fftwbl->set_active(defSpot.fftwbl); strumaskbl->setValue(defSpot.strumaskbl); toolbl->set_active(defSpot.toolbl); + decayd->setValue(defSpot.decayd); lapmaskbl->setValue(defSpot.lapmaskbl); shadmaskbl->setValue((double)defSpot.shadmaskbl); shadmaskblsha->setValue((double)defSpot.shadmaskblsha); @@ -6975,6 +7143,8 @@ void LocallabBlur::convertParamToSimple() // Disable all listeners disableListener(); + invmask->set_active(defSpot.invmask); + invmaskd->set_active(defSpot.invmaskd); // Set hidden specific GUI widgets in Simple mode to default spot values showmaskblMethod->set_active(0); @@ -7001,6 +7171,15 @@ void LocallabBlur::convertParamToSimple() lnoiselow->setValue(defSpot.lnoiselow); levelthrlow->setValue(defSpot.levelthrlow); usemask->set_active(defSpot.usemask); + invmaskd->set_active(defSpot.invmaskd); + invmask->set_active(defSpot.invmask); + recothresd->setValue(defSpot.recothresd); + lowthresd->setValue(defSpot.lowthresd); + higthresd->setValue(defSpot.higthresd); + decayd->setValue(defSpot.decayd); + recothres->setValue(defSpot.recothres); + lowthres->setValue(defSpot.lowthres); + higthres->setValue(defSpot.higthres); // Enable all listeners enableListener(); @@ -7014,9 +7193,17 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) fftwbl->hide(); expmaskbl->hide(); expdenoise1->hide(); + expdenoise2->hide(); + expdenoise3->hide(); maskusable->hide(); maskunusable->hide(); - + maskusable2->hide(); + maskunusable2->hide(); + maskusable3->hide(); + maskunusable3->hide(); + decayd->hide(); + invmask->hide(); + invmaskd->hide(); break; case Normal: @@ -7032,17 +7219,46 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) // Specific Simple mode widgets are shown in Normal mode expmaskbl->show(); expdenoise1->show(); + expdenoise2->hide(); + expdenoise3->show(); + if (blMethod->get_active_row_number() == 2) { + expdenoise2->show(); + } + + decayd->hide(); + invmask->hide(); + invmaskd->hide(); if(lnoiselow->getValue()!= 1.) { if (showmaskblMethodtyp->get_active_row_number() == 0) { showmaskblMethodtyp->set_active(2); } } + if(recothres->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 1) { + showmaskblMethodtyp->set_active(2); + } + } + if(recothresd->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } + if (enablMask->get_active()) { maskusable->show(); maskunusable->hide(); + maskusable2->show(); + maskunusable2->hide(); + maskusable3->show(); + maskunusable3->hide(); + } else { maskusable->hide(); maskunusable->show(); + maskusable2->hide(); + maskunusable2->show(); + maskusable3->hide(); + maskunusable3->show(); } break; @@ -7052,8 +7268,20 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) // Show widgets hidden in Normal and Simple mode if (blMethod->get_active_row_number() == 0) { // Keep widget hidden when blMethod is > 0 fftwbl->show(); + expdenoise2->hide(); } + if (blMethod->get_active_row_number() == 1) { + expdenoise2->hide(); + } + if (blMethod->get_active_row_number() == 2) { + expdenoise2->show(); + } + expdenoise1->show(); + expdenoise3->show(); + decayd->show(); + invmask->show(); + invmaskd->show(); expmaskbl->show(); strumaskbl->show(); @@ -7068,12 +7296,31 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) showmaskblMethodtyp->set_active(2); } } + if(recothres->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 1) { + showmaskblMethodtyp->set_active(2); + } + } + if(recothresd->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } + if (enablMask->get_active()) { maskusable->show(); maskunusable->hide(); + maskusable2->show(); + maskunusable2->hide(); + maskusable3->show(); + maskunusable3->hide(); } else { maskusable->hide(); maskunusable->show(); + maskusable2->hide(); + maskunusable2->show(); + maskusable3->show(); + maskunusable3->hide(); } } @@ -7152,6 +7399,37 @@ void LocallabBlur::usemaskChanged() } } +void LocallabBlur::invmaskdChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (invmaskd->get_active()) { + listener->panelChanged(Evlocallabinvmaskd, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } else { + listener->panelChanged(Evlocallabinvmaskd, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } +} + +void LocallabBlur::invmaskChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (invmask->get_active()) { + listener->panelChanged(Evlocallabinvmask, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } else { + listener->panelChanged(Evlocallabinvmask, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } +} + + void LocallabBlur::invblChanged() { const LocallabParams::LocallabSpot defSpot; @@ -7257,6 +7535,16 @@ void LocallabBlur::showmaskblMethodtypChanged() showmaskblMethodtyp->set_active(2); } } + if(recothres->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 1) { + showmaskblMethodtyp->set_active(2); + } + } + if(recothresd->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } // If mask preview is activated, deactivate all other tool mask preview if (locToolListener) { @@ -7274,9 +7562,17 @@ void LocallabBlur::enablMaskChanged() if (enablMask->get_active()) { maskusable->show(); maskunusable->hide(); + maskusable2->show(); + maskunusable2->hide(); + maskusable3->show(); + maskunusable3->hide(); } else { maskusable->hide(); maskunusable->show(); + maskusable2->hide(); + maskunusable2->show(); + maskusable3->hide(); + maskunusable3->show(); } if (isLocActivated && exp->getEnabled()) { @@ -7329,7 +7625,7 @@ void LocallabBlur::updateBlurGUI() if (mode == Expert) { // Keep widget hidden in Normal and Simple mode fftwbl->show(); } - + expdenoise2->hide(); radius->show(); strength->show(); grainFrame->show(); @@ -7337,6 +7633,9 @@ void LocallabBlur::updateBlurGUI() itera->hide(); guidbl->hide(); strbl->hide(); + recothres->hide(); + lowthres->hide(); + higthres->hide(); epsbl->hide(); activlum->show(); } else if (blMethod->get_active_row_number() == 1) { @@ -7348,6 +7647,10 @@ void LocallabBlur::updateBlurGUI() itera->show(); guidbl->hide(); strbl->hide(); + expdenoise2->hide(); + recothres->hide(); + lowthres->hide(); + higthres->hide(); epsbl->hide(); activlum->show(); } else if (blMethod->get_active_row_number() == 2) { @@ -7359,6 +7662,13 @@ void LocallabBlur::updateBlurGUI() itera->hide(); guidbl->show(); strbl->show(); + expdenoise2->hide(); + if (mode == Expert || mode == Normal){ + expdenoise2->show(); + recothres->show(); + lowthres->show(); + higthres->show(); + } epsbl->show(); activlum->hide(); } diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 7b3b6cb47..4410f823e 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -654,6 +654,10 @@ private: Adjuster* const guidbl; Adjuster* const strbl; Adjuster* const epsbl; + MyExpander* const expdenoise2; + Adjuster* const recothres; + Adjuster* const lowthres; + Adjuster* const higthres; Adjuster* const sensibn; MyComboBoxText* const blurMethod; Gtk::CheckButton* const invbl; @@ -666,6 +670,10 @@ private: MyExpander* const expdenoise1; Gtk::Label* const maskusable; Gtk::Label* const maskunusable; + Gtk::Label* const maskusable2; + Gtk::Label* const maskunusable2; + Gtk::Label* const maskusable3; + Gtk::Label* const maskunusable3; Gtk::CheckButton* const usemask; Adjuster* const lnoiselow; @@ -685,6 +693,15 @@ private: Gtk::Frame* const detailFrame; Adjuster* const detailthr; Adjuster* const adjblur; + MyExpander* const expdenoise3; + Adjuster* const recothresd; + Adjuster* const lowthresd; + Adjuster* const higthresd; + Adjuster* const decayd; + + Gtk::CheckButton* const invmaskd; + Gtk::CheckButton* const invmask; + Adjuster* const bilateral; Adjuster* const sensiden; Gtk::Button* neutral; @@ -715,7 +732,7 @@ private: ThresholdAdjuster* const csThresholdblur; sigc::connection blMethodConn, fftwblConn, invblConn, medMethodConn, blurMethodConn, chroMethodConn, activlumConn, showmaskblMethodConn, showmaskblMethodtypConn, enablMaskConn, toolblConn; - sigc::connection quamethodconn, usemaskConn, neutralconn; + sigc::connection quamethodconn, usemaskConn, invmaskdConn, invmaskConn, neutralconn; public: LocallabBlur(); ~LocallabBlur(); @@ -753,6 +770,8 @@ private: void blMethodChanged(); void fftwblChanged(); void usemaskChanged(); + void invmaskdChanged(); + void invmaskChanged(); void invblChanged(); void medMethodChanged(); void blurMethodChanged(); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 6cd2c93e5..350a7f87f 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1276,6 +1276,13 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).itera = locallab.spots.at(j).itera && pSpot.itera == otherSpot.itera; locallab.spots.at(j).guidbl = locallab.spots.at(j).guidbl && pSpot.guidbl == otherSpot.guidbl; locallab.spots.at(j).strbl = locallab.spots.at(j).strbl && pSpot.strbl == otherSpot.strbl; + locallab.spots.at(j).recothres = locallab.spots.at(j).recothres && pSpot.recothres == otherSpot.recothres; + locallab.spots.at(j).lowthres = locallab.spots.at(j).lowthres && pSpot.lowthres == otherSpot.lowthres; + locallab.spots.at(j).higthres = locallab.spots.at(j).higthres && pSpot.higthres == otherSpot.higthres; + locallab.spots.at(j).recothresd = locallab.spots.at(j).recothresd && pSpot.recothresd == otherSpot.recothresd; + locallab.spots.at(j).lowthresd = locallab.spots.at(j).lowthresd && pSpot.lowthresd == otherSpot.lowthresd; + locallab.spots.at(j).higthresd = locallab.spots.at(j).higthresd && pSpot.higthresd == otherSpot.higthresd; + locallab.spots.at(j).decayd = locallab.spots.at(j).decayd && pSpot.decayd == otherSpot.decayd; locallab.spots.at(j).isogr = locallab.spots.at(j).isogr && pSpot.isogr == otherSpot.isogr; locallab.spots.at(j).strengr = locallab.spots.at(j).strengr && pSpot.strengr == otherSpot.strengr; locallab.spots.at(j).scalegr = locallab.spots.at(j).scalegr && pSpot.scalegr == otherSpot.scalegr; @@ -1285,6 +1292,8 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).quamethod = locallab.spots.at(j).quamethod && pSpot.quamethod == otherSpot.quamethod; locallab.spots.at(j).blurMethod = locallab.spots.at(j).blurMethod && pSpot.blurMethod == otherSpot.blurMethod; locallab.spots.at(j).usemask = locallab.spots.at(j).usemask && pSpot.usemask == otherSpot.usemask; + locallab.spots.at(j).invmaskd = locallab.spots.at(j).invmaskd && pSpot.invmaskd == otherSpot.invmaskd; + locallab.spots.at(j).invmask = locallab.spots.at(j).invmask && pSpot.invmask == otherSpot.invmask; locallab.spots.at(j).levelthr = locallab.spots.at(j).levelthr && pSpot.levelthr == otherSpot.levelthr; locallab.spots.at(j).lnoiselow = locallab.spots.at(j).lnoiselow && pSpot.lnoiselow == otherSpot.lnoiselow; locallab.spots.at(j).levelthrlow = locallab.spots.at(j).levelthrlow && pSpot.levelthrlow == otherSpot.levelthrlow; @@ -4024,6 +4033,34 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).strbl = mods.locallab.spots.at(i).strbl; } + if (locallab.spots.at(i).recothres) { + toEdit.locallab.spots.at(i).recothres = mods.locallab.spots.at(i).recothres; + } + + if (locallab.spots.at(i).lowthres) { + toEdit.locallab.spots.at(i).lowthres = mods.locallab.spots.at(i).lowthres; + } + + if (locallab.spots.at(i).higthres) { + toEdit.locallab.spots.at(i).higthres = mods.locallab.spots.at(i).higthres; + } + + if (locallab.spots.at(i).recothresd) { + toEdit.locallab.spots.at(i).recothresd = mods.locallab.spots.at(i).recothresd; + } + + if (locallab.spots.at(i).lowthresd) { + toEdit.locallab.spots.at(i).lowthresd = mods.locallab.spots.at(i).lowthresd; + } + + if (locallab.spots.at(i).higthresd) { + toEdit.locallab.spots.at(i).higthresd = mods.locallab.spots.at(i).higthresd; + } + + if (locallab.spots.at(i).decayd) { + toEdit.locallab.spots.at(i).decayd = mods.locallab.spots.at(i).decayd; + } + if (locallab.spots.at(i).isogr) { toEdit.locallab.spots.at(i).isogr = mods.locallab.spots.at(i).isogr; } @@ -4060,6 +4097,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).usemask = mods.locallab.spots.at(i).usemask; } + if (locallab.spots.at(i).invmaskd) { + toEdit.locallab.spots.at(i).invmaskd = mods.locallab.spots.at(i).invmaskd; + } + + if (locallab.spots.at(i).invmask) { + toEdit.locallab.spots.at(i).invmask = mods.locallab.spots.at(i).invmask; + } + if (locallab.spots.at(i).levelthr) { toEdit.locallab.spots.at(i).levelthr = mods.locallab.spots.at(i).levelthr; } @@ -6580,6 +6625,13 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : itera(v), guidbl(v), strbl(v), + recothres(v), + lowthres(v), + higthres(v), + recothresd(v), + lowthresd(v), + higthresd(v), + decayd(v), isogr(v), strengr(v), scalegr(v), @@ -6588,6 +6640,8 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : chroMethod(v), quamethod(v), usemask(v), + invmaskd(v), + invmask(v), levelthr(v), lnoiselow(v), levelthrlow(v), @@ -7099,6 +7153,13 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) itera = v; guidbl = v; strbl = v; + recothres = v; + lowthres = v; + higthres = v; + recothresd = v; + lowthresd = v; + higthresd = v; + decayd = v; isogr = v; strengr = v; scalegr = v; @@ -7107,6 +7168,8 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) chroMethod = v; quamethod = v; usemask = v; + invmaskd = v; + invmask = v; levelthr = v; lnoiselow = v; levelthrlow = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 41406e3ea..eccbc7a43 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -613,6 +613,13 @@ public: bool itera; bool guidbl; bool strbl; + bool recothres; + bool lowthres; + bool higthres; + bool recothresd; + bool lowthresd; + bool higthresd; + bool decayd; bool isogr; bool strengr; bool scalegr; @@ -621,6 +628,8 @@ public: bool chroMethod; bool quamethod; bool usemask; + bool invmaskd; + bool invmask; bool levelthr; bool lnoiselow; bool levelthrlow;