added on/off switch for L*a*b* adjustments
This commit is contained in:
parent
4ef705cdd6
commit
e1bf4b075f
@ -5586,6 +5586,10 @@ void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, LUTf & cur
|
|||||||
|
|
||||||
SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf & acurve, LUTf & bcurve, LUTf & satcurve, LUTf & lhskcurve, LUTf & clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLCurve)
|
SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf & acurve, LUTf & bcurve, LUTf & satcurve, LUTf & lhskcurve, LUTf & clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLCurve)
|
||||||
{
|
{
|
||||||
|
if (!params->labCurve.enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int W = lold->W;
|
int W = lold->W;
|
||||||
int H = lold->H;
|
int H = lold->H;
|
||||||
// lhskcurve.dump("lh_curve");
|
// lhskcurve.dump("lh_curve");
|
||||||
|
@ -519,6 +519,7 @@ enum ProcEvent {
|
|||||||
EvTMFattalAmount = 489,
|
EvTMFattalAmount = 489,
|
||||||
EvWBEnabled = 490,
|
EvWBEnabled = 490,
|
||||||
EvRGBEnabled = 491,
|
EvRGBEnabled = 491,
|
||||||
|
EvLEnabled = 492,
|
||||||
|
|
||||||
NUMOFEVENTS
|
NUMOFEVENTS
|
||||||
|
|
||||||
|
@ -497,6 +497,7 @@ void RetinexParams::getCurves(RetinextransmissionCurve &transmissionCurveLUT, Re
|
|||||||
}
|
}
|
||||||
|
|
||||||
LCurveParams::LCurveParams() :
|
LCurveParams::LCurveParams() :
|
||||||
|
enabled(false),
|
||||||
lcurve{
|
lcurve{
|
||||||
DCT_Linear
|
DCT_Linear
|
||||||
},
|
},
|
||||||
@ -536,7 +537,8 @@ LCurveParams::LCurveParams() :
|
|||||||
bool LCurveParams::operator ==(const LCurveParams& other) const
|
bool LCurveParams::operator ==(const LCurveParams& other) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
lcurve == other.lcurve
|
enabled == other.enabled
|
||||||
|
&& lcurve == other.lcurve
|
||||||
&& acurve == other.acurve
|
&& acurve == other.acurve
|
||||||
&& bcurve == other.bcurve
|
&& bcurve == other.bcurve
|
||||||
&& cccurve == other.cccurve
|
&& cccurve == other.cccurve
|
||||||
@ -2820,6 +2822,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
|||||||
saveToKeyfile(!pedited || pedited->blackwhite.afterCurve, "Black & White", "AfterCurve", blackwhite.afterCurve, keyFile);
|
saveToKeyfile(!pedited || pedited->blackwhite.afterCurve, "Black & White", "AfterCurve", blackwhite.afterCurve, keyFile);
|
||||||
|
|
||||||
// Luma curve
|
// Luma curve
|
||||||
|
saveToKeyfile(!pedited || pedited->labCurve.enabled, "Luminance Curve", "Enabled", labCurve.enabled, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->labCurve.brightness, "Luminance Curve", "Brightness", labCurve.brightness, keyFile);
|
saveToKeyfile(!pedited || pedited->labCurve.brightness, "Luminance Curve", "Brightness", labCurve.brightness, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->labCurve.contrast, "Luminance Curve", "Contrast", labCurve.contrast, keyFile);
|
saveToKeyfile(!pedited || pedited->labCurve.contrast, "Luminance Curve", "Contrast", labCurve.contrast, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->labCurve.chromaticity, "Luminance Curve", "Chromaticity", labCurve.chromaticity, keyFile);
|
saveToKeyfile(!pedited || pedited->labCurve.chromaticity, "Luminance Curve", "Chromaticity", labCurve.chromaticity, keyFile);
|
||||||
@ -3588,6 +3591,15 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (keyFile.has_group ("Luminance Curve")) {
|
if (keyFile.has_group ("Luminance Curve")) {
|
||||||
|
if (ppVersion >= 329) {
|
||||||
|
assignFromKeyfile(keyFile, "Luminance Curve", "Enabled", pedited, labCurve.enabled, pedited->labCurve.enabled);
|
||||||
|
} else {
|
||||||
|
labCurve.enabled = true;
|
||||||
|
if (pedited) {
|
||||||
|
pedited->labCurve.enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
assignFromKeyfile(keyFile, "Luminance Curve", "Brightness", pedited, labCurve.brightness, pedited->labCurve.brightness);
|
assignFromKeyfile(keyFile, "Luminance Curve", "Brightness", pedited, labCurve.brightness, pedited->labCurve.brightness);
|
||||||
assignFromKeyfile(keyFile, "Luminance Curve", "Contrast", pedited, labCurve.contrast, pedited->labCurve.contrast);
|
assignFromKeyfile(keyFile, "Luminance Curve", "Contrast", pedited, labCurve.contrast, pedited->labCurve.contrast);
|
||||||
|
|
||||||
|
@ -341,6 +341,7 @@ struct RetinexParams
|
|||||||
*/
|
*/
|
||||||
struct LCurveParams
|
struct LCurveParams
|
||||||
{
|
{
|
||||||
|
bool enabled;
|
||||||
std::vector<double> lcurve;
|
std::vector<double> lcurve;
|
||||||
std::vector<double> acurve;
|
std::vector<double> acurve;
|
||||||
std::vector<double> bcurve;
|
std::vector<double> bcurve;
|
||||||
|
@ -518,6 +518,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
|
|||||||
HDR, // EvTMFattalThreshold
|
HDR, // EvTMFattalThreshold
|
||||||
HDR, // EvTMFattalAmount
|
HDR, // EvTMFattalAmount
|
||||||
ALLNORAW, // EvWBEnabled
|
ALLNORAW, // EvWBEnabled
|
||||||
RGBCURVE // EvRGBEnabled
|
RGBCURVE, // EvRGBEnabled
|
||||||
|
LUMINANCECURVE // EvLEnabled
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
using namespace rtengine;
|
using namespace rtengine;
|
||||||
using namespace rtengine::procparams;
|
using namespace rtengine::procparams;
|
||||||
|
|
||||||
LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"))
|
LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"), false, true)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::vector<GradientMilestone> milestones;
|
std::vector<GradientMilestone> milestones;
|
||||||
@ -244,6 +244,8 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
|
|||||||
hhshape->setUnChanged (!pedited->labCurve.hhcurve);
|
hhshape->setUnChanged (!pedited->labCurve.hhcurve);
|
||||||
lcshape->setUnChanged (!pedited->labCurve.lccurve);
|
lcshape->setUnChanged (!pedited->labCurve.lccurve);
|
||||||
clshape->setUnChanged (!pedited->labCurve.clcurve);
|
clshape->setUnChanged (!pedited->labCurve.clcurve);
|
||||||
|
|
||||||
|
set_inconsistent(multiImage && !pedited->labCurve.enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
brightness->setValue (pp->labCurve.brightness);
|
brightness->setValue (pp->labCurve.brightness);
|
||||||
@ -277,6 +279,8 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
|
|||||||
lcshape->setCurve (pp->labCurve.lccurve);
|
lcshape->setCurve (pp->labCurve.lccurve);
|
||||||
clshape->setCurve (pp->labCurve.clcurve);
|
clshape->setCurve (pp->labCurve.clcurve);
|
||||||
|
|
||||||
|
setEnabled(pp->labCurve.enabled);
|
||||||
|
|
||||||
queue_draw();
|
queue_draw();
|
||||||
|
|
||||||
enableListener ();
|
enableListener ();
|
||||||
@ -338,6 +342,7 @@ void LCurve::setEditProvider (EditDataProvider *provider)
|
|||||||
|
|
||||||
void LCurve::write (ProcParams* pp, ParamsEdited* pedited)
|
void LCurve::write (ProcParams* pp, ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
|
pp->labCurve.enabled = getEnabled();
|
||||||
|
|
||||||
pp->labCurve.brightness = brightness->getValue ();
|
pp->labCurve.brightness = brightness->getValue ();
|
||||||
pp->labCurve.contrast = (int)contrast->getValue ();
|
pp->labCurve.contrast = (int)contrast->getValue ();
|
||||||
@ -380,7 +385,7 @@ void LCurve::write (ProcParams* pp, ParamsEdited* pedited)
|
|||||||
pedited->labCurve.lccurve = !lcshape->isUnChanged ();
|
pedited->labCurve.lccurve = !lcshape->isUnChanged ();
|
||||||
pedited->labCurve.clcurve = !clshape->isUnChanged ();
|
pedited->labCurve.clcurve = !clshape->isUnChanged ();
|
||||||
|
|
||||||
|
pedited->labCurve.enabled = !get_inconsistent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -424,7 +429,7 @@ void LCurve::avoidcolorshift_toggled ()
|
|||||||
lastACVal = avoidcolorshift->get_active ();
|
lastACVal = avoidcolorshift->get_active ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listener) {
|
if (listener && getEnabled()) {
|
||||||
if (avoidcolorshift->get_active ()) {
|
if (avoidcolorshift->get_active ()) {
|
||||||
listener->panelChanged (EvLAvoidColorShift, M("GENERAL_ENABLED"));
|
listener->panelChanged (EvLAvoidColorShift, M("GENERAL_ENABLED"));
|
||||||
} else {
|
} else {
|
||||||
@ -451,7 +456,7 @@ void LCurve::lcredsk_toggled ()
|
|||||||
lcshape->refresh();
|
lcshape->refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listener) {
|
if (listener && getEnabled()) {
|
||||||
if (lcredsk->get_active ()) {
|
if (lcredsk->get_active ()) {
|
||||||
listener->panelChanged (EvLLCredsk, M("GENERAL_ENABLED"));
|
listener->panelChanged (EvLLCredsk, M("GENERAL_ENABLED"));
|
||||||
} else {
|
} else {
|
||||||
@ -471,7 +476,7 @@ void LCurve::lcredsk_toggled ()
|
|||||||
void LCurve::curveChanged (CurveEditor* ce)
|
void LCurve::curveChanged (CurveEditor* ce)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (listener) {
|
if (listener && getEnabled()) {
|
||||||
if (ce == lshape) {
|
if (ce == lshape) {
|
||||||
listener->panelChanged (EvLLCurve, M("HISTORY_CUSTOMCURVE"));
|
listener->panelChanged (EvLLCurve, M("HISTORY_CUSTOMCURVE"));
|
||||||
}
|
}
|
||||||
@ -526,15 +531,15 @@ void LCurve::adjusterChanged (Adjuster* a, double newval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (a == brightness) {
|
if (a == brightness) {
|
||||||
if (listener) {
|
if (listener && getEnabled()) {
|
||||||
listener->panelChanged (EvLBrightness, costr);
|
listener->panelChanged (EvLBrightness, costr);
|
||||||
}
|
}
|
||||||
} else if (a == contrast) {
|
} else if (a == contrast) {
|
||||||
if (listener) {
|
if (listener && getEnabled()) {
|
||||||
listener->panelChanged (EvLContrast, costr);
|
listener->panelChanged (EvLContrast, costr);
|
||||||
}
|
}
|
||||||
} else if (a == rstprotection) {
|
} else if (a == rstprotection) {
|
||||||
if (listener) {
|
if (listener && getEnabled()) {
|
||||||
listener->panelChanged (EvLRSTProtection, costr);
|
listener->panelChanged (EvLRSTProtection, costr);
|
||||||
}
|
}
|
||||||
} else if (a == chromaticity) {
|
} else if (a == chromaticity) {
|
||||||
@ -550,7 +555,7 @@ void LCurve::adjusterChanged (Adjuster* a, double newval)
|
|||||||
lcredsk->set_sensitive( int(newval) > -100 );
|
lcredsk->set_sensitive( int(newval) > -100 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listener) {
|
if (listener && getEnabled()) {
|
||||||
listener->panelChanged (EvLSaturation, costr);
|
listener->panelChanged (EvLSaturation, costr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -668,3 +673,16 @@ void LCurve::trimValues (rtengine::procparams::ProcParams* pp)
|
|||||||
contrast->trimValue(pp->labCurve.contrast);
|
contrast->trimValue(pp->labCurve.contrast);
|
||||||
chromaticity->trimValue(pp->labCurve.chromaticity);
|
chromaticity->trimValue(pp->labCurve.chromaticity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LCurve::enabledChanged()
|
||||||
|
{
|
||||||
|
if (listener) {
|
||||||
|
if (get_inconsistent()) {
|
||||||
|
listener->panelChanged (EvLEnabled, M("GENERAL_UNCHANGED"));
|
||||||
|
} else if (getEnabled()) {
|
||||||
|
listener->panelChanged (EvLEnabled, M("GENERAL_ENABLED"));
|
||||||
|
} else {
|
||||||
|
listener->panelChanged (EvLEnabled, M("GENERAL_DISABLED"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -82,10 +82,7 @@ public:
|
|||||||
|
|
||||||
virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller);
|
virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller);
|
||||||
|
|
||||||
private:
|
void enabledChanged();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -82,6 +82,7 @@ void ParamsEdited::set (bool v)
|
|||||||
retinex.radius = v;
|
retinex.radius = v;
|
||||||
|
|
||||||
retinex.retinex = v;
|
retinex.retinex = v;
|
||||||
|
labCurve.enabled = v;
|
||||||
labCurve.lcurve = v;
|
labCurve.lcurve = v;
|
||||||
labCurve.acurve = v;
|
labCurve.acurve = v;
|
||||||
labCurve.bcurve = v;
|
labCurve.bcurve = v;
|
||||||
@ -626,6 +627,7 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
|||||||
retinex.radius = retinex.radius && p.retinex.radius == other.retinex.radius;
|
retinex.radius = retinex.radius && p.retinex.radius == other.retinex.radius;
|
||||||
|
|
||||||
retinex.enabled = retinex.enabled && p.retinex.enabled == other.retinex.enabled;
|
retinex.enabled = retinex.enabled && p.retinex.enabled == other.retinex.enabled;
|
||||||
|
labCurve.enabled = labCurve.enabled && p.labCurve.enabled == other.labCurve.enabled;
|
||||||
labCurve.lcurve = labCurve.lcurve && p.labCurve.lcurve == other.labCurve.lcurve;
|
labCurve.lcurve = labCurve.lcurve && p.labCurve.lcurve == other.labCurve.lcurve;
|
||||||
labCurve.acurve = labCurve.acurve && p.labCurve.acurve == other.labCurve.acurve;
|
labCurve.acurve = labCurve.acurve && p.labCurve.acurve == other.labCurve.acurve;
|
||||||
labCurve.bcurve = labCurve.bcurve && p.labCurve.bcurve == other.labCurve.bcurve;
|
labCurve.bcurve = labCurve.bcurve && p.labCurve.bcurve == other.labCurve.bcurve;
|
||||||
@ -1304,6 +1306,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (labCurve.enabled) {
|
||||||
|
toEdit.labCurve.enabled = mods.labCurve.enabled;
|
||||||
|
}
|
||||||
|
|
||||||
if (labCurve.lcurve) {
|
if (labCurve.lcurve) {
|
||||||
toEdit.labCurve.lcurve = mods.labCurve.lcurve;
|
toEdit.labCurve.lcurve = mods.labCurve.lcurve;
|
||||||
}
|
}
|
||||||
|
@ -100,6 +100,7 @@ public:
|
|||||||
class LCurveParamsEdited
|
class LCurveParamsEdited
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
bool enabled;
|
||||||
bool brightness;
|
bool brightness;
|
||||||
bool contrast;
|
bool contrast;
|
||||||
bool chromaticity;
|
bool chromaticity;
|
||||||
@ -115,8 +116,6 @@ public:
|
|||||||
bool hhcurve;
|
bool hhcurve;
|
||||||
bool lccurve;
|
bool lccurve;
|
||||||
bool clcurve;
|
bool clcurve;
|
||||||
bool enabled;
|
|
||||||
bool method;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class RGBCurvesParamsEdited
|
class RGBCurvesParamsEdited
|
||||||
|
Loading…
x
Reference in New Issue
Block a user