From 446ae7b49ce28b324de663958e910c46a92fd235 Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 13 Dec 2019 13:37:16 +0100 Subject: [PATCH] First commit Wavelet Pyramid - Clarity and Blur Residual --- rtdata/languages/default | 8 +- rtengine/CMakeLists.txt | 1 + rtengine/improcfun.h | 2 +- rtengine/iplocallab.cc | 224 ++++++++++++++++++++++++++++----------- rtengine/procevents.h | 2 + rtengine/procparams.cc | 8 ++ rtengine/procparams.h | 2 + rtengine/refreshmap.cc | 4 +- rtgui/locallab.cc | 113 +++++++++++++++++--- rtgui/locallab.h | 7 ++ rtgui/paramsedited.cc | 14 +++ rtgui/paramsedited.h | 2 + 12 files changed, 308 insertions(+), 79 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index c77da3fbf..2ed021e39 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1093,6 +1093,8 @@ HISTORY_MSG_853;Local - Detail HISTORY_MSG_854;Local - Scope encoding log HISTORY_MSG_855;Local - Entire image HISTORY_MSG_856;Local - Base log +HISTORY_MSG_857;Local - Contrast Blur Residual +HISTORY_MSG_858;Local - Contrast Luminance only HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2186,6 +2188,8 @@ TP_LOCALLAB_BLUR;Gaussian Blur - Noise - Grain TP_LOCALLAB_BLURCBDL;Blur levels 0-1-2-3-4 TP_LOCALLAB_BLURCOL;Radius Mask Blur TP_LOCALLAB_BLURDE;Blur Shape detection +TP_LOCALLAB_BLURLC;Luminance only +TP_LOCALLAB_BLURRESIDFRA;Blur Residual TP_LOCALLAB_BUTTON_ADD;Add TP_LOCALLAB_BUTTON_DEL;Delete TP_LOCALLAB_BUTTON_DUPL;Duplicate @@ -2339,7 +2343,8 @@ TP_LOCALLAB_LINEAR;Linearity TP_LOCALLAB_LMASK_LEVEL_TOOLTIP;Give priority to action on midtones and high lights and by choosing the concerned wavelet levels TP_LOCALLAB_LMASK_LL_TOOLTIP;Give priority to action on midtones and high lights TP_LOCALLAB_LOCCONT;Unsharp Mask -TP_LOCALLAB_LOC_CONTRAST;Local contrast +TP_LOCALLAB_LOC_CONTRAST;Local contrast & Wavelet Pyramid +TP_LOCALLAB_LOC_CONTRASTPYR;Wavelet Pyramid TP_LOCALLAB_LOG;Encoding log TP_LOCALLAB_LOGAUTO;Automatic TP_LOCALLAB_LOGFRA;Source Gray Point @@ -2437,6 +2442,7 @@ TP_LOCALLAB_REFLABEL;Ref. (0..1) Chroma=%1 Luma=%2 Hue=%3 TP_LOCALLAB_REN_DIALOG_LAB;Enter the new Control Spot name TP_LOCALLAB_REN_DIALOG_NAME;Renaming Control Spot TP_LOCALLAB_RESID;Residual Image +TP_LOCALLAB_RESIDBLUR;Blur TP_LOCALLAB_RESIDCHRO;Residual image Chroma TP_LOCALLAB_RESIDCONT;Residual image Contrast TP_LOCALLAB_RETI;Dehaze - Retinex Strong local contrast diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 43efafeeb..92ed0c635 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -117,6 +117,7 @@ set(RTENGINESOURCEFILES processingjob.cc procparams.cc profilestore.cc + pyramid_1.cc rawflatfield.cc rawimage.cc rawimagesource.cc diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 21f0f2114..a4d0f6c7d 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -311,7 +311,7 @@ public: static void strcurv_data(std::string retistr, int *s_datc, int &siz); void blendstruc(int bfw, int bfh, LabImage* bufcolorig, float radius, float stru, array2D & blend2, int sk, bool multiThread); - void wavcontrast4(float ** tmp, float contrast, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, bool numThreads, const LocwavCurve & locwavCurve, bool & locwavutili, int & maxlvl); + void wavcontrast4(float ** tmp, float contrast, float radblur, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, bool numThreads, const LocwavCurve & locwavCurve, bool & locwavutili, int & maxlvl); void transit_shapedetect2(int call, int senstype, const LabImage * bufexporig, const LabImage * bufexpfin, LabImage * originalmask, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); void transit_shapedetect_retinex(int call, int senstype, LabImage * bufexporig, LabImage * bufmask, LabImage * buforigmas, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 2a85da397..c086e8410 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -118,7 +118,7 @@ void calcGammaLut(double gamma, double ts, LUTf &gammaLut) } } } - // localFactor = calcLocalFactorrect(lox, loy, lp.xc, lp.lx, lp.yc, lp.ly, ach, lp.transgrad); +// localFactor = calcLocalFactorrect(lox, loy, lp.xc, lp.lx, lp.yc, lp.ly, ach, lp.transgrad); float calcLocalFactor(const float lox, const float loy, const float lcx, const float dx, const float lcy, const float dy, const float ach, const float gradient) { @@ -1149,6 +1149,7 @@ static void calcTransition(const float lox, const float loy, const float ach, co // and a factor to calculate the transition in case zone == 1 zone = 0; + if (lox >= lp.xc && lox < (lp.xc + lp.lx) && loy >= lp.yc && loy < lp.yc + lp.ly) { float zoneVal = SQR((lox - lp.xc) / (ach * lp.lx)) + SQR((loy - lp.yc) / (ach * lp.ly)); zone = zoneVal < 1.f ? 2 : 0; @@ -1264,7 +1265,8 @@ float find_gray(float source_gray, float target_gray) // https://github.com/ampas/aces-dev // (as seen on pixls.us) void ImProcFunctions::log_encode(Imagefloat *rgb, struct local_params & lp, float scale, bool multiThread) -{ /* J.Desmis 12 2019 +{ + /* J.Desmis 12 2019 small adaptations to local adjustements replace log2 by log(lp.baselog) allows diferentiation between low and high lights */ @@ -1409,7 +1411,7 @@ void ImProcFunctions::log_encode(Imagefloat *rgb, struct local_params & lp, floa void ImProcFunctions::getAutoLogloc(int sp, ImageSource *imgsrc, float *sourceg, float *blackev, float *whiteev, bool *Autogr, int fw, int fh, float xsta, float xend, float ysta, float yend, int SCALE) { BENCHFUN -//adpatation to local adjustements Jacques Desmis 12 2019 +//adpatation to local adjustements Jacques Desmis 12 2019 PreviewProps pp(0, 0, fw, fh, SCALE); Imagefloat img(int(fw / SCALE + 0.5), int(fh / SCALE + 0.5)); @@ -1426,9 +1428,9 @@ void ImProcFunctions::getAutoLogloc(int sp, ImageSource *imgsrc, float *sourceg, constexpr float noise = 1e-5; int h = fh / SCALE; int w = fw / SCALE; - // printf("h=%d w=%d\n", h, w); - // printf("xsta=%f xend=%f ysta=%f yend=%f\n", xsta, xend, ysta, yend); - + // printf("h=%d w=%d\n", h, w); + // printf("xsta=%f xend=%f ysta=%f yend=%f\n", xsta, xend, ysta, yend); + int hsta = ysta * h; int hend = yend * h; @@ -3990,7 +3992,7 @@ void ImProcFunctions::maskcalccol(int call, bool invmask, bool pde, int bfw, int const int numThreads = 1; #endif - wavcontrast4(bufmaskblurcol->L, contrast, bfw, bfh, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurvecolwav, lmasutilicolwav, maxlvl); + wavcontrast4(bufmaskblurcol->L, contrast, 0.f, bfw, bfh, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurvecolwav, lmasutilicolwav, maxlvl); } @@ -4376,7 +4378,7 @@ void ImProcFunctions::Exclude_Local(float **deltaso, float hueref, float chromar for (int y = 0; y < transformed->H; y++) { const int loy = cy + y; - const bool isZone0 = loy > (lp.yc + lp.ly -1) || loy < lp.yc - lp.lyT; // // -1 fix issue 5554 + const bool isZone0 = loy > (lp.yc + lp.ly - 1) || loy < lp.yc - lp.lyT; // // -1 fix issue 5554 if (isZone0) { // outside selection and outside transition zone => no effect, keep original values for (int x = 0; x < transformed->W; x++) { @@ -4388,7 +4390,8 @@ void ImProcFunctions::Exclude_Local(float **deltaso, float hueref, float chromar for (int x = 0; x < transformed->W; x++) { const int lox = cx + x; - const bool isZone0x = lox > (lp.xc + lp.lx -1) || lox < lp.xc - lp.lxL; // -1 fix issue 5554 + const bool isZone0x = lox > (lp.xc + lp.lx - 1) || lox < lp.xc - lp.lxL; // -1 fix issue 5554 + if (isZone0x) { // outside selection and outside transition zone => no effect, keep original values for (int x = 0; x < transformed->W; x++) { transformed->L[y][x] = original->L[y][x]; @@ -6727,7 +6730,7 @@ void ImProcFunctions::fftw_tile_blur(int GW, int GH, int tilssize, int max_numbl fftwf_cleanup(); } -void ImProcFunctions::wavcontrast4(float ** tmp, float contrast, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, bool numThreads, const LocwavCurve & locwavCurve, bool & locwavutili, int & maxlvl) +void ImProcFunctions::wavcontrast4(float ** tmp, float contrast, float radblur, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, bool numThreads, const LocwavCurve & locwavCurve, bool & locwavutili, int & maxlvl) { wavelet_decomposition *wdspot = new wavelet_decomposition(tmp[0], bfw, bfh, level_br, 1, sk, numThreads, 6); @@ -6736,11 +6739,43 @@ void ImProcFunctions::wavcontrast4(float ** tmp, float contrast, int bfw, int bf } maxlvl = wdspot->maxlevel(); + int W_L = wdspot->level_W(0); + int H_L = wdspot->level_H(0); + float *wav_L0 = wdspot->coeff0; + + if (radblur > 0.f) { + array2D bufl(W_L, H_L); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < H_L; y++) { + for (int x = 0; x < W_L; x++) { + bufl[y][x] = wav_L0[y * W_L + x]; + } + } + + #pragma omp parallel + { + gaussianBlur(bufl, bufl, W_L, H_L, radblur); + } + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < H_L; y++) { + for (int x = 0; x < W_L; x++) { + wav_L0[y * W_L + x] = bufl[y][x]; + } + } + } + + if (contrast != 0.) { +// int W_L = wdspot->level_W(0); +// int H_L = wdspot->level_H(0); +// float *wav_L0 = wdspot->coeff0; - if (contrast != 0) { - int W_L = wdspot->level_W(0); - int H_L = wdspot->level_H(0); - float *wav_L0 = wdspot->coeff0; double avedbl = 0.0; // use double precision for large summations @@ -8744,7 +8779,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int level_hr = params->locallab.spots.at(sp).csthresholdblur.getTopRight(); - wavcontrast4(bufmaskblurbl->L, contrast, GW, GH, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurveblwav, lmasutiliblwav, maxlvl); + wavcontrast4(bufmaskblurbl->L, contrast, 0.f, GW, GH, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurveblwav, lmasutiliblwav, maxlvl); } int shado = params->locallab.spots.at(sp).shadmaskbl; @@ -8879,7 +8914,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int bfwr = bfw; bool reduH = false; bool reduW = false; - + bool fft = params->locallab.spots.at(sp).fftwbl; int isogr = params->locallab.spots.at(sp).isogr; int strengr = params->locallab.spots.at(sp).strengr; @@ -10031,7 +10066,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o const int bfh = yend - ystart; const int bfw = xend - xstart; - if(complexsoft == 2) { + if (complexsoft == 2) { lp.shmeth = 1; } @@ -10654,12 +10689,14 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int level_hl = params->locallab.spots.at(sp).csthreshold.getTopLeft(); int level_br = params->locallab.spots.at(sp).csthreshold.getBottomRight(); int level_hr = params->locallab.spots.at(sp).csthreshold.getTopRight(); + const float radblur = (params->locallab.spots.at(sp).residblur) / sk; + const bool blurlc = params->locallab.spots.at(sp).blurlc; - wavcontrast4(tmp1->L, contrast, tmp1->W, tmp1->H, level_bl, level_hl, level_br, level_hr, sk, numThreads, locwavCurve, locwavutili, maxlvl); + wavcontrast4(tmp1->L, contrast, radblur, tmp1->W, tmp1->H, level_bl, level_hl, level_br, level_hr, sk, numThreads, locwavCurve, locwavutili, maxlvl); const float satur = params->locallab.spots.at(sp).residchro; - if (satur != 0.f) { + if (satur != 0.f || radblur > 0.f) { wavelet_decomposition *wdspota = new wavelet_decomposition(tmp1->a[0], tmp1->W, tmp1->H, wavelet_level, 1, sk, numThreads, 6); @@ -10672,13 +10709,44 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int W_La = wdspota->level_W(0); int H_La = wdspota->level_H(0); + if (radblur > 0.f && !blurlc) { + array2D bufa(W_La, H_La); #ifdef _OPENMP - #pragma omp parallel for if (multiThread) + #pragma omp parallel for schedule(dynamic,16) #endif - for (int i = 0; i < W_La * H_La; i++) { - wav_ab0a[i] *= (1.f + sin(rtengine::RT_PI * (satur / 200.f)));//more progressive than linear - wav_ab0a[i] = CLIPC(wav_ab0a[i]); + for (int y = 0; y < H_La; y++) { + for (int x = 0; x < W_La; x++) { + bufa[y][x] = wav_ab0a [y * W_La + x]; + } + } + + #pragma omp parallel + { + gaussianBlur(bufa, bufa, W_La, H_La, radblur); + } + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < H_La; y++) { + for (int x = 0; x < W_La; x++) { + wav_ab0a[y * W_La + x] = bufa[y][x]; + } + } + + } + + if (satur != 0.f) { +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + + for (int i = 0; i < W_La * H_La; i++) { + wav_ab0a[i] *= (1.f + sin(rtengine::RT_PI * (satur / 200.f)));//more progressive than linear + wav_ab0a[i] = CLIPC(wav_ab0a[i]); + } } wdspota->reconstruct(tmp1->a[0], 1.f); @@ -10695,13 +10763,46 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int W_Lb = wdspotb->level_W(0); int H_Lb = wdspotb->level_H(0); + if (radblur > 0.f && !blurlc) { + array2D bufb(W_Lb, H_Lb); #ifdef _OPENMP - #pragma omp parallel for if (multiThread) + #pragma omp parallel for schedule(dynamic,16) #endif - for (int i = 0; i < W_Lb * H_Lb; i++) { - wav_ab0b[i] *= (1.f + sin(rtengine::RT_PI * (satur / 200.f))); - wav_ab0b[i] = CLIPC(wav_ab0b[i]); + for (int y = 0; y < H_Lb; y++) { + for (int x = 0; x < W_Lb; x++) { + bufb[y][x] = wav_ab0b [y * W_Lb + x]; + } + } + + #pragma omp parallel + { + gaussianBlur(bufb, bufb, W_Lb, H_Lb, radblur); + } + + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < H_Lb; y++) { + for (int x = 0; x < W_Lb; x++) { + wav_ab0b[y * W_Lb + x] = bufb[y][x]; + } + } + + } + + if (satur != 0.f) { + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + + for (int i = 0; i < W_Lb * H_Lb; i++) { + wav_ab0b[i] *= (1.f + sin(rtengine::RT_PI * (satur / 200.f))); + wav_ab0b[i] = CLIPC(wav_ab0b[i]); + } } wdspotb->reconstruct(tmp1->b[0], 1.f); @@ -11684,14 +11785,14 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int bfwr = bfw; bool reduH = false; bool reduW = false; - - if(complexsoft == 2) { + + if (complexsoft == 2) { lp.expmet = 1; lp.laplacexp = 0.f; } - + if (bfw >= mSP && bfh >= mSP) { - + if (lp.expmet == 1) { optfft(N_fftwsize, bfh, bfw, bfhr, bfwr, reduH, reduW, lp, original->H, original->W, xstart, ystart, xend, yend, cx, cy); } @@ -11993,7 +12094,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o delete [] dataor; } } -printf("OK 10\n"); + + printf("OK 10\n"); //shadows with ipshadowshighlight if ((lp.expcomp != 0.f && lp.expcomp != 0.01f) || (exlocalcurve && localexutili)) { @@ -13528,40 +13630,40 @@ printf("OK 10\n"); if (nottransit) { - //new 9 december 2019 - transit_shapedetect2(call, 0, bufcolreserv.get(), bufcolfin.get(), originalmaskcol.get(), hueref, chromaref, lumaref, sobelref, meansob, blend2, lp, original, transformed, cx, cy, sk); -/* -Befor 12 2019 - //special only transition - //may be we can add preview... -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif + //new 9 december 2019 + transit_shapedetect2(call, 0, bufcolreserv.get(), bufcolfin.get(), originalmaskcol.get(), hueref, chromaref, lumaref, sobelref, meansob, blend2, lp, original, transformed, cx, cy, sk); + /* + Befor 12 2019 + //special only transition + //may be we can add preview... + #ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) + #endif - for (int y = 0; y < bfh; y++) { - const int loy = y + ystart + cy; + for (int y = 0; y < bfh; y++) { + const int loy = y + ystart + cy; - for (int x = 0; x < bfw; x++) { - const int lox = x + xstart + cx; - int zone = 0; - float localFactor = 1.f; - const float achm = (float)lp.trans / 100.f; + for (int x = 0; x < bfw; x++) { + const int lox = x + xstart + cx; + int zone = 0; + float localFactor = 1.f; + const float achm = (float)lp.trans / 100.f; - if (lp.shapmet == 0) { - calcTransition(lox, loy, achm, lp, zone, localFactor); - } else if (lp.shapmet == 1) { - calcTransitionrect(lox, loy, achm, lp, zone, localFactor); - } + if (lp.shapmet == 0) { + calcTransition(lox, loy, achm, lp, zone, localFactor); + } else if (lp.shapmet == 1) { + calcTransitionrect(lox, loy, achm, lp, zone, localFactor); + } - if (zone > 0) { - transformed->L[y + ystart][x + xstart] = bufcolfin->L[y][x] * localFactor + (1.f - localFactor) * reserved->L[y + ystart][x + xstart]; - transformed->a[y + ystart][x + xstart] = bufcolfin->a[y][x] * localFactor + (1.f - localFactor) * reserved->a[y + ystart][x + xstart]; - transformed->b[y + ystart][x + xstart] = bufcolfin->b[y][x] * localFactor + (1.f - localFactor) * reserved->b[y + ystart][x + xstart]; - } - } - } + if (zone > 0) { + transformed->L[y + ystart][x + xstart] = bufcolfin->L[y][x] * localFactor + (1.f - localFactor) * reserved->L[y + ystart][x + xstart]; + transformed->a[y + ystart][x + xstart] = bufcolfin->a[y][x] * localFactor + (1.f - localFactor) * reserved->a[y + ystart][x + xstart]; + transformed->b[y + ystart][x + xstart] = bufcolfin->b[y][x] * localFactor + (1.f - localFactor) * reserved->b[y + ystart][x + xstart]; + } + } + } -*/ + */ } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 49eea0099..213cdc5dd 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -882,6 +882,8 @@ enum ProcEventCode { Evlocallabsensilog = 853, Evlocallabfullimage = 854, Evlocallabbaselog = 855, + Evlocallabresidblur = 856, + Evlocallabblurlc = 857, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 2e57b4929..4e797193c 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2722,12 +2722,14 @@ LocallabParams::LocallabSpot::LocallabSpot() : lclightness(1.0), levelwav(4), residcont(0.0), + residblur(0.0), residchro(0.0), clarilres(0.0), claricres(0.0), clarisoft(0.0), sensilc(19), fftwlc(false), + blurlc(true), localcontMethod("loc"), locwavcurve{(double)FCT_MinMaxCPoints, 0.0, 0.5, 0.35, 0.35, 1., 0.5, 0.35, 0.35}, csthreshold(0, 0, 5, 5, false), @@ -3105,12 +3107,14 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && lclightness == other.lclightness && levelwav == other.levelwav && residcont == other.residcont + && residblur == other.residblur && residchro == other.residchro && clarilres == other.clarilres && claricres == other.claricres && clarisoft == other.clarisoft && sensilc == other.sensilc && fftwlc == other.fftwlc + && blurlc == other.blurlc && localcontMethod == other.localcontMethod && locwavcurve == other.locwavcurve && csthreshold == other.csthreshold @@ -4468,12 +4472,14 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).lclightness, "Locallab", "Lclightness_" + std::to_string(i), spot.lclightness, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).levelwav, "Locallab", "Levelwav_" + std::to_string(i), spot.levelwav, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residcont, "Locallab", "Residcont_" + std::to_string(i), spot.residcont, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residblur, "Locallab", "Residblur_" + std::to_string(i), spot.residblur, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residchro, "Locallab", "Residchro_" + std::to_string(i), spot.residchro, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).clarilres, "Locallab", "ClariLres_" + std::to_string(i), spot.clarilres, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).claricres, "Locallab", "ClariCres_" + std::to_string(i), spot.claricres, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).clarisoft, "Locallab", "Clarisoft_" + std::to_string(i), spot.clarisoft, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensilc, "Locallab", "Sensilc_" + std::to_string(i), spot.sensilc, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).fftwlc, "Locallab", "Fftwlc_" + std::to_string(i), spot.fftwlc, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blurlc, "Locallab", "Blurlc_" + std::to_string(i), spot.blurlc, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).localcontMethod, "Locallab", "localcontMethod_" + std::to_string(i), spot.localcontMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).locwavcurve, "Locallab", "LocwavCurve_" + std::to_string(i), spot.locwavcurve, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).csthreshold, "Locallab", "CSThreshold_" + std::to_string(i), spot.csthreshold.toVector(), keyFile); @@ -5980,12 +5986,14 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Lclightness_" + std::to_string(i), pedited, spot.lclightness, spotEdited.lclightness); assignFromKeyfile(keyFile, "Locallab", "Levelwav_" + std::to_string(i), pedited, spot.levelwav, spotEdited.levelwav); assignFromKeyfile(keyFile, "Locallab", "Residcont_" + std::to_string(i), pedited, spot.residcont, spotEdited.residcont); + assignFromKeyfile(keyFile, "Locallab", "Residblur_" + std::to_string(i), pedited, spot.residblur, spotEdited.residblur); assignFromKeyfile(keyFile, "Locallab", "Residchro_" + std::to_string(i), pedited, spot.residchro, spotEdited.residchro); assignFromKeyfile(keyFile, "Locallab", "ClariLres_" + std::to_string(i), pedited, spot.clarilres, spotEdited.clarilres); assignFromKeyfile(keyFile, "Locallab", "ClariCres_" + std::to_string(i), pedited, spot.claricres, spotEdited.claricres); assignFromKeyfile(keyFile, "Locallab", "Clarisoft_" + std::to_string(i), pedited, spot.clarisoft, spotEdited.clarisoft); assignFromKeyfile(keyFile, "Locallab", "Sensilc_" + std::to_string(i), pedited, spot.sensilc, spotEdited.sensilc); assignFromKeyfile(keyFile, "Locallab", "Fftwlc_" + std::to_string(i), pedited, spot.fftwlc, spotEdited.fftwlc); + assignFromKeyfile(keyFile, "Locallab", "Blurlc_" + std::to_string(i), pedited, spot.blurlc, spotEdited.blurlc); assignFromKeyfile(keyFile, "Locallab", "localcontMethod_" + std::to_string(i), pedited, spot.localcontMethod, spotEdited.localcontMethod); assignFromKeyfile(keyFile, "Locallab", "LocwavCurve_" + std::to_string(i), pedited, spot.locwavcurve, spotEdited.locwavcurve); if (keyFile.has_key("Locallab", "CSThreshold_" + std::to_string(i))) { diff --git a/rtengine/procparams.h b/rtengine/procparams.h index cf6efacae..eb86c0145 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1265,12 +1265,14 @@ struct LocallabParams { double lclightness; int levelwav; double residcont; + double residblur; double residchro; double clarilres; double claricres; double clarisoft; int sensilc; bool fftwlc; + bool blurlc; Glib::ustring localcontMethod; std::vector locwavcurve; Threshold csthreshold; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 702816312..e3c77cffe 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -885,7 +885,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabdetail LUMINANCECURVE, //Evlocallabsensilog AUTOEXP, //Evlocallabfullimage - LUMINANCECURVE //Evlocallabbaselog + LUMINANCECURVE, //Evlocallabbaselog + LUMINANCECURVE, //Evlocallabresidblur + LUMINANCECURVE // Evlocallabblurlc }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index e0f0fba96..b5dcf1cc5 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -227,6 +227,7 @@ Locallab::Locallab(): expreti(Gtk::manage(new MyExpander(true, Gtk::manage(new Gtk::HBox())))), expretitools(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_EXPRETITOOLS")))), expsharp(Gtk::manage(new MyExpander(true, Gtk::manage(new Gtk::HBox())))), + expcontrastpyr(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_LOC_CONTRASTPYR")))), expcontrast(Gtk::manage(new MyExpander(true, M("TP_LOCALLAB_LOC_CONTRAST")))), expcbdl(Gtk::manage(new MyExpander(true, Gtk::manage(new Gtk::HBox())))), expdenoi(Gtk::manage(new MyExpander(true, Gtk::manage(new Gtk::HBox())))), @@ -544,6 +545,7 @@ lcdarkness(Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_DARKNESS"), 0, 3.0, 0.01 lclightness(Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_LIGHTNESS"), 0, 3.0, 0.01, 1.0))), levelwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELWAV"), 1, 9, 1, 4))), residcont(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCONT"), -100, 100, 1, 0))), +residblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDBLUR"), 0., 100., 0.5, 0.))), clarilres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARILRES"), -20., 100., 0.5, 0.))), clarisoft(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARISOFT"), 0., 100., 0.5, 0.))), claricres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARICRES"), -20., 100., 0.5, 0.))), @@ -647,6 +649,7 @@ fftwreti(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTW")))), inverssha(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), // Local contrast fftwlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTW")))), +blurlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLURLC")))), //CBDL enacbMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), //encoding log @@ -724,6 +727,7 @@ retiFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RETIFRA")))), retitoolFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RETITOOLFRA")))), residFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RESID")))), clariFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CLARIFRA")))), +blurresidFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_BLURRESIDFRA")))), grainFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRAINFRA")))), logFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOGFRA")))), logPFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOGPFRA")))), @@ -2764,6 +2768,8 @@ pe(nullptr) if (showtooltip) { fftwlc->set_tooltip_text(M("TP_LOCALLAB_LC_FFTW_TOOLTIP")); } + blurlcConn = blurlc->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::blurlcChanged)); + csThreshold->setAdjusterListener(this); LocalcurveEditorwav->setCurveListener(this); @@ -2804,6 +2810,7 @@ pe(nullptr) } residcont->setAdjusterListener(this); + residblur->setAdjusterListener(this); residchro->setAdjusterListener(this); clarilres->setAdjusterListener(this); clarisoft->setAdjusterListener(this); @@ -2811,20 +2818,37 @@ pe(nullptr) sensilc->setAdjusterListener(this); + + clariFrame->set_label_align(0.025, 0.5); ToolParamBlock* const clariBox = Gtk::manage(new ToolParamBlock()); clariBox->pack_start(*clarilres); - if (complexsoft < 2) { +// if (complexsoft < 2) { clariBox->pack_start(*claricres); - } +// } - if (complexsoft < 2) { +// if (complexsoft < 2) { clariBox->pack_start(*clarisoft); - } +// } clariFrame->add(*clariBox); + blurresidFrame->set_label_align(0.025, 0.5); + ToolParamBlock* const blurcontraBox = Gtk::manage(new ToolParamBlock()); + blurcontraBox->pack_start(*residblur); + blurcontraBox->pack_start(*blurlc); + blurresidFrame->add(*blurcontraBox); + + setExpandAlignProperties(expcontrastpyr, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + expcontrastpyr->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expcontrastpyr)); + expcontrastpyr->setLevel(2); + ToolParamBlock* const blurcontBox = Gtk::manage(new ToolParamBlock()); + blurcontBox->pack_start(*clariFrame); + blurcontBox->pack_start(*blurresidFrame); + + expcontrastpyr->add(*blurcontBox, false); + ToolParamBlock* const contrastBox = Gtk::manage(new ToolParamBlock()); if (complexsoft < 2) { @@ -2846,15 +2870,17 @@ pe(nullptr) contrastBox->pack_start(*residcont); // } - if (complexsoft < 2) { +// if (complexsoft < 2) { contrastBox->pack_start(*residchro); - } +// } + contrastBox->pack_start(*sensilc); // if (complexsoft < 2) { - contrastBox->pack_start(*clariFrame); + contrastBox->pack_start(*expcontrastpyr); + +// contrastBox->pack_start(*clariFrame); // } - contrastBox->pack_start(*sensilc); if (complexsoft < 2) { contrastBox->pack_start(*fftwlc); @@ -3529,6 +3555,7 @@ void Locallab::foldAllButMe(GdkEventButton* event, MyExpander *expander) exptonemap->set_expanded(exptonemap == expander); expreti->set_expanded(expreti == expander); expsharp->set_expanded(expsharp == expander); + expcontrastpyr->set_expanded(expcontrastpyr == expander); expcontrast->set_expanded(expcontrast == expander); expcbdl->set_expanded(expcbdl == expander); expdenoi->set_expanded(expdenoi == expander); @@ -3657,6 +3684,7 @@ void Locallab::writeOptions(std::vector &tpOpen) tpOpen.push_back(expsoft->get_expanded()); tpOpen.push_back(expblur->get_expanded()); tpOpen.push_back(expsharp->get_expanded()); + tpOpen.push_back(expcontrastpyr->get_expanded()); tpOpen.push_back(expcontrast->get_expanded()); tpOpen.push_back(expdenoi->get_expanded()); tpOpen.push_back(explog->get_expanded()); @@ -3829,7 +3857,7 @@ void Locallab::refChanged(double huer, double lumar, double chromar) void Locallab::updateToolState(std::vector &tpOpen) { - if (tpOpen.size() >= 31) { + if (tpOpen.size() >= 32) { expsettings->setExpanded(tpOpen.at(0)); expmaskcol->set_expanded(tpOpen.at(1)); expmaskcol1->set_expanded(tpOpen.at(2)); @@ -3858,9 +3886,10 @@ void Locallab::updateToolState(std::vector &tpOpen) expsoft->set_expanded(tpOpen.at(25)); expblur->set_expanded(tpOpen.at(26)); expsharp->set_expanded(tpOpen.at(27)); - expcontrast->set_expanded(tpOpen.at(28)); - expdenoi->set_expanded(tpOpen.at(29)); - explog->set_expanded(tpOpen.at(30)); + expcontrastpyr->set_expanded(tpOpen.at(28)); + expcontrast->set_expanded(tpOpen.at(29)); + expdenoi->set_expanded(tpOpen.at(30)); + explog->set_expanded(tpOpen.at(31)); } } @@ -4975,12 +5004,14 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).lclightness = lclightness->getValue(); pp->locallab.spots.at(pp->locallab.selspot).levelwav = levelwav->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).residcont = residcont->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).residblur = residblur->getValue(); pp->locallab.spots.at(pp->locallab.selspot).residchro = residchro->getValue(); pp->locallab.spots.at(pp->locallab.selspot).clarilres = clarilres->getValue(); pp->locallab.spots.at(pp->locallab.selspot).claricres = claricres->getValue(); pp->locallab.spots.at(pp->locallab.selspot).clarisoft = clarisoft->getValue(); pp->locallab.spots.at(pp->locallab.selspot).sensilc = sensilc->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).fftwlc = fftwlc->get_active(); + pp->locallab.spots.at(pp->locallab.selspot).blurlc = blurlc->get_active(); pp->locallab.spots.at(pp->locallab.selspot).locwavcurve = wavshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).csthreshold = csThreshold->getValue(); @@ -5361,12 +5392,14 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).lclightness = pe->locallab.spots.at(pp->locallab.selspot).lclightness || lclightness->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).levelwav = pe->locallab.spots.at(pp->locallab.selspot).levelwav || levelwav->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).residcont = pe->locallab.spots.at(pp->locallab.selspot).residcont || residcont->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).residblur = pe->locallab.spots.at(pp->locallab.selspot).residblur || residblur->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).residchro = pe->locallab.spots.at(pp->locallab.selspot).residchro || residchro->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).clarilres = pe->locallab.spots.at(pp->locallab.selspot).clarilres || clarilres->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).claricres = pe->locallab.spots.at(pp->locallab.selspot).claricres || claricres->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).clarisoft = pe->locallab.spots.at(pp->locallab.selspot).clarisoft || clarisoft->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensilc = pe->locallab.spots.at(pp->locallab.selspot).sensilc || sensilc->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).fftwlc = pe->locallab.spots.at(pp->locallab.selspot).fftwlc || !fftwlc->get_inconsistent(); + pe->locallab.spots.at(pp->locallab.selspot).blurlc = pe->locallab.spots.at(pp->locallab.selspot).blurlc || !blurlc->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).localcontMethod = pe->locallab.spots.at(pp->locallab.selspot).localcontMethod || localcontMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).locwavcurve = pe->locallab.spots.at(pp->locallab.selspot).locwavcurve || !wavshape->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).csthreshold = pe->locallab.spots.at(pp->locallab.selspot).csthreshold || csThreshold->getEditedState(); @@ -5744,12 +5777,14 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).lclightness = pedited->locallab.spots.at(pp->locallab.selspot).lclightness || lclightness->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).levelwav = pedited->locallab.spots.at(pp->locallab.selspot).levelwav || levelwav->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).residcont = pedited->locallab.spots.at(pp->locallab.selspot).residcont || residcont->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).residblur = pedited->locallab.spots.at(pp->locallab.selspot).residblur || residblur->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).residchro = pedited->locallab.spots.at(pp->locallab.selspot).residchro || residchro->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).clarilres = pedited->locallab.spots.at(pp->locallab.selspot).clarilres || clarilres->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).claricres = pedited->locallab.spots.at(pp->locallab.selspot).claricres || claricres->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).clarisoft = pedited->locallab.spots.at(pp->locallab.selspot).clarisoft || clarisoft->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensilc = pedited->locallab.spots.at(pp->locallab.selspot).sensilc || sensilc->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).fftwlc = pedited->locallab.spots.at(pp->locallab.selspot).fftwlc || !fftwlc->get_inconsistent(); + pedited->locallab.spots.at(pp->locallab.selspot).blurlc = pedited->locallab.spots.at(pp->locallab.selspot).blurlc || !blurlc->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).locwavcurve = pedited->locallab.spots.at(pp->locallab.selspot).locwavcurve || !wavshape->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).csthreshold = pedited->locallab.spots.at(pp->locallab.selspot).csthreshold || csThreshold->getEditedState(); // Contrast by detail levels @@ -6239,6 +6274,7 @@ void Locallab::localcontMethodChanged() if (localcontMethod->get_active_row_number() == 0) { levelwav->hide(); residcont->hide(); + residblur->hide(); residchro->hide(); clarilres->hide(); claricres->hide(); @@ -6251,9 +6287,11 @@ void Locallab::localcontMethodChanged() lclightness->show(); LocalcurveEditorwav->hide(); fftwlc->show(); + blurlc->show(); } else if (localcontMethod->get_active_row_number() == 1) { levelwav->show(); residcont->show(); + residblur->show(); residchro->show(); clarilres->show(); claricres->show(); @@ -6266,6 +6304,7 @@ void Locallab::localcontMethodChanged() lclightness->hide(); LocalcurveEditorwav->show(); fftwlc->hide(); + blurlc->show(); } // printf("localcontMethodChanged\n"); @@ -7728,6 +7767,29 @@ void Locallab::fullimageChanged() } } +void Locallab::blurlcChanged() +{ + + if (multiImage) { + if (blurlc->get_inconsistent()) { + blurlc->set_inconsistent(false); + blurlcConn.block(true); + blurlc->set_active(false); + blurlcConn.block(false); + } + } + + if (getEnabled() && expcontrast->getEnabled()) { + if (listener) { + if (blurlc->get_active()) { + listener->panelChanged(Evlocallabblurlc, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(Evlocallabblurlc, M("GENERAL_DISABLED")); + } + } + } +} + void Locallab::fftwlcChanged() { @@ -8206,6 +8268,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c lclightness->setDefault(defSpot->lclightness); levelwav->setDefault(defSpot->levelwav); residcont->setDefault(defSpot->residcont); + residblur->setDefault(defSpot->residblur); residchro->setDefault(defSpot->residchro); clarilres->setDefault(defSpot->clarilres); claricres->setDefault(defSpot->claricres); @@ -8436,6 +8499,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c lclightness->setDefaultEditedState(Irrelevant); levelwav->setDefaultEditedState(Irrelevant); residcont->setDefaultEditedState(Irrelevant); + residblur->setDefaultEditedState(Irrelevant); residchro->setDefaultEditedState(Irrelevant); clarilres->setDefaultEditedState(Irrelevant); claricres->setDefaultEditedState(Irrelevant); @@ -8671,6 +8735,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c lclightness->setDefaultEditedState(defSpotState->lclightness ? Edited : UnEdited); levelwav->setDefaultEditedState(defSpotState->levelwav ? Edited : UnEdited); residcont->setDefaultEditedState(defSpotState->residcont ? Edited : UnEdited); + residblur->setDefaultEditedState(defSpotState->residblur ? Edited : UnEdited); residchro->setDefaultEditedState(defSpotState->residchro ? Edited : UnEdited); clarilres->setDefaultEditedState(defSpotState->clarilres ? Edited : UnEdited); claricres->setDefaultEditedState(defSpotState->claricres ? Edited : UnEdited); @@ -9819,6 +9884,12 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == residblur) { + if (listener) { + listener->panelChanged(Evlocallabresidblur, residblur->getTextValue()); + } + } + if (a == residchro) { if (listener) { listener->panelChanged(Evlocallabresidchro, residchro->getTextValue()); @@ -10293,6 +10364,7 @@ void Locallab::setBatchMode(bool batchMode) lclightness->showEditedCB(); levelwav->showEditedCB(); residcont->showEditedCB(); + residblur->showEditedCB(); residchro->showEditedCB(); clarilres->showEditedCB(); claricres->showEditedCB(); @@ -10590,6 +10662,7 @@ void Locallab::enableListener() enablecontrastConn.block(false); localcontMethodConn.block(false); fftwlcConn.block(false); + blurlcConn.block(false); // Contrast by detail levels enablecbdlConn.block(false); enacbMaskConn.block(false); @@ -10684,6 +10757,7 @@ void Locallab::disableListener() enablecontrastConn.block(true); localcontMethodConn.block(true); fftwlcConn.block(true); + blurlcConn.block(true); // Contrast by detail levels enablecbdlConn.block(true); enacbMaskConn.block(true); @@ -11337,12 +11411,14 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con lclightness->setValue(pp->locallab.spots.at(index).lclightness); levelwav->setValue(pp->locallab.spots.at(index).levelwav); residcont->setValue(pp->locallab.spots.at(index).residcont); + residblur->setValue(pp->locallab.spots.at(index).residblur); residchro->setValue(pp->locallab.spots.at(index).residchro); clarilres->setValue(pp->locallab.spots.at(index).clarilres); claricres->setValue(pp->locallab.spots.at(index).claricres); clarisoft->setValue(pp->locallab.spots.at(index).clarisoft); sensilc->setValue(pp->locallab.spots.at(index).sensilc); fftwlc->set_active(pp->locallab.spots.at(index).fftwlc); + blurlc->set_active(pp->locallab.spots.at(index).blurlc); csThreshold->setValue(pp->locallab.spots.at(index).csthreshold); if (pp->locallab.spots.at(index).localcontMethod == "loc") { @@ -11353,12 +11429,13 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con if (complexsoft == 2) { localcontMethod->set_active(1); - claricres->setValue(0); - clarisoft->setValue(0); + // claricres->setValue(0); + // clarisoft->setValue(0); lcradius->setValue(80); lcamount->setValue(0); - residchro->setValue(0); + // residchro->setValue(0); fftwlc->set_active(false); + // blurlc->set_active(false); } wavshape->setCurve(pp->locallab.spots.at(index).locwavcurve); @@ -11826,12 +11903,14 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con lclightness->setEditedState(spotState->lclightness ? Edited : UnEdited); levelwav->setEditedState(spotState->levelwav ? Edited : UnEdited); residcont->setEditedState(spotState->residcont ? Edited : UnEdited); + residblur->setEditedState(spotState->residblur ? Edited : UnEdited); residchro->setEditedState(spotState->residchro ? Edited : UnEdited); clarilres->setEditedState(spotState->clarilres ? Edited : UnEdited); claricres->setEditedState(spotState->claricres ? Edited : UnEdited); clarisoft->setEditedState(spotState->clarisoft ? Edited : UnEdited); sensilc->setEditedState(spotState->sensilc ? Edited : UnEdited); fftwlc->set_inconsistent(multiImage && !spotState->fftwlc); + blurlc->set_inconsistent(multiImage && !spotState->blurlc); wavshape->setUnChanged(!spotState->locwavcurve); csThreshold->setEditedState(spotState->csthreshold ? Edited : UnEdited); @@ -12328,6 +12407,7 @@ void Locallab::updateSpecificGUIState() if (localcontMethod->get_active_row_number() == 0) { levelwav->hide(); residcont->hide(); + residblur->hide(); residchro->hide(); clarilres->hide(); claricres->hide(); @@ -12340,9 +12420,11 @@ void Locallab::updateSpecificGUIState() lclightness->show(); LocalcurveEditorwav->hide(); fftwlc->show(); + blurlc->show(); } else if (localcontMethod->get_active_row_number() == 1) { levelwav->show(); residcont->show(); + residblur->show(); residchro->show(); clarilres->show(); claricres->show(); @@ -12355,6 +12437,7 @@ void Locallab::updateSpecificGUIState() lclightness->hide(); LocalcurveEditorwav->show(); fftwlc->hide(); + blurlc->show(); } // Update Sharpening GUI according to inverssha button state (to be compliant with inversshaChanged function) diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 449f80f7f..2bb2018a1 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -61,6 +61,7 @@ private: MyExpander* const expreti; MyExpander* const expretitools; MyExpander* const expsharp; + MyExpander* const expcontrastpyr; MyExpander* const expcontrast; MyExpander* const expcbdl; MyExpander* const expdenoi; @@ -345,6 +346,7 @@ private: Adjuster* const lclightness; Adjuster* const levelwav; Adjuster* const residcont; + Adjuster* const residblur; Adjuster* const clarilres; Adjuster* const clarisoft; Adjuster* const claricres; @@ -455,6 +457,9 @@ private: //local contrast Gtk::CheckButton* const fftwlc; sigc::connection fftwlcConn; + Gtk::CheckButton* const blurlc; + sigc::connection blurlcConn; + //CBDL Gtk::CheckButton* const enacbMask; sigc::connection enacbMaskConn; @@ -563,6 +568,7 @@ private: Gtk::Frame* const retitoolFrame; Gtk::Frame* const residFrame; Gtk::Frame* const clariFrame; + Gtk::Frame* const blurresidFrame; Gtk::Frame* const grainFrame; Gtk::Frame* const logFrame; Gtk::Frame* const logPFrame; @@ -650,6 +656,7 @@ private: void inversshaChanged(); // local contrast void fftwlcChanged(); + void blurlcChanged(); //CBDL void enacbMaskChanged(); // ComboBox event functions diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 23b4d76e5..8babda616 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1258,12 +1258,14 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).lclightness = locallab.spots.at(j).lclightness && pSpot.lclightness == otherSpot.lclightness; locallab.spots.at(j).levelwav = locallab.spots.at(j).levelwav && pSpot.levelwav == otherSpot.levelwav; locallab.spots.at(j).residcont = locallab.spots.at(j).residcont && pSpot.residcont == otherSpot.residcont; + locallab.spots.at(j).residblur = locallab.spots.at(j).residblur && pSpot.residblur == otherSpot.residblur; locallab.spots.at(j).residchro = locallab.spots.at(j).residchro && pSpot.residchro == otherSpot.residchro; locallab.spots.at(j).clarilres = locallab.spots.at(j).clarilres && pSpot.clarilres == otherSpot.clarilres; locallab.spots.at(j).claricres = locallab.spots.at(j).claricres && pSpot.claricres == otherSpot.claricres; locallab.spots.at(j).clarisoft = locallab.spots.at(j).clarisoft && pSpot.clarisoft == otherSpot.clarisoft; locallab.spots.at(j).sensilc = locallab.spots.at(j).sensilc && pSpot.sensilc == otherSpot.sensilc; locallab.spots.at(j).fftwlc = locallab.spots.at(j).fftwlc && pSpot.fftwlc == otherSpot.fftwlc; + locallab.spots.at(j).blurlc = locallab.spots.at(j).blurlc && pSpot.blurlc == otherSpot.blurlc; locallab.spots.at(j).localcontMethod = locallab.spots.at(j).localcontMethod && pSpot.localcontMethod == otherSpot.localcontMethod; locallab.spots.at(j).locwavcurve = locallab.spots.at(j).locwavcurve && pSpot.locwavcurve == otherSpot.locwavcurve; locallab.spots.at(j).csthreshold = locallab.spots.at(j).csthreshold && pSpot.csthreshold == otherSpot.csthreshold; @@ -3983,6 +3985,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).residcont = mods.locallab.spots.at(i).residcont; } + if (locallab.spots.at(i).residblur) { + toEdit.locallab.spots.at(i).residblur = mods.locallab.spots.at(i).residblur; + } + if (locallab.spots.at(i).residchro) { toEdit.locallab.spots.at(i).residchro = mods.locallab.spots.at(i).residchro; } @@ -4007,6 +4013,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).fftwlc = mods.locallab.spots.at(i).fftwlc; } + if (locallab.spots.at(i).blurlc) { + toEdit.locallab.spots.at(i).blurlc = mods.locallab.spots.at(i).blurlc; + } + if (locallab.spots.at(i).localcontMethod) { toEdit.locallab.spots.at(i).localcontMethod = mods.locallab.spots.at(i).localcontMethod; } @@ -5484,12 +5494,14 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : lclightness(v), levelwav(v), residcont(v), + residblur(v), residchro(v), clarilres(v), claricres(v), clarisoft(v), sensilc(v), fftwlc(v), + blurlc(v), localcontMethod(v), locwavcurve(v), csthreshold(v), @@ -5857,12 +5869,14 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) lclightness = v; levelwav = v; residcont = v; + residblur = v; residchro = v; clarilres = v; claricres = v; clarisoft = v; sensilc = v; fftwlc = v; + blurlc = v; localcontMethod = v; locwavcurve = v; csthreshold = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 9b227f3f7..76d9bbbdd 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -691,12 +691,14 @@ public: bool lclightness; bool levelwav; bool residcont; + bool residblur; bool residchro; bool clarilres; bool claricres; bool clarisoft; bool sensilc; bool fftwlc; + bool blurlc; bool localcontMethod; bool locwavcurve; bool csthreshold;