astyled and removed whitespace from bayerpreprocess.cc

This commit is contained in:
Morgan Hardwood 2018-12-11 20:47:50 +01:00
parent f72277bf4e
commit aece987d55

View File

@ -24,14 +24,14 @@
using namespace rtengine; using namespace rtengine;
using namespace rtengine::procparams; using namespace rtengine::procparams;
BayerPreProcess::BayerPreProcess () : FoldableToolPanel(this, "bayerpreprocess", M("TP_PREPROCESS_LABEL"), true) BayerPreProcess::BayerPreProcess() : FoldableToolPanel(this, "bayerpreprocess", M("TP_PREPROCESS_LABEL"), true)
{ {
auto m = ProcEventMapper::getInstance(); auto m = ProcEventMapper::getInstance();
EvLineDenoiseDirection = m->newEvent(DARKFRAME, "HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION"); EvLineDenoiseDirection = m->newEvent(DARKFRAME, "HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION");
EvPDAFLinesFilter = m->newEvent(DARKFRAME, "HISTORY_MSG_PREPROCESS_PDAFLINESFILTER"); EvPDAFLinesFilter = m->newEvent(DARKFRAME, "HISTORY_MSG_PREPROCESS_PDAFLINESFILTER");
lineDenoise = Gtk::manage(new Adjuster (M("TP_PREPROCESS_LINEDENOISE"), 0, 1000, 1, 0)); lineDenoise = Gtk::manage(new Adjuster(M("TP_PREPROCESS_LINEDENOISE"), 0, 1000, 1, 0));
lineDenoise->setAdjusterListener (this); lineDenoise->setAdjusterListener(this);
if (lineDenoise->delay < options.adjusterMaxDelay) { if (lineDenoise->delay < options.adjusterMaxDelay) {
lineDenoise->delay = options.adjusterMaxDelay; lineDenoise->delay = options.adjusterMaxDelay;
@ -39,8 +39,8 @@ BayerPreProcess::BayerPreProcess () : FoldableToolPanel(this, "bayerpreprocess",
lineDenoise->show(); lineDenoise->show();
greenEqThreshold = Gtk::manage(new Adjuster (M("TP_PREPROCESS_GREENEQUIL"), 0, 100, 1, 0)); greenEqThreshold = Gtk::manage(new Adjuster(M("TP_PREPROCESS_GREENEQUIL"), 0, 100, 1, 0));
greenEqThreshold->setAdjusterListener (this); greenEqThreshold->setAdjusterListener(this);
if (greenEqThreshold->delay < options.adjusterMaxDelay) { if (greenEqThreshold->delay < options.adjusterMaxDelay) {
greenEqThreshold->delay = options.adjusterMaxDelay; greenEqThreshold->delay = options.adjusterMaxDelay;
@ -60,12 +60,12 @@ BayerPreProcess::BayerPreProcess () : FoldableToolPanel(this, "bayerpreprocess",
hb->pack_start(*lineDenoiseDirection); hb->pack_start(*lineDenoiseDirection);
pack_start( *lineDenoise, Gtk::PACK_SHRINK, 4); pack_start(*lineDenoise, Gtk::PACK_SHRINK, 4);
pack_start(*hb, Gtk::PACK_SHRINK, 4); pack_start(*hb, Gtk::PACK_SHRINK, 4);
pack_start( *Gtk::manage (new Gtk::HSeparator())); pack_start(*Gtk::manage(new Gtk::HSeparator()));
pack_start( *greenEqThreshold, Gtk::PACK_SHRINK, 4); pack_start(*greenEqThreshold, Gtk::PACK_SHRINK, 4);
pdafLinesFilter = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_PDAFLINESFILTER")))); pdafLinesFilter = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_PDAFLINESFILTER"))));
pdafLinesFilter->show(); pdafLinesFilter->show();
@ -77,58 +77,64 @@ BayerPreProcess::BayerPreProcess () : FoldableToolPanel(this, "bayerpreprocess",
void BayerPreProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) void BayerPreProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited)
{ {
disableListener (); disableListener();
if (pedited) {
lineDenoise->setEditedState(pedited->raw.bayersensor.linenoise ? Edited : UnEdited);
greenEqThreshold->setEditedState(pedited->raw.bayersensor.greenEq ? Edited : UnEdited);
if(pedited ) {
lineDenoise->setEditedState( pedited->raw.bayersensor.linenoise ? Edited : UnEdited );
greenEqThreshold->setEditedState( pedited->raw.bayersensor.greenEq ? Edited : UnEdited );
if (!pedited->raw.bayersensor.linenoiseDirection) { if (!pedited->raw.bayersensor.linenoiseDirection) {
lineDenoiseDirection->set_active(3); lineDenoiseDirection->set_active(3);
} }
pdafLinesFilter->set_inconsistent(!pedited->raw.bayersensor.pdafLinesFilter); pdafLinesFilter->set_inconsistent(!pedited->raw.bayersensor.pdafLinesFilter);
} }
lineDenoise->setValue (pp->raw.bayersensor.linenoise); lineDenoise->setValue(pp->raw.bayersensor.linenoise);
int d = int(pp->raw.bayersensor.linenoiseDirection)-1; int d = int(pp->raw.bayersensor.linenoiseDirection) - 1;
if (d == 4) { if (d == 4) {
--d; --d;
} }
lineDenoiseDirection->set_active(d); lineDenoiseDirection->set_active(d);
greenEqThreshold->setValue (pp->raw.bayersensor.greenthresh); greenEqThreshold->setValue(pp->raw.bayersensor.greenthresh);
pdafLinesFilter->set_active(pp->raw.bayersensor.pdafLinesFilter); pdafLinesFilter->set_active(pp->raw.bayersensor.pdafLinesFilter);
enableListener (); enableListener();
} }
void BayerPreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited) void BayerPreProcess::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
{ {
pp->raw.bayersensor.linenoise = lineDenoise->getIntValue(); pp->raw.bayersensor.linenoise = lineDenoise->getIntValue();
int d = lineDenoiseDirection->get_active_row_number() + 1; int d = lineDenoiseDirection->get_active_row_number() + 1;
if (d == 4) { if (d == 4) {
++d; ++d;
} }
pp->raw.bayersensor.linenoiseDirection = RAWParams::BayerSensor::LineNoiseDirection(d); pp->raw.bayersensor.linenoiseDirection = RAWParams::BayerSensor::LineNoiseDirection(d);
pp->raw.bayersensor.greenthresh = greenEqThreshold->getIntValue(); pp->raw.bayersensor.greenthresh = greenEqThreshold->getIntValue();
pp->raw.bayersensor.pdafLinesFilter = pdafLinesFilter->get_active(); pp->raw.bayersensor.pdafLinesFilter = pdafLinesFilter->get_active();
if (pedited) { if (pedited) {
pedited->raw.bayersensor.linenoise = lineDenoise->getEditedState (); pedited->raw.bayersensor.linenoise = lineDenoise->getEditedState();
pedited->raw.bayersensor.greenEq = greenEqThreshold->getEditedState (); pedited->raw.bayersensor.greenEq = greenEqThreshold->getEditedState();
pedited->raw.bayersensor.linenoise = lineDenoiseDirection->get_active_row_number() != 3; pedited->raw.bayersensor.linenoise = lineDenoiseDirection->get_active_row_number() != 3;
pedited->raw.bayersensor.pdafLinesFilter = !pdafLinesFilter->get_inconsistent(); pedited->raw.bayersensor.pdafLinesFilter = !pdafLinesFilter->get_inconsistent();
} }
} }
void BayerPreProcess::adjusterChanged (Adjuster* a, double newval) void BayerPreProcess::adjusterChanged(Adjuster* a, double newval)
{ {
if (listener) { if (listener) {
Glib::ustring value = a->getTextValue(); Glib::ustring value = a->getTextValue();
if (a == greenEqThreshold) { if (a == greenEqThreshold) {
listener->panelChanged (EvPreProcessGEquilThresh, value ); listener->panelChanged(EvPreProcessGEquilThresh, value);
} else if (a == lineDenoise) { } else if (a == lineDenoise) {
listener->panelChanged (EvPreProcessLineDenoise, value ); listener->panelChanged(EvPreProcessLineDenoise, value);
} }
} }
} }
@ -139,9 +145,10 @@ void BayerPreProcess::adjusterAutoToggled(Adjuster* a, bool newval)
void BayerPreProcess::setBatchMode(bool batchMode) void BayerPreProcess::setBatchMode(bool batchMode)
{ {
ToolPanel::setBatchMode (batchMode); ToolPanel::setBatchMode(batchMode);
lineDenoise->showEditedCB (); lineDenoise->showEditedCB();
greenEqThreshold->showEditedCB (); greenEqThreshold->showEditedCB();
if (batchMode) { if (batchMode) {
lineDenoiseDirection->append(M("GENERAL_UNCHANGED")); lineDenoiseDirection->append(M("GENERAL_UNCHANGED"));
} }
@ -149,26 +156,26 @@ void BayerPreProcess::setBatchMode(bool batchMode)
void BayerPreProcess::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) void BayerPreProcess::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited)
{ {
lineDenoise->setDefault( defParams->raw.bayersensor.linenoise); lineDenoise->setDefault(defParams->raw.bayersensor.linenoise);
greenEqThreshold->setDefault (defParams->raw.bayersensor.greenthresh); greenEqThreshold->setDefault(defParams->raw.bayersensor.greenthresh);
if (pedited) { if (pedited) {
lineDenoise->setDefaultEditedState( pedited->raw.bayersensor.linenoise ? Edited : UnEdited); lineDenoise->setDefaultEditedState(pedited->raw.bayersensor.linenoise ? Edited : UnEdited);
greenEqThreshold->setDefaultEditedState(pedited->raw.bayersensor.greenEq ? Edited : UnEdited); greenEqThreshold->setDefaultEditedState(pedited->raw.bayersensor.greenEq ? Edited : UnEdited);
} else { } else {
lineDenoise->setDefaultEditedState( Irrelevant ); lineDenoise->setDefaultEditedState(Irrelevant);
greenEqThreshold->setDefaultEditedState(Irrelevant ); greenEqThreshold->setDefaultEditedState(Irrelevant);
} }
} }
void BayerPreProcess::setAdjusterBehavior (bool linedenoiseadd, bool greenequiladd) void BayerPreProcess::setAdjusterBehavior(bool linedenoiseadd, bool greenequiladd)
{ {
lineDenoise->setAddMode(linedenoiseadd); lineDenoise->setAddMode(linedenoiseadd);
greenEqThreshold->setAddMode(greenequiladd); greenEqThreshold->setAddMode(greenequiladd);
} }
void BayerPreProcess::trimValues (rtengine::procparams::ProcParams* pp) void BayerPreProcess::trimValues(rtengine::procparams::ProcParams* pp)
{ {
lineDenoise->trimValue(pp->raw.bayersensor.linenoise); lineDenoise->trimValue(pp->raw.bayersensor.linenoise);