diff --git a/rtdata/languages/default b/rtdata/languages/default index e5c4ef483..2e51b255a 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2505,7 +2505,7 @@ TP_RETINEX_MAP_NONE;None TP_RETINEX_MEDIAN;Transmission median filter TP_RETINEX_METHOD;Method TP_RETINEX_METHOD_TOOLTIP;Low = Reinforce low light.\nUniform = Equalize action.\nHigh = Reinforce high light.\nHighlights = Remove magenta in highlights. -TP_RETINEX_MLABEL;Restored haze-free Min=%1 Max=%2 +TP_RETINEX_MLABEL;Restored data Min=%1 Max=%2 TP_RETINEX_MLABEL_TOOLTIP;Should be near min=0 max=32768\nRestored image with no mixture. TP_RETINEX_NEIGHBOR;Radius TP_RETINEX_NEUTRAL;Reset @@ -2519,11 +2519,11 @@ TP_RETINEX_SLOPE;Free gamma slope TP_RETINEX_STRENGTH;Strength TP_RETINEX_THRESHOLD;Threshold TP_RETINEX_THRESHOLD_TOOLTIP;Limits in/out.\nIn = image source,\nOut = image gauss. -TP_RETINEX_TLABEL;TM Min=%1 Max=%2 Mean=%3 Sigma=%4 -TP_RETINEX_TLABEL2;TM Tm=%1 TM=%2 -TP_RETINEX_TLABEL_TOOLTIP;Transmission map result.\nMin and Max are used by Variance.\nMean and Sigma.\nTm=Min TM=Max of transmission map. +TP_RETINEX_TLABEL;TM Datas Min=%1 Max=%2 Mean=%3 Sigma=%4 +TP_RETINEX_TLABEL2;TM Effective Tm=%1 TM=%2 +TP_RETINEX_TLABEL_TOOLTIP;Transmission map result.\nMin and Max are used by Variance.\nTm=Min TM=Max of Transmission Map. TP_RETINEX_TRANF;Transmission -TP_RETINEX_TRANSMISSION;Transmission map +TP_RETINEX_TRANSMISSION;Transmission map TP_RETINEX_TRANSMISSION_TOOLTIP;Transmission according to transmission.\nAbscissa: transmission from negative values (min), mean, and positives values (max).\nOrdinate: amplification or reduction. TP_RETINEX_UNIFORM;Uniform TP_RETINEX_VARIANCE;Contrast diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index ac4231c99..b92590aca 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1008,6 +1008,14 @@ void Crop::update(int todo) lumare = parent->lumarefs[sp]; sobelre = parent->sobelrefs[sp]; avge = parent->avgs[sp]; + float minCD; + float maxCD; + float mini; + float maxi; + float Tmean; + float Tsigma; + float Tmin; + float Tmax; CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumare, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, avge, sca); @@ -1022,7 +1030,13 @@ void Crop::update(int todo) locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, locwavCurve, locwavutili, LHutili, HHutili, cclocalcurve2, localcutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, - parent->locallColorMask, parent->locallColorMaskinv, parent->locallExpMask, parent->locallExpMaskinv, parent->locallSHMask, parent->locallSHMaskinv, parent->locallcbMask, parent->locallretiMask, parent->locallsoftMask, parent->localltmMask, parent->locallblMask); + parent->locallColorMask, parent->locallColorMaskinv, parent->locallExpMask, parent->locallExpMaskinv, parent->locallSHMask, parent->locallSHMaskinv, parent->locallcbMask, parent->locallretiMask, parent->locallsoftMask, parent->localltmMask, parent->locallblMask, + minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); + printf("Tmean=%f\n", Tmean); +// if (locallListener) { +// locallListener->minmaxChanged(maxCD, minCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); +// } + } else { parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve, lllocalcurve2,locallutili, loclhCurve, lochhCurve, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, @@ -1032,7 +1046,8 @@ void Crop::update(int todo) locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, locwavCurve, locwavutili, - LHutili, HHutili, cclocalcurve2, localcutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + LHutili, HHutili, cclocalcurve2, localcutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); } lllocalcurve2.clear(); lightCurveloc2.clear(); diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index ac12d4830..8dfb809c0 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1004,6 +1004,15 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) * - shbuffer is used as nullptr */ // Locallab mask are only shown for selected spot + float minCD; + float maxCD; + float mini; + float maxi; + float Tmean; + float Tsigma; + float Tmin; + float Tmax; + if (sp == params->locallab.selspot) { ipf.Lab_Local(3, sp, (float**)shbuffer, nprevl, nprevl, reserv, 0, 0, pW, pH, scale, locRETgainCurve, locRETtransCurve, lllocalcurve, locallutili, loclhCurve, lochhCurve, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, @@ -1013,7 +1022,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, locwavCurve, locwavutili, LHutili, HHutili, cclocalcurve, localcutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, - locallColorMask, locallColorMaskinv, locallExpMask, locallExpMaskinv, locallSHMask, locallSHMaskinv, locallcbMask, locallretiMask, locallsoftMask, localltmMask, locallblMask); + locallColorMask, locallColorMaskinv, locallExpMask, locallExpMaskinv, locallSHMask, locallSHMaskinv, locallcbMask, locallretiMask, locallsoftMask, localltmMask, locallblMask, + minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); + if (locallListener) { + locallListener->minmaxChanged(maxCD, minCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); + } } else { ipf.Lab_Local(3, sp, (float**)shbuffer, nprevl, nprevl, reserv, 0, 0, pW, pH, scale, locRETgainCurve, locRETtransCurve, lllocalcurve, locallutili, loclhCurve, lochhCurve, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, @@ -1022,7 +1035,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, locwavCurve, locwavutili, - LHutili, HHutili, cclocalcurve, localcutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + LHutili, HHutili, cclocalcurve, localcutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); + } //recalculate references after if (params->locallab.spots.at(sp).spotMethod == "exc") { diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 9aaa92751..bb2819be5 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -208,7 +208,8 @@ public: const LocCCmaskCurve & locccmasblCurve, bool &lcmasblutili, const LocLLmaskCurve & locllmasblCurve, bool &llmasblutili, const LocHHmaskCurve & lochhmasblCurve, bool & lhmasblutili, const LocwavCurve & locwavCurve, bool & locwavutili, bool &LHutili, bool &HHutili, LUTf & cclocalcurve, bool & localcutili, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, LUTf & lightCurveloc, double & huerefblur, double &chromarefblur, double & lumarefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, - int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask); + int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, + float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax); void addGaNoise(LabImage *lab, LabImage *dst, const float mean, const float variance, const int sk); void BlurNoise_Localold(int call, const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy); void InverseBlurNoise_Local(LabImage * originalmask, float **bufchro, const struct local_params& lp, const float hueref, const float chromaref, const float lumaref, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy, int sk); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index b2f59ef88..d3be847b2 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -6600,7 +6600,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o const LocCCmaskCurve & locccmasblCurve, bool & lcmasblutili, const LocLLmaskCurve & locllmasblCurve, bool & llmasblutili, const LocHHmaskCurve & lochhmasblCurve, bool & lhmasblutili, const LocwavCurve & locwavCurve, bool & locwavutili, bool & LHutili, bool & HHutili, LUTf & cclocalcurve, bool & localcutili, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, LUTf & lightCurveloc, double & huerefblur, double & chromarefblur, double & lumarefblur, double & hueref, double & chromaref, double & lumaref, double & sobelref, - int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask) + int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, + float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax) { /* comment on processus deltaE * the algo uses 3 different ways to manage deltaE according to the type of intervention @@ -7899,6 +7900,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (reduW) { bfwr = ftsizeW; } + if (settings->verbose) { printf("Nyst=%i Nyen=%i lp.yc=%f lp.lyT=%f lp.ly=%f bfh=%i bfhr=%i origH=%i ftsizeH=%i\n", ystart, yend, lp.yc, lp.lyT, lp.ly, bfh, bfhr, original->H, ftsizeH); printf("Nxst=%i Nxen=%i lp.xc=%f lp.lxL=%f lp.lx=%f bfw=%i bfwr=%i origW=%i ftsizeW=%i\n", xstart, xend, lp.xc, lp.lxL, lp.lx, bfw, bfwr, original->W, ftsizeW); @@ -8729,7 +8731,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o transit_shapedetect(30, bufexporig.get(), nullptr, buflight, bufl_ab, nullptr, nullptr, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); } - if (lp.str >= 0.2f && lp.retiena && call == 1) { + if (lp.str >= 0.2f && lp.retiena && call != 2) { int GW = transformed->W; int GH = transformed->H; LabImage *bufreti = nullptr; @@ -8741,7 +8743,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (GW > 2 && GH > 2) { - + array2D buflight(GW, GH); JaggedArray bufchro(GW, GH); @@ -8749,7 +8751,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o Hd = GH; Wd = GW; - if (!lp.invret && call == 1) { + if (!lp.invret && call != 2) { Hd = GH; Wd = GW; @@ -8814,7 +8816,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o LabImage *tmpl = nullptr; - if (!lp.invret && call == 1) { + if (!lp.invret && call != 2) { #ifdef _OPENMP @@ -8879,12 +8881,11 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o tmpl = new LabImage(transformed->W, transformed->H); } - float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax; + // float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax; bool fftw = lp.ftwreti; //for Retinex Mask are incorporated in MSR ImProcFunctions::MSRLocal(sp, fftw, 1, bufreti, bufmask, buforig, buforigmas, orig, tmpl->L, orig1, Wd, Hd, Wd, Hd, params->locallab, sk, locRETgainCcurve, locRETtransCcurve, 0, 4, 1.f, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, llretiMask, transformed, lp.enaretiMasktmap, lp.enaretiMask); - #ifdef _OPENMP #pragma omp parallel for #endif @@ -9108,6 +9109,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (bufreti) { delete bufreti; } + } } @@ -9343,7 +9345,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o tmpl = new LabImage(transformed->W, transformed->H); } - float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax; + // float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax; bool fftw = lp.ftwreti; //for Retinex Mask are incorporated in MSR diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index af467385d..96b25e5a6 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -372,6 +372,7 @@ class LocallabListener public: virtual ~LocallabListener() = default; virtual void refChanged (double huer, double lumar, double chromar) = 0; + virtual void minmaxChanged(double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax) = 0; }; class AutoColorTonListener diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 4f6d97d59..173ff48dd 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1217,6 +1217,14 @@ private: CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumare, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, avge, 1); + float minCD; + float maxCD; + float mini; + float maxi; + float Tmean; + float Tsigma; + float Tmin; + float Tmax; // No Locallab mask is shown in exported picture ipf.Lab_Local(2, sp, (float**)shbuffer, labView, labView, reservView, 0, 0, fw, fh, 1, locRETgainCurve, locRETtransCurve, lllocalcurve, locallutili, loclhCurve, lochhCurve, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, @@ -1226,7 +1234,8 @@ private: locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, locwavCurve, locwavutili, - LHutili, HHutili, cclocalcurve, localcutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + LHutili, HHutili, cclocalcurve, localcutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); // Clear local curves diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index da9c34c6e..9a0b9c05f 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -429,6 +429,14 @@ Locallab::Locallab(): bool showtooltip = options.showtooltip; CurveListener::setMulti(true); float R, G, B; + nextmin = 0.; + nextmax = 0.; + nextminiT = 0.; + nextmaxiT = 0.; + nextmeanT = 0.; + nextsigma = 0.; + nextminT = 0.; + nextmaxT = 0.; LocallabParams::LocallabSpot defSpot; @@ -1364,6 +1372,23 @@ Locallab::Locallab(): softradiusret->set_tooltip_text(M("TP_LOCALLAB_GUIDFILTER_TOOLTIP")); } + mMLabels = Gtk::manage(new Gtk::Label("---")); + setExpandAlignProperties(mMLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + mMLabels->set_tooltip_markup(M("TP_RETINEX_MLABEL_TOOLTIP")); + // settingsGrid->attach (*mMLabels, 0, 0, 1, 1); +// mMLabels->show (); + + transLabels = Gtk::manage(new Gtk::Label("---")); + setExpandAlignProperties(transLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + transLabels->set_tooltip_markup(M("TP_RETINEX_TLABEL_TOOLTIP")); + // settingsGrid->attach (*transLabels, 0, 1, 1, 1); +// transLabels->show (); + + transLabels2 = Gtk::manage(new Gtk::Label("---")); + setExpandAlignProperties(transLabels2, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); +// settingsGrid->attach (*transLabels2, 0, 2, 1, 1); +// transLabels2->show (); + LocalcurveEditortransT->setCurveListener(this); cTtransshape = static_cast(LocalcurveEditortransT->addCurve(CT_Flat, "", nullptr, false, false)); cTtransshape->setIdentityValue(0.); @@ -1372,8 +1397,9 @@ Locallab::Locallab(): if (showtooltip) { cTtransshape->setTooltip(M("TP_RETINEX_TRANSMISSION_TOOLTIP")); } + LocalcurveEditortransT->curveListComplete(); - + LocalcurveEditorgainT->setCurveListener(this); cTgainshape = static_cast(LocalcurveEditorgainT->addCurve(CT_Flat, "", nullptr, false, false)); @@ -1472,23 +1498,23 @@ Locallab::Locallab(): dehaBox->pack_start(*depth); dehaBox->pack_start(*lumonly); dehaFrame->add(*dehaBox); - + ToolParamBlock* const deharetiBox = Gtk::manage(new ToolParamBlock()); deharetiBox->pack_start(*str); deharetiBox->pack_start(*loglin); retiFrame->add(*deharetiBox); - + auxBox->add(*dehaFrame); auxBox->add(*retiFrame); ToolParamBlock* const scopeBox = Gtk::manage(new ToolParamBlock()); scopeBox->pack_start(*sensih); auxBox->add(*scopeBox); - + ToolParamBlock* const genBox = Gtk::manage(new ToolParamBlock()); genBox->pack_start(*auxBox); - - + + retiBox->pack_start(*retinexMethod); retiBox->pack_start(*fftwreti); retiBox->pack_start(*equilret); @@ -1501,12 +1527,15 @@ Locallab::Locallab(): retiBox->pack_start(*darkness); retiBox->pack_start(*lightnessreti); // retiBox->pack_start(*softradiusret); + retiBox->pack_start(*mMLabels); + retiBox->pack_start(*transLabels); + retiBox->pack_start(*transLabels2); retiBox->pack_start(*LocalcurveEditortransT, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor retiBox->pack_start(*LocalcurveEditorgainT, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor retiBox->pack_start(*expmaskreti); retiBox->pack_start(*inversret); retitoolFrame->add(*retiBox); - genBox->pack_start(*retitoolFrame); + genBox->pack_start(*retitoolFrame); expreti->add(*genBox, false); expreti->setLevel(2); @@ -2188,6 +2217,78 @@ void Locallab::writeOptions(std::vector &tpOpen) } +void Locallab::minmaxChanged(double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax) +{ + nextmin = cdmin; + nextmax = cdma; + nextminiT = mini; + nextmaxiT = maxi; + nextmeanT = Tmean; + nextsigma = Tsigma; + nextminT = Tmin; + nextmaxT = Tmax; + + idle_register.add( + [this]() -> bool { + GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected + // FIXME: The above can't be true?! + disableListener(); + enableListener(); + updateLabel(); + updateTrans(); + return false; + } + ); +} + +void Locallab::updateLabel() +{ + if (!batchMode) { + float nX, nY; + nX = nextmin; + nY = nextmax; + { + mMLabels->set_text( + Glib::ustring::compose(M("TP_RETINEX_MLABEL"), + Glib::ustring::format(std::fixed, std::setprecision(0), nX), + Glib::ustring::format(std::fixed, std::setprecision(0), nY)) + ); + } + } +} + +void Locallab::updateTrans() +{ + if (!batchMode) { + float nm, nM, nZ, nA, nB, nS; + nm = nextminiT; + nM = nextmaxiT; + nZ = nextmeanT; + nA = nextminT; + nB = nextmaxT; + nS = nextsigma; + { + transLabels->set_text( + Glib::ustring::compose(M("TP_RETINEX_TLABEL"), + Glib::ustring::format(std::fixed, std::setprecision(1), nm), + Glib::ustring::format(std::fixed, std::setprecision(1), nM), + Glib::ustring::format(std::fixed, std::setprecision(1), nZ), + Glib::ustring::format(std::fixed, std::setprecision(1), nS)) + ); + transLabels2->set_text( + Glib::ustring::compose(M("TP_RETINEX_TLABEL2"), + Glib::ustring::format(std::fixed, std::setprecision(1), nA), + Glib::ustring::format(std::fixed, std::setprecision(1), nB)) + ); + + + } + } +} + + + + void Locallab::refChanged(double huer, double lumar, double chromar) { if (!batchMode) { diff --git a/rtgui/locallab.h b/rtgui/locallab.h index a5d83306f..1d0a1b33e 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -415,9 +415,20 @@ private: ToolParamBlock * retiBox; ToolParamBlock * maskretiBox; LabGrid *labgrid; + Gtk::Label* mMLabels; + Gtk::Label* transLabels; + Gtk::Label* transLabels2; // Others Gtk::HBox* ctboxsoftmethod; Gtk::HBox* ctboxexpmethod; + double nextmin; + double nextmax; + double nextminiT; + double nextmaxiT; + double nextmeanT; + double nextminT; + double nextmaxT; + double nextsigma; /** * Used to store the default ProcParams when setDefaults function is called * When an other spot is selected, this default ProcParams is used to update adjusters default values @@ -533,6 +544,9 @@ public: void writeOptions(std::vector &tpOpen); void updateToolState(std::vector &tpOpen); void refChanged(double huer, double lumar, double chromar); + void minmaxChanged(double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax) override; + void updateLabel(); + void updateTrans(); // Mask visibility management functions struct llMaskVisibility {