Additional Speedup for CA-Correction, also included a prototype to allow strength of Auto-CA-correction

This commit is contained in:
heckflosse
2016-02-28 22:08:07 +01:00
parent 6b5db692e1
commit cbc88a5804
12 changed files with 405 additions and 566 deletions

View File

@@ -32,6 +32,14 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM
Gtk::Image* icablueR = Gtk::manage (new RTImage ("ajd-ca-blue2.png"));
caAutocorrect = Gtk::manage(new Gtk::CheckButton((M("TP_RAWCACORR_AUTO"))));
caStrength = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CASTR"), 2.0, 8.0, 0.5, 6.0));
caStrength->setAdjusterListener (this);
if (caStrength->delay < options.adjusterMaxDelay) {
caStrength->delay = options.adjusterMaxDelay;
}
caStrength->show();
caRed = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CARED"), -4.0, 4.0, 0.1, 0, icaredL, icaredR));
caRed->setAdjusterListener (this);
@@ -50,6 +58,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM
caBlue->show();
pack_start( *caAutocorrect, Gtk::PACK_SHRINK, 4);
pack_start( *caStrength, Gtk::PACK_SHRINK, 4);
pack_start( *caRed, Gtk::PACK_SHRINK, 4);
pack_start( *caBlue, Gtk::PACK_SHRINK, 4);
@@ -63,17 +72,20 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
if(pedited ) {
caAutocorrect->set_inconsistent(!pedited->raw.caCorrection);
caStrength->setEditedState( pedited->raw.caAutoStrength ? Edited : UnEdited );
caRed->setEditedState( pedited->raw.caRed ? Edited : UnEdited );
caBlue->setEditedState( pedited->raw.caBlue ? Edited : UnEdited );
}
lastCA = pp->raw.ca_autocorrect;
caStrength->set_sensitive(pp->raw.ca_autocorrect);
// disable Red and Blue sliders when caAutocorrect is enabled
caRed->set_sensitive(!pp->raw.ca_autocorrect);
caBlue->set_sensitive(!pp->raw.ca_autocorrect);
caAutocorrect->set_active(pp->raw.ca_autocorrect);
caStrength->setValue (pp->raw.caautostrength);
caRed->setValue (pp->raw.cared);
caBlue->setValue (pp->raw.cablue);
@@ -84,11 +96,13 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
{
pp->raw.ca_autocorrect = caAutocorrect->get_active();
pp->raw.caautostrength = caStrength->getValue();
pp->raw.cared = caRed->getValue();
pp->raw.cablue = caBlue->getValue();
if (pedited) {
pedited->raw.caCorrection = !caAutocorrect->get_inconsistent();
pedited->raw.caAutoStrength = caStrength->getEditedState ();
pedited->raw.caRed = caRed->getEditedState ();
pedited->raw.caBlue = caBlue->getEditedState ();
}
@@ -105,6 +119,8 @@ void RAWCACorr::adjusterChanged (Adjuster* a, double newval)
listener->panelChanged (EvPreProcessCARed, value );
} else if (a == caBlue) {
listener->panelChanged (EvPreProcessCABlue, value );
} else if (a == caStrength) {
listener->panelChanged (EvPreProcessCAStrength, value );
}
}
}
@@ -112,19 +128,23 @@ void RAWCACorr::adjusterChanged (Adjuster* a, double newval)
void RAWCACorr::setBatchMode(bool batchMode)
{
ToolPanel::setBatchMode (batchMode);
caStrength->showEditedCB ();
caRed->showEditedCB ();
caBlue->showEditedCB ();
}
void RAWCACorr::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited)
{
caStrength->setDefault( defParams->raw.caautostrength);
caRed->setDefault( defParams->raw.cared);
caBlue->setDefault( defParams->raw.cablue);
if (pedited) {
caStrength->setDefaultEditedState( pedited->raw.caAutoStrength ? Edited : UnEdited);
caRed->setDefaultEditedState( pedited->raw.caRed ? Edited : UnEdited);
caBlue->setDefaultEditedState( pedited->raw.caBlue ? Edited : UnEdited);
} else {
caStrength->setDefaultEditedState( Irrelevant );
caRed->setDefaultEditedState( Irrelevant );
caBlue->setDefaultEditedState( Irrelevant );
}
@@ -158,6 +178,7 @@ void RAWCACorr::caCorrectionChanged()
}
}*/
caStrength->set_sensitive(caAutocorrect->get_active ());
// disable Red and Blue sliders when caAutocorrect is enabled
caRed->set_sensitive(!caAutocorrect->get_active ());
caBlue->set_sensitive(!caAutocorrect->get_active ());
@@ -178,6 +199,7 @@ void RAWCACorr::caCorrectionChanged()
void RAWCACorr::setAdjusterBehavior (bool caadd)
{
caStrength->setAddMode(caadd);
caRed->setAddMode(caadd);
caBlue->setAddMode(caadd);
}
@@ -185,6 +207,7 @@ void RAWCACorr::setAdjusterBehavior (bool caadd)
void RAWCACorr::trimValues (rtengine::procparams::ProcParams* pp)
{
caStrength->trimValue(pp->raw.caautostrength);
caRed->trimValue(pp->raw.cared);
caBlue->trimValue(pp->raw.cablue);
}