diff --git a/rtdata/languages/default b/rtdata/languages/default index c99155cd6..090edf72a 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1168,6 +1168,7 @@ HISTORY_MSG_927;Local - Shadow mask HISTORY_MSG_928;Local - Common color mask HISTORY_MSG_929;Local - Mask common scope HISTORY_MSG_930;Local - Mask Common blend +HISTORY_MSG_932;Local - Mask Common enable HISTORY_MSG_CAT02PRESET;Cat02 automatic preset HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 03ae99862..998215c86 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -954,6 +954,7 @@ enum ProcEventCode { Evlocallabsensimask = 928, Evlocallabblendmask = 929, EvlocallabshowmaskmaskMethod = 930, + EvLocallabEnaMask = 931, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 992281437..524fc600f 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3737,7 +3737,8 @@ LocallabParams::LocallabSpot::LocallabSpot() : visimask(false), expmask(false), sensimask(60), - blendmask(0) + blendmask(0), + enamask(false) { } @@ -4213,7 +4214,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && visimask == other.visimask && expmask == other.expmask && sensimask == other.sensimask - && blendmask == other.blendmask; + && blendmask == other.blendmask + && enamask == other.enamask; } @@ -5713,6 +5715,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->expmask, "Locallab", "Expmask_" + index_str, spot.expmask, keyFile); saveToKeyfile(!pedited || spot_edited->sensimask, "Locallab", "Sensimask_" + index_str, spot.sensimask, keyFile); saveToKeyfile(!pedited || spot_edited->blendmask, "Locallab", "Blendmaskmask_" + index_str, spot.blendmask, keyFile); + saveToKeyfile(!pedited || spot_edited->enamask, "Locallab", "Enamask_" + index_str, spot.enamask, keyFile); } } } @@ -7431,6 +7434,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spot.visimask = assignFromKeyfile(keyFile, "Locallab", "Expmask_" + index_str, pedited, spot.expmask, spotEdited.expmask); assignFromKeyfile(keyFile, "Locallab", "Sensimask_" + index_str, pedited, spot.sensimask, spotEdited.sensimask); assignFromKeyfile(keyFile, "Locallab", "Blendmaskmask_" + index_str, pedited, spot.blendmask, spotEdited.blendmask); + assignFromKeyfile(keyFile, "Locallab", "Enamask_" + index_str, pedited, spot.enamask, spotEdited.enamask); if (spot.visimask) { spotEdited.visimask = true; diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 3c00f3b16..b20323c52 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1426,6 +1426,7 @@ struct LocallabParams { bool expmask; int sensimask; int blendmask; + bool enamask; LocallabSpot(); diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index c64b09de8..586532ce5 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -957,7 +957,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvLocenamask LUMINANCECURVE, // Evlocallabsensimask LUMINANCECURVE, // Evlocallabblendmask - LUMINANCECURVE // EvlocallabshowmaskmaskMethod + LUMINANCECURVE, // EvlocallabshowmaskmaskMethod + LUMINANCECURVE // EvLocallabEnaMask }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 0692b14da..b094a81e3 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -1206,8 +1206,9 @@ private: Adjuster* const sensimask; Adjuster* const blendmask; MyComboBoxText* const showmaskMethod; + Gtk::CheckButton* const enamask; - sigc::connection showmaskMethodConn; + sigc::connection showmaskMethodConn, enamaskConn; public: LocallabMask(); @@ -1230,6 +1231,7 @@ public: private: void enabledChanged() override; void showmaskMethodChanged(); + void enamaskChanged(); /* void autocomputeToggled(); diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 3e8e6464c..923cfbb27 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -4730,7 +4730,8 @@ LocallabMask::LocallabMask(): LocallabTool(this, M("TP_LOCALLAB_MASKCOM_TOOLNAME"), M("TP_LOCALLAB_MASKCOM"), false, false), sensimask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), blendmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), - showmaskMethod(Gtk::manage(new MyComboBoxText())) + showmaskMethod(Gtk::manage(new MyComboBoxText())), + enamask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))) { // Parameter Mask common specific widgets @@ -4743,10 +4744,12 @@ LocallabMask::LocallabMask(): showmaskMethod->set_active(0); showmaskMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskMethodConn = showmaskMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabMask::showmaskMethodChanged)); + enamaskConn = enamask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::enamaskChanged)); pack_start(*sensimask, Gtk::PACK_SHRINK, 0); pack_start(*blendmask, Gtk::PACK_SHRINK, 0); pack_start(*showmaskMethod, Gtk::PACK_SHRINK, 4); + pack_start(*enamask, Gtk::PACK_SHRINK, 0); } @@ -4788,6 +4791,7 @@ void LocallabMask::disableListener() { LocallabTool::disableListener(); showmaskMethodConn.block(true); + enamaskConn.block(true); } @@ -4795,6 +4799,7 @@ void LocallabMask::enableListener() { LocallabTool::enableListener(); showmaskMethodConn.block(false); + enamaskConn.block(false); } @@ -4831,6 +4836,7 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params sensimask->setValue(spot.sensimask); blendmask->setValue(spot.blendmask); + enamask->set_active(spot.enamask); } @@ -4855,12 +4861,30 @@ void LocallabMask::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.sensimask = sensimask->getIntValue(); spot.blendmask = blendmask->getIntValue(); + spot.enamask = enamask->get_active(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab } +void LocallabMask::enamaskChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (enamask->get_active()) { + listener->panelChanged(EvLocallabEnaMask, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } else { + listener->panelChanged(EvLocallabEnaMask, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } +} + + + void LocallabMask::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { const int index = defParams->locallab.selspot; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index cd83a784e..427ada9ad 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1482,6 +1482,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).expmask = locallab.spots.at(j).expmask && pSpot.expmask == otherSpot.expmask; locallab.spots.at(j).sensimask = locallab.spots.at(j).sensimask && pSpot.sensimask == otherSpot.sensimask; locallab.spots.at(j).blendmask = locallab.spots.at(j).blendmask && pSpot.blendmask == otherSpot.blendmask; + locallab.spots.at(j).enamask = locallab.spots.at(j).enamask && pSpot.enamask == otherSpot.enamask; } } @@ -4804,6 +4805,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).blendmask = mods.locallab.spots.at(i).blendmask; } + if (locallab.spots.at(i).enamask) { + toEdit.locallab.spots.at(i).enamask = mods.locallab.spots.at(i).enamask; + } + } if (pcvignette.enabled) { @@ -6377,8 +6382,8 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : visimask(v), expmask(v), sensimask(v), - blendmask(v) - + blendmask(v), + enamask(v) { } @@ -6844,6 +6849,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) expmask = v; sensimask = v; blendmask = v; + enamask = v; } bool CaptureSharpeningParamsEdited::isUnchanged() const diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 962a0d7cb..a559408e2 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -840,6 +840,7 @@ public: bool expmask; bool sensimask; bool blendmask; + bool enamask; LocallabSpotEdited(bool v);