raw ca correction: first try to avoid colour shift, #4777
This commit is contained in:
@@ -431,6 +431,7 @@ void ParamsEdited::set(bool v)
|
||||
raw.xtranssensor.exBlackGreen = v;
|
||||
raw.xtranssensor.exBlackBlue = v;
|
||||
raw.ca_autocorrect = v;
|
||||
raw.ca_avoidcolourshift = v;
|
||||
raw.caautoiterations = v;
|
||||
raw.cablue = v;
|
||||
raw.cared = v;
|
||||
@@ -987,6 +988,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
|
||||
raw.xtranssensor.exBlackGreen = raw.xtranssensor.exBlackGreen && p.raw.xtranssensor.blackgreen == other.raw.xtranssensor.blackgreen;
|
||||
raw.xtranssensor.exBlackBlue = raw.xtranssensor.exBlackBlue && p.raw.xtranssensor.blackblue == other.raw.xtranssensor.blackblue;
|
||||
raw.ca_autocorrect = raw.ca_autocorrect && p.raw.ca_autocorrect == other.raw.ca_autocorrect;
|
||||
raw.ca_avoidcolourshift = raw.ca_avoidcolourshift && p.raw.ca_avoidcolourshift == other.raw.ca_avoidcolourshift;
|
||||
raw.caautoiterations = raw.caautoiterations && p.raw.caautoiterations == other.raw.caautoiterations;
|
||||
raw.cared = raw.cared && p.raw.cared == other.raw.cared;
|
||||
raw.cablue = raw.cablue && p.raw.cablue == other.raw.cablue;
|
||||
@@ -2628,6 +2630,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
||||
toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect;
|
||||
}
|
||||
|
||||
if (raw.ca_avoidcolourshift) {
|
||||
toEdit.raw.ca_avoidcolourshift = mods.raw.ca_avoidcolourshift;
|
||||
}
|
||||
|
||||
if (raw.caautoiterations) {
|
||||
toEdit.raw.caautoiterations = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.caautoiterations + mods.raw.caautoiterations : mods.raw.caautoiterations;
|
||||
}
|
||||
@@ -3133,7 +3139,7 @@ bool RAWParamsEdited::XTransSensor::isUnchanged() const
|
||||
|
||||
bool RAWParamsEdited::isUnchanged() const
|
||||
{
|
||||
return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && ca_autocorrect && caautoiterations && cared && cablue && hotPixelFilter && deadPixelFilter && hotdeadpix_thresh && darkFrame
|
||||
return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && ca_autocorrect && ca_avoidcolourshift && caautoiterations && cared && cablue && hotPixelFilter && deadPixelFilter && hotdeadpix_thresh && darkFrame
|
||||
&& df_autoselect && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl;
|
||||
}
|
||||
|
||||
|
||||
@@ -787,6 +787,7 @@ public:
|
||||
XTransSensor xtranssensor;
|
||||
|
||||
bool ca_autocorrect;
|
||||
bool ca_avoidcolourshift;
|
||||
bool caautoiterations;
|
||||
bool cared;
|
||||
bool cablue;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
// This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes
|
||||
#define PPVERSION 342
|
||||
#define PPVERSION 343
|
||||
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
|
||||
|
||||
/*
|
||||
Log of version changes
|
||||
343 2018-09-06
|
||||
raw auto ca correction avoid colour shift
|
||||
342 2018-09-05
|
||||
raw auto ca correction iterations
|
||||
341 2018-07-22
|
||||
|
||||
@@ -28,6 +28,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM
|
||||
{
|
||||
auto m = ProcEventMapper::getInstance();
|
||||
EvPreProcessCAAutoiterations = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_AUTOIT");
|
||||
EvPreProcessCAColourshift = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_COLOURSHIFT");
|
||||
|
||||
Gtk::Image* icaredL = Gtk::manage (new RTImage ("circle-red-cyan-small.png"));
|
||||
Gtk::Image* icaredR = Gtk::manage (new RTImage ("circle-cyan-red-small.png"));
|
||||
@@ -66,6 +67,11 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM
|
||||
pack_start( *caRed, Gtk::PACK_SHRINK, 4);
|
||||
pack_start( *caBlue, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
caAvoidcolourshift = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AVOIDCOLORSHIFT"), multiImage));
|
||||
caAvoidcolourshift->setCheckBoxListener (this);
|
||||
pack_start( *caAvoidcolourshift, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited)
|
||||
@@ -74,7 +80,8 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
|
||||
|
||||
if(pedited ) {
|
||||
caAutocorrect->setEdited(pedited->raw.ca_autocorrect);
|
||||
caAutoiterations->setEditedState( pedited->raw.cared ? Edited : UnEdited );
|
||||
caAvoidcolourshift->setEdited(pedited->raw.ca_avoidcolourshift);
|
||||
caAutoiterations->setEditedState( pedited->raw.caautoiterations ? Edited : UnEdited );
|
||||
caRed->setEditedState( pedited->raw.cared ? Edited : UnEdited );
|
||||
caBlue->setEditedState( pedited->raw.cablue ? Edited : UnEdited );
|
||||
}
|
||||
@@ -85,6 +92,7 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
|
||||
caBlue->set_sensitive(!pp->raw.ca_autocorrect);
|
||||
|
||||
caAutocorrect->setValue(pp->raw.ca_autocorrect);
|
||||
caAvoidcolourshift->setValue(pp->raw.ca_avoidcolourshift);
|
||||
caAutoiterations->setValue (pp->raw.caautoiterations);
|
||||
caRed->setValue (pp->raw.cared);
|
||||
caBlue->setValue (pp->raw.cablue);
|
||||
@@ -95,12 +103,14 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
|
||||
void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
|
||||
{
|
||||
pp->raw.ca_autocorrect = caAutocorrect->getLastActive();
|
||||
pp->raw.ca_avoidcolourshift = caAvoidcolourshift->getLastActive();
|
||||
pp->raw.caautoiterations = caAutoiterations->getValue();
|
||||
pp->raw.cared = caRed->getValue();
|
||||
pp->raw.cablue = caBlue->getValue();
|
||||
|
||||
if (pedited) {
|
||||
pedited->raw.ca_autocorrect = !caAutocorrect->get_inconsistent();
|
||||
pedited->raw.ca_avoidcolourshift = !caAvoidcolourshift->get_inconsistent();
|
||||
pedited->raw.caautoiterations = caAutoiterations->getEditedState ();
|
||||
pedited->raw.cared = caRed->getEditedState ();
|
||||
pedited->raw.cablue = caBlue->getEditedState ();
|
||||
@@ -136,6 +146,10 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval)
|
||||
if (listener) {
|
||||
listener->panelChanged (EvPreProcessAutoCA, caAutocorrect->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||
}
|
||||
} else if (c == caAvoidcolourshift) {
|
||||
if (listener) {
|
||||
listener->panelChanged (EvPreProcessCAColourshift, caAvoidcolourshift->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,10 @@ protected:
|
||||
Adjuster* caAutoiterations;
|
||||
Adjuster* caRed;
|
||||
Adjuster* caBlue;
|
||||
CheckBox* caAvoidcolourshift;
|
||||
|
||||
rtengine::ProcEvent EvPreProcessCAAutoiterations;
|
||||
rtengine::ProcEvent EvPreProcessCAColourshift;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user