Improvement histogram curves CIECAM see issue1640
This commit is contained in:
@@ -263,9 +263,25 @@ ColorAppearance::ColorAppearance () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
p2VBox->pack_start( *curveEditorG, Gtk::PACK_SHRINK, 2);
|
||||
p2VBox->pack_start( *curveEditorG2, Gtk::PACK_SHRINK, 2);
|
||||
p2VBox->pack_start( *curveEditorG3, Gtk::PACK_SHRINK, 2);
|
||||
|
||||
// ------------------------ Choice CIECAM data
|
||||
|
||||
|
||||
datacie = Gtk::manage (new Gtk::CheckButton (M("TP_COLORAPP_DATACIE")));
|
||||
datacie->set_tooltip_markup (M("TP_COLORAPP_DATACIE_TOOLTIP"));
|
||||
datacieconn = datacie->signal_toggled().connect( sigc::mem_fun(*this, &ColorAppearance::datacie_toggled) );
|
||||
p2VBox->pack_start (*datacie);
|
||||
|
||||
//-------------------------
|
||||
|
||||
|
||||
|
||||
p2Frame->add(*p2VBox);
|
||||
|
||||
|
||||
pack_start (*p2Frame, Gtk::PACK_EXPAND_WIDGET, 4);
|
||||
|
||||
|
||||
|
||||
// ------------------------ Process #3: Converting back to Lab/RGB
|
||||
|
||||
@@ -387,6 +403,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||
colorh->setEditedState (pedited->colorappearance.colorh ? Edited : UnEdited);
|
||||
surrsource->set_inconsistent (!pedited->colorappearance.surrsource);
|
||||
gamut->set_inconsistent (!pedited->colorappearance.gamut);
|
||||
datacie->set_inconsistent (!pedited->colorappearance.datacie);
|
||||
|
||||
degree->setAutoInconsistent (multiImage && !pedited->colorappearance.autodegree);
|
||||
enabled->set_inconsistent (multiImage && !pedited->colorappearance.enabled);
|
||||
@@ -457,9 +474,13 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||
gamutconn.block (true);
|
||||
gamut->set_active (pp->colorappearance.gamut);
|
||||
gamutconn.block (false);
|
||||
datacieconn.block (true);
|
||||
datacie->set_active (pp->colorappearance.datacie);
|
||||
datacieconn.block (false);
|
||||
|
||||
lastsurr=pp->colorappearance.surrsource;
|
||||
lastgamut=pp->colorappearance.gamut;
|
||||
lastdatacie=pp->colorappearance.datacie;
|
||||
|
||||
lastEnabled = pp->colorappearance.enabled;
|
||||
lastAutoDegree = pp->colorappearance.autodegree;
|
||||
@@ -509,6 +530,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||
pp->colorappearance.rstprotection = rstprotection->getValue ();
|
||||
pp->colorappearance.surrsource = surrsource->get_active();
|
||||
pp->colorappearance.gamut = gamut->get_active();
|
||||
pp->colorappearance.datacie = datacie->get_active();
|
||||
pp->colorappearance.curve = shape->getCurve ();
|
||||
pp->colorappearance.curve2 = shape2->getCurve ();
|
||||
pp->colorappearance.curve3 = shape3->getCurve ();
|
||||
@@ -546,6 +568,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||
pedited->colorappearance.algo = algo->get_active_text()!=M("GENERAL_UNCHANGED");
|
||||
pedited->colorappearance.surrsource = !surrsource->get_inconsistent();
|
||||
pedited->colorappearance.gamut = !gamut->get_inconsistent();
|
||||
pedited->colorappearance.datacie = !datacie->get_inconsistent();
|
||||
pedited->colorappearance.curve = !shape->isUnChanged ();
|
||||
pedited->colorappearance.curve2 = !shape2->isUnChanged ();
|
||||
pedited->colorappearance.curve3 = !shape3->isUnChanged ();
|
||||
@@ -668,6 +691,28 @@ void ColorAppearance::gamut_toggled () {
|
||||
listener->panelChanged (EvCATgamut, M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
void ColorAppearance::datacie_toggled () {
|
||||
|
||||
if (batchMode) {
|
||||
if (datacie->get_inconsistent()) {
|
||||
datacie->set_inconsistent (false);
|
||||
datacieconn.block (true);
|
||||
datacie->set_active (false);
|
||||
datacieconn.block (false);
|
||||
}
|
||||
else if (lastdatacie)
|
||||
datacie->set_inconsistent (true);
|
||||
|
||||
lastdatacie = datacie->get_active ();
|
||||
}
|
||||
|
||||
if (listener) {
|
||||
if (datacie->get_active ())
|
||||
listener->panelChanged (EvCATdatacie, M("GENERAL_ENABLED"));
|
||||
else
|
||||
listener->panelChanged (EvCATdatacie, M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ColorAppearance::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) {
|
||||
|
||||
@@ -55,6 +55,7 @@ class ColorAppearance : public Gtk::VBox, public AdjusterListener, public Foldab
|
||||
//Adjuster* edge;
|
||||
Gtk::CheckButton* surrsource;
|
||||
Gtk::CheckButton* gamut;
|
||||
Gtk::CheckButton* datacie;
|
||||
|
||||
Gtk::CheckButton* enabled;
|
||||
MyComboBoxText* surround;
|
||||
@@ -64,7 +65,7 @@ class ColorAppearance : public Gtk::VBox, public AdjusterListener, public Foldab
|
||||
MyComboBoxText* algo;
|
||||
sigc::connection algoconn;
|
||||
sigc::connection surrconn;
|
||||
sigc::connection gamutconn;
|
||||
sigc::connection gamutconn, datacieconn;
|
||||
sigc::connection tcmodeconn, tcmode2conn, tcmode3conn;
|
||||
CurveEditorGroup* curveEditorG;
|
||||
CurveEditorGroup* curveEditorG2;
|
||||
@@ -79,6 +80,7 @@ class ColorAppearance : public Gtk::VBox, public AdjusterListener, public Foldab
|
||||
sigc::connection enaConn;
|
||||
bool lastsurr;
|
||||
bool lastgamut;
|
||||
bool lastdatacie;
|
||||
bool bgTTipQuery(int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Gtk::Tooltip>& tooltip);
|
||||
bool srTTipQuery(int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Gtk::Tooltip>& tooltip);
|
||||
|
||||
@@ -100,6 +102,8 @@ class ColorAppearance : public Gtk::VBox, public AdjusterListener, public Foldab
|
||||
void algoChanged ();
|
||||
void surrsource_toggled ();
|
||||
void gamut_toggled ();
|
||||
void datacie_toggled ();
|
||||
|
||||
void curveChanged (CurveEditor* ce);
|
||||
void curveMode1Changed ();
|
||||
bool curveMode1Changed_ ();
|
||||
|
||||
@@ -103,7 +103,8 @@ HistogramPanel::HistogramPanel () {
|
||||
showGreen->set_active (true);
|
||||
showBlue->set_active (true);
|
||||
showValue->set_active (true);
|
||||
showChro->set_active (true);
|
||||
showChro->set_active (false);//unactive by default
|
||||
|
||||
showRAW->set_active (false);
|
||||
showFull->set_active (!options.histogramFullMode);
|
||||
showBAR->set_active (options.histogramBar);
|
||||
@@ -311,8 +312,8 @@ void HistogramPanel::toggle_button_full () {
|
||||
//
|
||||
//
|
||||
// HistogramRGBArea
|
||||
HistogramRGBArea::HistogramRGBArea () :
|
||||
frozen(false), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(true), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(true){
|
||||
HistogramRGBArea::HistogramRGBArea () ://needChroma unactive by default
|
||||
frozen(false), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(true), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(false){
|
||||
|
||||
harih = new HistogramRGBAreaIdleHelper;
|
||||
harih->harea = this;
|
||||
@@ -546,8 +547,8 @@ void HistogramRGBArea::styleChanged (const Glib::RefPtr<Gtk::Style>& style) {
|
||||
//
|
||||
//
|
||||
// HistogramArea
|
||||
HistogramArea::HistogramArea (FullModeListener *fml) :
|
||||
valid(false), fullMode(options.histogramFullMode), myFullModeListener(fml), oldwidth(-1), needLuma(true), needRed(true), needGreen(true), needBlue(true), rawMode(false), needChroma(true) {
|
||||
HistogramArea::HistogramArea (FullModeListener *fml) : //needChroma unactive by default
|
||||
valid(false), fullMode(options.histogramFullMode), myFullModeListener(fml), oldwidth(-1), needLuma(true), needRed(true), needGreen(true), needBlue(true), rawMode(false), needChroma(false) {
|
||||
|
||||
lhist(256);
|
||||
rhist(256);
|
||||
@@ -697,9 +698,9 @@ void HistogramArea::renderHistogram () {
|
||||
}
|
||||
if (needChroma && !rawMode) {
|
||||
drawCurve(cr, chist, realhistheight, winw, winh);
|
||||
cr->set_source_rgb (1.0, 1.0, 1.0);
|
||||
cr->fill_preserve ();
|
||||
cr->set_source_rgb (0.2, 0.2, 0.1);
|
||||
cr->set_source_rgb (0.6, 0.6, 0.6);
|
||||
// cr->fill_preserve ();
|
||||
// cr->set_source_rgb (0.2, 0.2, 0.1);
|
||||
cr->stroke ();
|
||||
|
||||
drawMarks(cr, lhist, realhistheight, winw, ui, oi);
|
||||
|
||||
@@ -112,6 +112,7 @@ void ParamsEdited::set (bool v) {
|
||||
colorappearance.rstprotection = v;
|
||||
colorappearance.surrsource = v;
|
||||
colorappearance.gamut = v;
|
||||
colorappearance.datacie = v;
|
||||
colorappearance.curve = v;
|
||||
colorappearance.curve2 = v;
|
||||
colorappearance.curve3 = v;
|
||||
@@ -341,6 +342,7 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
colorappearance.colorh = colorappearance.colorh && p.colorappearance.colorh == other.colorappearance.colorh;
|
||||
colorappearance.surrsource = colorappearance.surrsource && p.colorappearance.surrsource == other.colorappearance.surrsource;
|
||||
colorappearance.gamut = colorappearance.gamut && p.colorappearance.gamut == other.colorappearance.gamut;
|
||||
colorappearance.datacie = colorappearance.datacie && p.colorappearance.datacie == other.colorappearance.datacie;
|
||||
colorappearance.curve = colorappearance.curve && p.colorappearance.curve == other.colorappearance.curve;
|
||||
colorappearance.curve3 = colorappearance.curve3 && p.colorappearance.curve3 == other.colorappearance.curve3;
|
||||
colorappearance.curve2 = colorappearance.curve2 && p.colorappearance.curve2 == other.colorappearance.curve2;
|
||||
@@ -606,6 +608,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
if (colorappearance.rstprotection) toEdit.colorappearance.rstprotection= dontforceSet && options.baBehav[ADDSET_CAT_RSTPRO] ? toEdit.colorappearance.rstprotection + mods.colorappearance.rstprotection : mods.colorappearance.rstprotection;
|
||||
if (colorappearance.surrsource) toEdit.colorappearance.surrsource = mods.colorappearance.surrsource;
|
||||
if (colorappearance.gamut) toEdit.colorappearance.gamut = mods.colorappearance.gamut;
|
||||
if (colorappearance.datacie) toEdit.colorappearance.datacie = mods.colorappearance.datacie;
|
||||
if (impulseDenoise.enabled) toEdit.impulseDenoise.enabled = mods.impulseDenoise.enabled;
|
||||
if (impulseDenoise.thresh) toEdit.impulseDenoise.thresh = mods.impulseDenoise.thresh;
|
||||
|
||||
|
||||
@@ -209,6 +209,8 @@ public:
|
||||
bool rstprotection;
|
||||
bool surrsource;
|
||||
bool gamut;
|
||||
bool datacie;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user