diff --git a/rtdata/languages/default b/rtdata/languages/default index b1ded30f3..4994365f2 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -732,6 +732,7 @@ HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;Local Contrast - Lightness HISTORY_MSG_LOCALCONTRAST_RADIUS;Local Contrast - Radius HISTORY_MSG_METADATA_MODE;Metadata copy mode HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction +HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter HISTORY_MSG_TM_FATTAL_ANCHOR;HDR TM - Anchor HISTORY_NEWSNAPSHOT;Add HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s @@ -1730,6 +1731,8 @@ TP_PREPROCESS_LINEDENOISE_DIRECTION_BOTH;Both TP_PREPROCESS_LINEDENOISE_DIRECTION_HORIZONTAL;Horizontal TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;Vertical TP_PREPROCESS_NO_FOUND;None found +TP_PREPROCESS_PDAFLINESFILTER;PDAF lines filter +TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress banding caused by on-sensor PDAF pixels occurring on some Sony mirrorless cameras on some backlit scenes. TP_PRSHARPENING_LABEL;Post-Resize Sharpening TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. TP_RAWCACORR_AUTO;Auto-correction diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 080a76410..7101e8b80 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -117,6 +117,7 @@ set(RTENGINESOURCEFILES tmo_fattal02.cc iplocalcontrast.cc histmatching.cc + pdaflinesfilter.cc ) if(LENSFUN_HAS_LOAD_DIRECTORY) diff --git a/rtengine/pdaflinesfilter.cc b/rtengine/pdaflinesfilter.cc new file mode 100644 index 000000000..6f11b5e78 --- /dev/null +++ b/rtengine/pdaflinesfilter.cc @@ -0,0 +1,97 @@ +/* -*- C++ -*- + * + * This file is part of RawTherapee. + * + * Copyright (c) 2017 Alberto Griggio + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ + +#include "pdaflinesfilter.h" +#include "settings.h" +#include + +namespace rtengine { + +extern const Settings *settings; + + +PDAFLinesFilter::PDAFLinesFilter(RawImage *ri): + ri_(ri), + W_(ri->get_width()), + H_(ri->get_height()) +{ + if (ri_->get_maker() == "Sony" && ri_->get_model() == "ILCE-7M3") { + // A7III, from https://www.dpreview.com/forums/post/60843139 + // in the original post: + // P 5 P 17 P 11 P 11 P 17 P 11 P 5 P 11 P 11 P 11 P 17 P 11 P 5 P 11 P 11 P 17 P 5 P 11 P 17 P 5 P 17 P 5 P 11 P 11 P 11 P 17 P 5 P 11 P 11 P 11 P 5 P 17 P 5 P 17 P 11 + // + // rotated to match the start of the frame + // P 11 P 11 P 11 P 17 P 11 P 5 P 11 P 11 P 17 P 5 P 11 P 17 P 5 P 17 P 5 P 11 P 11 P 11 P 17 P 5 P 11 P 11 P 11 P 5 P 17 P 5 P 17 P 11 P 5 P 17 P 11 P 11 P 17 P 11 P 5 + pattern_ = { + 0, 12, 24, 36, 54, 66, 72, 84, 96, 114, 120, 132, 150, 156, 174, 180, 192, 204, 216, 234, 240, 252, 264, 276, 282, 300, 306, 324, 336, 342, 360, 372, 384, 402, 414, 420 + }; + offset_ = 9; + } else if (ri_->get_maker() == "Sony" && ri_->get_model() == "ILCE-6000") { + // detected by hand, using the picture from https://www.dpreview.com/forums/thread/3923513 + // P 11 P 23 P 17 P 17 P 17 P 23 P 11 P 17 P 17 P 17 P 23 P 11 P 23 P 11 P 17 P 23 P 11 P 17 P 17 P 23 P 17 P 11 P 17 P 17 P 17 P 23 P 17 P 11 P 17 P 17 P 23 P 11 P 17 P 11 P 23 + pattern_ = { + 0, 12, 36, 54, 72, 90, 114, 126, 144, 162, 180, 204, 216, 240, 252, 270, 294, 306, 324, 342, 366, 384, 396, 414, 432, 450, 474, 492, 504, 522, 540, 564, 576, 594, 606, 630 + }; + offset_ = 3; + } +} + + +int PDAFLinesFilter::mark(array2D &rawData, PixelsMap &bpMap) +{ + if (pattern_.empty()) { + if (settings->verbose) { + std::cout << "no PDAF pattern known for " << ri_->get_maker() << " " << ri_->get_model() << std::endl; + } + return 0; + } + + size_t idx = 0; + int off = offset_; + + int found = 0; + for (int y = 1; y < H_-1; ++y) { + int yy = pattern_[idx] + off; + if (y == yy) { + int n = 0; + for (int x = 1; x < W_-1; ++x) { + if (ri_->FC(y, x) == 1 && rawData[y][x] > max(rawData[y-1][x-1], rawData[y-1][x+1], rawData[y+1][x-1], rawData[y+1][x+1])) { + bpMap.set(x, y); + bpMap.set(x-1, y); + bpMap.set(x+1, y); + n += 2; + } + } + found += n; + if (n && settings->verbose) { + std::cout << "marked " << n << "pixels in PDAF line at " << y << std::endl; + } + } else if (y > yy) { + ++idx; + if (idx >= pattern_.size()) { + idx = 0; + off += pattern_.back(); + } + } + } + return found; +} + +} // namespace rtengine diff --git a/rtengine/pdaflinesfilter.h b/rtengine/pdaflinesfilter.h new file mode 100644 index 000000000..428281abd --- /dev/null +++ b/rtengine/pdaflinesfilter.h @@ -0,0 +1,41 @@ +/* -*- C++ -*- + * + * This file is part of RawTherapee. + * + * Copyright (c) 2017 Alberto Griggio + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ + +#pragma once + +#include "rawimagesource.h" +#include + +namespace rtengine { + +class PDAFLinesFilter { +public: + PDAFLinesFilter(RawImage *ri); + int mark(array2D &rawData, PixelsMap &bpMap); + +private: + RawImage *ri_; + int W_; + int H_; + std::vector pattern_; + int offset_; +}; + +} // namespace rtengine diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 7d87aa2b8..0a87d9614 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2384,7 +2384,8 @@ RAWParams::BayerSensor::BayerSensor() : pixelShiftNonGreenCross(true), pixelShiftNonGreenCross2(false), pixelShiftNonGreenAmaze(false), - dcb_enhance(true) + dcb_enhance(true), + pdafLinesFilter(false) { } @@ -2435,7 +2436,8 @@ bool RAWParams::BayerSensor::operator ==(const BayerSensor& other) const && pixelShiftNonGreenCross == other.pixelShiftNonGreenCross && pixelShiftNonGreenCross2 == other.pixelShiftNonGreenCross2 && pixelShiftNonGreenAmaze == other.pixelShiftNonGreenAmaze - && dcb_enhance == other.dcb_enhance; + && dcb_enhance == other.dcb_enhance + && pdafLinesFilter == other.pdafLinesFilter; } bool RAWParams::BayerSensor::operator !=(const BayerSensor& other) const @@ -3404,6 +3406,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftNonGreenCross, "RAW Bayer", "pixelShiftNonGreenCross", raw.bayersensor.pixelShiftNonGreenCross, keyFile); saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftNonGreenCross2, "RAW Bayer", "pixelShiftNonGreenCross2", raw.bayersensor.pixelShiftNonGreenCross2, keyFile); saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftNonGreenAmaze, "RAW Bayer", "pixelShiftNonGreenAmaze", raw.bayersensor.pixelShiftNonGreenAmaze, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pdafLinesFilter, "RAW Bayer", "PDAFLinesFilter", raw.bayersensor.pdafLinesFilter, keyFile); saveToKeyfile(!pedited || pedited->raw.xtranssensor.method, "RAW X-Trans", "Method", raw.xtranssensor.method, keyFile); saveToKeyfile(!pedited || pedited->raw.xtranssensor.ccSteps, "RAW X-Trans", "CcSteps", raw.xtranssensor.ccSteps, keyFile); saveToKeyfile(!pedited || pedited->raw.xtranssensor.exBlackRed, "RAW X-Trans", "PreBlackRed", raw.xtranssensor.blackred, keyFile); @@ -4743,6 +4746,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftNonGreenCross", pedited, raw.bayersensor.pixelShiftNonGreenCross, pedited->raw.bayersensor.pixelShiftNonGreenCross); assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftNonGreenCross2", pedited, raw.bayersensor.pixelShiftNonGreenCross2, pedited->raw.bayersensor.pixelShiftNonGreenCross2); assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftNonGreenAmaze", pedited, raw.bayersensor.pixelShiftNonGreenAmaze, pedited->raw.bayersensor.pixelShiftNonGreenAmaze); + assignFromKeyfile(keyFile, "RAW Bayer", "PDAFLinesFilter", pedited, raw.bayersensor.pdafLinesFilter, pedited->raw.bayersensor.pdafLinesFilter); } if (keyFile.has_group ("RAW X-Trans")) { diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 605db56ce..2f04179e7 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1301,6 +1301,7 @@ struct RAWParams { bool pixelShiftNonGreenCross2; bool pixelShiftNonGreenAmaze; bool dcb_enhance; + bool pdafLinesFilter; BayerSensor(); diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index cb57591c2..da52cf352 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -34,6 +34,7 @@ #include "rt_math.h" #include "improcfun.h" #include "rtlensfun.h" +#include "pdaflinesfilter.h" #ifdef _OPENMP #include #endif @@ -1919,6 +1920,20 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } } + if (ri->getSensorType() == ST_BAYER && raw.bayersensor.pdafLinesFilter) { + PDAFLinesFilter f(ri); + + if (!bitmapBads) { + bitmapBads = new PixelsMap(W, H); + } + + int n = f.mark(rawData, *bitmapBads); + + if (settings->verbose && n > 0) { + printf("Marked %d hot pixels from PDAF lines\n", n); + } + } + // check if it is an olympus E camera or green equilibration is enabled. If yes, compute G channel pre-compensation factors if ( ri->getSensorType() == ST_BAYER && (raw.bayersensor.greenthresh || (((idata->getMake().size() >= 7 && idata->getMake().substr(0, 7) == "OLYMPUS" && idata->getModel()[0] == 'E') || (idata->getMake().size() >= 9 && idata->getMake().substr(0, 9) == "Panasonic")) && raw.bayersensor.method != RAWParams::BayerSensor::getMethodString( RAWParams::BayerSensor::Method::VNG4))) ) { // global correction diff --git a/rtgui/bayerpreprocess.cc b/rtgui/bayerpreprocess.cc index e6402efd0..e7780de47 100644 --- a/rtgui/bayerpreprocess.cc +++ b/rtgui/bayerpreprocess.cc @@ -28,6 +28,7 @@ BayerPreProcess::BayerPreProcess () : FoldableToolPanel(this, "bayerpreprocess", { auto m = ProcEventMapper::getInstance(); EvLineDenoiseDirection = m->newEvent(DARKFRAME, "HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION"); + EvPDAFLinesFilter = m->newEvent(DARKFRAME, "HISTORY_MSG_PREPROCESS_PDAFLINESFILTER"); lineDenoise = Gtk::manage(new Adjuster (M("TP_PREPROCESS_LINEDENOISE"), 0, 1000, 1, 0)); lineDenoise->setAdjusterListener (this); @@ -65,6 +66,13 @@ BayerPreProcess::BayerPreProcess () : FoldableToolPanel(this, "bayerpreprocess", pack_start( *greenEqThreshold, Gtk::PACK_SHRINK, 4); + pdafLinesFilter = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_PDAFLINESFILTER")))); + pdafLinesFilter->set_tooltip_markup(M("TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP")); + pdafLinesFilter->show(); + pdafLinesFilter->signal_toggled().connect(sigc::mem_fun(*this, &BayerPreProcess::pdafLinesFilterChanged), true); + + pack_start(*Gtk::manage(new Gtk::HSeparator())); + pack_start(*pdafLinesFilter, Gtk::PACK_SHRINK, 4); } void BayerPreProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) @@ -77,11 +85,13 @@ void BayerPreProcess::read(const rtengine::procparams::ProcParams* pp, const Par if (!pedited->raw.bayersensor.linenoiseDirection) { lineDenoiseDirection->set_active(3); } + pdafLinesFilter->set_inconsistent(!pedited->raw.bayersensor.pdafLinesFilter); } lineDenoise->setValue (pp->raw.bayersensor.linenoise); lineDenoiseDirection->set_active(int(pp->raw.bayersensor.linenoiseDirection)-1); greenEqThreshold->setValue (pp->raw.bayersensor.greenthresh); + pdafLinesFilter->set_active(pp->raw.bayersensor.pdafLinesFilter); enableListener (); } @@ -91,11 +101,13 @@ void BayerPreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pp->raw.bayersensor.linenoise = lineDenoise->getIntValue(); pp->raw.bayersensor.linenoiseDirection = RAWParams::BayerSensor::LineNoiseDirection(lineDenoiseDirection->get_active_row_number() + 1); pp->raw.bayersensor.greenthresh = greenEqThreshold->getIntValue(); + pp->raw.bayersensor.pdafLinesFilter = pdafLinesFilter->get_active(); if (pedited) { pedited->raw.bayersensor.linenoise = lineDenoise->getEditedState (); pedited->raw.bayersensor.greenEq = greenEqThreshold->getEditedState (); pedited->raw.bayersensor.linenoise = lineDenoiseDirection->get_active_row_number() != 3; + pedited->raw.bayersensor.pdafLinesFilter = !pdafLinesFilter->get_inconsistent(); } } @@ -158,3 +170,10 @@ void BayerPreProcess::lineDenoiseDirectionChanged() listener->panelChanged(EvLineDenoiseDirection, lineDenoiseDirection->get_active_text()); } } + +void BayerPreProcess::pdafLinesFilterChanged() +{ + if (listener) { + listener->panelChanged(EvPDAFLinesFilter, pdafLinesFilter->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); + } +} diff --git a/rtgui/bayerpreprocess.h b/rtgui/bayerpreprocess.h index 4c28ff64d..c27e76e00 100644 --- a/rtgui/bayerpreprocess.h +++ b/rtgui/bayerpreprocess.h @@ -32,8 +32,10 @@ protected: Adjuster* lineDenoise; MyComboBoxText *lineDenoiseDirection; Adjuster* greenEqThreshold; + Gtk::CheckButton *pdafLinesFilter; rtengine::ProcEvent EvLineDenoiseDirection; + rtengine::ProcEvent EvPDAFLinesFilter; public: @@ -49,6 +51,7 @@ public: void setAdjusterBehavior (bool linedenoiseadd, bool greenequiladd); void trimValues (rtengine::procparams::ProcParams* pp); void lineDenoiseDirectionChanged(); + void pdafLinesFilterChanged(); }; #endif diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 8acae08b3..868507ad0 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -434,6 +434,7 @@ void ParamsEdited::set (bool v) raw.bayersensor.greenEq = v; raw.bayersensor.linenoise = v; raw.bayersensor.linenoiseDirection = v; + raw.bayersensor.pdafLinesFilter = v; raw.xtranssensor.method = v; raw.xtranssensor.ccSteps = v; raw.xtranssensor.exBlackRed = v; @@ -996,6 +997,7 @@ void ParamsEdited::initFrom (const std::vector raw.bayersensor.greenEq = raw.bayersensor.greenEq && p.raw.bayersensor.greenthresh == other.raw.bayersensor.greenthresh; raw.bayersensor.linenoise = raw.bayersensor.linenoise && p.raw.bayersensor.linenoise == other.raw.bayersensor.linenoise; raw.bayersensor.linenoiseDirection = raw.bayersensor.linenoiseDirection && p.raw.bayersensor.linenoiseDirection == other.raw.bayersensor.linenoiseDirection; + raw.bayersensor.pdafLinesFilter = raw.bayersensor.pdafLinesFilter && p.raw.bayersensor.pdafLinesFilter == other.raw.bayersensor.pdafLinesFilter; raw.xtranssensor.method = raw.xtranssensor.method && p.raw.xtranssensor.method == other.raw.xtranssensor.method; raw.xtranssensor.ccSteps = raw.xtranssensor.ccSteps && p.raw.xtranssensor.ccSteps == other.raw.xtranssensor.ccSteps; raw.xtranssensor.exBlackRed = raw.xtranssensor.exBlackRed && p.raw.xtranssensor.blackred == other.raw.xtranssensor.blackred; @@ -2646,6 +2648,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.raw.bayersensor.linenoiseDirection = mods.raw.bayersensor.linenoiseDirection; } + if (raw.bayersensor.pdafLinesFilter) { + toEdit.raw.bayersensor.pdafLinesFilter = mods.raw.bayersensor.pdafLinesFilter; + } + if (raw.xtranssensor.method) { toEdit.raw.xtranssensor.method = mods.raw.xtranssensor.method; } @@ -3154,7 +3160,7 @@ bool RAWParamsEdited::BayerSensor::isUnchanged() const && 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 && pixelShiftOneGreen && pixelShiftEqualBright && pixelShiftEqualBrightChannel - && linenoise && linenoiseDirection && exBlack0 && exBlack1 && exBlack2 && exBlack3 && exTwoGreen; + && linenoise && linenoiseDirection && pdafLinesFilter && exBlack0 && exBlack1 && exBlack2 && exBlack3 && exTwoGreen; } bool RAWParamsEdited::XTransSensor::isUnchanged() const diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index d77e06b2d..12c8ee86e 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -764,6 +764,7 @@ public: bool greenEq; bool linenoise; bool linenoiseDirection; + bool pdafLinesFilter; bool isUnchanged() const; }; diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index 6ff9f4d3b..4828e90dc 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -114,6 +114,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren raw_greenthresh = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_GREENEQUIL"))); 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_pdaf_lines_filter = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_PDAFLINESFILTER"))); //--- raw_expos = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWEXPOS_LINEAR"))); raw_preser = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWEXPOS_PRESER"))); @@ -225,6 +226,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren vboxes[7]->pack_start (*raw_greenthresh, Gtk::PACK_SHRINK, 2); vboxes[7]->pack_start (*raw_hotpix_filt, Gtk::PACK_SHRINK, 2); vboxes[7]->pack_start (*raw_deadpix_filt, Gtk::PACK_SHRINK, 2); + vboxes[7]->pack_start (*raw_pdaf_lines_filter, Gtk::PACK_SHRINK, 2); vboxes[7]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0); vboxes[7]->pack_start (*raw_expos, Gtk::PACK_SHRINK, 2); vboxes[7]->pack_start (*raw_preser, Gtk::PACK_SHRINK, 2); @@ -368,6 +370,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren raw_greenthreshConn = raw_greenthresh->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_pdaf_lines_filterConn = raw_pdaf_lines_filter->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); //--- raw_exposConn = raw_expos->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); raw_preserConn = raw_preser->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); @@ -441,6 +444,7 @@ void PartialPasteDlg::rawToggled () ConnectionBlocker raw_greenthreshBlocker(raw_greenthreshConn); ConnectionBlocker raw_hotpix_filtBlocker(raw_hotpix_filtConn); ConnectionBlocker raw_deadpix_filtBlocker(raw_deadpix_filtConn); + ConnectionBlocker raw_pdaf_lines_filterBlocker(raw_pdaf_lines_filterConn); ConnectionBlocker raw_exposBlocker(raw_exposConn); ConnectionBlocker raw_preserBlocker(raw_preserConn); ConnectionBlocker raw_blackBlocker(raw_blackConn); @@ -467,6 +471,7 @@ void PartialPasteDlg::rawToggled () raw_greenthresh->set_active (raw->get_active ()); raw_hotpix_filt->set_active (raw->get_active ()); raw_deadpix_filt->set_active (raw->get_active ()); + raw_pdaf_lines_filter->set_active (raw->get_active ()); raw_expos->set_active (raw->get_active ()); raw_preser->set_active (raw->get_active ()); raw_black->set_active (raw->get_active ()); @@ -911,6 +916,10 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param filterPE.raw.hotdeadpix_thresh = falsePE.raw.hotdeadpix_thresh; } + if (!raw_pdaf_lines_filter->get_active ()) { + filterPE.raw.bayersensor.pdafLinesFilter = falsePE.raw.bayersensor.pdafLinesFilter; + } + if (!df_file->get_active ()) { filterPE.raw.darkFrame = falsePE.raw.darkFrame; } diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index e270a1e6e..b404db156 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -106,6 +106,7 @@ public: Gtk::CheckButton* raw_caredblue; Gtk::CheckButton* raw_hotpix_filt; Gtk::CheckButton* raw_deadpix_filt; + Gtk::CheckButton* raw_pdaf_lines_filter; Gtk::CheckButton* raw_linenoise; Gtk::CheckButton* raw_greenthresh; Gtk::CheckButton* raw_method; @@ -133,7 +134,7 @@ public: sigc::connection coarserotConn, finerotConn, cropConn, resizeConn, prsharpeningConn, perspectiveConn, commonTransConn; sigc::connection metadataConn, exifchConn, iptcConn, icmConn; sigc::connection df_fileConn, df_AutoSelectConn, ff_fileConn, ff_AutoSelectConn, ff_BlurRadiusConn, ff_BlurTypeConn, ff_ClipControlConn; - sigc::connection raw_caredblueConn, raw_ca_autocorrectConn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_imagenumConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_pixelshiftConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn; + sigc::connection raw_caredblueConn, raw_ca_autocorrectConn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_pdaf_lines_filterConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_imagenumConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_pixelshiftConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn; public: PartialPasteDlg (const Glib::ustring &title, Gtk::Window* parent);