Merge pull request #4797 from Beep6581/rawcacorrection_iterate
Raw ca correction. Iterative processing and Avoid color shift.
This commit is contained in:
commit
f9404901ff
@ -748,6 +748,8 @@ HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction
|
|||||||
HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter
|
HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter
|
||||||
HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold
|
HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold
|
||||||
HISTORY_MSG_RAW_BORDER;Raw border
|
HISTORY_MSG_RAW_BORDER;Raw border
|
||||||
|
HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations
|
||||||
|
HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift
|
||||||
HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling
|
HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling
|
||||||
HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold
|
HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold
|
||||||
HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light
|
HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light
|
||||||
@ -1780,6 +1782,8 @@ TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by o
|
|||||||
TP_PRSHARPENING_LABEL;Post-Resize Sharpening
|
TP_PRSHARPENING_LABEL;Post-Resize Sharpening
|
||||||
TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions.
|
TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions.
|
||||||
TP_RAWCACORR_AUTO;Auto-correction
|
TP_RAWCACORR_AUTO;Auto-correction
|
||||||
|
TP_RAWCACORR_AUTOIT;Iterations
|
||||||
|
TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift
|
||||||
TP_RAWCACORR_CABLUE;Blue
|
TP_RAWCACORR_CABLUE;Blue
|
||||||
TP_RAWCACORR_CARED;Red
|
TP_RAWCACORR_CARED;Red
|
||||||
TP_RAWCACORR_CASTR;Strength
|
TP_RAWCACORR_CASTR;Strength
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2561,6 +2561,8 @@ RAWParams::RAWParams() :
|
|||||||
ff_AutoClipControl(false),
|
ff_AutoClipControl(false),
|
||||||
ff_clipControl(0),
|
ff_clipControl(0),
|
||||||
ca_autocorrect(false),
|
ca_autocorrect(false),
|
||||||
|
ca_avoidcolourshift(true),
|
||||||
|
caautoiterations(2),
|
||||||
cared(0.0),
|
cared(0.0),
|
||||||
cablue(0.0),
|
cablue(0.0),
|
||||||
expos(1.0),
|
expos(1.0),
|
||||||
@ -2585,6 +2587,8 @@ bool RAWParams::operator ==(const RAWParams& other) const
|
|||||||
&& ff_AutoClipControl == other.ff_AutoClipControl
|
&& ff_AutoClipControl == other.ff_AutoClipControl
|
||||||
&& ff_clipControl == other.ff_clipControl
|
&& ff_clipControl == other.ff_clipControl
|
||||||
&& ca_autocorrect == other.ca_autocorrect
|
&& ca_autocorrect == other.ca_autocorrect
|
||||||
|
&& ca_avoidcolourshift == other.ca_avoidcolourshift
|
||||||
|
&& caautoiterations == other.caautoiterations
|
||||||
&& cared == other.cared
|
&& cared == other.cared
|
||||||
&& cablue == other.cablue
|
&& cablue == other.cablue
|
||||||
&& expos == other.expos
|
&& expos == other.expos
|
||||||
@ -3381,6 +3385,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
|||||||
saveToKeyfile(!pedited || pedited->raw.ff_AutoClipControl, "RAW", "FlatFieldAutoClipControl", raw.ff_AutoClipControl, keyFile);
|
saveToKeyfile(!pedited || pedited->raw.ff_AutoClipControl, "RAW", "FlatFieldAutoClipControl", raw.ff_AutoClipControl, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->raw.ff_clipControl, "RAW", "FlatFieldClipControl", raw.ff_clipControl, keyFile);
|
saveToKeyfile(!pedited || pedited->raw.ff_clipControl, "RAW", "FlatFieldClipControl", raw.ff_clipControl, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->raw.ca_autocorrect, "RAW", "CA", raw.ca_autocorrect, keyFile);
|
saveToKeyfile(!pedited || pedited->raw.ca_autocorrect, "RAW", "CA", raw.ca_autocorrect, keyFile);
|
||||||
|
saveToKeyfile(!pedited || pedited->raw.ca_avoidcolourshift, "RAW", "CAAvoidColourshift", raw.ca_avoidcolourshift, keyFile);
|
||||||
|
saveToKeyfile(!pedited || pedited->raw.caautoiterations, "RAW", "CAAutoIterations", raw.caautoiterations, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->raw.cared, "RAW", "CARed", raw.cared, keyFile);
|
saveToKeyfile(!pedited || pedited->raw.cared, "RAW", "CARed", raw.cared, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->raw.cablue, "RAW", "CABlue", raw.cablue, keyFile);
|
saveToKeyfile(!pedited || pedited->raw.cablue, "RAW", "CABlue", raw.cablue, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->raw.hotPixelFilter, "RAW", "HotPixelFilter", raw.hotPixelFilter, keyFile);
|
saveToKeyfile(!pedited || pedited->raw.hotPixelFilter, "RAW", "HotPixelFilter", raw.hotPixelFilter, keyFile);
|
||||||
@ -4753,6 +4759,17 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
|||||||
}
|
}
|
||||||
|
|
||||||
assignFromKeyfile(keyFile, "RAW", "CA", pedited, raw.ca_autocorrect, pedited->raw.ca_autocorrect);
|
assignFromKeyfile(keyFile, "RAW", "CA", pedited, raw.ca_autocorrect, pedited->raw.ca_autocorrect);
|
||||||
|
if (ppVersion >= 342) {
|
||||||
|
assignFromKeyfile(keyFile, "RAW", "CAAutoIterations", pedited, raw.caautoiterations, pedited->raw.caautoiterations);
|
||||||
|
} else {
|
||||||
|
raw.caautoiterations = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ppVersion >= 343) {
|
||||||
|
assignFromKeyfile(keyFile, "RAW", "CAAvoidColourshift", pedited, raw.ca_avoidcolourshift, pedited->raw.ca_avoidcolourshift);
|
||||||
|
} else {
|
||||||
|
raw.ca_avoidcolourshift = false;
|
||||||
|
}
|
||||||
assignFromKeyfile(keyFile, "RAW", "CARed", pedited, raw.cared, pedited->raw.cared);
|
assignFromKeyfile(keyFile, "RAW", "CARed", pedited, raw.cared, pedited->raw.cared);
|
||||||
assignFromKeyfile(keyFile, "RAW", "CABlue", pedited, raw.cablue, pedited->raw.cablue);
|
assignFromKeyfile(keyFile, "RAW", "CABlue", pedited, raw.cablue, pedited->raw.cablue);
|
||||||
// For compatibility to elder pp3 versions
|
// For compatibility to elder pp3 versions
|
||||||
|
@ -1368,6 +1368,8 @@ struct RAWParams {
|
|||||||
int ff_clipControl;
|
int ff_clipControl;
|
||||||
|
|
||||||
bool ca_autocorrect;
|
bool ca_autocorrect;
|
||||||
|
bool ca_avoidcolourshift;
|
||||||
|
int caautoiterations;
|
||||||
double cared;
|
double cared;
|
||||||
double cablue;
|
double cablue;
|
||||||
|
|
||||||
|
@ -2009,13 +2009,13 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le
|
|||||||
}
|
}
|
||||||
if(numFrames == 4) {
|
if(numFrames == 4) {
|
||||||
double fitParams[64];
|
double fitParams[64];
|
||||||
float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 8.0, *rawDataFrames[0], fitParams, false, true, nullptr, false);
|
float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, *rawDataFrames[0], fitParams, false, true, nullptr, false);
|
||||||
for(int i = 1; i < 3; ++i) {
|
for(int i = 1; i < 3; ++i) {
|
||||||
CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 8.0, *rawDataFrames[i], fitParams, true, false, buffer, false);
|
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, *rawDataFrames[i], fitParams, true, false, buffer, false);
|
||||||
}
|
}
|
||||||
CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 8.0, *rawDataFrames[3], fitParams, true, false, buffer, true);
|
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, *rawDataFrames[3], fitParams, true, false, buffer, true);
|
||||||
} else {
|
} else {
|
||||||
CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 8.0, rawData, nullptr, false, false, nullptr, true);
|
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, rawData, nullptr, false, false, nullptr, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,7 +239,19 @@ protected:
|
|||||||
inline void interpolate_row_rb (float* ar, float* ab, float* pg, float* cg, float* ng, int i);
|
inline void interpolate_row_rb (float* ar, float* ab, float* pg, float* cg, float* ng, int i);
|
||||||
inline void interpolate_row_rb_mul_pp (const array2D<float> &rawData, float* ar, float* ab, float* pg, float* cg, float* ng, int i, float r_mul, float g_mul, float b_mul, int x1, int width, int skip);
|
inline void interpolate_row_rb_mul_pp (const array2D<float> &rawData, float* ar, float* ab, float* pg, float* cg, float* ng, int i, float r_mul, float g_mul, float b_mul, int x1, int width, int skip);
|
||||||
|
|
||||||
float* CA_correct_RT (const bool autoCA, const double cared, const double cablue, const double caautostrength, array2D<float> &rawData, double *fitParamsTransfer, bool fitParamsIn, bool fitParamsOut, float * buffer, bool freeBuffer);
|
float* CA_correct_RT(
|
||||||
|
bool autoCA,
|
||||||
|
size_t autoIterations,
|
||||||
|
double cared,
|
||||||
|
double cablue,
|
||||||
|
bool avoidColourshift,
|
||||||
|
const array2D<float> &rawData,
|
||||||
|
double* fitParamsTransfer,
|
||||||
|
bool fitParamsIn,
|
||||||
|
bool fitParamsOut,
|
||||||
|
float* buffer,
|
||||||
|
bool freeBuffer
|
||||||
|
);
|
||||||
void ddct8x8s(int isgn, float a[8][8]);
|
void ddct8x8s(int isgn, float a[8][8]);
|
||||||
void processRawWhitepoint (float expos, float preser, array2D<float> &rawData); // exposure before interpolation
|
void processRawWhitepoint (float expos, float preser, array2D<float> &rawData); // exposure before interpolation
|
||||||
|
|
||||||
|
@ -431,6 +431,8 @@ void ParamsEdited::set(bool v)
|
|||||||
raw.xtranssensor.exBlackGreen = v;
|
raw.xtranssensor.exBlackGreen = v;
|
||||||
raw.xtranssensor.exBlackBlue = v;
|
raw.xtranssensor.exBlackBlue = v;
|
||||||
raw.ca_autocorrect = v;
|
raw.ca_autocorrect = v;
|
||||||
|
raw.ca_avoidcolourshift = v;
|
||||||
|
raw.caautoiterations = v;
|
||||||
raw.cablue = v;
|
raw.cablue = v;
|
||||||
raw.cared = v;
|
raw.cared = v;
|
||||||
raw.hotPixelFilter = v;
|
raw.hotPixelFilter = v;
|
||||||
@ -986,6 +988,8 @@ 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.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.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_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.cared = raw.cared && p.raw.cared == other.raw.cared;
|
||||||
raw.cablue = raw.cablue && p.raw.cablue == other.raw.cablue;
|
raw.cablue = raw.cablue && p.raw.cablue == other.raw.cablue;
|
||||||
raw.hotPixelFilter = raw.hotPixelFilter && p.raw.hotPixelFilter == other.raw.hotPixelFilter;
|
raw.hotPixelFilter = raw.hotPixelFilter && p.raw.hotPixelFilter == other.raw.hotPixelFilter;
|
||||||
@ -2626,6 +2630,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
|||||||
toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
if (raw.cared) {
|
if (raw.cared) {
|
||||||
toEdit.raw.cared = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.cared + mods.raw.cared : mods.raw.cared;
|
toEdit.raw.cared = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.cared + mods.raw.cared : mods.raw.cared;
|
||||||
}
|
}
|
||||||
@ -3127,7 +3139,7 @@ bool RAWParamsEdited::XTransSensor::isUnchanged() const
|
|||||||
|
|
||||||
bool RAWParamsEdited::isUnchanged() const
|
bool RAWParamsEdited::isUnchanged() const
|
||||||
{
|
{
|
||||||
return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && ca_autocorrect && 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;
|
&& df_autoselect && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -787,6 +787,8 @@ public:
|
|||||||
XTransSensor xtranssensor;
|
XTransSensor xtranssensor;
|
||||||
|
|
||||||
bool ca_autocorrect;
|
bool ca_autocorrect;
|
||||||
|
bool ca_avoidcolourshift;
|
||||||
|
bool caautoiterations;
|
||||||
bool cared;
|
bool cared;
|
||||||
bool cablue;
|
bool cablue;
|
||||||
bool hotPixelFilter;
|
bool hotPixelFilter;
|
||||||
|
@ -901,6 +901,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
|
|||||||
|
|
||||||
if (!raw_ca_autocorrect->get_active ()) {
|
if (!raw_ca_autocorrect->get_active ()) {
|
||||||
filterPE.raw.ca_autocorrect = falsePE.raw.ca_autocorrect;
|
filterPE.raw.ca_autocorrect = falsePE.raw.ca_autocorrect;
|
||||||
|
filterPE.raw.caautoiterations = falsePE.raw.caautoiterations;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!raw_caredblue->get_active ()) {
|
if (!raw_caredblue->get_active ()) {
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes
|
// This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes
|
||||||
#define PPVERSION 340
|
#define PPVERSION 343
|
||||||
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
|
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Log of version changes
|
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
|
341 2018-07-22
|
||||||
[ICM] enhanced custom output profile
|
[ICM] enhanced custom output profile
|
||||||
340 2018-07-08
|
340 2018-07-08
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "rawcacorrection.h"
|
#include "rawcacorrection.h"
|
||||||
|
#include "eventmapper.h"
|
||||||
#include "guiutils.h"
|
#include "guiutils.h"
|
||||||
#include "rtimage.h"
|
#include "rtimage.h"
|
||||||
|
|
||||||
@ -25,6 +26,11 @@ using namespace rtengine::procparams;
|
|||||||
|
|
||||||
RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROMATABERR_LABEL"))
|
RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROMATABERR_LABEL"))
|
||||||
{
|
{
|
||||||
|
auto m = ProcEventMapper::getInstance();
|
||||||
|
EvPreProcessCAAutoiterations = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_AUTOIT");
|
||||||
|
// EvPreProcessCAColourshift = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_COLOURSHIFT");
|
||||||
|
// EvPreProcessCAColourshiftHistory = m->newEvent(M_VOID, "HISTORY_MSG_RAWCACORR_COLOURSHIFT");
|
||||||
|
|
||||||
Gtk::Image* icaredL = Gtk::manage (new RTImage ("circle-red-cyan-small.png"));
|
Gtk::Image* icaredL = Gtk::manage (new RTImage ("circle-red-cyan-small.png"));
|
||||||
Gtk::Image* icaredR = Gtk::manage (new RTImage ("circle-cyan-red-small.png"));
|
Gtk::Image* icaredR = Gtk::manage (new RTImage ("circle-cyan-red-small.png"));
|
||||||
Gtk::Image* icablueL = Gtk::manage (new RTImage ("circle-blue-yellow-small.png"));
|
Gtk::Image* icablueL = Gtk::manage (new RTImage ("circle-blue-yellow-small.png"));
|
||||||
@ -33,6 +39,13 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM
|
|||||||
caAutocorrect = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AUTO"), multiImage));
|
caAutocorrect = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AUTO"), multiImage));
|
||||||
caAutocorrect->setCheckBoxListener (this);
|
caAutocorrect->setCheckBoxListener (this);
|
||||||
|
|
||||||
|
caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 5, 1, 2));
|
||||||
|
caAutoiterations->setAdjusterListener (this);
|
||||||
|
|
||||||
|
if (caAutoiterations->delay < options.adjusterMaxDelay) {
|
||||||
|
caAutoiterations->delay = options.adjusterMaxDelay;
|
||||||
|
}
|
||||||
|
|
||||||
caRed = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CARED"), -8.0, 8.0, 0.1, 0, icaredL, icaredR));
|
caRed = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CARED"), -8.0, 8.0, 0.1, 0, icaredL, icaredR));
|
||||||
caRed->setAdjusterListener (this);
|
caRed->setAdjusterListener (this);
|
||||||
|
|
||||||
@ -51,9 +64,15 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM
|
|||||||
caBlue->show();
|
caBlue->show();
|
||||||
|
|
||||||
pack_start( *caAutocorrect, Gtk::PACK_SHRINK, 4);
|
pack_start( *caAutocorrect, Gtk::PACK_SHRINK, 4);
|
||||||
|
pack_start( *caAutoiterations, Gtk::PACK_SHRINK, 4);
|
||||||
pack_start( *caRed, Gtk::PACK_SHRINK, 4);
|
pack_start( *caRed, Gtk::PACK_SHRINK, 4);
|
||||||
pack_start( *caBlue, 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)
|
void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited)
|
||||||
@ -62,15 +81,20 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
|
|||||||
|
|
||||||
if(pedited ) {
|
if(pedited ) {
|
||||||
caAutocorrect->setEdited(pedited->raw.ca_autocorrect);
|
caAutocorrect->setEdited(pedited->raw.ca_autocorrect);
|
||||||
|
// caAvoidcolourshift->setEdited(pedited->raw.ca_avoidcolourshift);
|
||||||
|
caAutoiterations->setEditedState( pedited->raw.caautoiterations ? Edited : UnEdited );
|
||||||
caRed->setEditedState( pedited->raw.cared ? Edited : UnEdited );
|
caRed->setEditedState( pedited->raw.cared ? Edited : UnEdited );
|
||||||
caBlue->setEditedState( pedited->raw.cablue ? Edited : UnEdited );
|
caBlue->setEditedState( pedited->raw.cablue ? Edited : UnEdited );
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable Red and Blue sliders when caAutocorrect is enabled
|
// disable Red and Blue sliders when caAutocorrect is enabled
|
||||||
|
caAutoiterations->set_sensitive(pp->raw.ca_autocorrect);
|
||||||
caRed->set_sensitive(!pp->raw.ca_autocorrect);
|
caRed->set_sensitive(!pp->raw.ca_autocorrect);
|
||||||
caBlue->set_sensitive(!pp->raw.ca_autocorrect);
|
caBlue->set_sensitive(!pp->raw.ca_autocorrect);
|
||||||
|
|
||||||
caAutocorrect->setValue(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);
|
caRed->setValue (pp->raw.cared);
|
||||||
caBlue->setValue (pp->raw.cablue);
|
caBlue->setValue (pp->raw.cablue);
|
||||||
|
|
||||||
@ -80,11 +104,15 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
|
|||||||
void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
|
void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
pp->raw.ca_autocorrect = caAutocorrect->getLastActive();
|
pp->raw.ca_autocorrect = caAutocorrect->getLastActive();
|
||||||
|
// pp->raw.ca_avoidcolourshift = caAvoidcolourshift->getLastActive();
|
||||||
|
pp->raw.caautoiterations = caAutoiterations->getValue();
|
||||||
pp->raw.cared = caRed->getValue();
|
pp->raw.cared = caRed->getValue();
|
||||||
pp->raw.cablue = caBlue->getValue();
|
pp->raw.cablue = caBlue->getValue();
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
pedited->raw.ca_autocorrect = !caAutocorrect->get_inconsistent();
|
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.cared = caRed->getEditedState ();
|
||||||
pedited->raw.cablue = caBlue->getEditedState ();
|
pedited->raw.cablue = caBlue->getEditedState ();
|
||||||
}
|
}
|
||||||
@ -97,7 +125,9 @@ void RAWCACorr::adjusterChanged (Adjuster* a, double newval)
|
|||||||
|
|
||||||
Glib::ustring value = a->getTextValue();
|
Glib::ustring value = a->getTextValue();
|
||||||
|
|
||||||
if (a == caRed) {
|
if (a == caAutoiterations) {
|
||||||
|
listener->panelChanged (EvPreProcessCAAutoiterations, value );
|
||||||
|
} else if (a == caRed) {
|
||||||
listener->panelChanged (EvPreProcessCARed, value );
|
listener->panelChanged (EvPreProcessCARed, value );
|
||||||
} else if (a == caBlue) {
|
} else if (a == caBlue) {
|
||||||
listener->panelChanged (EvPreProcessCABlue, value );
|
listener->panelChanged (EvPreProcessCABlue, value );
|
||||||
@ -110,6 +140,7 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval)
|
|||||||
if (c == caAutocorrect) {
|
if (c == caAutocorrect) {
|
||||||
if (!batchMode) {
|
if (!batchMode) {
|
||||||
// disable Red and Blue sliders when caAutocorrect is enabled
|
// disable Red and Blue sliders when caAutocorrect is enabled
|
||||||
|
caAutoiterations->set_sensitive(caAutocorrect->getLastActive ());
|
||||||
caRed->set_sensitive(!caAutocorrect->getLastActive ());
|
caRed->set_sensitive(!caAutocorrect->getLastActive ());
|
||||||
caBlue->set_sensitive(!caAutocorrect->getLastActive ());
|
caBlue->set_sensitive(!caAutocorrect->getLastActive ());
|
||||||
}
|
}
|
||||||
@ -117,24 +148,33 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval)
|
|||||||
listener->panelChanged (EvPreProcessAutoCA, caAutocorrect->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
listener->panelChanged (EvPreProcessAutoCA, caAutocorrect->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// else if (c == caAvoidcolourshift) {
|
||||||
|
// if (listener) {
|
||||||
|
// listener->panelChanged ((caAutocorrect->getLastActive() || caRed->getValue() != 0 || caBlue->getValue() != 0) ? EvPreProcessCAColourshift : EvPreProcessCAColourshiftHistory, caAvoidcolourshift->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void RAWCACorr::setBatchMode(bool batchMode)
|
void RAWCACorr::setBatchMode(bool batchMode)
|
||||||
{
|
{
|
||||||
ToolPanel::setBatchMode (batchMode);
|
ToolPanel::setBatchMode (batchMode);
|
||||||
|
caAutoiterations->showEditedCB ();
|
||||||
caRed->showEditedCB ();
|
caRed->showEditedCB ();
|
||||||
caBlue->showEditedCB ();
|
caBlue->showEditedCB ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RAWCACorr::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited)
|
void RAWCACorr::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
|
caAutoiterations->setDefault( defParams->raw.caautoiterations);
|
||||||
caRed->setDefault( defParams->raw.cared);
|
caRed->setDefault( defParams->raw.cared);
|
||||||
caBlue->setDefault( defParams->raw.cablue);
|
caBlue->setDefault( defParams->raw.cablue);
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
|
caAutoiterations->setDefaultEditedState( pedited->raw.caautoiterations ? Edited : UnEdited);
|
||||||
caRed->setDefaultEditedState( pedited->raw.cared ? Edited : UnEdited);
|
caRed->setDefaultEditedState( pedited->raw.cared ? Edited : UnEdited);
|
||||||
caBlue->setDefaultEditedState( pedited->raw.cablue ? Edited : UnEdited);
|
caBlue->setDefaultEditedState( pedited->raw.cablue ? Edited : UnEdited);
|
||||||
} else {
|
} else {
|
||||||
|
caAutoiterations->setDefaultEditedState( Irrelevant );
|
||||||
caRed->setDefaultEditedState( Irrelevant );
|
caRed->setDefaultEditedState( Irrelevant );
|
||||||
caBlue->setDefaultEditedState( Irrelevant );
|
caBlue->setDefaultEditedState( Irrelevant );
|
||||||
}
|
}
|
||||||
@ -150,6 +190,7 @@ void RAWCACorr::setAdjusterBehavior (bool caadd)
|
|||||||
void RAWCACorr::trimValues (rtengine::procparams::ProcParams* pp)
|
void RAWCACorr::trimValues (rtengine::procparams::ProcParams* pp)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
caAutoiterations->trimValue(pp->raw.caautoiterations);
|
||||||
caRed->trimValue(pp->raw.cared);
|
caRed->trimValue(pp->raw.cared);
|
||||||
caBlue->trimValue(pp->raw.cablue);
|
caBlue->trimValue(pp->raw.cablue);
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,14 @@ class RAWCACorr : public ToolParamBlock, public AdjusterListener, public CheckBo
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
CheckBox* caAutocorrect;
|
CheckBox* caAutocorrect;
|
||||||
|
Adjuster* caAutoiterations;
|
||||||
Adjuster* caRed;
|
Adjuster* caRed;
|
||||||
Adjuster* caBlue;
|
Adjuster* caBlue;
|
||||||
|
// CheckBox* caAvoidcolourshift;
|
||||||
|
|
||||||
|
rtengine::ProcEvent EvPreProcessCAAutoiterations;
|
||||||
|
// rtengine::ProcEvent EvPreProcessCAColourshift;
|
||||||
|
// rtengine::ProcEvent EvPreProcessCAColourshiftHistory;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user