diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 01fb707d3..7fe72099f 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -971,6 +971,7 @@ enum ProcEventCode { Evlocallabcontmask = 945, Evlocallabshadmask = 946, EvlocallabLmask_shape = 947, + EvlocallabLLmask_shapewav = 948, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 0a8b6ff65..7fdf1e673 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3817,6 +3817,17 @@ LocallabParams::LocallabSpot::LocallabSpot() : 0.0, 1.0, 1.0 + }, + LLmask_curvewav{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.5, + 0.35, + 0.35, + 1., + 0.5, + 0.35, + 0.35 } @@ -4312,7 +4323,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && slopmask == other.slopmask && shadmask == other.shadmask && HHhmask_curve == other.HHhmask_curve - && Lmask_curve == other.Lmask_curve; + && Lmask_curve == other.Lmask_curve + && LLmask_curvewav == other.LLmask_curvewav; } @@ -5830,6 +5842,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo 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); saveToKeyfile(!pedited || spot_edited->Lmask_curve, "Locallab", "Lmask_Curve_" + index_str, spot.Lmask_curve, keyFile); + saveToKeyfile(!pedited || spot_edited->LLmask_curvewav, "Locallab", "LLmask_Curvewav_" + index_str, spot.LLmask_curvewav, keyFile); } } } @@ -7566,6 +7579,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) 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); assignFromKeyfile(keyFile, "Locallab", "Lmask_Curve_" + index_str, pedited, spot.Lmask_curve, spotEdited.Lmask_curve); + assignFromKeyfile(keyFile, "Locallab", "LLmask_Curvewav_" + index_str, pedited, spot.LLmask_curvewav, spotEdited.LLmask_curvewav); if (spot.visimask) { spotEdited.visimask = true; diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 258d69cf1..ecde2d41a 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1444,6 +1444,7 @@ struct LocallabParams { double shadmask; std::vector HHhmask_curve; std::vector Lmask_curve; + std::vector LLmask_curvewav; LocallabSpot(); diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index f9fae6873..11ea7d5d6 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -974,7 +974,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabblurmask LUMINANCECURVE, // Evlocallabcontmask LUMINANCECURVE, // Evlocallabshadmask - LUMINANCECURVE // EvlocallabLmask_shape + LUMINANCECURVE, // EvlocallabLmask_shape + LUMINANCECURVE // EvlocallabLLmask_shapewav }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 9fa353fec..473ebf8be 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -1230,6 +1230,8 @@ private: FlatCurveEditor* const HHhmask_shape; CurveEditorGroup* const mask2CurveEditorG; DiagonalCurveEditor* const Lmask_shape; + CurveEditorGroup* const mask2CurveEditorGwav; + FlatCurveEditor* const LLmask_shapewav; sigc::connection showmaskMethodConn, enamaskConn, toolmaskConn, fftmaskConn; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 003bb96bf..2556c248a 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -4757,7 +4757,9 @@ LocallabMask::LocallabMask(): mask_HCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASKH"))), HHhmask_shape(static_cast(mask_HCurveEditorG->addCurve(CT_Flat, "H(H)", nullptr, false, true))), mask2CurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK2"))), - Lmask_shape(static_cast(mask2CurveEditorG->addCurve(CT_Diagonal, "L(L)"))) + Lmask_shape(static_cast(mask2CurveEditorG->addCurve(CT_Diagonal, "L(L)"))), + mask2CurveEditorGwav(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVMASK"))), + LLmask_shapewav(static_cast(mask2CurveEditorGwav->addCurve(CT_Flat, "L(L)", nullptr, false, false))) { // Parameter Mask common specific widgets @@ -4826,6 +4828,14 @@ LocallabMask::LocallabMask(): mask2CurveEditorG->curveListComplete(); + mask2CurveEditorGwav->setCurveListener(this); + + LLmask_shapewav->setIdentityValue(0.); + LLmask_shapewav->setResetCurve(FlatCurveType(defSpot.LLmask_curvewav.at(0)), defSpot.LLmask_curvewav); + LLmask_shapewav->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + + mask2CurveEditorGwav->curveListComplete(); + pack_start(*sensimask, Gtk::PACK_SHRINK, 0); pack_start(*blendmask, Gtk::PACK_SHRINK, 0); @@ -4860,6 +4870,7 @@ LocallabMask::LocallabMask(): 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 toolmaskBox->pack_start(*mask2CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + toolmaskBox->pack_start(*mask2CurveEditorGwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor toolmaskFrame->add(*toolmaskBox); maskmaskBox->pack_start(*toolmaskFrame); pack_start(*maskmaskBox); @@ -4900,6 +4911,8 @@ void LocallabMask::updateAdviceTooltips(const bool showTooltips) lapmask->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); mask2CurveEditorG->set_tooltip_text(M("TP_LOCALLAB_WAVMASK_TOOLTIP")); Lmask_shape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + mask2CurveEditorGwav->set_tooltip_text(M("TP_LOCALLAB_WAVMASK_TOOLTIP")); + LLmask_shapewav->setTooltip(M("TP_LOCALLAB_LMASK_LEVEL_TOOLTIP")); } else { exp->set_tooltip_text(M("")); @@ -4914,6 +4927,8 @@ void LocallabMask::updateAdviceTooltips(const bool showTooltips) lapmask->set_tooltip_text(M("")); mask2CurveEditorG->set_tooltip_text(M("")); Lmask_shape->setTooltip(M("")); + mask2CurveEditorGwav->set_tooltip_text(M("")); + LLmask_shapewav->setTooltip(M("")); } } @@ -4922,6 +4937,7 @@ LocallabMask::~LocallabMask() delete mask_CurveEditorG; delete mask_HCurveEditorG; delete mask2CurveEditorG; + delete mask2CurveEditorGwav; } void LocallabMask::disableListener() @@ -4997,6 +5013,7 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params HHhmask_shape->setCurve(spot.HHhmask_curve); fftmask->set_active(spot.fftmask); Lmask_shape->setCurve(spot.Lmask_curve); + LLmask_shapewav->setCurve(spot.LLmask_curvewav); } @@ -5042,6 +5059,7 @@ void LocallabMask::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.contmask = contmask->getValue(); spot.blurmask = blurmask->getValue(); spot.Lmask_curve = Lmask_shape->getCurve(); + spot.LLmask_curvewav = LLmask_shapewav->getCurve(); } @@ -5104,7 +5122,8 @@ void LocallabMask::updateGUIToMode(const modeType new_type) blurFrame->hide(); mask_HCurveEditorG->hide(); // mask2CurveEditorG->hide(); - + mask2CurveEditorGwav->hide(); + } else { // Advanced widgets are shown in Expert mode lapmask->show(); @@ -5115,7 +5134,8 @@ void LocallabMask::updateGUIToMode(const modeType new_type) blurFrame->show(); mask_HCurveEditorG->show(); // mask2CurveEditorG->show(); - + mask2CurveEditorGwav->show(); + } } @@ -5138,6 +5158,7 @@ void LocallabMask::convertParamToNormal() contmask->setValue(defSpot.contmask); HHhmask_shape->setCurve(defSpot.HHhmask_curve); // Lmask_shape->setCurve(defSpot.Lmask_curve); + LLmask_shapewav->setCurve(defSpot.LLmask_curvewav); // Enable all listeners enableListener(); @@ -5233,6 +5254,13 @@ void LocallabMask::curveChanged(CurveEditor* ce) } } + if (ce == LLmask_shapewav) { + if (listener) { + listener->panelChanged(EvlocallabLLmask_shapewav, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } } diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 0927b8ff5..407e67064 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1500,6 +1500,7 @@ void ParamsEdited::initFrom(const std::vector& 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; locallab.spots.at(j).Lmask_curve = locallab.spots.at(j).Lmask_curve && pSpot.Lmask_curve == otherSpot.Lmask_curve; + locallab.spots.at(j).LLmask_curvewav = locallab.spots.at(j).LLmask_curvewav && pSpot.LLmask_curvewav == otherSpot.LLmask_curvewav; } } @@ -4894,6 +4895,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).Lmask_curve = mods.locallab.spots.at(i).Lmask_curve; } + if (locallab.spots.at(i).LLmask_curvewav) { + toEdit.locallab.spots.at(i).LLmask_curvewav = mods.locallab.spots.at(i).LLmask_curvewav; + } + } if (pcvignette.enabled) { @@ -6485,7 +6490,8 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : slopmask(v), shadmask(v), HHhmask_curve(v), - Lmask_curve(v) + Lmask_curve(v), + LLmask_curvewav(v) { } @@ -6970,6 +6976,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) shadmask = v; HHhmask_curve =(v); Lmask_curve =(v); + LLmask_curvewav =(v); } bool CaptureSharpeningParamsEdited::isUnchanged() const diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index b2c933afa..7f82e128a 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -858,6 +858,7 @@ public: bool shadmask; bool HHhmask_curve; bool Lmask_curve; + bool LLmask_curvewav; LocallabSpotEdited(bool v);