diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 7e597fdd3..db9ed1cc4 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -24,8 +24,11 @@ #include #include "editwidgets.h" #include "options.h" +#include "../rtengine/procparams.h" using namespace rtengine; +using namespace procparams; + extern Options options; //----------------------------------------------------------------------------- @@ -806,25 +809,6 @@ void ControlSpotPanel::updateParamVisibility() } } -void ControlSpotPanel::adjusterAutoToggled(Adjuster* a, bool newval) -{ -} -void ControlSpotPanel::adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) -{ -} -void ControlSpotPanel::adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) -{ -} -void ControlSpotPanel::adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) -{ -} -void ControlSpotPanel::adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) -{ -} -void ControlSpotPanel::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) -{ -} - void ControlSpotPanel::adjusterChanged(Adjuster* a, double newval) { // printf("adjusterChanged\n"); @@ -2070,85 +2054,33 @@ void ControlSpotPanel::setEditedStates(SpotEdited* se) disableParamlistener(false); } -void ControlSpotPanel::setDefaults(const rtengine::procparams::ProcParams * defParams, const ParamsEdited * pedited, int id) +void ControlSpotPanel::setDefaults(const rtengine::procparams::ProcParams * defParams, const ParamsEdited * pedited) { - // Find vector index of given spot id (index = -1 if not found) - int index = -1; + const int index = defParams->locallab.selspot; - for (int i = 0; i < (int)defParams->locallab.spots.size(); i++) { - if (defParams->locallab.spots.at(i).id == id) { - index = i; + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); - break; - } + // Set default values for adjuster widgets + sensiexclu_->setDefault((double)defSpot.sensiexclu); + structexclu_->setDefault((double)defSpot.structexclu); + struc_->setDefault(defSpot.struc); + locX_->setDefault((double)defSpot.locX); + locXL_->setDefault((double)defSpot.locXL); + locY_->setDefault((double)defSpot.locY); + locYT_->setDefault((double)defSpot.locYT); + centerX_->setDefault((double)defSpot.centerX); + centerY_->setDefault((double)defSpot.centerY); + circrad_->setDefault((double)defSpot.circrad); + transit_->setDefault((double)defSpot.transit); + thresh_->setDefault(defSpot.thresh); + iter_->setDefault(defSpot.iter); + balan_->setDefault(defSpot.balan); + transitweak_->setDefault(defSpot.transitweak); + transitgrad_->setDefault(defSpot.transitgrad); } - // Set default values for adjusters - const rtengine::procparams::LocallabParams::LocallabSpot* defSpot = new rtengine::procparams::LocallabParams::LocallabSpot(); - - if (index != -1 && index < (int)defParams->locallab.spots.size()) { - defSpot = &defParams->locallab.spots.at(index); - } - - sensiexclu_->setDefault((double)defSpot->sensiexclu); - structexclu_->setDefault((double)defSpot->structexclu); - struc_->setDefault(defSpot->struc); - locX_->setDefault((double)defSpot->locX); - locXL_->setDefault((double)defSpot->locXL); - locY_->setDefault((double)defSpot->locY); - locYT_->setDefault((double)defSpot->locYT); - centerX_->setDefault((double)defSpot->centerX); - centerY_->setDefault((double)defSpot->centerY); - circrad_->setDefault((double)defSpot->circrad); - transit_->setDefault((double)defSpot->transit); - thresh_->setDefault(defSpot->thresh); - iter_->setDefault(defSpot->iter); - balan_->setDefault(defSpot->balan); - transitweak_->setDefault(defSpot->transitweak); - transitgrad_->setDefault(defSpot->transitgrad); - - // Set default edited states for adjusters - if (!pedited) { - sensiexclu_->setDefaultEditedState(Irrelevant); - structexclu_->setDefaultEditedState(Irrelevant); - struc_->setDefaultEditedState(Irrelevant); - locX_->setDefaultEditedState(Irrelevant); - locXL_->setDefaultEditedState(Irrelevant); - locY_->setDefaultEditedState(Irrelevant); - locYT_->setDefaultEditedState(Irrelevant); - centerX_->setDefaultEditedState(Irrelevant); - centerY_->setDefaultEditedState(Irrelevant); - circrad_->setDefaultEditedState(Irrelevant); - transit_->setDefaultEditedState(Irrelevant); - thresh_->setDefaultEditedState(Irrelevant); - iter_->setDefaultEditedState(Irrelevant); - balan_->setDefaultEditedState(Irrelevant); - transitweak_->setDefaultEditedState(Irrelevant); - transitgrad_->setDefaultEditedState(Irrelevant); - } else { - const LocallabParamsEdited::LocallabSpotEdited* defSpotState = new LocallabParamsEdited::LocallabSpotEdited(true); - - if (index != 1 && index < (int)pedited->locallab.spots.size()) { - defSpotState = &pedited->locallab.spots.at(index); - } - - sensiexclu_->setDefaultEditedState(defSpotState->sensiexclu ? Edited : UnEdited); - structexclu_->setDefaultEditedState(defSpotState->structexclu ? Edited : UnEdited); - struc_->setDefaultEditedState(defSpotState->struc ? Edited : UnEdited); - locX_->setDefaultEditedState(defSpotState->locX ? Edited : UnEdited); - locXL_->setDefaultEditedState(defSpotState->locXL ? Edited : UnEdited); - locY_->setDefaultEditedState(defSpotState->locY ? Edited : UnEdited); - locYT_->setDefaultEditedState(defSpotState->locYT ? Edited : UnEdited); - centerX_->setDefaultEditedState(defSpotState->centerX ? Edited : UnEdited); - centerY_->setDefaultEditedState(defSpotState->centerY ? Edited : UnEdited); - circrad_->setDefaultEditedState(defSpotState->circrad ? Edited : UnEdited); - transit_->setDefaultEditedState(defSpotState->transit ? Edited : UnEdited); - thresh_->setDefaultEditedState(defSpotState->thresh ? Edited : UnEdited); - iter_->setDefaultEditedState(defSpotState->iter ? Edited : UnEdited); - balan_->setDefaultEditedState(defSpotState->balan ? Edited : UnEdited); - transitweak_->setDefaultEditedState(defSpotState->transitweak ? Edited : UnEdited); - transitgrad_->setDefaultEditedState(defSpotState->transitgrad ? Edited : UnEdited); - } + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void ControlSpotPanel::setBatchMode(bool batchMode) diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h index 9d542c75b..eb5bb5b74 100644 --- a/rtgui/controlspotpanel.h +++ b/rtgui/controlspotpanel.h @@ -29,7 +29,6 @@ #include "toolpanel.h" #include #include -#include "thresholdadjuster.h" class ControlSpotPanel: public ToolParamBlock, @@ -206,10 +205,9 @@ public: * Implementation of setDefaults function of toolpanel.h * * @param defParams ProcParams containing default values to set to the adjusters - * @param pedited ParamsEdited containing default state values to set to the adjusters - * @param id Spot id to consider to update adjusters default values and default state values + * @param pedited ParamsEdited containing default state values to set to the adjusters (not used because batch mode is deactivated for Locallab) */ - void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr, int id = 0); + void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); /** * Variant of setDefaults function which only update adjuster default states * @@ -256,12 +254,6 @@ private: void qualityMethodChanged(); void updateParamVisibility(); void adjusterChanged(Adjuster* a, double newval); - void adjusterAutoToggled(Adjuster* a, bool newval); - void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop); - void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight); - void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop); - void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); - void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); void avoidChanged(); void disableParamlistener(bool cond); diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 9326bc7e1..73b8d6119 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -17,1982 +17,70 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . * 2017 Jacques Desmis - * 2018 Pierre Cabrera + * 2019 Pierre Cabrera */ #include "locallab.h" -#include "rtimage.h" -#include #include "../rtengine/rt_math.h" #include "options.h" -#include -#include "editcallbacks.h" -#include "guiutils.h" -#include -#include #include "../rtengine/improcfun.h" -#include "labgrid.h" -#include "locallabtools.h" - -#define MINCHRO 0. -#define MAXCHRO 150 -#define MAXCHROCC 100 -#define MINNEIGH 4 -#define MAXNEIGH 5000 -#define CENTERNEIGH 200 using namespace rtengine; extern Options options; -static double retiSlider2neigh(double sval) -{ - - // slider range: 0 - 5000 - double neigh; - - if (sval <= 1000) { - // linear below center-temp - neigh = MINNEIGH + (sval / 1000.0) * (CENTERNEIGH - MINNEIGH); - } else { - const double slope = (double)(CENTERNEIGH - MINNEIGH) / (MAXNEIGH - CENTERNEIGH); - double x = (sval - 1000) / 1000; // x 0..1 - double y = x * slope + (1.0 - slope) * pow(x, 4.0); - neigh = CENTERNEIGH + y * (MAXNEIGH - CENTERNEIGH); - } - - if (neigh < MINNEIGH) { - neigh = MINNEIGH; - } - - if (neigh > MAXNEIGH) { - neigh = MAXNEIGH; - } - - return neigh; -} - -static double retiNeigh2Slider(double neigh) -{ - - double sval; - - if (neigh <= CENTERNEIGH) { - sval = ((neigh - MINNEIGH) / (CENTERNEIGH - MINNEIGH)) * 1000.0; - } else { - const double slope = (double)(CENTERNEIGH - MINNEIGH) / (MAXNEIGH - CENTERNEIGH); - const double y = (neigh - CENTERNEIGH) / (MAXNEIGH - CENTERNEIGH); - double x = pow(y, 0.25); // rough guess of x, will be a little lower - double k = 0.1; - bool add = true; - - // the y=f(x) function is a mess to invert, therefore we have this trial-refinement loop instead. - // from tests, worst case is about 20 iterations, ie no problem - for (;;) { - double y1 = x * slope + (1.0 - slope) * pow(x, 4.0); - - if (1000 * fabs(y1 - y) < 0.1) { - break; - } - - if (y1 < y) { - if (!add) { - k /= 2; - } - - x += k; - add = true; - } else { - if (add) { - k /= 2; - } - - x -= k; - add = false; - } - } - - sval = 1000.0 + x * 1000.0; - } - - if (sval < 0) { - sval = 0; - } - - if (sval > 5000) { - sval = 5000; - } - - return sval; -} Locallab::Locallab(): FoldableToolPanel(this, "locallab", M("TP_LOCALLAB_LABEL"), false, true), - // Expander widgets - expsettings(Gtk::manage(new ControlSpotPanel())), - expcolor(Gtk::manage(new MyExpander(true, M("TP_LOCALLAB_COFR")))), - expexpose(Gtk::manage(new MyExpander(true, M("TP_LOCALLAB_EXPOSE")))), - expshadhigh(Gtk::manage(new MyExpander(true, M("TP_LOCALLAB_SHADHIGH")))), - expvibrance(Gtk::manage(new MyExpander(true, M("TP_LOCALLAB_VIBRANCE")))), - expsoft(Gtk::manage(new MyExpander(true, M("TP_LOCALLAB_SOFT")))), - expblur(Gtk::manage(new MyExpander(true, M("TP_LOCALLAB_BLUFR")))), - exptonemap(Gtk::manage(new MyExpander(true, Gtk::manage(new Gtk::HBox())))), - expreti(Gtk::manage(new MyExpander(true, Gtk::manage(new Gtk::HBox())))), - expsharp(Gtk::manage(new MyExpander(true, Gtk::manage(new Gtk::HBox())))), - 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())))), - expmaskcol(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOW")))), - expmaskexp(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOW")))), - expmasksh(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOW")))), - expmaskcb(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOW")))), - expmaskreti(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOW")))), - expmasktm(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOW")))), - - // CurveEditorGroup widgets - // Color & Light - llCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_LUM"))), - HCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_HLH"))), - maskCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK"))), - // Exposure - curveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_CURVEEDITOR_TONES_LABEL"))), - maskexpCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK"))), - //Shadows Highlight - maskSHCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK"))), - // Vibrance - curveEditorGG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL"))), - //TM - masktmCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK"))), - // Retinex - LocalcurveEditorgainT(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_TRANSMISSIONGAIN"))), - maskretiCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK"))), - //Local contrast - LocalcurveEditorwav(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAV"))), - - //CBDL - maskcbCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK"))), - - // Adjuster widgets - // Color & Light - lightness(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LIGHTNESS"), -100, 100, 1, 0))), - contrast(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTRAST"), -100, 100, 1, 0))), - chroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMA"), -100, 150, 1, 0))), - strengthgrid(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRGRID"), 0, 100, 1, 30))), - sensi(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), - structcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), - blurcolde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), - blendmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), - radmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 10.))), - chromaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), - gammaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.25, 4.0, 0.01, 1.))), - slomaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), - softradiuscol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.1, 0.))), - // Exposure - expcomp(Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -2.0, 4.0, 0.05, 0.0))), - hlcompr(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0))), - hlcomprthresh(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0))), - black(Gtk::manage(new Adjuster(M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 50, 0))), - shadex(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHADEX"), 0, 100, 1, 0))), - shcompr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHADEXCOMP"), 0, 100, 1, 50))), - expchroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EXPCHROMA"), -50, 100, 1, 30))), - warm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_WARM"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-small.png")), Gtk::manage(new RTImage("circle-orange-small.png"))))), - sensiex(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), - structexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), - blurexpde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), - blendmaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), - radmaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 10.))), - chromaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), - gammaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.25, 4.0, 0.01, 1.))), - slomaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), - softradiusexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.1, 0.))), - laplacexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPLACEXP"), 0.0, 100.0, 0.1, 20.))), - balanexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BALANEXP"), 0.2, 1.2, 0.01, 0.8))), - linear(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LINEAR"), 0., 1., 0.01, 0.))), - //Shadow hightlights - highlights(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_HIGHLIGHTS"), 0, 100, 1, 0))), - h_tonalwidth(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_HLTONALW"), 10, 100, 1, 70))), - shadows(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_SHADOWS"), 0, 100, 1, 0))), - s_tonalwidth(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_SHTONALW"), 10, 100, 1, 30))), - sh_radius(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_RADIUS"), 0, 100, 1, 40))), - sensihs(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), - blendmaskSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), - radmaskSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 10.))), - blurSHde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), - chromaskSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), - gammaskSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.25, 4.0, 0.01, 1.))), - slomaskSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), - // Vibrance - saturated(Gtk::manage(new Adjuster(M("TP_VIBRANCE_SATURATED"), -100., 100., 1., 0.))), - pastels(Gtk::manage(new Adjuster(M("TP_VIBRANCE_PASTELS"), -100., 100., 1., 0.))), - sensiv(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), - //Soft Light - streng(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENG"), 1, 100, 1, 1))), - laplace(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPLACE"), 0., 100., 0.5, 25.))), - sensisf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 1, 100, 1, 15))), - // Blur & Noise - radius(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADIUS"), 1.0, 100.0, 0.1, 1.0))), - strength(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGTH"), 0, 100, 1, 0))), - sensibn(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIBN"), 0, 100, 1, 40))), - // Tone Mapping - stren(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STREN"), -0.5, 2.0, 0.01, 0.5))), - gamma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAM"), 0.4, 4.0, 0.11, 1.0))), - estop(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ESTOP"), 0.1, 4.0, 0.01, 0.5))), - scaltm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALTM"), 0.1, 10.0, 0.01, 4.0))), - rewei(Gtk::manage(new Adjuster(M("TP_LOCALLAB_REWEI"), 0, 3, 1, 0))), - sensitm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), - softradiustm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.1, 0.))), - amount(Gtk::manage(new Adjuster(M("TP_LOCALLAB_AMOUNT"), 50., 100.0, 0.5, 95.))), - satur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SATUR"), -100., 100., 0.1, 0.))),//by default satur = 0 ==> use Mantiuk value - blendmasktm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), - radmasktm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 10.))), - chromasktm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), - gammasktm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.05, 5.0, 0.01, 1.))), - slomasktm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), - // Retinex - str(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STR"), 0., 100., 0.1, 0.0))), - chrrt(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHRRT"), 0.0, 100.0, 0.1, 0.0))), - neigh(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NEIGH"), MINNEIGH, MAXNEIGH, 0.5, CENTERNEIGH, nullptr, nullptr, &retiSlider2neigh, &retiNeigh2Slider))), - - // neigh(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NEIGH"), 4., 4000., 0.5, 50.))), - vart(Gtk::manage(new Adjuster(M("TP_LOCALLAB_VART"), 4.0, 500., 0.1, 70.))), - dehaz(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DEHAZ"), 0, 100, 1, 0))), - sensih(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIH"), 0, 100, 1, 30))), - softradiusret(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GUIDFILTER"), 0.0, 100.0, 0.1, 0.))), - blendmaskreti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), - radmaskreti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 10.))), - chromaskreti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), - gammaskreti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.05, 5.0, 0.01, 1.))), - slomaskreti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), - scalereti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALERETI"), 1.0, 10.0, 1., 3.))), - darkness(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DARKRETI"), 0.01, 3.0, 0.01, 1.))), - lightnessreti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LIGHTRETI"), 0.01, 3.0, 0.01, 1.))), - limd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRESRETI"), 1.2, 100.0, 0.1, 8.))), - // Sharpening - sharcontrast(Gtk::manage(new Adjuster(M("TP_SHARPENING_CONTRAST"), 0, 200, 1, 20))), - sharradius(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARRADIUS"), 0.4, 2.5, 0.01, 0.75))), - sharamount(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARAMOUNT"), 0, 100, 1, 100))), - shardamping(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARDAMPING"), 0, 100, 1, 0))), - shariter(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARITER"), 5, 100, 1, 30))), - sharblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARBLUR"), 0.2, 2.0, 0.05, 0.2))), - sensisha(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 19))), - // Local Contrast - lcradius(Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_RADIUS"), 20, 400, 1, 80))), - lcamount(Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_AMOUNT"), 0, 1.0, 0.01, 0))), - lcdarkness(Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_DARKNESS"), 0, 3.0, 0.01, 1.0))), - 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"), 3, 9, 1, 4))), - residcont(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCONT"), -100, 100, 1, 0))), - sensilc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 19))), - // Contrast by detail levels - chromacbdl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMACBDL"), 0., 1.5, 0.01, 0.))), - threshold(Gtk::manage(new Adjuster(M("TP_DIRPYREQUALIZER_THRESHOLD"), 0, 1., 0.01, 0.2))), - clarityml(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARITYML"), 0.1, 100., 0.1, 0.1))), - contresid(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTRESID"), -100, 100, 1, 0))), - blurcbdl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURCBDL"), 0., 100., 0.1, 0.))), - sensicb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSICB"), 0, 100, 1, 15))), - softradiuscb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.1, 0.))), - blendmaskcb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), - radmaskcb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 10.))), - chromaskcb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), - gammaskcb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.25, 4.0, 0.01, 1.))), - slomaskcb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), - // Denoise - noiselumf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINE"), MINCHRO, MAXCHRO, 1, 0))), - noiselumf0(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINEZERO"), MINCHRO, MAXCHRO, 1, 0))), - noiselumf2(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINETWO"), MINCHRO, MAXCHRO, 1, 0))), - noiselumc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMCOARSE"), MINCHRO, MAXCHROCC, 1, 0))), - noiselumdetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMDETAIL"), 0, 100, 1, 0))), - noiselequal(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELEQUAL"), -2, 10, 1, 7, Gtk::manage(new RTImage("circle-white-small.png")), Gtk::manage(new RTImage("circle-black-small.png"))))), - noisechrof(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHROFINE"), MINCHRO, MAXCHRO, 1, 0))), - noisechroc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHROCOARSE"), MINCHRO, MAXCHROCC, 1, 0))), - noisechrodetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHRODETAIL"), 0, 100, 1, 0))), - adjblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ADJ"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-small.png")), Gtk::manage(new RTImage("circle-red-small.png"))))), - bilateral(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BILATERAL"), 0, 100, 1, 0))), - sensiden(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIDEN"), 0, 100, 1, 20))), - - // ButtonCheck widgets - // Color & Light - curvactiv(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_CURV")))), - invers(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), - enaColorMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), - // Exposure - enaExpMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), - inversex(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), - //Shadows Highlight - enaSHMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), - inverssh(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), - // Vibrance - protectSkins(Gtk::manage(new Gtk::CheckButton(M("TP_VIBRANCE_PROTECTSKINS")))), - avoidColorShift(Gtk::manage(new Gtk::CheckButton(M("TP_VIBRANCE_AVOIDCOLORSHIFT")))), - pastSatTog(Gtk::manage(new Gtk::CheckButton(M("TP_VIBRANCE_PASTSATTOG")))), - // Blur & Noise - activlum(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ACTIV")))), - //TM - equiltm(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_EQUIL")))), - enatmMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), - // Retinex - equilret(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_EQUIL")))), - inversret(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), - enaretiMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), - enaretiMasktmap(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_TM_MASK")))), - fftwreti(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTW")))), - // Sharpening - inverssha(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), - // Local contrast - fftwlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTW")))), - //CBDL - enacbMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), - - // ComboBox widgets - // Color & Light - qualitycurveMethod(Gtk::manage(new MyComboBoxText())), - gridMethod(Gtk::manage(new MyComboBoxText())), - showmaskcolMethod(Gtk::manage(new MyComboBoxText())), - //Exposure - showmaskexpMethod(Gtk::manage(new MyComboBoxText())), - expMethod(Gtk::manage(new MyComboBoxText())), - //Shadows Highlight - showmaskSHMethod(Gtk::manage(new MyComboBoxText())), - // Blur & Noise - blurMethod(Gtk::manage(new MyComboBoxText())), - //soft Method - softMethod(Gtk::manage(new MyComboBoxText())), - showmasksoftMethod(Gtk::manage(new MyComboBoxText())), - //TM - showmasktmMethod(Gtk::manage(new MyComboBoxText())), - // Retinex - retinexMethod(Gtk::manage(new MyComboBoxText())), - showmaskretiMethod(Gtk::manage(new MyComboBoxText())), - //Local contrast - localcontMethod(Gtk::manage(new MyComboBoxText())), - //CBDL - showmaskcbMethod(Gtk::manage(new MyComboBoxText())), - - // ThresholdAdjuster widgets - // Vibrance - psThreshold(Gtk::manage(new ThresholdAdjuster(M("TP_VIBRANCE_PSTHRESHOLD"), -100., 100., 0., M("TP_VIBRANCE_PSTHRESHOLD_WEIGTHING"), 0, 0., 100., 75., M("TP_VIBRANCE_PSTHRESHOLD_SATTHRESH"), 0, this, false))), - - // Other widgets - labqualcurv(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_QUALCURV_METHOD") + ":"))), - lumacontrastMinusButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMACONTRAST_MINUS")))), - lumaneutralButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMANEUTRAL")))), - lumacontrastPlusButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMACONTRAST_PLUS")))), - gridFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABGRID")))), - pdeFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_PDEFRA")))), - residFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RESID")))), - - // Others - defparams(nullptr), - defpedited(nullptr), - pe(nullptr) + // Spot control panel widget + expsettings(Gtk::manage(new ControlSpotPanel())) { + const bool showtooltip = options.showtooltip; + + // Create panel widget to receive Locallab GUI elements ToolVBox* const panel = Gtk::manage(new ToolVBox()); - bool showtooltip = options.showtooltip; - CurveListener::setMulti(true); - float R, G, B; - - LocallabParams::LocallabSpot defSpot; - - // Test - LocallabDenoise* const test = new LocallabDenoise(); - panel->pack_start(*test->getExpander(), false, false); - - // Settings - expsettings->getExpander()->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expsettings->getExpander())); - expsettings->setLevel(2); + // Add spot control panel to panel widget + expsettings->setLevel(2); // TODO Move this to controlspotpanel.cc panel->pack_start(*expsettings->getExpander(), false, false); - // Color & Light - expcolor->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expcolor)); - enablecolorConn = expcolor->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expcolor)); - // expcolor->set_tooltip_text(M("TP_LOCALLAB_EXPCOLOR_TOOLTIP")); - setExpandAlignProperties(expmaskcol, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - expmaskcol->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskcol)); - expmaskcol->setLevel(2); - - curvactivConn = curvactiv->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::curvactivChanged)); - lightness->setAdjusterListener(this); - - if (showtooltip) { - lightness->set_tooltip_text(M("TP_LOCALLAB_EXPCOLOR_TOOLTIP")); - } - - contrast->setAdjusterListener(this); - - chroma->setAdjusterListener(this); - - if (showtooltip) { - sensi->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); - } - - sensi->setAdjusterListener(this); - - strengthgrid->setAdjusterListener(this); - structcol->setAdjusterListener(this); - blurcolde->setAdjusterListener(this); - - blendmaskcol->setAdjusterListener(this); - radmaskcol->setAdjusterListener(this); - chromaskcol->setAdjusterListener(this); - gammaskcol->setAdjusterListener(this); - slomaskcol->setAdjusterListener(this); - softradiuscol->setAdjusterListener(this); - - qualitycurveMethod->append(M("TP_LOCALLAB_CURVNONE")); - qualitycurveMethod->append(M("TP_LOCALLAB_CURVCURR")); - qualitycurveMethod->set_active(0); - - if (showtooltip) { - qualitycurveMethod->set_tooltip_markup(M("TP_LOCALLAB_CURVEMETHOD_TOOLTIP")); - } - - qualitycurveMethodConn = qualitycurveMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::qualitycurveMethodChanged)); - - gridMethod->append(M("TP_LOCALLAB_GRIDONE")); - gridMethod->append(M("TP_LOCALLAB_GRIDTWO")); - gridMethod->set_active(0); - gridMethodConn = gridMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::gridMethodChanged)); - - llCurveEditorG->setCurveListener(this); - llshape = static_cast(llCurveEditorG->addCurve(CT_Diagonal, "L(L)")); - llshape->setResetCurve(DiagonalCurveType(defSpot.llcurve.at(0)), defSpot.llcurve); - - if (showtooltip) { - llshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - - std::vector mllshape; - mllshape.push_back(GradientMilestone(0., 0., 0., 0.)); - mllshape.push_back(GradientMilestone(1., 1., 1., 1.)); - llshape->setBottomBarBgGradient(mllshape); - llshape->setLeftBarBgGradient(mllshape); - - ccshape = static_cast(llCurveEditorG->addCurve(CT_Diagonal, "C(C)")); - ccshape->setResetCurve(DiagonalCurveType(defSpot.cccurve.at(0)), defSpot.cccurve); - - if (showtooltip) { - ccshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - - std::vector mccshape; - mccshape.push_back(GradientMilestone(0., 0., 0., 0.)); - mccshape.push_back(GradientMilestone(1., 1., 1., 1.)); - ccshape->setBottomBarBgGradient(mccshape); - ccshape->setLeftBarBgGradient(mccshape); - - // llCurveEditorG->newLine(); - llCurveEditorG->curveListComplete(); - HCurveEditorG->setCurveListener(this); - - LHshape = static_cast(HCurveEditorG->addCurve(CT_Flat, "L(H)", nullptr, false, true)); - LHshape->setIdentityValue(0.); - LHshape->setResetCurve(FlatCurveType(defSpot.LHcurve.at(0)), defSpot.LHcurve); - - if (showtooltip) { - LHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - - LHshape->setCurveColorProvider(this, 1); - std::vector mLHshape; - - for (int i = 0; i < 7; i++) { - float x = float (i) * (1.0f / 6.0); - Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); - mLHshape.push_back(GradientMilestone(double (x), double (R), double (G), double (B))); - } - - LHshape->setBottomBarBgGradient(mLHshape); - - HHshape = static_cast(HCurveEditorG->addCurve(CT_Flat, "H(H)", nullptr, false, true)); - HHshape->setIdentityValue(0.); - HHshape->setResetCurve(FlatCurveType(defSpot.HHcurve.at(0)), defSpot.HHcurve); - - if (showtooltip) { - HHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - - HHshape->setCurveColorProvider(this, 1); - std::vector mHHshape; - - for (int i = 0; i < 7; i++) { - float x = float (i) * (1.0f / 6.0); - - Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); - mHHshape.push_back(GradientMilestone(double (x), double (R), double (G), double (B))); - } - - HHshape->setBottomBarBgGradient(mHHshape); - - HCurveEditorG->curveListComplete(); - - inversConn = invers->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::inversChanged)); - - showmaskcolMethod->append(M("TP_LOCALLAB_SHOWMNONE")); - showmaskcolMethod->append(M("TP_LOCALLAB_SHOWMODIF")); - showmaskcolMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); - showmaskcolMethod->append(M("TP_LOCALLAB_SHOWMASK")); - showmaskcolMethod->append(M("TP_LOCALLAB_SHOWSTRUC")); - showmaskcolMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); - - showmaskcolMethod->set_active(0); - - if (showtooltip) { - showmaskcolMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - - showmaskcolMethodConn = showmaskcolMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::showmaskcolMethodChanged)); - - enaColorMaskConn = enaColorMask->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::enaColorMaskChanged)); - - maskCurveEditorG->setCurveListener(this); - - CCmaskshape = static_cast(maskCurveEditorG->addCurve(CT_Flat, "C(C)", nullptr, false, false)); - CCmaskshape->setIdentityValue(0.); - CCmaskshape->setResetCurve(FlatCurveType(defSpot.CCmaskcurve.at(0)), defSpot.CCmaskcurve); - - if (showtooltip) { - CCmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - CCmaskshape->setBottomBarColorProvider(this, 7); - - LLmaskshape = static_cast(maskCurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false)); - LLmaskshape->setIdentityValue(0.); - LLmaskshape->setResetCurve(FlatCurveType(defSpot.LLmaskcurve.at(0)), defSpot.LLmaskcurve); - - if (showtooltip) { - LLmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - LLmaskshape->setBottomBarBgGradient(mllshape); - - if (showtooltip) { - LLmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - HHmaskshape = static_cast(maskCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true)); - HHmaskshape->setIdentityValue(0.); - HHmaskshape->setResetCurve(FlatCurveType(defSpot.HHmaskcurve.at(0)), defSpot.HHmaskcurve); - - if (showtooltip) { - HHmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - HHmaskshape->setCurveColorProvider(this, 6); - HHmaskshape->setBottomBarColorProvider(this, 6); - - maskCurveEditorG->curveListComplete(); - labgrid = Gtk::manage(new LabGrid(EvLocallabLabGridValue, M("TP_LOCALLAB_LABGRID_VALUES"))); - - ToolParamBlock* const colorBox = Gtk::manage(new ToolParamBlock()); - Gtk::Frame* const superFrame = Gtk::manage(new Gtk::Frame()); - superFrame->set_label_align(0.025, 0.5); - superFrame->set_label_widget(*curvactiv); - ToolParamBlock* const superBox = Gtk::manage(new ToolParamBlock()); - superBox->pack_start(*lightness); - superBox->pack_start(*contrast); - superBox->pack_start(*chroma); - gridFrame->set_label_align(0.025, 0.5); - ToolParamBlock* const gridBox = Gtk::manage(new ToolParamBlock()); - gridBox->pack_start(*labgrid); - gridBox->pack_start(*gridMethod); - gridBox->pack_start(*strengthgrid); - gridFrame->add(*gridBox); - superBox->pack_start(*gridFrame); - - superFrame->add(*superBox); - colorBox->pack_start(*superFrame); - colorBox->pack_start(*sensi); - colorBox->pack_start(*structcol); - colorBox->pack_start(*blurcolde); - colorBox->pack_start(*softradiuscol); - Gtk::HBox* const qualcurvbox = Gtk::manage(new Gtk::HBox()); - qualcurvbox->pack_start(*labqualcurv, Gtk::PACK_SHRINK, 4); - qualcurvbox->pack_start(*qualitycurveMethod); - colorBox->pack_start(*qualcurvbox); - colorBox->pack_start(*llCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - colorBox->pack_start(*HCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - colorBox->pack_start(*invers); - ToolParamBlock* const maskcolBox = Gtk::manage(new ToolParamBlock()); - maskcolBox->pack_start(*showmaskcolMethod, Gtk::PACK_SHRINK, 4); - maskcolBox->pack_start(*enaColorMask, Gtk::PACK_SHRINK, 0); - maskcolBox->pack_start(*maskCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - maskcolBox->pack_start(*blendmaskcol, Gtk::PACK_SHRINK, 0); - maskcolBox->pack_start(*radmaskcol, Gtk::PACK_SHRINK, 0); - maskcolBox->pack_start(*chromaskcol, Gtk::PACK_SHRINK, 0); - maskcolBox->pack_start(*gammaskcol, Gtk::PACK_SHRINK, 0); - maskcolBox->pack_start(*slomaskcol, Gtk::PACK_SHRINK, 0); - expmaskcol->add(*maskcolBox, false); - colorBox->pack_start(*expmaskcol); - - expcolor->add(*colorBox, false); - expcolor->setLevel(2); - - panel->pack_start(*expcolor, false, false); - - // Exposure - expexpose->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expexpose)); - enableexposeConn = expexpose->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expexpose)); - - if (showtooltip) { - expexpose->set_tooltip_text(M("TP_LOCALLAB_EXPOSURE_TOOLTIP")); - } - - expMethod->append(M("TP_LOCALLAB_STD")); - expMethod->append(M("TP_LOCALLAB_PDE")); - expMethod->set_active(0); - expMethodConn = expMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::expMethodChanged)); - - if (showtooltip) { - expMethod->set_tooltip_text(M("TP_LOCALLAB_EXPMETHOD_TOOLTIP")); - } - - setExpandAlignProperties(expmaskexp, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - expmaskexp->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskexp)); - expmaskexp->setLevel(2); - - expcomp->setAdjusterListener(this); - - hlcompr->setAdjusterListener(this); - - hlcomprthresh->setAdjusterListener(this); - - black->setAdjusterListener(this); - shadex->setAdjusterListener(this); - - shcompr->setAdjusterListener(this); - expchroma->setAdjusterListener(this); - - if (showtooltip) { - warm->set_tooltip_text(M("TP_LOCALLAB_WARM_TOOLTIP")); - } - - warm->setAdjusterListener(this); - - if (showtooltip) { - sensiex->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); - } - - sensiex->setAdjusterListener(this); - inversexConn = inversex->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::inversexChanged)); - - structexp->setAdjusterListener(this); - - blurexpde->setAdjusterListener(this); - - blendmaskexp->setAdjusterListener(this); - radmaskexp->setAdjusterListener(this); - chromaskexp->setAdjusterListener(this); - gammaskexp->setAdjusterListener(this); - slomaskexp->setAdjusterListener(this); - softradiusexp->setAdjusterListener(this); - laplacexp->setAdjusterListener(this); - balanexp->setAdjusterListener(this); - linear->setAdjusterListener(this); - - curveEditorG->setCurveListener(this); - - shapeexpos = static_cast(curveEditorG->addCurve(CT_Diagonal, "")); - shapeexpos->setResetCurve(DiagonalCurveType(defSpot.excurve.at(0)), defSpot.excurve); - - if (showtooltip) { - shapeexpos->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_TONES_TOOLTIP")); - } - - std::vector mshapeexpos; - mshapeexpos.push_back(GradientMilestone(0., 0., 0., 0.)); - mshapeexpos.push_back(GradientMilestone(1., 1., 1., 1.)); - shapeexpos->setBottomBarBgGradient(mshapeexpos); - shapeexpos->setLeftBarBgGradient(mshapeexpos); - - curveEditorG->curveListComplete(); - - enaExpMaskConn = enaExpMask->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::enaExpMaskChanged)); - - showmaskexpMethod->append(M("TP_LOCALLAB_SHOWMNONE")); - showmaskexpMethod->append(M("TP_LOCALLAB_SHOWMODIF")); - showmaskexpMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); - showmaskexpMethod->append(M("TP_LOCALLAB_SHOWMASK")); - showmaskexpMethod->append(M("TP_LOCALLAB_SHOWSTRUC")); - showmaskexpMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); - - showmaskexpMethod->set_active(0); - - if (showtooltip) { - showmaskexpMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - - showmaskexpMethodConn = showmaskexpMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::showmaskexpMethodChanged)); - - maskexpCurveEditorG->setCurveListener(this); - - CCmaskexpshape = static_cast(maskexpCurveEditorG->addCurve(CT_Flat, "C(C)", nullptr, false, false)); - CCmaskexpshape->setIdentityValue(0.); - CCmaskexpshape->setResetCurve(FlatCurveType(defSpot.CCmaskexpcurve.at(0)), defSpot.CCmaskexpcurve); - - if (showtooltip) { - CCmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - CCmaskexpshape->setBottomBarColorProvider(this, 7); - - LLmaskexpshape = static_cast(maskexpCurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false)); - LLmaskexpshape->setIdentityValue(0.); - LLmaskexpshape->setResetCurve(FlatCurveType(defSpot.LLmaskexpcurve.at(0)), defSpot.LLmaskexpcurve); - - if (showtooltip) { - LLmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - LLmaskexpshape->setBottomBarBgGradient(mllshape); - - HHmaskexpshape = static_cast(maskexpCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true)); - HHmaskexpshape->setIdentityValue(0.); - HHmaskexpshape->setResetCurve(FlatCurveType(defSpot.HHmaskexpcurve.at(0)), defSpot.HHmaskexpcurve); - - if (showtooltip) { - HHmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - HHmaskexpshape->setCurveColorProvider(this, 6); - HHmaskexpshape->setBottomBarColorProvider(this, 6); - - maskexpCurveEditorG->curveListComplete(); - - - pdeFrame->set_label_align(0.025, 0.5); - ToolParamBlock* const pdeBox = Gtk::manage(new ToolParamBlock()); - pdeBox->pack_start(*laplacexp); - pdeBox->pack_start(*linear); - pdeBox->pack_start(*balanexp); - - pdeFrame->add(*pdeBox); - - ToolParamBlock* const exposeBox = Gtk::manage(new ToolParamBlock()); - exposeBox->pack_start(*expMethod); - exposeBox->pack_start(*pdeFrame); - - exposeBox->pack_start(*expcomp); - exposeBox->pack_start(*hlcompr); - exposeBox->pack_start(*hlcomprthresh); - exposeBox->pack_start(*black); - exposeBox->pack_start(*shadex); - exposeBox->pack_start(*shcompr); - exposeBox->pack_start(*expchroma); - exposeBox->pack_start(*warm); - exposeBox->pack_start(*sensiex); - exposeBox->pack_start(*structexp); - exposeBox->pack_start(*blurexpde); - exposeBox->pack_start(*softradiusexp); - exposeBox->pack_start(*curveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - exposeBox->pack_start(*inversex); - ToolParamBlock* const maskexpBox = Gtk::manage(new ToolParamBlock()); - maskexpBox->pack_start(*showmaskexpMethod, Gtk::PACK_SHRINK, 4); - maskexpBox->pack_start(*enaExpMask, Gtk::PACK_SHRINK, 0); - maskexpBox->pack_start(*maskexpCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - maskexpBox->pack_start(*blendmaskexp, Gtk::PACK_SHRINK, 0); - maskexpBox->pack_start(*radmaskexp, Gtk::PACK_SHRINK, 0); - maskexpBox->pack_start(*chromaskexp, Gtk::PACK_SHRINK, 0); - maskexpBox->pack_start(*gammaskexp, Gtk::PACK_SHRINK, 0); - maskexpBox->pack_start(*slomaskexp, Gtk::PACK_SHRINK, 0); - expmaskexp->add(*maskexpBox, false); - exposeBox->pack_start(*expmaskexp); - - expexpose->add(*exposeBox, false); - expexpose->setLevel(2); - - panel->pack_start(*expexpose, false, false); - - - -//shadow highlight - expshadhigh->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expshadhigh)); - enableshadhighConn = expshadhigh->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expshadhigh)); - - if (showtooltip) { - expshadhigh->set_tooltip_text(M("TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP")); - } - - setExpandAlignProperties(expmasksh, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - expmasksh->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmasksh)); - expmasksh->setLevel(2); - - highlights->setAdjusterListener(this); - h_tonalwidth->setAdjusterListener(this); - shadows->setAdjusterListener(this); - s_tonalwidth->setAdjusterListener(this); - sh_radius->setAdjusterListener(this); - sensihs->setAdjusterListener(this); - blendmaskSH->setAdjusterListener(this); - radmaskSH->setAdjusterListener(this); - blurSHde->setAdjusterListener(this); - chromaskSH->setAdjusterListener(this); - gammaskSH->setAdjusterListener(this); - slomaskSH->setAdjusterListener(this); - - enaSHMaskConn = enaSHMask->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::enaSHMaskChanged)); - inversshConn = inverssh->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::inversshChanged)); - - showmaskSHMethod->append(M("TP_LOCALLAB_SHOWMNONE")); - showmaskSHMethod->append(M("TP_LOCALLAB_SHOWMODIF")); - showmaskSHMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); - showmaskSHMethod->append(M("TP_LOCALLAB_SHOWMASK")); - showmaskSHMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); - -// showmaskSHMethod->append(M("TP_LOCALLAB_SHOWSTRUC")); - - showmaskSHMethod->set_active(0); - - if (showtooltip) { - showmaskSHMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - - showmaskSHMethodConn = showmaskSHMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::showmaskSHMethodChanged)); - - maskSHCurveEditorG->setCurveListener(this); - - CCmaskSHshape = static_cast(maskSHCurveEditorG->addCurve(CT_Flat, "C(C)", nullptr, false, false)); - CCmaskSHshape->setIdentityValue(0.); - CCmaskSHshape->setResetCurve(FlatCurveType(defSpot.CCmaskSHcurve.at(0)), defSpot.CCmaskSHcurve); - - if (showtooltip) { - CCmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - CCmaskSHshape->setBottomBarColorProvider(this, 7); - - LLmaskSHshape = static_cast(maskSHCurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false)); - LLmaskSHshape->setIdentityValue(0.); - LLmaskSHshape->setResetCurve(FlatCurveType(defSpot.LLmaskSHcurve.at(0)), defSpot.LLmaskSHcurve); - - if (showtooltip) { - LLmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - LLmaskSHshape->setBottomBarBgGradient(mllshape); - - HHmaskSHshape = static_cast(maskSHCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true)); - HHmaskSHshape->setIdentityValue(0.); - HHmaskSHshape->setResetCurve(FlatCurveType(defSpot.HHmaskSHcurve.at(0)), defSpot.HHmaskSHcurve); - - if (showtooltip) { - HHmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - HHmaskSHshape->setCurveColorProvider(this, 6); - HHmaskSHshape->setBottomBarColorProvider(this, 6); - - maskSHCurveEditorG->curveListComplete(); - - ToolParamBlock* const shadhighBox = Gtk::manage(new ToolParamBlock()); - shadhighBox->pack_start(*highlights); - shadhighBox->pack_start(*h_tonalwidth); - shadhighBox->pack_start(*shadows); - shadhighBox->pack_start(*s_tonalwidth); - shadhighBox->pack_start(*sh_radius); - shadhighBox->pack_start(*sensihs); - shadhighBox->pack_start(*blurSHde); - shadhighBox->pack_start(*inverssh); - - - ToolParamBlock* const maskSHBox = Gtk::manage(new ToolParamBlock()); - maskSHBox->pack_start(*showmaskSHMethod, Gtk::PACK_SHRINK, 4); - maskSHBox->pack_start(*enaSHMask, Gtk::PACK_SHRINK, 0); - maskSHBox->pack_start(*maskSHCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - maskSHBox->pack_start(*blendmaskSH, Gtk::PACK_SHRINK, 0); - maskSHBox->pack_start(*radmaskSH, Gtk::PACK_SHRINK, 0); - maskSHBox->pack_start(*chromaskSH, Gtk::PACK_SHRINK, 0); - maskSHBox->pack_start(*gammaskSH, Gtk::PACK_SHRINK, 0); - maskSHBox->pack_start(*slomaskSH, Gtk::PACK_SHRINK, 0); - expmasksh->add(*maskSHBox, false); - shadhighBox->pack_start(*expmasksh); - - expshadhigh->add(*shadhighBox, false); - expshadhigh->setLevel(2); - - panel->pack_start(*expshadhigh, false, false); - - // Vibrance - expvibrance->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expvibrance)); - enablevibranceConn = expvibrance->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expvibrance)); - - saturated->setAdjusterListener(this); - - pastels->setAdjusterListener(this); - - if (showtooltip) { - psThreshold->set_tooltip_markup(M("TP_VIBRANCE_PSTHRESHOLD_TOOLTIP")); - } - - psThreshold->setAdjusterListener(this); - - pskinsconn = protectSkins->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::protectskins_toggled)); - - ashiftconn = avoidColorShift->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::avoidcolorshift_toggled)); - - pastsattogconn = pastSatTog->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::pastsattog_toggled)); - - sensiv->setAdjusterListener(this); - - curveEditorGG->setCurveListener(this); - - skinTonesCurve = static_cast(curveEditorGG->addCurve(CT_Diagonal, M("TP_VIBRANCE_CURVEEDITOR_SKINTONES"))); - - if (showtooltip) { - skinTonesCurve->setTooltip(M("TP_VIBRANCE_CURVEEDITOR_SKINTONES_TOOLTIP")); - } - - std::vector mskinTonesCurve; - // -0.1 rad < Hue < 1.6 rad - Color::hsv2rgb01(0.92f, 0.45f, 0.6f, R, G, B); - mskinTonesCurve.push_back(GradientMilestone(0.0, double (R), double (G), double (B))); - Color::hsv2rgb01(0.14056f, 0.45f, 0.6f, R, G, B); - mskinTonesCurve.push_back(GradientMilestone(1.0, double (R), double (G), double (B))); - skinTonesCurve->setBottomBarBgGradient(mskinTonesCurve); - skinTonesCurve->setLeftBarBgGradient(mskinTonesCurve); - skinTonesCurve->setRangeLabels( - M("TP_VIBRANCE_CURVEEDITOR_SKINTONES_RANGE1"), M("TP_VIBRANCE_CURVEEDITOR_SKINTONES_RANGE2"), - M("TP_VIBRANCE_CURVEEDITOR_SKINTONES_RANGE3"), M("TP_VIBRANCE_CURVEEDITOR_SKINTONES_RANGE4") - ); - skinTonesCurve->setRangeDefaultMilestones(0.1, 0.4, 0.85); - - curveEditorGG->curveListComplete(); - - ToolParamBlock* const vibranceBox = Gtk::manage(new ToolParamBlock()); - vibranceBox->pack_start(*saturated, Gtk::PACK_SHRINK, 0); - vibranceBox->pack_start(*pastels, Gtk::PACK_SHRINK, 0); - vibranceBox->pack_start(*psThreshold, Gtk::PACK_SHRINK, 0); - vibranceBox->pack_start(*protectSkins, Gtk::PACK_SHRINK, 0); - vibranceBox->pack_start(*avoidColorShift, Gtk::PACK_SHRINK, 0); - vibranceBox->pack_start(*pastSatTog, Gtk::PACK_SHRINK, 0); - vibranceBox->pack_start(*sensiv, Gtk::PACK_SHRINK, 0); - vibranceBox->pack_start(*curveEditorGG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - expvibrance->add(*vibranceBox, false); - expvibrance->setLevel(2); - - panel->pack_start(*expvibrance, false, false); - - // Soft Light - expsoft->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expsoft)); - enablesoftConn = expsoft->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expsoft)); - softMethod->append(M("TP_LOCALLAB_SOFTM")); - softMethod->append(M("TP_LOCALLAB_RETIM")); - softMethod->set_active(0); - - if (showtooltip) { - softMethod->set_tooltip_markup(M("TP_LOCALLAB_SOFTMETHOD_TOOLTIP")); - } - - softMethodConn = softMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::softMethodChanged)); - - - ctboxsoftmethod = Gtk::manage(new Gtk::HBox()); - Gtk::Label* const labelsoftmethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_SHOWDCT") + ":")); - ctboxsoftmethod->pack_start(*labelsoftmethod, Gtk::PACK_SHRINK, 4); - - showmasksoftMethod->append(M("TP_LOCALLAB_SHOWMNONE")); - showmasksoftMethod->append(M("TP_LOCALLAB_SHOWLAPLACE")); - showmasksoftMethod->append(M("TP_LOCALLAB_SHOWFOURIER")); - showmasksoftMethod->append(M("TP_LOCALLAB_SHOWPOISSON")); - showmasksoftMethod->append(M("TP_LOCALLAB_SHOWNORMAL")); - - showmasksoftMethod->set_active(0); - - if (showtooltip) { - showmasksoftMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKSOFT_TOOLTIP")); - } - - showmasksoftMethodConn = showmasksoftMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::showmasksoftMethodChanged)); - ctboxsoftmethod->pack_start(*showmasksoftMethod); - - - streng->setAdjusterListener(this); - laplace->setAdjusterListener(this); - - sensisf->setAdjusterListener(this); - - ToolParamBlock* const softBox = Gtk::manage(new ToolParamBlock()); - - softBox->pack_start(*softMethod); -// softBox->pack_start(*showmasksoftMethod, Gtk::PACK_SHRINK, 4); - softBox->pack_start(*ctboxsoftmethod); - softBox->pack_start(*streng); - softBox->pack_start(*laplace); - softBox->pack_start(*sensisf); - expsoft->add(*softBox, false); - expsoft->setLevel(2); - - panel->pack_start(*expsoft, false, false); - - - // Blur & Noise - expblur->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expblur)); - enableblurConn = expblur->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expblur)); - - radius->setAdjusterListener(this); - - strength->setAdjusterListener(this); - - if (showtooltip) { - sensibn->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); - } - - sensibn->setAdjusterListener(this); - - blurMethod->append(M("TP_LOCALLAB_BLNORM")); - blurMethod->append(M("TP_LOCALLAB_BLINV")); - blurMethod->set_active(0); - - if (showtooltip) { - blurMethod->set_tooltip_markup(M("TP_LOCALLAB_BLMETHOD_TOOLTIP")); - } - - blurMethodConn = blurMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::blurMethodChanged)); - - activlumConn = activlum->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::activlumChanged)); - - ToolParamBlock* const blurrBox = Gtk::manage(new ToolParamBlock()); - blurrBox->pack_start(*radius); - blurrBox->pack_start(*strength); - blurrBox->pack_start(*sensibn); - blurrBox->pack_start(*blurMethod); - blurrBox->pack_start(*activlum); - expblur->add(*blurrBox, false); - expblur->setLevel(2); - - panel->pack_start(*expblur, false, false); - - // Tone Mapping - Gtk::HBox* const TMTitleHBox = Gtk::manage(new Gtk::HBox()); - Gtk::Label* const TMLabel = Gtk::manage(new Gtk::Label()); - TMLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_TM")) + Glib::ustring("")); - TMLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - TMTitleHBox->pack_start(*TMLabel, Gtk::PACK_EXPAND_WIDGET, 0); - RTImage *TMImage = Gtk::manage(new RTImage("one-to-one-small.png")); - - if (showtooltip) { - TMImage->set_tooltip_text(M("TP_GENERAL_11SCALE_TOOLTIP")); - } - - TMTitleHBox->pack_end(*TMImage, Gtk::PACK_SHRINK, 0); - exptonemap->setLabel(TMTitleHBox); - exptonemap->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), exptonemap)); - enabletonemapConn = exptonemap->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), exptonemap)); - - if (showtooltip) { - exptonemap->set_tooltip_text(M("TP_LOCALLAB_TONEMAP_TOOLTIP")); - } - - setExpandAlignProperties(expmasktm, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - expmasktm->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmasktm)); - expmasktm->setLevel(2); - - stren->setAdjusterListener(this); - - gamma->setAdjusterListener(this); - - estop->setAdjusterListener(this); - - scaltm->setAdjusterListener(this); - - rewei->setAdjusterListener(this); - - amount->setAdjusterListener(this); - satur->setAdjusterListener(this); - - if (showtooltip) { - sensitm->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); - } - - sensitm->setAdjusterListener(this); - softradiustm->setAdjusterListener(this); - - if (showtooltip) { - estop->set_tooltip_text(M("TP_LOCALLAB_TONEMAPESTOP_TOOLTIP")); - } - - if (showtooltip) { - rewei->set_tooltip_text(M("TP_LOCALLAB_TONEMAPESTOP_TOOLTIP")); - } - - equiltmConn = equiltm->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::equiltmChanged)); - - masktmCurveEditorG->setCurveListener(this); - - CCmasktmshape = static_cast(masktmCurveEditorG->addCurve(CT_Flat, "C(C)", nullptr, false, false)); - CCmasktmshape->setIdentityValue(0.); - CCmasktmshape->setResetCurve(FlatCurveType(defSpot.CCmasktmcurve.at(0)), defSpot.CCmasktmcurve); - - if (showtooltip) { - CCmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - CCmasktmshape->setBottomBarColorProvider(this, 7); - - LLmasktmshape = static_cast(masktmCurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false)); - LLmasktmshape->setIdentityValue(0.); - LLmasktmshape->setResetCurve(FlatCurveType(defSpot.LLmasktmcurve.at(0)), defSpot.LLmasktmcurve); - - if (showtooltip) { - LLmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - LLmasktmshape->setBottomBarBgGradient(mllshape); - - HHmasktmshape = static_cast(masktmCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true)); - HHmasktmshape->setIdentityValue(0.); - HHmasktmshape->setResetCurve(FlatCurveType(defSpot.HHmasktmcurve.at(0)), defSpot.HHmasktmcurve); - - if (showtooltip) { - HHmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - HHmasktmshape->setCurveColorProvider(this, 6); - HHmasktmshape->setBottomBarColorProvider(this, 6); - - masktmCurveEditorG->curveListComplete(); - enatmMaskConn = enatmMask->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::enatmMaskChanged)); - - showmasktmMethod->append(M("TP_LOCALLAB_SHOWMNONE")); - showmasktmMethod->append(M("TP_LOCALLAB_SHOWMODIF")); - showmasktmMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); - showmasktmMethod->append(M("TP_LOCALLAB_SHOWMASK")); - showmasktmMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); - - - showmasktmMethod->set_active(0); - - if (showtooltip) { - showmasktmMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - - showmasktmMethodConn = showmasktmMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::showmasktmMethodChanged)); - - - - blendmasktm->setAdjusterListener(this); - radmasktm->setAdjusterListener(this); - chromasktm->setAdjusterListener(this); - gammasktm->setAdjusterListener(this); - slomasktm->setAdjusterListener(this); - - ToolParamBlock* const masktmBox = Gtk::manage(new ToolParamBlock()); - masktmBox->pack_start(*showmasktmMethod, Gtk::PACK_SHRINK, 4); - masktmBox->pack_start(*enatmMask, Gtk::PACK_SHRINK, 0); - masktmBox->pack_start(*masktmCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - masktmBox->pack_start(*blendmasktm, Gtk::PACK_SHRINK, 0); - masktmBox->pack_start(*radmasktm, Gtk::PACK_SHRINK, 0); - masktmBox->pack_start(*chromasktm, Gtk::PACK_SHRINK, 0); - masktmBox->pack_start(*gammasktm, Gtk::PACK_SHRINK, 0); - masktmBox->pack_start(*slomasktm, Gtk::PACK_SHRINK, 0); - expmasktm->add(*masktmBox, false); - - - ToolParamBlock* const tmBox = Gtk::manage(new ToolParamBlock()); -// tmBox->pack_start(*amount);//to use if we change transit_shapedetect parameters - tmBox->pack_start(*stren); - tmBox->pack_start(*equiltm); - tmBox->pack_start(*gamma); - tmBox->pack_start(*satur); - tmBox->pack_start(*estop); - tmBox->pack_start(*scaltm); - tmBox->pack_start(*rewei); -// tmBox->pack_start(*softradiustm);//always bad with TM ?? - tmBox->pack_start(*sensitm); - tmBox->pack_start(*expmasktm); - - exptonemap->add(*tmBox, false); - exptonemap->setLevel(2); - - panel->pack_start(*exptonemap, false, false); - - // Retinex - Gtk::HBox* const retiTitleHBox = Gtk::manage(new Gtk::HBox()); - Gtk::Label* const retiLabel = Gtk::manage(new Gtk::Label()); - retiLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_RETI")) + Glib::ustring("")); - retiLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - retiTitleHBox->pack_start(*retiLabel, Gtk::PACK_EXPAND_WIDGET, 0); - RTImage *retiImage = Gtk::manage(new RTImage("one-to-one-small.png")); - - if (showtooltip) { - retiImage->set_tooltip_text(M("TP_GENERAL_11SCALE_TOOLTIP")); - } - - retiTitleHBox->pack_end(*retiImage, Gtk::PACK_SHRINK, 0); - expreti->setLabel(retiTitleHBox); - expreti->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expreti)); - enableretiConn = expreti->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expreti)); - fftwretiConn = fftwreti->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::fftwretiChanged)); - - if (showtooltip) { - fftwreti->set_tooltip_text(M("TP_LOCALLAB_RETI_FFTW_TOOLTIP")); - } - - setExpandAlignProperties(expmaskreti, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - expmaskreti->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskreti)); - expmaskreti->setLevel(2); - - retinexMethod->append(M("TP_RETINEX_LOW")); - retinexMethod->append(M("TP_RETINEX_UNIFORM")); - retinexMethod->append(M("TP_RETINEX_HIGH")); - retinexMethod->set_active(0); - - if (showtooltip) { - retinexMethod->set_tooltip_markup(M("TP_LOCRETI_METHOD_TOOLTIP")); - } - - retinexMethodConn = retinexMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::retinexMethodChanged)); - - str->setAdjusterListener(this); - - neigh->setAdjusterListener(this); - - if (showtooltip) { - neigh->set_tooltip_text(M("TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP")); - } - - vart->setAdjusterListener(this); - - if (showtooltip) { - vart->set_tooltip_text(M("TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP")); - } - - dehaz->setAdjusterListener(this); - - chrrt->setAdjusterListener(this); - - if (showtooltip) { - sensih->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); - } - - sensih->setAdjusterListener(this); - softradiusret->setAdjusterListener(this); - - if (showtooltip) { - softradiusret->set_tooltip_text(M("TP_LOCALLAB_GUIDFILTER_TOOLTIP")); - } - - LocalcurveEditorgainT->setCurveListener(this); - - cTgainshape = static_cast(LocalcurveEditorgainT->addCurve(CT_Flat, "", nullptr, false, false)); - cTgainshape->setIdentityValue(0.); - cTgainshape->setResetCurve(FlatCurveType(defSpot.localTgaincurve.at(0)), defSpot.localTgaincurve); - - if (showtooltip) { - cTgainshape->setTooltip(M("TP_RETINEX_GAINTRANSMISSION_TOOLTIP")); - } - - LocalcurveEditorgainT->curveListComplete(); - - inversretConn = inversret->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::inversretChanged)); - equilretConn = equilret->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::equilretChanged)); - - maskretiCurveEditorG->setCurveListener(this); - - CCmaskretishape = static_cast(maskretiCurveEditorG->addCurve(CT_Flat, "C(C)", nullptr, false, false)); - CCmaskretishape->setIdentityValue(0.); - CCmaskretishape->setResetCurve(FlatCurveType(defSpot.CCmaskreticurve.at(0)), defSpot.CCmaskreticurve); - - if (showtooltip) { - CCmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - CCmaskretishape->setBottomBarColorProvider(this, 7); - - LLmaskretishape = static_cast(maskretiCurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false)); - LLmaskretishape->setIdentityValue(0.); - LLmaskretishape->setResetCurve(FlatCurveType(defSpot.LLmaskreticurve.at(0)), defSpot.LLmaskreticurve); - - if (showtooltip) { - LLmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - LLmaskretishape->setBottomBarBgGradient(mllshape); - - HHmaskretishape = static_cast(maskretiCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true)); - HHmaskretishape->setIdentityValue(0.); - HHmaskretishape->setResetCurve(FlatCurveType(defSpot.HHmaskreticurve.at(0)), defSpot.HHmaskreticurve); - - if (showtooltip) { - HHmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - HHmaskretishape->setCurveColorProvider(this, 6); - HHmaskretishape->setBottomBarColorProvider(this, 6); - - maskretiCurveEditorG->curveListComplete(); - enaretiMaskConn = enaretiMask->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::enaretiMaskChanged)); - enaretiMasktmapConn = enaretiMasktmap->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::enaretiMasktmapChanged)); - - showmaskretiMethod->append(M("TP_LOCALLAB_SHOWMNONE")); - showmaskretiMethod->append(M("TP_LOCALLAB_SHOWMODIF")); - showmaskretiMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); - showmaskretiMethod->append(M("TP_LOCALLAB_SHOWMASK")); - showmaskretiMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); - - - showmaskretiMethod->set_active(0); - - if (showtooltip) { - showmaskretiMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - - showmaskretiMethodConn = showmaskretiMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::showmaskretiMethodChanged)); - - - - blendmaskreti->setAdjusterListener(this); - radmaskreti->setAdjusterListener(this); - chromaskreti->setAdjusterListener(this); - gammaskreti->setAdjusterListener(this); - slomaskreti->setAdjusterListener(this); - scalereti->setAdjusterListener(this); - darkness->setAdjusterListener(this); - lightnessreti->setAdjusterListener(this); - limd->setAdjusterListener(this); - - ToolParamBlock* const maskretiBox = Gtk::manage(new ToolParamBlock()); - maskretiBox->pack_start(*showmaskretiMethod, Gtk::PACK_SHRINK, 4); - maskretiBox->pack_start(*enaretiMask, Gtk::PACK_SHRINK, 0); - maskretiBox->pack_start(*enaretiMasktmap, Gtk::PACK_SHRINK, 0); - maskretiBox->pack_start(*maskretiCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - maskretiBox->pack_start(*blendmaskreti, Gtk::PACK_SHRINK, 0); - maskretiBox->pack_start(*radmaskreti, Gtk::PACK_SHRINK, 0); - maskretiBox->pack_start(*chromaskreti, Gtk::PACK_SHRINK, 0); - maskretiBox->pack_start(*gammaskreti, Gtk::PACK_SHRINK, 0); - maskretiBox->pack_start(*slomaskreti, Gtk::PACK_SHRINK, 0); - expmaskreti->add(*maskretiBox, false); - - ToolParamBlock* const retiBox = Gtk::manage(new ToolParamBlock()); - retiBox->pack_start(*retinexMethod); - retiBox->pack_start(*fftwreti); - retiBox->pack_start(*equilret); - retiBox->pack_start(*str); - retiBox->pack_start(*chrrt); - retiBox->pack_start(*neigh); - retiBox->pack_start(*vart); - retiBox->pack_start(*scalereti); - retiBox->pack_start(*limd); - retiBox->pack_start(*darkness); - retiBox->pack_start(*lightnessreti); - retiBox->pack_start(*dehaz); - retiBox->pack_start(*softradiusret); - retiBox->pack_start(*sensih); - 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); - expreti->add(*retiBox, false); - expreti->setLevel(2); - - panel->pack_start(*expreti, false, false); - - // Sharpening - Gtk::HBox* const sharpTitleHBox = Gtk::manage(new Gtk::HBox()); - Gtk::Label* const sharpLabel = Gtk::manage(new Gtk::Label()); - sharpLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_SHARP")) + Glib::ustring("")); - sharpLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - sharpTitleHBox->pack_start(*sharpLabel, Gtk::PACK_EXPAND_WIDGET, 0); - RTImage *sharpImage = Gtk::manage(new RTImage("one-to-one-small.png")); - - if (showtooltip) { - sharpImage->set_tooltip_text(M("TP_GENERAL_11SCALE_TOOLTIP")); - } - - sharpTitleHBox->pack_end(*sharpImage, Gtk::PACK_SHRINK, 0); - expsharp->setLabel(sharpTitleHBox); - expsharp->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expsharp)); - enablesharpConn = expsharp->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expsharp)); - - sharcontrast->setAdjusterListener(this); - - sharradius->setAdjusterListener(this); - - sharamount->setAdjusterListener(this); - - shardamping->setAdjusterListener(this); - - shariter->setAdjusterListener(this); - - sharblur->setAdjusterListener(this); - - if (showtooltip) { - sensisha->set_tooltip_text(M("TP_LOCALLAB_SENSIS_TOOLTIP")); - } - - sensisha->setAdjusterListener(this); - - inversshaConn = inverssha->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::inversshaChanged)); - - ToolParamBlock* const sharpBox = Gtk::manage(new ToolParamBlock()); - sharpBox->pack_start(*sharcontrast); - sharpBox->pack_start(*sharradius); - sharpBox->pack_start(*sharamount); - sharpBox->pack_start(*shardamping); - sharpBox->pack_start(*shariter); - sharpBox->pack_start(*sharblur); - sharpBox->pack_start(*sensisha); - sharpBox->pack_start(*inverssha); - expsharp->add(*sharpBox, false); - expsharp->setLevel(2); - - panel->pack_start(*expsharp, false, false); - - // Local Contrast - expcontrast->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expcontrast)); - enablecontrastConn = expcontrast->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expcontrast)); - fftwlcConn = fftwlc->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::fftwlcChanged)); - - if (showtooltip) { - fftwlc->set_tooltip_text(M("TP_LOCALLAB_LC_FFTW_TOOLTIP")); - } - LocalcurveEditorwav->setCurveListener(this); - - wavshape = static_cast(LocalcurveEditorwav->addCurve(CT_Flat, "", nullptr, false, false)); - wavshape->setIdentityValue(0.); - wavshape->setResetCurve(FlatCurveType(defSpot.locwavcurve.at(0)), defSpot.locwavcurve); - - if (showtooltip) { - wavshape->setTooltip(M("TP_RETINEX_WAV_TOOLTIP")); - } - - LocalcurveEditorwav->curveListComplete(); - - localcontMethod->append(M("TP_LOCALLAB_LOCCONT")); - localcontMethod->append(M("TP_LOCALLAB_WAVE")); - localcontMethod->set_active(0); - - if (showtooltip) { - // localcontMethod->set_tooltip_markup(M("TP_LOCALLAB_LOCMETHOD_TOOLTIP")); - } - - localcontMethodConn = localcontMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::localcontMethodChanged)); - - lcradius->setAdjusterListener(this); - - lcamount->setAdjusterListener(this); - - lcdarkness->setAdjusterListener(this); - - lclightness->setAdjusterListener(this); - levelwav->setAdjusterListener(this); - if (showtooltip) { - levelwav->set_tooltip_markup(M("TP_LOCALLAB_LEVELWAV_TOOLTIP")); - } - - residcont->setAdjusterListener(this); - - sensilc->setAdjusterListener(this); - - ToolParamBlock* const contrastBox = Gtk::manage(new ToolParamBlock()); - contrastBox->pack_start(*localcontMethod); - contrastBox->pack_start(*lcradius); - contrastBox->pack_start(*lcamount); - contrastBox->pack_start(*lcdarkness); - contrastBox->pack_start(*lclightness); - contrastBox->pack_start(*LocalcurveEditorwav, Gtk::PACK_SHRINK, 4); - contrastBox->pack_start(*levelwav); - contrastBox->pack_start(*residcont); - contrastBox->pack_start(*sensilc); - contrastBox->pack_start(*fftwlc); - expcontrast->add(*contrastBox, false); - expcontrast->setLevel(2); - - panel->pack_start(*expcontrast, false, false); - - // Contrast by detail levels - Gtk::HBox* const cbdlTitleHBox = Gtk::manage(new Gtk::HBox()); - Gtk::Label* const cbdlLabel = Gtk::manage(new Gtk::Label()); - cbdlLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_CBDL")) + Glib::ustring("")); - cbdlLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - cbdlTitleHBox->pack_start(*cbdlLabel, Gtk::PACK_EXPAND_WIDGET, 0); - RTImage *cbdlImage = Gtk::manage(new RTImage("one-to-one-small.png")); - - if (showtooltip) { - cbdlImage->set_tooltip_text(M("TP_GENERAL_11SCALE_TOOLTIP")); - } - - cbdlTitleHBox->pack_end(*cbdlImage, Gtk::PACK_SHRINK, 0); - expcbdl->setLabel(cbdlTitleHBox); - expcbdl->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expcbdl)); - enablecbdlConn = expcbdl->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expcbdl)); - - if (showtooltip) { - expcbdl->set_tooltip_text(M("TP_LOCALLAB_EXPCBDL_TOOLTIP")); - } - - setExpandAlignProperties(expmaskcb, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - expmaskcb->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskcb)); - expmaskcb->setLevel(2); - - for (int i = 0; i < 6; i++) { - Glib::ustring ss; - ss = Glib::ustring::format(i); - - if (i == 0) { - ss += Glib::ustring::compose(" (%1)", M("TP_DIRPYREQUALIZER_LUMAFINEST")); - } else if (i == 5) { - ss += Glib::ustring::compose(" (%1)", M("TP_DIRPYREQUALIZER_LUMACOARSEST")); - } - - multiplier[i] = Gtk::manage(new Adjuster(std::move(ss), 0.0, 4.0, 0.01, 1.0)); - multiplier[i]->setAdjusterListener(this); - } - - if (showtooltip) { - chromacbdl->set_tooltip_text(M("TP_LOCALLAB_CHROMACB_TOOLTIP")); - } - - chromacbdl->setAdjusterListener(this); - - threshold->setAdjusterListener(this); - - if (showtooltip) { - sensicb->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); - } - - sensicb->setAdjusterListener(this); - softradiuscb->setAdjusterListener(this); - clarityml->setAdjusterListener(this); - contresid->setAdjusterListener(this); - blurcbdl->setAdjusterListener(this); - blendmaskcb->setAdjusterListener(this); - radmaskcb->setAdjusterListener(this); - chromaskcb->setAdjusterListener(this); - gammaskcb->setAdjusterListener(this); - slomaskcb->setAdjusterListener(this); - - enacbMaskConn = enacbMask->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::enacbMaskChanged)); - - showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMNONE")); - showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMODIF")); - showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); - showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMASK")); - showmaskcbMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); - - - showmaskcbMethod->set_active(0); - - if (showtooltip) { - showmaskcbMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - - showmaskcbMethodConn = showmaskcbMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::showmaskcbMethodChanged)); - - maskcbCurveEditorG->setCurveListener(this); - - CCmaskcbshape = static_cast(maskcbCurveEditorG->addCurve(CT_Flat, "C(C)", nullptr, false, false)); - CCmaskcbshape->setIdentityValue(0.); - CCmaskcbshape->setResetCurve(FlatCurveType(defSpot.CCmaskcbcurve.at(0)), defSpot.CCmaskcbcurve); - - if (showtooltip) { - CCmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - CCmaskcbshape->setBottomBarColorProvider(this, 7); - - LLmaskcbshape = static_cast(maskcbCurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false)); - LLmaskcbshape->setIdentityValue(0.); - LLmaskcbshape->setResetCurve(FlatCurveType(defSpot.LLmaskcbcurve.at(0)), defSpot.LLmaskcbcurve); - - if (showtooltip) { - LLmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - LLmaskcbshape->setBottomBarBgGradient(mllshape); - - HHmaskcbshape = static_cast(maskcbCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true)); - HHmaskcbshape->setIdentityValue(0.); - HHmaskcbshape->setResetCurve(FlatCurveType(defSpot.HHmaskcbcurve.at(0)), defSpot.HHmaskcbcurve); - - if (showtooltip) { - HHmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - - HHmaskcbshape->setCurveColorProvider(this, 6); - HHmaskcbshape->setBottomBarColorProvider(this, 6); - - maskcbCurveEditorG->curveListComplete(); - - - - ToolParamBlock* const cbdlBox = Gtk::manage(new ToolParamBlock()); - Gtk::HBox* buttonBox = Gtk::manage(new Gtk::HBox(true, 10)); - buttonBox->pack_start(*lumacontrastMinusButton); - lumacontrastMinusPressedConn = lumacontrastMinusButton->signal_pressed().connect(sigc::mem_fun(*this, &Locallab::lumacontrastMinusPressed)); - buttonBox->pack_start(*lumaneutralButton); - lumaneutralPressedConn = lumaneutralButton->signal_pressed().connect(sigc::mem_fun(*this, &Locallab::lumaneutralPressed)); - buttonBox->pack_start(*lumacontrastPlusButton); - lumacontrastPlusPressedConn = lumacontrastPlusButton->signal_pressed().connect(sigc::mem_fun(*this, &Locallab::lumacontrastPlusPressed)); - cbdlBox->pack_start(*buttonBox); - - for (int i = 0; i < 6; i++) { - cbdlBox->pack_start(*multiplier[i]); - } - - ToolParamBlock* const maskcbBox = Gtk::manage(new ToolParamBlock()); - maskcbBox->pack_start(*showmaskcbMethod, Gtk::PACK_SHRINK, 4); - maskcbBox->pack_start(*enacbMask, Gtk::PACK_SHRINK, 0); - maskcbBox->pack_start(*maskcbCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - maskcbBox->pack_start(*blendmaskcb, Gtk::PACK_SHRINK, 0); - maskcbBox->pack_start(*radmaskcb, Gtk::PACK_SHRINK, 0); - maskcbBox->pack_start(*chromaskcb, Gtk::PACK_SHRINK, 0); - maskcbBox->pack_start(*gammaskcb, Gtk::PACK_SHRINK, 0); - maskcbBox->pack_start(*slomaskcb, Gtk::PACK_SHRINK, 0); - expmaskcb->add(*maskcbBox, false); - - Gtk::HSeparator *separator = Gtk::manage(new Gtk::HSeparator()); - cbdlBox->pack_start(*separator, Gtk::PACK_SHRINK, 2); - cbdlBox->pack_start(*chromacbdl); - cbdlBox->pack_start(*threshold); - cbdlBox->pack_start(*blurcbdl); - residFrame->set_label_align(0.025, 0.5); - ToolParamBlock* const residBox = Gtk::manage(new ToolParamBlock()); - residBox->pack_start(*clarityml); - residBox->pack_start(*contresid); - residFrame->add(*residBox); - cbdlBox->pack_start(*residFrame); - cbdlBox->pack_start(*softradiuscb); - cbdlBox->pack_start(*sensicb); - cbdlBox->pack_start(*expmaskcb); - expcbdl->add(*cbdlBox, false); - expcbdl->setLevel(2); - - panel->pack_start(*expcbdl, false, false); - - // Denoise - Gtk::HBox* const denoiTitleHBox = Gtk::manage(new Gtk::HBox()); - Gtk::Label* const denoiLabel = Gtk::manage(new Gtk::Label()); - denoiLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_DENOIS")) + Glib::ustring("")); - denoiLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - denoiTitleHBox->pack_start(*denoiLabel, Gtk::PACK_EXPAND_WIDGET, 0); - RTImage *denoiImage = Gtk::manage(new RTImage("one-to-one-small.png")); - - if (showtooltip) { - denoiImage->set_tooltip_text(M("TP_GENERAL_11SCALE_TOOLTIP")); - } - - denoiTitleHBox->pack_end(*denoiImage, Gtk::PACK_SHRINK, 0); - expdenoi->setLabel(denoiTitleHBox); - expdenoi->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expdenoi)); - enabledenoiConn = expdenoi->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expdenoi)); - - noiselumf->setAdjusterListener(this); - noiselumf0->setAdjusterListener(this); - noiselumf2->setAdjusterListener(this); - - if (showtooltip) { - noiselumc->set_tooltip_text(M("TP_LOCALLAB_NOISECHROC_TOOLTIP")); - } - - noiselumc->setAdjusterListener(this); - - noiselumdetail->setAdjusterListener(this); - - noiselequal->setAdjusterListener(this); - - noisechrof->setAdjusterListener(this); - - if (showtooltip) { - noisechroc->set_tooltip_text(M("TP_LOCALLAB_NOISECHROC_TOOLTIP")); - } - - noisechroc->setAdjusterListener(this); - - noisechrodetail->setAdjusterListener(this); - - adjblur->setAdjusterListener(this); - - bilateral->setAdjusterListener(this); - - sensiden->setAdjusterListener(this); - - ToolParamBlock* const denoisBox = Gtk::manage(new ToolParamBlock()); - Gtk::Frame* const wavFrame = Gtk::manage(new Gtk::Frame()); - ToolParamBlock* const wavBox = Gtk::manage(new ToolParamBlock()); - wavBox->pack_start(*noiselumf0); - wavBox->pack_start(*noiselumf); - wavBox->pack_start(*noiselumf2); - wavBox->pack_start(*noiselumc); - wavBox->pack_start(*noiselumdetail); - wavBox->pack_start(*noiselequal); - wavBox->pack_start(*noisechrof); - wavBox->pack_start(*noisechroc); - // wavBox->pack_start(*noisechrodetail); // Uncomment this line to use the noisechrodetail adjuster - wavBox->pack_start(*adjblur); - wavFrame->add(*wavBox); - denoisBox->pack_start(*wavFrame); - denoisBox->pack_start(*bilateral); - denoisBox->pack_start(*sensiden); - expdenoi->add(*denoisBox, false); - expdenoi->setLevel(2); - - panel->pack_start(*expdenoi, false, false); - + // Create Locallab tools + expcolor = Gtk::manage(new LocallabColor()); + expexpose = Gtk::manage(new LocallabExposure()); + expshadhigh = Gtk::manage(new LocallabShadow()); + expvibrance = Gtk::manage(new LocallabVibrance()); + expsoft = Gtk::manage(new LocallabSoft()); + expblur = Gtk::manage(new LocallabBlur()); + exptonemap = Gtk::manage(new LocallabTone()); + expreti = Gtk::manage(new LocallabRetinex()); + expsharp = Gtk::manage(new LocallabSharp()); + expcontrast = Gtk::manage(new LocallabContrast()); + expcbdl = Gtk::manage(new LocallabCBDL()); + expdenoi = Gtk::manage(new LocallabDenoise()); + + // Add Locallab tools to panel widget + addTool(panel, expcolor); + addTool(panel, expexpose); + addTool(panel, expshadhigh); + addTool(panel, expvibrance); + addTool(panel, expsoft); + addTool(panel, expblur); + addTool(panel, exptonemap); + addTool(panel, expreti); + addTool(panel, expsharp); + addTool(panel, expcontrast); + addTool(panel, expcbdl); + addTool(panel, expdenoi); + + // Add panel widget to Locallab GUI pack_start(*panel); - setParamEditable(false); - + // Show all widgets show_all(); -} -Locallab::~Locallab() -{ - idle_register.destroy(); - - delete llCurveEditorG; - delete HCurveEditorG; - delete maskCurveEditorG; - delete curveEditorG; - delete maskexpCurveEditorG; - delete maskSHCurveEditorG; - delete curveEditorGG; - delete LocalcurveEditorgainT; - delete LocalcurveEditorwav; - delete masktmCurveEditorG; - delete maskretiCurveEditorG; - delete maskcbCurveEditorG; -} -void Locallab::foldAllButMe(GdkEventButton* event, MyExpander *expander) -{ - if (event->button == 3) { - expsettings->setExpanded(expsettings->getExpander() == expander); - expcolor->set_expanded(expcolor == expander); - expexpose->set_expanded(expexpose == expander); - expshadhigh->set_expanded(expshadhigh == expander); - expvibrance->set_expanded(expvibrance == expander); - expsoft->set_expanded(expsoft == expander); - expblur->set_expanded(expblur == expander); - exptonemap->set_expanded(exptonemap == expander); - expreti->set_expanded(expreti == expander); - expsharp->set_expanded(expsharp == expander); - expcontrast->set_expanded(expcontrast == expander); - expcbdl->set_expanded(expcbdl == expander); - expdenoi->set_expanded(expdenoi == expander); - expmaskcol->set_expanded(expmaskcol == expander); - expmaskexp->set_expanded(expmaskexp == expander); - expmasksh->set_expanded(expmasksh == expander); - expmaskcb->set_expanded(expmaskcb == expander); - expmaskreti->set_expanded(expmaskreti == expander); - expmasktm->set_expanded(expmasktm == expander); - - } -} - -void Locallab::enableToggled(MyExpander *expander) -{ - // printf("enableToggled\n"); - - rtengine::ProcEvent event; - sigc::connection* expConn; - - if (expander == expcolor) { - event = EvLocenacolor; - expConn = &enablecolorConn; - } else if (expander == expexpose) { - event = EvLocenaexpose; - expConn = &enableexposeConn; - } else if (expander == expshadhigh) { - event = EvLocenashadhigh; - expConn = &enableshadhighConn; - } else if (expander == expvibrance) { - event = EvLocenavibrance; - expConn = &enablevibranceConn; - } else if (expander == expsoft) { - event = EvLocenasoft; - expConn = &enablesoftConn; - } else if (expander == expblur) { - event = EvLocenablur; - expConn = &enableblurConn; - } else if (expander == exptonemap) { - event = EvLocenatonemap; - expConn = &enabletonemapConn; - } else if (expander == expreti) { - event = EvLocenareti; - expConn = &enableretiConn; - } else if (expander == expsharp) { - event = EvLocenasharp; - expConn = &enablesharpConn; - } else if (expander == expcontrast) { - event = EvLocenacontrast; - expConn = &enablecontrastConn; - } else if (expander == expcbdl) { - event = EvLocenacbdl; - expConn = &enablecbdlConn; - } else if (expander == expdenoi) { - event = EvLocenadenoi; - expConn = &enabledenoiConn; - } else { - return; - } - - if (multiImage) { - if (expander->get_inconsistent()) { - expander->set_inconsistent(false); - expConn->block(true); - expander->setEnabled(false); - expConn->block(false); - } - } - - if (getEnabled()) { - if (listener) { - if (expander->getEnabled()) { - listener->panelChanged(event, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(event, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::writeOptions(std::vector &tpOpen) -{ - tpOpen.push_back(expsettings->getExpanded()); - tpOpen.push_back(expcolor->get_expanded()); - tpOpen.push_back(expexpose->get_expanded()); - tpOpen.push_back(expshadhigh->get_expanded()); - tpOpen.push_back(expvibrance->get_expanded()); - tpOpen.push_back(expsoft->get_expanded()); - tpOpen.push_back(expblur->get_expanded()); - tpOpen.push_back(exptonemap->get_expanded()); - tpOpen.push_back(expreti->get_expanded()); - tpOpen.push_back(expsharp->get_expanded()); - tpOpen.push_back(expcontrast->get_expanded()); - tpOpen.push_back(expcbdl->get_expanded()); - tpOpen.push_back(expdenoi->get_expanded()); - tpOpen.push_back(expmaskcol->get_expanded()); - tpOpen.push_back(expmaskexp->get_expanded()); - tpOpen.push_back(expmasksh->get_expanded()); - tpOpen.push_back(expmaskcb->get_expanded()); - tpOpen.push_back(expmaskreti->get_expanded()); - tpOpen.push_back(expmasktm->get_expanded()); - -} - -void Locallab::refChanged(double huer, double lumar, double chromar) -{ - if (!batchMode) { - // Hue reference normalization (between 0 and 1) - double normHuer = huer; - float h = Color::huelab_to_huehsv2(normHuer); - h += 1.f / 6.f; - - if (h > 1.f) { - h -= 1.f; - } - - normHuer = h; - - // Luma reference normalization (between 0 and 1) - double normLumar = lumar / 100.f; - - // Chroma reference normalization (between 0 and 1) - double normChromar = chromar / 137.4f; - - // printf("nh=%f nl=%f nc=%f\n", normHuer, normLumar, normChromar); - - idle_register.add( - [this, normHuer, normLumar, normChromar]() -> bool { - GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected - - // Update Color & Light mask background - CCmaskshape->updateLocallabBackground(normChromar); - LLmaskshape->updateLocallabBackground(normLumar); - HHmaskshape->updateLocallabBackground(normHuer); - - // Update Exposure mask background - CCmaskexpshape->updateLocallabBackground(normChromar); - LLmaskexpshape->updateLocallabBackground(normLumar); - HHmaskexpshape->updateLocallabBackground(normHuer); - - // Update Shadow Highlight mask background - CCmaskSHshape->updateLocallabBackground(normChromar); - LLmaskSHshape->updateLocallabBackground(normLumar); - HHmaskSHshape->updateLocallabBackground(normHuer); - - // Update CBDL mask background - CCmaskcbshape->updateLocallabBackground(normChromar); - LLmaskcbshape->updateLocallabBackground(normLumar); - HHmaskcbshape->updateLocallabBackground(normHuer); - - // Update TM mask background - CCmasktmshape->updateLocallabBackground(normChromar); - LLmasktmshape->updateLocallabBackground(normLumar); - HHmasktmshape->updateLocallabBackground(normHuer); - - // Update Retinex mask background - CCmaskretishape->updateLocallabBackground(normChromar); - LLmaskretishape->updateLocallabBackground(normLumar); - HHmaskretishape->updateLocallabBackground(normHuer); - - return false; - } - ); - } -} - -void Locallab::updateToolState(std::vector &tpOpen) -{ - if (tpOpen.size() >= 20) { - expsettings->setExpanded(tpOpen.at(0)); - expcolor->set_expanded(tpOpen.at(1)); - expexpose->set_expanded(tpOpen.at(2)); - expshadhigh->set_expanded(tpOpen.at(3)); - expvibrance->set_expanded(tpOpen.at(4)); - expsoft->set_expanded(tpOpen.at(5)); - expblur->set_expanded(tpOpen.at(6)); - exptonemap->set_expanded(tpOpen.at(7)); - expreti->set_expanded(tpOpen.at(8)); - expsharp->set_expanded(tpOpen.at(9)); - expcontrast->set_expanded(tpOpen.at(10)); - expcbdl->set_expanded(tpOpen.at(11)); - expdenoi->set_expanded(tpOpen.at(12)); - expmaskcol->set_expanded(tpOpen.at(13)); - expmaskexp->set_expanded(tpOpen.at(14)); - expmasksh->set_expanded(tpOpen.at(15)); - expmaskcb->set_expanded(tpOpen.at(16)); - expmaskreti->set_expanded(tpOpen.at(17)); - expmasktm->set_expanded(tpOpen.at(18)); - } -} - -void Locallab::lumaneutralPressed() -{ - // printf("lumaneutralPressed\n"); - - for (int i = 0; i < 6; i++) { - multiplier[i]->setValue(1.0); - } - - // Raise event (only for first multiplier because associated event concerns all multipliers) - adjusterChanged(multiplier[0], multiplier[0]->getValue()); // Value isn't used -} - -void Locallab::lumacontrastPlusPressed() -{ - // printf("lumacontrastPlusPressed\n"); - - for (int i = 0; i < 6; i++) { - float inc = (5 - i); - multiplier[i]->setValue(multiplier[i]->getValue() + 0.01f * inc); - } - - // Raise event (only for first multiplier because associated event concerns all multipliers) - adjusterChanged(multiplier[0], multiplier[0]->getValue()); // Value isn't used -} - -void Locallab::lumacontrastMinusPressed() -{ - // printf("lumacontrastMinusPressed\n"); - - for (int i = 0; i < 6; i++) { - float inc = - (5 - i); - multiplier[i]->setValue(multiplier[i]->getValue() + 0.01f * inc); - } - - // Raise event (only for first multiplier because associated event concerns all multipliers) - adjusterChanged(multiplier[0], multiplier[0]->getValue()); // Value isn't used + // By default, if no photo is loaded, all Locallab tools are removed and it's not possible to add them + // (to be necessary called after "show_all" function) + setParamEditable(false); } void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) @@ -2002,12 +90,15 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) // Disable all listeners disableListener(); + // Update Locallab activation state setEnabled(pp->locallab.enabled); - if (pedited) { - set_inconsistent(multiImage && !pedited->locallab.enabled); + // Transmit Locallab activation state to Locallab tools + for (auto tool : locallabTools) { + tool->isLocallabActivated(exp->getEnabled()); } + // TODO Manage it with read function in controlspotpanel.cc // Delete all existent spots std::vector* const list = expsettings->getSpotIdList(); @@ -2015,6 +106,7 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) expsettings->deleteControlSpot(list->at(i)); } + // TODO Manage it with read function in controlspotpanel.cc // Add existent spots based on pp ControlSpotPanel::SpotRow* const r = new ControlSpotPanel::SpotRow(); @@ -2079,19 +171,14 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) expsettings->setSelectedSpot(pp->locallab.spots.at(pp->locallab.selspot).id); } - // Update Locallab tools GUI - updateLocallabGUI(pp, pedited, pp->locallab.selspot); - updateSpecificGUIState(); + // Update each Locallab tools GUI + for (auto tool : locallabTools) { + tool->read(pp, pedited); + } + // Specific case: if there is no spot, GUI isn't anymore editable (i.e. Locallab tool cannot be managed) if (pp->locallab.nbspot > 0) { setParamEditable(true); - - // Locallab params are not editable if nbspot, selspot or id are not coherent (batch mode) - if (pedited) { - if (!pedited->locallab.nbspot || !pedited->locallab.selspot || !pedited->locallab.id) { - setParamEditable(false); - } - } } else { setParamEditable(false); } @@ -2099,18 +186,22 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) // Enable all listeners enableListener(); - // Update default values according to selected spot - if (pp->locallab.nbspot > 0 && pp->locallab.selspot < (int)pp->locallab.spots.size()) { - setDefaults(defparams, defpedited, pp->locallab.spots.at(pp->locallab.selspot).id); - } + // Open/re-open all Locallab tools expanders + openAllTools(); + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void Locallab::write(ProcParams* pp, ParamsEdited* pedited) { - // printf("Locallab write\n"); - + // Update Locallab activation state pp->locallab.enabled = getEnabled(); + // Transmit Locallab activation state to Locallab tools (in case of updated) + for (auto tool : locallabTools) { + tool->isLocallabActivated(exp->getEnabled()); + } + const int spotPanelEvent = expsettings->getEventType(); int spotId; ControlSpotPanel::SpotRow* r; @@ -2210,12 +301,10 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) // Update Locallab tools GUI with new created spot disableListener(); - if (pe) { - pe->locallab.spots.push_back(new LocallabParamsEdited::LocallabSpotEdited(true)); + for (auto tool : locallabTools) { + tool->read(pp, pedited); } - updateLocallabGUI(pp, pe, pp->locallab.selspot); - enableListener(); if (pp->locallab.nbspot == 1) { @@ -2223,15 +312,12 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) } // Update default values according to selected spot - setDefaults(defparams, defpedited, spotId); + setDefaults(pp, pedited); - // ParamsEdited update - if (pedited) { - pedited->locallab.nbspot = true; - pedited->locallab.selspot = true; - pedited->locallab.id = true; - pedited->locallab.spots.push_back(new LocallabParamsEdited::LocallabSpotEdited(true)); - } + // Open/re-open all Locallab tools expanders + openAllTools(); + + // Note: No need to manage pedited as batch mode is deactivated for Locallab break; @@ -2263,14 +349,10 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) // Update Locallab tools GUI with selected spot disableListener(); - if (pe) { - if (i < (int)pe->locallab.spots.size()) { - pe->locallab.spots.erase(pe->locallab.spots.begin() + i); - } + for (auto tool : locallabTools) { + tool->read(pp, pedited); } - updateLocallabGUI(pp, pe, pp->locallab.selspot); - enableListener(); if (pp->locallab.nbspot == 0) { @@ -2278,20 +360,12 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) } // Update default values according to selected spot - if (pp->locallab.nbspot > 0) { - setDefaults(defparams, defpedited, pp->locallab.spots.at(pp->locallab.selspot).id); - } + setDefaults(pp, pedited); - // ParamsEdited update - if (pedited) { - pedited->locallab.nbspot = true; - pedited->locallab.selspot = true; - pedited->locallab.id = true; + // Open/re-open all Locallab tools expanders + openAllTools(); - if (i < (int)pedited->locallab.spots.size()) { - pedited->locallab.spots.erase(pedited->locallab.spots.begin() + i); - } - } + // Note: No need to manage pedited as batch mode is deactivated for Locallab break; } @@ -2312,16 +386,20 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) // Update control spots and Locallab tools GUI with selected spot expsettings->setSelectedSpot(spotId); disableListener(); - updateLocallabGUI(pp, pe, pp->locallab.selspot); + + for (auto tool : locallabTools) { + tool->read(pp, pedited); + } + enableListener(); // Update default values according to selected spot - setDefaults(defparams, defpedited, spotId); + setDefaults(pp, pedited); - // ParamsEdited update - if (pedited) { - pedited->locallab.selspot = true; - } + // Open/re-open all Locallab tools expanders + openAllTools(); + + // Note: No need to manage pedited as batch mode is deactivated for Locallab break; @@ -2426,24 +504,19 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) // Update Locallab tools GUI with new created spot disableListener(); - if (pe) { - pe->locallab.spots.push_back(new LocallabParamsEdited::LocallabSpotEdited(true)); + for (auto tool : locallabTools) { + tool->read(pp, pedited); } - updateLocallabGUI(pp, pe, pp->locallab.selspot); - enableListener(); // Update default values according to selected spot - setDefaults(defparams, defpedited, spotId); + setDefaults(pp, pedited); - // ParamsEdited update - if (pedited) { - pedited->locallab.nbspot = true; - pedited->locallab.selspot = true; - pedited->locallab.id = true; - pedited->locallab.spots.push_back(new LocallabParamsEdited::LocallabSpotEdited(true)); - } + // Open/re-open all Locallab tools expanders + openAllTools(); + + // Note: No need to manage pedited as batch mode is deactivated for Locallab break; @@ -2455,18 +528,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(i).isvisible = r->isvisible; } - if (pe) { - for (size_t i = 0; i < pe->locallab.spots.size(); i++) { - pe->locallab.spots.at(i).isvisible = true; - } - } - - // ParamsEdited update - if (pedited) { - for (size_t i = 0; i < pedited->locallab.spots.size(); i++) { - pedited->locallab.spots.at(i).isvisible = true; - } - } + // Note: No need to manage pedited as batch mode is deactivated for Locallab break; @@ -2527,1296 +589,65 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).transitweak = r->transitweak; pp->locallab.spots.at(pp->locallab.selspot).transitgrad = r->transitgrad; pp->locallab.spots.at(pp->locallab.selspot).avoid = r->avoid; - // Color & Light - pp->locallab.spots.at(pp->locallab.selspot).expcolor = expcolor->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).curvactiv = curvactiv->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).lightness = lightness->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).contrast = contrast->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).chroma = chroma->getIntValue(); - labgrid->getParams(pp->locallab.spots.at(pp->locallab.selspot).labgridALow, pp->locallab.spots.at(pp->locallab.selspot).labgridBLow, pp->locallab.spots.at(pp->locallab.selspot).labgridAHigh, pp->locallab.spots.at(pp->locallab.selspot).labgridBHigh); - pp->locallab.spots.at(pp->locallab.selspot).strengthgrid = strengthgrid->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).labgridALow *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(pp->locallab.selspot).labgridAHigh *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(pp->locallab.selspot).labgridBLow *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(pp->locallab.selspot).labgridBHigh *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(pp->locallab.selspot).sensi = sensi->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).structcol = structcol->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).blurcolde = blurcolde->getIntValue(); - - if (qualitycurveMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = "none"; - } else if (qualitycurveMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = "std"; - } - - if (gridMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(pp->locallab.selspot).gridMethod = "one"; - } else if (gridMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(pp->locallab.selspot).gridMethod = "two"; - } - - pp->locallab.spots.at(pp->locallab.selspot).llcurve = llshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).cccurve = ccshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).LHcurve = LHshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).HHcurve = HHshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).invers = invers->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).enaColorMask = enaColorMask->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).CCmaskcurve = CCmaskshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).LLmaskcurve = LLmaskshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).HHmaskcurve = HHmaskshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).blendmaskcol = blendmaskcol->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).radmaskcol = radmaskcol->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).chromaskcol = chromaskcol->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).gammaskcol = gammaskcol->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).slomaskcol = slomaskcol->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).softradiuscol = softradiuscol->getValue(); - // Exposure - pp->locallab.spots.at(pp->locallab.selspot).expexpose = expexpose->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).expcomp = expcomp->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).hlcompr = hlcompr->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).hlcomprthresh = hlcomprthresh->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).black = black->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).shadex = shadex->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).shcompr = shcompr->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).expchroma = expchroma->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).warm = warm->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).sensiex = sensiex->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).structexp = structexp->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).blurexpde = blurexpde->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).excurve = shapeexpos->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).inversex = inversex->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).enaExpMask = enaExpMask->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = LLmaskexpshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = CCmaskexpshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve = HHmaskexpshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).blendmaskexp = blendmaskexp->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).radmaskexp = radmaskexp->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).chromaskexp = chromaskexp->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).gammaskexp = gammaskexp->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).slomaskexp = slomaskexp->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).softradiusexp = softradiusexp->getValue(); - - if (expMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(pp->locallab.selspot).expMethod = "std"; - } else if (expMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(pp->locallab.selspot).expMethod = "pde"; - } - - pp->locallab.spots.at(pp->locallab.selspot).laplacexp = laplacexp->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).balanexp = balanexp->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).linear = linear->getValue(); - - // Shadow highlight - pp->locallab.spots.at(pp->locallab.selspot).expshadhigh = expshadhigh->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).highlights = highlights->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).h_tonalwidth = h_tonalwidth->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).shadows = shadows->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).s_tonalwidth = s_tonalwidth->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).sh_radius = sh_radius->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).sensihs = sensihs->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).enaSHMask = enaSHMask->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).LLmaskSHcurve = LLmaskSHshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).CCmaskSHcurve = CCmaskSHshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).HHmaskSHcurve = HHmaskSHshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).blendmaskSH = blendmaskSH->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).radmaskSH = radmaskSH->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).blurSHde = blurSHde->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).inverssh = inverssh->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).chromaskSH = chromaskSH->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).gammaskSH = gammaskSH->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).slomaskSH = slomaskSH->getValue(); - // Vibrance - pp->locallab.spots.at(pp->locallab.selspot).expvibrance = expvibrance->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).saturated = saturated->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).pastels = pastels->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).psthreshold = psThreshold->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).protectskins = protectSkins->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).avoidcolorshift = avoidColorShift->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).pastsattog = pastSatTog->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).sensiv = sensiv->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).skintonescurve = skinTonesCurve->getCurve(); - // Soft Light - pp->locallab.spots.at(pp->locallab.selspot).expsoft = expsoft->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).streng = streng->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).sensisf = sensisf->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).laplace = laplace->getValue(); - - if (softMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(pp->locallab.selspot).softMethod = "soft"; - } else if (softMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(pp->locallab.selspot).softMethod = "reti"; - } - - // Blur & Noise - pp->locallab.spots.at(pp->locallab.selspot).expblur = expblur->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).radius = radius->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).strength = strength->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).sensibn = sensibn->getIntValue(); - - - if (blurMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(pp->locallab.selspot).blurMethod = "norm"; - } else if (blurMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(pp->locallab.selspot).blurMethod = "inv"; - } - - pp->locallab.spots.at(pp->locallab.selspot).activlum = activlum->get_active(); - // Tone Mapping - pp->locallab.spots.at(pp->locallab.selspot).exptonemap = exptonemap->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).stren = stren->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).gamma = gamma->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).estop = estop->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).scaltm = scaltm->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).rewei = rewei->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).satur = satur->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).sensitm = sensitm->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).softradiustm = softradiustm->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).amount = amount->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).equiltm = equiltm->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).LLmasktmcurve = LLmasktmshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).CCmasktmcurve = CCmasktmshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).HHmasktmcurve = HHmasktmshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).enatmMask = enatmMask->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).blendmasktm = blendmasktm->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).radmasktm = radmasktm->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).chromasktm = chromasktm->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).gammasktm = gammasktm->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).slomasktm = slomasktm->getValue(); - // Retinex - pp->locallab.spots.at(pp->locallab.selspot).expreti = expreti->getEnabled(); - - if (retinexMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(pp->locallab.selspot).retinexMethod = "low"; - } else if (retinexMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(pp->locallab.selspot).retinexMethod = "uni"; - } else if (retinexMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(pp->locallab.selspot).retinexMethod = "high"; - } - - pp->locallab.spots.at(pp->locallab.selspot).str = str->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).chrrt = chrrt->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).neigh = neigh->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).vart = vart->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).dehaz = dehaz->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).sensih = sensih->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).localTgaincurve = cTgainshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).inversret = inversret->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).softradiusret = softradiusret->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).equilret = equilret->get_active(); - - pp->locallab.spots.at(pp->locallab.selspot).LLmaskreticurve = LLmaskretishape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).CCmaskreticurve = CCmaskretishape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).HHmaskreticurve = HHmaskretishape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).enaretiMask = enaretiMask->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).enaretiMasktmap = enaretiMasktmap->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).blendmaskreti = blendmaskreti->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).radmaskreti = radmaskreti->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).chromaskreti = chromaskreti->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).gammaskreti = gammaskreti->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).slomaskreti = slomaskreti->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).scalereti = scalereti->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).darkness = darkness->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).lightnessreti = lightnessreti->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).limd = limd->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).fftwreti = fftwreti->get_active(); - // Sharpening - pp->locallab.spots.at(pp->locallab.selspot).expsharp = expsharp->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).sharcontrast = sharcontrast->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).sharradius = sharradius->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).sharamount = sharamount->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).shardamping = shardamping->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).shariter = shariter->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).sharblur = sharblur->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).sensisha = sensisha->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).inverssha = inverssha->get_active(); - // Local Contrast - pp->locallab.spots.at(pp->locallab.selspot).expcontrast = expcontrast->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).lcradius = lcradius->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).lcamount = lcamount->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).lcdarkness = lcdarkness->getValue(); - 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).sensilc = sensilc->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).fftwlc = fftwlc->get_active(); - pp->locallab.spots.at(pp->locallab.selspot).locwavcurve = wavshape->getCurve(); - - if (localcontMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(pp->locallab.selspot).localcontMethod = "loc"; - } else if (localcontMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(pp->locallab.selspot).localcontMethod = "wav"; - } - - // Contrast by detail levels - pp->locallab.spots.at(pp->locallab.selspot).expcbdl = expcbdl->getEnabled(); - - for (int i = 0; i < 6; i++) { - pp->locallab.spots.at(pp->locallab.selspot).mult[i] = multiplier[i]->getValue(); - } - - pp->locallab.spots.at(pp->locallab.selspot).chromacbdl = chromacbdl->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).threshold = threshold->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).sensicb = sensicb->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).clarityml = clarityml->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).contresid = contresid->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).blurcbdl = blurcbdl->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).softradiuscb = softradiuscb->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).enacbMask = enacbMask->get_active(); - - pp->locallab.spots.at(pp->locallab.selspot).LLmaskcbcurve = LLmaskcbshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).CCmaskcbcurve = CCmaskcbshape->getCurve(); - pp->locallab.spots.at(pp->locallab.selspot).HHmaskcbcurve = HHmaskcbshape->getCurve(); - - pp->locallab.spots.at(pp->locallab.selspot).blendmaskcb = blendmaskcb->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).radmaskcb = radmaskcb->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).chromaskcb = chromaskcb->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).gammaskcb = gammaskcb->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).slomaskcb = slomaskcb->getValue(); - - // Denoise - pp->locallab.spots.at(pp->locallab.selspot).expdenoi = expdenoi->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).noiselumf = noiselumf->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).noiselumf0 = noiselumf0->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).noiselumf2 = noiselumf2->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).noiselumc = noiselumc->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).noiselumdetail = noiselumdetail->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).noiselequal = noiselequal->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).noisechrof = noisechrof->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).noisechroc = noisechroc->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).noisechrodetail = noisechrodetail->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).adjblur = adjblur->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).bilateral = bilateral->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).sensiden = sensiden->getIntValue(); } - ControlSpotPanel::SpotEdited* const se = expsettings->getEditedStates(); - - if (pe) { - if (pp->locallab.selspot < (int)pe->locallab.spots.size()) { - pe->locallab.spots.at(pp->locallab.selspot).name = pe->locallab.spots.at(pp->locallab.selspot).name || se->name; - pe->locallab.spots.at(pp->locallab.selspot).isvisible = pe->locallab.spots.at(pp->locallab.selspot).isvisible || se->isvisible; - pe->locallab.spots.at(pp->locallab.selspot).shape = pe->locallab.spots.at(pp->locallab.selspot).shape || se->shape; - pe->locallab.spots.at(pp->locallab.selspot).spotMethod = pe->locallab.spots.at(pp->locallab.selspot).spotMethod || se->spotMethod; - pe->locallab.spots.at(pp->locallab.selspot).sensiexclu = pe->locallab.spots.at(pp->locallab.selspot).sensiexclu || se->sensiexclu; - pe->locallab.spots.at(pp->locallab.selspot).structexclu = pe->locallab.spots.at(pp->locallab.selspot).structexclu || se->structexclu; - pe->locallab.spots.at(pp->locallab.selspot).struc = pe->locallab.spots.at(pp->locallab.selspot).struc || se->struc; - pe->locallab.spots.at(pp->locallab.selspot).shapeMethod = pe->locallab.spots.at(pp->locallab.selspot).shapeMethod || se->shapeMethod; - pe->locallab.spots.at(pp->locallab.selspot).locX = pe->locallab.spots.at(pp->locallab.selspot).locX || se->locX; - pe->locallab.spots.at(pp->locallab.selspot).locXL = pe->locallab.spots.at(pp->locallab.selspot).locXL || se->locXL; - pe->locallab.spots.at(pp->locallab.selspot).locY = pe->locallab.spots.at(pp->locallab.selspot).locY || se->locY; - pe->locallab.spots.at(pp->locallab.selspot).locYT = pe->locallab.spots.at(pp->locallab.selspot).locYT || se->locYT; - pe->locallab.spots.at(pp->locallab.selspot).centerX = pe->locallab.spots.at(pp->locallab.selspot).centerX || se->centerX; - pe->locallab.spots.at(pp->locallab.selspot).centerY = pe->locallab.spots.at(pp->locallab.selspot).centerY || se->centerY; - pe->locallab.spots.at(pp->locallab.selspot).circrad = pe->locallab.spots.at(pp->locallab.selspot).circrad || se->circrad; - pe->locallab.spots.at(pp->locallab.selspot).qualityMethod = pe->locallab.spots.at(pp->locallab.selspot).qualityMethod || se->qualityMethod; - pe->locallab.spots.at(pp->locallab.selspot).transit = pe->locallab.spots.at(pp->locallab.selspot).transit || se->transit; - pe->locallab.spots.at(pp->locallab.selspot).thresh = pe->locallab.spots.at(pp->locallab.selspot).thresh || se->thresh; - pe->locallab.spots.at(pp->locallab.selspot).iter = pe->locallab.spots.at(pp->locallab.selspot).iter || se->iter; - pe->locallab.spots.at(pp->locallab.selspot).transitweak = pe->locallab.spots.at(pp->locallab.selspot).transitweak || se->transitweak; - pe->locallab.spots.at(pp->locallab.selspot).transitgrad = pe->locallab.spots.at(pp->locallab.selspot).transitgrad || se->transitgrad; - pe->locallab.spots.at(pp->locallab.selspot).balan = pe->locallab.spots.at(pp->locallab.selspot).balan || se->balan; - pe->locallab.spots.at(pp->locallab.selspot).avoid = pe->locallab.spots.at(pp->locallab.selspot).avoid || se->avoid; - // Color & Light - pe->locallab.spots.at(pp->locallab.selspot).expcolor = pe->locallab.spots.at(pp->locallab.selspot).expcolor || !expcolor->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).curvactiv = pe->locallab.spots.at(pp->locallab.selspot).curvactiv || !curvactiv->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).lightness = pe->locallab.spots.at(pp->locallab.selspot).lightness || lightness->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).contrast = pe->locallab.spots.at(pp->locallab.selspot).contrast || contrast->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).labgridALow = pe->locallab.spots.at(pp->locallab.selspot).labgridBLow = pe->locallab.spots.at(pp->locallab.selspot).labgridAHigh = pe->locallab.spots.at(pp->locallab.selspot).labgridBHigh = labgrid->getEdited(); - pe->locallab.spots.at(pp->locallab.selspot).strengthgrid = pe->locallab.spots.at(pp->locallab.selspot).strengthgrid || strengthgrid->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).chroma = pe->locallab.spots.at(pp->locallab.selspot).chroma || chroma->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sensi = pe->locallab.spots.at(pp->locallab.selspot).sensi || sensi->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).structcol = pe->locallab.spots.at(pp->locallab.selspot).structcol || structcol->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = pe->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod || qualitycurveMethod->get_active_text() != M("GENERAL_UNCHANGED"); - pe->locallab.spots.at(pp->locallab.selspot).gridMethod = pe->locallab.spots.at(pp->locallab.selspot).gridMethod || gridMethod->get_active_text() != M("GENERAL_UNCHANGED"); - pe->locallab.spots.at(pp->locallab.selspot).llcurve = pe->locallab.spots.at(pp->locallab.selspot).llcurve || !llshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).cccurve = pe->locallab.spots.at(pp->locallab.selspot).cccurve || !ccshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).LHcurve = pe->locallab.spots.at(pp->locallab.selspot).LHcurve || !LHshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).HHcurve = pe->locallab.spots.at(pp->locallab.selspot).HHcurve || !HHshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).invers = pe->locallab.spots.at(pp->locallab.selspot).invers || !invers->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).enaColorMask = pe->locallab.spots.at(pp->locallab.selspot).enaColorMask || !enaColorMask->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).CCmaskcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskcurve || !CCmaskshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).LLmaskcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskcurve || !LLmaskshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).HHmaskcurve = pe->locallab.spots.at(pp->locallab.selspot).HHmaskcurve || !HHmaskshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).blurcolde = pe->locallab.spots.at(pp->locallab.selspot).blurcolde || blurcolde->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).blendmaskcol = pe->locallab.spots.at(pp->locallab.selspot).blendmaskcol || blendmaskcol->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).radmaskcol = pe->locallab.spots.at(pp->locallab.selspot).radmaskcol || radmaskcol->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).chromaskcol = pe->locallab.spots.at(pp->locallab.selspot).chromaskcol || chromaskcol->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).gammaskcol = pe->locallab.spots.at(pp->locallab.selspot).gammaskcol || gammaskcol->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).slomaskcol = pe->locallab.spots.at(pp->locallab.selspot).slomaskcol || slomaskcol->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).softradiuscol = pe->locallab.spots.at(pp->locallab.selspot).softradiuscol || softradiuscol->getEditedState(); - // Exposure - pe->locallab.spots.at(pp->locallab.selspot).expexpose = pe->locallab.spots.at(pp->locallab.selspot).expexpose || !expexpose->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).expcomp = pe->locallab.spots.at(pp->locallab.selspot).expcomp || expcomp->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).hlcompr = pe->locallab.spots.at(pp->locallab.selspot).hlcompr || hlcompr->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).hlcomprthresh = pe->locallab.spots.at(pp->locallab.selspot).hlcomprthresh || hlcomprthresh->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).black = pe->locallab.spots.at(pp->locallab.selspot).black || black->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).shadex = pe->locallab.spots.at(pp->locallab.selspot).shadex || shadex->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).shcompr = pe->locallab.spots.at(pp->locallab.selspot).shcompr || shcompr->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).expchroma = pe->locallab.spots.at(pp->locallab.selspot).expchroma || expchroma->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).warm = pe->locallab.spots.at(pp->locallab.selspot).warm || warm->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sensiex = pe->locallab.spots.at(pp->locallab.selspot).sensiex || sensiex->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).structexp = pe->locallab.spots.at(pp->locallab.selspot).structexp || structexp->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).blurexpde = pe->locallab.spots.at(pp->locallab.selspot).blurexpde || blurexpde->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).excurve = pe->locallab.spots.at(pp->locallab.selspot).excurve || !shapeexpos->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).inversex = pe->locallab.spots.at(pp->locallab.selspot).inversex || !inversex->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).enaExpMask = pe->locallab.spots.at(pp->locallab.selspot).enaExpMask || !enaExpMask->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve || !CCmaskexpshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve || !LLmaskexpshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve || !HHmaskexpshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).blendmaskexp = pe->locallab.spots.at(pp->locallab.selspot).blendmaskexp || blendmaskexp->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).radmaskexp = pe->locallab.spots.at(pp->locallab.selspot).radmaskexp || radmaskexp->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).chromaskexp = pe->locallab.spots.at(pp->locallab.selspot).chromaskexp || chromaskexp->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).gammaskexp = pe->locallab.spots.at(pp->locallab.selspot).gammaskexp || gammaskexp->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).slomaskexp = pe->locallab.spots.at(pp->locallab.selspot).slomaskexp || slomaskexp->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).softradiusexp = pe->locallab.spots.at(pp->locallab.selspot).softradiusexp || softradiusexp->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).expMethod = pe->locallab.spots.at(pp->locallab.selspot).expMethod || expMethod->get_active_text() != M("GENERAL_UNCHANGED"); - pe->locallab.spots.at(pp->locallab.selspot).laplacexp = pe->locallab.spots.at(pp->locallab.selspot).laplacexp || laplacexp->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).balanexp = pe->locallab.spots.at(pp->locallab.selspot).balanexp || balanexp->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).linear = pe->locallab.spots.at(pp->locallab.selspot).linear || linear->getEditedState(); - // Shadow highlight - pe->locallab.spots.at(pp->locallab.selspot).expshadhigh = pe->locallab.spots.at(pp->locallab.selspot).expshadhigh || !expshadhigh->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).highlights = pe->locallab.spots.at(pp->locallab.selspot).highlights || highlights->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).h_tonalwidth = pe->locallab.spots.at(pp->locallab.selspot).h_tonalwidth || h_tonalwidth->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).shadows = pe->locallab.spots.at(pp->locallab.selspot).shadows || shadows->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).s_tonalwidth = pe->locallab.spots.at(pp->locallab.selspot).s_tonalwidth || s_tonalwidth->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sh_radius = pe->locallab.spots.at(pp->locallab.selspot).sh_radius || sh_radius->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sensihs = pe->locallab.spots.at(pp->locallab.selspot).sensihs || sensihs->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).enaSHMask = pe->locallab.spots.at(pp->locallab.selspot).enaSHMask || !enaSHMask->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).CCmaskSHcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskSHcurve || !CCmaskSHshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).LLmaskSHcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskSHcurve || !LLmaskSHshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).HHmaskSHcurve = pe->locallab.spots.at(pp->locallab.selspot).HHmaskSHcurve || !HHmaskSHshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).blendmaskSH = pe->locallab.spots.at(pp->locallab.selspot).blendmaskSH || blendmaskSH->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).radmaskSH = pe->locallab.spots.at(pp->locallab.selspot).radmaskSH || radmaskSH->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).blurSHde = pe->locallab.spots.at(pp->locallab.selspot).blurSHde || blurSHde->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).inverssh = pe->locallab.spots.at(pp->locallab.selspot).inverssh || !inverssh->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).chromaskSH = pe->locallab.spots.at(pp->locallab.selspot).chromaskSH || chromaskSH->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).gammaskSH = pe->locallab.spots.at(pp->locallab.selspot).gammaskSH || gammaskSH->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).slomaskSH = pe->locallab.spots.at(pp->locallab.selspot).slomaskSH || slomaskSH->getEditedState(); - // Vibrance - pe->locallab.spots.at(pp->locallab.selspot).expvibrance = pe->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).saturated = pe->locallab.spots.at(pp->locallab.selspot).saturated || saturated->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).pastels = pe->locallab.spots.at(pp->locallab.selspot).pastels || pastels->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).psthreshold = pe->locallab.spots.at(pp->locallab.selspot).psthreshold || psThreshold->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).protectskins = pe->locallab.spots.at(pp->locallab.selspot).protectskins || !protectSkins->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).avoidcolorshift = pe->locallab.spots.at(pp->locallab.selspot).avoidcolorshift || !avoidColorShift->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).pastsattog = pe->locallab.spots.at(pp->locallab.selspot).pastsattog || !pastSatTog->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).sensiv = pe->locallab.spots.at(pp->locallab.selspot).sensiv || sensiv->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).skintonescurve = pe->locallab.spots.at(pp->locallab.selspot).skintonescurve || !skinTonesCurve->isUnChanged(); - // Soft Light - pe->locallab.spots.at(pp->locallab.selspot).expsoft = pe->locallab.spots.at(pp->locallab.selspot).expsoft || !expsoft->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).streng = pe->locallab.spots.at(pp->locallab.selspot).streng || streng->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sensisf = pe->locallab.spots.at(pp->locallab.selspot).sensisf || sensisf->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).laplace = pe->locallab.spots.at(pp->locallab.selspot).laplace || laplace->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).softMethod = pe->locallab.spots.at(pp->locallab.selspot).softMethod || softMethod->get_active_text() != M("GENERAL_UNCHANGED"); - // Blur & Noise - pe->locallab.spots.at(pp->locallab.selspot).expblur = pe->locallab.spots.at(pp->locallab.selspot).expblur || !expblur->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).radius = pe->locallab.spots.at(pp->locallab.selspot).radius || radius->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).strength = pe->locallab.spots.at(pp->locallab.selspot).strength || strength->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sensibn = pe->locallab.spots.at(pp->locallab.selspot).sensibn || sensibn->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).blurMethod = pe->locallab.spots.at(pp->locallab.selspot).blurMethod || blurMethod->get_active_text() != M("GENERAL_UNCHANGED"); - pe->locallab.spots.at(pp->locallab.selspot).activlum = pe->locallab.spots.at(pp->locallab.selspot).activlum || !activlum->get_inconsistent(); - // Tone Mapping - pe->locallab.spots.at(pp->locallab.selspot).exptonemap = pe->locallab.spots.at(pp->locallab.selspot).activlum || !exptonemap->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).stren = pe->locallab.spots.at(pp->locallab.selspot).stren || stren->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).gamma = pe->locallab.spots.at(pp->locallab.selspot).gamma || gamma->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).estop = pe->locallab.spots.at(pp->locallab.selspot).estop || estop->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).scaltm = pe->locallab.spots.at(pp->locallab.selspot).scaltm || scaltm->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).rewei = pe->locallab.spots.at(pp->locallab.selspot).rewei || rewei->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).satur = pe->locallab.spots.at(pp->locallab.selspot).satur || satur->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sensitm = pe->locallab.spots.at(pp->locallab.selspot).sensitm || sensitm->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).softradiustm = pe->locallab.spots.at(pp->locallab.selspot).softradiustm || softradiustm->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).amount = pe->locallab.spots.at(pp->locallab.selspot).amount || amount->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).equiltm = pe->locallab.spots.at(pp->locallab.selspot).equiltm || !equiltm->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).CCmasktmcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmasktmcurve || !CCmasktmshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).LLmasktmcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmasktmcurve || !LLmasktmshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).HHmasktmcurve = pe->locallab.spots.at(pp->locallab.selspot).HHmasktmcurve || !HHmasktmshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).enatmMask = pe->locallab.spots.at(pp->locallab.selspot).enatmMask || !enatmMask->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).blendmasktm = pe->locallab.spots.at(pp->locallab.selspot).blendmasktm || blendmasktm->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).radmasktm = pe->locallab.spots.at(pp->locallab.selspot).radmasktm || radmasktm->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).chromasktm = pe->locallab.spots.at(pp->locallab.selspot).chromasktm || chromasktm->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).gammasktm = pe->locallab.spots.at(pp->locallab.selspot).gammasktm || gammasktm->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).slomasktm = pe->locallab.spots.at(pp->locallab.selspot).slomasktm || slomasktm->getEditedState(); - // Retinex - pe->locallab.spots.at(pp->locallab.selspot).expreti = pe->locallab.spots.at(pp->locallab.selspot).expreti || !expreti->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).retinexMethod = pe->locallab.spots.at(pp->locallab.selspot).retinexMethod || retinexMethod->get_active_text() != M("GENERAL_UNCHANGED"); - pe->locallab.spots.at(pp->locallab.selspot).str = pe->locallab.spots.at(pp->locallab.selspot).str || str->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).chrrt = pe->locallab.spots.at(pp->locallab.selspot).chrrt || chrrt->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).neigh = pe->locallab.spots.at(pp->locallab.selspot).neigh || neigh->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).vart = pe->locallab.spots.at(pp->locallab.selspot).vart || vart->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).dehaz = pe->locallab.spots.at(pp->locallab.selspot).dehaz || dehaz->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sensih = pe->locallab.spots.at(pp->locallab.selspot).sensih || sensih->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).localTgaincurve = pe->locallab.spots.at(pp->locallab.selspot).localTgaincurve || !cTgainshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).inversret = pe->locallab.spots.at(pp->locallab.selspot).inversret || !inversret->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).equilret = pe->locallab.spots.at(pp->locallab.selspot).equilret || !equilret->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).softradiusret = pe->locallab.spots.at(pp->locallab.selspot).softradiusret || softradiusret->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).CCmaskreticurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskreticurve || !CCmaskretishape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).LLmaskreticurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskreticurve || !LLmaskretishape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).HHmaskreticurve = pe->locallab.spots.at(pp->locallab.selspot).HHmaskreticurve || !HHmaskretishape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).enaretiMask = pe->locallab.spots.at(pp->locallab.selspot).enaretiMask || !enaretiMask->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).enaretiMasktmap = pe->locallab.spots.at(pp->locallab.selspot).enaretiMasktmap || !enaretiMasktmap->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).blendmaskreti = pe->locallab.spots.at(pp->locallab.selspot).blendmaskreti || blendmaskreti->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).radmaskreti = pe->locallab.spots.at(pp->locallab.selspot).radmaskreti || radmaskreti->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).chromaskreti = pe->locallab.spots.at(pp->locallab.selspot).chromaskreti || chromaskreti->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).gammaskreti = pe->locallab.spots.at(pp->locallab.selspot).gammaskreti || gammaskreti->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).slomaskreti = pe->locallab.spots.at(pp->locallab.selspot).slomaskreti || slomaskreti->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).scalereti = pe->locallab.spots.at(pp->locallab.selspot).scalereti || scalereti->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).darkness = pe->locallab.spots.at(pp->locallab.selspot).darkness || darkness->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).lightnessreti = pe->locallab.spots.at(pp->locallab.selspot).lightnessreti || lightnessreti->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).limd = pe->locallab.spots.at(pp->locallab.selspot).limd || limd->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).fftwreti = pe->locallab.spots.at(pp->locallab.selspot).fftwreti || !fftwreti->get_inconsistent(); - // Sharpening - pe->locallab.spots.at(pp->locallab.selspot).expsharp = pe->locallab.spots.at(pp->locallab.selspot).expsharp || !expsharp->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).sharcontrast = pe->locallab.spots.at(pp->locallab.selspot).sharcontrast || sharcontrast->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sharradius = pe->locallab.spots.at(pp->locallab.selspot).sharradius || sharradius->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sharamount = pe->locallab.spots.at(pp->locallab.selspot).sharamount || sharamount->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).shardamping = pe->locallab.spots.at(pp->locallab.selspot).shardamping || shardamping->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).shariter = pe->locallab.spots.at(pp->locallab.selspot).shariter || shariter->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sharblur = pe->locallab.spots.at(pp->locallab.selspot).sharblur || sharblur->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sensisha = pe->locallab.spots.at(pp->locallab.selspot).sensisha || sensisha->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).inverssha = pe->locallab.spots.at(pp->locallab.selspot).inverssha || !inverssha->get_inconsistent(); - // Local Contrast - pe->locallab.spots.at(pp->locallab.selspot).expcontrast = pe->locallab.spots.at(pp->locallab.selspot).expcontrast || !expcontrast->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).lcradius = pe->locallab.spots.at(pp->locallab.selspot).lcradius || lcradius->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).lcamount = pe->locallab.spots.at(pp->locallab.selspot).lcamount || lcamount->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).lcdarkness = pe->locallab.spots.at(pp->locallab.selspot).lcdarkness || lcdarkness->getEditedState(); - 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).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).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(); - // Contrast by detail levels - pe->locallab.spots.at(pp->locallab.selspot).expcbdl = pe->locallab.spots.at(pp->locallab.selspot).expcbdl || !expcbdl->get_inconsistent(); - - for (int i = 0; i < 6; i++) { - pe->locallab.spots.at(pp->locallab.selspot).mult[i] = pe->locallab.spots.at(pp->locallab.selspot).mult[i] || multiplier[i]->getEditedState(); - } - - pe->locallab.spots.at(pp->locallab.selspot).chromacbdl = pe->locallab.spots.at(pp->locallab.selspot).chromacbdl || chromacbdl->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).threshold = pe->locallab.spots.at(pp->locallab.selspot).threshold || threshold->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sensicb = pe->locallab.spots.at(pp->locallab.selspot).sensicb || sensicb->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).clarityml = pe->locallab.spots.at(pp->locallab.selspot).clarityml || clarityml->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).contresid = pe->locallab.spots.at(pp->locallab.selspot).contresid || contresid->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).blurcbdl = pe->locallab.spots.at(pp->locallab.selspot).blurcbdl || blurcbdl->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).softradiuscb = pe->locallab.spots.at(pp->locallab.selspot).softradiuscb || softradiuscb->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).enacbMask = pe->locallab.spots.at(pp->locallab.selspot).enacbMask || !enacbMask->get_inconsistent(); - - pe->locallab.spots.at(pp->locallab.selspot).CCmaskcbcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskcbcurve || !CCmaskcbshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).LLmaskcbcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskcbcurve || !LLmaskcbshape->isUnChanged(); - pe->locallab.spots.at(pp->locallab.selspot).HHmaskcbcurve = pe->locallab.spots.at(pp->locallab.selspot).HHmaskcbcurve || !HHmaskcbshape->isUnChanged(); - - pe->locallab.spots.at(pp->locallab.selspot).blendmaskcb = pe->locallab.spots.at(pp->locallab.selspot).blendmaskcb || blendmaskcb->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).radmaskcb = pe->locallab.spots.at(pp->locallab.selspot).radmaskcb || radmaskcb->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).chromaskcb = pe->locallab.spots.at(pp->locallab.selspot).chromaskcb || chromaskcb->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).gammaskcb = pe->locallab.spots.at(pp->locallab.selspot).gammaskcb || gammaskcb->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).slomaskcb = pe->locallab.spots.at(pp->locallab.selspot).slomaskcb || slomaskcb->getEditedState(); - - // Denoise - pe->locallab.spots.at(pp->locallab.selspot).expdenoi = pe->locallab.spots.at(pp->locallab.selspot).expdenoi || !expdenoi->get_inconsistent(); - pe->locallab.spots.at(pp->locallab.selspot).noiselumf = pe->locallab.spots.at(pp->locallab.selspot).noiselumf || noiselumf->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).noiselumf0 = pe->locallab.spots.at(pp->locallab.selspot).noiselumf0 || noiselumf0->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).noiselumf2 = pe->locallab.spots.at(pp->locallab.selspot).noiselumf2 || noiselumf2->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).noiselumc = pe->locallab.spots.at(pp->locallab.selspot).noiselumc || noiselumc->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).noiselumdetail = pe->locallab.spots.at(pp->locallab.selspot).noiselumdetail || noiselumdetail->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).noiselequal = pe->locallab.spots.at(pp->locallab.selspot).noiselequal || noiselequal->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).noisechrof = pe->locallab.spots.at(pp->locallab.selspot).noisechrof || noisechrof->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).noisechroc = pe->locallab.spots.at(pp->locallab.selspot).noisechroc || noisechroc->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).noisechrodetail = pe->locallab.spots.at(pp->locallab.selspot).noisechrodetail || noisechrodetail->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).adjblur = pe->locallab.spots.at(pp->locallab.selspot).adjblur || adjblur->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).bilateral = pe->locallab.spots.at(pp->locallab.selspot).bilateral || bilateral->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).sensiden = pe->locallab.spots.at(pp->locallab.selspot).sensiden || sensiden->getEditedState(); - } + for (auto tool : locallabTools) { + tool->write(pp, pedited); } - // ParamsEdited update - if (pedited) { - pedited->locallab.enabled = pedited->locallab.enabled || !get_inconsistent(); - - if (pp->locallab.selspot < (int)pedited->locallab.spots.size()) { - // Control spot settings - pedited->locallab.spots.at(pp->locallab.selspot).name = pedited->locallab.spots.at(pp->locallab.selspot).name || se->name; - pedited->locallab.spots.at(pp->locallab.selspot).isvisible = pedited->locallab.spots.at(pp->locallab.selspot).isvisible || se->isvisible; - pedited->locallab.spots.at(pp->locallab.selspot).shape = pedited->locallab.spots.at(pp->locallab.selspot).shape || se->shape; - pedited->locallab.spots.at(pp->locallab.selspot).spotMethod = pedited->locallab.spots.at(pp->locallab.selspot).spotMethod || se->spotMethod; - pedited->locallab.spots.at(pp->locallab.selspot).sensiexclu = pedited->locallab.spots.at(pp->locallab.selspot).sensiexclu || se->sensiexclu; - pedited->locallab.spots.at(pp->locallab.selspot).structexclu = pedited->locallab.spots.at(pp->locallab.selspot).structexclu || se->structexclu; - pedited->locallab.spots.at(pp->locallab.selspot).struc = pedited->locallab.spots.at(pp->locallab.selspot).struc || se->struc; - pedited->locallab.spots.at(pp->locallab.selspot).shapeMethod = pedited->locallab.spots.at(pp->locallab.selspot).shapeMethod || se->shapeMethod; - pedited->locallab.spots.at(pp->locallab.selspot).locX = pedited->locallab.spots.at(pp->locallab.selspot).locX || se->locX; - pedited->locallab.spots.at(pp->locallab.selspot).locXL = pedited->locallab.spots.at(pp->locallab.selspot).locXL || se->locXL; - pedited->locallab.spots.at(pp->locallab.selspot).locY = pedited->locallab.spots.at(pp->locallab.selspot).locY || se->locY; - pedited->locallab.spots.at(pp->locallab.selspot).locYT = pedited->locallab.spots.at(pp->locallab.selspot).locYT || se->locYT; - pedited->locallab.spots.at(pp->locallab.selspot).centerX = pedited->locallab.spots.at(pp->locallab.selspot).centerX || se->centerX; - pedited->locallab.spots.at(pp->locallab.selspot).centerY = pedited->locallab.spots.at(pp->locallab.selspot).centerY || se->centerY; - pedited->locallab.spots.at(pp->locallab.selspot).circrad = pedited->locallab.spots.at(pp->locallab.selspot).circrad || se->circrad; - pedited->locallab.spots.at(pp->locallab.selspot).qualityMethod = pedited->locallab.spots.at(pp->locallab.selspot).qualityMethod || se->qualityMethod; - pedited->locallab.spots.at(pp->locallab.selspot).transit = pedited->locallab.spots.at(pp->locallab.selspot).transit || se->transit; - pedited->locallab.spots.at(pp->locallab.selspot).thresh = pedited->locallab.spots.at(pp->locallab.selspot).thresh || se->thresh; - pedited->locallab.spots.at(pp->locallab.selspot).iter = pedited->locallab.spots.at(pp->locallab.selspot).iter || se->iter; - pedited->locallab.spots.at(pp->locallab.selspot).balan = pedited->locallab.spots.at(pp->locallab.selspot).balan || se->balan; - pedited->locallab.spots.at(pp->locallab.selspot).transitweak = pedited->locallab.spots.at(pp->locallab.selspot).transitweak || se->transitweak; - pedited->locallab.spots.at(pp->locallab.selspot).transitgrad = pedited->locallab.spots.at(pp->locallab.selspot).transitgrad || se->transitgrad; - pedited->locallab.spots.at(pp->locallab.selspot).avoid = pedited->locallab.spots.at(pp->locallab.selspot).avoid || se->avoid; - // Color & Light - pedited->locallab.spots.at(pp->locallab.selspot).expcolor = pedited->locallab.spots.at(pp->locallab.selspot).expcolor || !expcolor->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).curvactiv = pedited->locallab.spots.at(pp->locallab.selspot).curvactiv || !curvactiv->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).lightness = pedited->locallab.spots.at(pp->locallab.selspot).lightness || lightness->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).contrast = pedited->locallab.spots.at(pp->locallab.selspot).contrast || contrast->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).chroma = pedited->locallab.spots.at(pp->locallab.selspot).chroma || chroma->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).strengthgrid = pedited->locallab.spots.at(pp->locallab.selspot).strengthgrid || strengthgrid->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sensi = pedited->locallab.spots.at(pp->locallab.selspot).sensi || sensi->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).structcol = pedited->locallab.spots.at(pp->locallab.selspot).structcol || structcol->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = pedited->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod || qualitycurveMethod->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->locallab.spots.at(pp->locallab.selspot).gridMethod = pedited->locallab.spots.at(pp->locallab.selspot).gridMethod || gridMethod->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->locallab.spots.at(pp->locallab.selspot).llcurve = pedited->locallab.spots.at(pp->locallab.selspot).llcurve || !llshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).cccurve = pedited->locallab.spots.at(pp->locallab.selspot).cccurve || !ccshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).LHcurve = pedited->locallab.spots.at(pp->locallab.selspot).LHcurve || !LHshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).HHcurve = pedited->locallab.spots.at(pp->locallab.selspot).HHcurve || !HHshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).invers = pedited->locallab.spots.at(pp->locallab.selspot).invers || !invers->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).enaColorMask = pedited->locallab.spots.at(pp->locallab.selspot).enaColorMask || !enaColorMask->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).CCmaskcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskcurve || !CCmaskshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).LLmaskcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskcurve || !LLmaskshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).HHmaskcurve = pedited->locallab.spots.at(pp->locallab.selspot).HHmaskcurve || !HHmaskshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).blurcolde = pedited->locallab.spots.at(pp->locallab.selspot).blurcolde || blurcolde->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).blendmaskcol = pedited->locallab.spots.at(pp->locallab.selspot).blendmaskcol || blendmaskcol->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).radmaskcol = pedited->locallab.spots.at(pp->locallab.selspot).radmaskcol || radmaskcol->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).chromaskcol = pedited->locallab.spots.at(pp->locallab.selspot).chromaskcol || chromaskcol->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).gammaskcol = pedited->locallab.spots.at(pp->locallab.selspot).gammaskcol || gammaskcol->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).slomaskcol = pedited->locallab.spots.at(pp->locallab.selspot).slomaskcol || slomaskcol->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).softradiuscol = pedited->locallab.spots.at(pp->locallab.selspot).softradiuscol || softradiuscol->getEditedState(); - // Exposure - pedited->locallab.spots.at(pp->locallab.selspot).expexpose = pedited->locallab.spots.at(pp->locallab.selspot).expexpose || !expexpose->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).expcomp = pedited->locallab.spots.at(pp->locallab.selspot).expcomp || expcomp->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).hlcompr = pedited->locallab.spots.at(pp->locallab.selspot).hlcompr || hlcompr->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).hlcomprthresh = pedited->locallab.spots.at(pp->locallab.selspot).hlcomprthresh || hlcomprthresh->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).black = pedited->locallab.spots.at(pp->locallab.selspot).black || black->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).shadex = pedited->locallab.spots.at(pp->locallab.selspot).shadex || shadex->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).shcompr = pedited->locallab.spots.at(pp->locallab.selspot).shcompr || shcompr->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).expchroma = pedited->locallab.spots.at(pp->locallab.selspot).expchroma || expchroma->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).warm = pedited->locallab.spots.at(pp->locallab.selspot).warm || warm->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sensiex = pedited->locallab.spots.at(pp->locallab.selspot).sensiex || sensiex->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).structexp = pedited->locallab.spots.at(pp->locallab.selspot).structexp || structexp->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).blurexpde = pedited->locallab.spots.at(pp->locallab.selspot).blurexpde || blurexpde->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).excurve = pedited->locallab.spots.at(pp->locallab.selspot).excurve || !shapeexpos->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).inversex = pedited->locallab.spots.at(pp->locallab.selspot).inversex || !inversex->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).enaExpMask = pedited->locallab.spots.at(pp->locallab.selspot).enaExpMask || !enaExpMask->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve || !CCmaskexpshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve || !LLmaskexpshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve || !HHmaskexpshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).blendmaskexp = pedited->locallab.spots.at(pp->locallab.selspot).blendmaskexp || blendmaskexp->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).radmaskexp = pedited->locallab.spots.at(pp->locallab.selspot).radmaskexp || radmaskexp->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).chromaskexp = pedited->locallab.spots.at(pp->locallab.selspot).chromaskexp || chromaskexp->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).gammaskexp = pedited->locallab.spots.at(pp->locallab.selspot).gammaskexp || gammaskexp->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).slomaskexp = pedited->locallab.spots.at(pp->locallab.selspot).slomaskexp || slomaskexp->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).softradiusexp = pedited->locallab.spots.at(pp->locallab.selspot).softradiusexp || softradiusexp->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).expMethod = pedited->locallab.spots.at(pp->locallab.selspot).expMethod || expMethod->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->locallab.spots.at(pp->locallab.selspot).laplacexp = pedited->locallab.spots.at(pp->locallab.selspot).laplacexp || laplacexp->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).balanexp = pedited->locallab.spots.at(pp->locallab.selspot).balanexp || balanexp->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).linear = pedited->locallab.spots.at(pp->locallab.selspot).linear || linear->getEditedState(); - // Shadow highlight - pedited->locallab.spots.at(pp->locallab.selspot).expshadhigh = pedited->locallab.spots.at(pp->locallab.selspot).expshadhigh || !expshadhigh->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).highlights = pedited->locallab.spots.at(pp->locallab.selspot).highlights || highlights->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).h_tonalwidth = pedited->locallab.spots.at(pp->locallab.selspot).h_tonalwidth || h_tonalwidth->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).shadows = pedited->locallab.spots.at(pp->locallab.selspot).shadows || shadows->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).s_tonalwidth = pedited->locallab.spots.at(pp->locallab.selspot).s_tonalwidth || s_tonalwidth->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sh_radius = pedited->locallab.spots.at(pp->locallab.selspot).sh_radius || sh_radius->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sensihs = pedited->locallab.spots.at(pp->locallab.selspot).sensihs || sensihs->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).enaSHMask = pedited->locallab.spots.at(pp->locallab.selspot).enaSHMask || !enaSHMask->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).CCmaskSHcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskSHcurve || !CCmaskSHshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).LLmaskSHcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskSHcurve || !LLmaskSHshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).HHmaskSHcurve = pedited->locallab.spots.at(pp->locallab.selspot).HHmaskSHcurve || !HHmaskSHshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).blendmaskSH = pedited->locallab.spots.at(pp->locallab.selspot).blendmaskSH || blendmaskSH->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).radmaskSH = pedited->locallab.spots.at(pp->locallab.selspot).radmaskSH || radmaskSH->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).blurSHde = pedited->locallab.spots.at(pp->locallab.selspot).blurSHde || blurSHde->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).inverssh = pedited->locallab.spots.at(pp->locallab.selspot).inverssh || !inverssh->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).chromaskSH = pedited->locallab.spots.at(pp->locallab.selspot).chromaskSH || chromaskSH->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).gammaskSH = pedited->locallab.spots.at(pp->locallab.selspot).gammaskSH || gammaskSH->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).slomaskSH = pedited->locallab.spots.at(pp->locallab.selspot).slomaskSH || slomaskSH->getEditedState(); - // Vibrance - pedited->locallab.spots.at(pp->locallab.selspot).expvibrance = pedited->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).saturated = pedited->locallab.spots.at(pp->locallab.selspot).saturated || saturated->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).pastels = pedited->locallab.spots.at(pp->locallab.selspot).pastels || pastels->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).psthreshold = pedited->locallab.spots.at(pp->locallab.selspot).psthreshold || psThreshold->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).protectskins = pedited->locallab.spots.at(pp->locallab.selspot).protectskins || !protectSkins->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).avoidcolorshift = pedited->locallab.spots.at(pp->locallab.selspot).avoidcolorshift || !avoidColorShift->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).pastsattog = pedited->locallab.spots.at(pp->locallab.selspot).pastsattog || !pastSatTog->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).sensiv = pedited->locallab.spots.at(pp->locallab.selspot).sensiv || sensiv->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).skintonescurve = pedited->locallab.spots.at(pp->locallab.selspot).skintonescurve || !skinTonesCurve->isUnChanged(); - // Soft Light - pedited->locallab.spots.at(pp->locallab.selspot).expsoft = pedited->locallab.spots.at(pp->locallab.selspot).expsoft || !expsoft->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).streng = pedited->locallab.spots.at(pp->locallab.selspot).streng || streng->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sensisf = pedited->locallab.spots.at(pp->locallab.selspot).sensisf || sensisf->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).laplace = pedited->locallab.spots.at(pp->locallab.selspot).laplace || laplace->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).softMethod = pedited->locallab.spots.at(pp->locallab.selspot).softMethod || softMethod->get_active_text() != M("GENERAL_UNCHANGED"); - // Blur & Noise - pedited->locallab.spots.at(pp->locallab.selspot).expblur = pedited->locallab.spots.at(pp->locallab.selspot).expblur || !expblur->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).radius = pedited->locallab.spots.at(pp->locallab.selspot).radius || radius->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).strength = pedited->locallab.spots.at(pp->locallab.selspot).strength || strength->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sensibn = pedited->locallab.spots.at(pp->locallab.selspot).sensibn || sensibn->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).blurMethod = pedited->locallab.spots.at(pp->locallab.selspot).blurMethod || blurMethod->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->locallab.spots.at(pp->locallab.selspot).activlum = pedited->locallab.spots.at(pp->locallab.selspot).activlum || !activlum->get_inconsistent(); - // Tone Mapping - pedited->locallab.spots.at(pp->locallab.selspot).exptonemap = pedited->locallab.spots.at(pp->locallab.selspot).exptonemap || !exptonemap->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).stren = pedited->locallab.spots.at(pp->locallab.selspot).stren || stren->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).gamma = pedited->locallab.spots.at(pp->locallab.selspot).gamma || gamma->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).estop = pedited->locallab.spots.at(pp->locallab.selspot).estop || estop->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).scaltm = pedited->locallab.spots.at(pp->locallab.selspot).scaltm || scaltm->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).rewei = pedited->locallab.spots.at(pp->locallab.selspot).rewei || rewei->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).satur = pedited->locallab.spots.at(pp->locallab.selspot).satur || satur->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sensitm = pedited->locallab.spots.at(pp->locallab.selspot).sensitm || sensitm->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).softradiustm = pedited->locallab.spots.at(pp->locallab.selspot).softradiustm || softradiustm->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).amount = pedited->locallab.spots.at(pp->locallab.selspot).amount || amount->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).enaretiMask = pedited->locallab.spots.at(pp->locallab.selspot).enaretiMask || !enaretiMask->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).enaretiMasktmap = pedited->locallab.spots.at(pp->locallab.selspot).enaretiMasktmap || !enaretiMasktmap->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).equiltm = pedited->locallab.spots.at(pp->locallab.selspot).equiltm || !equiltm->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).CCmasktmcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmasktmcurve || !CCmasktmshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).LLmasktmcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmasktmcurve || !LLmasktmshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).HHmasktmcurve = pedited->locallab.spots.at(pp->locallab.selspot).HHmasktmcurve || !HHmasktmshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).enatmMask = pedited->locallab.spots.at(pp->locallab.selspot).enatmMask || !enatmMask->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).blendmasktm = pedited->locallab.spots.at(pp->locallab.selspot).blendmasktm || blendmasktm->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).radmasktm = pedited->locallab.spots.at(pp->locallab.selspot).radmasktm || radmasktm->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).chromasktm = pedited->locallab.spots.at(pp->locallab.selspot).chromasktm || chromasktm->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).gammasktm = pedited->locallab.spots.at(pp->locallab.selspot).gammasktm || gammasktm->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).slomasktm = pedited->locallab.spots.at(pp->locallab.selspot).slomasktm || slomasktm->getEditedState(); - // Retinex - pedited->locallab.spots.at(pp->locallab.selspot).expreti = pedited->locallab.spots.at(pp->locallab.selspot).expreti || !expreti->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).retinexMethod = pedited->locallab.spots.at(pp->locallab.selspot).retinexMethod || retinexMethod->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->locallab.spots.at(pp->locallab.selspot).str = pedited->locallab.spots.at(pp->locallab.selspot).str || str->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).chrrt = pedited->locallab.spots.at(pp->locallab.selspot).chrrt || chrrt->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).neigh = pedited->locallab.spots.at(pp->locallab.selspot).neigh || neigh->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).vart = pedited->locallab.spots.at(pp->locallab.selspot).vart || vart->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).dehaz = pedited->locallab.spots.at(pp->locallab.selspot).dehaz || dehaz->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sensih = pedited->locallab.spots.at(pp->locallab.selspot).sensih || sensih->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).localTgaincurve = pedited->locallab.spots.at(pp->locallab.selspot).localTgaincurve || !cTgainshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).inversret = pedited->locallab.spots.at(pp->locallab.selspot).inversret || !inversret->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).equilret = pedited->locallab.spots.at(pp->locallab.selspot).equilret || !equilret->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).softradiusret = pedited->locallab.spots.at(pp->locallab.selspot).softradiusret || softradiusret->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).CCmaskreticurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskreticurve || !CCmaskretishape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).LLmaskreticurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskreticurve || !LLmaskretishape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).HHmaskreticurve = pedited->locallab.spots.at(pp->locallab.selspot).HHmaskreticurve || !HHmaskretishape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).enaretiMask = pedited->locallab.spots.at(pp->locallab.selspot).enaretiMask || !enaretiMask->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).enaretiMasktmap = pedited->locallab.spots.at(pp->locallab.selspot).enaretiMasktmap || !enaretiMasktmap->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).blendmaskreti = pedited->locallab.spots.at(pp->locallab.selspot).blendmaskreti || blendmaskreti->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).radmaskreti = pedited->locallab.spots.at(pp->locallab.selspot).radmaskreti || radmaskreti->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).chromaskreti = pedited->locallab.spots.at(pp->locallab.selspot).chromaskreti || chromaskreti->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).gammaskreti = pedited->locallab.spots.at(pp->locallab.selspot).gammaskreti || gammaskreti->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).slomaskreti = pedited->locallab.spots.at(pp->locallab.selspot).slomaskreti || slomaskreti->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).scalereti = pedited->locallab.spots.at(pp->locallab.selspot).scalereti || scalereti->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).darkness = pedited->locallab.spots.at(pp->locallab.selspot).darkness || darkness->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).lightnessreti = pedited->locallab.spots.at(pp->locallab.selspot).lightnessreti || lightnessreti->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).limd = pedited->locallab.spots.at(pp->locallab.selspot).limd || limd->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).fftwreti = pedited->locallab.spots.at(pp->locallab.selspot).fftwreti || !fftwreti->get_inconsistent(); - // Sharpening - pedited->locallab.spots.at(pp->locallab.selspot).expsharp = pedited->locallab.spots.at(pp->locallab.selspot).expsharp || !expsharp->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).sharcontrast = pedited->locallab.spots.at(pp->locallab.selspot).sharcontrast || sharcontrast->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sharradius = pedited->locallab.spots.at(pp->locallab.selspot).sharradius || sharradius->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sharamount = pedited->locallab.spots.at(pp->locallab.selspot).sharamount || sharamount->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).shardamping = pedited->locallab.spots.at(pp->locallab.selspot).shardamping || shardamping->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).shariter = pedited->locallab.spots.at(pp->locallab.selspot).shariter || shariter->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sharblur = pedited->locallab.spots.at(pp->locallab.selspot).sharblur || sharblur->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sensisha = pedited->locallab.spots.at(pp->locallab.selspot).sensisha || sensisha->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).inverssha = pedited->locallab.spots.at(pp->locallab.selspot).inverssha || !inverssha->get_inconsistent(); - // Local Contrast - pedited->locallab.spots.at(pp->locallab.selspot).expcontrast = pedited->locallab.spots.at(pp->locallab.selspot).expcontrast || !expcontrast->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).lcradius = pedited->locallab.spots.at(pp->locallab.selspot).lcradius || lcradius->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).lcamount = pedited->locallab.spots.at(pp->locallab.selspot).lcamount || lcamount->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).lcdarkness = pedited->locallab.spots.at(pp->locallab.selspot).lcdarkness || lcdarkness->getEditedState(); - 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).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).locwavcurve = pedited->locallab.spots.at(pp->locallab.selspot).locwavcurve || !wavshape->isUnChanged(); - // Contrast by detail levels - pedited->locallab.spots.at(pp->locallab.selspot).expcbdl = pedited->locallab.spots.at(pp->locallab.selspot).expcbdl || !expcbdl->get_inconsistent(); - - for (int i = 0; i < 6; i++) { - pedited->locallab.spots.at(pp->locallab.selspot).mult[i] = pedited->locallab.spots.at(pp->locallab.selspot).mult[i] || multiplier[i]->getEditedState(); - } - - pedited->locallab.spots.at(pp->locallab.selspot).chromacbdl = pedited->locallab.spots.at(pp->locallab.selspot).chromacbdl || chromacbdl->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).threshold = pedited->locallab.spots.at(pp->locallab.selspot).threshold || threshold->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sensicb = pedited->locallab.spots.at(pp->locallab.selspot).sensicb || sensicb->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).clarityml = pedited->locallab.spots.at(pp->locallab.selspot).clarityml || clarityml->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).contresid = pedited->locallab.spots.at(pp->locallab.selspot).contresid || contresid->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).blurcbdl = pedited->locallab.spots.at(pp->locallab.selspot).blurcbdl || blurcbdl->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).softradiuscb = pedited->locallab.spots.at(pp->locallab.selspot).softradiuscb || softradiuscb->getEditedState(); - - pedited->locallab.spots.at(pp->locallab.selspot).enacbMask = pedited->locallab.spots.at(pp->locallab.selspot).enacbMask || !enacbMask->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).CCmaskcbcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskcbcurve || !CCmaskcbshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).LLmaskcbcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskcbcurve || !LLmaskcbshape->isUnChanged(); - pedited->locallab.spots.at(pp->locallab.selspot).HHmaskcbcurve = pedited->locallab.spots.at(pp->locallab.selspot).HHmaskcbcurve || !HHmaskcbshape->isUnChanged(); - - pedited->locallab.spots.at(pp->locallab.selspot).blendmaskcb = pedited->locallab.spots.at(pp->locallab.selspot).blendmaskcb || blendmaskcb->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).radmaskcb = pedited->locallab.spots.at(pp->locallab.selspot).radmaskcb || radmaskcb->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).chromaskcb = pedited->locallab.spots.at(pp->locallab.selspot).chromaskcb || chromaskcb->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).gammaskcb = pedited->locallab.spots.at(pp->locallab.selspot).gammaskcb || gammaskcb->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).slomaskcb = pedited->locallab.spots.at(pp->locallab.selspot).slomaskcb || slomaskcb->getEditedState(); - - // Denoise - pedited->locallab.spots.at(pp->locallab.selspot).expdenoi = pedited->locallab.spots.at(pp->locallab.selspot).expdenoi || !expdenoi->get_inconsistent(); - pedited->locallab.spots.at(pp->locallab.selspot).noiselumf = pedited->locallab.spots.at(pp->locallab.selspot).noiselumf || noiselumf->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).noiselumf0 = pedited->locallab.spots.at(pp->locallab.selspot).noiselumf0 || noiselumf0->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).noiselumf2 = pedited->locallab.spots.at(pp->locallab.selspot).noiselumf2 || noiselumf2->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).noiselumc = pedited->locallab.spots.at(pp->locallab.selspot).noiselumc || noiselumc->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).noiselumdetail = pedited->locallab.spots.at(pp->locallab.selspot).noiselumdetail || noiselumdetail->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).noiselequal = pedited->locallab.spots.at(pp->locallab.selspot).noiselequal || noiselequal->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).noisechrof = pedited->locallab.spots.at(pp->locallab.selspot).noisechrof || noisechrof->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).noisechroc = pedited->locallab.spots.at(pp->locallab.selspot).noisechroc || noisechroc->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).noisechrodetail = pedited->locallab.spots.at(pp->locallab.selspot).noisechrodetail || noisechrodetail->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).adjblur = pedited->locallab.spots.at(pp->locallab.selspot).adjblur || adjblur->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).bilateral = pedited->locallab.spots.at(pp->locallab.selspot).bilateral || bilateral->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).sensiden = pedited->locallab.spots.at(pp->locallab.selspot).sensiden || sensiden->getEditedState(); - } - } + // Note: No need to manage pedited as batch mode is deactivated for Locallab } } - - // Update Locallab tools GUI - disableListener(); - updateSpecificGUIState(); - enableListener(); } -void Locallab::protectskins_toggled() +/* + * Note: + * By default, this function is called when a new image is loaded (after read function). In this case, if there is + * at least one spot, default values are set to selected spot ones. + * To keep having default values according to selected spot, this function shall also be called in the following + * situations (after having called write function for controlspotpanel): + * - After spot creation + * - After spot deletion + * - After spot selection + * - After spot duplication + */ +void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pedited) { - // printf("protectskins_toggled\n"); + // Set default values in spot panel control + expsettings->setDefaults(defParams, pedited); - if (multiImage) { - if (protectSkins->get_inconsistent()) { - protectSkins->set_inconsistent(false); - pskinsconn.block(true); - protectSkins->set_active(false); - pskinsconn.block(false); - } - } - - if (getEnabled() && expvibrance->getEnabled()) { - if (listener) { - if (protectSkins->get_active()) { - listener->panelChanged(EvlocallabProtectSkins, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvlocallabProtectSkins, M("GENERAL_DISABLED")); - } - } + // Set defaut values in Locallab tools + for (auto tool : locallabTools) { + tool->setDefaults(defParams, pedited); } } -void Locallab::avoidcolorshift_toggled() +void Locallab::setListener(ToolPanelListener* tpl) { - // printf("avoidcolorshift_toggled\n"); + this->listener = tpl; - if (multiImage) { - if (avoidColorShift->get_inconsistent()) { - avoidColorShift->set_inconsistent(false); - ashiftconn.block(true); - avoidColorShift->set_active(false); - ashiftconn.block(false); - } - } + // Set listener for spot control panel + expsettings->setListener(tpl); - if (getEnabled() && expvibrance->getEnabled()) { - if (listener) { - if (avoidColorShift->get_active()) { - listener->panelChanged(EvlocallabAvoidColorShift, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvlocallabAvoidColorShift, M("GENERAL_DISABLED")); - } - } + // Set listener for locallab tools + for (auto tool : locallabTools) { + tool->setListener(tpl); } } -void Locallab::pastsattog_toggled() +void Locallab::refChanged(double huer, double lumar, double chromar) { - // printf("pastsattog_toggled\n"); - - if (multiImage) { - if (pastSatTog->get_inconsistent()) { - pastSatTog->set_inconsistent(false); - pastsattogconn.block(true); - pastSatTog->set_active(false); - pastsattogconn.block(false); - } - } - - // Update Vibrance GUI according to pastsattog button state (to be compliant with updateSpecificGUIState function) - if (multiImage && pastSatTog->get_inconsistent()) { - psThreshold->set_sensitive(true); - saturated->set_sensitive(true); - } else if (pastSatTog->get_active()) { - // Link both slider, so we set saturated and psThresholds unsensitive - psThreshold->set_sensitive(false); - saturated->set_sensitive(false); - saturated->setValue(pastels->getValue()); // Pastels and Saturated are linked - } else { - // Separate sliders, so we set saturated and psThresholds sensitive again - psThreshold->set_sensitive(true); - saturated->set_sensitive(true); - } - - if (getEnabled() && expvibrance->getEnabled()) { - if (listener) { - if (pastSatTog->get_active()) { - listener->panelChanged(EvlocallabPastSatTog, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvlocallabPastSatTog, M("GENERAL_DISABLED")); - } - } + // Update locallab tools mask background + for (auto tool : locallabTools) { + tool->refChanged(huer, lumar, chromar); } } - -void Locallab::curveChanged(CurveEditor* ce) -{ - // Color & Light - if (getEnabled() && expcolor->getEnabled()) { - if (ce == llshape) { - if (listener) { - listener->panelChanged(Evlocallabllshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == ccshape) { - if (listener) { - listener->panelChanged(Evlocallabccshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == LHshape) { - if (listener) { - listener->panelChanged(EvlocallabLHshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == HHshape) { - if (listener) { - listener->panelChanged(EvlocallabHHshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == CCmaskshape) { - if (listener) { - listener->panelChanged(EvlocallabCCmaskshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == LLmaskshape) { - if (listener) { - listener->panelChanged(EvlocallabLLmaskshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == HHmaskshape) { - if (listener) { - listener->panelChanged(EvlocallabHHmaskshape, M("HISTORY_CUSTOMCURVE")); - } - } - - } - - // Exposure - if (getEnabled() && expexpose->getEnabled()) { - if (ce == shapeexpos) { - if (listener) { - listener->panelChanged(Evlocallabshapeexpos, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == CCmaskexpshape) { - if (listener) { - listener->panelChanged(EvlocallabCCmaskexpshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == LLmaskexpshape) { - if (listener) { - listener->panelChanged(EvlocallabLLmaskexpshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == HHmaskexpshape) { - if (listener) { - listener->panelChanged(EvlocallabHHmaskexpshape, M("HISTORY_CUSTOMCURVE")); - } - } - } - - //Shadows Highlight - if (getEnabled() && expshadhigh->getEnabled()) { - - if (ce == CCmaskSHshape) { - if (listener) { - listener->panelChanged(EvlocallabCCmaskSHshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == LLmaskSHshape) { - if (listener) { - listener->panelChanged(EvlocallabLLmaskSHshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == HHmaskSHshape) { - if (listener) { - listener->panelChanged(EvlocallabHHmaskSHshape, M("HISTORY_CUSTOMCURVE")); - } - } - } - - //CBDL - if (getEnabled() && expcbdl->getEnabled()) { - - if (ce == CCmaskcbshape) { - if (listener) { - listener->panelChanged(EvlocallabCCmaskcbshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == LLmaskcbshape) { - if (listener) { - listener->panelChanged(EvlocallabLLmaskcbshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == HHmaskcbshape) { - if (listener) { - listener->panelChanged(EvlocallabHHmaskcbshape, M("HISTORY_CUSTOMCURVE")); - } - } - } - - // Vibrance - if (getEnabled() && expvibrance->getEnabled()) { - if (ce == skinTonesCurve) { - if (listener) { - listener->panelChanged(EvlocallabSkinTonesCurve, M("HISTORY_CUSTOMCURVE")); - } - } - } - - // TM - if (getEnabled() && exptonemap->getEnabled()) { - - if (ce == CCmasktmshape) { - if (listener) { - listener->panelChanged(EvlocallabCCmasktmshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == LLmasktmshape) { - if (listener) { - listener->panelChanged(EvlocallabLLmasktmshape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == HHmasktmshape) { - if (listener) { - listener->panelChanged(EvlocallabHHmasktmshape, M("HISTORY_CUSTOMCURVE")); - } - } - - } - - // Retinex - if (getEnabled() && expreti->getEnabled()) { - if (ce == cTgainshape) { - if (listener) { - listener->panelChanged(EvlocallabCTgainCurve, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == CCmaskretishape) { - if (listener) { - listener->panelChanged(EvlocallabCCmaskretishape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == LLmaskretishape) { - if (listener) { - listener->panelChanged(EvlocallabLLmaskretishape, M("HISTORY_CUSTOMCURVE")); - } - } - - if (ce == HHmaskretishape) { - if (listener) { - listener->panelChanged(EvlocallabHHmaskretishape, M("HISTORY_CUSTOMCURVE")); - } - } - - } - - // Local contrast - if (getEnabled() && expcontrast->getEnabled()) { - if (ce == wavshape) { - if (listener) { - listener->panelChanged(EvlocallabwavCurve, M("HISTORY_CUSTOMCURVE")); - } - } - } - -} - -void Locallab::localcontMethodChanged() -{ - if (localcontMethod->get_active_row_number() == 0) { - levelwav->hide(); - residcont->hide(); - lcradius->show(); - lcamount->show(); - lcdarkness->show(); - lclightness->show(); - LocalcurveEditorwav->hide(); - fftwlc->show(); - } else if (localcontMethod->get_active_row_number() == 1) { - levelwav->show(); - residcont->show(); - lcradius->hide(); - lcamount->hide(); - lcdarkness->hide(); - lclightness->hide(); - LocalcurveEditorwav->show(); - fftwlc->hide(); - } - - // printf("localcontMethodChanged\n"); - if (getEnabled() && expcontrast->getEnabled()) { - if (listener) { - listener->panelChanged(EvlocallablocalcontMethod, localcontMethod->get_active_text()); - } - } -} - - -void Locallab::retinexMethodChanged() -{ - // printf("retinexMethodChanged\n"); - - if (getEnabled() && expreti->getEnabled()) { - if (listener) { - listener->panelChanged(EvlocallabretinexMethod, retinexMethod->get_active_text()); - } - } -} - -void Locallab::softMethodChanged() -{ - // printf("softMethodChanged\n"); - if (softMethod->get_active_row_number() == 0) { - laplace->hide(); - ctboxsoftmethod->hide(); - } else { - laplace->show(); - ctboxsoftmethod->show(); - } - - if (getEnabled() && expsoft->getEnabled()) { - if (listener) { - listener->panelChanged(EvlocallabsoftMethod, softMethod->get_active_text()); - } - } -} - - -void Locallab::blurMethodChanged() -{ - // printf("blurMethodChanged\n"); - - - if (getEnabled() && expblur->getEnabled()) { - if (listener) { - listener->panelChanged(EvlocallabblurMethod, blurMethod->get_active_text()); - } - } -} - -void Locallab::qualitycurveMethodChanged() -{ - // printf("qualitycurveMethodChanged\n"); - - if (getEnabled() && expcolor->getEnabled()) { - if (listener) { - listener->panelChanged(EvlocallabqualitycurveMethod, qualitycurveMethod->get_active_text()); - } - } -} - -void Locallab::gridMethodChanged() -{ - // printf("qualitycurveMethodChanged\n"); - - if (getEnabled() && expcolor->getEnabled()) { - if (listener) { - listener->panelChanged(EvLocallabgridMethod, gridMethod->get_active_text()); - } - } -} - -void Locallab::showmaskcolMethodChanged() -{ - // printf("showmaskcolMethodChanged\n"); - - // When one mask state is changed, other masks are deactivated - disableListener(); - showmaskexpMethod->set_active(0); - showmaskSHMethod->set_active(0); - showmaskcbMethod->set_active(0); - showmaskretiMethod->set_active(0); - showmasksoftMethod->set_active(0); - showmasktmMethod->set_active(0); - enableListener(); - - if (listener) { - listener->panelChanged(EvlocallabshowmaskcolMethod, ""); - } -} - -void Locallab::showmaskexpMethodChanged() -{ - // printf("showmaskexpMethodChanged\n"); - - // When one mask state is changed, other masks are deactivated - disableListener(); - showmaskcolMethod->set_active(0); - showmaskcbMethod->set_active(0); - showmaskSHMethod->set_active(0); - showmaskretiMethod->set_active(0); - showmasksoftMethod->set_active(0); - showmasktmMethod->set_active(0); - enableListener(); - - if (listener) { - listener->panelChanged(EvlocallabshowmaskexpMethod, ""); - } -} - -void Locallab::expMethodChanged() -{ - // printf("expMethodChanged\n"); - disableListener(); - - if (expMethod->get_active_row_number() == 0) { - pdeFrame->set_sensitive(false); - laplacexp->set_sensitive(false); - balanexp->set_sensitive(false); - linear->set_sensitive(false); - } else if (expMethod->get_active_row_number() == 1) { - laplacexp->set_sensitive(true); - balanexp->set_sensitive(true); - linear->set_sensitive(true); - pdeFrame->set_sensitive(true); - } - - enableListener(); - - if (getEnabled() && expexpose->getEnabled()) { - if (listener) { - listener->panelChanged(EvlocallabexpMethod, ""); - } - } -} - - -void Locallab::showmaskSHMethodChanged() -{ - // printf("showmaskSHMethodChanged\n"); - - // When one mask state is changed, other masks are deactivated - disableListener(); - showmaskcolMethod->set_active(0); - showmaskexpMethod->set_active(0); - showmaskcbMethod->set_active(0); - showmaskretiMethod->set_active(0); - showmasksoftMethod->set_active(0); - showmasktmMethod->set_active(0); - enableListener(); - - if (listener) { - listener->panelChanged(EvlocallabshowmaskSHMethod, ""); - } -} - -void Locallab::showmaskcbMethodChanged() -{ - // printf("showmaskSHMethodChanged\n"); - - // When one mask state is changed, other masks are deactivated - disableListener(); - showmaskcolMethod->set_active(0); - showmaskSHMethod->set_active(0); - showmaskexpMethod->set_active(0); - showmaskretiMethod->set_active(0); - showmasksoftMethod->set_active(0); - showmasktmMethod->set_active(0); - enableListener(); - - if (listener) { - listener->panelChanged(EvlocallabshowmaskcbMethod, ""); - } -} - -void Locallab::showmasktmMethodChanged() -{ - // printf("showmaskSHMethodChanged\n"); - - // When one mask state is changed, other masks are deactivated - disableListener(); - showmaskcolMethod->set_active(0); - showmaskSHMethod->set_active(0); - showmaskexpMethod->set_active(0); - showmaskcbMethod->set_active(0); - showmaskretiMethod->set_active(0); - showmasksoftMethod->set_active(0); - enableListener(); - - if (listener) { - listener->panelChanged(EvlocallabshowmasktmMethod, ""); - } -} - - -void Locallab::showmaskretiMethodChanged() -{ - // printf("showmaskSHMethodChanged\n"); - - // When one mask state is changed, other masks are deactivated - disableListener(); - showmaskcolMethod->set_active(0); - showmaskSHMethod->set_active(0); - showmaskexpMethod->set_active(0); - showmaskcbMethod->set_active(0); - showmasksoftMethod->set_active(0); - showmasktmMethod->set_active(0); - enableListener(); - - if (listener) { - listener->panelChanged(EvlocallabshowmaskretiMethod, ""); - } -} - -void Locallab::showmasksoftMethodChanged() -{ - // printf("showmaskcolMethodChanged\n"); - - // When one mask state is changed, other masks are deactivated - disableListener(); - showmaskcolMethod->set_active(0); - showmaskexpMethod->set_active(0); - showmaskSHMethod->set_active(0); - showmaskcbMethod->set_active(0); - showmaskretiMethod->set_active(0); - showmasktmMethod->set_active(0); - enableListener(); - - if (listener) { - listener->panelChanged(EvlocallabshowmasksoftMethod, ""); - } -} - -void Locallab::resetMaskVisibility() +void Locallab::resetMaskVisibility() // TODO To keep ?? { // printf("resetMaskVisibility\n"); + /* disableListener(); showmaskcolMethod->set_active(0); showmaskexpMethod->set_active(0); @@ -3826,11 +657,13 @@ void Locallab::resetMaskVisibility() showmasksoftMethod->set_active(0); showmasktmMethod->set_active(0); enableListener(); + */ } -Locallab::llMaskVisibility* Locallab::getMaskVisibility() +Locallab::llMaskVisibility* Locallab::getMaskVisibility() // TODO To keep ?? { llMaskVisibility* maskStruct = new llMaskVisibility(); + /* maskStruct->colorMask = showmaskcolMethod->get_active_row_number(); maskStruct->expMask = showmaskexpMethod->get_active_row_number(); maskStruct->SHMask = showmaskSHMethod->get_active_row_number(); @@ -3838,2215 +671,13 @@ Locallab::llMaskVisibility* Locallab::getMaskVisibility() maskStruct->retiMask = showmaskretiMethod->get_active_row_number(); maskStruct->softMask = showmasksoftMethod->get_active_row_number(); maskStruct->tmMask = showmasktmMethod->get_active_row_number(); -// printf("SHmask=%i \n", maskStruct->SHMask); -// printf("retimask=%i \n", maskStruct->retiMask); + // printf("SHmask=%i \n", maskStruct->SHMask); + // printf("retimask=%i \n", maskStruct->retiMask); + */ return maskStruct; } -void Locallab::enaColorMaskChanged() -{ - // printf("enaColorMaskChanged\n"); - - if (multiImage) { - if (enaColorMask->get_inconsistent()) { - enaColorMask->set_inconsistent(false); - enaColorMaskConn.block(true); - enaColorMask->set_active(false); - enaColorMaskConn.block(false); - } - } - - if (getEnabled() && expcolor->getEnabled()) { - if (listener) { - if (enaColorMask->get_active()) { - listener->panelChanged(EvLocallabEnaColorMask, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvLocallabEnaColorMask, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::enaExpMaskChanged() -{ - // printf("enaExpMaskChanged\n"); - - if (multiImage) { - if (enaExpMask->get_inconsistent()) { - enaExpMask->set_inconsistent(false); - enaExpMaskConn.block(true); - enaExpMask->set_active(false); - enaExpMaskConn.block(false); - } - } - - if (getEnabled() && expexpose->getEnabled()) { - if (listener) { - if (enaExpMask->get_active()) { - listener->panelChanged(EvLocallabEnaExpMask, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvLocallabEnaExpMask, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::enaSHMaskChanged() -{ - // printf("enaSHMaskChanged\n"); - - if (multiImage) { - if (enaSHMask->get_inconsistent()) { - enaSHMask->set_inconsistent(false); - enaSHMaskConn.block(true); - enaSHMask->set_active(false); - enaSHMaskConn.block(false); - } - } - - if (getEnabled() && expshadhigh->getEnabled()) { - if (listener) { - if (enaSHMask->get_active()) { - listener->panelChanged(EvLocallabEnaSHMask, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvLocallabEnaSHMask, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::enatmMaskChanged() -{ - printf("enatmmaskChanged\n"); - - if (multiImage) { - if (enatmMask->get_inconsistent()) { - enatmMask->set_inconsistent(false); - enatmMaskConn.block(true); - enatmMask->set_active(false); - enatmMaskConn.block(false); - } - } - - if (getEnabled() && exptonemap->getEnabled()) { - if (listener) { - if (enatmMask->get_active()) { - listener->panelChanged(EvLocallabEnatmMask, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvLocallabEnatmMask, M("GENERAL_DISABLED")); - } - } - } -} - - -void Locallab::enaretiMaskChanged() -{ - printf("enaretimaskChanged\n"); - - if (multiImage) { - if (enaretiMask->get_inconsistent()) { - enaretiMask->set_inconsistent(false); - enaretiMaskConn.block(true); - enaretiMask->set_active(false); - enaretiMaskConn.block(false); - } - } - - if (getEnabled() && expreti->getEnabled()) { - if (listener) { - if (enaretiMask->get_active()) { - listener->panelChanged(EvLocallabEnaretiMask, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvLocallabEnaretiMask, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::enaretiMasktmapChanged() -{ - // printf("enacbMaskChanged\n"); - - if (multiImage) { - if (enaretiMasktmap->get_inconsistent()) { - enaretiMasktmap->set_inconsistent(false); - enaretiMasktmapConn.block(true); - enaretiMasktmap->set_active(false); - enaretiMasktmapConn.block(false); - } - } - - if (getEnabled() && expreti->getEnabled()) { - if (listener) { - if (enaretiMasktmap->get_active()) { - listener->panelChanged(EvLocallabEnaretiMasktmap, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvLocallabEnaretiMasktmap, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::enacbMaskChanged() -{ - // printf("enacbMaskChanged\n"); - - if (multiImage) { - if (enacbMask->get_inconsistent()) { - enacbMask->set_inconsistent(false); - enacbMaskConn.block(true); - enacbMask->set_active(false); - enacbMaskConn.block(false); - } - } - - if (getEnabled() && expcbdl->getEnabled()) { - if (listener) { - if (enacbMask->get_active()) { - listener->panelChanged(EvLocallabEnacbMask, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvLocallabEnacbMask, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::inversChanged() -{ - // printf("inversChanged\n"); - - if (multiImage) { - if (invers->get_inconsistent()) { - invers->set_inconsistent(false); - inversConn.block(true); - invers->set_active(false); - inversConn.block(false); - } - } - - // Update Color & Light GUI according to invers button state (to be compliant with updateSpecificGUIState function) - if (multiImage && invers->get_inconsistent()) { - sensi->show(); - llCurveEditorG->show(); - HCurveEditorG->show(); - curvactiv->hide(); - qualitycurveMethod->show(); - labqualcurv->show(); - expmaskcol->show(); - structcol->show(); - strengthgrid->hide(); - blurcolde->show(); - softradiuscol->show(); - showmaskcolMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - gridFrame->hide(); - } else if (invers->get_active()) { - sensi->show(); - llCurveEditorG->show(); - HCurveEditorG->hide(); - curvactiv->hide(); - qualitycurveMethod->hide(); - labqualcurv->hide(); - expmaskcol->hide(); - structcol->hide(); - blurcolde->show(); - gridFrame->hide(); - strengthgrid->hide(); - softradiuscol->hide(); - - } else { - sensi->show(); - llCurveEditorG->show(); - HCurveEditorG->show(); - curvactiv->hide(); - qualitycurveMethod->show(); - labqualcurv->show(); - expmaskcol->show(); - structcol->show(); - blurcolde->show(); - gridFrame->show(); - softradiuscol->show(); - - if (batchMode) { - showmaskcolMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - } - } - - if (getEnabled() && expcolor->getEnabled()) { - if (listener) { - if (invers->get_active()) { - listener->panelChanged(Evlocallabinvers, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabinvers, M("GENERAL_DISABLED")); - } - } - } -} - - -void Locallab::inversexChanged() -{ - // printf("inversChanged\n"); - - if (multiImage) { - if (inversex->get_inconsistent()) { - inversex->set_inconsistent(false); - inversexConn.block(true); - inversex->set_active(false); - inversexConn.block(false); - } - } - - // Update Color & Light GUI according to invers button state (to be compliant with updateSpecificGUIState function) - if (multiImage && inversex->get_inconsistent()) { - sensiex->show(); - curveEditorG->show(); - expmaskexp->show(); - structexp->show(); - blurexpde->show(); - shadex->show(); - expMethod->show(); - - if (expMethod->get_active_row_number() == 0) { - pdeFrame->hide(); - } else if (expMethod->get_active_row_number() == 1) { - pdeFrame->show(); - } - - softradiusexp->show(); - showmaskexpMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - } else if (inversex->get_active()) { - sensiex->show(); - curveEditorG->show(); - expmaskexp->hide(); - structexp->hide(); - shadex->hide(); - blurexpde->show(); - softradiusexp->hide(); - expMethod->hide(); - - if (expMethod->get_active_row_number() == 0) { - pdeFrame->hide(); - } else if (expMethod->get_active_row_number() == 1) { - pdeFrame->hide(); - } - - } else { - sensiex->show(); - curveEditorG->show(); - expmaskexp->show(); - structexp->show(); - blurexpde->show(); - softradiusexp->show(); - shadex->show(); - expMethod->show(); - - if (expMethod->get_active_row_number() == 0) { - pdeFrame->hide(); - } else if (expMethod->get_active_row_number() == 1) { - pdeFrame->show(); - } - - - if (batchMode) { - showmaskexpMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - } - } - - if (getEnabled() && expexpose->getEnabled()) { - if (listener) { - if (inversex->get_active()) { - listener->panelChanged(Evlocallabinversex, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabinversex, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::inversshChanged() -{ - // printf("inversChanged\n"); - - if (multiImage) { - if (inverssh->get_inconsistent()) { - inverssh->set_inconsistent(false); - inversshConn.block(true); - inverssh->set_active(false); - inversshConn.block(false); - } - } - - // Update Color & Light GUI according to invers button state (to be compliant with updateSpecificGUIState function) - if (multiImage && inverssh->get_inconsistent()) { - - sensihs->show(); - blurSHde->show(); - expmasksh->show(); - - showmaskSHMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - } else if (inverssh->get_active()) { - sensihs->show(); - expmasksh->hide(); - blurSHde->show(); - - } else { - sensihs->show(); - expmasksh->show(); - blurSHde->show(); - - if (batchMode) { - showmaskSHMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - } - } - - if (getEnabled() && expshadhigh->getEnabled()) { - if (listener) { - if (inverssh->get_active()) { - listener->panelChanged(Evlocallabinverssh, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabinverssh, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::curvactivChanged() -{ - // printf("curvactivChanged\n"); - - if (multiImage) { - if (curvactiv->get_inconsistent()) { - curvactiv->set_inconsistent(false); - curvactivConn.block(true); - curvactiv->set_active(false); - curvactivConn.block(false); - } - } - - if (getEnabled() && expcolor->getEnabled()) { - if (listener) { - if (curvactiv->get_active()) { - listener->panelChanged(Evlocallabcurvactiv, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabcurvactiv, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::activlumChanged() -{ - // printf("activlumChanged\n"); - - if (multiImage) { - if (activlum->get_inconsistent()) { - activlum->set_inconsistent(false); - activlumConn.block(true); - activlum->set_active(false); - activlumConn.block(false); - } - } - - if (getEnabled() && expblur->getEnabled()) { - if (listener) { - if (activlum->get_active()) { - listener->panelChanged(Evlocallabactivlum, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabactivlum, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::fftwlcChanged() -{ - // printf("fftwlcChanged\n"); - - if (multiImage) { - if (fftwlc->get_inconsistent()) { - fftwlc->set_inconsistent(false); - fftwlcConn.block(true); - fftwlc->set_active(false); - fftwlcConn.block(false); - } - } - - if (getEnabled() && expcontrast->getEnabled()) { - if (listener) { - if (fftwlc->get_active()) { - listener->panelChanged(Evlocallabfftwlc, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabfftwlc, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::fftwretiChanged() -{ - // printf("fftwlcChanged\n"); - - if (multiImage) { - if (fftwreti->get_inconsistent()) { - fftwreti->set_inconsistent(false); - fftwretiConn.block(true); - fftwreti->set_active(false); - fftwretiConn.block(false); - } - } - - if (getEnabled() && expreti->getEnabled()) { - if (listener) { - if (fftwreti->get_active()) { - listener->panelChanged(Evlocallabfftwreti, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabfftwreti, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::inversshaChanged() -{ - // printf("inversshaChanged\n"); - - if (multiImage) { - if (inverssha->get_inconsistent()) { - inverssha->set_inconsistent(false); - inversshaConn.block(true); - inverssha->set_active(false); - inversshaConn.block(false); - } - } - - // Update Sharpening GUI according to inverssha button state (to be compliant with updateSpecificGUIState function) - sensisha->show(); - - if (getEnabled() && expsharp->getEnabled()) { - if (listener) { - if (inverssha->get_active()) { - listener->panelChanged(Evlocallabinverssha, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabinverssha, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::equiltmChanged() -{ - // printf("inversretChanged\n"); - - if (multiImage) { - if (equiltm->get_inconsistent()) { - equiltm->set_inconsistent(false); - equiltmConn.block(true); - equiltm->set_active(false); - equiltmConn.block(false); - } - } - - - if (getEnabled() && exptonemap->getEnabled()) { - if (listener) { - if (inversret->get_active()) { - listener->panelChanged(Evlocallabequiltm, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabequiltm, M("GENERAL_DISABLED")); - } - } - } -} - - - -void Locallab::equilretChanged() -{ - // printf("inversretChanged\n"); - - if (multiImage) { - if (equilret->get_inconsistent()) { - equilret->set_inconsistent(false); - equilretConn.block(true); - equilret->set_active(false); - equilretConn.block(false); - } - } - - - if (getEnabled() && expreti->getEnabled()) { - if (listener) { - if (inversret->get_active()) { - listener->panelChanged(Evlocallabequilret, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabequilret, M("GENERAL_DISABLED")); - } - } - } -} - - - -void Locallab::inversretChanged() -{ - // printf("inversretChanged\n"); - - if (multiImage) { - if (inversret->get_inconsistent()) { - inversret->set_inconsistent(false); - inversretConn.block(true); - inversret->set_active(false); - inversretConn.block(false); - } - } - - // Update Retinex GUI according to inversret button state (to be compliant with updateSpecificGUIState function) - if (multiImage && inversret->get_inconsistent()) { - sensih->show(); - softradiusret->show(); - expmaskreti->show(); - } else if (inversret->get_active()) { - sensih->show(); - dehaz->show(); - softradiuscol->show(); - expmaskreti->hide(); - } else { - sensih->show(); - dehaz->show(); - softradiusret->show(); - expmaskreti->show(); - } - - if (getEnabled() && expreti->getEnabled()) { - if (listener) { - if (inversret->get_active()) { - listener->panelChanged(Evlocallabinversret, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabinversret, M("GENERAL_DISABLED")); - } - } - } -} - -void Locallab::setParamEditable(bool cond) -{ - // printf("setParamEditable: %d\n", cond); - - // Update params editable state for controlspotpanel - expsettings->setParamEditable(cond); - - // Color & Light - expcolor->set_sensitive(cond); - // Exposure - expexpose->set_sensitive(cond); - // Shadow highlight - expshadhigh->set_sensitive(cond); - // Vibrance - expvibrance->set_sensitive(cond); - // Soft Light - expsoft->set_sensitive(cond); - // Blur & Noise - expblur->set_sensitive(cond); - // Tone Mapping - exptonemap->set_sensitive(cond); - // Retinex - expreti->set_sensitive(cond); - // Sharpening - expsharp->set_sensitive(cond); - // Local Contrast - expcontrast->set_sensitive(cond); - // Contrast by detail levels - expcbdl->set_sensitive(cond); - // Denoise - expdenoi->set_sensitive(cond); -} - -void Locallab::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) -{ - defparams = defParams; - defpedited = pedited; - - if (pedited) { - pe = new ParamsEdited(*pedited); - } else { - pe = nullptr; - } -} - -void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pedited, int id) -{ - // printf("setDefaults\n"); - - // Set default values and edited states for controlspotpanel - expsettings->setDefaults(defParams, pedited, id); - - // Find vector index of given spot id (index = -1 if not found) - int index = -1; - - for (int i = 0; i < (int)defParams->locallab.spots.size(); i++) { - if (defParams->locallab.spots.at(i).id == id) { - index = i; - - break; - } - } - - // Set default values for adjusters - const LocallabParams::LocallabSpot* defSpot = new LocallabParams::LocallabSpot(); - - if (index != -1 && index < (int)defParams->locallab.spots.size()) { - defSpot = &defParams->locallab.spots.at(index); - } - - // Color & Light - lightness->setDefault((double)defSpot->lightness); - contrast->setDefault((double)defSpot->contrast); - chroma->setDefault((double)defSpot->chroma); - labgrid->setDefault(defSpot->labgridALow / LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX); - sensi->setDefault((double)defSpot->sensi); - structcol->setDefault((double)defSpot->structcol); - blurcolde->setDefault((double)defSpot->blurcolde); - blendmaskcol->setDefault((double)defSpot->blendmaskcol); - radmaskcol->setDefault(defSpot->radmaskcol); - chromaskcol->setDefault(defSpot->chromaskcol); - gammaskcol->setDefault(defSpot->gammaskcol); - slomaskcol->setDefault(defSpot->slomaskcol); - softradiuscol->setDefault(defSpot->softradiuscol); - // Exposure - expcomp->setDefault(defSpot->expcomp); - hlcompr->setDefault((double)defSpot->hlcompr); - hlcomprthresh->setDefault((double)defSpot->hlcomprthresh); - black->setDefault((double)defSpot->black); - shadex->setDefault((double)defSpot->shadex); - shcompr->setDefault((double)defSpot->shcompr); - expchroma->setDefault((double)defSpot->expchroma); - warm->setDefault((double)defSpot->warm); - sensiex->setDefault((double)defSpot->sensiex); - structexp->setDefault((double)defSpot->structexp); - blurexpde->setDefault((double)defSpot->blurexpde); - blendmaskexp->setDefault((double)defSpot->blendmaskexp); - radmaskexp->setDefault(defSpot->radmaskexp); - chromaskexp->setDefault(defSpot->chromaskexp); - gammaskexp->setDefault(defSpot->gammaskexp); - slomaskexp->setDefault(defSpot->slomaskexp); - softradiusexp->setDefault(defSpot->softradiusexp); - laplacexp->setDefault(defSpot->laplacexp); - balanexp->setDefault(defSpot->balanexp); - linear->setDefault(defSpot->linear); - // Shadow highlight - highlights->setDefault((double)defSpot->highlights); - h_tonalwidth->setDefault((double)defSpot->h_tonalwidth); - shadows->setDefault((double)defSpot->shadows); - s_tonalwidth->setDefault((double)defSpot->s_tonalwidth); - sh_radius->setDefault((double)defSpot->sh_radius); - sensihs->setDefault((double)defSpot->sensihs); - blendmaskSH->setDefault((double)defSpot->blendmaskSH); - radmaskSH->setDefault(defSpot->radmaskSH); - blurSHde->setDefault((double)defSpot->blurSHde); - chromaskSH->setDefault(defSpot->chromaskSH); - gammaskSH->setDefault(defSpot->gammaskSH); - slomaskSH->setDefault(defSpot->slomaskSH); - // Vibrance - saturated->setDefault((double)defSpot->saturated); - pastels->setDefault((double)defSpot->pastels); - psThreshold->setDefault(defSpot->psthreshold); - sensiv->setDefault((double)defSpot->sensiv); - // Soft Light - streng->setDefault((double)defSpot->streng); - sensisf->setDefault((double)defSpot->sensisf); - laplace->setDefault(defSpot->laplace); - // Blur & Noise - radius->setDefault(defSpot->radius); - strength->setDefault((double)defSpot->strength); - sensibn->setDefault((double)defSpot->sensibn); - // Tone Mapping - stren->setDefault(defSpot->stren); - gamma->setDefault(defSpot->gamma); - estop->setDefault(defSpot->estop); - scaltm->setDefault(defSpot->scaltm); - rewei->setDefault((double)defSpot->rewei); - satur->setDefault(defSpot->satur); - sensitm->setDefault((double)defSpot->sensitm); - softradiustm->setDefault(defSpot->softradiustm); - amount->setDefault(defSpot->amount); - blendmasktm->setDefault((double)defSpot->blendmasktm); - radmasktm->setDefault(defSpot->radmasktm); - chromasktm->setDefault(defSpot->chromasktm); - gammasktm->setDefault(defSpot->gammasktm); - slomasktm->setDefault(defSpot->slomasktm); - // Retinex - str->setDefault(defSpot->str); - chrrt->setDefault(defSpot->chrrt); - neigh->setDefault(defSpot->neigh); - vart->setDefault(defSpot->vart); - dehaz->setDefault((double)defSpot->dehaz); - sensih->setDefault((double)defSpot->sensih); - softradiusret->setDefault(defSpot->softradiusret); - blendmaskreti->setDefault((double)defSpot->blendmaskreti); - radmaskreti->setDefault(defSpot->radmaskreti); - chromaskreti->setDefault(defSpot->chromaskreti); - gammaskreti->setDefault(defSpot->gammaskreti); - slomaskreti->setDefault(defSpot->slomaskreti); - scalereti->setDefault(defSpot->scalereti); - darkness->setDefault(defSpot->darkness); - lightnessreti->setDefault(defSpot->lightnessreti); - limd->setDefault(defSpot->limd); - // Sharpening - sharcontrast->setDefault((double)defSpot->sharcontrast); - sharradius->setDefault(defSpot->sharradius); - sharamount->setDefault((double)defSpot->sharamount); - shardamping->setDefault((double)defSpot->shardamping); - shariter->setDefault((double)defSpot->shariter); - sharblur->setDefault(defSpot->sharblur); - sensisha->setDefault((double)defSpot->sensisha); - // Local Contrast - lcradius->setDefault((double)defSpot->lcradius); - lcamount->setDefault(defSpot->lcamount); - lcdarkness->setDefault(defSpot->lcdarkness); - lclightness->setDefault(defSpot->lclightness); - levelwav->setDefault(defSpot->levelwav); - residcont->setDefault(defSpot->residcont); - sensilc->setDefault((double)defSpot->sensilc); - - // Contrast by detail levels - for (int i = 0; i < 6; i++) { - multiplier[i]->setDefault(defSpot->mult[i]); - } - - chromacbdl->setDefault(defSpot->chromacbdl); - threshold->setDefault(defSpot->threshold); - sensicb->setDefault((double)defSpot->sensicb); - clarityml->setDefault(defSpot->clarityml); - contresid->setDefault((double)defSpot->contresid); - blurcbdl->setDefault(defSpot->blurcbdl); - softradiuscb->setDefault(defSpot->softradiuscb); - blendmaskcb->setDefault((double)defSpot->blendmaskcb); - radmaskcb->setDefault(defSpot->radmaskcb); - chromaskcb->setDefault(defSpot->chromaskcb); - gammaskcb->setDefault(defSpot->gammaskcb); - slomaskcb->setDefault(defSpot->slomaskcb); - - // Denoise - noiselumf->setDefault((double)defSpot->noiselumf); - noiselumf0->setDefault((double)defSpot->noiselumf0); - noiselumf2->setDefault((double)defSpot->noiselumf2); - noiselumc->setDefault((double)defSpot->noiselumc); - noiselumdetail->setDefault((double)defSpot->noiselumdetail); - noiselequal->setDefault((double)defSpot->noiselequal); - noisechrof->setDefault((double)defSpot->noisechrof); - noisechroc->setDefault((double)defSpot->noisechroc); - noisechrodetail->setDefault((double)defSpot->noisechrodetail); - adjblur->setDefault((double)defSpot->adjblur); - bilateral->setDefault((double)defSpot->bilateral); - sensiden->setDefault((double)defSpot->sensiden); - - // Set default edited states for adjusters and threshold adjusters - if (!pedited) { - // Color & Light - lightness->setDefaultEditedState(Irrelevant); - contrast->setDefaultEditedState(Irrelevant); - chroma->setDefaultEditedState(Irrelevant); - labgrid->setEdited(Edited); - sensi->setDefaultEditedState(Irrelevant); - structcol->setDefaultEditedState(Irrelevant); - strengthgrid->setDefault((double)defSpot->strengthgrid); - blurcolde->setDefaultEditedState(Irrelevant); - blendmaskcol->setDefaultEditedState(Irrelevant); - radmaskcol->setDefaultEditedState(Irrelevant); - chromaskcol->setDefaultEditedState(Irrelevant); - gammaskcol->setDefaultEditedState(Irrelevant); - slomaskcol->setDefaultEditedState(Irrelevant); - softradiuscol->setDefaultEditedState(Irrelevant); - // Exposure - expcomp->setDefaultEditedState(Irrelevant); - hlcompr->setDefaultEditedState(Irrelevant); - hlcomprthresh->setDefaultEditedState(Irrelevant); - black->setDefaultEditedState(Irrelevant); - shadex->setDefaultEditedState(Irrelevant); - shcompr->setDefaultEditedState(Irrelevant); - expchroma->setDefaultEditedState(Irrelevant); - warm->setDefaultEditedState(Irrelevant); - sensiex->setDefaultEditedState(Irrelevant); - structexp->setDefaultEditedState(Irrelevant); - blurexpde->setDefaultEditedState(Irrelevant); - blendmaskexp->setDefaultEditedState(Irrelevant); - radmaskexp->setDefaultEditedState(Irrelevant); - chromaskexp->setDefaultEditedState(Irrelevant); - gammaskexp->setDefaultEditedState(Irrelevant); - slomaskexp->setDefaultEditedState(Irrelevant); - softradiusexp->setDefaultEditedState(Irrelevant); - laplacexp->setDefaultEditedState(Irrelevant); - balanexp->setDefaultEditedState(Irrelevant); - linear->setDefaultEditedState(Irrelevant); - // Shadow highlight - highlights->setDefaultEditedState(Irrelevant); - h_tonalwidth->setDefaultEditedState(Irrelevant); - shadows->setDefaultEditedState(Irrelevant); - s_tonalwidth->setDefaultEditedState(Irrelevant); - sh_radius->setDefaultEditedState(Irrelevant); - sensihs->setDefaultEditedState(Irrelevant); - blendmaskSH->setDefaultEditedState(Irrelevant); - radmaskSH->setDefaultEditedState(Irrelevant); - blurSHde->setDefaultEditedState(Irrelevant); - chromaskSH->setDefaultEditedState(Irrelevant); - gammaskSH->setDefaultEditedState(Irrelevant); - slomaskSH->setDefaultEditedState(Irrelevant); - // Vibrance - saturated->setDefaultEditedState(Irrelevant); - pastels->setDefaultEditedState(Irrelevant); - psThreshold->setDefaultEditedState(Irrelevant); - sensiv->setDefaultEditedState(Irrelevant); - // Soft Light - streng->setDefaultEditedState(Irrelevant); - sensisf->setDefaultEditedState(Irrelevant); - laplace->setDefaultEditedState(Irrelevant); - // Blur & Noise - radius->setDefaultEditedState(Irrelevant); - strength->setDefaultEditedState(Irrelevant); - sensibn->setDefaultEditedState(Irrelevant); - // Tone Mapping - stren->setDefaultEditedState(Irrelevant); - gamma->setDefaultEditedState(Irrelevant); - estop->setDefaultEditedState(Irrelevant); - scaltm->setDefaultEditedState(Irrelevant); - rewei->setDefaultEditedState(Irrelevant); - satur->setDefaultEditedState(Irrelevant); - sensitm->setDefaultEditedState(Irrelevant); - softradiustm->setDefaultEditedState(Irrelevant); - amount->setDefaultEditedState(Irrelevant); - blendmasktm->setDefaultEditedState(Irrelevant); - radmasktm->setDefaultEditedState(Irrelevant); - chromasktm->setDefaultEditedState(Irrelevant); - gammasktm->setDefaultEditedState(Irrelevant); - slomasktm->setDefaultEditedState(Irrelevant); - // Retinex - str->setDefaultEditedState(Irrelevant); - chrrt->setDefaultEditedState(Irrelevant); - neigh->setDefaultEditedState(Irrelevant); - vart->setDefaultEditedState(Irrelevant); - dehaz->setDefaultEditedState(Irrelevant); - sensih->setDefaultEditedState(Irrelevant); - softradiusret->setDefaultEditedState(Irrelevant); - blendmaskreti->setDefaultEditedState(Irrelevant); - radmaskreti->setDefaultEditedState(Irrelevant); - chromaskreti->setDefaultEditedState(Irrelevant); - gammaskreti->setDefaultEditedState(Irrelevant); - slomaskreti->setDefaultEditedState(Irrelevant); - scalereti->setDefaultEditedState(Irrelevant); - darkness->setDefaultEditedState(Irrelevant); - lightnessreti->setDefaultEditedState(Irrelevant); - limd->setDefaultEditedState(Irrelevant); - // Sharpening - sharcontrast->setDefaultEditedState(Irrelevant); - sharradius->setDefaultEditedState(Irrelevant); - sharamount->setDefaultEditedState(Irrelevant); - shardamping->setDefaultEditedState(Irrelevant); - shariter->setDefaultEditedState(Irrelevant); - sharblur->setDefaultEditedState(Irrelevant); - sensisha->setDefaultEditedState(Irrelevant); - // Local Contrast - lcradius->setDefaultEditedState(Irrelevant); - lcamount->setDefaultEditedState(Irrelevant); - lcdarkness->setDefaultEditedState(Irrelevant); - lclightness->setDefaultEditedState(Irrelevant); - levelwav->setDefaultEditedState(Irrelevant); - residcont->setDefaultEditedState(Irrelevant); - sensilc->setDefaultEditedState(Irrelevant); - - // Contrast by detail levels - for (int i = 0; i < 6; i++) { - multiplier[i]->setDefaultEditedState(Irrelevant); - } - - chromacbdl->setDefaultEditedState(Irrelevant); - threshold->setDefaultEditedState(Irrelevant); - sensicb->setDefaultEditedState(Irrelevant); - clarityml->setDefaultEditedState(Irrelevant); - contresid->setDefaultEditedState(Irrelevant); - blurcbdl->setDefaultEditedState(Irrelevant); - softradiuscb->setDefaultEditedState(Irrelevant); - blendmaskcb->setDefaultEditedState(Irrelevant); - radmaskcb->setDefaultEditedState(Irrelevant); - chromaskcb->setDefaultEditedState(Irrelevant); - gammaskcb->setDefaultEditedState(Irrelevant); - slomaskcb->setDefaultEditedState(Irrelevant); - - // Denoise - noiselumf->setDefaultEditedState(Irrelevant); - noiselumf0->setDefaultEditedState(Irrelevant); - noiselumf2->setDefaultEditedState(Irrelevant); - noiselumc->setDefaultEditedState(Irrelevant); - noiselumdetail->setDefaultEditedState(Irrelevant); - noiselequal->setDefaultEditedState(Irrelevant); - noisechrof->setDefaultEditedState(Irrelevant); - noisechroc->setDefaultEditedState(Irrelevant); - noisechrodetail->setDefaultEditedState(Irrelevant); - adjblur->setDefaultEditedState(Irrelevant); - bilateral->setDefaultEditedState(Irrelevant); - sensiden->setDefaultEditedState(Irrelevant); - } else { - const LocallabParamsEdited::LocallabSpotEdited* defSpotState = new LocallabParamsEdited::LocallabSpotEdited(true); - - if (index != 1 && index < (int)pedited->locallab.spots.size()) { - defSpotState = &pedited->locallab.spots.at(index); - } - - // Color & Light - lightness->setDefaultEditedState(defSpotState->lightness ? Edited : UnEdited); - contrast->setDefaultEditedState(defSpotState->contrast ? Edited : UnEdited); - chroma->setDefaultEditedState(defSpotState->chroma ? Edited : UnEdited); - labgrid->setEdited((defSpotState->labgridALow || defSpotState->labgridBLow || defSpotState->labgridAHigh || defSpotState->labgridBHigh) ? Edited : UnEdited); - sensi->setDefaultEditedState(defSpotState->sensi ? Edited : UnEdited); - structcol->setDefaultEditedState(defSpotState->structcol ? Edited : UnEdited); - strengthgrid->setDefaultEditedState(defSpotState->strengthgrid ? Edited : UnEdited); - blurcolde->setDefaultEditedState(defSpotState->blurcolde ? Edited : UnEdited); - blendmaskcol->setDefaultEditedState(defSpotState->blendmaskcol ? Edited : UnEdited); - radmaskcol->setDefaultEditedState(defSpotState->radmaskcol ? Edited : UnEdited); - chromaskcol->setDefaultEditedState(defSpotState->chromaskcol ? Edited : UnEdited); - gammaskcol->setDefaultEditedState(defSpotState->gammaskcol ? Edited : UnEdited); - slomaskcol->setDefaultEditedState(defSpotState->slomaskcol ? Edited : UnEdited); - softradiuscol->setDefaultEditedState(defSpotState->softradiuscol ? Edited : UnEdited); - // Exposure - expcomp->setDefaultEditedState(defSpotState->expcomp ? Edited : UnEdited); - hlcompr->setDefaultEditedState(defSpotState->hlcompr ? Edited : UnEdited); - hlcomprthresh->setDefaultEditedState(defSpotState->hlcomprthresh ? Edited : UnEdited); - black->setDefaultEditedState(defSpotState->black ? Edited : UnEdited); - shadex->setDefaultEditedState(defSpotState->shadex ? Edited : UnEdited); - shcompr->setDefaultEditedState(defSpotState->shcompr ? Edited : UnEdited); - expchroma->setDefaultEditedState(defSpotState->expchroma ? Edited : UnEdited); - warm->setDefaultEditedState(defSpotState->warm ? Edited : UnEdited); - sensiex->setDefaultEditedState(defSpotState->sensiex ? Edited : UnEdited); - structexp->setDefaultEditedState(defSpotState->structexp ? Edited : UnEdited); - blurexpde->setDefaultEditedState(defSpotState->blurexpde ? Edited : UnEdited); - blendmaskexp->setDefaultEditedState(defSpotState->blendmaskexp ? Edited : UnEdited); - radmaskexp->setDefaultEditedState(defSpotState->radmaskexp ? Edited : UnEdited); - chromaskexp->setDefaultEditedState(defSpotState->chromaskexp ? Edited : UnEdited); - gammaskexp->setDefaultEditedState(defSpotState->gammaskexp ? Edited : UnEdited); - slomaskexp->setDefaultEditedState(defSpotState->slomaskexp ? Edited : UnEdited); - softradiusexp->setDefaultEditedState(defSpotState->softradiusexp ? Edited : UnEdited); - laplacexp->setDefaultEditedState(defSpotState->laplacexp ? Edited : UnEdited); - balanexp->setDefaultEditedState(defSpotState->balanexp ? Edited : UnEdited); - linear->setDefaultEditedState(defSpotState->linear ? Edited : UnEdited); - // Shadow highlight - highlights->setDefaultEditedState(defSpotState->highlights ? Edited : UnEdited); - h_tonalwidth->setDefaultEditedState(defSpotState->h_tonalwidth ? Edited : UnEdited); - shadows->setDefaultEditedState(defSpotState->shadows ? Edited : UnEdited); - s_tonalwidth->setDefaultEditedState(defSpotState->s_tonalwidth ? Edited : UnEdited); - sh_radius->setDefaultEditedState(defSpotState->sh_radius ? Edited : UnEdited); - sensihs->setDefaultEditedState(defSpotState->sensihs ? Edited : UnEdited); - blendmaskSH->setDefaultEditedState(defSpotState->blendmaskSH ? Edited : UnEdited); - radmaskSH->setDefaultEditedState(defSpotState->radmaskSH ? Edited : UnEdited); - blurSHde->setDefaultEditedState(defSpotState->blurSHde ? Edited : UnEdited); - chromaskSH->setDefaultEditedState(defSpotState->chromaskSH ? Edited : UnEdited); - gammaskSH->setDefaultEditedState(defSpotState->gammaskSH ? Edited : UnEdited); - slomaskSH->setDefaultEditedState(defSpotState->slomaskSH ? Edited : UnEdited); - // Vibrance - saturated->setDefaultEditedState(defSpotState->saturated ? Edited : UnEdited); - pastels->setDefaultEditedState(defSpotState->pastels ? Edited : UnEdited); - psThreshold->setDefaultEditedState(defSpotState->psthreshold ? Edited : UnEdited); - sensiv->setDefaultEditedState(defSpotState->sensiv ? Edited : UnEdited); - // Soft Light - streng->setDefaultEditedState(defSpotState->streng ? Edited : UnEdited); - sensisf->setDefaultEditedState(defSpotState->sensisf ? Edited : UnEdited); - laplace->setDefaultEditedState(defSpotState->laplace ? Edited : UnEdited); - // Blur & Noise - radius->setDefaultEditedState(defSpotState->radius ? Edited : UnEdited); - strength->setDefaultEditedState(defSpotState->strength ? Edited : UnEdited); - sensibn->setDefaultEditedState(defSpotState->sensibn ? Edited : UnEdited); - // Tone Mapping - stren->setDefaultEditedState(defSpotState->stren ? Edited : UnEdited); - gamma->setDefaultEditedState(defSpotState->gamma ? Edited : UnEdited); - estop->setDefaultEditedState(defSpotState->estop ? Edited : UnEdited); - scaltm->setDefaultEditedState(defSpotState->scaltm ? Edited : UnEdited); - rewei->setDefaultEditedState(defSpotState->rewei ? Edited : UnEdited); - satur->setDefaultEditedState(defSpotState->satur ? Edited : UnEdited); - sensitm->setDefaultEditedState(defSpotState->sensitm ? Edited : UnEdited); - softradiustm->setDefaultEditedState(defSpotState->softradiustm ? Edited : UnEdited); - amount->setDefaultEditedState(defSpotState->amount ? Edited : UnEdited); - blendmasktm->setDefaultEditedState(defSpotState->blendmasktm ? Edited : UnEdited); - radmasktm->setDefaultEditedState(defSpotState->radmasktm ? Edited : UnEdited); - chromasktm->setDefaultEditedState(defSpotState->chromasktm ? Edited : UnEdited); - gammasktm->setDefaultEditedState(defSpotState->gammasktm ? Edited : UnEdited); - slomasktm->setDefaultEditedState(defSpotState->slomasktm ? Edited : UnEdited); - // Retinex - str->setDefaultEditedState(defSpotState->str ? Edited : UnEdited); - chrrt->setDefaultEditedState(defSpotState->chrrt ? Edited : UnEdited); - neigh->setDefaultEditedState(defSpotState->neigh ? Edited : UnEdited); - vart->setDefaultEditedState(defSpotState->vart ? Edited : UnEdited); - dehaz->setDefaultEditedState(defSpotState->dehaz ? Edited : UnEdited); - sensih->setDefaultEditedState(defSpotState->sensih ? Edited : UnEdited); - softradiusret->setDefaultEditedState(defSpotState->softradiusret ? Edited : UnEdited); - blendmaskreti->setDefaultEditedState(defSpotState->blendmaskreti ? Edited : UnEdited); - radmaskreti->setDefaultEditedState(defSpotState->radmaskreti ? Edited : UnEdited); - chromaskreti->setDefaultEditedState(defSpotState->chromaskreti ? Edited : UnEdited); - gammaskreti->setDefaultEditedState(defSpotState->gammaskreti ? Edited : UnEdited); - slomaskreti->setDefaultEditedState(defSpotState->slomaskreti ? Edited : UnEdited); - scalereti->setDefaultEditedState(defSpotState->scalereti ? Edited : UnEdited); - darkness->setDefaultEditedState(defSpotState->darkness ? Edited : UnEdited); - lightnessreti->setDefaultEditedState(defSpotState->lightnessreti ? Edited : UnEdited); - limd->setDefaultEditedState(defSpotState->limd ? Edited : UnEdited); - // Sharpening - sharcontrast->setDefaultEditedState(defSpotState->sharcontrast ? Edited : UnEdited); - sharradius->setDefaultEditedState(defSpotState->sharradius ? Edited : UnEdited); - sharamount->setDefaultEditedState(defSpotState->sharamount ? Edited : UnEdited); - shardamping->setDefaultEditedState(defSpotState->shardamping ? Edited : UnEdited); - shariter->setDefaultEditedState(defSpotState->shariter ? Edited : UnEdited); - sharblur->setDefaultEditedState(defSpotState->sharblur ? Edited : UnEdited); - sensisha->setDefaultEditedState(defSpotState->sensisha ? Edited : UnEdited); - // Local Contrast - lcradius->setDefaultEditedState(defSpotState->lcradius ? Edited : UnEdited); - lcamount->setDefaultEditedState(defSpotState->lcamount ? Edited : UnEdited); - lcdarkness->setDefaultEditedState(defSpotState->lcdarkness ? Edited : UnEdited); - lclightness->setDefaultEditedState(defSpotState->lclightness ? Edited : UnEdited); - levelwav->setDefaultEditedState(defSpotState->levelwav ? Edited : UnEdited); - residcont->setDefaultEditedState(defSpotState->residcont ? Edited : UnEdited); - sensilc->setDefaultEditedState(defSpotState->sensilc ? Edited : UnEdited); - - // Contrast by detail levels - for (int i = 0; i < 6; i++) { - multiplier[i]->setDefaultEditedState(defSpotState->mult[i] ? Edited : UnEdited); - } - - chromacbdl->setDefaultEditedState(defSpotState->chromacbdl ? Edited : UnEdited); - threshold->setDefaultEditedState(defSpotState->threshold ? Edited : UnEdited); - sensicb->setDefaultEditedState(defSpotState->sensicb ? Edited : UnEdited); - clarityml->setDefaultEditedState(defSpotState->clarityml ? Edited : UnEdited); - contresid->setDefaultEditedState(defSpotState->contresid ? Edited : UnEdited); - blurcbdl->setDefaultEditedState(defSpotState->blurcbdl ? Edited : UnEdited); - softradiuscb->setDefaultEditedState(defSpotState->softradiuscb ? Edited : UnEdited); - - blendmaskcb->setDefaultEditedState(defSpotState->blendmaskcb ? Edited : UnEdited); - radmaskcb->setDefaultEditedState(defSpotState->radmaskcb ? Edited : UnEdited); - chromaskcb->setDefaultEditedState(defSpotState->chromaskcb ? Edited : UnEdited); - gammaskcb->setDefaultEditedState(defSpotState->gammaskcb ? Edited : UnEdited); - slomaskcb->setDefaultEditedState(defSpotState->slomaskcb ? Edited : UnEdited); - - // Denoise - noiselumf->setDefaultEditedState(defSpotState->noiselumf ? Edited : UnEdited); - noiselumf0->setDefaultEditedState(defSpotState->noiselumf0 ? Edited : UnEdited); - noiselumf2->setDefaultEditedState(defSpotState->noiselumf2 ? Edited : UnEdited); - noiselumc->setDefaultEditedState(defSpotState->noiselumc ? Edited : UnEdited); - noiselumdetail->setDefaultEditedState(defSpotState->noiselumdetail ? Edited : UnEdited); - noiselequal->setDefaultEditedState(defSpotState->noiselequal ? Edited : UnEdited); - noisechrof->setDefaultEditedState(defSpotState->noisechrof ? Edited : UnEdited); - noisechroc->setDefaultEditedState(defSpotState->noisechroc ? Edited : UnEdited); - noisechrodetail->setDefaultEditedState(defSpotState->noisechrodetail ? Edited : UnEdited); - adjblur->setDefaultEditedState(defSpotState->adjblur ? Edited : UnEdited); - bilateral->setDefaultEditedState(defSpotState->bilateral ? Edited : UnEdited); - sensiden->setDefaultEditedState(defSpotState->sensiden ? Edited : UnEdited); - } -} - -void Locallab::adjusterAutoToggled(Adjuster* a, bool newval) -{ - // Not used -} - -void Locallab::adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) -{ - // Not used -} -void Locallab::adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) -{ - // Not used -} - -void Locallab::adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) -{ - // Not used -} - -void Locallab::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) -{ - // Not used -} - -void Locallab::adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) -{ - // printf("adjusterChangedTS\n"); - - if (getEnabled() && expvibrance->getEnabled()) { - if (listener) { - listener->panelChanged(EvlocallabPastSatThreshold, psThreshold->getHistoryString()); - } - } -} - -void Locallab::adjusterChanged(Adjuster * a, double newval) -{ - // printf("adjusterChanged\n"); - - // Color & Light - if (getEnabled() && expcolor->getEnabled()) { - if (a == lightness) { - if (listener) { - listener->panelChanged(Evlocallablightness, lightness->getTextValue()); - } - } - - if (a == contrast) { - if (listener) { - listener->panelChanged(Evlocallabcontrast, contrast->getTextValue()); - } - } - - if (a == chroma) { - if (listener) { - listener->panelChanged(Evlocallabchroma, chroma->getTextValue()); - } - } - - if (a == strengthgrid) { - if (listener) { - listener->panelChanged(EvLocallabLabstrengthgrid, strengthgrid->getTextValue()); - } - } - - if (a == sensi) { - if (listener) { - listener->panelChanged(Evlocallabsensi, sensi->getTextValue()); - } - } - - if (a == blurcolde) { - if (listener) { - listener->panelChanged(Evlocallabblurcolde, blurcolde->getTextValue()); - } - } - - if (a == structcol) { - if (listener) { - listener->panelChanged(Evlocallabstructcol, structcol->getTextValue()); - } - } - - if (a == blendmaskcol) { - if (listener) { - listener->panelChanged(Evlocallabblendmaskcol, blendmaskcol->getTextValue()); - } - } - - if (a == radmaskcol) { - if (listener) { - listener->panelChanged(Evlocallabradmaskcol, radmaskcol->getTextValue()); - } - } - - if (a == chromaskcol) { - if (listener) { - listener->panelChanged(Evlocallabchromaskcol, chromaskcol->getTextValue()); - } - } - - if (a == gammaskcol) { - if (listener) { - listener->panelChanged(Evlocallabgammaskcol, gammaskcol->getTextValue()); - } - } - - if (a == slomaskcol) { - if (listener) { - listener->panelChanged(Evlocallabslomaskcol, slomaskcol->getTextValue()); - } - } - - if (a == softradiuscol) { - if (listener) { - listener->panelChanged(Evlocallabsoftradiuscol, softradiuscol->getTextValue()); - } - } - - } - - // Exposure - if (a == black) { - // Update Exposure GUI according to black adjuster state (to be compliant with updateSpecificGUIState function) - if (multiImage && black->getEditedState() != Edited) { - shcompr->set_sensitive(true); - } else { - shcompr->set_sensitive(!((int)black->getValue() == 0)); // At black = 0, shcompr value has no effect - } - } - - if (a == shadex) { - // Update Exposure GUI according to shadex adjuster state (to be compliant with updateSpecificGUIState function) - if (multiImage && shadex->getEditedState() != Edited) { - shcompr->set_sensitive(true); - } else { - shcompr->set_sensitive(!((int)shadex->getValue() == 0)); // At black = 0, shcompr value has no effect - } - } - - if (getEnabled() && expexpose->getEnabled()) { - if (a == expcomp) { - if (listener) { - listener->panelChanged(Evlocallabexpcomp, expcomp->getTextValue()); - } - } - - if (a == hlcompr) { - if (listener) { - listener->panelChanged(Evlocallabhlcompr, hlcompr->getTextValue()); - } - } - - if (a == hlcomprthresh) { - if (listener) { - listener->panelChanged(Evlocallabhlcomprthresh, hlcomprthresh->getTextValue()); - } - } - - if (a == black) { - if (listener) { - listener->panelChanged(Evlocallabblack, black->getTextValue()); - } - } - - if (a == shadex) { - if (listener) { - listener->panelChanged(Evlocallabshadex, shadex->getTextValue()); - } - } - - if (a == shcompr) { - if (listener) { - listener->panelChanged(Evlocallabshcompr, shcompr->getTextValue()); - } - } - - if (a == expchroma) { - if (listener) { - listener->panelChanged(Evlocallabexpchroma, expchroma->getTextValue()); - } - } - - if (a == warm) { - if (listener) { - listener->panelChanged(Evlocallabwarm, warm->getTextValue()); - } - } - - if (a == sensiex) { - if (listener) { - listener->panelChanged(Evlocallabsensiex, sensiex->getTextValue()); - } - } - - if (a == structexp) { - if (listener) { - listener->panelChanged(Evlocallabstructexp, structexp->getTextValue()); - } - } - - if (a == blurexpde) { - if (listener) { - listener->panelChanged(Evlocallabblurexpde, blurexpde->getTextValue()); - } - } - - if (a == blendmaskexp) { - if (listener) { - listener->panelChanged(Evlocallabblendmaskexp, blendmaskexp->getTextValue()); - } - } - - if (a == radmaskexp) { - if (listener) { - listener->panelChanged(Evlocallabradmaskexp, radmaskexp->getTextValue()); - } - } - - if (a == chromaskexp) { - if (listener) { - listener->panelChanged(Evlocallabchromaskexp, chromaskexp->getTextValue()); - } - } - - if (a == gammaskexp) { - if (listener) { - listener->panelChanged(Evlocallabgammaskexp, gammaskexp->getTextValue()); - } - } - - if (a == slomaskexp) { - if (listener) { - listener->panelChanged(Evlocallabslomaskexp, slomaskexp->getTextValue()); - } - } - - if (a == softradiusexp) { - if (listener) { - listener->panelChanged(Evlocallabsoftradiusexp, softradiusexp->getTextValue()); - } - } - - if (a == laplacexp) { - if (listener) { - listener->panelChanged(Evlocallablaplacexp, laplacexp->getTextValue()); - } - } - - if (a == balanexp) { - if (listener) { - listener->panelChanged(Evlocallabbalanexp, balanexp->getTextValue()); - } - } - - if (a == linear) { - if (listener) { - listener->panelChanged(Evlocallablinear, linear->getTextValue()); - } - } - - } - - if (getEnabled() && expshadhigh->getEnabled()) { - - if (a == highlights) { - if (listener) { - listener->panelChanged(Evlocallabhighlights, highlights->getTextValue()); - } - } - - if (a == h_tonalwidth) { - if (listener) { - listener->panelChanged(Evlocallabh_tonalwidth, h_tonalwidth->getTextValue()); - } - } - - if (a == shadows) { - if (listener) { - listener->panelChanged(Evlocallabshadows, shadows->getTextValue()); - } - } - - if (a == s_tonalwidth) { - if (listener) { - listener->panelChanged(Evlocallabs_tonalwidth, s_tonalwidth->getTextValue()); - } - } - - if (a == sh_radius) { - if (listener) { - listener->panelChanged(Evlocallabsh_radius, sh_radius->getTextValue()); - } - } - - if (a == sensihs) { - if (listener) { - listener->panelChanged(Evlocallabsensihs, sensihs->getTextValue()); - } - } - - if (a == blendmaskSH) { - if (listener) { - listener->panelChanged(EvlocallabblendmaskSH, blendmaskSH->getTextValue()); - } - } - - if (a == radmaskSH) { - if (listener) { - listener->panelChanged(EvlocallabradmaskSH, radmaskSH->getTextValue()); - } - } - - if (a == blurSHde) { - if (listener) { - listener->panelChanged(EvlocallabblurSHde, blurSHde->getTextValue()); - } - } - - if (a == chromaskSH) { - if (listener) { - listener->panelChanged(EvlocallabchromaskSH, chromaskSH->getTextValue()); - } - } - - if (a == gammaskSH) { - if (listener) { - listener->panelChanged(EvlocallabgammaskSH, gammaskSH->getTextValue()); - } - } - - if (a == slomaskSH) { - if (listener) { - listener->panelChanged(EvlocallabslomaskSH, slomaskSH->getTextValue()); - } - } - - } - - // Vibrance - if (a == pastels && pastSatTog->get_active() && !(multiImage && pastSatTog->get_inconsistent())) { - saturated->setValue(newval); - } - - if (getEnabled() && expvibrance->getEnabled()) { - if (a == saturated && !pastSatTog->get_active()) { - if (listener) { - listener->panelChanged(EvlocallabSaturated, saturated->getTextValue()); - } - } - - if (a == pastels) { - if (listener) { - listener->panelChanged(EvlocallabPastels, pastels->getTextValue()); - } - } - - if (a == sensiv) { - if (listener) { - listener->panelChanged(Evlocallabsensiv, sensiv->getTextValue()); - } - } - } - - // Soft Light - if (getEnabled() && expsoft->getEnabled()) { - if (a == streng) { - if (listener) { - listener->panelChanged(Evlocallabstreng, streng->getTextValue()); - } - } - - if (a == sensisf) { - if (listener) { - listener->panelChanged(Evlocallabsensisf, sensisf->getTextValue()); - } - } - - if (a == laplace) { - if (listener) { - listener->panelChanged(Evlocallablaplace, laplace->getTextValue()); - } - } - - } - - - // Blur & Noise - if (getEnabled() && expblur->getEnabled()) { - if (a == radius) { - if (listener) { - listener->panelChanged(Evlocallabradius, radius->getTextValue()); - } - } - - if (a == strength) { - if (listener) { - listener->panelChanged(Evlocallabstrength, strength->getTextValue()); - } - } - - if (a == sensibn) { - if (listener) { - listener->panelChanged(Evlocallabsensibn, sensibn->getTextValue()); - } - } - } - - // Tone Mapping - if (getEnabled() && exptonemap->getEnabled()) { - if (a == stren) { - if (listener) { - listener->panelChanged(Evlocallabstren, stren->getTextValue()); - } - } - - if (a == gamma) { - if (listener) { - listener->panelChanged(Evlocallabgamma, gamma->getTextValue()); - } - } - - if (a == estop) { - if (listener) { - listener->panelChanged(Evlocallabestop, estop->getTextValue()); - } - } - - if (a == scaltm) { - if (listener) { - listener->panelChanged(Evlocallabscaltm, scaltm->getTextValue()); - } - } - - if (a == rewei) { - if (listener) { - listener->panelChanged(Evlocallabrewei, rewei->getTextValue()); - } - } - - if (a == sensitm) { - if (listener) { - listener->panelChanged(Evlocallabsensitm, sensitm->getTextValue()); - } - } - - if (a == softradiustm) { - if (listener) { - listener->panelChanged(Evlocallabsoftradiustm, softradiustm->getTextValue()); - } - } - - if (a == amount) { - if (listener) { - listener->panelChanged(Evlocallabamount, amount->getTextValue()); - } - } - - if (a == satur) { - if (listener) { - listener->panelChanged(Evlocallabsatur, satur->getTextValue()); - } - } - - if (a == blendmasktm) { - if (listener) { - listener->panelChanged(Evlocallabblendmasktm, blendmasktm->getTextValue()); - } - } - - if (a == radmasktm) { - if (listener) { - listener->panelChanged(Evlocallabradmasktm, radmasktm->getTextValue()); - } - } - - if (a == chromasktm) { - if (listener) { - listener->panelChanged(Evlocallabchromasktm, chromasktm->getTextValue()); - } - } - - if (a == gammasktm) { - if (listener) { - listener->panelChanged(Evlocallabgammasktm, gammasktm->getTextValue()); - } - } - - if (a == slomasktm) { - if (listener) { - listener->panelChanged(Evlocallabslomasktm, slomasktm->getTextValue()); - } - } - - - } - - // Retinex - if (getEnabled() && expreti->getEnabled()) { - if (a == str) { - if (listener) { - listener->panelChanged(Evlocallabstr, str->getTextValue()); - } - } - - if (a == chrrt) { - if (listener) { - listener->panelChanged(Evlocallabchrrt, chrrt->getTextValue()); - } - } - - if (a == neigh) { - if (listener) { - listener->panelChanged(Evlocallabneigh, neigh->getTextValue()); - } - } - - if (a == vart) { - if (listener) { - listener->panelChanged(Evlocallabvart, vart->getTextValue()); - } - } - - if (a == dehaz) { - if (listener) { - listener->panelChanged(Evlocallabdehaz, dehaz->getTextValue()); - } - } - - if (a == sensih) { - if (listener) { - listener->panelChanged(Evlocallabsensih, sensih->getTextValue()); - } - } - - if (a == softradiusret) { - if (listener) { - listener->panelChanged(Evlocallabsoftradiusret, softradiusret->getTextValue()); - } - } - - if (a == blendmaskreti) { - if (listener) { - listener->panelChanged(Evlocallabblendmaskreti, blendmaskreti->getTextValue()); - } - } - - if (a == radmaskreti) { - if (listener) { - listener->panelChanged(Evlocallabradmaskreti, radmaskreti->getTextValue()); - } - } - - if (a == chromaskreti) { - if (listener) { - listener->panelChanged(Evlocallabchromaskreti, chromaskreti->getTextValue()); - } - } - - if (a == gammaskreti) { - if (listener) { - listener->panelChanged(Evlocallabgammaskreti, gammaskreti->getTextValue()); - } - } - - if (a == slomaskreti) { - if (listener) { - listener->panelChanged(Evlocallabslomaskreti, slomaskreti->getTextValue()); - } - } - - if (a == scalereti) { - if (scalereti->getValue() == 1) { - // limd->hide(); - LocalcurveEditorgainT->hide(); - retinexMethod->hide(); - } else { - // limd->show(); - LocalcurveEditorgainT->show(); - retinexMethod->show(); - } - - if (listener) { - listener->panelChanged(Evlocallabscalereti, scalereti->getTextValue()); - } - } - - if (a == darkness) { - if (listener) { - listener->panelChanged(Evlocallabdarkness, darkness->getTextValue()); - } - } - - if (a == lightnessreti) { - if (listener) { - listener->panelChanged(Evlocallablightnessreti, lightnessreti->getTextValue()); - } - } - - if (a == limd) { - if (listener) { - listener->panelChanged(Evlocallablimd, limd->getTextValue()); - } - } - - } - - // Sharpening - if (getEnabled() && expsharp->getEnabled()) { - if (a == sharcontrast) { - if (listener) { - listener->panelChanged(Evlocallabsharcontrast, sharcontrast->getTextValue()); - } - } - - if (a == sharradius) { - if (listener) { - listener->panelChanged(Evlocallabsharradius, sharradius->getTextValue()); - } - } - - if (a == sharamount) { - if (listener) { - listener->panelChanged(Evlocallabsharamount, sharamount->getTextValue()); - } - } - - if (a == shardamping) { - if (listener) { - listener->panelChanged(Evlocallabshardamping, shardamping->getTextValue()); - } - } - - if (a == shariter) { - if (listener) { - listener->panelChanged(Evlocallabshariter, shariter->getTextValue()); - } - } - - if (a == sharblur) { - if (listener) { - listener->panelChanged(Evlocallabsharblur, sharblur->getTextValue()); - } - } - - if (a == sensisha) { - if (listener) { - listener->panelChanged(Evlocallabsensis, sensisha->getTextValue()); - } - } - } - - // Local Contrast - if (getEnabled() && expcontrast->getEnabled()) { - if (a == lcradius) { - if (listener) { - listener->panelChanged(Evlocallablcradius, lcradius->getTextValue()); - } - } - - if (a == lcamount) { - if (listener) { - listener->panelChanged(Evlocallablcamount, lcamount->getTextValue()); - } - } - - if (a == lcdarkness) { - if (listener) { - listener->panelChanged(Evlocallablcdarkness, lcdarkness->getTextValue()); - } - } - - if (a == lclightness) { - if (listener) { - listener->panelChanged(Evlocallablclightness, lclightness->getTextValue()); - } - } - - if (a == levelwav) { - if (listener) { - listener->panelChanged(Evlocallablevelwav, levelwav->getTextValue()); - } - } - - if (a == residcont) { - if (listener) { - listener->panelChanged(Evlocallabresidcont, residcont->getTextValue()); - } - } - - if (a == sensilc) { - if (listener) { - listener->panelChanged(Evlocallabsensilc, sensilc->getTextValue()); - } - } - } - - // Contrast by detail levels - if (getEnabled() && expcbdl->getEnabled()) { - if (a == multiplier[0] || a == multiplier[1] || a == multiplier[2] || a == multiplier[3] || a == multiplier[4] || a == multiplier[5]) { - if (listener) { - listener->panelChanged(EvlocallabEqualizer, - Glib::ustring::compose("%1, %2, %3, %4, %5, %6", - Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[0]->getValue()), - Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[1]->getValue()), - Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[2]->getValue()), - Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[3]->getValue()), - Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[4]->getValue()), - Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[5]->getValue()))); - } - } - - if (a == chromacbdl) { - if (listener) { - listener->panelChanged(Evlocallabchromacbdl, chromacbdl->getTextValue()); - } - } - - if (a == threshold) { - if (listener) { - listener->panelChanged(EvlocallabThresho, threshold->getTextValue()); - } - } - - if (a == sensicb) { - if (listener) { - listener->panelChanged(Evlocallabsensicb, sensicb->getTextValue()); - } - } - - if (a == clarityml) { - //contresid->setValue(0.); - - if (listener) { - listener->panelChanged(EvLocallabclarityml, clarityml->getTextValue()); - } - } - - if (a == contresid) { - - if (listener) { - listener->panelChanged(EvLocallabcontresid, contresid->getTextValue()); - } - } - - if (a == blurcbdl) { - - if (listener) { - listener->panelChanged(EvLocallabblurcbdl, blurcbdl->getTextValue()); - } - } - - if (a == softradiuscb) { - if (listener) { - listener->panelChanged(Evlocallabsoftradiuscb, softradiuscb->getTextValue()); - } - } - - if (a == blendmaskcb) { - if (listener) { - listener->panelChanged(Evlocallabblendmaskcb, blendmaskcb->getTextValue()); - } - } - - if (a == radmaskcb) { - if (listener) { - listener->panelChanged(Evlocallabradmaskcb, radmaskcb->getTextValue()); - } - } - - if (a == chromaskcb) { - if (listener) { - listener->panelChanged(Evlocallabchromaskcb, chromaskcb->getTextValue()); - } - } - - if (a == gammaskcb) { - if (listener) { - listener->panelChanged(Evlocallabgammaskcb, gammaskcb->getTextValue()); - } - } - - if (a == slomaskcb) { - if (listener) { - listener->panelChanged(Evlocallabslomaskcb, slomaskcb->getTextValue()); - } - } - - } - - // Denoise - if (getEnabled() && expdenoi->getEnabled()) { - if (a == noiselumf) { - if (listener) { - listener->panelChanged(Evlocallabnoiselumf, noiselumf->getTextValue()); - } - } - - if (a == noiselumf0) { - if (listener) { - listener->panelChanged(Evlocallabnoiselumf0, noiselumf0->getTextValue()); - } - } - - if (a == noiselumf2) { - if (listener) { - listener->panelChanged(Evlocallabnoiselumf2, noiselumf2->getTextValue()); - } - } - - if (a == noiselumc) { - if (listener) { - listener->panelChanged(Evlocallabnoiselumc, noiselumc->getTextValue()); - } - } - - if (a == noiselumdetail) { - if (listener) { - listener->panelChanged(Evlocallabnoiselumdetail, noiselumdetail->getTextValue()); - } - } - - if (a == noiselequal) { - if (listener) { - listener->panelChanged(Evlocallabnoiselequal, noiselequal->getTextValue()); - } - } - - if (a == noisechrof) { - if (listener) { - listener->panelChanged(Evlocallabnoisechrof, noisechrof->getTextValue()); - } - } - - if (a == noisechroc) { - if (listener) { - listener->panelChanged(Evlocallabnoisechroc, noisechroc->getTextValue()); - } - } - - if (a == noisechrodetail) { - if (listener) { - listener->panelChanged(Evlocallabnoisechrodetail, noisechrodetail->getTextValue()); - } - } - - if (a == adjblur) { - if (listener) { - listener->panelChanged(Evlocallabadjblur, adjblur->getTextValue()); - } - } - - if (a == bilateral) { - if (listener) { - listener->panelChanged(Evlocallabbilateral, bilateral->getTextValue()); - } - } - - if (a == sensiden) { - if (listener) { - listener->panelChanged(Evlocallabsensiden, sensiden->getTextValue()); - } - } - } -} - -void Locallab::enabledChanged() -{ - if (listener) { - if (get_inconsistent()) { - listener->panelChanged(EvlocallabEnabled, M("GENERAL_UNCHANGED")); - } else if (getEnabled()) { - listener->panelChanged(EvlocallabEnabled, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(EvlocallabEnabled, M("GENERAL_DISABLED")); - } - } -} - -void Locallab::trimValues(rtengine::procparams::ProcParams * pp) -{ - // TODO -} - -void Locallab::setBatchMode(bool batchMode) -{ - // printf("BatchMode : %d\n", batchMode); - - ToolPanel::setBatchMode(batchMode); - - // Set batch mode for controlspotpanel - expsettings->setBatchMode(batchMode); - - // Set batch mode for adjusters and threshold adjusters - // Color & Light - lightness->showEditedCB(); - contrast->showEditedCB(); - chroma->showEditedCB(); - sensi->showEditedCB(); - structcol->showEditedCB(); - strengthgrid->showEditedCB(); - blurcolde->showEditedCB(); - blendmaskcol->showEditedCB(); - radmaskcol->showEditedCB(); - chromaskcol->showEditedCB(); - gammaskcol->showEditedCB(); - slomaskcol->showEditedCB(); - softradiuscol->showEditedCB(); - // Exposure - expcomp->showEditedCB(); - hlcompr->showEditedCB(); - hlcomprthresh->showEditedCB(); - black->showEditedCB(); - shadex->showEditedCB(); - shcompr->showEditedCB(); - expchroma->showEditedCB(); - warm->showEditedCB(); - sensiex->showEditedCB(); - structexp->showEditedCB(); - blurexpde->showEditedCB(); - blendmaskexp->showEditedCB(); - radmaskexp->showEditedCB(); - chromaskexp->showEditedCB(); - gammaskexp->showEditedCB(); - slomaskexp->showEditedCB(); - softradiusexp->showEditedCB(); - laplacexp->showEditedCB(); - balanexp->showEditedCB(); - linear->showEditedCB(); - //Shadow Highlight - highlights->showEditedCB(); - h_tonalwidth->showEditedCB(); - shadows->showEditedCB(); - s_tonalwidth->showEditedCB(); - sh_radius->showEditedCB(); - sensihs->showEditedCB(); - blendmaskSH->showEditedCB(); - radmaskSH->showEditedCB(); - blurSHde->showEditedCB(); - chromaskSH->showEditedCB(); - gammaskSH->showEditedCB(); - slomaskSH->showEditedCB(); - // Vibrance - saturated->showEditedCB(); - pastels->showEditedCB(); - psThreshold->showEditedCB(); - sensiv->showEditedCB(); - // Soft Light - streng->showEditedCB(); - sensisf->showEditedCB(); - laplace->showEditedCB(); - // Blur & Noise - radius->showEditedCB(); - streng->showEditedCB(); - strength->showEditedCB(); - sensibn->showEditedCB(); - // Tone Mapping - stren->showEditedCB(); - gamma->showEditedCB(); - estop->showEditedCB(); - scaltm->showEditedCB(); - rewei->showEditedCB(); - satur->showEditedCB(); - sensitm->showEditedCB(); - softradiustm->showEditedCB(); - amount->showEditedCB(); - blendmasktm->showEditedCB(); - radmasktm->showEditedCB(); - chromasktm->showEditedCB(); - gammasktm->showEditedCB(); - slomasktm->showEditedCB(); - // Retinex - str->showEditedCB(); - chrrt->showEditedCB(); - neigh->showEditedCB(); - vart->showEditedCB(); - dehaz->showEditedCB(); - sensih->showEditedCB(); - softradiusret->showEditedCB(); - blendmaskreti->showEditedCB(); - radmaskreti->showEditedCB(); - chromaskreti->showEditedCB(); - gammaskreti->showEditedCB(); - slomaskreti->showEditedCB(); - scalereti->showEditedCB(); - darkness->showEditedCB(); - lightnessreti->showEditedCB(); - limd->showEditedCB(); - // Sharpening - sharradius->showEditedCB(); - sharamount->showEditedCB(); - shardamping->showEditedCB(); - shariter->showEditedCB(); - sensisha->showEditedCB(); - // Local Contrast - lcradius->showEditedCB(); - lcamount->showEditedCB(); - lcdarkness->showEditedCB(); - lclightness->showEditedCB(); - levelwav->showEditedCB(); - residcont->showEditedCB(); - sensilc->showEditedCB(); - - // Contrast by detail levels - for (int i = 0; i < 6; i++) { - multiplier[i]->showEditedCB(); - } - - chromacbdl->showEditedCB(); - threshold->showEditedCB(); - sensicb->showEditedCB(); - clarityml->showEditedCB(); - contresid->showEditedCB(); - blurcbdl->showEditedCB(); - softradiuscb->showEditedCB(); - blendmaskcb->showEditedCB(); - radmaskcb->showEditedCB(); - chromaskcb->showEditedCB(); - gammaskcb->showEditedCB(); - slomaskcb->showEditedCB(); - - // Denoise - noiselumf->showEditedCB(); - noiselumc->showEditedCB(); - noiselumdetail->showEditedCB(); - noiselequal->showEditedCB(); - noiselumf0->showEditedCB(); - noiselumf2->showEditedCB(); - noisechroc->showEditedCB(); - noisechrodetail->showEditedCB(); - adjblur->showEditedCB(); - bilateral->showEditedCB(); - sensiden->showEditedCB(); - - // Set batch mode for comboBoxText - // Color & Light - qualitycurveMethod->append(M("GENERAL_UNCHANGED")); - gridMethod->append(M("GENERAL_UNCHANGED")); - //exposure - expMethod->append(M("GENERAL_UNCHANGED")); - // softlight - softMethod->append(M("GENERAL_UNCHANGED")); - // Blur & Noise - blurMethod->append(M("GENERAL_UNCHANGED")); - // Retinex - retinexMethod->append(M("GENERAL_UNCHANGED")); - - //Local contrast - localcontMethod->append(M("GENERAL_UNCHANGED")); - - // In batch mode, being able to change mask visibility is useless - showmaskcolMethod->hide(); - showmaskexpMethod->hide(); - showmaskSHMethod->hide(); - showmaskcbMethod->hide(); - showmaskretiMethod->hide(); - showmasktmMethod->hide(); -} - -std::vector Locallab::getCurvePoints(ThresholdSelector* tAdjuster) const -{ - std::vector points; - double threshold, transitionWeighting; - tAdjuster->getPositions (transitionWeighting, threshold); // ( range -100;+100, range 0;+100 ) - transitionWeighting /= 100.; // range -1., +1. - threshold /= 100.; // range 0., +1. - - // Initial point - points.push_back(0.); - points.push_back(0.); - - double p2 = 3.0 * threshold / 4.0; // same one than in ipvibrance.cc - double s0 = threshold + (1.0 - threshold) / 4.0; // same one than in ipvibrance.cc - - // point at the beginning of the first linear transition - points.push_back(p2); - points.push_back(0.); - - // Y value of the chroma mean point, calculated to get a straight line between p2 and s0 - double chromaMean = (threshold / 4.0) / (s0 - p2); - - // move chromaMean up or down depending on transitionWeighting - if (transitionWeighting > 0.0) { - // positive values -> give more weight to Saturated - chromaMean = (1.0 - chromaMean) * transitionWeighting + chromaMean; - } else if (transitionWeighting < 0.0) { - // negative values -> give more weight to Pastels - chromaMean = chromaMean * transitionWeighting + chromaMean; - } - - // point at the location of the Top cursor, at the end of the first linear transition and the beginning of the second one - points.push_back(threshold); - points.push_back(chromaMean); - - if (threshold < 1.0) { - - // point at the end of the second linear transition - points.push_back(s0); - points.push_back(1.0); - - // end point - points.push_back(1.0); - points.push_back(1.0); - } - - return points; -} - void Locallab::setEditProvider(EditDataProvider * provider) { expsettings->setEditProvider(provider); @@ -6062,941 +693,76 @@ void Locallab::unsubscribe() expsettings->unsubscribe(); } -void Locallab::colorForValue(double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) +void Locallab::enabledChanged() { - - float R = 0.f; - float G = 0.f; - float B = 0.f; - - if (elemType == ColorCaller::CCET_VERTICAL_BAR) { - valY = 0.5; - } - - if (callerId == 1) { // ch - main curve - - Color::hsv2rgb01(float (valX), float (valY), 0.5f, R, G, B); - } else if (callerId == 2) { // cc - bottom bar - - float value = (1.f - 0.7f) * float (valX) + 0.7f; - // whole hue range - // Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before) - Color::hsv2rgb01(float (valY), float (valX), value, R, G, B); - } else if (callerId == 3) { // lc - bottom bar - - float value = (1.f - 0.7f) * float (valX) + 0.7f; - // Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before) - Color::hsv2rgb01(float (valY), float (valX), value, R, G, B); - } else if (callerId == 4) { // LH - bottom bar - Color::hsv2rgb01(float (valX), 0.5f, float (valY), R, G, B); - } else if (callerId == 5) { // HH - bottom bar - float h = float ((valY - 0.5) * 0.3 + valX); - - if (h > 1.0f) { - h -= 1.0f; - } else if (h < 0.0f) { - h += 1.0f; - } - - Color::hsv2rgb01(h, 0.5f, 0.5f, R, G, B); - } else if (callerId == 6) { - // TODO - float x = valX - 1.f / 6.f; - - if (x < 0.f) { - x += 1.f; - } - - x = log2lin(x, 3.f); - // float x = valX; - Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); - } else if (callerId == 7) { - Color::hsv2rgb01(float(valY), float(valX), 0.5f, R, G, B); - } - - caller->ccRed = double (R); - caller->ccGreen = double (G); - caller->ccBlue = double (B); -} - -void Locallab::setListener(ToolPanelListener* tpl) -{ - this->listener = tpl; - labgrid->setListener(tpl); - expsettings->setListener(tpl); -} - -void Locallab::enableListener() -{ - // printf("enableListener\n"); - - FoldableToolPanel::enableListener(); - // Color & Light - enablecolorConn.block(false); - curvactivConn.block(false); - qualitycurveMethodConn.block(false); - gridMethodConn.block(false); - inversConn.block(false); - showmaskcolMethodConn.block(false); - enaColorMaskConn.block(false); - // Exposure - enableexposeConn.block(false); - inversexConn.block(false); - showmaskexpMethodConn.block(false); - expMethodConn.block(false); - enaExpMaskConn.block(false); - // Shadow highlight - enableshadhighConn.block(false); - showmaskSHMethodConn.block(false); - enaSHMaskConn.block(false); - inversshConn.block(false); - // Vibrance - enablevibranceConn.block(false); - pskinsconn.block(false); - ashiftconn.block(false); - pastsattogconn.block(false); - // Soft Light - enablesoftConn.block(false); - softMethodConn.block(false); - showmasksoftMethodConn.block(false); - // Blur & Noise - enableblurConn.block(false); - blurMethodConn.block(false); - activlumConn.block(false); - // Tone Mapping - enabletonemapConn.block(false); - equiltmConn.block(false); - enatmMaskConn.block(false); - showmasktmMethodConn.block(false); - // Retinex - enableretiConn.block(false); - retinexMethodConn.block(false); - inversretConn.block(false); - equilretConn.block(false); - enaretiMaskConn.block(false); - enaretiMasktmapConn.block(false); - showmaskretiMethodConn.block(false); - fftwretiConn.block(false); - // Sharpening - enablesharpConn.block(false); - inversshaConn.block(false); - // Local Contrast - enablecontrastConn.block(false); - localcontMethodConn.block(false); - fftwlcConn.block(false); - // Contrast by detail levels - enablecbdlConn.block(false); - enacbMaskConn.block(false); - showmaskcbMethodConn.block(false); - // Denoise - enabledenoiConn.block(false); -} - -void Locallab::disableListener() -{ - // printf("disableListener\n"); - - FoldableToolPanel::disableListener(); - // Color & Light - enablecolorConn.block(true); - curvactivConn.block(true); - qualitycurveMethodConn.block(true); - gridMethodConn.block(true); - inversConn.block(true); - showmaskcolMethodConn.block(true); - enaColorMaskConn.block(true); - // Exposure - enableexposeConn.block(true); - inversexConn.block(true); - showmaskexpMethodConn.block(true); - expMethodConn.block(true); - enaExpMaskConn.block(true); - // Shadow highlight - enableshadhighConn.block(true); - showmaskSHMethodConn.block(true); - enaSHMaskConn.block(true); - inversshConn.block(true); - // Vibrance - enablevibranceConn.block(true); - pskinsconn.block(true); - ashiftconn.block(true); - pastsattogconn.block(true); - // Soft Light - enablesoftConn.block(true); - softMethodConn.block(true); - showmasksoftMethodConn.block(true); - // Blur & Noise - enableblurConn.block(true); - blurMethodConn.block(true); - activlumConn.block(true); - // Tone Mapping - enabletonemapConn.block(true); - equiltmConn.block(true); - enatmMaskConn.block(true); - showmasktmMethodConn.block(true); - // Retinex - enableretiConn.block(true); - retinexMethodConn.block(true); - inversretConn.block(true); - equilretConn.block(true); - enaretiMaskConn.block(true); - enaretiMasktmapConn.block(true); - showmaskretiMethodConn.block(true); - fftwretiConn.block(true); - // Sharpening - enablesharpConn.block(true); - inversshaConn.block(true); - // Local Contrast - enablecontrastConn.block(true); - localcontMethodConn.block(true); - fftwlcConn.block(true); - // Contrast by detail levels - enablecbdlConn.block(true); - enacbMaskConn.block(true); - showmaskcbMethodConn.block(true); - // Denoise - enabledenoiConn.block(true); -} - -void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited, int index) -{ - // printf("updateLocallabGUI\n"); - - // Update GUI values - if (index < pp->locallab.nbspot && index < (int)pp->locallab.spots.size()) { - // Color & Light - expcolor->setEnabled(pp->locallab.spots.at(index).expcolor); - curvactiv->set_active(pp->locallab.spots.at(index).curvactiv); - lightness->setValue(pp->locallab.spots.at(index).lightness); - contrast->setValue(pp->locallab.spots.at(index).contrast); - chroma->setValue(pp->locallab.spots.at(index).chroma); - labgrid->setParams(pp->locallab.spots.at(index).labgridALow / LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX, false); - strengthgrid->setValue(pp->locallab.spots.at(index).strengthgrid); - sensi->setValue(pp->locallab.spots.at(index).sensi); - structcol->setValue(pp->locallab.spots.at(index).structcol); - - if (pp->locallab.spots.at(index).qualitycurveMethod == "none") { - qualitycurveMethod->set_active(0); - } else if (pp->locallab.spots.at(index).qualitycurveMethod == "std") { - qualitycurveMethod->set_active(1); - } - - if (pp->locallab.spots.at(index).gridMethod == "one") { - gridMethod->set_active(0); - } else if (pp->locallab.spots.at(index).gridMethod == "two") { - gridMethod->set_active(1); - } - - - if (pp->locallab.spots.at(index).scalereti == 1) { - LocalcurveEditorgainT->hide(); - retinexMethod->hide(); + if (listener) { + if (getEnabled()) { + listener->panelChanged(EvlocallabEnabled, M("GENERAL_ENABLED")); } else { - LocalcurveEditorgainT->show(); - retinexMethod->show(); + listener->panelChanged(EvlocallabEnabled, M("GENERAL_DISABLED")); } + } +} - llshape->setCurve(pp->locallab.spots.at(index).llcurve); - ccshape->setCurve(pp->locallab.spots.at(index).cccurve); - LHshape->setCurve(pp->locallab.spots.at(index).LHcurve); - HHshape->setCurve(pp->locallab.spots.at(index).HHcurve); - invers->set_active(pp->locallab.spots.at(index).invers); - enaColorMask->set_active(pp->locallab.spots.at(index).enaColorMask); - CCmaskshape->setCurve(pp->locallab.spots.at(index).CCmaskcurve); - LLmaskshape->setCurve(pp->locallab.spots.at(index).LLmaskcurve); - HHmaskshape->setCurve(pp->locallab.spots.at(index).HHmaskcurve); - blurcolde->setValue(pp->locallab.spots.at(index).blurcolde); - blendmaskcol->setValue(pp->locallab.spots.at(index).blendmaskcol); - radmaskcol->setValue(pp->locallab.spots.at(index).radmaskcol); - chromaskcol->setValue(pp->locallab.spots.at(index).chromaskcol); - gammaskcol->setValue(pp->locallab.spots.at(index).gammaskcol); - slomaskcol->setValue(pp->locallab.spots.at(index).slomaskcol); - softradiuscol->setValue(pp->locallab.spots.at(index).softradiuscol); +void Locallab::autoOpenCurve() +{ + // TODO Actually autoOpenCurve only considers linearity state of selected spot curve +} - // Exposure - expexpose->setEnabled(pp->locallab.spots.at(index).expexpose); - expcomp->setValue(pp->locallab.spots.at(index).expcomp); - hlcompr->setValue(pp->locallab.spots.at(index).hlcompr); - hlcomprthresh->setValue(pp->locallab.spots.at(index).hlcomprthresh); - black->setValue(pp->locallab.spots.at(index).black); - shadex->setValue(pp->locallab.spots.at(index).shadex); - shcompr->setValue(pp->locallab.spots.at(index).shcompr); - expchroma->setValue(pp->locallab.spots.at(index).expchroma); - warm->setValue(pp->locallab.spots.at(index).warm); - sensiex->setValue(pp->locallab.spots.at(index).sensiex); - structexp->setValue(pp->locallab.spots.at(index).structexp); - blurexpde->setValue(pp->locallab.spots.at(index).blurexpde); - shapeexpos->setCurve(pp->locallab.spots.at(index).excurve); - inversex->set_active(pp->locallab.spots.at(index).inversex); - enaExpMask->set_active(pp->locallab.spots.at(index).enaExpMask); - CCmaskexpshape->setCurve(pp->locallab.spots.at(index).CCmaskexpcurve); - LLmaskexpshape->setCurve(pp->locallab.spots.at(index).LLmaskexpcurve); - HHmaskexpshape->setCurve(pp->locallab.spots.at(index).HHmaskexpcurve); - blendmaskexp->setValue(pp->locallab.spots.at(index).blendmaskexp); - radmaskexp->setValue(pp->locallab.spots.at(index).radmaskexp); - chromaskexp->setValue(pp->locallab.spots.at(index).chromaskexp); - gammaskexp->setValue(pp->locallab.spots.at(index).gammaskexp); - slomaskexp->setValue(pp->locallab.spots.at(index).slomaskexp); - softradiusexp->setValue(pp->locallab.spots.at(index).softradiusexp); - - if (pp->locallab.spots.at(index).expMethod == "std") { - expMethod->set_active(0); - } else if (pp->locallab.spots.at(index).expMethod == "pde") { - expMethod->set_active(1); - } - - laplacexp->setValue(pp->locallab.spots.at(index).laplacexp); - balanexp->setValue(pp->locallab.spots.at(index).balanexp); - linear->setValue(pp->locallab.spots.at(index).linear); - - // Shadow highlight - expshadhigh->setEnabled(pp->locallab.spots.at(index).expshadhigh); - highlights->setValue(pp->locallab.spots.at(index).highlights); - h_tonalwidth->setValue(pp->locallab.spots.at(index).h_tonalwidth); - shadows->setValue(pp->locallab.spots.at(index).shadows); - s_tonalwidth->setValue(pp->locallab.spots.at(index).s_tonalwidth); - sh_radius->setValue(pp->locallab.spots.at(index).sh_radius); - sensihs->setValue(pp->locallab.spots.at(index).sensihs); - enaSHMask->set_active(pp->locallab.spots.at(index).enaSHMask); - CCmaskSHshape->setCurve(pp->locallab.spots.at(index).CCmaskSHcurve); - LLmaskSHshape->setCurve(pp->locallab.spots.at(index).LLmaskSHcurve); - HHmaskSHshape->setCurve(pp->locallab.spots.at(index).HHmaskSHcurve); - blendmaskSH->setValue(pp->locallab.spots.at(index).blendmaskSH); - radmaskSH->setValue(pp->locallab.spots.at(index).radmaskSH); - blurSHde->setValue(pp->locallab.spots.at(index).blurSHde); - inverssh->set_active(pp->locallab.spots.at(index).inverssh); - chromaskSH->setValue(pp->locallab.spots.at(index).chromaskSH); - gammaskSH->setValue(pp->locallab.spots.at(index).gammaskSH); - slomaskSH->setValue(pp->locallab.spots.at(index).slomaskSH); - - // Vibrance - expvibrance->setEnabled(pp->locallab.spots.at(index).expvibrance); - saturated->setValue(pp->locallab.spots.at(index).saturated); - pastels->setValue(pp->locallab.spots.at(index).pastels); - psThreshold->setValue(pp->locallab.spots.at(index).psthreshold); - protectSkins->set_active(pp->locallab.spots.at(index).protectskins); - avoidColorShift->set_active(pp->locallab.spots.at(index).avoidcolorshift); - pastSatTog->set_active(pp->locallab.spots.at(index).pastsattog); - sensiv->setValue(pp->locallab.spots.at(index).sensiv); - skinTonesCurve->setCurve(pp->locallab.spots.at(index).skintonescurve); - - // Soft Light - expsoft->setEnabled(pp->locallab.spots.at(index).expsoft); - streng->setValue(pp->locallab.spots.at(index).streng); - sensisf->setValue(pp->locallab.spots.at(index).sensisf); - laplace->setValue(pp->locallab.spots.at(index).laplace); - - if (pp->locallab.spots.at(index).softMethod == "soft") { - softMethod->set_active(0); - } else if (pp->locallab.spots.at(index).softMethod == "reti") { - softMethod->set_active(1); - } - - // Blur & Noise - expblur->setEnabled(pp->locallab.spots.at(index).expblur); - radius->setValue(pp->locallab.spots.at(index).radius); - strength->setValue(pp->locallab.spots.at(index).strength); - sensibn->setValue(pp->locallab.spots.at(index).sensibn); - - if (pp->locallab.spots.at(index).blurMethod == "norm") { - blurMethod->set_active(0); - } else if (pp->locallab.spots.at(index).blurMethod == "inv") { - blurMethod->set_active(1); - } - - activlum->set_active(pp->locallab.spots.at(index).activlum); - - // Tone Mapping - exptonemap->setEnabled(pp->locallab.spots.at(index).exptonemap); - stren->setValue(pp->locallab.spots.at(index).stren); - gamma->setValue(pp->locallab.spots.at(index).gamma); - estop->setValue(pp->locallab.spots.at(index).estop); - scaltm->setValue(pp->locallab.spots.at(index).scaltm); - rewei->setValue(pp->locallab.spots.at(index).rewei); - satur->setValue(pp->locallab.spots.at(index).satur); - sensitm->setValue(pp->locallab.spots.at(index).sensitm); - softradiustm->setValue(pp->locallab.spots.at(index).softradiustm); - amount->setValue(pp->locallab.spots.at(index).amount); - equiltm->set_active(pp->locallab.spots.at(index).equiltm); - enatmMask->set_active(pp->locallab.spots.at(index).enatmMask); - blendmasktm->setValue(pp->locallab.spots.at(index).blendmasktm); - radmasktm->setValue(pp->locallab.spots.at(index).radmasktm); - chromasktm->setValue(pp->locallab.spots.at(index).chromasktm); - gammasktm->setValue(pp->locallab.spots.at(index).gammasktm); - slomasktm->setValue(pp->locallab.spots.at(index).slomasktm); - CCmasktmshape->setCurve(pp->locallab.spots.at(index).CCmasktmcurve); - LLmasktmshape->setCurve(pp->locallab.spots.at(index).LLmasktmcurve); - HHmasktmshape->setCurve(pp->locallab.spots.at(index).HHmasktmcurve); - - // Retinex - expreti->setEnabled(pp->locallab.spots.at(index).expreti); - - if (pp->locallab.spots.at(index).retinexMethod == "low") { - retinexMethod->set_active(0); - } else if (pp->locallab.spots.at(index).retinexMethod == "uni") { - retinexMethod->set_active(1); +void Locallab::foldAllButOne(LocallabTool* except) +{ + for (auto tool : locallabTools) { + if (tool != except) { + // All other tool expanders are fold + tool->setExpanded(false); } else { - retinexMethod->set_active(2); - } - - str->setValue(pp->locallab.spots.at(index).str); - chrrt->setValue(pp->locallab.spots.at(index).chrrt); - neigh->setValue(pp->locallab.spots.at(index).neigh); - vart->setValue(pp->locallab.spots.at(index).vart); - dehaz->setValue(pp->locallab.spots.at(index).dehaz); - sensih->setValue(pp->locallab.spots.at(index).sensih); - cTgainshape->setCurve(pp->locallab.spots.at(index).localTgaincurve); - inversret->set_active(pp->locallab.spots.at(index).inversret); - equilret->set_active(pp->locallab.spots.at(index).equilret); - softradiusret->setValue(pp->locallab.spots.at(index).softradiusret); - CCmaskretishape->setCurve(pp->locallab.spots.at(index).CCmaskreticurve); - LLmaskretishape->setCurve(pp->locallab.spots.at(index).LLmaskreticurve); - HHmaskretishape->setCurve(pp->locallab.spots.at(index).HHmaskreticurve); - enaretiMask->set_active(pp->locallab.spots.at(index).enaretiMask); - enaretiMasktmap->set_active(pp->locallab.spots.at(index).enaretiMasktmap); - blendmaskreti->setValue(pp->locallab.spots.at(index).blendmaskreti); - radmaskreti->setValue(pp->locallab.spots.at(index).radmaskreti); - chromaskreti->setValue(pp->locallab.spots.at(index).chromaskreti); - gammaskreti->setValue(pp->locallab.spots.at(index).gammaskreti); - slomaskreti->setValue(pp->locallab.spots.at(index).slomaskreti); - scalereti->setValue(pp->locallab.spots.at(index).scalereti); - darkness->setValue(pp->locallab.spots.at(index).darkness); - lightnessreti->setValue(pp->locallab.spots.at(index).lightnessreti); - limd->setValue(pp->locallab.spots.at(index).limd); - fftwreti->set_active(pp->locallab.spots.at(index).fftwreti); - - // Sharpening - expsharp->setEnabled(pp->locallab.spots.at(index).expsharp); - sharcontrast->setValue(pp->locallab.spots.at(index).sharcontrast); - sharradius->setValue(pp->locallab.spots.at(index).sharradius); - sharamount->setValue(pp->locallab.spots.at(index).sharamount); - shardamping->setValue(pp->locallab.spots.at(index).shardamping); - shariter->setValue(pp->locallab.spots.at(index).shariter); - sharblur->setValue(pp->locallab.spots.at(index).sharblur); - sensisha->setValue(pp->locallab.spots.at(index).sensisha); - inverssha->set_active(pp->locallab.spots.at(index).inverssha); - - // Local Contrast - expcontrast->setEnabled(pp->locallab.spots.at(index).expcontrast); - lcradius->setValue(pp->locallab.spots.at(index).lcradius); - lcamount->setValue(pp->locallab.spots.at(index).lcamount); - lcdarkness->setValue(pp->locallab.spots.at(index).lcdarkness); - lclightness->setValue(pp->locallab.spots.at(index).lclightness); - levelwav->setValue(pp->locallab.spots.at(index).levelwav); - residcont->setValue(pp->locallab.spots.at(index).residcont); - sensilc->setValue(pp->locallab.spots.at(index).sensilc); - fftwlc->set_active(pp->locallab.spots.at(index).fftwlc); - if (pp->locallab.spots.at(index).localcontMethod == "loc") { - localcontMethod->set_active(0); - } else if (pp->locallab.spots.at(index).localcontMethod == "wav") { - localcontMethod->set_active(1); - } - wavshape->setCurve(pp->locallab.spots.at(index).locwavcurve); - - // Contrast by detail levels - expcbdl->setEnabled(pp->locallab.spots.at(index).expcbdl); - - for (int i = 0; i < 6; i++) { - multiplier[i]->setValue(pp->locallab.spots.at(index).mult[i]); - } - - chromacbdl->setValue(pp->locallab.spots.at(index).chromacbdl); - threshold->setValue(pp->locallab.spots.at(index).threshold); - sensicb->setValue(pp->locallab.spots.at(index).sensicb); - clarityml->setValue(pp->locallab.spots.at(index).clarityml); - contresid->setValue(pp->locallab.spots.at(index).contresid); - blurcbdl->setValue(pp->locallab.spots.at(index).blurcbdl); - softradiuscb->setValue(pp->locallab.spots.at(index).softradiuscb); - blendmaskcb->setValue(pp->locallab.spots.at(index).blendmaskcb); - radmaskcb->setValue(pp->locallab.spots.at(index).radmaskcb); - chromaskcb->setValue(pp->locallab.spots.at(index).chromaskcb); - gammaskcb->setValue(pp->locallab.spots.at(index).gammaskcb); - slomaskcb->setValue(pp->locallab.spots.at(index).slomaskcb); - enacbMask->set_active(pp->locallab.spots.at(index).enacbMask); - CCmaskcbshape->setCurve(pp->locallab.spots.at(index).CCmaskcbcurve); - LLmaskcbshape->setCurve(pp->locallab.spots.at(index).LLmaskcbcurve); - HHmaskcbshape->setCurve(pp->locallab.spots.at(index).HHmaskcbcurve); - - // Denoise - expdenoi->setEnabled(pp->locallab.spots.at(index).expdenoi); - noiselumf->setValue(pp->locallab.spots.at(index).noiselumf); - noiselumf0->setValue(pp->locallab.spots.at(index).noiselumf0); - noiselumf2->setValue(pp->locallab.spots.at(index).noiselumf2); - noiselumc->setValue(pp->locallab.spots.at(index).noiselumc); - noiselumdetail->setValue(pp->locallab.spots.at(index).noiselumdetail); - noiselequal->setValue(pp->locallab.spots.at(index).noiselequal); - noisechrof->setValue(pp->locallab.spots.at(index).noisechrof); - noisechroc->setValue(pp->locallab.spots.at(index).noisechroc); - noisechrodetail->setValue(pp->locallab.spots.at(index).noisechrodetail); - adjblur->setValue(pp->locallab.spots.at(index).adjblur); - bilateral->setValue(pp->locallab.spots.at(index).bilateral); - sensiden->setValue(pp->locallab.spots.at(index).sensiden); - - if (pedited) { - if (index < (int)pedited->locallab.spots.size()) { - const LocallabParamsEdited::LocallabSpotEdited* spotState = &pedited->locallab.spots.at(index); - - // Control spot settings - ControlSpotPanel::SpotEdited* const se = new ControlSpotPanel::SpotEdited(); - - if (pedited->locallab.nbspot && pedited->locallab.id) { - se->nbspot = true; - } else { - se->nbspot = false; - } - - se->selspot = pedited->locallab.selspot; - se->name = spotState->name; - se->isvisible = spotState->isvisible; - se->shape = spotState->shape; - se->spotMethod = spotState->spotMethod; - se->sensiexclu = spotState->sensiexclu; - se->structexclu = spotState->structexclu; - se->struc = spotState->struc; - se->shapeMethod = spotState->shapeMethod; - se->locX = spotState->locX; - se->locXL = spotState->locXL; - se->locY = spotState->locY; - se->locYT = spotState->locYT; - se->centerX = spotState->centerX; - se->centerY = spotState->centerY; - se->circrad = spotState->circrad; - se->qualityMethod = spotState->qualityMethod; - se->transit = spotState->transit; - se->thresh = spotState->thresh; - se->iter = spotState->iter; - se->balan = spotState->balan; - se->transitweak = spotState->transitweak; - se->transitgrad = spotState->transitgrad; - se->avoid = spotState->avoid; - expsettings->setEditedStates(se); - - // Color & Light - expcolor->set_inconsistent(!spotState->expcolor); - curvactiv->set_inconsistent(multiImage && !spotState->curvactiv); - lightness->setEditedState(spotState->lightness ? Edited : UnEdited); - contrast->setEditedState(spotState->contrast ? Edited : UnEdited); - chroma->setEditedState(spotState->chroma ? Edited : UnEdited); - sensi->setEditedState(spotState->sensi ? Edited : UnEdited); - structcol->setEditedState(spotState->structcol ? Edited : UnEdited); - labgrid->setEdited(spotState->labgridALow || spotState->labgridBLow || spotState->labgridAHigh || spotState->labgridBHigh); - strengthgrid->setEditedState(spotState->strengthgrid ? Edited : UnEdited); - - if (!spotState->qualitycurveMethod) { - qualitycurveMethod->set_active_text(M("GENERAL_UNCHANGED")); - } - - if (!spotState->gridMethod) { - gridMethod->set_active_text(M("GENERAL_UNCHANGED")); - } - - llshape->setUnChanged(!spotState->llcurve); - ccshape->setUnChanged(!spotState->cccurve); - LHshape->setUnChanged(!spotState->LHcurve); - HHshape->setUnChanged(!spotState->HHcurve); - invers->set_inconsistent(multiImage && !spotState->invers); - enaColorMask->set_inconsistent(multiImage && !spotState->enaColorMask); - CCmaskshape->setUnChanged(!spotState->CCmaskcurve); - LLmaskshape->setUnChanged(!spotState->LLmaskcurve); - HHmaskshape->setUnChanged(!spotState->HHmaskcurve); - blurcolde->setEditedState(spotState->blurcolde ? Edited : UnEdited); - blendmaskcol->setEditedState(spotState->blendmaskcol ? Edited : UnEdited); - radmaskcol->setEditedState(spotState->radmaskcol ? Edited : UnEdited); - chromaskcol->setEditedState(spotState->chromaskcol ? Edited : UnEdited); - gammaskcol->setEditedState(spotState->gammaskcol ? Edited : UnEdited); - slomaskcol->setEditedState(spotState->slomaskcol ? Edited : UnEdited); - softradiuscol->setEditedState(spotState->softradiuscol ? Edited : UnEdited); - - // Exposure - expexpose->set_inconsistent(!spotState->expexpose); - expcomp->setEditedState(spotState->expcomp ? Edited : UnEdited); - hlcompr->setEditedState(spotState->hlcompr ? Edited : UnEdited); - hlcomprthresh->setEditedState(spotState->hlcomprthresh ? Edited : UnEdited); - black->setEditedState(spotState->black ? Edited : UnEdited); - shadex->setEditedState(spotState->shadex ? Edited : UnEdited); - warm->setEditedState(spotState->warm ? Edited : UnEdited); - shcompr->setEditedState(spotState->shcompr ? Edited : UnEdited); - expchroma->setEditedState(spotState->expchroma ? Edited : UnEdited); - sensiex->setEditedState(spotState->sensiex ? Edited : UnEdited); - structexp->setEditedState(spotState->structexp ? Edited : UnEdited); - blurexpde->setEditedState(spotState->blurexpde ? Edited : UnEdited); - shapeexpos->setUnChanged(!spotState->excurve); - inversex->set_inconsistent(multiImage && !spotState->inversex); - enaExpMask->set_inconsistent(multiImage && !spotState->enaExpMask); - CCmaskexpshape->setUnChanged(!spotState->CCmaskexpcurve); - LLmaskexpshape->setUnChanged(!spotState->LLmaskexpcurve); - HHmaskexpshape->setUnChanged(!spotState->HHmaskexpcurve); - blendmaskexp->setEditedState(spotState->blendmaskexp ? Edited : UnEdited); - radmaskexp->setEditedState(spotState->radmaskexp ? Edited : UnEdited); - chromaskexp->setEditedState(spotState->chromaskexp ? Edited : UnEdited); - gammaskexp->setEditedState(spotState->gammaskexp ? Edited : UnEdited); - slomaskexp->setEditedState(spotState->slomaskexp ? Edited : UnEdited); - softradiusexp->setEditedState(spotState->softradiusexp ? Edited : UnEdited); - - if (!spotState->expMethod) { - expMethod->set_active_text(M("GENERAL_UNCHANGED")); - } - - laplacexp->setEditedState(spotState->laplacexp ? Edited : UnEdited); - balanexp->setEditedState(spotState->balanexp ? Edited : UnEdited); - linear->setEditedState(spotState->linear ? Edited : UnEdited); - - // Shadow highlight - expshadhigh->set_inconsistent(!spotState->expshadhigh); - highlights->setEditedState(spotState->highlights ? Edited : UnEdited); - h_tonalwidth->setEditedState(spotState->h_tonalwidth ? Edited : UnEdited); - shadows->setEditedState(spotState->shadows ? Edited : UnEdited); - s_tonalwidth->setEditedState(spotState->s_tonalwidth ? Edited : UnEdited); - sh_radius->setEditedState(spotState->sh_radius ? Edited : UnEdited); - sensihs->setEditedState(spotState->sensihs ? Edited : UnEdited); - enaSHMask->set_inconsistent(multiImage && !spotState->enaSHMask); - CCmaskSHshape->setUnChanged(!spotState->CCmaskSHcurve); - LLmaskSHshape->setUnChanged(!spotState->LLmaskSHcurve); - HHmaskSHshape->setUnChanged(!spotState->HHmaskSHcurve); - blendmaskSH->setEditedState(spotState->blendmaskSH ? Edited : UnEdited); - radmaskSH->setEditedState(spotState->radmaskSH ? Edited : UnEdited); - blurSHde->setEditedState(spotState->blurSHde ? Edited : UnEdited); - inverssh->set_inconsistent(multiImage && !spotState->inverssh); - chromaskSH->setEditedState(spotState->chromaskSH ? Edited : UnEdited); - gammaskSH->setEditedState(spotState->gammaskSH ? Edited : UnEdited); - slomaskSH->setEditedState(spotState->slomaskSH ? Edited : UnEdited); - - // Vibrance - expvibrance->set_inconsistent(!spotState->expvibrance); - saturated->setEditedState(spotState->saturated ? Edited : UnEdited); - pastels->setEditedState(spotState->pastels ? Edited : UnEdited); - psThreshold->setEditedState(spotState->psthreshold ? Edited : UnEdited); - protectSkins->set_inconsistent(multiImage && !spotState->protectskins); - avoidColorShift->set_inconsistent(multiImage && !spotState->avoidcolorshift); - pastSatTog->set_inconsistent(multiImage && !spotState->pastsattog); - sensiv->setEditedState(spotState->sensiv ? Edited : UnEdited); - skinTonesCurve->setUnChanged(!spotState->skintonescurve); - - // Soft Light - expsoft->set_inconsistent(!spotState->expsoft); - streng->setEditedState(spotState->streng ? Edited : UnEdited); - sensisf->setEditedState(spotState->sensisf ? Edited : UnEdited); - laplace->setEditedState(spotState->laplace ? Edited : UnEdited); - - if (!spotState->softMethod) { - softMethod->set_active_text(M("GENERAL_UNCHANGED")); - } - - // Blur & Noise - expblur->set_inconsistent(!spotState->expblur); - radius->setEditedState(spotState->radius ? Edited : UnEdited); - strength->setEditedState(spotState->strength ? Edited : UnEdited); - sensibn->setEditedState(spotState->sensibn ? Edited : UnEdited); - - if (!spotState->blurMethod) { - blurMethod->set_active_text(M("GENERAL_UNCHANGED")); - } - - activlum->set_inconsistent(multiImage && !spotState->activlum); - - // Tone Mapping - exptonemap->set_inconsistent(!spotState->exptonemap); - stren->setEditedState(spotState->stren ? Edited : UnEdited); - gamma->setEditedState(spotState->gamma ? Edited : UnEdited); - estop->setEditedState(spotState->estop ? Edited : UnEdited); - scaltm->setEditedState(spotState->scaltm ? Edited : UnEdited); - rewei->setEditedState(spotState->rewei ? Edited : UnEdited); - satur->setEditedState(spotState->satur ? Edited : UnEdited); - sensitm->setEditedState(spotState->sensitm ? Edited : UnEdited); - softradiustm->setEditedState(spotState->softradiustm ? Edited : UnEdited); - amount->setEditedState(spotState->amount ? Edited : UnEdited); - equiltm->set_inconsistent(multiImage && !spotState->equiltm); - CCmasktmshape->setUnChanged(!spotState->CCmasktmcurve); - LLmasktmshape->setUnChanged(!spotState->LLmasktmcurve); - HHmasktmshape->setUnChanged(!spotState->HHmasktmcurve); - enatmMask->set_inconsistent(multiImage && !spotState->enatmMask); - blendmasktm->setEditedState(spotState->blendmasktm ? Edited : UnEdited); - radmasktm->setEditedState(spotState->radmasktm ? Edited : UnEdited); - chromasktm->setEditedState(spotState->chromasktm ? Edited : UnEdited); - gammasktm->setEditedState(spotState->gammasktm ? Edited : UnEdited); - slomasktm->setEditedState(spotState->slomasktm ? Edited : UnEdited); - - // Retinex - expreti->set_inconsistent(!spotState->expreti); - - if (!spotState->retinexMethod) { - retinexMethod->set_active_text(M("GENERAL_UNCHANGED")); - } - - str->setEditedState(spotState->str ? Edited : UnEdited); - chrrt->setEditedState(spotState->chrrt ? Edited : UnEdited); - neigh->setEditedState(spotState->neigh ? Edited : UnEdited); - vart->setEditedState(spotState->vart ? Edited : UnEdited); - dehaz->setEditedState(spotState->dehaz ? Edited : UnEdited); - sensih->setEditedState(spotState->sensih ? Edited : UnEdited); - cTgainshape->setUnChanged(!spotState->localTgaincurve); - inversret->set_inconsistent(multiImage && !spotState->inversret); - equilret->set_inconsistent(multiImage && !spotState->equilret); - softradiusret->setEditedState(spotState->softradiusret ? Edited : UnEdited); - CCmaskretishape->setUnChanged(!spotState->CCmaskreticurve); - LLmaskretishape->setUnChanged(!spotState->LLmaskreticurve); - HHmaskretishape->setUnChanged(!spotState->HHmaskreticurve); - enaretiMask->set_inconsistent(multiImage && !spotState->enaretiMask); - enaretiMasktmap->set_inconsistent(multiImage && !spotState->enaretiMasktmap); - blendmaskreti->setEditedState(spotState->blendmaskreti ? Edited : UnEdited); - radmaskreti->setEditedState(spotState->radmaskreti ? Edited : UnEdited); - chromaskreti->setEditedState(spotState->chromaskreti ? Edited : UnEdited); - gammaskreti->setEditedState(spotState->gammaskreti ? Edited : UnEdited); - slomaskreti->setEditedState(spotState->slomaskreti ? Edited : UnEdited); - scalereti->setEditedState(spotState->scalereti ? Edited : UnEdited); - darkness->setEditedState(spotState->darkness ? Edited : UnEdited); - lightnessreti->setEditedState(spotState->lightnessreti ? Edited : UnEdited); - limd->setEditedState(spotState->limd ? Edited : UnEdited); - fftwreti->set_inconsistent(multiImage && !spotState->fftwreti); - - // Sharpening - expsharp->set_inconsistent(!spotState->expsharp); - sharcontrast->setEditedState(spotState->sharcontrast ? Edited : UnEdited); - sharradius->setEditedState(spotState->sharradius ? Edited : UnEdited); - sharamount->setEditedState(spotState->sharamount ? Edited : UnEdited); - shardamping->setEditedState(spotState->shardamping ? Edited : UnEdited); - shariter->setEditedState(spotState->shariter ? Edited : UnEdited); - sharblur->setEditedState(spotState->sharblur ? Edited : UnEdited); - sensisha->setEditedState(spotState->sensisha ? Edited : UnEdited); - inverssha->set_inconsistent(multiImage && !spotState->inverssha); - - // Local Contrast - expcontrast->set_inconsistent(!spotState->expcontrast); - lcradius->setEditedState(spotState->lcradius ? Edited : UnEdited); - lcamount->setEditedState(spotState->lcamount ? Edited : UnEdited); - lcdarkness->setEditedState(spotState->lcdarkness ? Edited : UnEdited); - lclightness->setEditedState(spotState->lclightness ? Edited : UnEdited); - levelwav->setEditedState(spotState->levelwav ? Edited : UnEdited); - residcont->setEditedState(spotState->residcont ? Edited : UnEdited); - sensilc->setEditedState(spotState->sensilc ? Edited : UnEdited); - fftwlc->set_inconsistent(multiImage && !spotState->fftwlc); - wavshape->setUnChanged(!spotState->locwavcurve); - if (!spotState->retinexMethod) { - localcontMethod->set_active_text(M("GENERAL_UNCHANGED")); - } - - // Contrast by detail levels - expcbdl->set_inconsistent(!spotState->expcbdl); - - for (int i = 0; i < 6; i++) { - multiplier[i]->setEditedState(spotState->mult[i] ? Edited : UnEdited); - } - - chromacbdl->setEditedState(spotState->chromacbdl ? Edited : UnEdited); - threshold->setEditedState(spotState->threshold ? Edited : UnEdited); - sensicb->setEditedState(spotState->sensicb ? Edited : UnEdited); - clarityml->setEditedState(spotState->clarityml ? Edited : UnEdited); - contresid->setEditedState(spotState->contresid ? Edited : UnEdited); - blurcbdl->setEditedState(spotState->blurcbdl ? Edited : UnEdited); - softradiuscb->setEditedState(spotState->softradiuscb ? Edited : UnEdited); - blendmaskcb->setEditedState(spotState->blendmaskcb ? Edited : UnEdited); - radmaskcb->setEditedState(spotState->radmaskcb ? Edited : UnEdited); - chromaskcb->setEditedState(spotState->chromaskcb ? Edited : UnEdited); - gammaskcb->setEditedState(spotState->gammaskcb ? Edited : UnEdited); - slomaskcb->setEditedState(spotState->slomaskcb ? Edited : UnEdited); - enacbMask->set_inconsistent(multiImage && !spotState->enacbMask); - CCmaskcbshape->setUnChanged(!spotState->CCmaskcbcurve); - LLmaskcbshape->setUnChanged(!spotState->LLmaskcbcurve); - HHmaskcbshape->setUnChanged(!spotState->HHmaskcbcurve); - - // Denoise - expdenoi->set_inconsistent(!spotState->expdenoi); - noiselumf->setEditedState(spotState->noiselumf ? Edited : UnEdited); - noiselumf0->setEditedState(spotState->noiselumf0 ? Edited : UnEdited); - noiselumf2->setEditedState(spotState->noiselumf2 ? Edited : UnEdited); - noiselumc->setEditedState(spotState->noiselumc ? Edited : UnEdited); - noiselumdetail->setEditedState(spotState->noiselumdetail ? Edited : UnEdited); - noiselequal->setEditedState(spotState->noiselequal ? Edited : UnEdited); - noisechrof->setEditedState(spotState->noisechrof ? Edited : UnEdited); - noisechroc->setEditedState(spotState->noisechroc ? Edited : UnEdited); - noisechrodetail->setEditedState(spotState->noisechrodetail ? Edited : UnEdited); - adjblur->setEditedState(spotState->adjblur ? Edited : UnEdited); - bilateral->setEditedState(spotState->bilateral ? Edited : UnEdited); - sensiden->setEditedState(spotState->sensiden ? Edited : UnEdited); + // If fold, selected tool expander is unfold + if (!tool->getExpanded()) { + tool->setExpanded(true); } } } } -void Locallab::updateSpecificGUIState() +void Locallab::addTool(Gtk::Box* where, LocallabTool* tool) { - // Update Color & Light GUI according to invers button state (to be compliant with inversChanged function) - sensi->show(); - llCurveEditorG->show(); - curvactiv->hide(); - blurcolde->show(); - - if (multiImage && invers->get_inconsistent()) { - HCurveEditorG->show(); - qualitycurveMethod->show(); - labqualcurv->show(); - expmaskcol->show(); - structcol->show(); - softradiuscol->show(); - showmaskcolMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - gridFrame->hide(); - } else if (invers->get_active()) { - HCurveEditorG->hide(); - qualitycurveMethod->hide(); - labqualcurv->hide(); - expmaskcol->hide(); - softradiuscol->hide(); - structcol->hide(); - gridFrame->hide(); - } else { - HCurveEditorG->show(); - qualitycurveMethod->show(); - labqualcurv->show(); - expmaskcol->show(); - structcol->show(); - gridFrame->show(); - softradiuscol->show(); - - if (batchMode) { - showmaskcolMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - } - } - - // Update Exposure GUI according to black adjuster state (to be compliant with adjusterChanged function) - sensiex->show(); - curveEditorG->show(); - blurexpde->show(); - - if (multiImage && inversex->get_inconsistent()) { - structexp->show(); - softradiusexp->show(); - shadex->show(); - expMethod->show(); - - if (expMethod->get_active_row_number() == 0) { - pdeFrame->hide(); - } else if (expMethod->get_active_row_number() == 1) { - pdeFrame->show(); - } - - showmaskexpMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - } else if (inversex->get_active()) { - structexp->hide(); - softradiusexp->hide(); - shadex->hide(); - expMethod->hide(); - pdeFrame->hide(); - - if (expMethod->get_active_row_number() == 0) { - pdeFrame->hide(); - } else if (expMethod->get_active_row_number() == 1) { - pdeFrame->hide(); - } - } else { - structexp->show(); - softradiusexp->show(); - shadex->show(); - expMethod->show(); - - if (expMethod->get_active_row_number() == 0) { - pdeFrame->hide(); - } else if (expMethod->get_active_row_number() == 1) { - pdeFrame->show(); - } - - if (batchMode) { - showmaskexpMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - } - } - - // Update SH GUI according to black adjuster state (to be compliant with adjusterChanged function) - sensihs->show(); - blurSHde->show(); - - if (multiImage && inversex->get_inconsistent()) { - showmaskSHMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - } else if (batchMode && !inverssh->get_active()) { - showmaskSHMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode - } - - - if (multiImage && black->getEditedState() != Edited) { - shcompr->set_sensitive(true); - } else { - shcompr->set_sensitive(!((int)black->getValue() == 0)); // At black = 0, shcompr value has no effect - } - - if (multiImage && shadex->getEditedState() != Edited) { - shcompr->set_sensitive(true); - } else { - shcompr->set_sensitive(!((int)shadex->getValue() == 0)); // At black = 0, shcompr value has no effect - } - - // Update Vibrance GUI according to pastsattog button state (to be compliant with pastsattog_toggled function) - if (multiImage && pastSatTog->get_inconsistent()) { - psThreshold->set_sensitive(true); - saturated->set_sensitive(true); - } else if (pastSatTog->get_active()) { - // Link both slider, so we set saturated and psThresholds unsensitive - psThreshold->set_sensitive(false); - saturated->set_sensitive(false); - saturated->setValue(pastels->getValue()); // Pastels and Saturated are linked - } else { - // Separate sliders, so we set saturated and psThresholds sensitive again - psThreshold->set_sensitive(true); - saturated->set_sensitive(true); - } - - if (expMethod->get_active_row_number() == 0) { - pdeFrame->hide(); - } else if (expMethod->get_active_row_number() == 1) { - pdeFrame->show(); - } - - // Update Retinex GUI according to inversret button state (to be compliant with inversretChanged function) - if (multiImage && inversret->get_inconsistent()) { - sensih->show(); - softradiusret->show(); - showmaskretiMethod->show(); // Being able to change Color & Light mask visibility is useless in batch mode - } else if (inversret->get_active()) { - sensih->show(); - softradiusret->show(); - showmaskretiMethod->hide(); - sensih->show(); - softradiusret->show(); - } - - if (localcontMethod->get_active_row_number() == 0) { - levelwav->hide(); - residcont->hide(); - lcradius->show(); - lcamount->show(); - lcdarkness->show(); - lclightness->show(); - LocalcurveEditorwav->hide(); - fftwlc->show(); - } else if (localcontMethod->get_active_row_number() == 1) { - levelwav->show(); - residcont->show(); - lcradius->hide(); - lcamount->hide(); - lcdarkness->hide(); - lclightness->hide(); - LocalcurveEditorwav->show(); - fftwlc->hide(); - } - - // Update Sharpening GUI according to inverssha button state (to be compliant with inversshaChanged function) - sensisha->show(); + where->pack_start(*tool->getExpander(), false, false); + locallabTools.push_back(tool); + tool->setLocallabToolListener(this); } -void Locallab::autoOpenCurve() +void Locallab::openAllTools() { - // printf("autoOpenCurve\n"); - - // TODO autoOpenCurve only considers linearity state of selected spot curve -// llshape->openIfNonlinear(); -// ccshape->openIfNonlinear(); -// LHshape->openIfNonlinear(); -// HHshape->openIfNonlinear(); -// CCmaskshape->openIfNonlinear(); -// LLmaskshape->openIfNonlinear(); -// HHmaskshape->openIfNonlinear(); -// CCmaskexpshape->openIfNonlinear(); -// LLmaskexpshape->openIfNonlinear(); + for (auto tool : locallabTools) { + tool->setExpanded(true); + } +} + +void Locallab::setParamEditable(bool cond) +{ + // Update params editable state for controlspotpanel + expsettings->setParamEditable(cond); // TODO Move this code to controlspotpanel.cc when there is zero spot + + // Enable/disable possibility to add Locallab tool + // TODO To implement + + // Remove all Locallab tool only if cond is false + // TODO To be managed in locallabtools first + /* + if (!cond) { + for (auto tool : locallabTools) { + tool->addLocallabTool(false); + } + } + */ +} + +void Locallab::resetOtherMaskView(LocallabTool* current) +{ + // Reset mask view GUI for all other Locallab tools except current + for (auto tool : locallabTools) { + if (tool != current) { + tool->resetMaskView(); + } + } } diff --git a/rtgui/locallab.h b/rtgui/locallab.h index bd5cdf8f9..df2b05d85 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -17,454 +17,53 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . * 2017 Jacques Desmis - * 2018 Pierre Cabrera + * 2019 Pierre Cabrera */ +#ifndef _LOCALLAB_H_ +#define _LOCALLAB_H_ -#include -#include "adjuster.h" +#include "controlspotpanel.h" +#include "locallabtools.h" #include "toolpanel.h" #include "editcallbacks.h" -#include "curveeditor.h" -#include "curveeditorgroup.h" -#include "toolpanel.h" -#include "options.h" -#include "thresholdadjuster.h" -#include "controlspotpanel.h" -#include "labgrid.h" + class Locallab : public ToolParamBlock, - public AdjusterListener, public FoldableToolPanel, - public CurveListener, - public ColorProvider, - public ThresholdCurveProvider, public rtengine::LocallabListener, - public ThresholdAdjusterListener - + public LocallabToolListener { private: - IdleRegister idle_register; - - // Expander widgets + // Spot control panel widget ControlSpotPanel* const expsettings; - MyExpander* const expcolor; - MyExpander* const expexpose; - MyExpander* const expshadhigh; - MyExpander* const expvibrance; - MyExpander* const expsoft; - MyExpander* const expblur; - MyExpander* const exptonemap; - MyExpander* const expreti; - MyExpander* const expsharp; - MyExpander* const expcontrast; - MyExpander* const expcbdl; - MyExpander* const expdenoi; - MyExpander* const expmaskcol; - MyExpander* const expmaskexp; - MyExpander* const expmasksh; - MyExpander* const expmaskcb; - MyExpander* const expmaskreti; - MyExpander* const expmasktm; - sigc::connection enablecolorConn, enableexposeConn, enableshadhighConn, enablevibranceConn, enablesoftConn, enableblurConn, enabletonemapConn, enableretiConn, enablesharpConn, enablecontrastConn, enablecbdlConn, enabledenoiConn; - // Curve widgets - // Color & Light - CurveEditorGroup* const llCurveEditorG; - CurveEditorGroup* const HCurveEditorG; - CurveEditorGroup* const maskCurveEditorG; - DiagonalCurveEditor* llshape; - DiagonalCurveEditor* ccshape; - FlatCurveEditor* LHshape; - FlatCurveEditor* HHshape; - FlatCurveEditor* CCmaskshape; - FlatCurveEditor* LLmaskshape; - FlatCurveEditor* HHmaskshape; - // Exposure - CurveEditorGroup* const curveEditorG; - CurveEditorGroup* const maskexpCurveEditorG; - DiagonalCurveEditor* shapeexpos; - FlatCurveEditor* CCmaskexpshape; - FlatCurveEditor* LLmaskexpshape; - FlatCurveEditor* HHmaskexpshape; - //Shadows Highlight - CurveEditorGroup* const maskSHCurveEditorG; - FlatCurveEditor* CCmaskSHshape; - FlatCurveEditor* LLmaskSHshape; - FlatCurveEditor* HHmaskSHshape; - // Vibrance - CurveEditorGroup* const curveEditorGG; - DiagonalCurveEditor* skinTonesCurve; - // TM - CurveEditorGroup* const masktmCurveEditorG; - FlatCurveEditor* CCmasktmshape; - FlatCurveEditor* LLmasktmshape; - FlatCurveEditor* HHmasktmshape; - // Retinex - CurveEditorGroup* const LocalcurveEditorgainT; - CurveEditorGroup* const maskretiCurveEditorG; - FlatCurveEditor* cTgainshape; - FlatCurveEditor* CCmaskretishape; - FlatCurveEditor* LLmaskretishape; - FlatCurveEditor* HHmaskretishape; - //local contrast - CurveEditorGroup* const LocalcurveEditorwav; - FlatCurveEditor* wavshape; - - //Cbdl - CurveEditorGroup* const maskcbCurveEditorG; - FlatCurveEditor* CCmaskcbshape; - FlatCurveEditor* LLmaskcbshape; - FlatCurveEditor* HHmaskcbshape; - - // Adjuster widgets - // Color & Light - Adjuster* const lightness; - Adjuster* const contrast; - Adjuster* const chroma; - Adjuster* const strengthgrid; - Adjuster* const sensi; - Adjuster* const structcol; - Adjuster* const blurcolde; - Adjuster* const blendmaskcol; - Adjuster* const radmaskcol; - Adjuster* const chromaskcol; - Adjuster* const gammaskcol; - Adjuster* const slomaskcol; - Adjuster* const softradiuscol; - // Exposure - Adjuster* const expcomp; - Adjuster* const hlcompr; - Adjuster* const hlcomprthresh; - Adjuster* const black; - Adjuster* const shadex; - Adjuster* const shcompr; - Adjuster* const expchroma; - Adjuster* const warm; - Adjuster* const sensiex; - Adjuster* const structexp; - Adjuster* const blurexpde; - Adjuster* const blendmaskexp; - Adjuster* const radmaskexp; - Adjuster* const chromaskexp; - Adjuster* const gammaskexp; - Adjuster* const slomaskexp; - Adjuster* const softradiusexp; - Adjuster* const laplacexp; - Adjuster* const balanexp; - Adjuster* const linear; - //Shadow highlight - Adjuster* const highlights; - Adjuster* const h_tonalwidth; - Adjuster* const shadows; - Adjuster* const s_tonalwidth; - Adjuster* const sh_radius; - Adjuster* const sensihs; - Adjuster* const blendmaskSH; - Adjuster* const radmaskSH; - Adjuster* const blurSHde; - Adjuster* const chromaskSH; - Adjuster* const gammaskSH; - Adjuster* const slomaskSH; - // Vibrance - Adjuster* const saturated; - Adjuster* const pastels; - Adjuster* const sensiv; - // Soft Light - Adjuster* const streng; - Adjuster* const laplace; - Adjuster* const sensisf; - // Blur & Noise - Adjuster* const radius; - Adjuster* const strength; - Adjuster* const sensibn; - // Tone Mapping - Adjuster* const stren; - Adjuster* const gamma; - Adjuster* const estop; - Adjuster* const scaltm; - Adjuster* const rewei; - Adjuster* const sensitm; - Adjuster* const softradiustm; - Adjuster* const amount; - Adjuster* const satur; - Adjuster* const blendmasktm; - Adjuster* const radmasktm; - Adjuster* const chromasktm; - Adjuster* const gammasktm; - Adjuster* const slomasktm; - // Retinex - Adjuster* const str; - Adjuster* const chrrt; - Adjuster* const neigh; - Adjuster* const vart; - Adjuster* const dehaz; - Adjuster* const sensih; - Adjuster* const softradiusret; - - Adjuster* const blendmaskreti; - Adjuster* const radmaskreti; - Adjuster* const chromaskreti; - Adjuster* const gammaskreti; - Adjuster* const slomaskreti; - Adjuster* const scalereti; - Adjuster* const darkness; - Adjuster* const lightnessreti; - Adjuster* const limd; - - // Sharpening - Adjuster* const sharcontrast; - Adjuster* const sharradius; - Adjuster* const sharamount; - Adjuster* const shardamping; - Adjuster* const shariter; - Adjuster* const sharblur; - Adjuster* const sensisha; - // Local Contrast - Adjuster* const lcradius; - Adjuster* const lcamount; - Adjuster* const lcdarkness; - Adjuster* const lclightness; - Adjuster* const levelwav; - Adjuster* const residcont; - Adjuster* const sensilc; - // Contrast by detail levels - Adjuster* multiplier[6]; - Adjuster* const chromacbdl; - Adjuster* const threshold; - Adjuster* const clarityml; - Adjuster* const contresid; - Adjuster* const blurcbdl; - Adjuster* const sensicb; - Adjuster* const softradiuscb; - Adjuster* const blendmaskcb; - Adjuster* const radmaskcb; - Adjuster* const chromaskcb; - Adjuster* const gammaskcb; - Adjuster* const slomaskcb; - - // Denoise - Adjuster* const noiselumf; - Adjuster* const noiselumf0; - Adjuster* const noiselumf2; - Adjuster* const noiselumc; - Adjuster* const noiselumdetail; - Adjuster* const noiselequal; - Adjuster* const noisechrof; - Adjuster* const noisechroc; - Adjuster* const noisechrodetail; - Adjuster* const adjblur; - Adjuster* const bilateral; - Adjuster* const sensiden; - - // ButtonCheck widgets - // Color & Light - Gtk::CheckButton* const curvactiv; - Gtk::CheckButton* const invers; - Gtk::CheckButton* const enaColorMask; - sigc::connection curvactivConn, inversConn, enaColorMaskConn; - // Exposure - Gtk::CheckButton* const enaExpMask; - sigc::connection enaExpMaskConn; - Gtk::CheckButton* const inversex; - sigc::connection inversexConn; - //Shadows highlight - Gtk::CheckButton* const enaSHMask; - sigc::connection enaSHMaskConn; - Gtk::CheckButton* const inverssh; - sigc::connection inversshConn; - // Vibrance - Gtk::CheckButton* const protectSkins; - Gtk::CheckButton* const avoidColorShift; - Gtk::CheckButton* const pastSatTog; - sigc::connection pskinsconn, ashiftconn, pastsattogconn; - // Blur & Noise - Gtk::CheckButton* const activlum; - sigc::connection activlumConn; - //Tone mapping - Gtk::CheckButton* const equiltm; - sigc::connection equiltmConn; - Gtk::CheckButton* const enatmMask; - sigc::connection enatmMaskConn; - // Retinex - Gtk::CheckButton* const equilret; - sigc::connection equilretConn; - Gtk::CheckButton* const inversret; - sigc::connection inversretConn; - Gtk::CheckButton* const enaretiMask; - sigc::connection enaretiMaskConn; - Gtk::CheckButton* const enaretiMasktmap; - sigc::connection enaretiMasktmapConn; - Gtk::CheckButton* const fftwreti; - sigc::connection fftwretiConn; - // Sharpening - Gtk::CheckButton* const inverssha; - sigc::connection inversshaConn; - //local contrast - Gtk::CheckButton* const fftwlc; - sigc::connection fftwlcConn; - - //CBDL - Gtk::CheckButton* const enacbMask; - sigc::connection enacbMaskConn; - - // ComboBox widgets - // Color & Light - MyComboBoxText* const qualitycurveMethod; - sigc::connection qualitycurveMethodConn; - MyComboBoxText* const gridMethod; - sigc::connection gridMethodConn; - MyComboBoxText* const showmaskcolMethod; - sigc::connection showmaskcolMethodConn; - //Exposure - MyComboBoxText* const showmaskexpMethod; - sigc::connection showmaskexpMethodConn; - MyComboBoxText* const expMethod; - sigc::connection expMethodConn; - //Shadows Highlight - MyComboBoxText* const showmaskSHMethod; - sigc::connection showmaskSHMethodConn; - // Blur & Noise - MyComboBoxText* const blurMethod; - sigc::connection blurMethodConn; - //soft light - MyComboBoxText* const softMethod; - sigc::connection softMethodConn; - MyComboBoxText* const showmasksoftMethod; - sigc::connection showmasksoftMethodConn; - //TM - MyComboBoxText* const showmasktmMethod; - sigc::connection showmasktmMethodConn; - // Retinex - MyComboBoxText* const retinexMethod; - sigc::connection retinexMethodConn; - MyComboBoxText* const showmaskretiMethod; - sigc::connection showmaskretiMethodConn; - //local contrast - MyComboBoxText* const localcontMethod; - sigc::connection localcontMethodConn; - //CBDL - MyComboBoxText* const showmaskcbMethod; - sigc::connection showmaskcbMethodConn; - // ThresholdAdjuster widgets - // Vibrance - ThresholdAdjuster* const psThreshold; - - // Other widgets - Gtk::Label* const labqualcurv; - Gtk::Button* const lumacontrastMinusButton; - Gtk::Button* const lumaneutralButton; - Gtk::Button* const lumacontrastPlusButton; - sigc::connection lumacontrastMinusPressedConn, lumaneutralPressedConn, lumacontrastPlusPressedConn; - Gtk::Frame* gridFrame; - Gtk::Frame* pdeFrame; - Gtk::Frame* residFrame; - LabGrid *labgrid; - // Others - Gtk::HBox* ctboxsoftmethod; - /** - * 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 - */ - const rtengine::procparams::ProcParams* defparams; - /** - * Used to store the default ParamsEdited when setDefaults function is called - * When an other spot is selected, this default ParamsEdited is used to update adjusters default edited state - */ - const ParamsEdited* defpedited; - /** - * Used to store the default ParamsEdited when setDefaults function is called - * This ParamsEdited is updated when control spots are modified and is used to update adjusters edited state - */ - ParamsEdited* pe; - - // Expander management functions - void foldAllButMe(GdkEventButton* event, MyExpander *expander); - void enableToggled(MyExpander *expander); - - // ButtonCheck event functions - // Color & Light - void curvactivChanged(); - void inversChanged(); - void enaColorMaskChanged(); - // Exposure - void enaExpMaskChanged(); - void inversexChanged(); - //Shadows Highlight - void enaSHMaskChanged(); - void inversshChanged(); - // Vibrance - void protectskins_toggled(); - void avoidcolorshift_toggled(); - void pastsattog_toggled(); - // Blur & Noise - void activlumChanged(); - //TM - void equiltmChanged(); - void enatmMaskChanged(); - // Retinex - void equilretChanged(); - void inversretChanged(); - void enaretiMaskChanged(); - void enaretiMasktmapChanged(); - void fftwretiChanged(); - // Sharpening - void inversshaChanged(); - // local contrast - void fftwlcChanged(); - //CBDL - void enacbMaskChanged(); - // ComboBox event functions - // Color & Light - void qualitycurveMethodChanged(); - void gridMethodChanged(); - void showmaskcolMethodChanged(); - //Exposure - void showmaskexpMethodChanged(); - void expMethodChanged(); - //Shadows Highlight - void showmaskSHMethodChanged(); - // Blur & Noise - void blurMethodChanged(); - // Soft light - void softMethodChanged(); - void showmasksoftMethodChanged(); - //TM - void showmasktmMethodChanged(); - // Retinex - void retinexMethodChanged(); - void showmaskretiMethodChanged(); - //Local contrast - void localcontMethodChanged(); - //CBDL - void showmaskcbMethodChanged(); - // Other widgets event functions - void lumacontrastMinusPressed(); - void lumaneutralPressed(); - void lumacontrastPlusPressed(); - - // Locallab GUI management function - void updateLocallabGUI(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited, int index); - void updateSpecificGUIState(); - void setParamEditable(bool cond); + // Locallab tool widgets + LocallabColor* expcolor; + LocallabExposure* expexpose; + LocallabShadow* expshadhigh; + LocallabVibrance* expvibrance; + LocallabSoft* expsoft; + LocallabBlur* expblur; + LocallabTone* exptonemap; + LocallabRetinex* expreti; + LocallabSharp* expsharp; + LocallabContrast* expcontrast; + LocallabCBDL* expcbdl; + LocallabDenoise* expdenoi; + std::vector locallabTools; public: Locallab(); - ~Locallab(); // FoldableToolPanel management functions void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr); void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr); void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); - void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited, int id); - void setBatchMode(bool batchMode); - void trimValues(rtengine::procparams::ProcParams* pp); void setListener(ToolPanelListener* tpl); - void enableListener(); - void disableListener(); - void writeOptions(std::vector &tpOpen); - void updateToolState(std::vector &tpOpen); + + // Locallab tools mask background management function void refChanged(double huer, double lumar, double chromar); // Mask visibility management functions @@ -492,19 +91,21 @@ public: // Curve management function void autoOpenCurve(); - // Curve event function - void curveChanged(CurveEditor* ce); + // Locallab tools expanders management functions + void foldAllButOne(LocallabTool* except); - // Adjuster event function - void adjusterChanged(Adjuster* a, double newval); - void adjusterAutoToggled(Adjuster* a, bool newval); +private: + // Locallab tools management functions + void addTool(Gtk::Box* where, LocallabTool* tool); - // ThresholdAdjuster event functions - virtual void colorForValue(double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); - std::vector getCurvePoints(ThresholdSelector* tAdjuster) const; - void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop); - void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop); - void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight); - void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); - void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); + // Locallab tools management functions + void openAllTools(); + + // Locallab GUI management function + void setParamEditable(bool cond); + + // LocallabToolListener function + void resetOtherMaskView(LocallabTool* current); }; + +#endif diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 3a77be69e..fce136ac8 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -23,6 +23,7 @@ #include "options.h" #include "multilangmgr.h" #include "../rtengine/procparams.h" +#include "locallab.h" using namespace rtengine; using namespace procparams; @@ -66,6 +67,7 @@ LocallabTool::LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustr } exp = Gtk::manage(new MyExpander(true, titleBox)); + exp->signal_button_release_event().connect_notify(sigc::mem_fun(this, &LocallabTool::foldThemAll)); enaExpConn = exp->signal_enabled_toggled().connect(sigc::mem_fun(*this, &LocallabTool::enabledChanged)); ToolParamBlock* const totalBox = Gtk::manage(new ToolParamBlock()); @@ -207,37 +209,39 @@ void LocallabTool::resetMaskView() void LocallabTool::refChanged(double huer, double lumar, double chromar) { - // Hue reference normalization (between 0 and 1) - double normHuer = huer; - float h = Color::huelab_to_huehsv2(normHuer); - h += 1.f / 6.f; + if (useMask) { + // Hue reference normalization (between 0 and 1) + double normHuer = huer; + float h = Color::huelab_to_huehsv2(normHuer); + h += 1.f / 6.f; - if (h > 1.f) { - h -= 1.f; + if (h > 1.f) { + h -= 1.f; + } + + normHuer = h; + + // Luma reference normalization (between 0 and 1) + const double normLumar = lumar / 100.f; + + // Chroma reference normalization (between 0 and 1) + const double normChromar = chromar / 137.4f; + + // printf("nh=%f nl=%f nc=%f\n", normHuer, normLumar, normChromar); + + idle_register.add( + [this, normHuer, normLumar, normChromar]() -> bool { + GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected + + // Update mask background + CCMaskShape->updateLocallabBackground(normChromar); + LLMaskShape->updateLocallabBackground(normLumar); + HHMaskShape->updateLocallabBackground(normHuer); + + return false; + } + ); } - - normHuer = h; - - // Luma reference normalization (between 0 and 1) - const double normLumar = lumar / 100.f; - - // Chroma reference normalization (between 0 and 1) - const double normChromar = chromar / 137.4f; - - // printf("nh=%f nl=%f nc=%f\n", normHuer, normLumar, normChromar); - - idle_register.add( - [this, normHuer, normLumar, normChromar]() -> bool { - GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected - - // Update mask background - CCMaskShape->updateLocallabBackground(normChromar); - LLMaskShape->updateLocallabBackground(normLumar); - HHMaskShape->updateLocallabBackground(normHuer); - - return false; - } - ); } void LocallabTool::colorForValue(double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) @@ -258,7 +262,6 @@ void LocallabTool::colorForValue(double valX, double valY, enum ColorCaller::Ele break; case 2: // HHmaskshape - // TODO float x = valX - 1.f / 6.f; if (x < 0.f) { @@ -266,7 +269,6 @@ void LocallabTool::colorForValue(double valX, double valY, enum ColorCaller::Ele } x = log2lin(x, 3.f); - // float x = valX; Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); } @@ -319,6 +321,15 @@ bool LocallabTool::on_remove_change(GdkEventButton* event) return true; // No event propagation further (to avoid closing expander when mouse clicking on remove image) } +void LocallabTool::foldThemAll(GdkEventButton* event) +{ + if (event->button == GDK_BUTTON_SECONDARY) { + if (locToolListener) { + (static_cast(locToolListener))->foldAllButOne(this); + } + } +} + /* ==== LocallabColor ==== */ LocallabColor::LocallabColor(): LocallabTool(this, "Locallab Color&Light", M("TP_LOCALLAB_COFR"), false, MaskNormal), @@ -519,7 +530,7 @@ void LocallabColor::colorForValue(double valX, double valY, enum ColorCaller::El void LocallabColor::setListener(ToolPanelListener* tpl) { - LocallabTool::setListener(tpl); //TODO Check if working + LocallabTool::setListener(tpl); labgrid->setListener(tpl); } @@ -667,7 +678,32 @@ void LocallabColor::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe void LocallabColor::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default value for adjuster and labgrid widgets + lightness->setDefault((double)defSpot.lightness); + contrast->setDefault((double)defSpot.contrast); + chroma->setDefault((double)defSpot.chroma); + labgrid->setDefault(defSpot.labgridALow / LocallabParams::LABGRIDL_CORR_MAX, + defSpot.labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, + defSpot.labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, + defSpot.labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX); + strengthgrid->setDefault((double) defSpot.strengthgrid); + sensi->setDefault((double)defSpot.sensi); + structcol->setDefault((double)defSpot.structcol); + blurcolde->setDefault((double)defSpot.blurcolde); + softradiuscol->setDefault(defSpot.softradiuscol); + blendMask->setDefault((double)defSpot.blendmaskcol); + radMask->setDefault(defSpot.radmaskcol); + chroMask->setDefault(defSpot.chromaskcol); + gamMask->setDefault(defSpot.gammaskcol); + sloMask->setDefault(defSpot.slomaskcol); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabColor::adjusterChanged(Adjuster* a, double newval) @@ -1197,7 +1233,35 @@ void LocallabExposure::write(rtengine::procparams::ProcParams* pp, ParamsEdited* void LocallabExposure::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default values for adjuster widgets + laplacexp->setDefault(defSpot.laplacexp); + linear->setDefault(defSpot.linear); + balanexp->setDefault(defSpot.balanexp); + expcomp->setDefault(defSpot.expcomp); + hlcompr->setDefault((double)defSpot.hlcompr); + hlcomprthresh->setDefault((double)defSpot.hlcomprthresh); + black->setDefault((double)defSpot.black); + shadex->setDefault((double)defSpot.shadex); + shcompr->setDefault((double)defSpot.shcompr); + expchroma->setDefault((double)defSpot.expchroma); + warm->setDefault((double)defSpot.warm); + sensiex->setDefault((double)defSpot.sensiex); + structexp->setDefault((double)defSpot.structexp); + blurexpde->setDefault((double)defSpot.blurexpde); + softradiusexp->setDefault(defSpot.softradiusexp); + blendMask->setDefault((double)defSpot.blendmaskexp); + radMask->setDefault(defSpot.radmaskexp); + chroMask->setDefault(defSpot.chromaskexp); + gamMask->setDefault(defSpot.gammaskexp); + sloMask->setDefault(defSpot.slomaskexp); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabExposure::adjusterChanged(Adjuster* a, double newval) @@ -1632,7 +1696,27 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p void LocallabShadow::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default values for adjuster widgets + highlights->setDefault((double)defSpot.highlights); + h_tonalwidth->setDefault((double)defSpot.h_tonalwidth); + shadows->setDefault((double)defSpot.shadows); + s_tonalwidth->setDefault((double)defSpot.s_tonalwidth); + sh_radius->setDefault((double)defSpot.sh_radius); + sensihs->setDefault((double)defSpot.sensihs); + blurSHde->setDefault((double)defSpot.blurSHde); + blendMask->setDefault((double)defSpot.blendmaskSH); + radMask->setDefault(defSpot.radmaskSH); + chroMask->setDefault(defSpot.chromaskSH); + gamMask->setDefault(defSpot.gammaskSH); + sloMask->setDefault(defSpot.slomaskSH); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabShadow::adjusterChanged(Adjuster* a, double newval) @@ -1965,7 +2049,19 @@ void LocallabVibrance::write(rtengine::procparams::ProcParams* pp, ParamsEdited* void LocallabVibrance::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default values for adjuster and threshold adjuster widgets + saturated->setDefault((double)defSpot.saturated); + pastels->setDefault((double)defSpot.pastels); + psThreshold->setDefault(defSpot.psthreshold); + sensiv->setDefault((double)defSpot.sensiv); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabVibrance::adjusterChanged(Adjuster* a, double newval) @@ -2272,7 +2368,18 @@ void LocallabSoft::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped void LocallabSoft::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default value for adjuster widgets + streng->setDefault((double)defSpot.streng); + laplace->setDefault(defSpot.laplace); + sensisf->setDefault((double)defSpot.sensisf); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabSoft::adjusterChanged(Adjuster* a, double newval) @@ -2301,6 +2408,13 @@ void LocallabSoft::adjusterChanged(Adjuster* a, double newval) } } +void LocallabSoft::resetMaskView() +{ + showmasksoftMethodConn.block(true); + showmasksoftMethod->set_active(0); + showmasksoftMethodConn.block(false); +} + void LocallabSoft::enabledChanged() { if (isLocActivated) { @@ -2469,7 +2583,18 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default value for adjuster widgets + radius->setDefault(defSpot.radius); + strength->setDefault((double)defSpot.strength); + sensibn->setDefault((double)defSpot.sensibn); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabBlur::adjusterChanged(Adjuster* a, double newval) diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 1d1970fd3..1e934bf8e 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -95,6 +95,17 @@ public: return exp; } + // Getter/setter for Locallab tool expanded status + void setExpanded(bool expanded) + { + exp->set_expanded(expanded); + } + + bool getExpanded() + { + return exp->get_expanded(); + } + // Setter for Locallab activation indicator void isLocallabActivated(bool cond) { @@ -149,6 +160,9 @@ private: // Remove button event function bool on_remove_change(GdkEventButton* event); + // Tool expander event function + void foldThemAll(GdkEventButton* event); + // To be implemented virtual void enabledChanged() {}; }; @@ -376,6 +390,8 @@ public: void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); void adjusterChanged(Adjuster* a, double newval); + void resetMaskView(); + private: void enabledChanged(); diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 144a93a0f..124840078 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -266,7 +266,29 @@ void LocallabTone::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped void LocallabTone::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default values for adjuster widgets + amount->setDefault(defSpot.amount); + stren->setDefault(defSpot.stren); + gamma->setDefault(defSpot.gamma); + satur->setDefault(defSpot.satur); + estop->setDefault(defSpot.estop); + scaltm->setDefault(defSpot.scaltm); + rewei->setDefault((double)defSpot.rewei); + softradiustm->setDefault(defSpot.softradiustm); + sensitm->setDefault((double)defSpot.sensitm); + blendMask->setDefault((double)defSpot.blendmasktm); + radMask->setDefault(defSpot.radmasktm); + chroMask->setDefault(defSpot.chromasktm); + gamMask->setDefault(defSpot.gammasktm); + sloMask->setDefault(defSpot.slomasktm); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabTone::adjusterChanged(Adjuster* a, double newval) @@ -702,7 +724,31 @@ void LocallabRetinex::write(rtengine::procparams::ProcParams* pp, ParamsEdited* void LocallabRetinex::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default values for adjuster widgets + str->setDefault(defSpot.str); + chrrt->setDefault(defSpot.chrrt); + neigh->setDefault(defSpot.neigh); + vart->setDefault(defSpot.vart); + scalereti->setDefault(defSpot.scalereti); + limd->setDefault(defSpot.limd); + darkness->setDefault(defSpot.darkness); + lightnessreti->setDefault(defSpot.lightnessreti); + dehaz->setDefault((double)defSpot.dehaz); + softradiusret->setDefault(defSpot.softradiusret); + sensih->setDefault((double)defSpot.sensih); + blendMask->setDefault((double)defSpot.blendmaskreti); + radMask->setDefault(defSpot.radmaskreti); + chroMask->setDefault(defSpot.chromaskreti); + gamMask->setDefault(defSpot.gammaskreti); + sloMask->setDefault(defSpot.slomaskreti); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabRetinex::adjusterChanged(Adjuster* a, double newval) @@ -1108,7 +1154,22 @@ void LocallabSharp::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe void LocallabSharp::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default values for adjuster widgets + sharcontrast->setDefault((double)defSpot.sharcontrast); + sharradius->setDefault(defSpot.sharradius); + sharamount->setDefault((double)defSpot.sharamount); + shardamping->setDefault((double)defSpot.shardamping); + shariter->setDefault((double)defSpot.shariter); + sharblur->setDefault(defSpot.sharblur); + sensisha->setDefault((double)defSpot.sensisha); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabSharp::adjusterChanged(Adjuster* a, double newval) @@ -1360,7 +1421,22 @@ void LocallabContrast::write(rtengine::procparams::ProcParams* pp, ParamsEdited* void LocallabContrast::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default values for adjuster widgets + lcradius->setDefault((double)defSpot.lcradius); + lcamount->setDefault(defSpot.lcamount); + lcdarkness->setDefault(defSpot.lcdarkness); + lclightness->setDefault(defSpot.lclightness); + levelwav->setDefault(defSpot.levelwav); + residcont->setDefault(defSpot.residcont); + sensilc->setDefault((double)defSpot.sensilc); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabContrast::adjusterChanged(Adjuster* a, double newval) @@ -1680,7 +1756,31 @@ void LocallabCBDL::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped void LocallabCBDL::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default values for adjuster widgets + for (int i = 0; i < 6; i++) { + multiplier[i]->setDefault(defSpot.mult[i]); + } + + chromacbdl->setDefault(defSpot.chromacbdl); + threshold->setDefault(defSpot.threshold); + blurcbdl->setDefault(defSpot.blurcbdl); + clarityml->setDefault(defSpot.clarityml); + contresid->setDefault((double)defSpot.contresid); + softradiuscb->setDefault(defSpot.softradiuscb); + sensicb->setDefault((double)defSpot.sensicb); + blendMask->setDefault((double)defSpot.blendmaskcb); + radMask->setDefault(defSpot.radmaskcb); + chroMask->setDefault(defSpot.chromaskcb); + gamMask->setDefault(defSpot.gammaskcb); + sloMask->setDefault(defSpot.slomaskcb); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabCBDL::adjusterChanged(Adjuster* a, double newval) @@ -2013,7 +2113,27 @@ void LocallabDenoise::write(rtengine::procparams::ProcParams* pp, ParamsEdited* void LocallabDenoise::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - // TODO + const int index = defParams->locallab.selspot; + + if (index < (int)defParams->locallab.spots.size()) { + const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + + // Set default values for adjuster widgets + noiselumf0->setDefault((double)defSpot.noiselumf0); + noiselumf->setDefault((double)defSpot.noiselumf); + noiselumf2->setDefault((double)defSpot.noiselumf2); + noiselumc->setDefault((double)defSpot.noiselumc); + noiselumdetail->setDefault((double)defSpot.noiselumdetail); + noiselequal->setDefault((double)defSpot.noiselequal); + noisechrof->setDefault((double)defSpot.noisechrof); + noisechroc->setDefault((double)defSpot.noisechroc); + noisechrodetail->setDefault((double)defSpot.noisechrodetail); + adjblur->setDefault((double)defSpot.adjblur); + bilateral->setDefault((double)defSpot.bilateral); + sensiden->setDefault((double)defSpot.sensiden); + } + + // Note: No need to manage pedited as batch mode is deactivated for Locallab } void LocallabDenoise::adjusterChanged(Adjuster* a, double newval) diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index d92a069d9..20e9f976e 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -718,13 +718,8 @@ void ToolPanelCoordinator::updateToolState() temp.push_back(options.tpOpen.at(i + expList.size())); } - locallab->updateToolState(temp); - locallab->setExpanded(true); - wavelet->updateToolState(temp); retinex->updateToolState(temp); - - } } @@ -753,7 +748,6 @@ void ToolPanelCoordinator::writeToolExpandedStatus(std::vector &tpOpen) tpOpen.push_back(expList.at(i)->get_expanded()); } - locallab->writeOptions(tpOpen); wavelet->writeOptions(tpOpen); retinex->writeOptions(tpOpen);