Fixed Auto Levels Clip malfunction issue 2104
This commit is contained in:
@@ -5,7 +5,7 @@ set (BASESOURCEFILES
|
||||
ilabel.cc thumbbrowserbase.cc adjuster.cc filebrowserentry.cc filebrowser.cc filethumbnailbuttonset.cc
|
||||
cachemanager.cc cacheimagedata.cc shcselector.cc perspective.cc thresholdselector.cc thresholdadjuster.cc
|
||||
clipboard.cc thumbimageupdater.cc bqentryupdater.cc lensgeom.cc coloredbar.cc
|
||||
coarsepanel.cc cacorrection.cc hlrec.cc chmixer.cc blackwhite.cc
|
||||
coarsepanel.cc cacorrection.cc chmixer.cc blackwhite.cc
|
||||
resize.cc icmpanel.cc crop.cc shadowshighlights.cc
|
||||
impulsedenoise.cc dirpyrdenoise.cc epd.cc
|
||||
exifpanel.cc toolpanel.cc lensprofile.cc
|
||||
|
@@ -28,6 +28,8 @@ HLRecovery::HLRecovery () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
|
||||
enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLE")));
|
||||
enabled->set_active (false);
|
||||
enabled->set_tooltip_markup (M("TP_HLREC_ENA_TOOLTIP"));
|
||||
|
||||
pack_start (*enabled);
|
||||
|
||||
method = Gtk::manage (new MyComboBoxText ());
|
||||
@@ -49,6 +51,27 @@ HLRecovery::HLRecovery () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
show_all ();
|
||||
}
|
||||
|
||||
int HLChangedUI (void* data) {
|
||||
GThreadLock lock;
|
||||
(static_cast<HLRecovery*>(data))->HLComputed_ ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void HLRecovery::HLChanged (bool hlrbool){
|
||||
|
||||
nexthlrbool= hlrbool;
|
||||
g_idle_add (HLChangedUI, this);
|
||||
}
|
||||
bool HLRecovery::HLComputed_ () {
|
||||
enaconn.block (true);
|
||||
enabled->set_active (nexthlrbool);
|
||||
enaconn.block (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void HLRecovery::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||
|
||||
disableListener ();
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include "toolpanel.h"
|
||||
#include "guiutils.h"
|
||||
|
||||
class HLRecovery : public Gtk::VBox, public FoldableToolPanel {
|
||||
class HLRecovery : public Gtk::VBox, public FoldableToolPanel, public rtengine::AutoHLListener{
|
||||
|
||||
protected:
|
||||
Gtk::CheckButton* enabled;
|
||||
@@ -31,16 +31,21 @@ class HLRecovery : public Gtk::VBox, public FoldableToolPanel {
|
||||
sigc::connection methconn;
|
||||
sigc::connection enaconn;
|
||||
bool lastEnabled;
|
||||
bool nexthlrbool;
|
||||
|
||||
public:
|
||||
|
||||
HLRecovery ();
|
||||
// ~HLRecovery ();
|
||||
|
||||
|
||||
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
|
||||
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
||||
void setBatchMode (bool batchMode);
|
||||
|
||||
void setRaw (bool raw);
|
||||
void HLChanged (bool hlrbool);
|
||||
bool HLComputed_ ();
|
||||
|
||||
void enabledChanged ();
|
||||
void methodChanged ();
|
||||
|
@@ -46,6 +46,8 @@ void ParamsEdited::set (bool v) {
|
||||
toneCurve.autoexp = v;
|
||||
toneCurve.clip = v;
|
||||
toneCurve.expcomp = v;
|
||||
toneCurve.hrenabled = v;
|
||||
toneCurve.method = v;
|
||||
labCurve.lcurve = v;
|
||||
labCurve.acurve = v;
|
||||
labCurve.bcurve = v;
|
||||
@@ -241,8 +243,6 @@ void ParamsEdited::set (bool v) {
|
||||
blackwhite.afterCurveMode = v;
|
||||
blackwhite.autoc = v;
|
||||
|
||||
hlrecovery.enabled = v;
|
||||
hlrecovery.method = v;
|
||||
resize.scale = v;
|
||||
resize.appliesTo = v;
|
||||
resize.method = v;
|
||||
@@ -325,6 +325,8 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
toneCurve.autoexp = toneCurve.autoexp && p.toneCurve.autoexp == other.toneCurve.autoexp;
|
||||
toneCurve.clip = toneCurve.clip && p.toneCurve.clip == other.toneCurve.clip;
|
||||
toneCurve.expcomp = toneCurve.expcomp && p.toneCurve.expcomp == other.toneCurve.expcomp;
|
||||
toneCurve.hrenabled = toneCurve.hrenabled && p.toneCurve.hrenabled == other.toneCurve.hrenabled;
|
||||
toneCurve.method = toneCurve.method && p.toneCurve.method == other.toneCurve.method;
|
||||
labCurve.lcurve = labCurve.lcurve && p.labCurve.lcurve == other.labCurve.lcurve;
|
||||
labCurve.acurve = labCurve.acurve && p.labCurve.acurve == other.labCurve.acurve;
|
||||
labCurve.bcurve = labCurve.bcurve && p.labCurve.bcurve == other.labCurve.bcurve;
|
||||
@@ -523,8 +525,6 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
blackwhite.afterCurve = blackwhite.afterCurve && p.blackwhite.afterCurve == other.blackwhite.afterCurve;
|
||||
blackwhite.afterCurveMode = blackwhite.afterCurveMode && p.blackwhite.afterCurveMode == other.blackwhite.afterCurveMode;
|
||||
blackwhite.autoc = blackwhite.autoc && p.blackwhite.autoc == other.blackwhite.autoc;
|
||||
hlrecovery.enabled = hlrecovery.enabled && p.hlrecovery.enabled == other.hlrecovery.enabled;
|
||||
hlrecovery.method = hlrecovery.method && p.hlrecovery.method == other.hlrecovery.method;
|
||||
resize.scale = resize.scale && p.resize.scale == other.resize.scale;
|
||||
resize.appliesTo = resize.appliesTo && p.resize.appliesTo == other.resize.appliesTo;
|
||||
resize.method = resize.method && p.resize.method == other.resize.method;
|
||||
@@ -601,6 +601,8 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
if (toneCurve.expcomp) toEdit.toneCurve.expcomp = dontforceSet && options.baBehav[ADDSET_TC_EXPCOMP] ? toEdit.toneCurve.expcomp + mods.toneCurve.expcomp : mods.toneCurve.expcomp;
|
||||
if (toneCurve.hlcompr) toEdit.toneCurve.hlcompr = dontforceSet && options.baBehav[ADDSET_TC_HLCOMPAMOUNT] ? toEdit.toneCurve.hlcompr + mods.toneCurve.hlcompr : mods.toneCurve.hlcompr;
|
||||
if (toneCurve.hlcomprthresh) toEdit.toneCurve.hlcomprthresh = dontforceSet && options.baBehav[ADDSET_TC_HLCOMPTHRESH] ? toEdit.toneCurve.hlcomprthresh + mods.toneCurve.hlcomprthresh : mods.toneCurve.hlcomprthresh;
|
||||
if (toneCurve.hrenabled) toEdit.toneCurve.hrenabled = mods.toneCurve.hrenabled;
|
||||
if (toneCurve.method) toEdit.toneCurve.method = mods.toneCurve.method;
|
||||
if (labCurve.lcurve) toEdit.labCurve.lcurve = mods.labCurve.lcurve;
|
||||
if (labCurve.acurve) toEdit.labCurve.acurve = mods.labCurve.acurve;
|
||||
if (labCurve.bcurve) toEdit.labCurve.bcurve = mods.labCurve.bcurve;
|
||||
@@ -801,8 +803,6 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
if (blackwhite.afterCurve) toEdit.blackwhite.afterCurve = mods.blackwhite.afterCurve;
|
||||
if (blackwhite.afterCurveMode) toEdit.blackwhite.afterCurveMode = mods.blackwhite.afterCurveMode;
|
||||
|
||||
if (hlrecovery.enabled) toEdit.hlrecovery.enabled = mods.hlrecovery.enabled;
|
||||
if (hlrecovery.method) toEdit.hlrecovery.method = mods.hlrecovery.method;
|
||||
if (resize.scale) toEdit.resize.scale = mods.resize.scale;
|
||||
if (resize.appliesTo) toEdit.resize.appliesTo = mods.resize.appliesTo;
|
||||
if (resize.method) toEdit.resize.method = mods.resize.method;
|
||||
|
@@ -49,6 +49,9 @@ class ToneCurveParamsEdited {
|
||||
bool autoexp;
|
||||
bool clip;
|
||||
bool expcomp;
|
||||
bool hrenabled;
|
||||
bool method;
|
||||
|
||||
};
|
||||
|
||||
class LCurveParamsEdited {
|
||||
@@ -69,6 +72,10 @@ class LCurveParamsEdited {
|
||||
bool hhcurve;
|
||||
bool lccurve;
|
||||
bool clcurve;
|
||||
|
||||
bool enabled;
|
||||
bool method;
|
||||
|
||||
};
|
||||
|
||||
class RGBCurvesParamsEdited {
|
||||
@@ -384,14 +391,14 @@ class CACorrParamsEdited {
|
||||
bool red;
|
||||
bool blue;
|
||||
};
|
||||
|
||||
/*
|
||||
class HRecParamsEdited {
|
||||
|
||||
public:
|
||||
bool enabled;
|
||||
bool method;
|
||||
};
|
||||
|
||||
*/
|
||||
class ResizeParamsEdited {
|
||||
|
||||
public:
|
||||
@@ -503,7 +510,7 @@ class ParamsEdited {
|
||||
VignettingParamsEdited vignetting;
|
||||
ChannelMixerParamsEdited chmixer;
|
||||
BlackWhiteParamsEdited blackwhite;
|
||||
HRecParamsEdited hlrecovery;
|
||||
// HRecParamsEdited hlrecovery;
|
||||
ResizeParamsEdited resize;
|
||||
ColorManagementParamsEdited icm;
|
||||
RAWParamsEdited raw;
|
||||
|
@@ -46,7 +46,7 @@ PartialPasteDlg::PartialPasteDlg (Glib::ustring title) {
|
||||
// options in basic:
|
||||
wb = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_WHITEBALANCE")));
|
||||
exposure = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EXPOSURE")));
|
||||
hlrec = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_HLRECONSTRUCTION")));
|
||||
// hlrec = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_HLRECONSTRUCTION")));
|
||||
sh = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_SHADOWSHIGHLIGHTS")));
|
||||
epd = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EPD")));
|
||||
pcvignette = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PCVIGNETTE")));
|
||||
@@ -126,7 +126,7 @@ PartialPasteDlg::PartialPasteDlg (Glib::ustring title) {
|
||||
vboxes[0]->pack_start (*hseps[0], Gtk::PACK_SHRINK, 2);
|
||||
vboxes[0]->pack_start (*wb, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[0]->pack_start (*exposure, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[0]->pack_start (*hlrec, Gtk::PACK_SHRINK, 2);
|
||||
// vboxes[0]->pack_start (*hlrec, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[0]->pack_start (*sh, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[0]->pack_start (*epd, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[0]->pack_start (*pcvignette, Gtk::PACK_SHRINK, 2);
|
||||
@@ -249,7 +249,7 @@ PartialPasteDlg::PartialPasteDlg (Glib::ustring title) {
|
||||
|
||||
wbConn = wb->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
|
||||
exposureConn = exposure->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
|
||||
hlrecConn = hlrec->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
|
||||
// hlrecConn = hlrec->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
|
||||
shConn = sh->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
|
||||
epdConn = epd->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
|
||||
pcvignetteConn = pcvignette->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
|
||||
@@ -433,7 +433,7 @@ void PartialPasteDlg::basicToggled () {
|
||||
|
||||
wbConn.block (true);
|
||||
exposureConn.block (true);
|
||||
hlrecConn.block (true);
|
||||
// hlrecConn.block (true);
|
||||
shConn.block (true);
|
||||
epdConn.block(true);
|
||||
pcvignetteConn.block (true);
|
||||
@@ -445,7 +445,7 @@ void PartialPasteDlg::basicToggled () {
|
||||
|
||||
wb->set_active (basic->get_active ());
|
||||
exposure->set_active (basic->get_active ());
|
||||
hlrec->set_active (basic->get_active ());
|
||||
// hlrec->set_active (basic->get_active ());
|
||||
sh->set_active (basic->get_active ());
|
||||
epd->set_active (basic->get_active ());
|
||||
pcvignette->set_active (basic->get_active ());
|
||||
@@ -455,7 +455,7 @@ void PartialPasteDlg::basicToggled () {
|
||||
|
||||
wbConn.block (false);
|
||||
exposureConn.block (false);
|
||||
hlrecConn.block (false);
|
||||
// hlrecConn.block (false);
|
||||
shConn.block (false);
|
||||
epdConn.block (false);
|
||||
pcvignetteConn.block (false);
|
||||
@@ -613,7 +613,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
|
||||
// Now we filter out the filter depending on the checked items
|
||||
if (!wb->get_active ()) filterPE.wb = falsePE.wb;
|
||||
if (!exposure->get_active ()) filterPE.toneCurve = falsePE.toneCurve;
|
||||
if (!hlrec->get_active ()) filterPE.hlrecovery = falsePE.hlrecovery;
|
||||
// if (!hlrec->get_active ()) filterPE.toneCurve = falsePE.toneCurve;
|
||||
if (!sh->get_active ()) filterPE.sh = falsePE.sh;
|
||||
if (!epd->get_active ()) filterPE.edgePreservingDecompositionUI = falsePE.edgePreservingDecompositionUI;
|
||||
if (!pcvignette->get_active ()) filterPE.pcvignette = falsePE.pcvignette;
|
||||
|
@@ -44,10 +44,10 @@ ToneCurve::ToneCurve () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) );
|
||||
|
||||
sclip = Gtk::manage (new MySpinButton ());
|
||||
sclip->set_range (0.0, 0.9999);
|
||||
sclip->set_increments (0.001, 0.01);
|
||||
sclip->set_value (0.002);
|
||||
sclip->set_digits (4);
|
||||
sclip->set_range (0.0, 0.99);
|
||||
sclip->set_increments (0.01, 0.01);
|
||||
sclip->set_value (0.02);
|
||||
sclip->set_digits (2);
|
||||
sclip->set_tooltip_text (M("TP_EXPOSURE_CLIP_TIP"));
|
||||
sclip->signal_value_changed().connect( sigc::mem_fun(*this, &ToneCurve::clip_changed) );
|
||||
|
||||
@@ -64,16 +64,56 @@ ToneCurve::ToneCurve () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
abox->pack_end (*Gtk::manage (new Gtk::Label (M("TP_EXPOSURE_CLIP"))));
|
||||
pack_start (*abox);
|
||||
|
||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||
|
||||
//----------- Exposure Compensation ------------------------
|
||||
expcomp = Gtk::manage (new Adjuster (M("TP_EXPOSURE_EXPCOMP"), -5, 10, 0.05, 0));
|
||||
pack_start (*expcomp);
|
||||
hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0));
|
||||
pack_start (*hlcompr);
|
||||
hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 33));
|
||||
pack_start (*hlcomprthresh);
|
||||
pack_start (*Gtk::manage (new Gtk::Label (" "))); //spacer
|
||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||
|
||||
//--------------HLRecovery from HLREC and Hl compress
|
||||
hlrbox = Gtk::manage (new Gtk::HBox ());
|
||||
hlrbox->set_border_width (2);
|
||||
|
||||
Gtk::Label* hlrLabel = Gtk::manage (new Gtk::Label (M("TP_HLREC_LABEL")));
|
||||
|
||||
hrenabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLE")));
|
||||
|
||||
hrenabled->set_active (false);
|
||||
hrenabled->set_tooltip_markup (M("TP_HLREC_ENA_TOOLTIP"));
|
||||
hlrbox->pack_start (*hlrLabel,Gtk::PACK_SHRINK);
|
||||
|
||||
hlrbox->pack_end (*hrenabled, Gtk::PACK_SHRINK);
|
||||
hlrbox->pack_end (*Gtk::manage (new Gtk::Label (" "))); //spacer
|
||||
|
||||
pack_start (*hlrbox);
|
||||
|
||||
|
||||
method = Gtk::manage (new MyComboBoxText ());
|
||||
method->append_text (M("TP_HLREC_LUMINANCE"));
|
||||
method->append_text (M("TP_HLREC_CIELAB"));
|
||||
method->append_text (M("TP_HLREC_COLOR"));
|
||||
method->append_text (M("TP_HLREC_BLEND"));
|
||||
|
||||
method->set_active (0);
|
||||
Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ());
|
||||
Gtk::Label* lab = Gtk::manage (new Gtk::Label (M("TP_HLREC_METHOD")));
|
||||
hb->pack_start (*lab, Gtk::PACK_SHRINK, 4);
|
||||
hb->pack_start (*method);
|
||||
pack_start (*hb);
|
||||
|
||||
enaconn = hrenabled->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::hrenabledChanged) );
|
||||
methconn = method->signal_changed().connect ( sigc::mem_fun(*this, &ToneCurve::methodChanged) );
|
||||
pack_start (*Gtk::manage (new Gtk::Label (" "))); //spacer
|
||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||
|
||||
hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0));
|
||||
pack_start (*hlcompr);
|
||||
hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 33));
|
||||
pack_start (*hlcomprthresh);
|
||||
|
||||
|
||||
|
||||
//----------- Black Level ----------------------------------
|
||||
black = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 50, 0));
|
||||
pack_start (*black);
|
||||
@@ -202,8 +242,28 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||
if (!pedited->toneCurve.curveMode2) {
|
||||
toneCurveMode2->set_active(4);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (pedited)
|
||||
hrenabled->set_inconsistent (!pedited->toneCurve.hrenabled);
|
||||
enaconn.block (true);
|
||||
hrenabled->set_active (pp->toneCurve.hrenabled);
|
||||
enaconn.block (false);
|
||||
|
||||
if (pedited && !pedited->toneCurve.method)
|
||||
method->set_active (4);
|
||||
else if (pp->toneCurve.method=="Luminance")
|
||||
method->set_active (0);
|
||||
else if (pp->toneCurve.method=="CIELab blending")
|
||||
method->set_active (1);
|
||||
else if (pp->toneCurve.method=="Color")
|
||||
method->set_active (2);
|
||||
else if (pp->toneCurve.method=="Blend")
|
||||
method->set_active (3);
|
||||
|
||||
lasthrEnabled = pp->toneCurve.hrenabled;
|
||||
|
||||
autoconn.block (false);
|
||||
tcmode2conn.block(false);
|
||||
tcmodeconn.block(false);
|
||||
@@ -215,6 +275,22 @@ void ToneCurve::autoOpenCurve () {
|
||||
shape->openIfNonlinear();
|
||||
shape2->openIfNonlinear();
|
||||
}
|
||||
int HLChangedUI (void* data) {
|
||||
GThreadLock lock;
|
||||
(static_cast<ToneCurve*>(data))->HLComputed_ ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ToneCurve::HLChanged (bool hlrbool){
|
||||
nexthlrbool= hlrbool;
|
||||
g_idle_add (HLChangedUI, this);
|
||||
}
|
||||
bool ToneCurve::HLComputed_ () {
|
||||
enaconn.block (true);
|
||||
hrenabled->set_active (nexthlrbool);
|
||||
enaconn.block (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||
|
||||
@@ -260,8 +336,69 @@ void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||
pedited->toneCurve.curveMode = toneCurveMode->get_active_row_number() != 4;
|
||||
pedited->toneCurve.curveMode2 = toneCurveMode2->get_active_row_number() != 4;
|
||||
}
|
||||
if (pedited) {
|
||||
pedited->toneCurve.method = method->get_active_row_number()!=4;
|
||||
pedited->toneCurve.hrenabled = !hrenabled->get_inconsistent();
|
||||
}
|
||||
|
||||
pp->toneCurve.hrenabled = hrenabled->get_active();
|
||||
if (method->get_active_row_number()==0)
|
||||
pp->toneCurve.method = "Luminance";
|
||||
else if (method->get_active_row_number()==1)
|
||||
pp->toneCurve.method = "CIELab blending";
|
||||
else if (method->get_active_row_number()==2)
|
||||
pp->toneCurve.method = "Color";
|
||||
else if (method->get_active_row_number()==3)
|
||||
pp->toneCurve.method = "Blend";
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ToneCurve::hrenabledChanged () {
|
||||
|
||||
if (batchMode) {
|
||||
if (hrenabled->get_inconsistent()) {
|
||||
hrenabled->set_inconsistent (false);
|
||||
enaconn.block (true);
|
||||
hrenabled->set_active (false);
|
||||
enaconn.block (false);
|
||||
}
|
||||
else if (lasthrEnabled)
|
||||
hrenabled->set_inconsistent (true);
|
||||
|
||||
lasthrEnabled = hrenabled->get_active ();
|
||||
}
|
||||
|
||||
if (listener) {
|
||||
if (hrenabled->get_active ()){
|
||||
listener->panelChanged (EvHREnabled, M("GENERAL_ENABLED"));
|
||||
}
|
||||
else { // Switch off auto exposure if user changes enabled manually
|
||||
if (autolevels->get_active() ) {
|
||||
autoconn.block(true);
|
||||
autolevels->set_active (false);
|
||||
autoconn.block(false);
|
||||
autolevels->set_inconsistent (false);
|
||||
}
|
||||
listener->panelChanged (EvHREnabled, M("GENERAL_DISABLED"));}
|
||||
}
|
||||
}
|
||||
void ToneCurve::methodChanged () {
|
||||
|
||||
if (listener) {
|
||||
if (hrenabled->get_active ())
|
||||
listener->panelChanged (EvHRMethod, method->get_active_text ());
|
||||
}
|
||||
}
|
||||
void ToneCurve::setRaw (bool raw) {
|
||||
|
||||
disableListener ();
|
||||
method->set_sensitive (raw);
|
||||
hrenabled->set_sensitive (raw);
|
||||
enableListener ();
|
||||
}
|
||||
|
||||
|
||||
void ToneCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) {
|
||||
|
||||
expcomp->setDefault (defParams->toneCurve.expcomp);
|
||||
@@ -365,7 +502,7 @@ void ToneCurve::adjusterChanged (Adjuster* a, double newval) {
|
||||
}
|
||||
|
||||
void ToneCurve::neutral_pressed () {
|
||||
// This method deselects auto levels
|
||||
// This method deselects auto levels and HL reconstruction auto
|
||||
// and sets neutral values to params in exposure panel
|
||||
|
||||
if (batchMode) {
|
||||
@@ -387,6 +524,7 @@ void ToneCurve::neutral_pressed () {
|
||||
brightness->setValue(0);
|
||||
black->setValue(0);
|
||||
shcompr->setValue(50);
|
||||
hrenabled->set_active (false);
|
||||
if (!black->getAddMode()) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect
|
||||
contrast->setValue(0);
|
||||
//saturation->setValue(0);
|
||||
@@ -425,6 +563,7 @@ void ToneCurve::autolevels_toggled () {
|
||||
hlcompr->setValue (0);
|
||||
if (hlcomprthresh->getAddMode())
|
||||
hlcomprthresh->setValue (0);
|
||||
|
||||
if (listener) {
|
||||
if (!autolevels->get_inconsistent()) {
|
||||
if (autolevels->get_active ())
|
||||
@@ -529,6 +668,11 @@ bool ToneCurve::autoExpComputed_ () {
|
||||
}
|
||||
|
||||
void ToneCurve::setBatchMode (bool batchMode) {
|
||||
//from HLrecovery
|
||||
ToolPanel::setBatchMode (batchMode);
|
||||
method->append_text (M("GENERAL_UNCHANGED"));
|
||||
//---------------
|
||||
|
||||
|
||||
removeIfThere (abox, autolevels, false);
|
||||
autolevels = Gtk::manage (new Gtk::CheckButton (M("TP_EXPOSURE_AUTOLEVELS")));
|
||||
|
@@ -27,10 +27,20 @@
|
||||
#include "mycurve.h"
|
||||
#include "guiutils.h"
|
||||
|
||||
class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public rtengine::AutoExpListener, public CurveListener {
|
||||
class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public rtengine::AutoExpListener, public rtengine::AutoHLListener,public CurveListener {
|
||||
|
||||
protected:
|
||||
// from HLRecovery
|
||||
Gtk::CheckButton* hrenabled;
|
||||
MyComboBoxText* method;
|
||||
sigc::connection methconn;
|
||||
sigc::connection enaconn;
|
||||
bool lasthrEnabled;
|
||||
bool nexthlrbool;
|
||||
|
||||
Gtk::HBox* abox;
|
||||
Gtk::HBox* hlrbox;
|
||||
|
||||
Gtk::ToggleButton* autolevels;
|
||||
MySpinButton* sclip;
|
||||
Gtk::Button* neutral;
|
||||
@@ -45,7 +55,6 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool
|
||||
MyComboBoxText* toneCurveMode;
|
||||
MyComboBoxText* toneCurveMode2;
|
||||
|
||||
|
||||
bool clipDirty, lastAuto;
|
||||
sigc::connection autoconn, neutralconn, tcmodeconn, tcmode2conn;
|
||||
CurveEditorGroup* curveEditorG;
|
||||
@@ -60,6 +69,9 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool
|
||||
int nextBlack;
|
||||
int nextHlcompr;
|
||||
int nextHlcomprthresh;
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@@ -92,6 +104,16 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool
|
||||
void expandCurve (bool isExpanded);
|
||||
bool isCurveExpanded ();
|
||||
void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, LUTu & histCLurve, LUTu & histLLCurve, LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma);
|
||||
};
|
||||
|
||||
//from HLrecovery
|
||||
void setRaw (bool raw);
|
||||
void HLChanged (bool hlrbool);
|
||||
bool HLComputed_ ();
|
||||
|
||||
void hrenabledChanged ();
|
||||
void methodChanged ();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -63,7 +63,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) {
|
||||
pcvignette = Gtk::manage (new PCVignette ());
|
||||
perspective = Gtk::manage (new PerspCorrection ());
|
||||
cacorrection = Gtk::manage (new CACorrection ());
|
||||
hlrecovery = Gtk::manage (new HLRecovery ());
|
||||
// hlrecovery = Gtk::manage (new HLRecovery ());
|
||||
chmixer = Gtk::manage (new ChMixer ());
|
||||
blackwhite = Gtk::manage (new BlackWhite ());
|
||||
resize = Gtk::manage (new Resize ());
|
||||
@@ -82,7 +82,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) {
|
||||
|
||||
addPanel (colorPanel, whitebalance, M("TP_WBALANCE_LABEL")); toolPanels.push_back (whitebalance);
|
||||
addPanel (exposurePanel, toneCurve, M("TP_EXPOSURE_LABEL")); toolPanels.push_back (toneCurve);
|
||||
addPanel (exposurePanel, hlrecovery, M("TP_HLREC_LABEL")); toolPanels.push_back (hlrecovery);
|
||||
// addPanel (exposurePanel, hlrecovery, M("TP_HLREC_LABEL")); toolPanels.push_back (hlrecovery);
|
||||
addPanel (colorPanel, vibrance, M("TP_VIBRANCE_LABEL")); toolPanels.push_back (vibrance);
|
||||
addPanel (colorPanel, chmixer, M("TP_CHMIXER_LABEL")); toolPanels.push_back (chmixer);
|
||||
addPanel (colorPanel, blackwhite, M("TP_BWMIX_LABEL")); toolPanels.push_back (blackwhite);
|
||||
@@ -365,6 +365,7 @@ void ToolPanelCoordinator::initImage (rtengine::StagedImageProcessor* ipc_, bool
|
||||
ipc->setAutoExpListener (toneCurve);
|
||||
ipc->setAutoCamListener (colorappearance);
|
||||
ipc->setAutoBWListener (blackwhite);
|
||||
ipc->setAutoHLListener (toneCurve);
|
||||
|
||||
ipc->setSizeListener (crop);
|
||||
ipc->setSizeListener (resize);
|
||||
@@ -374,7 +375,7 @@ void ToolPanelCoordinator::initImage (rtengine::StagedImageProcessor* ipc_, bool
|
||||
icm->setRawMeta (raw, (const rtengine::ImageData*)pMetaData);
|
||||
lensProf->setRawMeta (raw, pMetaData);
|
||||
|
||||
hlrecovery->setRaw (raw);
|
||||
toneCurve->setRaw (raw);
|
||||
hasChanged = true;
|
||||
}
|
||||
|
||||
|
@@ -45,7 +45,7 @@
|
||||
#include "resize.h"
|
||||
#include "chmixer.h"
|
||||
#include "blackwhite.h"
|
||||
#include "hlrec.h"
|
||||
//#include "hlrec.h"
|
||||
#include "cacorrection.h"
|
||||
#include "lensprofile.h"
|
||||
#include "distortion.h"
|
||||
@@ -97,7 +97,7 @@ class ToolPanelCoordinator : public ToolPanelListener,
|
||||
Distortion* distortion;
|
||||
PerspCorrection* perspective;
|
||||
CACorrection* cacorrection;
|
||||
HLRecovery* hlrecovery;
|
||||
// HLRecovery* hlrecovery;
|
||||
ColorAppearance* colorappearance;
|
||||
Vibrance* vibrance;
|
||||
ChMixer* chmixer;
|
||||
|
Reference in New Issue
Block a user