Added method Illuminant to make choices easier in free mode

This commit is contained in:
Desmis 2020-03-04 16:31:49 +01:00
parent a356306728
commit 05f365c0d6
7 changed files with 133 additions and 1 deletions

View File

@ -760,6 +760,7 @@ HISTORY_MSG_ICM_OUTPUT_TYPE;Output - Type
HISTORY_MSG_ICM_WORKING_GAMMA;Working - Gamma
HISTORY_MSG_ICM_WORKING_SLOPE;Working - Slope
HISTORY_MSG_ICM_WORKING_TRC_METHOD;Working - TRC method
HISTORY_MSG_ILLUM;Illuminant
HISTORY_MSG_LOCALCONTRAST_AMOUNT;Local Contrast - Amount
HISTORY_MSG_LOCALCONTRAST_DARKNESS;Local Contrast - Darkness
HISTORY_MSG_LOCALCONTRAST_ENABLED;Local Contrast
@ -1438,6 +1439,15 @@ TP_COLORAPP_GAMUT;Gamut control (L*a*b*)
TP_COLORAPP_GAMUT_TOOLTIP;Allow gamut control in L*a*b* mode.
TP_COLORAPP_HUE;Hue (h)
TP_COLORAPP_HUE_TOOLTIP;Hue (h) - angle between 0° and 360°.
TP_COLORAPP_ILLUM;Illuminant
TP_COLORAPP_ILLUM_TOOLTIP;Select the illuminant closest to the shooting conditions.\nIn general D50, but it can change depending on the time and lattitude.
TP_COLORAPP_ILA;Incandescent A
TP_COLORAPP_IL50;D50
TP_COLORAPP_IL55;D55
TP_COLORAPP_IL60;D60
TP_COLORAPP_IL65;D65
TP_COLORAPP_IL75;D75
TP_COLORAPP_ILFREE;Free
TP_COLORAPP_LABEL;CIE Color Appearance Model 2002
TP_COLORAPP_LABEL_CAM02;Image Adjustments
TP_COLORAPP_LABEL_SCENE;Scene Conditions

View File

@ -1374,6 +1374,7 @@ ColorAppearanceParams::ColorAppearanceParams() :
adaplum(16),
badpixsl(0),
wbmodel("RawT"),
illum("i50"),
algo("No"),
contrast(0.0),
qcontrast(0.0),
@ -1392,7 +1393,7 @@ ColorAppearanceParams::ColorAppearanceParams() :
autotempout(true),
ybout(18),
greenout(1.0),
tempsc(5000),
tempsc(5003),
greensc(1.0),
presetcat02(false)
{
@ -1421,6 +1422,7 @@ bool ColorAppearanceParams::operator ==(const ColorAppearanceParams& other) cons
&& adaplum == other.adaplum
&& badpixsl == other.badpixsl
&& wbmodel == other.wbmodel
&& illum == other.illum
&& algo == other.algo
&& contrast == other.contrast
&& qcontrast == other.qcontrast
@ -3214,6 +3216,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->colorappearance.adaplum, "Color appearance", "AdaptLum", colorappearance.adaplum, keyFile);
saveToKeyfile(!pedited || pedited->colorappearance.badpixsl, "Color appearance", "Badpixsl", colorappearance.badpixsl, keyFile);
saveToKeyfile(!pedited || pedited->colorappearance.wbmodel, "Color appearance", "Model", colorappearance.wbmodel, keyFile);
saveToKeyfile(!pedited || pedited->colorappearance.illum, "Color appearance", "Illum", colorappearance.illum, keyFile);
saveToKeyfile(!pedited || pedited->colorappearance.algo, "Color appearance", "Algorithm", colorappearance.algo, keyFile);
saveToKeyfile(!pedited || pedited->colorappearance.jlight, "Color appearance", "J-Light", colorappearance.jlight, keyFile);
saveToKeyfile(!pedited || pedited->colorappearance.qbright, "Color appearance", "Q-Bright", colorappearance.qbright, keyFile);
@ -4208,6 +4211,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Color appearance", "AdaptLum", pedited, colorappearance.adaplum, pedited->colorappearance.adaplum);
assignFromKeyfile(keyFile, "Color appearance", "Badpixsl", pedited, colorappearance.badpixsl, pedited->colorappearance.badpixsl);
assignFromKeyfile(keyFile, "Color appearance", "Model", pedited, colorappearance.wbmodel, pedited->colorappearance.wbmodel);
assignFromKeyfile(keyFile, "Color appearance", "Illum", pedited, colorappearance.illum, pedited->colorappearance.illum);
assignFromKeyfile(keyFile, "Color appearance", "Algorithm", pedited, colorappearance.algo, pedited->colorappearance.algo);
assignFromKeyfile(keyFile, "Color appearance", "J-Light", pedited, colorappearance.jlight, pedited->colorappearance.jlight);
assignFromKeyfile(keyFile, "Color appearance", "Q-Bright", pedited, colorappearance.qbright, pedited->colorappearance.qbright);

