added checkbox to let the user decide whether to clamp or not
This commit is contained in:
@@ -50,6 +50,7 @@ void ParamsEdited::set (bool v)
|
||||
toneCurve.hrenabled = v;
|
||||
toneCurve.method = v;
|
||||
toneCurve.histmatching = v;
|
||||
toneCurve.clampOOG = v;
|
||||
retinex.cdcurve = v;
|
||||
retinex.mapcurve = v;
|
||||
retinex.cdHcurve = v;
|
||||
@@ -610,6 +611,7 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
toneCurve.hrenabled = toneCurve.hrenabled && p.toneCurve.hrenabled == other.toneCurve.hrenabled;
|
||||
toneCurve.method = toneCurve.method && p.toneCurve.method == other.toneCurve.method;
|
||||
toneCurve.histmatching = toneCurve.histmatching && p.toneCurve.histmatching == other.toneCurve.histmatching;
|
||||
toneCurve.clampOOG = toneCurve.clampOOG && p.toneCurve.clampOOG == other.toneCurve.clampOOG;
|
||||
retinex.cdcurve = retinex.cdcurve && p.retinex.cdcurve == other.retinex.cdcurve;
|
||||
retinex.mapcurve = retinex.mapcurve && p.retinex.mapcurve == other.retinex.mapcurve;
|
||||
retinex.cdHcurve = retinex.cdHcurve && p.retinex.cdHcurve == other.retinex.cdHcurve;
|
||||
@@ -1210,6 +1212,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
toEdit.toneCurve.histmatching = mods.toneCurve.histmatching;
|
||||
}
|
||||
|
||||
if (toneCurve.clampOOG) {
|
||||
toEdit.toneCurve.clampOOG = mods.toneCurve.clampOOG;
|
||||
}
|
||||
|
||||
if (retinex.enabled) {
|
||||
toEdit.retinex.enabled = mods.retinex.enabled;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
bool hrenabled;
|
||||
bool method;
|
||||
bool histmatching;
|
||||
bool clampOOG;
|
||||
};
|
||||
|
||||
class RetinexParamsEdited
|
||||
|
||||
@@ -32,6 +32,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA
|
||||
auto m = ProcEventMapper::getInstance();
|
||||
EvHistMatching = m->newEvent(AUTOEXP, "HISTORY_MSG_HISTMATCHING");
|
||||
EvHistMatchingBatch = m->newEvent(M_VOID, "HISTORY_MSG_HISTMATCHING");
|
||||
EvClampOOG = m->newEvent(RGBCURVE, "HISTORY_MSG_CLAMPOOG");
|
||||
|
||||
CurveListener::setMulti(true);
|
||||
|
||||
@@ -39,6 +40,13 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA
|
||||
bottomMilestones.push_back( GradientMilestone(0., 0., 0., 0.) );
|
||||
bottomMilestones.push_back( GradientMilestone(1., 1., 1., 1.) );
|
||||
|
||||
//----------- OOG clamping ----------------------------------
|
||||
clampOOG = Gtk::manage(new Gtk::CheckButton(M("TP_EXPOSURE_CLAMPOOG")));
|
||||
clampOOG->set_tooltip_markup(M("TP_EXPOSURE_CLAMPOOG_TOOLTIP"));
|
||||
pack_start(*clampOOG);
|
||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||
clampOOG->signal_toggled().connect(sigc::mem_fun(*this, &ToneCurve::clampOOGChanged));
|
||||
|
||||
//----------- Auto Levels ----------------------------------
|
||||
abox = Gtk::manage (new Gtk::HBox ());
|
||||
abox->set_spacing (10);
|
||||
@@ -236,6 +244,7 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
toneCurveMode2->set_active(rtengine::toUnderlying(pp->toneCurve.curveMode2));
|
||||
|
||||
histmatching->set_active(pp->toneCurve.histmatching);
|
||||
clampOOG->set_active(pp->toneCurve.clampOOG);
|
||||
|
||||
if (pedited) {
|
||||
expcomp->setEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited);
|
||||
@@ -261,6 +270,7 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
}
|
||||
|
||||
histmatching->set_inconsistent(!pedited->toneCurve.histmatching);
|
||||
clampOOG->set_inconsistent(!pedited->toneCurve.clampOOG);
|
||||
}
|
||||
|
||||
enaconn.block (true);
|
||||
@@ -357,6 +367,7 @@ void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited)
|
||||
}
|
||||
|
||||
pp->toneCurve.histmatching = histmatching->get_active();
|
||||
pp->toneCurve.clampOOG = clampOOG->get_active();
|
||||
|
||||
if (pedited) {
|
||||
pedited->toneCurve.expcomp = expcomp->getEditedState ();
|
||||
@@ -376,6 +387,7 @@ void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited)
|
||||
pedited->toneCurve.method = method->get_active_row_number() != 4;
|
||||
pedited->toneCurve.hrenabled = !hrenabled->get_inconsistent();
|
||||
pedited->toneCurve.histmatching = !histmatching->get_inconsistent();
|
||||
pedited->toneCurve.clampOOG = !clampOOG->get_inconsistent();
|
||||
}
|
||||
|
||||
pp->toneCurve.hrenabled = hrenabled->get_active();
|
||||
@@ -443,6 +455,17 @@ void ToneCurve::methodChanged ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ToneCurve::clampOOGChanged()
|
||||
{
|
||||
if (listener) {
|
||||
listener->panelChanged(EvClampOOG, clampOOG->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ToneCurve::setRaw (bool raw)
|
||||
{
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ protected:
|
||||
MyComboBoxText* toneCurveMode;
|
||||
MyComboBoxText* toneCurveMode2;
|
||||
Gtk::ToggleButton *histmatching;
|
||||
Gtk::CheckButton *clampOOG;
|
||||
|
||||
bool clipDirty, lastAuto;
|
||||
sigc::connection autoconn, neutralconn, tcmodeconn, tcmode2conn;
|
||||
@@ -69,6 +70,7 @@ protected:
|
||||
|
||||
rtengine::ProcEvent EvHistMatching;
|
||||
rtengine::ProcEvent EvHistMatchingBatch;
|
||||
rtengine::ProcEvent EvClampOOG;
|
||||
|
||||
// used temporarily in eventing
|
||||
double nextExpcomp;
|
||||
@@ -124,6 +126,7 @@ public:
|
||||
|
||||
void hrenabledChanged ();
|
||||
void methodChanged ();
|
||||
void clampOOGChanged();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user