diff --git a/rtdata/languages/default b/rtdata/languages/default index de394ac15..a6abadaa6 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -778,7 +778,6 @@ HISTORY_MSG_PIXELSHIFT_DEMOSAIC;PS - Demosaic method for motion HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter HISTORY_MSG_PREPROCWB_MODE;Preprocess WB Mode -HISTORY_MSG_PREPROCWB_MULTS;Preprocess WB Comp. HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift @@ -1845,12 +1844,10 @@ TP_PREPROCESS_LINEDENOISE_DIRECTION_PDAF_LINES;Horizontal only on PDAF rows TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;Vertical TP_PREPROCESS_NO_FOUND;None found TP_PREPROCESS_PDAFLINESFILTER;PDAF lines filter -TP_PREPROCWB_BLUE;Blue compensation TP_PREPROCWB_LABEL;Preprocess White Balance TP_PREPROCWB_MODE;Mode TP_PREPROCWB_MODE_AUTO;Auto TP_PREPROCWB_MODE_CAMERA;Camera -TP_PREPROCWB_RED;Red compensation 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/procparams.cc b/rtengine/procparams.cc index b7d122f83..97dfc2fe7 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2765,18 +2765,13 @@ Glib::ustring RAWParams::XTransSensor::getMethodString(Method method) RAWParams::PreprocessWB::PreprocessWB() : - mode(Mode::AUTO), - red(1.0), - blue(1.0) + mode(Mode::AUTO) { } bool RAWParams::PreprocessWB::operator ==(const PreprocessWB& other) const { - return - mode == other.mode - && red == other.red - && blue == other.blue; + return mode == other.mode; } bool RAWParams::PreprocessWB::operator !=(const PreprocessWB& other) const @@ -3757,8 +3752,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Preprocess WB saveToKeyfile(!pedited || pedited->raw.preprocessWB.mode, "RAW Preprocess WB", "Mode", toUnderlying(raw.preprocessWB.mode), keyFile); - saveToKeyfile(!pedited || pedited->raw.preprocessWB.red, "RAW Preprocess WB", "RedMult", raw.preprocessWB.red, keyFile); - saveToKeyfile(!pedited || pedited->raw.preprocessWB.blue, "RAW Preprocess WB", "BlueMult", raw.preprocessWB.blue, keyFile); // EXIF change list if (!pedited || pedited->exif) { @@ -5351,8 +5344,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) pedited->raw.preprocessWB.mode = true; } } - assignFromKeyfile(keyFile, "RAW Preprocess WB", "Red" , pedited, raw.preprocessWB.red, pedited->raw.preprocessWB.red); - assignFromKeyfile(keyFile, "RAW Preprocess WB", "Blue" , pedited, raw.preprocessWB.blue, pedited->raw.preprocessWB.blue); } if (keyFile.has_group("MetaData")) { diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 50d48733a..a737d5776 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1527,8 +1527,6 @@ struct RAWParams { }; Mode mode; - double red; - double blue; PreprocessWB(); diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 7f7fd1543..a37e94c62 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -1237,13 +1237,6 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le // Auto WB gives us better demosaicing and CA auto-correct performance for strange white balance settings (such as UniWB) ri->get_colorsCoeff( ref_pre_mul, scale_mul, c_black, raw.preprocessWB.mode == RAWParams::PreprocessWB::Mode::AUTO); - // Apply custom compensation factors as specified in params - const auto ppwb = raw.preprocessWB; - ref_pre_mul[0] *= ppwb.red; - ref_pre_mul[2] *= ppwb.blue; - scale_mul[0] *= ppwb.red; - scale_mul[2] *= ppwb.blue; - refwb_red = ri->get_pre_mul(0) / ref_pre_mul[0]; refwb_green = ri->get_pre_mul(1) / ref_pre_mul[1]; refwb_blue = ri->get_pre_mul(2) / ref_pre_mul[2]; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index fdc3cbe52..c7ab5f1c5 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -609,8 +609,6 @@ void ParamsEdited::set(bool v) filmNegative.greenExp = v; filmNegative.blueRatio = v; raw.preprocessWB.mode = v; - raw.preprocessWB.red = v; - raw.preprocessWB.blue = v; exif = v; iptc = v; @@ -1199,8 +1197,6 @@ void ParamsEdited::initFrom(const std::vector& filmNegative.greenExp = filmNegative.greenExp && p.filmNegative.greenExp == other.filmNegative.greenExp; filmNegative.blueRatio = filmNegative.blueRatio && p.filmNegative.blueRatio == other.filmNegative.blueRatio; raw.preprocessWB.mode = raw.preprocessWB.mode && p.raw.preprocessWB.mode == other.raw.preprocessWB.mode; - raw.preprocessWB.red = raw.preprocessWB.red && p.raw.preprocessWB.red == other.raw.preprocessWB.red; - raw.preprocessWB.blue = raw.preprocessWB.blue && p.raw.preprocessWB.blue == other.raw.preprocessWB.blue; // How the hell can we handle that??? // exif = exif && p.exif==other.exif @@ -3350,14 +3346,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.raw.preprocessWB.mode = mods.raw.preprocessWB.mode; } - if (raw.preprocessWB.red) { - toEdit.raw.preprocessWB.red = mods.raw.preprocessWB.red; - } - - if (raw.preprocessWB.blue) { - toEdit.raw.preprocessWB.blue = mods.raw.preprocessWB.blue; - } - // Exif changes are added to the existing ones if (exif) { for (procparams::ExifPairs::const_iterator i = mods.exif.begin(); i != mods.exif.end(); ++i) { @@ -3414,5 +3402,5 @@ bool CaptureSharpeningParamsEdited::isUnchanged() const bool RAWParamsEdited::PreprocessWBParamsEdited::isUnchanged() const { - return mode && red && blue; + return mode; } \ No newline at end of file diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index c63119e25..8b4cf1241 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -701,8 +701,6 @@ struct RAWParamsEdited { struct PreprocessWBParamsEdited { bool mode; - bool red; - bool blue; bool isUnchanged() const; }; diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index f74d40e4e..8c49323c5 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -1008,8 +1008,6 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param if (!raw_preprocwb->get_active ()) { filterPE.raw.preprocessWB.mode = falsePE.raw.preprocessWB.mode; - filterPE.raw.preprocessWB.red = falsePE.raw.preprocessWB.red; - filterPE.raw.preprocessWB.blue = falsePE.raw.preprocessWB.blue; } if (dstPE) { diff --git a/rtgui/preprocesswb.cc b/rtgui/preprocesswb.cc index 1f54f7672..170371318 100644 --- a/rtgui/preprocesswb.cc +++ b/rtgui/preprocesswb.cc @@ -32,10 +32,7 @@ using namespace rtengine::procparams; PreprocessWB::PreprocessWB() : FoldableToolPanel(this, "preprocesswb", M("TP_PREPROCWB_LABEL")), evPreprocessWBMode(ProcEventMapper::getInstance()->newEvent(FIRST, "HISTORY_MSG_PREPROCWB_MODE")), - evPreprocessWBMults(ProcEventMapper::getInstance()->newEvent(FIRST, "HISTORY_MSG_PREPROCWB_MULTS")), - mode(Gtk::manage(new MyComboBoxText())), - red(Gtk::manage(new Adjuster(M("TP_PREPROCWB_RED"), 0.05, 20.0, 0.01, 1))), - blue(Gtk::manage(new Adjuster(M("TP_PREPROCWB_BLUE"), 0.05, 20.0, 0.01, 1))) + mode(Gtk::manage(new MyComboBoxText())) { Gtk::HBox *hb = Gtk::manage(new Gtk::HBox()); hb->pack_start(*Gtk::manage(new Gtk::Label(M("TP_PREPROCWB_MODE") + ": ")), Gtk::PACK_SHRINK, 0); @@ -48,41 +45,16 @@ PreprocessWB::PreprocessWB() : mode->set_active(0); mode->signal_changed().connect(sigc::mem_fun(*this, &PreprocessWB::modeChanged)); - red->setAdjusterListener(this); - blue->setAdjusterListener(this); - - red->setLogScale(8, 1, true); - blue->setLogScale(8, 1, true); - - if (red->delay < options.adjusterMaxDelay) { - red->delay = options.adjusterMaxDelay; - } - - if (blue->delay < options.adjusterMaxDelay) { - blue->delay = options.adjusterMaxDelay; - } - mode->show(); - red->show(); - blue->show(); pack_start(*hb, Gtk::PACK_SHRINK, 4); - pack_start(*red, Gtk::PACK_SHRINK, 4); - pack_start(*blue, Gtk::PACK_SHRINK, 4); } void PreprocessWB::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { disableListener(); - if (pedited) { - red->setEditedState(pedited->raw.preprocessWB.red ? Edited : UnEdited); - blue->setEditedState(pedited->raw.preprocessWB.blue ? Edited : UnEdited); - } - mode->set_active(int(pp->raw.preprocessWB.mode)); - red->setValue(pp->raw.preprocessWB.red); - blue->setValue(pp->raw.preprocessWB.blue); enableListener(); } @@ -93,25 +65,12 @@ void PreprocessWB::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped pp->raw.preprocessWB.mode = RAWParams::PreprocessWB::Mode(mode->get_active_row_number()); } - pp->raw.preprocessWB.red = red->getValue(); - pp->raw.preprocessWB.blue = blue->getValue(); - if (pedited) { pedited->raw.preprocessWB.mode = mode->get_active_row_number() != 2; // UNCHANGED entry, see setBatchMode - pedited->raw.preprocessWB.red = red->getEditedState(); - pedited->raw.preprocessWB.blue = blue->getEditedState(); } } -void PreprocessWB::adjusterChanged(Adjuster* a, double newval) -{ - if (listener) { - listener->panelChanged(evPreprocessWBMults, Glib::ustring::compose( - "R/G=%1 ; B/G=%2", red->getValue(), blue->getValue())); - } -} - void PreprocessWB::setBatchMode(bool batchMode) { ToolPanel::setBatchMode(batchMode); @@ -119,35 +78,15 @@ void PreprocessWB::setBatchMode(bool batchMode) if (batchMode) { mode->append(M("GENERAL_UNCHANGED")); mode->set_active_text(M("GENERAL_UNCHANGED")); - red->showEditedCB(); - blue->showEditedCB(); } } void PreprocessWB::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - red->setDefault(defParams->raw.preprocessWB.red); - blue->setDefault(defParams->raw.preprocessWB.blue); - - if (pedited) { - red->setDefaultEditedState(pedited->raw.preprocessWB.red ? Edited : UnEdited); - blue->setDefaultEditedState(pedited->raw.preprocessWB.blue ? Edited : UnEdited); - } else { - red->setDefaultEditedState(Irrelevant); - blue->setDefaultEditedState(Irrelevant); - } -} - -void PreprocessWB::setAdjusterBehavior(bool add) -{ - red->setAddMode(add); - blue->setAddMode(add); } void PreprocessWB::trimValues(rtengine::procparams::ProcParams* pp) { - red->trimValue(pp->raw.preprocessWB.red); - blue->trimValue(pp->raw.preprocessWB.blue); } void PreprocessWB::modeChanged() diff --git a/rtgui/preprocesswb.h b/rtgui/preprocesswb.h index 2aabf13d8..343d2e9e9 100644 --- a/rtgui/preprocesswb.h +++ b/rtgui/preprocesswb.h @@ -25,18 +25,14 @@ class PreprocessWB final: public ToolParamBlock, - public AdjusterListener, public FoldableToolPanel { private: - const rtengine::ProcEvent evPreprocessWBMode, evPreprocessWBMults; + const rtengine::ProcEvent evPreprocessWBMode; MyComboBoxText* mode; - Adjuster* red; - Adjuster* blue; - public: PreprocessWB(); @@ -45,7 +41,6 @@ public: void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override; void setBatchMode(bool batchMode) override; void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; - void adjusterChanged(Adjuster* a, double newval) override; void setAdjusterBehavior(bool add); void trimValues(rtengine::procparams::ProcParams* pp) override; void modeChanged();