pixelshift: option to smooth transitions between regions with and without motion

This commit is contained in:
heckflosse
2017-01-19 18:46:41 +01:00
parent e231d6c06d
commit 8d40dbdc0b
10 changed files with 69 additions and 30 deletions

View File

@@ -128,6 +128,10 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
pixelShiftBlur->set_tooltip_text (M("TP_RAW_PIXELSHIFTBLUR_TOOLTIP"));
pixelShiftOptions->pack_start(*pixelShiftBlur);
pixelShiftSmooth = Gtk::manage (new Gtk::CheckButton(M("TP_RAW_PIXELSHIFTSMOOTH")));
pixelShiftSmooth->set_tooltip_text (M("TP_RAW_PIXELSHIFTSMOOTH_TOOLTIP"));
pixelShiftOptions->pack_start(*pixelShiftSmooth);
pixelShiftHoleFill = Gtk::manage (new Gtk::CheckButton(M("TP_RAW_PIXELSHIFTHOLEFILL")));
pixelShiftHoleFill->set_tooltip_text (M("TP_RAW_PIXELSHIFTHOLEFILL_TOOLTIP"));
pixelShiftOptions->pack_start(*pixelShiftHoleFill);
@@ -301,6 +305,7 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
pixelShiftMedian3conn = pixelShiftMedian3->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftMedian3Changed), true);
pixelShiftGreenconn = pixelShiftGreen->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftGreenChanged), true);
pixelShiftBlurconn = pixelShiftBlur->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftBlurChanged), true);
pixelShiftSmoothconn = pixelShiftSmooth->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftSmoothChanged), true);
pixelShiftExp0conn = pixelShiftExp0->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftExp0Changed), true);
pixelShiftNonGreenCrossconn = pixelShiftNonGreenCross->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftNonGreenCrossChanged), true);
pixelShiftNonGreenCross2conn = pixelShiftNonGreenCross2->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftNonGreenCross2Changed), true);
@@ -342,6 +347,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
pixelShiftMedian3->set_inconsistent(!pedited->raw.bayersensor.pixelShiftMedian3);
pixelShiftGreen->set_inconsistent(!pedited->raw.bayersensor.pixelShiftGreen);
pixelShiftBlur->set_inconsistent(!pedited->raw.bayersensor.pixelShiftBlur);
pixelShiftSmooth->set_inconsistent(!pedited->raw.bayersensor.pixelShiftSmooth);
pixelShiftExp0->set_inconsistent(!pedited->raw.bayersensor.pixelShiftExp0);
pixelShiftNonGreenCross->set_inconsistent(!pedited->raw.bayersensor.pixelShiftNonGreenCross);
pixelShiftNonGreenCross2->set_inconsistent(!pedited->raw.bayersensor.pixelShiftNonGreenCross2);
@@ -386,6 +392,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
pixelShiftMedian3->set_active(pp->raw.bayersensor.pixelShiftMedian3);
pixelShiftGreen->set_active(pp->raw.bayersensor.pixelShiftGreen);
pixelShiftBlur->set_active(pp->raw.bayersensor.pixelShiftBlur);
pixelShiftSmooth->set_active(pp->raw.bayersensor.pixelShiftSmooth);
pixelShiftExp0->set_active(pp->raw.bayersensor.pixelShiftExp0);
pixelShiftNonGreenCross->set_active(pp->raw.bayersensor.pixelShiftNonGreenCross);
pixelShiftNonGreenCross2->set_active(pp->raw.bayersensor.pixelShiftNonGreenCross2);
@@ -407,6 +414,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
pixelShiftHoleFill->set_sensitive(pixelShiftAutomatic->get_active () && pixelShiftMotionCorrection->get_active_row_number() == 5);
pixelShiftBlur->set_sensitive(pixelShiftAutomatic->get_active () && pixelShiftMotionCorrection->get_active_row_number() == 5);
pixelShiftSmooth->set_sensitive(pixelShiftAutomatic->get_active () && pixelShiftMotionCorrection->get_active_row_number() == 5 && pixelShiftBlur->get_active());
if (!batchMode) {
if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::dcb] ||
@@ -483,6 +491,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
pp->raw.bayersensor.pixelShiftMedian3 = pixelShiftMedian3->get_active();
pp->raw.bayersensor.pixelShiftGreen = pixelShiftGreen->get_active();
pp->raw.bayersensor.pixelShiftBlur = pixelShiftBlur->get_active();
pp->raw.bayersensor.pixelShiftSmooth = pixelShiftSmooth->get_active();
pp->raw.bayersensor.pixelShiftExp0 = pixelShiftExp0->get_active();
pp->raw.bayersensor.pixelShiftNonGreenCross = pixelShiftNonGreenCross->get_active();
pp->raw.bayersensor.pixelShiftNonGreenCross2 = pixelShiftNonGreenCross2->get_active();
@@ -529,6 +538,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
pedited->raw.bayersensor.pixelShiftMedian3 = !pixelShiftMedian3->get_inconsistent();
pedited->raw.bayersensor.pixelShiftGreen = !pixelShiftGreen->get_inconsistent();
pedited->raw.bayersensor.pixelShiftBlur = !pixelShiftBlur->get_inconsistent();
pedited->raw.bayersensor.pixelShiftSmooth = !pixelShiftSmooth->get_inconsistent();
pedited->raw.bayersensor.pixelShiftExp0 = !pixelShiftExp0->get_inconsistent();
pedited->raw.bayersensor.pixelShiftNonGreenCross = !pixelShiftNonGreenCross->get_inconsistent();
pedited->raw.bayersensor.pixelShiftNonGreenCross2 = !pixelShiftNonGreenCross2->get_inconsistent();
@@ -650,9 +660,11 @@ void BayerProcess::psMotionCorrectionChanged ()
if(pixelShiftMotionCorrection->get_active_row_number() == 5) {
pixelShiftBlur->set_sensitive(true);
pixelShiftHoleFill->set_sensitive(true);
pixelShiftSmooth->set_sensitive(pixelShiftBlur->get_active());
} else {
pixelShiftBlur->set_sensitive(false);
pixelShiftHoleFill->set_sensitive(false);
pixelShiftSmooth->set_sensitive(false);
}
if (listener) {
@@ -823,6 +835,7 @@ void BayerProcess::pixelShiftAutomaticChanged ()
pixelShiftMedian3->set_sensitive(pixelShiftAutomatic->get_active () && pixelShiftMedian->get_active());
pixelShiftGreen->set_sensitive(pixelShiftAutomatic->get_active ());
pixelShiftBlur->set_sensitive(pixelShiftAutomatic->get_active () && pixelShiftMotionCorrection->get_active_row_number() == 5);
pixelShiftSmooth->set_sensitive(pixelShiftAutomatic->get_active () && pixelShiftMotionCorrection->get_active_row_number() == 5 && pixelShiftBlur->get_active());
pixelShiftExp0->set_sensitive(pixelShiftAutomatic->get_active ());
pixelShiftNonGreenCross->set_sensitive(pixelShiftAutomatic->get_active ());
pixelShiftNonGreenCross2->set_sensitive(pixelShiftAutomatic->get_active ());
@@ -971,11 +984,33 @@ void BayerProcess::pixelShiftBlurChanged ()
lastDCBen = pixelShiftBlur->get_active ();
}
pixelShiftSmooth->set_sensitive(pixelShiftBlur->get_active ());
if (listener) {
listener->panelChanged (EvPixelShiftBlur, pixelShiftBlur->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
}
}
void BayerProcess::pixelShiftSmoothChanged ()
{
if (batchMode) {
if (pixelShiftSmooth->get_inconsistent()) {
pixelShiftSmooth->set_inconsistent (false);
pixelShiftSmoothconn.block (true);
pixelShiftSmooth->set_active (false);
pixelShiftSmoothconn.block (false);
} else if (lastDCBen) {
pixelShiftSmooth->set_inconsistent (true);
}
lastDCBen = pixelShiftSmooth->get_active ();
}
if (listener) {
listener->panelChanged (EvPixelShiftSmooth, pixelShiftSmooth->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
}
}
void BayerProcess::pixelShiftExp0Changed ()
{
if (batchMode) {

View File

@@ -56,6 +56,7 @@ protected:
Gtk::CheckButton* pixelShiftNonGreenAmaze;
Gtk::CheckButton* pixelShiftGreen;
Gtk::CheckButton* pixelShiftBlur;
Gtk::CheckButton* pixelShiftSmooth;
Gtk::CheckButton* pixelShiftExp0;
Gtk::CheckButton* pixelShiftHoleFill;
Gtk::CheckButton* pixelShiftMedian;
@@ -75,7 +76,7 @@ protected:
sigc::connection methodconn, imagenumberconn, psmcconn, dcbEnhconn,
pixelShiftShowMotionconn, pixelShiftShowMotionMaskOnlyconn, pixelShiftAutomaticconn,
pixelShiftNonGreenHorizontalconn, pixelShiftNonGreenVerticalconn, pixelShiftHoleFillconn, pixelShiftMedianconn, pixelShiftMedian3conn, pixelShiftNonGreenCrossconn,
pixelShiftNonGreenCross2conn, pixelShiftNonGreenAmazeconn, pixelShiftGreenconn, pixelShiftBlurconn, pixelShiftExp0conn, pixelShiftMotionMethodConn;
pixelShiftNonGreenCross2conn, pixelShiftNonGreenAmazeconn, pixelShiftGreenconn, pixelShiftBlurconn, pixelShiftSmoothconn, pixelShiftExp0conn, pixelShiftMotionMethodConn;
public:
BayerProcess ();
@@ -100,6 +101,7 @@ public:
void pixelShiftMedian3Changed();
void pixelShiftGreenChanged();
void pixelShiftBlurChanged();
void pixelShiftSmoothChanged();
void pixelShiftExp0Changed();
void pixelShiftNonGreenCrossChanged();
void pixelShiftNonGreenCross2Changed();

View File

@@ -392,6 +392,7 @@ void ParamsEdited::set (bool v)
raw.bayersensor.pixelShiftMedian3 = v;
raw.bayersensor.pixelShiftGreen = v;
raw.bayersensor.pixelShiftBlur = v;
raw.bayersensor.pixelShiftSmooth = v;
raw.bayersensor.pixelShiftExp0 = v;
raw.bayersensor.pixelShiftNonGreenCross = v;
raw.bayersensor.pixelShiftNonGreenCross2 = v;
@@ -914,6 +915,7 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
raw.bayersensor.pixelShiftMedian3 = raw.bayersensor.pixelShiftMedian3 && p.raw.bayersensor.pixelShiftMedian3 == other.raw.bayersensor.pixelShiftMedian3;
raw.bayersensor.pixelShiftGreen = raw.bayersensor.pixelShiftGreen && p.raw.bayersensor.pixelShiftGreen == other.raw.bayersensor.pixelShiftGreen;
raw.bayersensor.pixelShiftBlur = raw.bayersensor.pixelShiftBlur && p.raw.bayersensor.pixelShiftBlur == other.raw.bayersensor.pixelShiftBlur;
raw.bayersensor.pixelShiftSmooth = raw.bayersensor.pixelShiftSmooth && p.raw.bayersensor.pixelShiftSmooth == other.raw.bayersensor.pixelShiftSmooth;
raw.bayersensor.pixelShiftExp0 = raw.bayersensor.pixelShiftExp0 && p.raw.bayersensor.pixelShiftExp0 == other.raw.bayersensor.pixelShiftExp0;
raw.bayersensor.pixelShiftNonGreenCross = raw.bayersensor.pixelShiftNonGreenCross && p.raw.bayersensor.pixelShiftNonGreenCross == other.raw.bayersensor.pixelShiftNonGreenCross;
raw.bayersensor.pixelShiftNonGreenCross2 = raw.bayersensor.pixelShiftNonGreenCross2 && p.raw.bayersensor.pixelShiftNonGreenCross2 == other.raw.bayersensor.pixelShiftNonGreenCross2;
@@ -2418,6 +2420,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
toEdit.raw.bayersensor.pixelShiftBlur = mods.raw.bayersensor.pixelShiftBlur;
}
if (raw.bayersensor.pixelShiftSmooth) {
toEdit.raw.bayersensor.pixelShiftSmooth = mods.raw.bayersensor.pixelShiftSmooth;
}
if (raw.bayersensor.pixelShiftExp0) {
toEdit.raw.bayersensor.pixelShiftExp0 = mods.raw.bayersensor.pixelShiftExp0;
}
@@ -2946,7 +2952,7 @@ bool RAWParamsEdited::BayerSensor::isUnchanged() const
return method && imageNum && dcbIterations && dcbEnhance && lmmseIterations/*&& allEnhance*/ && greenEq
&& pixelShiftMotion && pixelShiftMotionCorrection && pixelShiftMotionCorrectionMethod && pixelShiftStddevFactorGreen && pixelShiftStddevFactorRed && pixelShiftStddevFactorBlue && pixelShiftEperIso
&& pixelShiftNreadIso && pixelShiftPrnu && pixelShiftSigma && pixelShiftSum && pixelShiftRedBlueWeight && pixelshiftShowMotion && pixelshiftShowMotionMaskOnly
&& pixelShiftAutomatic && pixelShiftNonGreenHorizontal && pixelShiftNonGreenVertical && pixelShiftHoleFill && pixelShiftMedian && pixelShiftMedian3 && pixelShiftNonGreenCross && pixelShiftNonGreenCross2 && pixelShiftNonGreenAmaze && pixelShiftGreen && pixelShiftBlur && pixelShiftExp0
&& pixelShiftAutomatic && pixelShiftNonGreenHorizontal && pixelShiftNonGreenVertical && pixelShiftHoleFill && pixelShiftMedian && pixelShiftMedian3 && pixelShiftNonGreenCross && pixelShiftNonGreenCross2 && pixelShiftNonGreenAmaze && pixelShiftGreen && pixelShiftBlur && pixelShiftSmooth && pixelShiftExp0
&& linenoise && exBlack0 && exBlack1 && exBlack2 && exBlack3 && exTwoGreen;
}

View File

@@ -714,6 +714,7 @@ public:
bool pixelShiftMedian3;
bool pixelShiftGreen;
bool pixelShiftBlur;
bool pixelShiftSmooth;
bool pixelShiftExp0;
bool pixelShiftNonGreenCross;
bool pixelShiftNonGreenCross2;