Formatted all .cc and .h code in rtengine, rtexif and rtgui using astyle

This commit is contained in:
DrSlony
2015-08-11 11:55:03 +02:00
parent effb46c3e1
commit 0e0cfb9b25
452 changed files with 133354 additions and 99460 deletions

View File

@@ -26,102 +26,113 @@ using namespace rtengine::procparams;
PreProcess::PreProcess () : FoldableToolPanel(this, "preprocess", M("TP_PREPROCESS_LABEL"), 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);
hdThreshold = Gtk::manage (new Adjuster (M("TP_RAW_HD"),20,200,2,100));
hdThreshold->set_tooltip_markup (M("TP_RAW_HD_TOOLTIP"));
hdThreshold->setAdjusterListener (this);
if (hdThreshold->delay < 1000) hdThreshold->delay = 1000;
hdThreshold->show();
pack_start( *hdThreshold, Gtk::PACK_SHRINK, 4);
// 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);
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);
hdThreshold = Gtk::manage (new Adjuster (M("TP_RAW_HD"), 20, 200, 2, 100));
hdThreshold->set_tooltip_markup (M("TP_RAW_HD_TOOLTIP"));
hdThreshold->setAdjusterListener (this);
if (hdThreshold->delay < 1000) {
hdThreshold->delay = 1000;
}
hdThreshold->show();
pack_start( *hdThreshold, Gtk::PACK_SHRINK, 4);
// 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 ();
hpixelconn.block (true);
dpixelconn.block (true);
if(pedited ){
hotPixel->set_inconsistent (!pedited->raw.hotPixelFilter);
deadPixel->set_inconsistent (!pedited->raw.deadPixelFilter);
}
disableListener ();
hpixelconn.block (true);
dpixelconn.block (true);
lastHot = pp->raw.hotPixelFilter;
lastDead = pp->raw.deadPixelFilter;
hotPixel->set_active (pp->raw.hotPixelFilter);
deadPixel->set_active (pp->raw.deadPixelFilter);
hdThreshold->setValue (pp->raw.hotdeadpix_thresh);
hpixelconn.block (false);
dpixelconn.block (false);
enableListener ();
if(pedited ) {
hotPixel->set_inconsistent (!pedited->raw.hotPixelFilter);
deadPixel->set_inconsistent (!pedited->raw.deadPixelFilter);
}
lastHot = pp->raw.hotPixelFilter;
lastDead = pp->raw.deadPixelFilter;
hotPixel->set_active (pp->raw.hotPixelFilter);
deadPixel->set_active (pp->raw.deadPixelFilter);
hdThreshold->setValue (pp->raw.hotdeadpix_thresh);
hpixelconn.block (false);
dpixelconn.block (false);
enableListener ();
}
void PreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
{
pp->raw.hotPixelFilter = hotPixel->get_active();
pp->raw.deadPixelFilter = deadPixel->get_active();
pp->raw.hotdeadpix_thresh = hdThreshold->getIntValue();
if (pedited) {
pedited->raw.hotDeadPixelThresh = hdThreshold->getEditedState ();
pedited->raw.hotPixelFilter = !hotPixel->get_inconsistent();
pedited->raw.deadPixelFilter = !deadPixel->get_inconsistent();
}
pp->raw.hotPixelFilter = hotPixel->get_active();
pp->raw.deadPixelFilter = deadPixel->get_active();
pp->raw.hotdeadpix_thresh = hdThreshold->getIntValue();
if (pedited) {
pedited->raw.hotDeadPixelThresh = hdThreshold->getEditedState ();
pedited->raw.hotPixelFilter = !hotPixel->get_inconsistent();
pedited->raw.deadPixelFilter = !deadPixel->get_inconsistent();
}
}
void PreProcess::adjusterChanged (Adjuster* a, double newval)
{
if (listener) {
if (a == hdThreshold)
listener->panelChanged (EvPreProcessHotDeadThresh, a->getTextValue() );
}
if (listener) {
if (a == hdThreshold) {
listener->panelChanged (EvPreProcessHotDeadThresh, a->getTextValue() );
}
}
}
void PreProcess::hotPixelChanged ()
{
if (batchMode) {
if (hotPixel->get_inconsistent()) {
hotPixel->set_inconsistent (false);
hpixelconn.block (true);
hotPixel->set_active (false);
hpixelconn.block (false);
}
else if (lastHot)
hotPixel->set_inconsistent (true);
if (batchMode) {
if (hotPixel->get_inconsistent()) {
hotPixel->set_inconsistent (false);
hpixelconn.block (true);
hotPixel->set_active (false);
hpixelconn.block (false);
} else if (lastHot) {
hotPixel->set_inconsistent (true);
}
lastHot = hotPixel->get_active ();
}
if (listener)
listener->panelChanged (EvPreProcessHotPixel, hotPixel->get_active()?M("GENERAL_ENABLED"):M("GENERAL_DISABLED"));
lastHot = hotPixel->get_active ();
}
if (listener) {
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);
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"));
lastDead = deadPixel->get_active ();
}
if (listener) {
listener->panelChanged (EvPreProcessDeadPixel, deadPixel->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
}
}