diff --git a/rtdata/languages/default b/rtdata/languages/default index e954b156e..c8e7a7bf4 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1183,6 +1183,7 @@ HISTORY_MSG_943;Local - Mask Common H(H) curve HISTORY_MSG_944;Local - Mask Common FFT HISTORY_MSG_945;Local - Mask Common Blur radius HISTORY_MSG_946;Local - Mask Common contrast threshold +HISTORY_MSG_947;Local - Mask Common shadows 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 ad5cd34c4..9ed965ccd 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -969,6 +969,7 @@ enum ProcEventCode { EvLocallabfftmask = 943, Evlocallabblurmask = 944, Evlocallabcontmask = 945, + Evlocallabshadmask = 946, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 591f57b13..20a976bde 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3795,6 +3795,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : chromask(0.0), gammask(1.0), slopmask(0.0), + shadmask(0.0), HHhmask_curve{ static_cast(FCT_MinMaxCPoints), 0.0, @@ -4301,6 +4302,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && chromask == other.chromask && gammask == other.gammask && slopmask == other.slopmask + && shadmask == other.shadmask && HHhmask_curve == other.HHhmask_curve; } @@ -5816,6 +5818,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->chromask, "Locallab", "Chromask_" + index_str, spot.chromask, keyFile); saveToKeyfile(!pedited || spot_edited->gammask, "Locallab", "Gammask_" + index_str, spot.gammask, keyFile); saveToKeyfile(!pedited || spot_edited->slopmask, "Locallab", "Slopmask_" + index_str, spot.slopmask, keyFile); + saveToKeyfile(!pedited || spot_edited->shadmask, "Locallab", "Shadmask_" + index_str, spot.shadmask, keyFile); saveToKeyfile(!pedited || spot_edited->HHhmask_curve, "Locallab", "HHhmask_Curve_" + index_str, spot.HHhmask_curve, keyFile); } } @@ -7550,6 +7553,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Chromask_" + index_str, pedited, spot.chromask, spotEdited.chromask); assignFromKeyfile(keyFile, "Locallab", "Gammask_" + index_str, pedited, spot.gammask, spotEdited.gammask); assignFromKeyfile(keyFile, "Locallab", "Slopmask_" + index_str, pedited, spot.slopmask, spotEdited.slopmask); + assignFromKeyfile(keyFile, "Locallab", "Shadmask_" + index_str, pedited, spot.shadmask, spotEdited.shadmask); assignFromKeyfile(keyFile, "Locallab", "HHhmask_Curve_" + index_str, pedited, spot.HHhmask_curve, spotEdited.HHhmask_curve); if (spot.visimask) { diff --git a/rtengine/procparams.h b/rtengine/procparams.h index a0e5719f0..0079433cc 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1441,6 +1441,7 @@ struct LocallabParams { double chromask; double gammask; double slopmask; + double shadmask; std::vector HHhmask_curve; LocallabSpot(); diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index d2459851d..7ddd1fc4c 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -972,7 +972,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvlocallabHHhmask_shape LUMINANCECURVE, // EvLocallabfftmask LUMINANCECURVE, // Evlocallabblurmask - LUMINANCECURVE // Evlocallabcontmask + LUMINANCECURVE, // Evlocallabcontmask + LUMINANCECURVE // Evlocallabshadmask }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 13415cbe5..35050176b 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -1769,6 +1769,7 @@ void LocallabColor::convertParamToNormal() toolcol->set_active(defSpot.toolcol); fftColorMask->set_active(defSpot.fftColorMask); contcol->setValue(defSpot.contcol); + blurcol->setValue(defSpot.blurcol); lapmaskcol->setValue(defSpot.lapmaskcol); gammaskcol->setValue(defSpot.gammaskcol); slomaskcol->setValue(defSpot.slomaskcol); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index fe3a3df79..b65ac707b 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -1225,6 +1225,7 @@ private: Adjuster* const chromask; Adjuster* const gammask; Adjuster* const slopmask; + Adjuster* const shadmask; CurveEditorGroup* const mask_HCurveEditorG; FlatCurveEditor* const HHhmask_shape; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 60c2c9707..2246f9bea 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -4752,6 +4752,7 @@ LocallabMask::LocallabMask(): chromask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), gammask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.25, 4.0, 0.01, 1.))), slopmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), + shadmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHAMASKCOL"), 0, 100, 1, 0))), mask_HCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASKH"))), HHhmask_shape(static_cast(mask_HCurveEditorG->addCurve(CT_Flat, "H(H)", nullptr, false, true))) @@ -4804,6 +4805,7 @@ LocallabMask::LocallabMask(): chromask->setAdjusterListener(this); gammask->setAdjusterListener(this); slopmask->setAdjusterListener(this); + shadmask->setAdjusterListener(this); mask_HCurveEditorG->setCurveListener(this); @@ -4845,6 +4847,7 @@ LocallabMask::LocallabMask(): toolmaskBox->pack_start(*chromask, Gtk::PACK_SHRINK, 0); toolmaskBox->pack_start(*gammask, Gtk::PACK_SHRINK, 0); toolmaskBox->pack_start(*slopmask, Gtk::PACK_SHRINK, 0); + toolmaskBox->pack_start(*shadmask, Gtk::PACK_SHRINK, 0); toolmaskBox->pack_start(*mask_HCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor toolmaskFrame->add(*toolmaskBox); maskmaskBox->pack_start(*toolmaskFrame); @@ -4974,6 +4977,7 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params chromask->setValue(spot.chromask); gammask->setValue(spot.gammask); slopmask->setValue(spot.slopmask); + shadmask->setValue(spot.shadmask); HHhmask_shape->setCurve(spot.HHhmask_curve); fftmask->set_active(spot.fftmask); @@ -5015,6 +5019,7 @@ void LocallabMask::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.chromask = chromask->getValue(); spot.gammask = gammask->getValue(); spot.slopmask = slopmask->getValue(); + spot.shadmask = shadmask->getValue(); spot.HHhmask_curve = HHhmask_shape->getCurve(); spot.fftmask = fftmask->get_active(); spot.contmask = contmask->getValue(); @@ -5059,6 +5064,7 @@ void LocallabMask::setDefaults(const rtengine::procparams::ProcParams* defParams chromask->setDefault(defSpot.chromask); lapmask->setDefault(defSpot.lapmask); slopmask->setDefault(defSpot.slopmask); + shadmask->setDefault(defSpot.shadmask); HHhmask_shape->setCurve(defSpot.HHhmask_curve); contmask->setDefault(defSpot.contmask); blurmask->setDefault(defSpot.blurmask); @@ -5075,6 +5081,7 @@ void LocallabMask::updateGUIToMode(const modeType new_type) lapmask->hide(); gammask->hide(); slopmask->hide(); + shadmask->hide(); struFrame->hide(); blurFrame->hide(); mask_HCurveEditorG->hide(); @@ -5084,6 +5091,7 @@ void LocallabMask::updateGUIToMode(const modeType new_type) lapmask->show(); gammask->show(); slopmask->show(); + shadmask->show(); struFrame->show(); blurFrame->show(); mask_HCurveEditorG->show(); @@ -5102,6 +5110,7 @@ void LocallabMask::convertParamToNormal() lapmask->setValue(defSpot.lapmask); gammask->setValue(defSpot.gammask); slopmask->setValue(defSpot.slopmask); + shadmask->setValue(defSpot.shadmask); strumaskmask->setValue(defSpot.strumaskmask); toolmask->set_active(defSpot.toolmask); fftmask->set_active(defSpot.fftmask); @@ -5260,6 +5269,13 @@ void LocallabMask::adjusterChanged(Adjuster* a, double newval) } } + if (a == shadmask) { + if (listener) { + listener->panelChanged(Evlocallabshadmask, + shadmask->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } } diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 0f88e8ec9..9fccd0637 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1497,6 +1497,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).chromask = locallab.spots.at(j).chromask && pSpot.chromask == otherSpot.chromask; locallab.spots.at(j).gammask = locallab.spots.at(j).gammask && pSpot.gammask == otherSpot.gammask; locallab.spots.at(j).slopmask = locallab.spots.at(j).slopmask && pSpot.slopmask == otherSpot.slopmask; + locallab.spots.at(j).shadmask = locallab.spots.at(j).shadmask && pSpot.shadmask == otherSpot.shadmask; locallab.spots.at(j).HHhmask_curve = locallab.spots.at(j).HHhmask_curve && pSpot.HHhmask_curve == otherSpot.HHhmask_curve; } } @@ -4880,6 +4881,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).slopmask = mods.locallab.spots.at(i).slopmask; } + if (locallab.spots.at(i).shadmask) { + toEdit.locallab.spots.at(i).shadmask = mods.locallab.spots.at(i).shadmask; + } + if (locallab.spots.at(i).HHhmask_curve) { toEdit.locallab.spots.at(i).HHhmask_curve = mods.locallab.spots.at(i).HHhmask_curve; } @@ -6473,6 +6478,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : chromask(v), gammask(v), slopmask(v), + shadmask(v), HHhmask_curve(v) { @@ -6955,6 +6961,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) chromask = v; gammask = v; slopmask = v; + shadmask = v; HHhmask_curve =(v); } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index bd76fc8c7..52893d34d 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -855,6 +855,7 @@ public: bool chromask; bool gammask; bool slopmask; + bool shadmask; bool HHhmask_curve; LocallabSpotEdited(bool v);