Optimization for dark frames and hot/dead pixel detection/interpolation, Issue 2486
This commit is contained in:
@@ -317,7 +317,8 @@ void ParamsEdited::set (bool v) {
|
||||
raw.caCorrection = v;
|
||||
raw.caBlue = v;
|
||||
raw.caRed = v;
|
||||
raw.hotDeadPixelFilter = v;
|
||||
raw.hotPixelFilter = v;
|
||||
raw.deadPixelFilter = v;
|
||||
raw.hotDeadPixelThresh = v;
|
||||
raw.darkFrame = v;
|
||||
raw.dfAuto = v;
|
||||
@@ -649,7 +650,8 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
raw.caCorrection = raw.caCorrection && p.raw.ca_autocorrect == other.raw.ca_autocorrect;
|
||||
raw.caRed = raw.caRed && p.raw.cared == other.raw.cared;
|
||||
raw.caBlue = raw.caBlue && p.raw.cablue == other.raw.cablue;
|
||||
raw.hotDeadPixelFilter = raw.hotDeadPixelFilter && p.raw.hotdeadpix_filt == other.raw.hotdeadpix_filt;
|
||||
raw.hotPixelFilter = raw.hotPixelFilter && p.raw.hotPixelFilter == other.raw.hotPixelFilter;
|
||||
raw.deadPixelFilter = raw.deadPixelFilter && p.raw.deadPixelFilter == other.raw.deadPixelFilter;
|
||||
raw.hotDeadPixelThresh = raw.hotDeadPixelThresh && p.raw.hotdeadpix_thresh == other.raw.hotdeadpix_thresh;
|
||||
raw.darkFrame = raw.darkFrame && p.raw.dark_frame == other.raw.dark_frame;
|
||||
raw.dfAuto = raw.dfAuto && p.raw.df_autoselect == other.raw.df_autoselect;
|
||||
@@ -989,7 +991,8 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
if (raw.exPos) toEdit.raw.expos = dontforceSet && options.baBehav[ADDSET_RAWEXPOS_LINEAR] ? toEdit.raw.expos + mods.raw.expos : mods.raw.expos;
|
||||
if (raw.exPreser) toEdit.raw.preser = dontforceSet && options.baBehav[ADDSET_RAWEXPOS_PRESER] ? toEdit.raw.preser + mods.raw.preser : mods.raw.preser;
|
||||
|
||||
if (raw.hotDeadPixelFilter) toEdit.raw.hotdeadpix_filt = mods.raw.hotdeadpix_filt;
|
||||
if (raw.hotPixelFilter) toEdit.raw.hotPixelFilter = mods.raw.hotPixelFilter;
|
||||
if (raw.deadPixelFilter) toEdit.raw.deadPixelFilter = mods.raw.deadPixelFilter;
|
||||
if (raw.hotDeadPixelThresh) toEdit.raw.hotdeadpix_thresh = mods.raw.hotdeadpix_thresh;
|
||||
if (raw.darkFrame) toEdit.raw.dark_frame = mods.raw.dark_frame;
|
||||
if (raw.dfAuto) toEdit.raw.df_autoselect = mods.raw.df_autoselect;
|
||||
@@ -1042,7 +1045,7 @@ bool RAWParamsEdited::XTransSensor::isUnchanged() const {
|
||||
}
|
||||
|
||||
bool RAWParamsEdited::isUnchanged() const {
|
||||
return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && caCorrection && caRed && caBlue && hotDeadPixelFilter && hotDeadPixelThresh && darkFrame
|
||||
return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && caCorrection && caRed && caBlue && hotPixelFilter && deadPixelFilter && hotDeadPixelThresh && darkFrame
|
||||
&& dfAuto && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl;
|
||||
}
|
||||
|
||||
|
@@ -536,7 +536,8 @@ class RAWParamsEdited {
|
||||
bool caCorrection;
|
||||
bool caRed;
|
||||
bool caBlue;
|
||||
bool hotDeadPixelFilter;
|
||||
bool hotPixelFilter;
|
||||
bool deadPixelFilter;
|
||||
bool hotDeadPixelThresh;
|
||||
bool darkFrame;
|
||||
bool dfAuto;
|
||||
|
@@ -97,7 +97,8 @@ PartialPasteDlg::PartialPasteDlg (Glib::ustring title) {
|
||||
raw_ca_autocorrect = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_AUTO")));
|
||||
raw_cared = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_CARED")));
|
||||
raw_cablue = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_CABLUE")));
|
||||
raw_hotdeadpix_filt = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_HOTDEADPIXFILT")));
|
||||
raw_hotpix_filt = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_HOTPIXFILT")));
|
||||
raw_deadpix_filt = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_DEADPIXFILT")));
|
||||
raw_linenoise = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_LINEDENOISE")));
|
||||
raw_greenthresh = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_GREENEQUIL")));
|
||||
raw_method = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAW_DMETHOD")));
|
||||
@@ -190,7 +191,8 @@ PartialPasteDlg::PartialPasteDlg (Glib::ustring title) {
|
||||
vboxes[6]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[6]->pack_start (*raw_linenoise, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start (*raw_greenthresh, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start (*raw_hotdeadpix_filt, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start (*raw_hotpix_filt, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start (*raw_deadpix_filt, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[6]->pack_start (*raw_expos, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start (*raw_preser, Gtk::PACK_SHRINK, 2);
|
||||
@@ -307,7 +309,8 @@ PartialPasteDlg::PartialPasteDlg (Glib::ustring title) {
|
||||
raw_ca_autocorrectConn = raw_ca_autocorrect->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
|
||||
raw_caredConn = raw_cared->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
|
||||
raw_cablueConn = raw_cablue->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
|
||||
raw_hotdeadpix_filtConn = raw_hotdeadpix_filt->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
|
||||
raw_hotpix_filtConn = raw_hotpix_filt->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
|
||||
raw_deadpix_filtConn = raw_deadpix_filt->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
|
||||
raw_linenoiseConn = raw_linenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
|
||||
raw_greenthreshConn = raw_greenthresh->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
|
||||
df_fileConn = df_file->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
|
||||
@@ -378,7 +381,8 @@ void PartialPasteDlg::rawToggled () {
|
||||
raw_ca_autocorrectConn.block (true);
|
||||
raw_caredConn.block (true);
|
||||
raw_cablueConn.block (true);
|
||||
raw_hotdeadpix_filtConn.block (true);
|
||||
raw_hotpix_filtConn.block (true);
|
||||
raw_deadpix_filtConn.block (true);
|
||||
raw_linenoiseConn.block (true);
|
||||
raw_greenthreshConn.block (true);
|
||||
df_fileConn.block (true);
|
||||
@@ -403,7 +407,8 @@ void PartialPasteDlg::rawToggled () {
|
||||
raw_ca_autocorrect->set_active (raw->get_active ());
|
||||
raw_cared->set_active (raw->get_active ());
|
||||
raw_cablue->set_active (raw->get_active ());
|
||||
raw_hotdeadpix_filt->set_active (raw->get_active ());
|
||||
raw_hotpix_filt->set_active (raw->get_active ());
|
||||
raw_deadpix_filt->set_active (raw->get_active ());
|
||||
raw_linenoise->set_active (raw->get_active ());
|
||||
raw_greenthresh->set_active (raw->get_active ());
|
||||
df_file->set_active (raw->get_active ());
|
||||
@@ -426,7 +431,8 @@ void PartialPasteDlg::rawToggled () {
|
||||
raw_ca_autocorrectConn.block (false);
|
||||
raw_caredConn.block (false);
|
||||
raw_cablueConn.block (false);
|
||||
raw_hotdeadpix_filtConn.block (false);
|
||||
raw_hotpix_filtConn.block (false);
|
||||
raw_deadpix_filtConn.block (false);
|
||||
raw_linenoiseConn.block (false);
|
||||
raw_greenthreshConn.block (false);
|
||||
df_fileConn.block (false);
|
||||
@@ -688,7 +694,9 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
|
||||
if (!raw_ca_autocorrect->get_active ()) filterPE.raw.caCorrection = falsePE.raw.caCorrection;
|
||||
if (!raw_cared->get_active ()) filterPE.raw.caRed = falsePE.raw.caRed;
|
||||
if (!raw_cablue->get_active ()) filterPE.raw.caBlue = falsePE.raw.caBlue;
|
||||
if (!raw_hotdeadpix_filt->get_active ()) { filterPE.raw.hotDeadPixelFilter = falsePE.raw.hotDeadPixelFilter;
|
||||
if (!raw_hotpix_filt->get_active ()) { filterPE.raw.hotPixelFilter = falsePE.raw.hotPixelFilter;
|
||||
filterPE.raw.hotDeadPixelThresh = falsePE.raw.hotDeadPixelThresh; }
|
||||
if (!raw_deadpix_filt->get_active ()) { filterPE.raw.deadPixelFilter = falsePE.raw.deadPixelFilter;
|
||||
filterPE.raw.hotDeadPixelThresh = falsePE.raw.hotDeadPixelThresh; }
|
||||
if (!df_file->get_active ()) filterPE.raw.darkFrame = falsePE.raw.darkFrame;
|
||||
if (!df_AutoSelect->get_active ()) filterPE.raw.dfAuto = falsePE.raw.dfAuto;
|
||||
|
@@ -94,7 +94,8 @@ class PartialPasteDlg : public Gtk::Dialog {
|
||||
Gtk::CheckButton* raw_ca_autocorrect;
|
||||
Gtk::CheckButton* raw_cared;
|
||||
Gtk::CheckButton* raw_cablue;
|
||||
Gtk::CheckButton* raw_hotdeadpix_filt;
|
||||
Gtk::CheckButton* raw_hotpix_filt;
|
||||
Gtk::CheckButton* raw_deadpix_filt;
|
||||
Gtk::CheckButton* raw_linenoise;
|
||||
Gtk::CheckButton* raw_greenthresh;
|
||||
Gtk::CheckButton* raw_method;
|
||||
@@ -121,7 +122,7 @@ class PartialPasteDlg : public Gtk::Dialog {
|
||||
sigc::connection coarserotConn, finerotConn, cropConn, resizeConn, perspectiveConn, commonTransConn;
|
||||
sigc::connection exifchConn, iptcConn, icmConn, gamcsconn;
|
||||
sigc::connection df_fileConn, df_AutoSelectConn, ff_fileConn, ff_AutoSelectConn, ff_BlurRadiusConn, ff_BlurTypeConn, ff_ClipControlConn;
|
||||
sigc::connection raw_caredConn, raw_cablueConn, raw_ca_autocorrectConn, raw_hotdeadpix_filtConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn; //,raw_all_enhanceConn
|
||||
sigc::connection raw_caredConn, raw_cablueConn, raw_ca_autocorrectConn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn; //,raw_all_enhanceConn
|
||||
|
||||
public:
|
||||
PartialPasteDlg (Glib::ustring title);
|
||||
|
@@ -26,54 +26,86 @@ using namespace rtengine::procparams;
|
||||
|
||||
PreProcess::PreProcess () : FoldableToolPanel(this)
|
||||
{
|
||||
hotDeadPixel = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_HOTDEADPIXFILT"))));
|
||||
hotDeadPixel->set_tooltip_markup (M("TP_PREPROCESS_HOTDEADPIXFILT_TOOLTIP"));
|
||||
|
||||
pack_start( *hotDeadPixel, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
hdpixelconn = hotDeadPixel->signal_toggled().connect ( sigc::mem_fun(*this, &PreProcess::hotDeadPixelChanged), true);
|
||||
|
||||
Gtk::HBox* hotdeadPixel = Gtk::manage( new Gtk::HBox () );
|
||||
hotdeadPixel->set_spacing(4);
|
||||
hotPixel = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_HOTPIXFILT"))));
|
||||
deadPixel = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_DEADPIXFILT"))));
|
||||
|
||||
hotPixel->set_tooltip_markup (M("TP_PREPROCESS_HOTPIXFILT_TOOLTIP"));
|
||||
deadPixel->set_tooltip_markup (M("TP_PREPROCESS_DEADPIXFILT_TOOLTIP"));
|
||||
|
||||
hotdeadPixel->pack_start( *hotPixel, Gtk::PACK_SHRINK);
|
||||
hotdeadPixel->pack_start( *deadPixel, Gtk::PACK_SHRINK, 0);
|
||||
pack_start(*hotdeadPixel, Gtk::PACK_SHRINK, 0);
|
||||
// hotdeadPixel->show();
|
||||
hpixelconn = hotPixel->signal_toggled().connect ( sigc::mem_fun(*this, &PreProcess::hotPixelChanged), true);
|
||||
dpixelconn = deadPixel->signal_toggled().connect ( sigc::mem_fun(*this, &PreProcess::deadPixelChanged), true);
|
||||
}
|
||||
|
||||
void PreProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited)
|
||||
{
|
||||
disableListener ();
|
||||
hdpixelconn.block (true);
|
||||
|
||||
hpixelconn.block (true);
|
||||
dpixelconn.block (true);
|
||||
if(pedited ){
|
||||
hotDeadPixel->set_inconsistent (!pedited->raw.hotDeadPixelFilter);
|
||||
hotPixel->set_inconsistent (!pedited->raw.hotPixelFilter);
|
||||
deadPixel->set_inconsistent (!pedited->raw.deadPixelFilter);
|
||||
}
|
||||
|
||||
lastHot = pp->raw.hotdeadpix_filt;
|
||||
lastHot = pp->raw.hotPixelFilter;
|
||||
lastDead = pp->raw.deadPixelFilter;
|
||||
hotPixel->set_active (pp->raw.hotPixelFilter);
|
||||
deadPixel->set_active (pp->raw.deadPixelFilter);
|
||||
|
||||
hotDeadPixel->set_active (pp->raw.hotdeadpix_filt);
|
||||
|
||||
hdpixelconn.block (false);
|
||||
hpixelconn.block (false);
|
||||
dpixelconn.block (false);
|
||||
enableListener ();
|
||||
}
|
||||
|
||||
void PreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
|
||||
{
|
||||
pp->raw.hotdeadpix_filt = hotDeadPixel->get_active();
|
||||
pp->raw.hotPixelFilter = hotPixel->get_active();
|
||||
pp->raw.deadPixelFilter = deadPixel->get_active();
|
||||
|
||||
if (pedited) {
|
||||
pedited->raw.hotDeadPixelFilter = !hotDeadPixel->get_inconsistent();
|
||||
pedited->raw.hotPixelFilter = !hotPixel->get_inconsistent();
|
||||
pedited->raw.deadPixelFilter = !deadPixel->get_inconsistent();
|
||||
}
|
||||
}
|
||||
|
||||
void PreProcess::hotDeadPixelChanged ()
|
||||
void PreProcess::hotPixelChanged ()
|
||||
{
|
||||
if (batchMode) {
|
||||
if (hotDeadPixel->get_inconsistent()) {
|
||||
hotDeadPixel->set_inconsistent (false);
|
||||
hdpixelconn.block (true);
|
||||
hotDeadPixel->set_active (false);
|
||||
hdpixelconn.block (false);
|
||||
if (hotPixel->get_inconsistent()) {
|
||||
hotPixel->set_inconsistent (false);
|
||||
hpixelconn.block (true);
|
||||
hotPixel->set_active (false);
|
||||
hpixelconn.block (false);
|
||||
}
|
||||
else if (lastHot)
|
||||
hotDeadPixel->set_inconsistent (true);
|
||||
hotPixel->set_inconsistent (true);
|
||||
|
||||
lastHot = hotDeadPixel->get_active ();
|
||||
lastHot = hotPixel->get_active ();
|
||||
}
|
||||
if (listener)
|
||||
listener->panelChanged (EvPreProcessHotDeadPixel, hotDeadPixel->get_active()?M("GENERAL_ENABLED"):M("GENERAL_DISABLED"));
|
||||
listener->panelChanged (EvPreProcessHotPixel, hotPixel->get_active()?M("GENERAL_ENABLED"):M("GENERAL_DISABLED"));
|
||||
}
|
||||
|
||||
void PreProcess::deadPixelChanged ()
|
||||
{
|
||||
if (batchMode) {
|
||||
if (deadPixel->get_inconsistent()) {
|
||||
deadPixel->set_inconsistent (false);
|
||||
dpixelconn.block (true);
|
||||
deadPixel->set_active (false);
|
||||
dpixelconn.block (false);
|
||||
}
|
||||
else if (lastDead)
|
||||
deadPixel->set_inconsistent (true);
|
||||
|
||||
lastDead = deadPixel->get_active ();
|
||||
}
|
||||
if (listener)
|
||||
listener->panelChanged (EvPreProcessDeadPixel, deadPixel->get_active()?M("GENERAL_ENABLED"):M("GENERAL_DISABLED"));
|
||||
}
|
||||
|
@@ -27,10 +27,11 @@
|
||||
class PreProcess : public ToolParamBlock, /*public AdjusterListener,*/ public FoldableToolPanel {
|
||||
|
||||
protected:
|
||||
|
||||
Gtk::CheckButton* hotDeadPixel;
|
||||
bool lastHot;
|
||||
sigc::connection hdpixelconn;
|
||||
Gtk::CheckButton* hotPixel;
|
||||
Gtk::CheckButton* deadPixel;
|
||||
bool lastHot,lastDead;
|
||||
sigc::connection hpixelconn;
|
||||
sigc::connection dpixelconn;
|
||||
|
||||
public:
|
||||
|
||||
@@ -41,7 +42,8 @@ class PreProcess : public ToolParamBlock, /*public AdjusterListener,*/ public Fo
|
||||
//void setBatchMode (bool batchMode);
|
||||
//void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
||||
|
||||
void hotDeadPixelChanged();
|
||||
void hotPixelChanged();
|
||||
void deadPixelChanged();
|
||||
|
||||
//void adjusterChanged (Adjuster* a, double newval);
|
||||
//void setAdjusterBehavior (bool linedenoiseadd, bool greenequiladd);
|
||||
|
Reference in New Issue
Block a user