Patch from issue 1359: "Munsell correction - Lab adjustements" credits: jdesmis
Bundled new features besid the Lab tool enhancement (by jdesmis) : - curve to control skin tones in vibrance tool, credits: jdesmis - right click over SHCSelector (below the parametric curve) to reset to default values, credits: Hombre - colored bars around curves, credits: Hombre
This commit is contained in:
@@ -18,15 +18,18 @@
|
||||
*/
|
||||
#include "labcurve.h"
|
||||
#include <iomanip>
|
||||
#include "../rtengine/improcfun.h"
|
||||
|
||||
using namespace rtengine;
|
||||
using namespace rtengine::procparams;
|
||||
|
||||
LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
|
||||
brightness = Gtk::manage (new Adjuster (M("TP_LABCURVE_BRIGHTNESS"), -100, 100, 1, 0));
|
||||
contrast = Gtk::manage (new Adjuster (M("TP_LABCURVE_CONTRAST"), -100, 100, 1, 0));
|
||||
saturation = Gtk::manage (new Adjuster (M("TP_LABCURVE_SATURATION"), -100, 100, 1, 5));
|
||||
std::vector<GradientMilestone> bottomMilestones;
|
||||
|
||||
brightness = Gtk::manage (new Adjuster (M("TP_LABCURVE_BRIGHTNESS"), -100., 100., 1., 0.));
|
||||
contrast = Gtk::manage (new Adjuster (M("TP_LABCURVE_CONTRAST"), -100., 100., 1., 0.));
|
||||
chromaticity = Gtk::manage (new Adjuster (M("TP_LABCURVE_CHROMATICITY"), -100., 100., 1., 0.));
|
||||
|
||||
pack_start (*brightness);
|
||||
brightness->show ();
|
||||
@@ -34,12 +37,12 @@ LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
pack_start (*contrast);
|
||||
contrast->show ();
|
||||
|
||||
pack_start (*saturation);
|
||||
saturation->show ();
|
||||
pack_start (*chromaticity);
|
||||
chromaticity->show ();
|
||||
|
||||
brightness->setAdjusterListener (this);
|
||||
contrast->setAdjusterListener (this);
|
||||
saturation->setAdjusterListener (this);
|
||||
chromaticity->setAdjusterListener (this);
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%
|
||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||
@@ -48,24 +51,17 @@ LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
bwtoning->set_tooltip_markup (M("TP_LABCURVE_BWTONING_TIP"));
|
||||
pack_start (*bwtoning);
|
||||
|
||||
avoidclip = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_AVOIDCOLORCLIP")));
|
||||
avoidcolorshift = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_AVOIDCOLORSHIFT")));
|
||||
avoidcolorshift->set_tooltip_text (M("TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP"));
|
||||
pack_start (*avoidcolorshift, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
rstprotection = Gtk::manage ( new Adjuster (M("TP_LABCURVE_RSTPROTECTION"), 0., 100., 0.1, 0.) );
|
||||
pack_start (*rstprotection);
|
||||
rstprotection->show ();
|
||||
|
||||
pack_start (*avoidclip);
|
||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||
|
||||
enablelimiter = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_ENABLESATLIMITER")));
|
||||
pack_start (*enablelimiter);
|
||||
|
||||
saturationlimiter = Gtk::manage ( new Adjuster (M("TP_LABCURVE_SATLIMIT"), 0, 100, 1.0, 50) );
|
||||
pack_start (*saturationlimiter);
|
||||
saturationlimiter->show ();
|
||||
saturationlimiter->reference ();
|
||||
|
||||
//saturation->setAdjusterListener (this);
|
||||
saturationlimiter->setAdjusterListener (this);
|
||||
rstprotection->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) );
|
||||
acconn = avoidcolorshift->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::avoidcolorshift_toggled) );
|
||||
//%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
Gtk::HSeparator *hsep3 = Gtk::manage (new Gtk::HSeparator());
|
||||
@@ -74,17 +70,52 @@ LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
|
||||
curveEditorG = new CurveEditorGroup (options.lastLabCurvesDir);
|
||||
curveEditorG->setCurveListener (this);
|
||||
curveEditorG->setColorProvider (this);
|
||||
|
||||
ccshape = static_cast<DiagonalCurveEditor*>(curveEditorG->addCurve(CT_Diagonal, M("TP_LABCURVE_CURVEEDITOR_CC")));
|
||||
ccshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_CC_TOOLTIP"));
|
||||
ccshape->setRangeLabels(
|
||||
M("TP_LABCURVE_CURVEEDITOR_CC_RANGE1"), M("TP_LABCURVE_CURVEEDITOR_CC_RANGE2"),
|
||||
M("TP_LABCURVE_CURVEEDITOR_CC_RANGE3"), M("TP_LABCURVE_CURVEEDITOR_CC_RANGE4")
|
||||
);
|
||||
ccshape->setRangeDefaultMilestones(0.05, 0.2, 0.58);
|
||||
//cbgshape = static_cast<DiagonalCurveEditor*>(curveEditorG->addCurve(CT_Diagonal, M("TP_LABCURVE_CURVEEDITOR_CBG"));
|
||||
//cbgshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_CBG_TOOLTIP"));
|
||||
// -0.1 rad < Hue < 1.6 rad
|
||||
for (int i=0; i<7; i++) {
|
||||
float R, G, B;
|
||||
float x = float(i)*(1.0f/6.0);
|
||||
Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B);
|
||||
bottomMilestones.push_back( GradientMilestone(double(x), double(R), double(G), double(B)) );
|
||||
}
|
||||
chshape = static_cast<FlatCurveEditor*>(curveEditorG->addCurve(CT_Flat, M("TP_LABCURVE_CURVEEDITOR_CH")));
|
||||
chshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_CH_TOOLTIP"));
|
||||
chshape->setBottomBarBgGradient(bottomMilestones);
|
||||
chshape->setCurveColorProvider(this);
|
||||
|
||||
curveEditorG->newLine();
|
||||
|
||||
bottomMilestones.clear();
|
||||
bottomMilestones.push_back( GradientMilestone(0., 0., 0., 0.) );
|
||||
bottomMilestones.push_back( GradientMilestone(1., 1., 1., 1.) );
|
||||
lshape = static_cast<DiagonalCurveEditor*>(curveEditorG->addCurve(CT_Diagonal, "L"));
|
||||
lshape->setBottomBarBgGradient(bottomMilestones);
|
||||
lshape->setLeftBarBgGradient(bottomMilestones);
|
||||
ashape = static_cast<DiagonalCurveEditor*>(curveEditorG->addCurve(CT_Diagonal, "a"));
|
||||
ashape->setRangeLabels(
|
||||
M("TP_LABCURVE_CURVEEDITOR_A_RANGE1"), M("TP_LABCURVE_CURVEEDITOR_A_RANGE2"),
|
||||
M("TP_LABCURVE_CURVEEDITOR_A_RANGE3"), M("TP_LABCURVE_CURVEEDITOR_A_RANGE4")
|
||||
);
|
||||
bshape = static_cast<DiagonalCurveEditor*>(curveEditorG->addCurve(CT_Diagonal, "b"));
|
||||
bshape->setRangeLabels(
|
||||
M("TP_LABCURVE_CURVEEDITOR_B_RANGE1"), M("TP_LABCURVE_CURVEEDITOR_B_RANGE2"),
|
||||
M("TP_LABCURVE_CURVEEDITOR_B_RANGE3"), M("TP_LABCURVE_CURVEEDITOR_B_RANGE4")
|
||||
);
|
||||
|
||||
// This will add the reset button at the end of the curveType buttons
|
||||
curveEditorG->curveListComplete();
|
||||
|
||||
pack_start (*curveEditorG, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
|
||||
}
|
||||
|
||||
LCurve::~LCurve () {
|
||||
@@ -98,53 +129,63 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||
if (pedited) {
|
||||
brightness->setEditedState (pedited->labCurve.brightness ? Edited : UnEdited);
|
||||
contrast->setEditedState (pedited->labCurve.contrast ? Edited : UnEdited);
|
||||
saturation->setEditedState (pedited->labCurve.saturation ? Edited : UnEdited);
|
||||
chromaticity->setEditedState (pedited->labCurve.chromaticity ? Edited : UnEdited);
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
saturationlimiter->setEditedState (pedited->labCurve.saturationlimit ? Edited : UnEdited);
|
||||
rstprotection->setEditedState (pedited->labCurve.rstprotection ? Edited : UnEdited);
|
||||
bwtoning->set_inconsistent (!pedited->labCurve.bwtoning);
|
||||
avoidclip->set_inconsistent (!pedited->labCurve.avoidclip);
|
||||
enablelimiter->set_inconsistent (!pedited->labCurve.enable_saturationlimiter);
|
||||
avoidcolorshift->set_inconsistent (!pedited->labCurve.avoidcolorshift);
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
lshape->setUnChanged (!pedited->labCurve.lcurve);
|
||||
ashape->setUnChanged (!pedited->labCurve.acurve);
|
||||
bshape->setUnChanged (!pedited->labCurve.bcurve);
|
||||
|
||||
lshape->setUnChanged (!pedited->labCurve.lcurve);
|
||||
ashape->setUnChanged (!pedited->labCurve.acurve);
|
||||
bshape->setUnChanged (!pedited->labCurve.bcurve);
|
||||
ccshape->setUnChanged (!pedited->labCurve.cccurve);
|
||||
chshape->setUnChanged (!pedited->labCurve.chcurve);
|
||||
//cbgshape->setUnChanged (!pedited->labCurve.cbgcurve);
|
||||
}
|
||||
else {
|
||||
//if bwtoning is enabled, chromaticity value, avoid color shift and rstprotection has no effect
|
||||
//ccshape->set_sensitive(!(!pp->labCurve.bwtoning));
|
||||
//chshape->set_sensitive(!(!pp->labCurve.bwtoning));
|
||||
chromaticity->set_sensitive(!pp->labCurve.bwtoning);
|
||||
rstprotection->set_sensitive( !pp->labCurve.bwtoning && pp->labCurve.chromaticity!=0 );
|
||||
avoidcolorshift->set_sensitive(!pp->labCurve.bwtoning);
|
||||
}
|
||||
|
||||
brightness->setValue (pp->labCurve.brightness);
|
||||
contrast->setValue (pp->labCurve.contrast);
|
||||
saturation->setValue (pp->labCurve.saturation);
|
||||
chromaticity->setValue (pp->labCurve.chromaticity);
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
saturationlimiter->setValue (pp->labCurve.saturationlimit);
|
||||
rstprotection->setValue (pp->labCurve.rstprotection);
|
||||
|
||||
bwtconn.block (true);
|
||||
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);
|
||||
avoidcolorshift->set_active (pp->labCurve.avoidcolorshift);
|
||||
bwtconn.block (false);
|
||||
acconn.block (false);
|
||||
elconn.block (true);
|
||||
enablelimiter->set_active (pp->labCurve.enable_saturationlimiter);
|
||||
elconn.block (false);
|
||||
|
||||
//removeIfThere (this, saturationlimiter, false);
|
||||
// if (enablelimiter->get_active () || enablelimiter->get_inconsistent())
|
||||
// pack_start (*saturationlimiter);
|
||||
|
||||
|
||||
lastBWTVal = pp->labCurve.bwtoning;
|
||||
lastACVal = pp->labCurve.avoidclip;
|
||||
lastELVal = pp->labCurve.enable_saturationlimiter;
|
||||
lastACVal = pp->labCurve.avoidcolorshift;
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
lshape->setCurve (pp->labCurve.lcurve);
|
||||
ashape->setCurve (pp->labCurve.acurve);
|
||||
bshape->setCurve (pp->labCurve.bcurve);
|
||||
lshape->setCurve (pp->labCurve.lcurve);
|
||||
ashape->setCurve (pp->labCurve.acurve);
|
||||
bshape->setCurve (pp->labCurve.bcurve);
|
||||
ccshape->setCurve (pp->labCurve.cccurve);
|
||||
chshape->setCurve (pp->labCurve.chcurve);
|
||||
//cbgshape->setCurve (pp->labCurve.cbgcurve);
|
||||
|
||||
// Open up the first curve if selected
|
||||
bool active = lshape->openIfNonlinear();
|
||||
if (!active) ashape->openIfNonlinear();
|
||||
if (!active) bshape->openIfNonlinear();
|
||||
if (!active) ccshape->openIfNonlinear();
|
||||
if (!active) chshape->openIfNonlinear();
|
||||
|
||||
queue_draw();
|
||||
|
||||
enableListener ();
|
||||
}
|
||||
@@ -153,34 +194,38 @@ void LCurve::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||
|
||||
pp->labCurve.brightness = brightness->getValue ();
|
||||
pp->labCurve.contrast = (int)contrast->getValue ();
|
||||
pp->labCurve.saturation = (int)saturation->getValue ();
|
||||
pp->labCurve.chromaticity = (int)chromaticity->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 ();
|
||||
pp->labCurve.bwtoning = bwtoning->get_active ();
|
||||
pp->labCurve.avoidcolorshift = avoidcolorshift->get_active ();
|
||||
pp->labCurve.rstprotection = rstprotection->getValue ();
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
pp->labCurve.lcurve = lshape->getCurve ();
|
||||
pp->labCurve.acurve = ashape->getCurve ();
|
||||
pp->labCurve.bcurve = bshape->getCurve ();
|
||||
pp->labCurve.lcurve = lshape->getCurve ();
|
||||
pp->labCurve.acurve = ashape->getCurve ();
|
||||
pp->labCurve.bcurve = bshape->getCurve ();
|
||||
pp->labCurve.cccurve = ccshape->getCurve ();
|
||||
pp->labCurve.chcurve = chshape->getCurve ();
|
||||
//pp->labCurve.cbgcurve = cbgshape->getCurve ();
|
||||
|
||||
if (pedited) {
|
||||
pedited->labCurve.brightness = brightness->getEditedState ();
|
||||
pedited->labCurve.contrast = contrast->getEditedState ();
|
||||
pedited->labCurve.saturation = saturation->getEditedState ();
|
||||
pedited->labCurve.brightness = brightness->getEditedState ();
|
||||
pedited->labCurve.contrast = contrast->getEditedState ();
|
||||
pedited->labCurve.chromaticity = chromaticity->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 ();
|
||||
pedited->labCurve.bwtoning = !bwtoning->get_inconsistent();
|
||||
pedited->labCurve.avoidcolorshift = !avoidcolorshift->get_inconsistent();
|
||||
pedited->labCurve.rstprotection = rstprotection->getEditedState ();
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
pedited->labCurve.lcurve = !lshape->isUnChanged ();
|
||||
pedited->labCurve.acurve = !ashape->isUnChanged ();
|
||||
pedited->labCurve.bcurve = !bshape->isUnChanged ();
|
||||
pedited->labCurve.cccurve = !ccshape->isUnChanged ();
|
||||
pedited->labCurve.chcurve = !chshape->isUnChanged ();
|
||||
//pedited->labCurve.cbgcurve = !bshape->isUnChanged ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,46 +233,46 @@ void LCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedit
|
||||
|
||||
brightness->setDefault (defParams->labCurve.brightness);
|
||||
contrast->setDefault (defParams->labCurve.contrast);
|
||||
saturation->setDefault (defParams->labCurve.saturation);
|
||||
saturationlimiter->setDefault (defParams->labCurve.saturationlimit);
|
||||
chromaticity->setDefault (defParams->labCurve.chromaticity);
|
||||
rstprotection->setDefault (defParams->labCurve.rstprotection);
|
||||
|
||||
if (pedited) {
|
||||
brightness->setDefaultEditedState (pedited->labCurve.brightness ? Edited : UnEdited);
|
||||
contrast->setDefaultEditedState (pedited->labCurve.contrast ? Edited : UnEdited);
|
||||
saturation->setDefaultEditedState (pedited->labCurve.saturation ? Edited : UnEdited);
|
||||
saturationlimiter->setDefaultEditedState (pedited->labCurve.saturationlimit ? Edited : UnEdited);
|
||||
chromaticity->setDefaultEditedState (pedited->labCurve.chromaticity ? Edited : UnEdited);
|
||||
rstprotection->setDefaultEditedState (pedited->labCurve.rstprotection ? Edited : UnEdited);
|
||||
|
||||
}
|
||||
else {
|
||||
brightness->setDefaultEditedState (Irrelevant);
|
||||
contrast->setDefaultEditedState (Irrelevant);
|
||||
saturation->setDefaultEditedState (Irrelevant);
|
||||
saturationlimiter->setDefaultEditedState (Irrelevant);
|
||||
chromaticity->setDefaultEditedState (Irrelevant);
|
||||
rstprotection->setDefaultEditedState (Irrelevant);
|
||||
}
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
//Clipping control changed
|
||||
void LCurve::avoidclip_toggled () {
|
||||
|
||||
//Color shift control changed
|
||||
void LCurve::avoidcolorshift_toggled () {
|
||||
|
||||
if (batchMode) {
|
||||
if (avoidclip->get_inconsistent()) {
|
||||
avoidclip->set_inconsistent (false);
|
||||
if (avoidcolorshift->get_inconsistent()) {
|
||||
avoidcolorshift->set_inconsistent (false);
|
||||
acconn.block (true);
|
||||
avoidclip->set_active (false);
|
||||
avoidcolorshift->set_active (false);
|
||||
acconn.block (false);
|
||||
}
|
||||
else if (lastACVal)
|
||||
avoidclip->set_inconsistent (true);
|
||||
|
||||
lastACVal = avoidclip->get_active ();
|
||||
avoidcolorshift->set_inconsistent (true);
|
||||
|
||||
lastACVal = avoidcolorshift->get_active ();
|
||||
}
|
||||
|
||||
|
||||
if (listener) {
|
||||
if (avoidclip->get_active ())
|
||||
listener->panelChanged (EvLAvoidClip, M("GENERAL_ENABLED"));
|
||||
if (avoidcolorshift->get_active ())
|
||||
listener->panelChanged (EvLAvoidColorShift, M("GENERAL_ENABLED"));
|
||||
else
|
||||
listener->panelChanged (EvLAvoidClip, M("GENERAL_DISABLED"));
|
||||
listener->panelChanged (EvLAvoidColorShift, M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,8 +292,13 @@ void LCurve::bwtoning_toggled () {
|
||||
|
||||
lastBWTVal = bwtoning->get_active ();
|
||||
}
|
||||
|
||||
saturation->set_sensitive(!(bwtoning->get_active ())); //at bwtoning enabled saturation value has no effect
|
||||
else {
|
||||
//ccshape->set_sensitive(!(!pp->labCurve.bwtoning));
|
||||
//chshape->set_sensitive(!(!pp->labCurve.bwtoning));
|
||||
chromaticity->set_sensitive( !(bwtoning->get_active ()) );
|
||||
rstprotection->set_sensitive( !(bwtoning->get_active ()) && chromaticity->getIntValue()!=0 );
|
||||
avoidcolorshift->set_sensitive( !(bwtoning->get_active ()) );
|
||||
}
|
||||
|
||||
if (listener) {
|
||||
if (bwtoning->get_active ())
|
||||
@@ -258,35 +308,8 @@ void LCurve::bwtoning_toggled () {
|
||||
}
|
||||
}
|
||||
|
||||
void LCurve::enablelimiter_toggled () {
|
||||
|
||||
if (batchMode) {
|
||||
if (enablelimiter->get_inconsistent()) {
|
||||
enablelimiter->set_inconsistent (false);
|
||||
elconn.block (true);
|
||||
enablelimiter->set_active (false);
|
||||
elconn.block (false);
|
||||
}
|
||||
else if (lastELVal)
|
||||
enablelimiter->set_inconsistent (true);
|
||||
|
||||
lastELVal = enablelimiter->get_active ();
|
||||
}
|
||||
|
||||
//removeIfThere (this, saturationlimiter, false);
|
||||
//if (enablelimiter->get_active () || enablelimiter->get_inconsistent())
|
||||
// pack_start (*saturationlimiter);
|
||||
|
||||
if (listener) {
|
||||
if (enablelimiter->get_active ())
|
||||
listener->panelChanged (EvLSatLimiter, M("GENERAL_ENABLED"));
|
||||
else
|
||||
listener->panelChanged (EvLSatLimiter, M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
//%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
/*
|
||||
* Curve listener
|
||||
*
|
||||
@@ -296,13 +319,19 @@ void LCurve::enablelimiter_toggled () {
|
||||
void LCurve::curveChanged (CurveEditor* ce) {
|
||||
|
||||
if (listener) {
|
||||
if (ce == lshape)
|
||||
listener->panelChanged (EvLLCurve, M("HISTORY_CUSTOMCURVE"));
|
||||
if (ce == ashape)
|
||||
listener->panelChanged (EvLaCurve, M("HISTORY_CUSTOMCURVE"));
|
||||
if (ce == bshape)
|
||||
listener->panelChanged (EvLbCurve, M("HISTORY_CUSTOMCURVE"));
|
||||
}
|
||||
if (ce == lshape)
|
||||
listener->panelChanged (EvLLCurve, M("HISTORY_CUSTOMCURVE"));
|
||||
if (ce == ashape)
|
||||
listener->panelChanged (EvLaCurve, M("HISTORY_CUSTOMCURVE"));
|
||||
if (ce == bshape)
|
||||
listener->panelChanged (EvLbCurve, M("HISTORY_CUSTOMCURVE"));
|
||||
if (ce == ccshape)
|
||||
listener->panelChanged (EvLCCCurve, M("HISTORY_CUSTOMCURVE"));
|
||||
if (ce == chshape)
|
||||
listener->panelChanged (EvLCHCurve, M("HISTORY_CUSTOMCURVE"));
|
||||
//if (ce == cbgshape)
|
||||
// listener->panelChanged (EvLCBGCurve, M("HISTORY_CUSTOMCURVE"));
|
||||
}
|
||||
}
|
||||
|
||||
void LCurve::adjusterChanged (Adjuster* a, double newval) {
|
||||
@@ -313,7 +342,7 @@ void LCurve::adjusterChanged (Adjuster* a, double newval) {
|
||||
Glib::ustring costr;
|
||||
if (a==brightness)
|
||||
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue());
|
||||
else if (a==saturationlimiter)
|
||||
else if (a==rstprotection)
|
||||
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(1), a->getValue());
|
||||
else
|
||||
costr = Glib::ustring::format ((int)a->getValue());
|
||||
@@ -322,10 +351,14 @@ void LCurve::adjusterChanged (Adjuster* a, double newval) {
|
||||
listener->panelChanged (EvLBrightness, costr);
|
||||
else if (a==contrast)
|
||||
listener->panelChanged (EvLContrast, costr);
|
||||
else if (a==saturation)
|
||||
else if (a==chromaticity) {
|
||||
if (!batchMode) {
|
||||
rstprotection->set_sensitive( !(bwtoning->get_active ()) && chromaticity->getIntValue()!=0 );
|
||||
}
|
||||
listener->panelChanged (EvLSaturation, costr);
|
||||
else if (a==saturationlimiter)
|
||||
listener->panelChanged (EvLSatLimit, costr);
|
||||
}
|
||||
else if (a==rstprotection)
|
||||
listener->panelChanged (EvLRSTProtection, costr);
|
||||
}
|
||||
|
||||
void LCurve::colorForValue (double valX, double valY) {
|
||||
@@ -348,6 +381,22 @@ void LCurve::colorForValue (double valX, double valY) {
|
||||
green = (double)valY;
|
||||
blue = (double)valY;
|
||||
}
|
||||
else if (ce == ccshape) { // c = f(c)
|
||||
red = (double)valY;
|
||||
green = (double)valY;
|
||||
blue = (double)valY;
|
||||
}
|
||||
else if (ce == chshape) { // c = f(h)
|
||||
|
||||
float r, g, b;
|
||||
|
||||
Color::hsv2rgb01(float(valX), float(valY), 0.5f, r, g, b);
|
||||
|
||||
red = double(r);
|
||||
green = double(g);
|
||||
blue = double(b);
|
||||
}
|
||||
|
||||
else {
|
||||
printf("Error: no curve displayed!\n");
|
||||
}
|
||||
@@ -356,31 +405,31 @@ void LCurve::colorForValue (double valX, double valY) {
|
||||
|
||||
void LCurve::setBatchMode (bool batchMode) {
|
||||
|
||||
ToolPanel::setBatchMode (batchMode);
|
||||
brightness->showEditedCB ();
|
||||
contrast->showEditedCB ();
|
||||
saturation->showEditedCB ();
|
||||
saturationlimiter->showEditedCB ();
|
||||
ToolPanel::setBatchMode (batchMode);
|
||||
brightness->showEditedCB ();
|
||||
contrast->showEditedCB ();
|
||||
chromaticity->showEditedCB ();
|
||||
rstprotection->showEditedCB ();
|
||||
|
||||
curveEditorG->setBatchMode (batchMode);
|
||||
curveEditorG->setBatchMode (batchMode);
|
||||
}
|
||||
|
||||
|
||||
void LCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma){
|
||||
|
||||
lshape->updateBackgroundHistogram (histLCurve);
|
||||
lshape->updateBackgroundHistogram (histLCurve);
|
||||
}
|
||||
|
||||
void LCurve::setAdjusterBehavior (bool bradd, bool contradd, bool satadd) {
|
||||
|
||||
brightness->setAddMode(bradd);
|
||||
contrast->setAddMode(contradd);
|
||||
saturation->setAddMode(satadd);
|
||||
chromaticity->setAddMode(satadd);
|
||||
}
|
||||
|
||||
void LCurve::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||
|
||||
brightness->trimValue(pp->labCurve.brightness);
|
||||
contrast->trimValue(pp->labCurve.contrast);
|
||||
saturation->trimValue(pp->labCurve.saturation);
|
||||
chromaticity->trimValue(pp->labCurve.chromaticity);
|
||||
}
|
||||
|
Reference in New Issue
Block a user