diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 8be506374..aa3dc3598 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2357,6 +2357,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : thresh(2.0), iter(2.0), balan(1.0), + avoid(false), // Color & Light expcolor(false), curvactiv(false), @@ -2367,7 +2368,6 @@ LocallabParams::LocallabSpot::LocallabSpot() : labgridBLow(0.0), labgridAHigh(0.0), labgridBHigh(0.0), - strengthgrid(30), sensi(15), structcol(0), @@ -2508,9 +2508,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : noisechrodetail(0), adjblur(0), bilateral(0), - sensiden(20), - // Others - avoid(false) + sensiden(20) { } @@ -2539,6 +2537,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && thresh == other.thresh && iter == other.iter && balan == other.balan + && avoid == other.avoid // Color & Light && expcolor == other.expcolor && curvactiv == other.curvactiv @@ -2623,7 +2622,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && pastsattog == other.pastsattog && sensiv == other.sensiv && skintonescurve == other.skintonescurve - //Soft Light + // Soft Light && expsoft == other.expsoft && streng == other.streng && sensisf == other.sensisf @@ -2664,14 +2663,13 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && sharblur == other.sharblur && sensisha == other.sensisha && inverssha == other.inverssha - //local contrast + // Local contrast && expcontrast == other.expcontrast && lcradius == other.lcradius && lcamount == other.lcamount && lcdarkness == other.lcdarkness && lclightness == other.lclightness && sensilc == other.sensilc - // Constrast by detail levels && expcbdl == other.expcbdl && [this, &other]()->bool { @@ -2699,9 +2697,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && noisechrodetail == other.noisechrodetail && adjblur == other.adjblur && bilateral == other.bilateral - && sensiden == other.sensiden - // Others - && avoid == other.avoid; + && sensiden == other.sensiden; } bool LocallabParams::LocallabSpot::operator !=(const LocallabSpot& other) const @@ -3677,6 +3673,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).thresh, "Locallab", "Thresh_" + std::to_string(i), spot.thresh, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).iter, "Locallab", "Iter_" + std::to_string(i), spot.iter, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).balan, "Locallab", "Balan_" + std::to_string(i), spot.balan, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).avoid, "Locallab", "Avoid_" + std::to_string(i), spot.avoid, keyFile); // Color & Light saveToKeyfile(!pedited || pedited->locallab.spots.at(i).expcolor, "Locallab", "Expcolor_" + std::to_string(i), spot.expcolor, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).curvactiv, "Locallab", "Curvactiv_" + std::to_string(i), spot.curvactiv, keyFile); @@ -3832,8 +3829,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).adjblur, "Locallab", "Adjblur_" + std::to_string(i), spot.adjblur, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).bilateral, "Locallab", "Bilateral_" + std::to_string(i), spot.bilateral, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensiden, "Locallab", "Sensiden_" + std::to_string(i), spot.sensiden, keyFile); - // Others - saveToKeyfile(!pedited || pedited->locallab.spots.at(i).avoid, "Locallab", "Avoid_" + std::to_string(i), spot.avoid, keyFile); } } @@ -4943,6 +4938,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Thresh_" + std::to_string(i), pedited, spot.thresh, spotEdited.thresh); assignFromKeyfile(keyFile, "Locallab", "Iter_" + std::to_string(i), pedited, spot.iter, spotEdited.iter); assignFromKeyfile(keyFile, "Locallab", "Balan_" + std::to_string(i), pedited, spot.balan, spotEdited.balan); + assignFromKeyfile(keyFile, "Locallab", "Avoid_" + std::to_string(i), pedited, spot.avoid, spotEdited.avoid); // Color & Light assignFromKeyfile(keyFile, "Locallab", "Expcolor_" + std::to_string(i), pedited, spot.expcolor, spotEdited.expcolor); assignFromKeyfile(keyFile, "Locallab", "Curvactiv_" + std::to_string(i), pedited, spot.curvactiv, spotEdited.curvactiv); @@ -5110,8 +5106,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Adjblur_" + std::to_string(i), pedited, spot.adjblur, spotEdited.adjblur); assignFromKeyfile(keyFile, "Locallab", "Bilateral_" + std::to_string(i), pedited, spot.bilateral, spotEdited.bilateral); assignFromKeyfile(keyFile, "Locallab", "Sensiden_" + std::to_string(i), pedited, spot.sensiden, spotEdited.sensiden); - // Others - assignFromKeyfile(keyFile, "Locallab", "Avoid_" + std::to_string(i), pedited, spot.avoid, spotEdited.avoid); locallab.spots.at(i) = spot; diff --git a/rtengine/procparams.h b/rtengine/procparams.h index dba783868..0af821e71 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -957,6 +957,7 @@ struct LocallabParams { double thresh; double iter; double balan; + bool avoid; // Color & Light bool expcolor; bool curvactiv; @@ -968,7 +969,6 @@ struct LocallabParams { double labgridAHigh; double labgridBHigh; int strengthgrid; - int sensi; int structcol; int blurcolde; @@ -1110,8 +1110,6 @@ struct LocallabParams { int adjblur; int bilateral; int sensiden; - // Others - bool avoid; LocallabSpot(); diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index fefba4992..db51d74de 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -61,6 +61,8 @@ ControlSpotPanel::ControlSpotPanel(): iter_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_PROXI"), 0.2, 4.0, 0.1, 2.0))), balan_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BALAN"), 0.3, 1.7, 0.1, 1.0, Gtk::manage(new RTImage("rawtherapee-logo-16.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), + avoid_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOID")))), + lastObject_(-1), lastCoord_(new Coord()), nbSpotChanged_(false), @@ -243,6 +245,10 @@ ControlSpotPanel::ControlSpotPanel(): artifFrame->add(*artifBox); pack_start(*artifFrame); + avoidConn_ = avoid_->signal_toggled().connect( + sigc::mem_fun(*this, &ControlSpotPanel::avoidChanged)); + pack_start(*avoid_); + show_all(); } @@ -437,6 +443,7 @@ void ControlSpotPanel::load_ControlSpot_param() thresh_->setValue(static_cast(row[spots_.thresh])); iter_->setValue(static_cast(row[spots_.iter])); balan_->setValue(static_cast(row[spots_.balan])); + avoid_->set_active(row[spots_.avoid]); } void ControlSpotPanel::controlspotChanged() @@ -687,7 +694,6 @@ void ControlSpotPanel::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, in { } - void ControlSpotPanel::adjusterChanged(Adjuster* a, double newval) { // printf("adjusterChanged\n"); @@ -852,6 +858,41 @@ void ControlSpotPanel::adjusterChanged(Adjuster* a, double newval) } +void ControlSpotPanel::avoidChanged() +{ + // printf("avoidChanged\n"); + + // Get selected control spot + const auto s = treeview_.get_selection(); + + if (!s->count_selected_rows()) { + return; + } + + const auto iter = s->get_selected(); + Gtk::TreeModel::Row row = *iter; + + if (multiImage) { + if (avoid_->get_inconsistent()) { + avoid_->set_inconsistent(false); + avoidConn_.block(true); + avoid_->set_active(false); + avoidConn_.block(false); + } + } + + row[spots_.avoid] = avoid_->get_active(); + + // Raise event + if (listener) { + if (avoid_->get_active()) { + listener->panelChanged(Evlocallabavoid, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(Evlocallabavoid, M("GENERAL_DISABLED")); + } + } +} + void ControlSpotPanel::disableParamlistener(bool cond) { // printf("disableParamlistener: %d\n", cond); @@ -880,6 +921,7 @@ void ControlSpotPanel::disableParamlistener(bool cond) thresh_->block(cond); iter_->block(cond); balan_->block(cond); + avoidConn_.block(cond); } void ControlSpotPanel::setParamEditable(bool cond) @@ -904,6 +946,7 @@ void ControlSpotPanel::setParamEditable(bool cond) thresh_->set_sensitive(cond); iter_->set_sensitive(cond); balan_->set_sensitive(cond); + avoid_->set_sensitive(cond); } void ControlSpotPanel::addControlSpotCurve(Gtk::TreeModel::Row row) @@ -1581,6 +1624,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(int id) r->thresh = row[spots_.thresh]; r->iter = row[spots_.iter]; r->balan = row[spots_.balan]; + r->avoid = row[spots_.avoid]; return r; } @@ -1701,6 +1745,7 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot) row[spots_.thresh] = newSpot->thresh; row[spots_.iter] = newSpot->iter; row[spots_.balan] = newSpot->balan; + row[spots_.avoid] = newSpot->avoid; updateParamVisibility(); disableParamlistener(false); @@ -1744,6 +1789,7 @@ int ControlSpotPanel::updateControlSpot(SpotRow* spot) row[spots_.thresh] = spot->thresh; row[spots_.iter] = spot->iter; row[spots_.balan] = spot->balan; + row[spots_.avoid] = spot->avoid; updateControlSpotCurve(row); updateParamVisibility(); @@ -1833,6 +1879,7 @@ ControlSpotPanel::SpotEdited* ControlSpotPanel::getEditedStates() se->thresh = thresh_->getEditedState(); se->iter = iter_->getEditedState(); se->balan = balan_->getEditedState(); + se->avoid = !avoid_->get_inconsistent(); return se; } @@ -1899,6 +1946,7 @@ void ControlSpotPanel::setEditedStates(SpotEdited* se) thresh_->setEditedState(se->thresh ? Edited : UnEdited); iter_->setEditedState(se->iter ? Edited : UnEdited); balan_->setEditedState(se->balan ? Edited : UnEdited); + avoid_->set_inconsistent(multiImage && !se->avoid); // Update Control Spot GUI according to widgets edited states updateParamVisibility(); @@ -2037,6 +2085,7 @@ ControlSpotPanel::ControlSpots::ControlSpots() add(thresh); add(iter); add(balan); + add(avoid); } //----------------------------------------------------------------------------- diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h index 57453a531..51de13d1b 100644 --- a/rtgui/controlspotpanel.h +++ b/rtgui/controlspotpanel.h @@ -63,6 +63,7 @@ public: double thresh; double iter; double balan; + bool avoid; }; /** @@ -91,6 +92,7 @@ public: bool thresh; bool iter; bool balan; + bool avoid; }; // Constructor and management functions @@ -237,6 +239,7 @@ private: void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop); void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); + void avoidChanged(); void disableParamlistener(bool cond); @@ -279,6 +282,7 @@ private: Gtk::TreeModelColumn thresh; Gtk::TreeModelColumn iter; Gtk::TreeModelColumn balan; + Gtk::TreeModelColumn avoid; }; class RenameDialog: @@ -336,6 +340,9 @@ private: Adjuster* const iter_; Adjuster* const balan_; + Gtk::CheckButton* const avoid_; + sigc::connection avoidConn_; + // Internal variables int lastObject_; rtengine::Coord* lastCoord_; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 030984ae4..e1e68f902 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -197,8 +197,6 @@ Locallab::Locallab(): inversret(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), // Sharpening inverssha(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), - // Others - avoid(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOID")))), // ComboBox widgets // Color & Light @@ -983,8 +981,6 @@ Locallab::Locallab(): sensiden->setAdjusterListener(this); - avoidConn = avoid->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::avoidChanged)); - ToolParamBlock* const denoisBox = Gtk::manage(new ToolParamBlock()); Gtk::Frame* const wavFrame = Gtk::manage(new Gtk::Frame()); ToolParamBlock* const wavBox = Gtk::manage(new ToolParamBlock()); @@ -1005,8 +1001,6 @@ Locallab::Locallab(): panel->pack_start(*expdenoi, false, false); - panel->pack_start(*avoid); - pack_start(*panel); setParamEditable(false); @@ -1305,6 +1299,7 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) r->thresh = pp->locallab.spots.at(i).thresh; r->iter = pp->locallab.spots.at(i).iter; r->balan = pp->locallab.spots.at(i).balan; + r->avoid = pp->locallab.spots.at(i).avoid; expsettings->addControlSpot(r); } @@ -1405,6 +1400,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) r->thresh = newSpot->thresh; r->iter = newSpot->iter; r->balan = newSpot->balan; + r->avoid = newSpot->avoid; expsettings->addControlSpot(r); // ProcParams update @@ -1460,7 +1456,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) expsettings->setSelectedSpot(pp->locallab.spots.at(pp->locallab.selspot).id); } - // Update Locallab tools GUI with new created spot + // Update Locallab tools GUI with selected spot disableListener(); if (pe) { @@ -1591,6 +1587,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) r->thresh = newSpot->thresh; r->iter = newSpot->iter; r->balan = newSpot->balan; + r->avoid = newSpot->avoid; expsettings->addControlSpot(r); // ProcParams update @@ -1679,6 +1676,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).thresh = r->thresh; pp->locallab.spots.at(pp->locallab.selspot).iter = r->iter; pp->locallab.spots.at(pp->locallab.selspot).balan = r->balan; + pp->locallab.spots.at(pp->locallab.selspot).avoid = r->avoid; // Color & Light pp->locallab.spots.at(pp->locallab.selspot).expcolor = expcolor->getEnabled(); pp->locallab.spots.at(pp->locallab.selspot).curvactiv = curvactiv->get_active(); @@ -1765,7 +1763,6 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).chromaskSH = chromaskSH->getValue(); pp->locallab.spots.at(pp->locallab.selspot).gammaskSH = gammaskSH->getValue(); pp->locallab.spots.at(pp->locallab.selspot).slomaskSH = slomaskSH->getValue(); - // Vibrance pp->locallab.spots.at(pp->locallab.selspot).expvibrance = expvibrance->getEnabled(); pp->locallab.spots.at(pp->locallab.selspot).saturated = saturated->getIntValue(); @@ -1863,8 +1860,6 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).adjblur = adjblur->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).bilateral = bilateral->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).sensiden = sensiden->getIntValue(); - // Others - pp->locallab.spots.at(pp->locallab.selspot).avoid = avoid->get_active(); } ControlSpotPanel::SpotEdited* const se = expsettings->getEditedStates(); @@ -1891,6 +1886,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).thresh = pe->locallab.spots.at(pp->locallab.selspot).thresh || se->thresh; pe->locallab.spots.at(pp->locallab.selspot).iter = pe->locallab.spots.at(pp->locallab.selspot).iter || se->iter; pe->locallab.spots.at(pp->locallab.selspot).balan = pe->locallab.spots.at(pp->locallab.selspot).balan || se->balan; + pe->locallab.spots.at(pp->locallab.selspot).avoid = pe->locallab.spots.at(pp->locallab.selspot).avoid || se->avoid; // Color & Light pe->locallab.spots.at(pp->locallab.selspot).expcolor = pe->locallab.spots.at(pp->locallab.selspot).expcolor || !expcolor->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).curvactiv = pe->locallab.spots.at(pp->locallab.selspot).curvactiv || !curvactiv->get_inconsistent(); @@ -1951,7 +1947,6 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).s_tonalwidth = pe->locallab.spots.at(pp->locallab.selspot).s_tonalwidth || s_tonalwidth->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sh_radius = pe->locallab.spots.at(pp->locallab.selspot).sh_radius || sh_radius->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensihs = pe->locallab.spots.at(pp->locallab.selspot).sensihs || sensihs->getEditedState(); - pe->locallab.spots.at(pp->locallab.selspot).enaSHMask = pe->locallab.spots.at(pp->locallab.selspot).enaSHMask || !enaSHMask->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).CCmaskSHcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskSHcurve || !CCmaskSHshape->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).LLmaskSHcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskSHcurve || !LLmaskSHshape->isUnChanged(); @@ -2044,8 +2039,6 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).adjblur = pe->locallab.spots.at(pp->locallab.selspot).adjblur || adjblur->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).bilateral = pe->locallab.spots.at(pp->locallab.selspot).bilateral || bilateral->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensiden = pe->locallab.spots.at(pp->locallab.selspot).sensiden || sensiden->getEditedState(); - // Others - pe->locallab.spots.at(pp->locallab.selspot).avoid = pe->locallab.spots.at(pp->locallab.selspot).avoid || !avoid->get_inconsistent(); } } @@ -2075,6 +2068,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).thresh = pedited->locallab.spots.at(pp->locallab.selspot).thresh || se->thresh; pedited->locallab.spots.at(pp->locallab.selspot).iter = pedited->locallab.spots.at(pp->locallab.selspot).iter || se->iter; pedited->locallab.spots.at(pp->locallab.selspot).balan = pedited->locallab.spots.at(pp->locallab.selspot).balan || se->balan; + pedited->locallab.spots.at(pp->locallab.selspot).avoid = pedited->locallab.spots.at(pp->locallab.selspot).avoid || se->avoid; // Color & Light pedited->locallab.spots.at(pp->locallab.selspot).expcolor = pedited->locallab.spots.at(pp->locallab.selspot).expcolor || !expcolor->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).curvactiv = pedited->locallab.spots.at(pp->locallab.selspot).curvactiv || !curvactiv->get_inconsistent(); @@ -2134,7 +2128,6 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).s_tonalwidth = pedited->locallab.spots.at(pp->locallab.selspot).s_tonalwidth || s_tonalwidth->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sh_radius = pedited->locallab.spots.at(pp->locallab.selspot).sh_radius || sh_radius->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensihs = pedited->locallab.spots.at(pp->locallab.selspot).sensihs || sensihs->getEditedState(); - pedited->locallab.spots.at(pp->locallab.selspot).enaSHMask = pedited->locallab.spots.at(pp->locallab.selspot).enaSHMask || !enaSHMask->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).CCmaskSHcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskSHcurve || !CCmaskSHshape->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).LLmaskSHcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskSHcurve || !LLmaskSHshape->isUnChanged(); @@ -2227,8 +2220,6 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).adjblur = pedited->locallab.spots.at(pp->locallab.selspot).adjblur || adjblur->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).bilateral = pedited->locallab.spots.at(pp->locallab.selspot).bilateral || bilateral->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensiden = pedited->locallab.spots.at(pp->locallab.selspot).sensiden || sensiden->getEditedState(); - // Others - pedited->locallab.spots.at(pp->locallab.selspot).avoid = pedited->locallab.spots.at(pp->locallab.selspot).avoid || !avoid->get_inconsistent(); } } } @@ -2961,8 +2952,6 @@ void Locallab::setParamEditable(bool cond) expcbdl->set_sensitive(cond); // Denoise expdenoi->set_sensitive(cond); - // Others - avoid->set_sensitive(cond); } void Locallab::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) @@ -3033,7 +3022,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe gammaskexp->setDefault(defSpot->gammaskexp); slomaskexp->setDefault(defSpot->slomaskexp); softradiusexp->setDefault(defSpot->softradiusexp); - //Shadow highlight + // Shadow highlight highlights->setDefault((double)defSpot->highlights); h_tonalwidth->setDefault((double)defSpot->h_tonalwidth); shadows->setDefault((double)defSpot->shadows); @@ -3087,7 +3076,6 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lcdarkness->setDefault(defSpot->lcdarkness); lclightness->setDefault(defSpot->lclightness); sensilc->setDefault((double)defSpot->sensilc); - // Contrast by detail levels for (int i = 0; i < 5; i++) { multiplier[i]->setDefault(defSpot->mult[i]); @@ -3143,7 +3131,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe gammaskexp->setDefaultEditedState(Irrelevant); slomaskexp->setDefaultEditedState(Irrelevant); softradiusexp->setDefaultEditedState(Irrelevant); - //Shadow highlight + // Shadow highlight highlights->setDefaultEditedState(Irrelevant); h_tonalwidth->setDefaultEditedState(Irrelevant); shadows->setDefaultEditedState(Irrelevant); @@ -3197,7 +3185,6 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lcdarkness->setDefaultEditedState(Irrelevant); lclightness->setDefaultEditedState(Irrelevant); sensilc->setDefaultEditedState(Irrelevant); - // Contrast by detail levels for (int i = 0; i < 5; i++) { multiplier[i]->setDefaultEditedState(Irrelevant); @@ -3257,7 +3244,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe gammaskexp->setDefaultEditedState(defSpotState->gammaskexp ? Edited : UnEdited); slomaskexp->setDefaultEditedState(defSpotState->slomaskexp ? Edited : UnEdited); softradiusexp->setDefaultEditedState(defSpotState->softradiusexp ? Edited : UnEdited); - //Shadow highlight + // Shadow highlight highlights->setDefaultEditedState(defSpotState->highlights ? Edited : UnEdited); h_tonalwidth->setDefaultEditedState(defSpotState->h_tonalwidth ? Edited : UnEdited); shadows->setDefaultEditedState(defSpotState->shadows ? Edited : UnEdited); @@ -3311,7 +3298,6 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lcdarkness->setDefaultEditedState(defSpotState->lcdarkness ? Edited : UnEdited); lclightness->setDefaultEditedState(defSpotState->lclightness ? Edited : UnEdited); sensilc->setDefaultEditedState(defSpotState->sensilc ? Edited : UnEdited); - // Contrast by detail levels for (int i = 0; i < 5; i++) { multiplier[i]->setDefaultEditedState(defSpotState->mult[i] ? Edited : UnEdited); @@ -3983,30 +3969,6 @@ void Locallab::enabledChanged() } } -void Locallab::avoidChanged() -{ - // printf("avoidChanged\n"); - - if (multiImage) { - if (avoid->get_inconsistent()) { - avoid->set_inconsistent(false); - avoidConn.block(true); - avoid->set_active(false); - avoidConn.block(false); - } - } - - if (getEnabled()) { - if (listener) { - if (avoid->get_active()) { - listener->panelChanged(Evlocallabavoid, M("GENERAL_ENABLED")); - } else { - listener->panelChanged(Evlocallabavoid, M("GENERAL_DISABLED")); - } - } - } -} - void Locallab::trimValues(rtengine::procparams::ProcParams * pp) { // TODO @@ -4106,7 +4068,6 @@ void Locallab::setBatchMode(bool batchMode) lcdarkness->showEditedCB(); lclightness->showEditedCB(); sensilc->showEditedCB(); - // Contrast by detail levels for (int i = 0; i < 5; i++) { multiplier[i]->showEditedCB(); @@ -4320,7 +4281,6 @@ void Locallab::enableListener() enablecbdlConn.block(false); // Denoise enabledenoiConn.block(false); - avoidConn.block(false); } void Locallab::disableListener() @@ -4372,7 +4332,6 @@ void Locallab::disableListener() enablecbdlConn.block(true); // Denoise enabledenoiConn.block(true); - avoidConn.block(true); } void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited, int index) @@ -4445,6 +4404,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con gammaskexp->setValue(pp->locallab.spots.at(index).gammaskexp); slomaskexp->setValue(pp->locallab.spots.at(index).slomaskexp); softradiusexp->setValue(pp->locallab.spots.at(index).softradiusexp); + // Shadow highlight expshadhigh->setEnabled(pp->locallab.spots.at(index).expshadhigh); highlights->setValue(pp->locallab.spots.at(index).highlights); @@ -4453,7 +4413,6 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con s_tonalwidth->setValue(pp->locallab.spots.at(index).s_tonalwidth); sh_radius->setValue(pp->locallab.spots.at(index).sh_radius); sensihs->setValue(pp->locallab.spots.at(index).sensihs); - enaSHMask->set_active(pp->locallab.spots.at(index).enaSHMask); CCmaskSHshape->setCurve(pp->locallab.spots.at(index).CCmaskSHcurve); LLmaskSHshape->setCurve(pp->locallab.spots.at(index).LLmaskSHcurve); @@ -4465,6 +4424,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con chromaskSH->setValue(pp->locallab.spots.at(index).chromaskSH); gammaskSH->setValue(pp->locallab.spots.at(index).gammaskSH); slomaskSH->setValue(pp->locallab.spots.at(index).slomaskSH); + // Vibrance expvibrance->setEnabled(pp->locallab.spots.at(index).expvibrance); saturated->setValue(pp->locallab.spots.at(index).saturated); @@ -4481,7 +4441,6 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con streng->setValue(pp->locallab.spots.at(index).streng); sensisf->setValue(pp->locallab.spots.at(index).sensisf); - // Blur & Noise expblur->setEnabled(pp->locallab.spots.at(index).expblur); radius->setValue(pp->locallab.spots.at(index).radius); @@ -4540,7 +4499,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con inverssha->set_active(pp->locallab.spots.at(index).inverssha); // Local Contrast - expcontrast->setEnabled(pp->locallab.spots.at(index).expcontrast); + expcontrast->setEnabled(pp->locallab.spots.at(index).expcontrast); lcradius->setValue(pp->locallab.spots.at(index).lcradius); lcamount->setValue(pp->locallab.spots.at(index).lcamount); lcdarkness->setValue(pp->locallab.spots.at(index).lcdarkness); @@ -4572,9 +4531,6 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con bilateral->setValue(pp->locallab.spots.at(index).bilateral); sensiden->setValue(pp->locallab.spots.at(index).sensiden); - // Others - avoid->set_active(pp->locallab.spots.at(index).avoid); - if (pedited) { if (index < (int)pedited->locallab.spots.size()) { const LocallabParamsEdited::LocallabSpotEdited* spotState = &pedited->locallab.spots.at(index); @@ -4609,6 +4565,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con se->thresh = spotState->thresh; se->iter = spotState->iter; se->balan = spotState->balan; + se->avoid = spotState->avoid; expsettings->setEditedStates(se); // Color & Light @@ -4708,7 +4665,6 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con streng->setEditedState(spotState->streng ? Edited : UnEdited); sensisf->setEditedState(spotState->sensisf ? Edited : UnEdited); - // Blur & Noise expblur->set_inconsistent(!spotState->expblur); radius->setEditedState(spotState->radius ? Edited : UnEdited); @@ -4790,9 +4746,6 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con adjblur->setEditedState(spotState->adjblur ? Edited : UnEdited); bilateral->setEditedState(spotState->bilateral ? Edited : UnEdited); sensiden->setEditedState(spotState->sensiden ? Edited : UnEdited); - - // Others - avoid->set_inconsistent(multiImage && !spotState->avoid); } } } @@ -4800,6 +4753,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con void Locallab::updateSpecificGUIState() { + // Update Color & Light GUI according to invers button state (to be compliant with inversChanged function) if (multiImage && invers->get_inconsistent()) { sensi->show(); llCurveEditorG->show(); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 75772cdb8..629e184cb 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -226,9 +226,6 @@ private: // Sharpening Gtk::CheckButton* const inverssha; sigc::connection inversshaConn; - // Others - Gtk::CheckButton* const avoid; - sigc::connection avoidConn; // ComboBox widgets // Color & Light @@ -308,8 +305,6 @@ private: void inversretChanged(); // Sharpening void inversshaChanged(); - // Others - void avoidChanged(); // ComboBox event functions // Color & Light diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 26b7190e9..00a35ed11 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -947,6 +947,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).thresh = locallab.spots.at(j).thresh && pSpot.thresh == otherSpot.thresh; locallab.spots.at(j).iter = locallab.spots.at(j).iter && pSpot.iter == otherSpot.iter; locallab.spots.at(j).balan = locallab.spots.at(j).balan && pSpot.balan == otherSpot.balan; + locallab.spots.at(j).avoid = locallab.spots.at(j).avoid && pSpot.avoid == otherSpot.avoid; // Color & Light locallab.spots.at(j).expcolor = locallab.spots.at(j).expcolor && pSpot.expcolor == otherSpot.expcolor; locallab.spots.at(j).curvactiv = locallab.spots.at(j).curvactiv && pSpot.curvactiv == otherSpot.curvactiv; @@ -1102,8 +1103,6 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).adjblur = locallab.spots.at(j).adjblur && pSpot.adjblur == otherSpot.adjblur; locallab.spots.at(j).bilateral = locallab.spots.at(j).bilateral && pSpot.bilateral == otherSpot.bilateral; locallab.spots.at(j).sensiden = locallab.spots.at(j).sensiden && pSpot.sensiden == otherSpot.sensiden; - // Others - locallab.spots.at(j).avoid = locallab.spots.at(j).avoid && pSpot.avoid == otherSpot.avoid; } } @@ -2609,6 +2608,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).balan = mods.locallab.spots.at(i).balan; } + if (locallab.spots.at(i).avoid) { + toEdit.locallab.spots.at(i).avoid = mods.locallab.spots.at(i).avoid; + } + // Color & Light if (locallab.spots.at(i).expcolor) { toEdit.locallab.spots.at(i).expcolor = mods.locallab.spots.at(i).expcolor; @@ -3174,11 +3177,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng if (locallab.spots.at(i).sensiden) { toEdit.locallab.spots.at(i).sensiden = mods.locallab.spots.at(i).sensiden; } - - // Others - if (locallab.spots.at(i).avoid) { - toEdit.locallab.spots.at(i).avoid = mods.locallab.spots.at(i).avoid; - } } @@ -4141,6 +4139,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : thresh(v), iter(v), balan(v), + avoid(v), // Color & Light expcolor(v), curvactiv(v), @@ -4291,9 +4290,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : noisechrodetail(v), adjblur(v), bilateral(v), - sensiden(v), - // Others - avoid(v) + sensiden(v) { } @@ -4319,6 +4316,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) thresh = v; iter = v; balan = v; + avoid = v; // Color & Light expcolor = v; curvactiv = v; @@ -4474,6 +4472,4 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) adjblur = v; bilateral = v; sensiden = v; - // Others - avoid = v; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 616b9ec39..21ba52f4d 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -374,6 +374,7 @@ public: bool thresh; bool iter; bool balan; + bool avoid; // Color & Light bool expcolor; bool curvactiv; @@ -525,8 +526,6 @@ public: bool adjblur; bool bilateral; bool sensiden; - // Others - bool avoid; LocallabSpotEdited(bool v);