Merge with "Beep6581/dev"
This commit is contained in:
@@ -44,6 +44,8 @@
|
||||
using namespace rtengine;
|
||||
using namespace rtengine::procparams;
|
||||
|
||||
const Glib::ustring ColorAppearance::TOOL_NAME = "colorappearance";
|
||||
|
||||
static double wbSlider2Temp (double sval)
|
||||
{
|
||||
|
||||
@@ -212,7 +214,7 @@ static double wbTemp2Slider (double temp)
|
||||
}
|
||||
|
||||
|
||||
ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance", M ("TP_COLORAPP_LABEL"), false, true)
|
||||
ColorAppearance::ColorAppearance () : FoldableToolPanel (this, TOOL_NAME, M ("TP_COLORAPP_LABEL"), false, true)
|
||||
{
|
||||
CurveListener::setMulti (true);
|
||||
std::vector<GradientMilestone> milestones;
|
||||
@@ -220,7 +222,6 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
|
||||
milestones.push_back ( GradientMilestone (1., 1., 1., 1.) );
|
||||
|
||||
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");
|
||||
EvCATcomplex = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CATCOMPLEX");
|
||||
@@ -269,10 +270,6 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
|
||||
catHBox->pack_start(*catmethod);
|
||||
genVBox->pack_start (*catHBox, Gtk::PACK_SHRINK);
|
||||
|
||||
presetcat02 = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_PRESETCAT02")));
|
||||
presetcat02->set_tooltip_markup (M("TP_COLORAPP_PRESETCAT02_TOOLTIP"));
|
||||
presetcat02conn = presetcat02->signal_toggled().connect( sigc::mem_fun(*this, &ColorAppearance::presetcat02pressed));
|
||||
// genVBox->pack_start (*presetcat02, Gtk::PACK_SHRINK);
|
||||
|
||||
genFrame->add (*genVBox);
|
||||
pack_start (*genFrame, Gtk::PACK_EXPAND_WIDGET, 4);
|
||||
@@ -686,14 +683,22 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
|
||||
ybout->set_tooltip_markup (M ("TP_COLORAPP_YBOUT_TOOLTIP"));
|
||||
|
||||
tempout->set_tooltip_markup (M ("TP_COLORAPP_TEMP2_TOOLTIP"));
|
||||
// tempout->throwOnButtonRelease();
|
||||
// tempout->addAutoButton (M ("TP_COLORAPP_TEMPOUT_TOOLTIP"));
|
||||
|
||||
tempout->throwOnButtonRelease();
|
||||
tempout->addAutoButton (M ("TP_COLORAPP_TEMPOUT_TOOLTIP"));
|
||||
// I renable tempout with addautobutton to work properly (and all code disabled). There are certainly some redundancies, but it doesn't matter
|
||||
tempout->show();
|
||||
greenout->show();
|
||||
ybout->show();
|
||||
p3VBox->pack_start (*tempout);
|
||||
p3VBox->pack_start (*greenout);
|
||||
Gtk::Frame *tempgreenFrame;
|
||||
tempgreenFrame = Gtk::manage(new Gtk::Frame());
|
||||
tempgreenFrame->set_label_align (0.025, 0.5);
|
||||
Gtk::Box* tempgreenVBox;
|
||||
tempgreenVBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
|
||||
tempgreenVBox->set_spacing (2);
|
||||
tempgreenVBox->pack_start (*tempout);
|
||||
tempgreenVBox->pack_start (*greenout);
|
||||
tempgreenFrame->add(*tempgreenVBox);
|
||||
p3VBox->pack_start(*tempgreenFrame);
|
||||
p3VBox->pack_start (*ybout);
|
||||
|
||||
Gtk::Box* surrHBox = Gtk::manage (new Gtk::Box ());
|
||||
@@ -827,7 +832,7 @@ void ColorAppearance::neutral_pressed ()
|
||||
qcontrast->resetValue (false);
|
||||
colorh->resetValue (false);
|
||||
tempout->resetValue (false);
|
||||
// tempout->setAutoValue (true);
|
||||
tempout->setAutoValue (true);
|
||||
greenout->resetValue (false);
|
||||
ybout->resetValue (false);
|
||||
tempsc->resetValue (false);
|
||||
@@ -874,7 +879,6 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
tcmodeconn.block (true);
|
||||
tcmode2conn.block (true);
|
||||
tcmode3conn.block (true);
|
||||
presetcat02conn.block (true);
|
||||
shape->setCurve (pp->colorappearance.curve);
|
||||
shape2->setCurve (pp->colorappearance.curve2);
|
||||
shape3->setCurve (pp->colorappearance.curve3);
|
||||
@@ -882,7 +886,6 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
toneCurveMode2->set_active (toUnderlying(pp->colorappearance.curveMode2));
|
||||
toneCurveMode3->set_active (toUnderlying(pp->colorappearance.curveMode3));
|
||||
curveMode3Changed(); // This will set the correct sensitive state of depending Adjusters
|
||||
presetcat02->set_active(pp->colorappearance.presetcat02);
|
||||
|
||||
nexttemp = pp->wb.temperature;
|
||||
nextgreen = 1.; //pp->wb.green;
|
||||
@@ -920,7 +923,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
adapscen->setAutoInconsistent (multiImage && !pedited->colorappearance.autoadapscen);
|
||||
ybscen->setAutoInconsistent (multiImage && !pedited->colorappearance.autoybscen);
|
||||
set_inconsistent (multiImage && !pedited->colorappearance.enabled);
|
||||
// tempout->setAutoInconsistent (multiImage && !pedited->colorappearance.autotempout);
|
||||
tempout->setAutoInconsistent (multiImage && !pedited->colorappearance.autotempout);
|
||||
|
||||
shape->setUnChanged (!pedited->colorappearance.curve);
|
||||
shape2->setUnChanged (!pedited->colorappearance.curve2);
|
||||
@@ -946,7 +949,6 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
if (!pedited->colorappearance.curveMode3) {
|
||||
toneCurveMode3->set_active (3);
|
||||
}
|
||||
presetcat02->set_inconsistent(!pedited->colorappearance.presetcat02);
|
||||
|
||||
|
||||
}
|
||||
@@ -1106,7 +1108,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
lastAutoAdapscen = pp->colorappearance.autoadapscen;
|
||||
lastAutoDegreeout = pp->colorappearance.autodegreeout;
|
||||
lastAutoybscen = pp->colorappearance.autoybscen;
|
||||
// lastAutotempout = pp->colorappearance.autotempout;
|
||||
lastAutotempout = pp->colorappearance.autotempout;
|
||||
|
||||
degree->setValue (pp->colorappearance.degree);
|
||||
degree->setAutoValue (pp->colorappearance.autodegree);
|
||||
@@ -1129,15 +1131,11 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
qcontrast->setValue (pp->colorappearance.qcontrast);
|
||||
colorh->setValue (pp->colorappearance.colorh);
|
||||
tempout->setValue (pp->colorappearance.tempout);
|
||||
// tempout->setAutoValue (pp->colorappearance.autotempout);
|
||||
tempout->setAutoValue (pp->colorappearance.autotempout);
|
||||
greenout->setValue (pp->colorappearance.greenout);
|
||||
ybout->setValue (pp->colorappearance.ybout);
|
||||
tempsc->setValue (pp->colorappearance.tempsc);
|
||||
greensc->setValue (pp->colorappearance.greensc);
|
||||
presetcat02conn.block (true);
|
||||
presetcat02->set_active (pp->colorappearance.presetcat02);
|
||||
presetcat02conn.block (false);
|
||||
lastpresetcat02 = pp->colorappearance.presetcat02;
|
||||
|
||||
if (complexmethod->get_active_row_number() == 0) {
|
||||
updateGUIToMode(0);
|
||||
@@ -1197,12 +1195,11 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
|
||||
pp->colorappearance.curve2 = shape2->getCurve ();
|
||||
pp->colorappearance.curve3 = shape3->getCurve ();
|
||||
pp->colorappearance.tempout = tempout->getValue ();
|
||||
// pp->colorappearance.autotempout = tempout->getAutoValue ();
|
||||
pp->colorappearance.autotempout = tempout->getAutoValue ();
|
||||
pp->colorappearance.greenout = greenout->getValue ();
|
||||
pp->colorappearance.ybout = ybout->getValue ();
|
||||
pp->colorappearance.tempsc = tempsc->getValue ();
|
||||
pp->colorappearance.greensc = greensc->getValue ();
|
||||
pp->colorappearance.presetcat02 = presetcat02->get_active();
|
||||
|
||||
int tcMode = toneCurveMode->get_active_row_number();
|
||||
|
||||
@@ -1276,8 +1273,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
|
||||
pedited->colorappearance.ybout = ybout->getEditedState ();
|
||||
pedited->colorappearance.tempsc = tempsc->getEditedState ();
|
||||
pedited->colorappearance.greensc = greensc->getEditedState ();
|
||||
pedited->colorappearance.presetcat02 = presetcat02->get_inconsistent ();
|
||||
// pedited->colorappearance.autotempout = !tempout->getAutoInconsistent();
|
||||
pedited->colorappearance.autotempout = !tempout->getAutoInconsistent();
|
||||
|
||||
}
|
||||
|
||||
@@ -1369,7 +1365,9 @@ void ColorAppearance::updateGUIToMode(int mode)
|
||||
curveEditorG->hide();
|
||||
curveEditorG2->hide();
|
||||
curveEditorG3->hide();
|
||||
greenout->hide();
|
||||
//greenout->hide();
|
||||
greenout->set_sensitive(false);
|
||||
|
||||
badpixsl->hide();
|
||||
datacie->hide();
|
||||
} else {
|
||||
@@ -1378,7 +1376,8 @@ void ColorAppearance::updateGUIToMode(int mode)
|
||||
curveEditorG->show();
|
||||
curveEditorG2->show();
|
||||
curveEditorG3->show();
|
||||
greenout->show();
|
||||
// greenout->show();
|
||||
greenout->set_sensitive(true);
|
||||
badpixsl->show();
|
||||
datacie->show();
|
||||
}
|
||||
@@ -1397,10 +1396,6 @@ void ColorAppearance::convertParamToNormal()
|
||||
shape2->reset();
|
||||
shape3->reset();
|
||||
wbmodel->set_active (0);
|
||||
if (presetcat02->get_active ()) {
|
||||
wbmodel->set_active (2);
|
||||
illumChanged();
|
||||
}
|
||||
if (catmethod->get_active_row_number() == 1 || catmethod->get_active_row_number() == 2) {
|
||||
wbmodel->set_active (2);
|
||||
illumChanged();
|
||||
@@ -1488,13 +1483,13 @@ void ColorAppearance::catmethodChanged()
|
||||
ybout->setValue(18);
|
||||
tempout->setValue (nexttemp);
|
||||
|
||||
/* if(tempout->getAutoValue()) {
|
||||
tempout->resetValue (false);
|
||||
} else {
|
||||
tempout->setValue (nexttemp);
|
||||
tempout->setAutoValue (true);
|
||||
}
|
||||
*/
|
||||
if(tempout->getAutoValue()) {
|
||||
tempout->resetValue (false);
|
||||
} else {
|
||||
tempout->setValue (nexttemp);
|
||||
tempout->setAutoValue (true);
|
||||
}
|
||||
|
||||
greenout->setValue (nextgreen);
|
||||
enableListener();
|
||||
|
||||
@@ -1543,7 +1538,7 @@ void ColorAppearance::catmethodChanged()
|
||||
adaplum->resetValue (false);
|
||||
degreeout->resetValue (false);
|
||||
ybout->resetValue (false);
|
||||
// tempout->resetValue (false);
|
||||
tempout->resetValue (false);
|
||||
tempout->setValue (nexttemp);
|
||||
greenout->resetValue (false);
|
||||
enableListener();
|
||||
@@ -1705,140 +1700,6 @@ void ColorAppearance::badpix_toggled () {
|
||||
|
||||
}
|
||||
*/
|
||||
void ColorAppearance::presetcat02pressed () //keep in case of...
|
||||
{
|
||||
if (presetcat02->get_active ()) {
|
||||
disableListener();
|
||||
jlight->resetValue (false);
|
||||
qbright->resetValue (false);
|
||||
chroma->resetValue (false);
|
||||
schroma->resetValue (false);
|
||||
mchroma->resetValue (false);
|
||||
rstprotection->resetValue (false);
|
||||
contrast->resetValue (false);
|
||||
qcontrast->resetValue (false);
|
||||
colorh->resetValue (false);
|
||||
tempout->resetValue (false);
|
||||
greenout->resetValue (false);
|
||||
ybout->resetValue (false);
|
||||
tempsc->resetValue (false);
|
||||
greensc->resetValue (false);
|
||||
badpixsl->resetValue (false);
|
||||
wbmodel->set_active (0);
|
||||
illum->set_active (2);
|
||||
toneCurveMode->set_active (0);
|
||||
toneCurveMode2->set_active (1);
|
||||
toneCurveMode3->set_active (0);
|
||||
shape->reset();
|
||||
shape2->reset();
|
||||
shape3->reset();
|
||||
gamutconn.block (true);
|
||||
gamut->set_active (true);
|
||||
gamutconn.block (false);
|
||||
degree->setAutoValue (true);
|
||||
degree->resetValue (false);
|
||||
degree->setValue(90);
|
||||
adapscen->resetValue (false);
|
||||
adapscen->setAutoValue (true);
|
||||
degreeout->resetValue (false);
|
||||
degreeout->setAutoValue (true);
|
||||
ybscen->resetValue (false);
|
||||
ybscen->setAutoValue (true);
|
||||
surrsrc->set_active (0);
|
||||
wbmodel->set_active (2);
|
||||
tempsc->resetValue (false);
|
||||
greensc->resetValue (false);
|
||||
adapscen->setValue(400.);
|
||||
ybscen->setValue(18);
|
||||
surround->set_active (0);
|
||||
adaplum->setValue(400.);
|
||||
degreeout->setValue(90);
|
||||
ybout->setValue(18);
|
||||
tempout->setValue (nexttemp);
|
||||
|
||||
/* if(tempout->getAutoValue()) {
|
||||
tempout->resetValue (false);
|
||||
} else {
|
||||
tempout->setValue (nexttemp);
|
||||
tempout->setAutoValue (true);
|
||||
}
|
||||
*/
|
||||
greenout->setValue (nextgreen);
|
||||
enableListener();
|
||||
} else {
|
||||
disableListener();
|
||||
/* jlight->resetValue (false);
|
||||
qbright->resetValue (false);
|
||||
chroma->resetValue (false);
|
||||
schroma->resetValue (false);
|
||||
mchroma->resetValue (false);
|
||||
rstprotection->resetValue (false);
|
||||
contrast->resetValue (false);
|
||||
qcontrast->resetValue (false);
|
||||
colorh->resetValue (false);
|
||||
tempout->resetValue (false);
|
||||
greenout->resetValue (false);
|
||||
ybout->resetValue (false);
|
||||
tempsc->resetValue (false);
|
||||
greensc->resetValue (false);
|
||||
badpixsl->resetValue (false);
|
||||
wbmodel->set_active (0);
|
||||
toneCurveMode->set_active (0);
|
||||
toneCurveMode2->set_active (0);
|
||||
toneCurveMode3->set_active (0);
|
||||
shape->reset();
|
||||
shape2->reset();
|
||||
shape3->reset();
|
||||
gamutconn.block (true);
|
||||
gamut->set_active (true);
|
||||
gamutconn.block (false);
|
||||
*/
|
||||
degree->setAutoValue (true);
|
||||
degree->resetValue (false);
|
||||
adapscen->resetValue (false);
|
||||
adapscen->setAutoValue (true);
|
||||
degreeout->resetValue (false);
|
||||
degreeout->setAutoValue (true);
|
||||
ybscen->resetValue (false);
|
||||
ybscen->setAutoValue (true);
|
||||
surrsrc->set_active (0);
|
||||
wbmodel->set_active (0);
|
||||
illum->set_active (2);
|
||||
tempsc->resetValue (false);
|
||||
greensc->resetValue (false);
|
||||
adapscen->resetValue (false);
|
||||
ybscen->resetValue (false);
|
||||
surround->set_active (0);
|
||||
adaplum->resetValue (false);
|
||||
degreeout->resetValue (false);
|
||||
ybout->resetValue (false);
|
||||
tempout->resetValue (false);
|
||||
greenout->resetValue (false);
|
||||
enableListener();
|
||||
|
||||
}
|
||||
if (batchMode) {
|
||||
if (presetcat02->get_inconsistent()) {
|
||||
presetcat02->set_inconsistent (false);
|
||||
presetcat02conn.block (true);
|
||||
presetcat02->set_active (false);
|
||||
presetcat02conn.block (false);
|
||||
} else if (lastpresetcat02) {
|
||||
presetcat02->set_inconsistent (true);
|
||||
}
|
||||
|
||||
lastpresetcat02 = presetcat02->get_active ();
|
||||
}
|
||||
|
||||
if (listener) {
|
||||
if (presetcat02->get_active ()) {
|
||||
listener->panelChanged (Evcatpreset, M ("GENERAL_ENABLED"));
|
||||
} else {
|
||||
listener->panelChanged (Evcatpreset, M ("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ColorAppearance::datacie_toggled ()
|
||||
{
|
||||
@@ -2001,9 +1862,6 @@ void ColorAppearance::autoCamChanged (double ccam, double ccamout)
|
||||
|
||||
void ColorAppearance::adapCamChanged (double cadap)
|
||||
{
|
||||
if(presetcat02->get_active()){
|
||||
return;
|
||||
}
|
||||
|
||||
idle_register.add(
|
||||
[this, cadap]() -> bool
|
||||
@@ -2018,14 +1876,14 @@ void ColorAppearance::adapCamChanged (double cadap)
|
||||
|
||||
|
||||
void ColorAppearance::wbCamChanged (double temp, double tin)
|
||||
{
|
||||
{//reactivate this function
|
||||
|
||||
idle_register.add(
|
||||
[this, temp, tin]() -> bool
|
||||
{
|
||||
disableListener();
|
||||
tempout->setValue(temp);
|
||||
greenout->setValue(tin);
|
||||
greenout->setValue(tin);
|
||||
enableListener();
|
||||
return false;
|
||||
}
|
||||
@@ -2034,9 +1892,6 @@ void ColorAppearance::wbCamChanged (double temp, double tin)
|
||||
|
||||
void ColorAppearance::ybCamChanged (int ybsc)
|
||||
{
|
||||
if(presetcat02->get_active()){
|
||||
return;
|
||||
}
|
||||
|
||||
idle_register.add(
|
||||
[this, ybsc]() -> bool
|
||||
@@ -2122,16 +1977,6 @@ void ColorAppearance::adjusterChanged(Adjuster* a, double newval)
|
||||
|
||||
void ColorAppearance::adjusterAutoToggled(Adjuster* a)
|
||||
{
|
||||
/*
|
||||
if(presetcat02->get_active ()){
|
||||
if(tempout->getAutoValue()) {
|
||||
tempout->resetValue (false);
|
||||
} else {
|
||||
tempout->setValue (nexttemp);
|
||||
tempout->setAutoValue (true);
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (multiImage) {
|
||||
if (degree->getAutoInconsistent()) {
|
||||
degree->setAutoInconsistent (false);
|
||||
@@ -2167,7 +2012,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a)
|
||||
ybscen->setAutoInconsistent (true);
|
||||
}
|
||||
|
||||
/* lastAutotempout = tempout->getAutoValue();
|
||||
lastAutotempout = tempout->getAutoValue();
|
||||
|
||||
if (tempout->getAutoInconsistent()) {
|
||||
tempout->setAutoInconsistent (false);
|
||||
@@ -2177,7 +2022,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a)
|
||||
}
|
||||
|
||||
lastAutotempout = tempout->getAutoValue();
|
||||
*/
|
||||
|
||||
}
|
||||
if (listener && (multiImage || getEnabled()) ) {
|
||||
|
||||
@@ -2221,7 +2066,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a)
|
||||
listener->panelChanged (EvCATAutoyb, M ("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
if (a == tempout) {
|
||||
if (tempout->getAutoInconsistent()) {
|
||||
listener->panelChanged (EvCATAutotempout, M ("GENERAL_UNCHANGED"));
|
||||
@@ -2231,7 +2076,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a)
|
||||
listener->panelChanged (EvCATAutotempout, M ("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
void ColorAppearance::enabledChanged ()
|
||||
|
Reference in New Issue
Block a user