Enhancement: BW toning in Lab (see issue 1424)
This commit is contained in:
@@ -44,6 +44,10 @@ LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
//%%%%%%%%%%%%%%%%%%
|
||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||
|
||||
bwtoning = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_BWTONING")));
|
||||
bwtoning->set_tooltip_markup (M("TP_LABCURVE_BWTONING_TIP"));
|
||||
pack_start (*bwtoning);
|
||||
|
||||
avoidclip = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_AVOIDCOLORCLIP")));
|
||||
|
||||
pack_start (*avoidclip);
|
||||
@@ -59,6 +63,7 @@ LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
|
||||
//saturation->setAdjusterListener (this);
|
||||
saturationlimiter->setAdjusterListener (this);
|
||||
bwtconn= bwtoning->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::bwtoning_toggled) );
|
||||
acconn = avoidclip->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::avoidclip_toggled) );
|
||||
elconn = enablelimiter->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::enablelimiter_toggled) );
|
||||
//%%%%%%%%%%%%%%%%%%%
|
||||
@@ -97,6 +102,7 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
saturationlimiter->setEditedState (pedited->labCurve.saturationlimit ? Edited : UnEdited);
|
||||
bwtoning->set_inconsistent (!pedited->labCurve.bwtoning);
|
||||
avoidclip->set_inconsistent (!pedited->labCurve.avoidclip);
|
||||
enablelimiter->set_inconsistent (!pedited->labCurve.enable_saturationlimiter);
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
@@ -114,6 +120,8 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
saturationlimiter->setValue (pp->labCurve.saturationlimit);
|
||||
acconn.block (true);
|
||||
bwtoning->set_active (pp->labCurve.bwtoning);
|
||||
saturation->set_sensitive(!(bwtoning->get_active ())); //at bwtoning enabled saturation value has no effect
|
||||
avoidclip->set_active (pp->labCurve.avoidclip);
|
||||
acconn.block (false);
|
||||
elconn.block (true);
|
||||
@@ -124,6 +132,7 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||
// if (enablelimiter->get_active () || enablelimiter->get_inconsistent())
|
||||
// pack_start (*saturationlimiter);
|
||||
|
||||
lastBWTVal = pp->labCurve.bwtoning;
|
||||
lastACVal = pp->labCurve.avoidclip;
|
||||
lastELVal = pp->labCurve.enable_saturationlimiter;
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
@@ -147,6 +156,7 @@ void LCurve::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||
pp->labCurve.saturation = (int)saturation->getValue ();
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
pp->labCurve.bwtoning = bwtoning->get_active ();
|
||||
pp->labCurve.avoidclip = avoidclip->get_active ();
|
||||
pp->labCurve.enable_saturationlimiter = enablelimiter->get_active ();
|
||||
pp->labCurve.saturationlimit = saturationlimiter->getValue ();
|
||||
@@ -162,6 +172,7 @@ void LCurve::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||
pedited->labCurve.saturation = saturation->getEditedState ();
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
pedited->labCurve.bwtoning = !bwtoning->get_inconsistent();
|
||||
pedited->labCurve.avoidclip = !avoidclip->get_inconsistent();
|
||||
pedited->labCurve.enable_saturationlimiter = !enablelimiter->get_inconsistent();
|
||||
pedited->labCurve.saturationlimit = saturationlimiter->getEditedState ();
|
||||
@@ -220,6 +231,33 @@ void LCurve::avoidclip_toggled () {
|
||||
}
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
//BW toning control changed
|
||||
void LCurve::bwtoning_toggled () {
|
||||
|
||||
if (batchMode) {
|
||||
if (bwtoning->get_inconsistent()) {
|
||||
bwtoning->set_inconsistent (false);
|
||||
bwtconn.block (true);
|
||||
bwtoning->set_active (false);
|
||||
bwtconn.block (false);
|
||||
}
|
||||
else if (lastBWTVal)
|
||||
bwtoning->set_inconsistent (true);
|
||||
|
||||
lastBWTVal = bwtoning->get_active ();
|
||||
}
|
||||
|
||||
saturation->set_sensitive(!(bwtoning->get_active ())); //at bwtoning enabled saturation value has no effect
|
||||
|
||||
if (listener) {
|
||||
if (bwtoning->get_active ())
|
||||
listener->panelChanged (EvLBWtoning, M("GENERAL_ENABLED"));
|
||||
else
|
||||
listener->panelChanged (EvLBWtoning, M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
|
||||
void LCurve::enablelimiter_toggled () {
|
||||
|
||||
if (batchMode) {
|
||||
|
@@ -39,11 +39,12 @@ class LCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPan
|
||||
|
||||
//%%%%%%%%%%%%%%%%
|
||||
Gtk::CheckButton* avoidclip;
|
||||
Gtk::CheckButton* enablelimiter;
|
||||
Gtk::CheckButton* enablelimiter;
|
||||
Gtk::CheckButton* bwtoning;
|
||||
Adjuster* saturationlimiter;
|
||||
bool cbAdd;
|
||||
sigc::connection acconn, elconn;
|
||||
bool lastACVal, lastELVal;
|
||||
sigc::connection bwtconn, acconn, elconn;
|
||||
bool lastBWTVal, lastACVal, lastELVal;
|
||||
//%%%%%%%%%%%%%%%%
|
||||
|
||||
public:
|
||||
@@ -62,6 +63,7 @@ class LCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPan
|
||||
void adjusterChanged (Adjuster* a, double newval);
|
||||
void avoidclip_toggled ();
|
||||
void enablelimiter_toggled ();
|
||||
void bwtoning_toggled();
|
||||
void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma);
|
||||
|
||||
virtual void colorForValue (double valX, double valY);
|
||||
|
@@ -52,6 +52,7 @@ void ParamsEdited::set (bool v) {
|
||||
labCurve.avoidclip = v;
|
||||
labCurve.enable_saturationlimiter = v;
|
||||
labCurve.saturationlimit = v;
|
||||
labCurve.bwtoning =v;
|
||||
rgbCurves.rcurve = v;
|
||||
rgbCurves.gcurve = v;
|
||||
rgbCurves.bcurve = v;
|
||||
@@ -244,6 +245,7 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
labCurve.avoidclip = labCurve.avoidclip && p.labCurve.avoidclip == other.labCurve.avoidclip;
|
||||
labCurve.enable_saturationlimiter = labCurve.enable_saturationlimiter && p.labCurve.enable_saturationlimiter == other.labCurve.enable_saturationlimiter;
|
||||
labCurve.saturationlimit = labCurve.saturationlimit && p.labCurve.saturationlimit == other.labCurve.saturationlimit;
|
||||
labCurve.bwtoning = labCurve.bwtoning && p.labCurve.bwtoning == other.labCurve.bwtoning;
|
||||
rgbCurves.rcurve = rgbCurves.rcurve && p.rgbCurves.rcurve == other.rgbCurves.rcurve;
|
||||
rgbCurves.gcurve = rgbCurves.gcurve && p.rgbCurves.gcurve == other.rgbCurves.gcurve;
|
||||
rgbCurves.bcurve = rgbCurves.bcurve && p.rgbCurves.bcurve == other.rgbCurves.bcurve;
|
||||
@@ -432,9 +434,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
if (labCurve.brightness) toEdit.labCurve.brightness = dontforceSet && options.baBehav[ADDSET_LC_BRIGHTNESS] ? toEdit.labCurve.brightness + mods.labCurve.brightness : mods.labCurve.brightness;
|
||||
if (labCurve.contrast) toEdit.labCurve.contrast = dontforceSet && options.baBehav[ADDSET_LC_CONTRAST] ? toEdit.labCurve.contrast + mods.labCurve.contrast : mods.labCurve.contrast;
|
||||
if (labCurve.saturation) toEdit.labCurve.saturation = dontforceSet && options.baBehav[ADDSET_LC_SATURATION] ? toEdit.labCurve.saturation + mods.labCurve.saturation : mods.labCurve.saturation;
|
||||
if (labCurve.avoidclip) toEdit.labCurve.avoidclip = mods.labCurve.avoidclip;
|
||||
|
||||
if (labCurve.enable_saturationlimiter) toEdit.labCurve.enable_saturationlimiter = mods.labCurve.enable_saturationlimiter;
|
||||
if (labCurve.saturationlimit) toEdit.labCurve.saturationlimit = mods.labCurve.saturationlimit;
|
||||
if (labCurve.bwtoning) toEdit.labCurve.bwtoning = mods.labCurve.bwtoning;
|
||||
|
||||
if (rgbCurves.rcurve) toEdit.rgbCurves.rcurve = mods.rgbCurves.rcurve;
|
||||
if (rgbCurves.gcurve) toEdit.rgbCurves.gcurve = mods.rgbCurves.gcurve;
|
||||
|
@@ -60,6 +60,7 @@ class LCurveParamsEdited {
|
||||
bool lcurve;
|
||||
bool acurve;
|
||||
bool bcurve;
|
||||
bool bwtoning;
|
||||
};
|
||||
|
||||
class RGBCurvesParamsEdited {
|
||||
|
Reference in New Issue
Block a user