diff --git a/rtdata/languages/default b/rtdata/languages/default index 72e9c0602..210048b8a 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1180,6 +1180,7 @@ 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_944;Local - Mask Common FFT 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 c750593f8..879edf337 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -966,6 +966,7 @@ enum ProcEventCode { EvLocallabtoolmask = 940, Evlocallabstrumaskmask = 941, EvlocallabHHhmask_shape = 942, + EvLocallabfftmask = 943, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index fd2499ea7..059b15057 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3740,6 +3740,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : sensimask(60), blendmask(0), enamask(false), + fftmask(true), CCmask_curve{ static_cast(FCT_MinMaxCPoints), 0.0, @@ -4285,6 +4286,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && sensimask == other.sensimask && blendmask == other.blendmask && enamask == other.enamask + && fftmask == other.fftmask && CCmask_curve == other.CCmask_curve && LLmask_curve == other.LLmask_curve && HHmask_curve == other.HHmask_curve @@ -5797,6 +5799,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo 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); + saveToKeyfile(!pedited || spot_edited->fftmask, "Locallab", "Fftmask_" + index_str, spot.fftmask, keyFile); saveToKeyfile(!pedited || spot_edited->CCmask_curve, "Locallab", "CCmask_Curve_" + index_str, spot.CCmask_curve, keyFile); saveToKeyfile(!pedited || spot_edited->LLmask_curve, "Locallab", "LLmask_Curve_" + index_str, spot.LLmask_curve, keyFile); saveToKeyfile(!pedited || spot_edited->HHmask_curve, "Locallab", "HHmask_Curve_" + index_str, spot.HHmask_curve, keyFile); @@ -7528,6 +7531,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) 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); + assignFromKeyfile(keyFile, "Locallab", "Fftmask_" + index_str, pedited, spot.fftmask, spotEdited.fftmask); assignFromKeyfile(keyFile, "Locallab", "CCmask_Curve_" + index_str, pedited, spot.CCmask_curve, spotEdited.CCmask_curve); assignFromKeyfile(keyFile, "Locallab", "LLmask_Curve_" + index_str, pedited, spot.LLmask_curve, spotEdited.LLmask_curve); assignFromKeyfile(keyFile, "Locallab", "HHmask_Curve_" + index_str, pedited, spot.HHmask_curve, spotEdited.HHmask_curve); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index ab785df76..c13055aa7 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1428,6 +1428,7 @@ struct LocallabParams { int sensimask; int blendmask; bool enamask; + bool fftmask; std::vector CCmask_curve; std::vector LLmask_curve; std::vector HHmask_curve; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index e0ce25926..f9a0c39d5 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -969,7 +969,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvlocallabHHmask_shape LUMINANCECURVE, // EvLocallabtoolmask LUMINANCECURVE, // Evlocallabstrumaskmask - LUMINANCECURVE //EvlocallabHHhmask_shape + LUMINANCECURVE, // EvlocallabHHhmask_shape + LUMINANCECURVE // EvLocallabfftmask }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index ee000da56..0eaf0d206 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -1215,6 +1215,8 @@ private: Gtk::Frame* const struFrame; Adjuster* const strumaskmask; Gtk::CheckButton* const toolmask; + Gtk::Frame* const blurFrame; + Gtk::CheckButton* const fftmask; Adjuster* const radmask; Adjuster* const lapmask; @@ -1224,7 +1226,7 @@ private: CurveEditorGroup* const mask_HCurveEditorG; FlatCurveEditor* const HHhmask_shape; - sigc::connection showmaskMethodConn, enamaskConn, toolmaskConn; + sigc::connection showmaskMethodConn, enamaskConn, toolmaskConn, fftmaskConn; public: LocallabMask(); @@ -1253,6 +1255,8 @@ private: void toolmaskChanged(); void convertParamToNormal() override; void updateGUIToMode(const modeType new_type) override; + void fftmaskChanged(); + void updatemaskGUI3(); /* void autocomputeToggled(); diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 384134fd8..40826613e 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -4742,7 +4742,9 @@ LocallabMask::LocallabMask(): struFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABSTRUM")))), strumaskmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUMASKCOL"), 0., 200., 0.1, 0.))), toolmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_TOOLCOL")))), - + blurFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABBLURM")))), + fftmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTCOL_MASK")))), + radmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), -10.0, 1000.0, 0.1, 0.))), 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.))), @@ -4788,6 +4790,9 @@ LocallabMask::LocallabMask(): strumaskmask->setAdjusterListener(this); toolmaskConn = toolmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::toolmaskChanged)); + blurFrame->set_label_align(0.025, 0.5); + + fftmaskConn = fftmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::fftmaskChanged)); radmask->setAdjusterListener(this); lapmask->setAdjusterListener(this); @@ -4819,6 +4824,11 @@ LocallabMask::LocallabMask(): struFrame->add(*strumBox); maskmaskBox->pack_start(*struFrame, Gtk::PACK_SHRINK, 0); + ToolParamBlock* const blurmBox = Gtk::manage(new ToolParamBlock()); + blurmBox->pack_start(*fftmask, Gtk::PACK_SHRINK, 0); + blurFrame->add(*blurmBox); + maskmaskBox->pack_start(*blurFrame, Gtk::PACK_SHRINK, 0); + Gtk::Frame* const toolmaskFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_TOOLMASK"))); toolmaskFrame->set_label_align(0.025, 0.5); ToolParamBlock* const toolmaskBox = Gtk::manage(new ToolParamBlock()); @@ -4894,6 +4904,7 @@ void LocallabMask::disableListener() showmaskMethodConn.block(true); enamaskConn.block(true); toolmaskConn.block(true); + fftmaskConn.block(true); } @@ -4903,6 +4914,7 @@ void LocallabMask::enableListener() showmaskMethodConn.block(false); enamaskConn.block(false); toolmaskConn.block(false); + fftmaskConn.block(false); } @@ -4936,9 +4948,11 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params exp->set_visible(spot.visimask); exp->setEnabled(spot.expmask); complexity->set_active(spot.complexmask); - - + + sensimask->setValue(spot.sensimask); + updatemaskGUI3(); + blendmask->setValue(spot.blendmask); enamask->set_active(spot.enamask); CCmask_shape->setCurve(spot.CCmask_curve); @@ -4952,6 +4966,7 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params gammask->setValue(spot.gammask); slopmask->setValue(spot.slopmask); HHhmask_shape->setCurve(spot.HHhmask_curve); + fftmask->set_active(spot.fftmask); } @@ -4992,6 +5007,7 @@ void LocallabMask::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.gammask = gammask->getValue(); spot.slopmask = slopmask->getValue(); spot.HHhmask_curve = HHhmask_shape->getCurve(); + spot.fftmask = fftmask->get_active(); } @@ -5047,12 +5063,14 @@ void LocallabMask::updateGUIToMode(const modeType new_type) gammask->hide(); slopmask->hide(); struFrame->hide(); + blurFrame->hide(); } else { // Advanced widgets are shown in Expert mode lapmask->show(); gammask->show(); slopmask->show(); struFrame->show(); + blurFrame->show(); } } @@ -5069,12 +5087,47 @@ void LocallabMask::convertParamToNormal() slopmask->setValue(defSpot.slopmask); strumaskmask->setValue(defSpot.strumaskmask); toolmask->set_active(defSpot.toolmask); + fftmask->set_active(defSpot.fftmask); // Enable all listeners enableListener(); } +void LocallabMask::updatemaskGUI3() +{ /* + const double temp = blurcol->getValue(); + + if (fftColorMask->get_active()) { + blurcol->setLimits(0.2, 1000., 0.5, 0.2); + } else { + blurcol->setLimits(0.2, 100., 0.5, 0.2); + } + + blurcol->setValue(temp); + */ +} + + + +void LocallabMask::fftmaskChanged() +{ + updatemaskGUI3(); // Update GUI according to fftmask button state + + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (fftmask->get_active()) { + listener->panelChanged(EvLocallabfftmask, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } else { + listener->panelChanged(EvLocallabfftmask, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } +} + + void LocallabMask::curveChanged(CurveEditor* ce) { if (isLocActivated && exp->getEnabled()) { diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 49ad58aac..bfa727be3 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1484,6 +1484,7 @@ void ParamsEdited::initFrom(const std::vector& 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; + locallab.spots.at(j).fftmask = locallab.spots.at(j).fftmask && pSpot.fftmask == otherSpot.fftmask; locallab.spots.at(j).CCmask_curve = locallab.spots.at(j).CCmask_curve && pSpot.CCmask_curve == otherSpot.CCmask_curve; locallab.spots.at(j).LLmask_curve = locallab.spots.at(j).LLmask_curve && pSpot.LLmask_curve == otherSpot.LLmask_curve; locallab.spots.at(j).HHmask_curve = locallab.spots.at(j).HHmask_curve && pSpot.HHmask_curve == otherSpot.HHmask_curve; @@ -4825,6 +4826,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).enamask = mods.locallab.spots.at(i).enamask; } + if (locallab.spots.at(i).fftmask) { + toEdit.locallab.spots.at(i).fftmask = mods.locallab.spots.at(i).fftmask; + } + if (locallab.spots.at(i).CCmask_curve) { toEdit.locallab.spots.at(i).CCmask_curve = mods.locallab.spots.at(i).CCmask_curve; } @@ -6445,6 +6450,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : sensimask(v), blendmask(v), enamask(v), + fftmask(v), CCmask_curve(v), LLmask_curve(v), HHmask_curve(v), @@ -6924,6 +6930,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) sensimask = v; blendmask = v; enamask = v; + fftmask = v; CCmask_curve = v; LLmask_curve = v; HHmask_curve = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 27e9887c0..69d1e885b 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -842,6 +842,7 @@ public: bool sensimask; bool blendmask; bool enamask; + bool fftmask; bool CCmask_curve; bool LLmask_curve; bool HHmask_curve;