Add "Inpaint opposed" to Highlight reconstruction and improved Itcwb (#6635)
* Essai HL * Try Inpaint opposed * Code improvment * Add file * Improvment to process inpaint opposed and color propagation * Clean code * Change Blend to Coloropp in Profile pp3 * Enable BENCHFUN hilite_recon * Clean rtengine cmakelist * Comment unused code * Neutralise unused code * Change bad Exposure in Pop2Lab.pp3 * Try to fix bug when Inpaint Opposed is used and White balance disabled * Changes to refreshmap * Change to improccoordinator M_RETINEX * Clean unused commented code * Force Inpaint-opposed in rawimagesouce if wb change * Suppressed message in console * Change events and limits to 1 the number of calls to inpaint-opposed * Comment code * Add gain theshold to inpaint opposed * fixed typo in procparams.cc * Change in option.cc itcwb_sort to true * Change itcw sorted in options and rawimagesource.cc * Change sampling read datas Itcwb * Allow or not purple in WB itcwb * Added option icwb.nopurple to bypass settings * Added code comment Itcwb * optimize Itcwb between green and student * Formated code used by Itcwb with Astylert.bat * Change color_match - thanks to Lawrence37 * Remove wrong text
This commit is contained in:
@@ -42,6 +42,7 @@ ToneCurve::ToneCurve() : FoldableToolPanel(this, TOOL_NAME, M("TP_EXPOSURE_LABEL
|
||||
EvHistMatchingBatch = m->newEvent(M_VOID, "HISTORY_MSG_HISTMATCHING");
|
||||
EvClampOOG = m->newEvent(DARKFRAME, "HISTORY_MSG_CLAMPOOG");
|
||||
EvHLbl = m->newEvent(DEMOSAIC, "HISTORY_MSG_HLBL");
|
||||
EvHLth = m->newEvent(DEMOSAIC, "HISTORY_MSG_HLTH");
|
||||
|
||||
CurveListener::setMulti(true);
|
||||
|
||||
@@ -97,13 +98,14 @@ ToneCurve::ToneCurve() : FoldableToolPanel(this, TOOL_NAME, M("TP_EXPOSURE_LABEL
|
||||
method = Gtk::manage (new MyComboBoxText ());
|
||||
method->append (M("TP_HLREC_LUMINANCE"));
|
||||
method->append (M("TP_HLREC_CIELAB"));
|
||||
method->append (M("TP_HLREC_COLOR"));
|
||||
method->append (M("TP_HLREC_BLEND"));
|
||||
method->append (M("TP_HLREC_COLOR"));
|
||||
method->append (M("TP_HLREC_COLOROPP"));
|
||||
Gtk::Box *hrVBox;
|
||||
hrVBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
|
||||
hrVBox->set_spacing(2);
|
||||
|
||||
method->set_active(0);
|
||||
method->set_active(4);
|
||||
Gtk::Frame* const hrFrame = Gtk::manage(new Gtk::Frame());
|
||||
hrFrame->set_label_align(0.025, 0.5);
|
||||
hrFrame->set_label_widget(*hrenabled);
|
||||
@@ -113,9 +115,11 @@ ToneCurve::ToneCurve() : FoldableToolPanel(this, TOOL_NAME, M("TP_EXPOSURE_LABEL
|
||||
hlrbox->pack_start (*lab, Gtk::PACK_SHRINK);
|
||||
hlrbox->pack_start (*method);
|
||||
hlbl = Gtk::manage(new Adjuster(M("TP_HLREC_HLBLUR"), 0, 4, 1, 0));
|
||||
hlth = Gtk::manage(new Adjuster(M("TP_HLREC_HLTH"), 0.25, 1.75, 0.01, 1.));
|
||||
|
||||
hrVBox->pack_start(*hlrbox, Gtk::PACK_SHRINK);
|
||||
hrVBox->pack_start(*hlbl);
|
||||
hrVBox->pack_start(*hlth);
|
||||
hrFrame->add(*hrVBox);
|
||||
pack_start(*hrFrame);
|
||||
|
||||
@@ -223,6 +227,7 @@ ToneCurve::ToneCurve() : FoldableToolPanel(this, TOOL_NAME, M("TP_EXPOSURE_LABEL
|
||||
black->setAdjusterListener(this);
|
||||
hlcompr->setAdjusterListener(this);
|
||||
hlbl->setAdjusterListener(this);
|
||||
hlth->setAdjusterListener(this);
|
||||
hlcomprthresh->setAdjusterListener(this);
|
||||
shcompr->setAdjusterListener(this);
|
||||
contrast->setAdjusterListener(this);
|
||||
@@ -254,6 +259,7 @@ void ToneCurve::read(const ProcParams* pp, const ParamsEdited* pedited)
|
||||
black->setValue(pp->toneCurve.black);
|
||||
hlcompr->setValue(pp->toneCurve.hlcompr);
|
||||
hlbl->setValue(pp->toneCurve.hlbl);
|
||||
hlth->setValue(pp->toneCurve.hlth);
|
||||
hlcomprthresh->setValue(pp->toneCurve.hlcomprthresh);
|
||||
shcompr->setValue(pp->toneCurve.shcompr);
|
||||
|
||||
@@ -283,6 +289,7 @@ void ToneCurve::read(const ProcParams* pp, const ParamsEdited* pedited)
|
||||
black->setEditedState(pedited->toneCurve.black ? Edited : UnEdited);
|
||||
hlcompr->setEditedState(pedited->toneCurve.hlcompr ? Edited : UnEdited);
|
||||
hlbl->setEditedState(pedited->toneCurve.hlbl ? Edited : UnEdited);
|
||||
hlth->setEditedState(pedited->toneCurve.hlth ? Edited : UnEdited);
|
||||
hlcomprthresh->setEditedState(pedited->toneCurve.hlcomprthresh ? Edited : UnEdited);
|
||||
shcompr->setEditedState(pedited->toneCurve.shcompr ? Edited : UnEdited);
|
||||
brightness->setEditedState(pedited->toneCurve.brightness ? Edited : UnEdited);
|
||||
@@ -310,16 +317,18 @@ void ToneCurve::read(const ProcParams* pp, const ParamsEdited* pedited)
|
||||
hrenabled->set_active(pp->toneCurve.hrenabled);
|
||||
enaconn.block(false);
|
||||
|
||||
if (pedited && !pedited->toneCurve.method) {
|
||||
method->set_active(4);
|
||||
} else if (pp->toneCurve.method == "Luminance") {
|
||||
if (pedited && !pedited->toneCurve.method) {
|
||||
method->set_active(5);
|
||||
} 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(2);
|
||||
} else if (pp->toneCurve.method == "Color") {
|
||||
method->set_active(3);
|
||||
} else if (pp->toneCurve.method == "Coloropp") {
|
||||
method->set_active(4);
|
||||
}
|
||||
|
||||
hrenabledChanged();
|
||||
@@ -354,6 +363,7 @@ void ToneCurve::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pp->toneCurve.black = black->getValue();
|
||||
pp->toneCurve.hlcompr = hlcompr->getValue();
|
||||
pp->toneCurve.hlbl = hlbl->getValue();
|
||||
pp->toneCurve.hlth = hlth->getValue();
|
||||
pp->toneCurve.hlcomprthresh = hlcomprthresh->getValue();
|
||||
pp->toneCurve.shcompr = shcompr->getValue();
|
||||
pp->toneCurve.brightness = brightness->getValue();
|
||||
@@ -403,6 +413,7 @@ void ToneCurve::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pedited->toneCurve.black = black->getEditedState();
|
||||
pedited->toneCurve.hlcompr = hlcompr->getEditedState();
|
||||
pedited->toneCurve.hlbl = hlbl->getEditedState();
|
||||
pedited->toneCurve.hlth = hlth->getEditedState();
|
||||
pedited->toneCurve.hlcomprthresh = hlcomprthresh->getEditedState();
|
||||
pedited->toneCurve.shcompr = shcompr->getEditedState();
|
||||
pedited->toneCurve.brightness = brightness->getEditedState();
|
||||
@@ -414,7 +425,7 @@ void ToneCurve::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pedited->toneCurve.curve2 = !shape2->isUnChanged();
|
||||
pedited->toneCurve.curveMode = toneCurveMode->get_active_row_number() != 6;
|
||||
pedited->toneCurve.curveMode2 = toneCurveMode2->get_active_row_number() != 6;
|
||||
pedited->toneCurve.method = method->get_active_row_number() != 4;
|
||||
pedited->toneCurve.method = method->get_active_row_number() != 5;
|
||||
pedited->toneCurve.hrenabled = !hrenabled->get_inconsistent();
|
||||
pedited->toneCurve.histmatching = !histmatching->get_inconsistent();
|
||||
pedited->toneCurve.fromHistMatching = true;
|
||||
@@ -428,9 +439,11 @@ void ToneCurve::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
} 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";
|
||||
} else if (method->get_active_row_number() == 3) {
|
||||
pp->toneCurve.method = "Color";
|
||||
} else if (method->get_active_row_number() == 4) {
|
||||
pp->toneCurve.method = "Coloropp";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,15 +467,21 @@ void ToneCurve::hrenabledChanged()
|
||||
if (hrenabled->get_active()) {
|
||||
hlrbox->show();
|
||||
hlrbox->set_sensitive(true);
|
||||
if (method->get_active_row_number() == 2) {
|
||||
if (method->get_active_row_number() == 3) {
|
||||
hlbl->show();
|
||||
hlth->hide();
|
||||
} else if (method->get_active_row_number() == 4){
|
||||
hlbl->hide();
|
||||
hlth->show();
|
||||
} else {
|
||||
hlbl->hide();
|
||||
}
|
||||
hlth->hide();
|
||||
}
|
||||
} else {
|
||||
hlrbox->show();
|
||||
hlrbox->set_sensitive(false);
|
||||
hlbl->hide();
|
||||
hlth->hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,11 +506,16 @@ void ToneCurve::hrenabledChanged()
|
||||
void ToneCurve::methodChanged()
|
||||
{
|
||||
|
||||
if (method->get_active_row_number() == 2) {
|
||||
if (method->get_active_row_number() == 3) {
|
||||
hlbl->show();
|
||||
} else {
|
||||
hlth->hide();
|
||||
} else if (method->get_active_row_number() == 4){
|
||||
hlbl->hide();
|
||||
}
|
||||
hlth->show();
|
||||
} else {
|
||||
hlbl->hide();
|
||||
hlth->hide();
|
||||
}
|
||||
if (listener) {
|
||||
setHistmatching(false);
|
||||
if (hrenabled->get_active()) {
|
||||
@@ -513,6 +537,7 @@ void ToneCurve::setRaw(bool raw)
|
||||
disableListener();
|
||||
method->set_sensitive(raw);
|
||||
hlbl->set_sensitive(raw);
|
||||
hlth->set_sensitive(raw);
|
||||
hrenabled->set_sensitive(raw);
|
||||
histmatching->set_sensitive(raw);
|
||||
enableListener();
|
||||
@@ -526,6 +551,7 @@ void ToneCurve::setDefaults(const ProcParams* defParams, const ParamsEdited* ped
|
||||
black->setDefault(defParams->toneCurve.black);
|
||||
hlcompr->setDefault(defParams->toneCurve.hlcompr);
|
||||
hlbl->setDefault(defParams->toneCurve.hlbl);
|
||||
hlth->setDefault(defParams->toneCurve.hlth);
|
||||
hlcomprthresh->setDefault(defParams->toneCurve.hlcomprthresh);
|
||||
shcompr->setDefault(defParams->toneCurve.shcompr);
|
||||
contrast->setDefault(defParams->toneCurve.contrast);
|
||||
@@ -536,6 +562,7 @@ void ToneCurve::setDefaults(const ProcParams* defParams, const ParamsEdited* ped
|
||||
black->setDefaultEditedState(pedited->toneCurve.black ? Edited : UnEdited);
|
||||
hlcompr->setDefaultEditedState(pedited->toneCurve.hlcompr ? Edited : UnEdited);
|
||||
hlbl->setDefaultEditedState(pedited->toneCurve.hlbl ? Edited : UnEdited);
|
||||
hlth->setDefaultEditedState(pedited->toneCurve.hlth ? Edited : UnEdited);
|
||||
hlcomprthresh->setDefaultEditedState(pedited->toneCurve.hlcomprthresh ? Edited : UnEdited);
|
||||
shcompr->setDefaultEditedState(pedited->toneCurve.shcompr ? Edited : UnEdited);
|
||||
brightness->setDefaultEditedState(pedited->toneCurve.brightness ? Edited : UnEdited);
|
||||
@@ -546,6 +573,7 @@ void ToneCurve::setDefaults(const ProcParams* defParams, const ParamsEdited* ped
|
||||
black->setDefaultEditedState(Irrelevant);
|
||||
hlcompr->setDefaultEditedState(Irrelevant);
|
||||
hlbl->setDefaultEditedState(Irrelevant);
|
||||
hlth->setDefaultEditedState(Irrelevant);
|
||||
hlcomprthresh->setDefaultEditedState(Irrelevant);
|
||||
shcompr->setDefaultEditedState(Irrelevant);
|
||||
brightness->setDefaultEditedState(Irrelevant);
|
||||
@@ -660,6 +688,8 @@ void ToneCurve::adjusterChanged(Adjuster* a, double newval)
|
||||
listener->panelChanged(EvSaturation, costr);
|
||||
} else if (a == hlbl) {
|
||||
listener->panelChanged(EvHLbl, costr);
|
||||
} else if (a == hlth) {
|
||||
listener->panelChanged(EvHLth, costr);
|
||||
} else if (a == hlcompr) {
|
||||
listener->panelChanged(EvHLCompr, costr);
|
||||
|
||||
@@ -695,6 +725,7 @@ void ToneCurve::neutral_pressed()
|
||||
expcomp->setValue(0);
|
||||
hlcompr->setValue(0);
|
||||
hlbl->setValue(0);
|
||||
hlth->setValue(1.0);
|
||||
hlcomprthresh->setValue(0);
|
||||
brightness->setValue(0);
|
||||
black->setValue(0);
|
||||
@@ -707,6 +738,7 @@ void ToneCurve::neutral_pressed()
|
||||
hlrbox->show();
|
||||
hlrbox->set_sensitive(false);
|
||||
hlbl->hide();
|
||||
hlth->hide();
|
||||
}
|
||||
|
||||
if (!black->getAddMode() && !batchMode) {
|
||||
@@ -841,6 +873,7 @@ void ToneCurve::waitForAutoExp()
|
||||
hrenabled->set_sensitive(false);
|
||||
method->set_sensitive(false);
|
||||
hlbl->set_sensitive(false);
|
||||
hlth->set_sensitive(false);
|
||||
histmatching->set_sensitive(false);
|
||||
}
|
||||
|
||||
@@ -853,6 +886,7 @@ void ToneCurve::enableAll()
|
||||
black->setEnabled(true);
|
||||
hlcompr->setEnabled(true);
|
||||
hlbl->setEnabled(true);
|
||||
hlth->setEnabled(true);
|
||||
hlcomprthresh->setEnabled(true);
|
||||
shcompr->setEnabled(true);
|
||||
contrast->setEnabled(true);
|
||||
@@ -864,6 +898,7 @@ void ToneCurve::enableAll()
|
||||
hrenabled->set_sensitive(true);
|
||||
method->set_sensitive(true);
|
||||
hlbl->set_sensitive(true);
|
||||
hlth->set_sensitive(true);
|
||||
histmatching->set_sensitive(true);
|
||||
}
|
||||
|
||||
@@ -883,6 +918,7 @@ void ToneCurve::setBatchMode(bool batchMode)
|
||||
black->showEditedCB();
|
||||
hlcompr->showEditedCB();
|
||||
hlbl->showEditedCB();
|
||||
hlth->showEditedCB();
|
||||
hlcomprthresh->showEditedCB();
|
||||
shcompr->showEditedCB();
|
||||
brightness->showEditedCB();
|
||||
@@ -996,16 +1032,22 @@ void ToneCurve::autoExpChanged(double expcomp, int bright, int contr, int black,
|
||||
if (nextHLRecons) {
|
||||
hlrbox->show();
|
||||
hlrbox->set_sensitive(true);
|
||||
if (method->get_active_row_number() == 2) {
|
||||
if (method->get_active_row_number() == 3) {
|
||||
hlbl->show();
|
||||
} else {
|
||||
hlth->hide();
|
||||
} else if (method->get_active_row_number() == 4){
|
||||
hlbl->hide();
|
||||
}
|
||||
hlth->show();
|
||||
} else {
|
||||
hlbl->hide();
|
||||
hlth->hide();
|
||||
}
|
||||
} else if (!batchMode) {
|
||||
hlrbox->show();
|
||||
hlrbox->set_sensitive(false);
|
||||
hlbl->hide();
|
||||
}
|
||||
hlth->hide();
|
||||
}
|
||||
|
||||
if (!this->black->getAddMode() && !batchMode) {
|
||||
shcompr->set_sensitive(static_cast<int>(this->black->getValue())); //at black=0 shcompr value has no effect
|
||||
|
Reference in New Issue
Block a user