diff --git a/rtdata/languages/default b/rtdata/languages/default index 724af3f0a..72e9c0602 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1177,6 +1177,9 @@ HISTORY_MSG_937;Local - Mask Common slope HISTORY_MSG_938;Local - Mask Common curve C(C) HISTORY_MSG_939;Local - Mask Common curve L(L) HISTORY_MSG_940;Local - Mask Common curve LC(H) +HISTORY_MSG_941;Local - Mask Common structure as tool +HISTORY_MSG_942;Local - Mask Common structure strength +HISTORY_MSG_943;Local - Mask Common H(H) curve 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 d98a8a6c2..c750593f8 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -965,6 +965,7 @@ enum ProcEventCode { EvlocallabHHmask_shape = 939, EvLocallabtoolmask = 940, Evlocallabstrumaskmask = 941, + EvlocallabHHhmask_shape = 942, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 1bcec4de2..fd2499ea7 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3791,7 +3791,22 @@ LocallabParams::LocallabSpot::LocallabSpot() : lapmask(0.0), chromask(0.0), gammask(1.0), - slopmask(0.0) + slopmask(0.0), + HHhmask_curve{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.5, + 0.35, + 0.35, + 0.50, + 0.5, + 0.35, + 0.35, + 1.00, + 0.5, + 0.35, + 0.35 + } { } @@ -4279,7 +4294,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && lapmask == other.lapmask && chromask == other.chromask && gammask == other.gammask - && slopmask == other.slopmask; + && slopmask == other.slopmask + && HHhmask_curve == other.HHhmask_curve; } @@ -5791,6 +5807,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->HHhmask_curve, "Locallab", "HHhmask_Curve_" + index_str, spot.HHhmask_curve, keyFile); } } } @@ -7521,6 +7538,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", "HHhmask_Curve_" + index_str, pedited, spot.HHhmask_curve, spotEdited.HHhmask_curve); if (spot.visimask) { spotEdited.visimask = true; diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 79c81e63e..ab785df76 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1438,6 +1438,7 @@ struct LocallabParams { double chromask; double gammask; double slopmask; + std::vector HHhmask_curve; LocallabSpot(); diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 29417c059..e0ce25926 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -968,7 +968,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvlocallabLLmask_shape LUMINANCECURVE, // EvlocallabHHmask_shape LUMINANCECURVE, // EvLocallabtoolmask - LUMINANCECURVE // Evlocallabstrumaskmask + LUMINANCECURVE, // Evlocallabstrumaskmask + LUMINANCECURVE //EvlocallabHHhmask_shape }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 91f7d4989..ee000da56 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -1221,6 +1221,8 @@ private: Adjuster* const chromask; Adjuster* const gammask; Adjuster* const slopmask; + CurveEditorGroup* const mask_HCurveEditorG; + FlatCurveEditor* const HHhmask_shape; sigc::connection showmaskMethodConn, enamaskConn, toolmaskConn; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index f3448de71..384134fd8 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -4747,7 +4747,10 @@ LocallabMask::LocallabMask(): lapmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPMASKCOL"), 0.0, 100.0, 0.1, 0.))), 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.))) + slopmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.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))) { // Parameter Mask common specific widgets @@ -4791,7 +4794,16 @@ LocallabMask::LocallabMask(): chromask->setAdjusterListener(this); gammask->setAdjusterListener(this); slopmask->setAdjusterListener(this); - + + mask_HCurveEditorG->setCurveListener(this); + + HHhmask_shape->setIdentityValue(0.); + HHhmask_shape->setResetCurve(FlatCurveType(defSpot.HHhmask_curve.at(0)), defSpot.HHhmask_curve); + HHhmask_shape->setCurveColorProvider(this, 2); + HHhmask_shape->setBottomBarColorProvider(this, 2); + + mask_HCurveEditorG->curveListComplete(); + pack_start(*sensimask, Gtk::PACK_SHRINK, 0); pack_start(*blendmask, Gtk::PACK_SHRINK, 0); @@ -4816,6 +4828,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(*mask_HCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor toolmaskFrame->add(*toolmaskBox); maskmaskBox->pack_start(*toolmaskFrame); pack_start(*maskmaskBox); @@ -4851,6 +4864,9 @@ void LocallabMask::updateAdviceTooltips(const bool showTooltips) LLmask_shape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmask_shape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); struFrame->set_tooltip_text(M("TP_LOCALLAB_STRUMASK_TOOLTIP")); + mask_HCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_HHMASK_TOOLTIP")); + radmask->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + lapmask->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); } else { exp->set_tooltip_text(M("")); @@ -4860,12 +4876,16 @@ void LocallabMask::updateAdviceTooltips(const bool showTooltips) LLmask_shape->setTooltip(M("")); HHmask_shape->setTooltip(M("")); struFrame->set_tooltip_text(M("")); + mask_HCurveEditorG->set_tooltip_text(M("")); + radmask->set_tooltip_text(M("")); + lapmask->set_tooltip_text(M("")); } } LocallabMask::~LocallabMask() { delete mask_CurveEditorG; + delete mask_HCurveEditorG; } void LocallabMask::disableListener() @@ -4931,6 +4951,7 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params chromask->setValue(spot.chromask); gammask->setValue(spot.gammask); slopmask->setValue(spot.slopmask); + HHhmask_shape->setCurve(spot.HHhmask_curve); } @@ -4970,6 +4991,7 @@ void LocallabMask::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.chromask = chromask->getValue(); spot.gammask = gammask->getValue(); spot.slopmask = slopmask->getValue(); + spot.HHhmask_curve = HHhmask_shape->getCurve(); } @@ -5010,6 +5032,7 @@ void LocallabMask::setDefaults(const rtengine::procparams::ProcParams* defParams chromask->setDefault(defSpot.chromask); lapmask->setDefault(defSpot.lapmask); slopmask->setDefault(defSpot.slopmask); + HHhmask_shape->setCurve(defSpot.HHhmask_curve); } @@ -5077,6 +5100,12 @@ void LocallabMask::curveChanged(CurveEditor* ce) } } + if (ce == HHhmask_shape) { + if (listener) { + listener->panelChanged(EvlocallabHHhmask_shape, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } } } diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 7111d1986..49ad58aac 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1494,6 +1494,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).HHhmask_curve = locallab.spots.at(j).HHhmask_curve && pSpot.HHhmask_curve == otherSpot.HHhmask_curve; } } @@ -4864,6 +4865,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).HHhmask_curve) { + toEdit.locallab.spots.at(i).HHhmask_curve = mods.locallab.spots.at(i).HHhmask_curve; + } + } if (pcvignette.enabled) { @@ -6449,7 +6454,8 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : lapmask(v), chromask(v), gammask(v), - slopmask(v) + slopmask(v), + HHhmask_curve(v) { } @@ -6928,6 +6934,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) chromask = v; gammask = v; slopmask = v; + HHhmask_curve =(v); } bool CaptureSharpeningParamsEdited::isUnchanged() const diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index b177101f3..27e9887c0 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -852,6 +852,7 @@ public: bool chromask; bool gammask; bool slopmask; + bool HHhmask_curve; LocallabSpotEdited(bool v);