pixelshift: Optionally use one green instead of averaging two greens

This commit is contained in:
heckflosse
2017-12-15 18:59:26 +01:00
parent a17084f638
commit 7d430adbc6
12 changed files with 4917 additions and 8 deletions

View File

@@ -225,6 +225,11 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
pixelShiftLmmse->set_tooltip_text (M("TP_RAW_PIXELSHIFTLMMSE_TOOLTIP"));
pixelShiftOptions->pack_start(*pixelShiftLmmse);
pixelShiftOneGreen = Gtk::manage (new CheckBox(M("TP_RAW_PIXELSHIFTONEGREEN"), multiImage));
pixelShiftOneGreen->setCheckBoxListener (this);
pixelShiftOneGreen->set_tooltip_text (M("TP_RAW_PIXELSHIFTONEGREEN_TOOLTIP"));
pixelShiftOptions->pack_start(*pixelShiftOneGreen);
#ifdef PIXELSHIFTDEV
pixelShiftMotion = Gtk::manage (new Adjuster (M("TP_RAW_PIXELSHIFTMOTION"), 0, 100, 1, 70));
pixelShiftMotion->setAdjusterListener (this);
@@ -376,6 +381,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
}
pixelShiftSmooth->setValue (pp->raw.bayersensor.pixelShiftSmoothFactor);
pixelShiftLmmse->setValue (pp->raw.bayersensor.pixelShiftLmmse);
pixelShiftOneGreen->setValue (pp->raw.bayersensor.pixelShiftOneGreen);
pixelShiftEqualBright->setValue (pp->raw.bayersensor.pixelShiftEqualBright);
pixelShiftEqualBrightChannel->set_sensitive (pp->raw.bayersensor.pixelShiftEqualBright);
pixelShiftEqualBrightChannel->setValue (pp->raw.bayersensor.pixelShiftEqualBrightChannel);
@@ -427,6 +433,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
pixelShiftBlur->setEdited (pedited->raw.bayersensor.pixelShiftBlur);
pixelShiftSmooth->setEditedState ( pedited->raw.bayersensor.pixelShiftSmooth ? Edited : UnEdited);
pixelShiftLmmse->setEdited (pedited->raw.bayersensor.pixelShiftLmmse);
pixelShiftOneGreen->setEdited (pedited->raw.bayersensor.pixelShiftOneGreen);
pixelShiftEqualBright->setEdited (pedited->raw.bayersensor.pixelShiftEqualBright);
pixelShiftEqualBrightChannel->setEdited (pedited->raw.bayersensor.pixelShiftEqualBrightChannel);
pixelShiftNonGreenCross->setEdited (pedited->raw.bayersensor.pixelShiftNonGreenCross);
@@ -531,6 +538,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
pp->raw.bayersensor.pixelShiftBlur = pixelShiftBlur->getLastActive ();
pp->raw.bayersensor.pixelShiftSmoothFactor = pixelShiftSmooth->getValue();
pp->raw.bayersensor.pixelShiftLmmse = pixelShiftLmmse->getLastActive ();
pp->raw.bayersensor.pixelShiftOneGreen = pixelShiftOneGreen->getLastActive ();
pp->raw.bayersensor.pixelShiftEqualBright = pixelShiftEqualBright->getLastActive ();
pp->raw.bayersensor.pixelShiftEqualBrightChannel = pixelShiftEqualBrightChannel->getLastActive ();
pp->raw.bayersensor.pixelShiftNonGreenCross = pixelShiftNonGreenCross->getLastActive ();
@@ -583,6 +591,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
pedited->raw.bayersensor.pixelShiftBlur = !pixelShiftBlur->get_inconsistent();
pedited->raw.bayersensor.pixelShiftSmooth = pixelShiftSmooth->getEditedState();
pedited->raw.bayersensor.pixelShiftLmmse = !pixelShiftLmmse->get_inconsistent();
pedited->raw.bayersensor.pixelShiftOneGreen = !pixelShiftOneGreen->get_inconsistent();
pedited->raw.bayersensor.pixelShiftEqualBright = !pixelShiftEqualBright->get_inconsistent();
pedited->raw.bayersensor.pixelShiftEqualBrightChannel = !pixelShiftEqualBrightChannel->get_inconsistent();
pedited->raw.bayersensor.pixelShiftNonGreenCross = !pixelShiftNonGreenCross->get_inconsistent();
@@ -849,6 +858,10 @@ void BayerProcess::checkBoxToggled (CheckBox* c, CheckValue newval)
if (listener) {
listener->panelChanged (EvPixelShiftLmmse, pixelShiftLmmse->getValueAsStr ());
}
} else if (c == pixelShiftOneGreen) {
if (listener) {
listener->panelChanged (EvPixelShiftOneGreen, pixelShiftOneGreen->getValueAsStr ());
}
} else if (c == pixelShiftEqualBright) {
if (!batchMode) {
pixelShiftEqualBrightChannel->set_sensitive(newval != CheckValue::off);

View File

@@ -49,6 +49,7 @@ protected:
CheckBox* pixelShiftBlur;
CheckBox* pixelShiftHoleFill;
CheckBox* pixelShiftMedian;
CheckBox* pixelShiftOneGreen;
CheckBox* pixelShiftLmmse;
CheckBox* pixelShiftEqualBright;
CheckBox* pixelShiftEqualBrightChannel;

View File

@@ -411,6 +411,7 @@ void ParamsEdited::set (bool v)
raw.bayersensor.pixelShiftSmooth = v;
raw.bayersensor.pixelShiftExp0 = v;
raw.bayersensor.pixelShiftLmmse = v;
raw.bayersensor.pixelShiftOneGreen = v;
raw.bayersensor.pixelShiftEqualBright = v;
raw.bayersensor.pixelShiftEqualBrightChannel = v;
raw.bayersensor.pixelShiftNonGreenCross = v;
@@ -953,6 +954,7 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
raw.bayersensor.pixelShiftSmooth = raw.bayersensor.pixelShiftSmooth && p.raw.bayersensor.pixelShiftSmoothFactor == other.raw.bayersensor.pixelShiftSmoothFactor;
raw.bayersensor.pixelShiftExp0 = raw.bayersensor.pixelShiftExp0 && p.raw.bayersensor.pixelShiftExp0 == other.raw.bayersensor.pixelShiftExp0;
raw.bayersensor.pixelShiftLmmse = raw.bayersensor.pixelShiftLmmse && p.raw.bayersensor.pixelShiftLmmse == other.raw.bayersensor.pixelShiftLmmse;
raw.bayersensor.pixelShiftOneGreen = raw.bayersensor.pixelShiftOneGreen && p.raw.bayersensor.pixelShiftOneGreen == other.raw.bayersensor.pixelShiftOneGreen;
raw.bayersensor.pixelShiftEqualBright = raw.bayersensor.pixelShiftEqualBright && p.raw.bayersensor.pixelShiftEqualBright == other.raw.bayersensor.pixelShiftEqualBright;
raw.bayersensor.pixelShiftEqualBrightChannel = raw.bayersensor.pixelShiftEqualBrightChannel && p.raw.bayersensor.pixelShiftEqualBrightChannel == other.raw.bayersensor.pixelShiftEqualBrightChannel;
raw.bayersensor.pixelShiftNonGreenCross = raw.bayersensor.pixelShiftNonGreenCross && p.raw.bayersensor.pixelShiftNonGreenCross == other.raw.bayersensor.pixelShiftNonGreenCross;
@@ -2523,6 +2525,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
toEdit.raw.bayersensor.pixelShiftLmmse = mods.raw.bayersensor.pixelShiftLmmse;
}
if (raw.bayersensor.pixelShiftOneGreen) {
toEdit.raw.bayersensor.pixelShiftOneGreen = mods.raw.bayersensor.pixelShiftOneGreen;
}
if (raw.bayersensor.pixelShiftEqualBright) {
toEdit.raw.bayersensor.pixelShiftEqualBright = mods.raw.bayersensor.pixelShiftEqualBright;
}
@@ -3051,7 +3057,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 && pixelShiftSmooth && pixelShiftExp0 && pixelShiftLmmse && pixelShiftEqualBright && pixelShiftEqualBrightChannel
&& pixelShiftAutomatic && pixelShiftNonGreenHorizontal && pixelShiftNonGreenVertical && pixelShiftHoleFill && pixelShiftMedian && pixelShiftMedian3 && pixelShiftNonGreenCross && pixelShiftNonGreenCross2 && pixelShiftNonGreenAmaze && pixelShiftGreen && pixelShiftBlur && pixelShiftSmooth && pixelShiftExp0 && pixelShiftLmmse && pixelShiftOneGreen && pixelShiftEqualBright && pixelShiftEqualBrightChannel
&& linenoise && exBlack0 && exBlack1 && exBlack2 && exBlack3 && exTwoGreen;
}

View File

@@ -734,6 +734,7 @@ public:
bool pixelShiftSmooth;
bool pixelShiftExp0;
bool pixelShiftLmmse;
bool pixelShiftOneGreen;
bool pixelShiftEqualBright;
bool pixelShiftEqualBrightChannel;
bool pixelShiftNonGreenCross;