diff --git a/rtdata/languages/default b/rtdata/languages/default index cfdda482f..60405f63e 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1046,6 +1046,10 @@ HISTORY_MSG_805;Local - Blur Noise mask Structure HISTORY_MSG_806;Local - Color mask Structure as tool HISTORY_MSG_807;Local - Blur Noise mask Structure as tool HISTORY_MSG_808;Local - Color mask curve H(H) +HISTORY_MSG_809;Local - Vib mask curve C(C) +HISTORY_MSG_810;Local - Vib mask curve L(L) +HISTORY_MSG_811;Local - Vib mask curve LC(H) +HISTORY_MSG_813;Local - Use Vib mask HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index c62a9761c..ce5712a52 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -239,6 +239,7 @@ ImProcCoordinator::ImProcCoordinator() : locallExpMaskinv(0), locallSHMask(0), locallSHMaskinv(0), + locallvibMask(0), locallcbMask(0), locallretiMask(0), locallsoftMask(0), diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index a8e2c7248..007187cce 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -337,6 +337,7 @@ protected: int locallExpMaskinv; int locallSHMask; int locallSHMaskinv; + int locallvibMask; int locallcbMask; int locallretiMask; int locallsoftMask; @@ -411,13 +412,14 @@ public: updaterThreadStart.unlock(); } - void setLocallabMaskVisibility (int locallColorMask, int locallColorMaskinv, int locallExpMask, int locallExpMaskinv, int locallSHMask, int locallSHMaskinv, int locallcbMask, int locallretiMask, int locallsoftMask, int localltmMask, int locallblMask) override + void setLocallabMaskVisibility (int locallColorMask, int locallColorMaskinv, int locallExpMask, int locallExpMaskinv, int locallSHMask, int locallSHMaskinv, int locallvibMask, int locallcbMask, int locallretiMask, int locallsoftMask, int localltmMask, int locallblMask) override { this->locallColorMask = locallColorMask; this->locallColorMaskinv = locallColorMaskinv; this->locallExpMask = locallExpMask; this->locallExpMaskinv = locallExpMaskinv; this->locallSHMask = locallSHMask; + this->locallvibMask = locallvibMask; this->locallSHMaskinv = locallSHMaskinv; this->locallcbMask = locallcbMask; this->locallretiMask = locallretiMask; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 04cdba7fc..044d3c2b4 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -832,6 +832,11 @@ enum ProcEventCode { EvLocallabtoolcol = 805, Evlocallabtoolbl = 806, EvlocallabHHhmaskshape = 807, + EvlocallabCCmaskvibshape = 808, + EvlocallabLLmaskvibshape = 809, + EvlocallabHHmaskvibshape = 810, + EvlocallabshowmaskvibMethod = 811, + EvLocallabEnavibMask = 812, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index c8fb506c4..aedfc34f7 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2568,6 +2568,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : pastsattog(true), sensiv(15), skintonescurve{(double)DCT_Linear}, + CCmaskvibcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35 }, + LLmaskvibcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35}, + HHmaskvibcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35}, + enavibMask(false), // Soft Light expsoft(false), streng(0), @@ -2899,7 +2903,11 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && pastsattog == other.pastsattog && sensiv == other.sensiv && skintonescurve == other.skintonescurve - // Soft Light + && CCmaskvibcurve == other.CCmaskvibcurve + && LLmaskvibcurve == other.LLmaskvibcurve + && HHmaskvibcurve == other.HHmaskvibcurve + && enavibMask == other.enavibMask + // Soft Light && expsoft == other.expsoft && streng == other.streng && sensisf == other.sensisf @@ -4209,6 +4217,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).pastsattog, "Locallab", "PastSatTog_" + std::to_string(i), spot.pastsattog, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensiv, "Locallab", "Sensiv_" + std::to_string(i), spot.sensiv, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).skintonescurve, "Locallab", "SkinTonesCurve_" + std::to_string(i), spot.skintonescurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).CCmaskvibcurve, "Locallab", "CCmaskvibCurve_" + std::to_string(i), spot.CCmaskvibcurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).LLmaskvibcurve, "Locallab", "LLmaskvibCurve_" + std::to_string(i), spot.LLmaskvibcurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).HHmaskvibcurve, "Locallab", "HHmaskvibCurve_" + std::to_string(i), spot.HHmaskvibcurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).enavibMask, "Locallab", "EnavibMask_" + std::to_string(i), spot.enavibMask, keyFile); // Soft Light saveToKeyfile(!pedited || pedited->locallab.spots.at(i).expsoft, "Locallab", "Expsoft_" + std::to_string(i), spot.expsoft, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).streng, "Locallab", "Streng_" + std::to_string(i), spot.streng, keyFile); @@ -5657,7 +5669,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "PastSatTog_" + std::to_string(i), pedited, spot.pastsattog, spotEdited.pastsattog); assignFromKeyfile(keyFile, "Locallab", "Sensiv_" + std::to_string(i), pedited, spot.sensiv, spotEdited.sensiv); assignFromKeyfile(keyFile, "Locallab", "SkinTonesCurve_" + std::to_string(i), pedited, spot.skintonescurve, spotEdited.skintonescurve); - // Soft Light + assignFromKeyfile(keyFile, "Locallab", "CCmaskvibCurve_" + std::to_string(i), pedited, spot.CCmaskvibcurve, spotEdited.CCmaskvibcurve); + assignFromKeyfile(keyFile, "Locallab", "LLmaskvibCurve_" + std::to_string(i), pedited, spot.LLmaskvibcurve, spotEdited.LLmaskvibcurve); + assignFromKeyfile(keyFile, "Locallab", "HHmaskvibCurve_" + std::to_string(i), pedited, spot.HHmaskvibcurve, spotEdited.HHmaskvibcurve); + assignFromKeyfile(keyFile, "Locallab", "EnavibMask_" + std::to_string(i), pedited, spot.enavibMask, spotEdited.enavibMask); + // Soft Light assignFromKeyfile(keyFile, "Locallab", "Expsoft_" + std::to_string(i), pedited, spot.expsoft, spotEdited.expsoft); assignFromKeyfile(keyFile, "Locallab", "Streng_" + std::to_string(i), pedited, spot.streng, spotEdited.streng); assignFromKeyfile(keyFile, "Locallab", "Sensisf_" + std::to_string(i), pedited, spot.sensisf, spotEdited.sensisf); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 6b5c91185..cb4aceec0 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1111,6 +1111,10 @@ struct LocallabParams { bool pastsattog; int sensiv; std::vector skintonescurve; + std::vector CCmaskvibcurve; + std::vector LLmaskvibcurve; + std::vector HHmaskvibcurve; + bool enavibMask; // Soft Light bool expsoft; int streng; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 8475674fc..d81485011 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -835,7 +835,13 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //EvLocallabstrumaskbl LUMINANCECURVE, // EvLocallabtoolcol LUMINANCECURVE, //Evlocallabtoolbl - LUMINANCECURVE //EvlocallabHHhmaskshape + LUMINANCECURVE, //EvlocallabHHhmaskshape + LUMINANCECURVE, // EvlocallabCCmaskvibshape + LUMINANCECURVE, //EvlocallabLLmaskvibshape + LUMINANCECURVE, //EvlocallabHHmaskvibshape + LUMINANCECURVE, //EvlocallabshowmaskvibMethod + LUMINANCECURVE //EvLocallabEnavibMask + }; namespace rtengine diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 401c55302..ebfa47088 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -523,7 +523,7 @@ public: virtual void updateUnLock() = 0; - virtual void setLocallabMaskVisibility(int locallColorMask, int locallColorMaskinv, int locallExpMask, int locallExpMaskinv, int locallSHMask, int locallSHMaskinv, int locallcbMask, int locallretiMask, int locallsoftMask, int localltmMask, int locallblMask) = 0; + virtual void setLocallabMaskVisibility(int locallColorMask, int locallColorMaskinv, int locallExpMask, int locallExpMaskinv, int locallvibMask, int locallSHMask, int locallSHMaskinv, int locallcbMask, int locallretiMask, int locallsoftMask, int localltmMask, int locallblMask) = 0; /** Creates and returns a Crop instance that acts as a window on the image * @param editDataProvider pointer to the EditDataProvider that communicates with the EditSubscriber diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 7dfd928e4..57e26f881 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -152,6 +152,7 @@ Locallab::Locallab(): expmaskreti(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWR")))), expmasktm(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWT")))), expmaskbl(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWPLUS")))), + expmaskvib(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWVI")))), // CurveEditorGroup widgets @@ -199,8 +200,12 @@ Locallab::Locallab(): // Vibrance curveEditorGG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL"))), - + maskvibCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK"))), skinTonesCurve(static_cast(curveEditorGG->addCurve(CT_Diagonal, M("TP_VIBRANCE_CURVEEDITOR_SKINTONES")))), + CCmaskvibshape(static_cast(maskvibCurveEditorG->addCurve(CT_Flat, "C(C)", nullptr, false, false))), + LLmaskvibshape(static_cast(maskvibCurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false))), + HHmaskvibshape(static_cast(maskvibCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true))), + //Blur maskblCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK"))), @@ -487,6 +492,7 @@ inverssh(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), protectSkins(Gtk::manage(new Gtk::CheckButton(M("TP_VIBRANCE_PROTECTSKINS")))), avoidColorShift(Gtk::manage(new Gtk::CheckButton(M("TP_VIBRANCE_AVOIDCOLORSHIFT")))), pastSatTog(Gtk::manage(new Gtk::CheckButton(M("TP_VIBRANCE_PASTSATTOG")))), +enavibMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), // Blur & Noise activlum(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ACTIV")))), enablMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), @@ -530,6 +536,8 @@ exnoiseMethod(Gtk::manage(new MyComboBoxText())), shMethod(Gtk::manage(new MyComboBoxText())), showmaskSHMethod(Gtk::manage(new MyComboBoxText())), showmaskSHMethodinv(Gtk::manage(new MyComboBoxText())), +//vibrance +showmaskvibMethod(Gtk::manage(new MyComboBoxText())), // Blur & Noise blurMethod(Gtk::manage(new MyComboBoxText())), //soft Method @@ -1449,6 +1457,14 @@ pe(nullptr) expvibrance->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expvibrance)); enablevibranceConn = expvibrance->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expvibrance)); + setExpandAlignProperties(expmaskvib, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + expmaskvib->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskvib)); + expmaskvib->setLevel(2); + + if (showtooltip) { + expmaskvib->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + } + saturated->setAdjusterListener(this); pastels->setAdjusterListener(this); @@ -1505,6 +1521,72 @@ pe(nullptr) vibranceBox->pack_start(*pastSatTog, Gtk::PACK_SHRINK, 0); vibranceBox->pack_start(*sensiv, Gtk::PACK_SHRINK, 0); vibranceBox->pack_start(*curveEditorGG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + + enavibMaskConn = enavibMask->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::enavibMaskChanged)); + + showmaskvibMethod->append(M("TP_LOCALLAB_SHOWMNONE")); + showmaskvibMethod->append(M("TP_LOCALLAB_SHOWMODIF")); + showmaskvibMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); + showmaskvibMethod->append(M("TP_LOCALLAB_SHOWMASK")); + showmaskvibMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); + + + showmaskvibMethod->set_active(0); + + if (showtooltip) { + showmaskvibMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); + } + + showmaskvibMethodConn = showmaskvibMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::showmaskvibMethodChanged)); + + maskvibCurveEditorG->setCurveListener(this); + + CCmaskvibshape->setIdentityValue(0.); + CCmaskvibshape->setResetCurve(FlatCurveType(defSpot.CCmaskvibcurve.at(0)), defSpot.CCmaskvibcurve); + + if (showtooltip) { + CCmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + } + + CCmaskvibshape->setBottomBarColorProvider(this, 7); + + LLmaskvibshape->setIdentityValue(0.); + LLmaskvibshape->setResetCurve(FlatCurveType(defSpot.LLmaskvibcurve.at(0)), defSpot.LLmaskvibcurve); + + if (showtooltip) { + LLmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + } + + LLmaskvibshape->setBottomBarBgGradient(mllshape); + + HHmaskvibshape->setIdentityValue(0.); + HHmaskvibshape->setResetCurve(FlatCurveType(defSpot.HHmaskvibcurve.at(0)), defSpot.HHmaskvibcurve); + + if (showtooltip) { + HHmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + } + + HHmaskvibshape->setCurveColorProvider(this, 6); + HHmaskvibshape->setBottomBarColorProvider(this, 6); + + maskvibCurveEditorG->curveListComplete(); + + ToolParamBlock* const maskvibBox = Gtk::manage(new ToolParamBlock()); + + maskvibBox->pack_start(*showmaskvibMethod, Gtk::PACK_SHRINK, 4); + maskvibBox->pack_start(*enavibMask, Gtk::PACK_SHRINK, 0); + maskvibBox->pack_start(*maskvibCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor +/* maskSHBox->pack_start(*blendmaskSH, Gtk::PACK_SHRINK, 0); + maskSHBox->pack_start(*radmaskSH, Gtk::PACK_SHRINK, 0); + maskSHBox->pack_start(*lapmaskSH, Gtk::PACK_SHRINK, 0); + maskSHBox->pack_start(*chromaskSH, Gtk::PACK_SHRINK, 0); + maskSHBox->pack_start(*gammaskSH, Gtk::PACK_SHRINK, 0); + maskSHBox->pack_start(*slomaskSH, Gtk::PACK_SHRINK, 0); + maskSHBox->pack_start(*mask2SHCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + maskSHBox->pack_start(*fatSHFrame); + */ + expmaskvib->add(*maskvibBox, false); +// vibranceBox->pack_start(*expmaskvib); expvibrance->add(*vibranceBox, false); expvibrance->setLevel(2); @@ -2639,6 +2721,7 @@ Locallab::~Locallab() delete curveEditorG; delete maskexpCurveEditorG; delete maskSHCurveEditorG; + delete maskvibCurveEditorG; delete curveEditorGG; delete LocalcurveEditortransT; delete LocalcurveEditorgainT; @@ -2677,6 +2760,7 @@ void Locallab::foldAllButMe(GdkEventButton* event, MyExpander *expander) expmaskreti->set_expanded(expmaskreti == expander); expmasktm->set_expanded(expmasktm == expander); expmaskbl->set_expanded(expmaskbl == expander); + expmaskvib->set_expanded(expmaskvib == expander); } } @@ -2771,6 +2855,7 @@ void Locallab::writeOptions(std::vector &tpOpen) tpOpen.push_back(expmaskreti->get_expanded()); tpOpen.push_back(expmasktm->get_expanded()); tpOpen.push_back(expmaskbl->get_expanded()); + tpOpen.push_back(expmaskvib->get_expanded()); } @@ -2888,6 +2973,11 @@ void Locallab::refChanged(double huer, double lumar, double chromar) LLmaskSHshape->updateLocallabBackground(normLumar); HHmaskSHshape->updateLocallabBackground(normHuer); + // Update Vibrance mask background + CCmaskvibshape->updateLocallabBackground(normChromar); + LLmaskvibshape->updateLocallabBackground(normLumar); + HHmaskvibshape->updateLocallabBackground(normHuer); + // Update CBDL mask background CCmaskcbshape->updateLocallabBackground(normChromar); LLmaskcbshape->updateLocallabBackground(normLumar); @@ -2917,7 +3007,7 @@ void Locallab::refChanged(double huer, double lumar, double chromar) void Locallab::updateToolState(std::vector &tpOpen) { - if (tpOpen.size() >= 22) { + if (tpOpen.size() >= 23) { expsettings->setExpanded(tpOpen.at(0)); expcolor->set_expanded(tpOpen.at(1)); expexpose->set_expanded(tpOpen.at(2)); @@ -2939,6 +3029,7 @@ void Locallab::updateToolState(std::vector &tpOpen) expmaskreti->set_expanded(tpOpen.at(18)); expmasktm->set_expanded(tpOpen.at(19)); expmaskbl->set_expanded(tpOpen.at(20)); + expmaskvib->set_expanded(tpOpen.at(21)); } } @@ -3886,6 +3977,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).pastsattog = pastSatTog->get_active(); pp->locallab.spots.at(pp->locallab.selspot).sensiv = sensiv->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).skintonescurve = skinTonesCurve->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).LLmaskvibcurve = LLmaskvibshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).CCmaskvibcurve = CCmaskvibshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).HHmaskvibcurve = HHmaskvibshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).enavibMask = enavibMask->get_active(); // Soft Light pp->locallab.spots.at(pp->locallab.selspot).expsoft = expsoft->getEnabled(); pp->locallab.spots.at(pp->locallab.selspot).streng = streng->getIntValue(); @@ -4259,6 +4354,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).pastsattog = pe->locallab.spots.at(pp->locallab.selspot).pastsattog || !pastSatTog->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).sensiv = pe->locallab.spots.at(pp->locallab.selspot).sensiv || sensiv->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).skintonescurve = pe->locallab.spots.at(pp->locallab.selspot).skintonescurve || !skinTonesCurve->isUnChanged(); + pe->locallab.spots.at(pp->locallab.selspot).CCmaskvibcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskvibcurve || !CCmaskvibshape->isUnChanged(); + pe->locallab.spots.at(pp->locallab.selspot).LLmaskvibcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskvibcurve || !LLmaskvibshape->isUnChanged(); + pe->locallab.spots.at(pp->locallab.selspot).HHmaskvibcurve = pe->locallab.spots.at(pp->locallab.selspot).HHmaskvibcurve || !HHmaskvibshape->isUnChanged(); + pe->locallab.spots.at(pp->locallab.selspot).enavibMask = pe->locallab.spots.at(pp->locallab.selspot).enavibMask || !enavibMask->get_inconsistent(); // Soft Light pe->locallab.spots.at(pp->locallab.selspot).expsoft = pe->locallab.spots.at(pp->locallab.selspot).expsoft || !expsoft->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).streng = pe->locallab.spots.at(pp->locallab.selspot).streng || streng->getEditedState(); @@ -4590,6 +4689,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).pastsattog = pedited->locallab.spots.at(pp->locallab.selspot).pastsattog || !pastSatTog->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).sensiv = pedited->locallab.spots.at(pp->locallab.selspot).sensiv || sensiv->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).skintonescurve = pedited->locallab.spots.at(pp->locallab.selspot).skintonescurve || !skinTonesCurve->isUnChanged(); + pedited->locallab.spots.at(pp->locallab.selspot).CCmaskvibcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskvibcurve || !CCmaskvibshape->isUnChanged(); + pedited->locallab.spots.at(pp->locallab.selspot).LLmaskvibcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskvibcurve || !LLmaskvibshape->isUnChanged(); + pedited->locallab.spots.at(pp->locallab.selspot).HHmaskvibcurve = pedited->locallab.spots.at(pp->locallab.selspot).HHmaskvibcurve || !HHmaskvibshape->isUnChanged(); + pedited->locallab.spots.at(pp->locallab.selspot).enavibMask = pedited->locallab.spots.at(pp->locallab.selspot).enavibMask || !enavibMask->get_inconsistent(); // Soft Light pedited->locallab.spots.at(pp->locallab.selspot).expsoft = pedited->locallab.spots.at(pp->locallab.selspot).expsoft || !expsoft->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).streng = pedited->locallab.spots.at(pp->locallab.selspot).streng || streng->getEditedState(); @@ -4993,6 +5096,7 @@ void Locallab::curveChanged(CurveEditor* ce) } + //CBDL if (getEnabled() && expcbdl->getEnabled()) { @@ -5029,6 +5133,25 @@ void Locallab::curveChanged(CurveEditor* ce) listener->panelChanged(EvlocallabSkinTonesCurve, M("HISTORY_CUSTOMCURVE")); } } + + if (ce == CCmaskvibshape) { + if (listener) { + listener->panelChanged(EvlocallabCCmaskvibshape, M("HISTORY_CUSTOMCURVE")); + } + } + + if (ce == LLmaskvibshape) { + if (listener) { + listener->panelChanged(EvlocallabLLmaskvibshape, M("HISTORY_CUSTOMCURVE")); + } + } + + if (ce == HHmaskvibshape) { + if (listener) { + listener->panelChanged(EvlocallabHHmaskvibshape, M("HISTORY_CUSTOMCURVE")); + } + } + } //Blur @@ -5369,7 +5492,7 @@ void Locallab::showmaskcolMethodChanged() showmaskexpMethodinv->set_active(0); showmaskSHMethod->set_active(0); showmaskSHMethodinv->set_active(0); - showmaskcbMethod->set_active(0); + showmaskvibMethod->set_active(0); showmaskretiMethod->set_active(0); showmasksoftMethod->set_active(0); showmasktmMethod->set_active(0); @@ -5392,6 +5515,7 @@ void Locallab::showmaskcolMethodChangedinv() showmaskexpMethodinv->set_active(0); showmaskSHMethod->set_active(0); showmaskSHMethodinv->set_active(0); + showmaskvibMethod->set_active(0); showmaskcbMethod->set_active(0); showmaskretiMethod->set_active(0); showmasksoftMethod->set_active(0); @@ -5416,6 +5540,7 @@ void Locallab::showmaskexpMethodChangedinv() showmaskSHMethod->set_active(0); showmaskSHMethodinv->set_active(0); showmaskcbMethod->set_active(0); + showmaskvibMethod->set_active(0); showmaskretiMethod->set_active(0); showmasksoftMethod->set_active(0); showmasktmMethod->set_active(0); @@ -5439,6 +5564,7 @@ void Locallab::showmaskexpMethodChanged() showmaskcbMethod->set_active(0); showmaskSHMethod->set_active(0); showmaskSHMethodinv->set_active(0); + showmaskvibMethod->set_active(0); showmaskretiMethod->set_active(0); showmasksoftMethod->set_active(0); showmasktmMethod->set_active(0); @@ -5556,6 +5682,7 @@ void Locallab::showmaskSHMethodChanged() showmaskcolMethod->set_active(0); showmaskexpMethod->set_active(0); showmaskSHMethodinv->set_active(0); + showmaskvibMethod->set_active(0); showmaskcbMethod->set_active(0); showmaskretiMethod->set_active(0); showmasksoftMethod->set_active(0); @@ -5568,6 +5695,29 @@ void Locallab::showmaskSHMethodChanged() } } +void Locallab::showmaskvibMethodChanged() +{ + // printf("showmaskSHMethodChanged\n"); + + // When one mask state is changed, other masks are deactivated + disableListener(); + showmaskexpMethodinv->set_active(0); + showmaskcolMethodinv->set_active(0); + showmaskcolMethod->set_active(0); + showmaskexpMethod->set_active(0); + showmaskSHMethodinv->set_active(0); + showmaskcbMethod->set_active(0); + showmaskretiMethod->set_active(0); + showmasksoftMethod->set_active(0); + showmasktmMethod->set_active(0); + showmaskblMethod->set_active(0); + enableListener(); + + if (listener) { + listener->panelChanged(EvlocallabshowmaskvibMethod, ""); + } +} + void Locallab::showmaskSHMethodChangedinv() { // printf("showmaskSHMethodChanged\n"); @@ -5579,6 +5729,7 @@ void Locallab::showmaskSHMethodChangedinv() showmaskcolMethod->set_active(0); showmaskexpMethod->set_active(0); showmaskcbMethod->set_active(0); + showmaskvibMethod->set_active(0); showmaskretiMethod->set_active(0); showmasksoftMethod->set_active(0); showmasktmMethod->set_active(0); @@ -5602,6 +5753,7 @@ void Locallab::showmaskcbMethodChanged() showmaskSHMethod->set_active(0); showmaskSHMethodinv->set_active(0); showmaskexpMethod->set_active(0); + showmaskvibMethod->set_active(0); showmaskretiMethod->set_active(0); showmasksoftMethod->set_active(0); showmasktmMethod->set_active(0); @@ -5625,6 +5777,7 @@ void Locallab::showmaskblMethodChanged() showmaskSHMethod->set_active(0); showmaskSHMethodinv->set_active(0); showmaskexpMethod->set_active(0); + showmaskvibMethod->set_active(0); showmaskcbMethod->set_active(0); showmaskretiMethod->set_active(0); showmasksoftMethod->set_active(0); @@ -5649,6 +5802,7 @@ void Locallab::showmasktmMethodChanged() showmaskcolMethod->set_active(0); showmaskSHMethod->set_active(0); showmaskSHMethodinv->set_active(0); + showmaskvibMethod->set_active(0); showmaskexpMethod->set_active(0); showmaskcbMethod->set_active(0); showmaskretiMethod->set_active(0); @@ -5672,6 +5826,7 @@ void Locallab::showmaskretiMethodChanged() showmaskcolMethod->set_active(0); showmaskSHMethod->set_active(0); showmaskSHMethodinv->set_active(0); + showmaskvibMethod->set_active(0); showmaskexpMethod->set_active(0); showmaskcbMethod->set_active(0); showmasksoftMethod->set_active(0); @@ -5694,6 +5849,7 @@ void Locallab::showmasksoftMethodChanged() showmaskcolMethod->set_active(0); showmaskexpMethod->set_active(0); showmaskSHMethod->set_active(0); + showmaskvibMethod->set_active(0); showmaskSHMethodinv->set_active(0); showmaskcbMethod->set_active(0); showmaskretiMethod->set_active(0); @@ -5715,6 +5871,7 @@ void Locallab::resetMaskVisibility() showmaskcolMethod->set_active(0); showmaskexpMethod->set_active(0); showmaskSHMethod->set_active(0); + showmaskvibMethod->set_active(0); showmaskSHMethodinv->set_active(0); showmaskcbMethod->set_active(0); showmaskretiMethod->set_active(0); @@ -5731,6 +5888,7 @@ Locallab::llMaskVisibility* Locallab::getMaskVisibility() maskStruct->expMask = showmaskexpMethod->get_active_row_number(); maskStruct->expMaskinv = showmaskexpMethodinv->get_active_row_number(); maskStruct->SHMask = showmaskSHMethod->get_active_row_number(); + maskStruct->vibMask = showmaskvibMethod->get_active_row_number(); maskStruct->SHMaskinv = showmaskSHMethodinv->get_active_row_number(); maskStruct->cbMask = showmaskcbMethod->get_active_row_number(); maskStruct->retiMask = showmaskretiMethod->get_active_row_number(); @@ -5882,6 +6040,30 @@ void Locallab::enaSHMaskChanged() } } +void Locallab::enavibMaskChanged() +{ + // printf("enavibMaskChanged\n"); + + if (multiImage) { + if (enavibMask->get_inconsistent()) { + enavibMask->set_inconsistent(false); + enavibMaskConn.block(true); + enavibMask->set_active(false); + enavibMaskConn.block(false); + } + } + + if (getEnabled() && expvibrance->getEnabled()) { + if (listener) { + if (enavibMask->get_active()) { + listener->panelChanged(EvLocallabEnavibMask, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(EvLocallabEnavibMask, M("GENERAL_DISABLED")); + } + } + } +} + void Locallab::enablMaskChanged() { // printf("enablmaskChanged\n"); @@ -8658,6 +8840,7 @@ void Locallab::setBatchMode(bool batchMode) showmaskexpMethodinv->hide(); showmaskSHMethod->hide(); showmaskSHMethodinv->hide(); + showmaskvibMethod->hide(); showmaskcbMethod->hide(); showmaskretiMethod->hide(); showmasktmMethod->hide(); @@ -8832,7 +9015,9 @@ void Locallab::enableListener() pskinsconn.block(false); ashiftconn.block(false); pastsattogconn.block(false); - // Soft Light + showmaskvibMethodConn.block(false); + enavibMaskConn.block(false); + // Soft Light enablesoftConn.block(false); softMethodConn.block(false); showmasksoftMethodConn.block(false); @@ -8918,6 +9103,8 @@ void Locallab::disableListener() pskinsconn.block(true); ashiftconn.block(true); pastsattogconn.block(true); + showmaskvibMethodConn.block(true); + enavibMaskConn.block(true); // Soft Light enablesoftConn.block(true); softMethodConn.block(true); @@ -9209,6 +9396,10 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con pastSatTog->set_active(pp->locallab.spots.at(index).pastsattog); sensiv->setValue(pp->locallab.spots.at(index).sensiv); skinTonesCurve->setCurve(pp->locallab.spots.at(index).skintonescurve); + CCmaskvibshape->setCurve(pp->locallab.spots.at(index).CCmaskvibcurve); + LLmaskvibshape->setCurve(pp->locallab.spots.at(index).LLmaskvibcurve); + HHmaskvibshape->setCurve(pp->locallab.spots.at(index).HHmaskvibcurve); + enavibMask->set_active(pp->locallab.spots.at(index).enavibMask); // Soft Light expsoft->setEnabled(pp->locallab.spots.at(index).expsoft); @@ -9625,6 +9816,10 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con pastSatTog->set_inconsistent(multiImage && !spotState->pastsattog); sensiv->setEditedState(spotState->sensiv ? Edited : UnEdited); skinTonesCurve->setUnChanged(!spotState->skintonescurve); + CCmaskvibshape->setUnChanged(!spotState->CCmaskvibcurve); + LLmaskvibshape->setUnChanged(!spotState->LLmaskvibcurve); + HHmaskvibshape->setUnChanged(!spotState->HHmaskvibcurve); + enavibMask->set_inconsistent(multiImage && !spotState->enavibMask); // Soft Light expsoft->set_inconsistent(!spotState->expsoft); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 1faef2592..13f6cbd56 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -70,6 +70,7 @@ private: MyExpander* const expmaskreti; MyExpander* const expmasktm; MyExpander* const expmaskbl; + MyExpander* const expmaskvib; sigc::connection enablecolorConn, enableexposeConn, enableshadhighConn, enablevibranceConn, enablesoftConn, enableblurConn, enabletonemapConn, enableretiConn, enablesharpConn, enablecontrastConn, enablecbdlConn, enabledenoiConn; // Curve widgets @@ -111,7 +112,14 @@ private: FlatCurveEditor* const HHmaskSHshape; // Vibrance CurveEditorGroup* const curveEditorGG; + CurveEditorGroup* const maskvibCurveEditorG; DiagonalCurveEditor* const skinTonesCurve; +// CurveEditorGroup* const mask2vibCurveEditorG; +// DiagonalCurveEditor* const Lmaskvibshape; + FlatCurveEditor* const CCmaskvibshape; + FlatCurveEditor* const LLmaskvibshape; + FlatCurveEditor* const HHmaskvibshape; + //Blur and noise CurveEditorGroup* const maskblCurveEditorG; CurveEditorGroup* const mask2blCurveEditorG; @@ -358,6 +366,8 @@ private: Gtk::CheckButton* const protectSkins; Gtk::CheckButton* const avoidColorShift; Gtk::CheckButton* const pastSatTog; + Gtk::CheckButton* const enavibMask; + sigc::connection enavibMaskConn; sigc::connection pskinsconn, ashiftconn, pastsattogconn; // Blur & Noise Gtk::CheckButton* const activlum; @@ -435,6 +445,10 @@ private: sigc::connection showmaskSHMethodConn; MyComboBoxText* const showmaskSHMethodinv; sigc::connection showmaskSHMethodConninv; + //vibrance + //Shadows Highlight + MyComboBoxText* const showmaskvibMethod; + sigc::connection showmaskvibMethodConn; // Blur & Noise MyComboBoxText* const blurMethod; sigc::connection blurMethodConn; @@ -547,6 +561,7 @@ private: void protectskins_toggled(); void avoidcolorshift_toggled(); void pastsattog_toggled(); + void enavibMaskChanged(); // Blur & Noise void activlumChanged(); void enablMaskChanged(); @@ -588,6 +603,8 @@ private: void shMethodChanged(); void showmaskSHMethodChanged(); void showmaskSHMethodChangedinv(); + //vibrance + void showmaskvibMethodChanged(); // Blur & Noise void blMethodChanged(); void medMethodChanged(); @@ -644,6 +661,7 @@ public: int colorMaskinv; int expMask; int expMaskinv; + int vibMask; int SHMask; int SHMaskinv; int cbMask; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index c594461e7..b0e5bc3c2 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1105,6 +1105,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).pastsattog = locallab.spots.at(j).pastsattog && pSpot.pastsattog == otherSpot.pastsattog; locallab.spots.at(j).sensiv = locallab.spots.at(j).sensiv && pSpot.sensiv == otherSpot.sensiv; locallab.spots.at(j).skintonescurve = locallab.spots.at(j).skintonescurve && pSpot.skintonescurve == otherSpot.skintonescurve; + locallab.spots.at(j).CCmaskvibcurve = locallab.spots.at(j).CCmaskvibcurve && pSpot.CCmaskvibcurve == otherSpot.CCmaskvibcurve; + locallab.spots.at(j).LLmaskvibcurve = locallab.spots.at(j).LLmaskvibcurve && pSpot.LLmaskvibcurve == otherSpot.LLmaskvibcurve; + locallab.spots.at(j).HHmaskvibcurve = locallab.spots.at(j).HHmaskvibcurve && pSpot.HHmaskvibcurve == otherSpot.HHmaskvibcurve; + locallab.spots.at(j).enavibMask = locallab.spots.at(j).enavibMask && pSpot.enavibMask == otherSpot.enavibMask; // Soft Light locallab.spots.at(j).expsoft = locallab.spots.at(j).expsoft && pSpot.expsoft == otherSpot.expsoft; locallab.spots.at(j).streng = locallab.spots.at(j).streng && pSpot.streng == otherSpot.streng; @@ -3332,6 +3336,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).skintonescurve = mods.locallab.spots.at(i).skintonescurve; } + if (locallab.spots.at(i).CCmaskvibcurve) { + toEdit.locallab.spots.at(i).CCmaskvibcurve = mods.locallab.spots.at(i).CCmaskvibcurve; + } + + if (locallab.spots.at(i).LLmaskvibcurve) { + toEdit.locallab.spots.at(i).LLmaskvibcurve = mods.locallab.spots.at(i).LLmaskvibcurve; + } + + if (locallab.spots.at(i).HHmaskvibcurve) { + toEdit.locallab.spots.at(i).HHmaskvibcurve = mods.locallab.spots.at(i).HHmaskvibcurve; + } + + if (locallab.spots.at(i).enavibMask) { + toEdit.locallab.spots.at(i).enavibMask = mods.locallab.spots.at(i).enavibMask; + } + // Soft Light if (locallab.spots.at(i).expsoft) { toEdit.locallab.spots.at(i).expsoft = mods.locallab.spots.at(i).expsoft; @@ -5075,6 +5095,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : pastsattog(v), sensiv(v), skintonescurve(v), + CCmaskvibcurve(v), + LLmaskvibcurve(v), + HHmaskvibcurve(v), + enavibMask(v), // Soft Light expsoft(v), streng(v), @@ -5396,6 +5420,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) pastsattog = v; sensiv = v; skintonescurve = v; + CCmaskvibcurve = v; + LLmaskvibcurve = v; + HHmaskvibcurve = v; + enavibMask = v; // Soft Light expsoft = v; streng = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index e38342710..96f121101 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -533,6 +533,10 @@ public: bool pastsattog; bool sensiv; bool skintonescurve; + bool CCmaskvibcurve; + bool LLmaskvibcurve; + bool HHmaskvibcurve; + bool enavibMask; // Soft Light bool expsoft; bool streng; diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 5b5f756a3..e5e323f8c 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -484,10 +484,10 @@ void ToolPanelCoordinator::panelChanged(const rtengine::ProcEvent& event, const // Manage Locallab mask visibility if (event == rtengine::EvlocallabshowmaskcolMethod || event == rtengine::EvlocallabshowmaskcolMethodinv ||event == rtengine::EvlocallabshowmaskexpMethod ||event == rtengine::EvlocallabshowmaskexpMethodinv - || event == rtengine::EvlocallabshowmaskSHMethod || event == rtengine::EvlocallabshowmaskSHMethodinv || event == rtengine::EvlocallabshowmasksoftMethod + || event == rtengine::EvlocallabshowmaskSHMethod || event == rtengine::EvlocallabshowmaskSHMethodinv || event == rtengine::EvlocallabshowmaskvibMethod || event == rtengine::EvlocallabshowmasksoftMethod || event == rtengine::EvlocallabshowmaskcbMethod || event == rtengine::EvlocallabshowmaskretiMethod || event == rtengine::EvlocallabshowmasktmMethod || event == rtengine::EvlocallabshowmaskblMethod) { Locallab::llMaskVisibility* maskStruc = locallab->getMaskVisibility(); - ipc->setLocallabMaskVisibility(maskStruc->colorMask, maskStruc->colorMaskinv, maskStruc->expMask, maskStruc->expMaskinv, maskStruc->SHMask, maskStruc->SHMaskinv, maskStruc->cbMask, maskStruc->retiMask, maskStruc->softMask, maskStruc->tmMask, maskStruc->blMask); + ipc->setLocallabMaskVisibility(maskStruc->colorMask, maskStruc->colorMaskinv, maskStruc->expMask, maskStruc->expMaskinv, maskStruc->SHMask, maskStruc->SHMaskinv, maskStruc->vibMask, maskStruc->cbMask, maskStruc->retiMask, maskStruc->softMask, maskStruc->tmMask, maskStruc->blMask); } ipc->endUpdateParams(changeFlags); // starts the IPC processing @@ -595,7 +595,7 @@ void ToolPanelCoordinator::profileChange( // Reset Locallab mask visibility when a picture is loaded if (event == rtengine::EvPhotoLoaded) { locallab->resetMaskVisibility(); - ipc->setLocallabMaskVisibility(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ipc->setLocallabMaskVisibility(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // start the IPC processing