View File

@ -661,6 +661,7 @@ struct ColorAppearanceParams {
double adaplum;
int badpixsl;
Glib::ustring wbmodel;
Glib::ustring illum;
Glib::ustring algo;
double contrast;
double qcontrast;

View File

@ -221,6 +221,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
auto m = ProcEventMapper::getInstance();
Evcatpreset = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CAT02PRESET");
EvCATAutotempout = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_TEMPOUT");
EvCATillum = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ILLUM");
//preset button cat02
presetcat02 = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_PRESETCAT02")));
presetcat02->set_tooltip_markup (M("TP_COLORAPP_PRESETCAT02_TIP"));
@ -285,6 +286,25 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
wbmHBox->pack_start (*wbmodel);
p1VBox->pack_start (*wbmHBox);
Gtk::HBox* illumHBox = Gtk::manage (new Gtk::HBox ());
illumHBox->set_spacing (2);
illumHBox->set_tooltip_markup (M ("TP_COLORAPP_ILLUM_TOOLTIP"));
Gtk::Label* illumLab = Gtk::manage (new Gtk::Label (M ("TP_COLORAPP_ILLUM") + ":"));
illumHBox->pack_start (*illumLab, Gtk::PACK_SHRINK);
illum = Gtk::manage (new MyComboBoxText ());
illum->append (M ("TP_COLORAPP_ILA"));
illum->append (M ("TP_COLORAPP_IL50"));
illum->append (M ("TP_COLORAPP_IL55"));
illum->append (M ("TP_COLORAPP_IL60"));
illum->append (M ("TP_COLORAPP_IL65"));
illum->append (M ("TP_COLORAPP_IL75"));
illum->append (M ("TP_COLORAPP_ILFREE"));
illum->set_active (0);
illumHBox->pack_start (*illum);
p1VBox->pack_start (*illumHBox);
Gtk::Image* itempL = Gtk::manage (new RTImage ("circle-blue-small.png"));
Gtk::Image* itempR = Gtk::manage (new RTImage ("circle-yellow-small.png"));
Gtk::Image* igreenL = Gtk::manage (new RTImage ("circle-magenta-small.png"));
@ -701,6 +721,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
// surrconn = surrsource->signal_toggled().connect ( sigc::mem_fun (*this, &ColorAppearance::surrsource_toggled) );
wbmodelconn = wbmodel->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::wbmodelChanged) );
illumconn = illum->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::illumChanged) );
algoconn = algo->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::algoChanged) );
surroundconn = surround->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::surroundChanged) );
surrsrcconn = surrsrc->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::surrsrcChanged) );
@ -777,6 +798,7 @@ void ColorAppearance::neutral_pressed ()
greensc->resetValue (false);
badpixsl->resetValue (false);
wbmodel->set_active (0);
illum->set_active (1);
toneCurveMode->set_active (0);
toneCurveMode2->set_active (0);
toneCurveMode3->set_active (0);
@ -938,6 +960,30 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
// Have to be manually called to handle initial state update
wbmodelChanged();
illumconn.block (true);
if (pedited && !pedited->colorappearance.illum) {
illum->set_active (7);
} else if (pp->colorappearance.illum == "iA") {
illum->set_active (0);
} else if (pp->colorappearance.illum == "i50") {
illum->set_active (1);
} else if (pp->colorappearance.illum == "i55") {
illum->set_active (2);
} else if (pp->colorappearance.illum == "i60") {
illum->set_active (3);
} else if (pp->colorappearance.illum == "i65") {
illum->set_active (4);
} else if (pp->colorappearance.illum == "i75") {
illum->set_active (5);
} else if (pp->colorappearance.illum == "ifree") {
illum->set_active (6);
}
illumconn.block (false);
// Have to be manually called to handle initial state update
illumChanged();
algoconn.block (true);
if (pedited && !pedited->colorappearance.algo) {
@ -1123,6 +1169,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
pedited->colorappearance.surround = surround->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->colorappearance.surrsrc = surrsrc->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->colorappearance.wbmodel = wbmodel->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->colorappearance.illum = illum->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->colorappearance.algo = algo->get_active_text() != M ("GENERAL_UNCHANGED");
// pedited->colorappearance.surrsource = !surrsource->get_inconsistent();
pedited->colorappearance.gamut = !gamut->get_inconsistent();
@ -1173,7 +1220,22 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
pp->colorappearance.wbmodel = "RawTCAT02";
} else if (wbmodel->get_active_row_number() == 2) {
pp->colorappearance.wbmodel = "free";
}
if (illum->get_active_row_number() == 0) {
pp->colorappearance.illum = "iA";
} else if (illum->get_active_row_number() == 1) {
pp->colorappearance.illum = "i50";
} else if (illum->get_active_row_number() == 2) {
pp->colorappearance.illum = "i55";
} else if (illum->get_active_row_number() == 3) {
pp->colorappearance.illum = "i60";
} else if (illum->get_active_row_number() == 4) {
pp->colorappearance.illum = "i65";
} else if (illum->get_active_row_number() == 5) {
pp->colorappearance.illum = "i75";
} else if (illum->get_active_row_number() == 6) {
pp->colorappearance.illum = "ifree";
}
if (algo->get_active_row_number() == 0) {
@ -1358,6 +1420,7 @@ void ColorAppearance::presetcat02pressed ()
greensc->resetValue (false);
badpixsl->resetValue (false);
wbmodel->set_active (0);
illum->set_active (1);
toneCurveMode->set_active (0);
toneCurveMode2->set_active (0);
toneCurveMode3->set_active (0);
@ -1427,6 +1490,7 @@ void ColorAppearance::presetcat02pressed ()
ybscen->setAutoValue (true);
surrsrc->set_active (0);
wbmodel->set_active (0);
illum->set_active (1);
tempsc->resetValue (false);
greensc->resetValue (false);
adapscen->resetValue (false);
@ -1884,13 +1948,17 @@ void ColorAppearance::surroundChanged ()
void ColorAppearance::wbmodelChanged ()
{
if (wbmodel->get_active_row_number() == 0 || wbmodel->get_active_row_number() == 1) {
illum->hide();
tempsc->hide();
greensc->hide();
tempsc->setValue (5003);
greensc->setValue (1);
}
if (wbmodel->get_active_row_number() == 2) {
tempsc->show();
greensc->show();
illum->show();
}
if (listener && (multiImage || getEnabled()) ) {
@ -1898,6 +1966,43 @@ void ColorAppearance::wbmodelChanged ()
}
}
void ColorAppearance::illumChanged ()
{
if (illum->get_active_row_number() == 0) {
tempsc->setValue (2856);
tempsc->set_sensitive(false);
greensc->set_sensitive(false);
} else if (illum->get_active_row_number() == 1) {
tempsc->setValue (5003);
tempsc->set_sensitive(false);
greensc->set_sensitive(false);
} else if (illum->get_active_row_number() == 2) {
tempsc->setValue (5503);
tempsc->set_sensitive(false);
greensc->set_sensitive(false);
} else if (illum->get_active_row_number() == 3) {
tempsc->setValue (6000);
tempsc->set_sensitive(false);
greensc->set_sensitive(false);
} else if (illum->get_active_row_number() == 4) {
tempsc->setValue (6504);
tempsc->set_sensitive(false);
greensc->set_sensitive(false);
} else if (illum->get_active_row_number() == 5) {
tempsc->setValue (7504);
tempsc->set_sensitive(false);
greensc->set_sensitive(false);
} else if (illum->get_active_row_number() == 6) {
tempsc->set_sensitive(true);
greensc->set_sensitive(true);
}
if (listener && (multiImage || getEnabled()) ) {
listener->panelChanged (EvCATillum, illum->get_active_text ());
}
}
void ColorAppearance::algoChanged ()
{
@ -2000,6 +2105,7 @@ void ColorAppearance::setBatchMode (bool batchMode)
surround->append (M ("GENERAL_UNCHANGED"));
surrsrc->append (M ("GENERAL_UNCHANGED"));
wbmodel->append (M ("GENERAL_UNCHANGED"));
illum->append (M ("GENERAL_UNCHANGED"));
algo->append (M ("GENERAL_UNCHANGED"));
toneCurveMode->append (M ("GENERAL_UNCHANGED"));
toneCurveMode2->append (M ("GENERAL_UNCHANGED"));

View File

@ -53,6 +53,7 @@ public:
void surroundChanged ();
void surrsrcChanged ();
void wbmodelChanged ();
void illumChanged ();
void algoChanged ();
void surrsource_toggled ();
void gamut_toggled ();
@ -102,6 +103,7 @@ public:
private:
rtengine::ProcEvent Evcatpreset;
rtengine::ProcEvent EvCATAutotempout;
rtengine::ProcEvent EvCATillum;
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);
void foldAllButMe (GdkEventButton* event, MyExpander *expander);
@ -156,6 +158,8 @@ private:
sigc::connection surroundconn;
MyComboBoxText* wbmodel;
sigc::connection wbmodelconn;
MyComboBoxText* illum;
sigc::connection illumconn;
MyComboBoxText* algo;
sigc::connection algoconn;
sigc::connection surrconn;

View File

@ -219,6 +219,7 @@ void ParamsEdited::set(bool v)
colorappearance.adaplum = v;
colorappearance.badpixsl = v;
colorappearance.wbmodel = v;
colorappearance.illum = v;
colorappearance.algo = v;
colorappearance.jlight = v;
@ -812,6 +813,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
colorappearance.adaplum = colorappearance.adaplum && p.colorappearance.adaplum == other.colorappearance.adaplum;
colorappearance.badpixsl = colorappearance.badpixsl && p.colorappearance.badpixsl == other.colorappearance.badpixsl;
colorappearance.wbmodel = colorappearance.wbmodel && p.colorappearance.wbmodel == other.colorappearance.wbmodel;
colorappearance.illum = colorappearance.illum && p.colorappearance.illum == other.colorappearance.illum;
colorappearance.algo = colorappearance.algo && p.colorappearance.algo == other.colorappearance.algo;
colorappearance.jlight = colorappearance.jlight && p.colorappearance.jlight == other.colorappearance.jlight;
colorappearance.qbright = colorappearance.qbright && p.colorappearance.qbright == other.colorappearance.qbright;
@ -2010,6 +2012,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.colorappearance.wbmodel = mods.colorappearance.wbmodel;
}
if (colorappearance.illum) {
toEdit.colorappearance.illum = mods.colorappearance.illum;
}
if (colorappearance.algo) {
toEdit.colorappearance.algo = mods.colorappearance.algo;
}

View File

@ -275,6 +275,7 @@ struct ColorAppearanceParamsEdited {
bool ybscen;
bool badpixsl;
bool wbmodel;
bool illum;
bool algo;
bool jlight;
bool qbright;