diff --git a/rtdata/languages/default b/rtdata/languages/default index a5f77403e..9dc49102a 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1215,6 +1215,7 @@ HISTORY_MSG_COLORTONING_LABREGION_POWER;CT - region power HISTORY_MSG_COLORTONING_LABREGION_SATURATION;CT - Saturation HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK;CT - region show mask HISTORY_MSG_COLORTONING_LABREGION_SLOPE;CT - region slope +HISTORY_MSG_COMPLEX;Wavelet complexity HISTORY_MSG_DEHAZE_DEPTH;Dehaze - Depth HISTORY_MSG_DEHAZE_ENABLED;Haze Removal HISTORY_MSG_DEHAZE_LUMINANCE;Dehaze - Luminance only @@ -3280,6 +3281,10 @@ TP_WAVELET_COLORT;Opacity Red-Green TP_WAVELET_COMPCONT;Contrast TP_WAVELET_COMPGAMMA;Compression gamma TP_WAVELET_COMPGAMMA_TOOLTIP;Adjusting the gamma of the residual image allows you to equilibrate the data and histogram. +TP_WAVELET_COMPLEXLAB;Complexity +TP_WAVELET_COMPLEX_TOOLTIP;Allows treatment +TP_WAVELET_COMPNORMAL;Normal +TP_WAVELET_COMPEXPERT;Expert TP_WAVELET_COMPTM;Tone mapping TP_WAVELET_CONTEDIT;'After' contrast curve TP_WAVELET_CONTFRAME;Contrast - Compression diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 863c7fc79..a12ab4ba4 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2395,6 +2395,7 @@ WaveletParams::WaveletParams() : CLmethod("all"), Backmethod("grey"), Tilesmethod("full"), + complexmethod("normal"), daubcoeffmethod("4_"), CHmethod("without"), Medgreinf("less"), @@ -2527,6 +2528,7 @@ bool WaveletParams::operator ==(const WaveletParams& other) const && CLmethod == other.CLmethod && Backmethod == other.Backmethod && Tilesmethod == other.Tilesmethod + && complexmethod == other.complexmethod && daubcoeffmethod == other.daubcoeffmethod && CHmethod == other.CHmethod && Medgreinf == other.Medgreinf @@ -5988,6 +5990,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->wavelet.iter, "Wavelet", "Iter", wavelet.iter, keyFile); saveToKeyfile(!pedited || pedited->wavelet.thres, "Wavelet", "MaxLev", wavelet.thres, keyFile); saveToKeyfile(!pedited || pedited->wavelet.Tilesmethod, "Wavelet", "TilesMethod", wavelet.Tilesmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.complexmethod, "Wavelet", "complexMethod", wavelet.complexmethod, keyFile); saveToKeyfile(!pedited || pedited->wavelet.daubcoeffmethod, "Wavelet", "DaubMethod", wavelet.daubcoeffmethod, keyFile); saveToKeyfile(!pedited || pedited->wavelet.CLmethod, "Wavelet", "ChoiceLevMethod", wavelet.CLmethod, keyFile); saveToKeyfile(!pedited || pedited->wavelet.Backmethod, "Wavelet", "BackMethod", wavelet.Backmethod, keyFile); @@ -7858,6 +7861,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Wavelet", "ChoiceLevMethod", pedited, wavelet.CLmethod, pedited->wavelet.CLmethod); assignFromKeyfile(keyFile, "Wavelet", "BackMethod", pedited, wavelet.Backmethod, pedited->wavelet.Backmethod); assignFromKeyfile(keyFile, "Wavelet", "TilesMethod", pedited, wavelet.Tilesmethod, pedited->wavelet.Tilesmethod); + assignFromKeyfile(keyFile, "Wavelet", "complexMethod", pedited, wavelet.complexmethod, pedited->wavelet.complexmethod); assignFromKeyfile(keyFile, "Wavelet", "DaubMethod", pedited, wavelet.daubcoeffmethod, pedited->wavelet.daubcoeffmethod); assignFromKeyfile(keyFile, "Wavelet", "CHromaMethod", pedited, wavelet.CHmethod, pedited->wavelet.CHmethod); assignFromKeyfile(keyFile, "Wavelet", "Medgreinf", pedited, wavelet.Medgreinf, pedited->wavelet.Medgreinf); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 7d609494e..048fe1ee5 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1790,6 +1790,7 @@ struct WaveletParams { Glib::ustring CLmethod; Glib::ustring Backmethod; Glib::ustring Tilesmethod; + Glib::ustring complexmethod; Glib::ustring daubcoeffmethod; Glib::ustring CHmethod; Glib::ustring Medgreinf; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index db830c6c1..070e31316 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -531,6 +531,7 @@ void ParamsEdited::set(bool v) wavelet.CLmethod = v; wavelet.Backmethod = v; wavelet.Tilesmethod = v; + wavelet.complexmethod = v; wavelet.daubcoeffmethod = v; wavelet.CHmethod = v; wavelet.CHSLmethod = v; @@ -1679,6 +1680,7 @@ void ParamsEdited::initFrom(const std::vector& wavelet.CLmethod = wavelet.CLmethod && p.wavelet.CLmethod == other.wavelet.CLmethod; wavelet.Backmethod = wavelet.Backmethod && p.wavelet.Backmethod == other.wavelet.Backmethod; wavelet.Tilesmethod = wavelet.Tilesmethod && p.wavelet.Tilesmethod == other.wavelet.Tilesmethod; + wavelet.complexmethod = wavelet.complexmethod && p.wavelet.complexmethod == other.wavelet.complexmethod; wavelet.daubcoeffmethod = wavelet.daubcoeffmethod && p.wavelet.daubcoeffmethod == other.wavelet.daubcoeffmethod; wavelet.CHmethod = wavelet.CHmethod && p.wavelet.CHmethod == other.wavelet.CHmethod; wavelet.CHSLmethod = wavelet.CHSLmethod && p.wavelet.CHSLmethod == other.wavelet.CHSLmethod; @@ -5574,6 +5576,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.wavelet.Tilesmethod = mods.wavelet.Tilesmethod; } + if (wavelet.complexmethod) { + toEdit.wavelet.complexmethod = mods.wavelet.complexmethod; + } + if (wavelet.daubcoeffmethod) { toEdit.wavelet.daubcoeffmethod = mods.wavelet.daubcoeffmethod; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 98a427796..57b6458b9 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -1039,6 +1039,7 @@ struct WaveletParamsEdited { bool CLmethod; bool Backmethod; bool Tilesmethod; + bool complexmethod; bool daubcoeffmethod; bool Dirmethod; bool sigma; diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 9d7bf583a..0fd153d40 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -158,6 +158,7 @@ Wavelet::Wavelet() : HSmethod(Gtk::manage(new MyComboBoxText())), CLmethod(Gtk::manage(new MyComboBoxText())), Backmethod(Gtk::manage(new MyComboBoxText())), + complexmethod(Gtk::manage(new MyComboBoxText())), Tilesmethod(Gtk::manage(new MyComboBoxText())), daubcoeffmethod(Gtk::manage(new MyComboBoxText())), Dirmethod(Gtk::manage(new MyComboBoxText())), @@ -190,7 +191,9 @@ Wavelet::Wavelet() : expclari(Gtk::manage(new MyExpander(true, M("TP_WAVELET_CLARI")))), expbl(Gtk::manage(new MyExpander(true, M("TP_WAVELET_BL")))), neutrHBox(Gtk::manage(new Gtk::HBox())), - usharpHBox(Gtk::manage(new Gtk::HBox())) + usharpHBox(Gtk::manage(new Gtk::HBox())), + ctboxch(Gtk::manage(new Gtk::HBox())) + { CurveListener::setMulti(true); auto m = ProcEventMapper::getInstance(); @@ -227,6 +230,7 @@ Wavelet::Wavelet() : EvWavrangeab = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_RANGEAB"); EvWavprotab = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_PROTAB"); EvWavlevelshc = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_LEVELSHC"); + EvWavcomplexmet = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_COMPLEX"); labgrid = Gtk::manage(new LabGrid(EvWavLabGridValue, M("TP_WAVELET_LABGRID_VALUES"))); @@ -269,6 +273,16 @@ Wavelet::Wavelet() : thres->set_tooltip_text(M("TP_WAVELET_LEVELS_TOOLTIP")); thres->setAdjusterListener(this); + complexmethod->append(M("TP_WAVELET_COMPNORMAL")); + complexmethod->append(M("TP_WAVELET_COMPEXPERT")); + complexmethodconn = complexmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::complexmethodChanged)); + complexmethod->set_tooltip_text(M("TP_WAVELET_COMPLEX_TOOLTIP")); + Gtk::HBox* const complexHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Label* const complexLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_COMPLEXLAB") + ":")); + complexHBox->pack_start(*complexLabel, Gtk::PACK_SHRINK, 4); + complexHBox->pack_start(*complexmethod); + + Tilesmethod->append(M("TP_WAVELET_TILESFULL")); Tilesmethod->append(M("TP_WAVELET_TILESBIG")); // Tilesmethod->append(M("TP_WAVELET_TILESLIT")); @@ -335,6 +349,7 @@ Wavelet::Wavelet() : levdirSubHBox->pack_start(*Lmethod); levdirSubHBox->pack_start(*Dirmethod, Gtk::PACK_EXPAND_WIDGET, 2); // same, but 2 not 4? + settingsBox->pack_start(*complexHBox); settingsBox->pack_start(*strength); settingsBox->pack_start(*thres); settingsBox->pack_start(*tilesizeHBox); @@ -452,7 +467,7 @@ Wavelet::Wavelet() : ToolParamBlock* const chBox = Gtk::manage(new ToolParamBlock()); Gtk::Label* const labmch = Gtk::manage(new Gtk::Label(M("TP_WAVELET_CHTYPE") + ":")); - Gtk::HBox* const ctboxch = Gtk::manage(new Gtk::HBox()); +// Gtk::HBox* const ctboxch = Gtk::manage(new Gtk::HBox()); ctboxch->pack_start(*labmch, Gtk::PACK_SHRINK, 1); CHmethod->append(M("TP_WAVELET_CH1")); @@ -1236,6 +1251,7 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) CLmethodconn.block(true); Backmethodconn.block(true); Tilesmethodconn.block(true); + complexmethodconn.block(true); daubcoeffmethodconn.block(true); Dirmethodconn.block(true); CHmethodconn.block(true); @@ -1357,6 +1373,12 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) } else if (pp->wavelet.CLmethod == "all") { CLmethod->set_active(3); } + if (pp->wavelet.complexmethod == "normal") { + complexmethod->set_active(0); + } else if (pp->wavelet.complexmethod == "expert") { + complexmethod->set_active(1); + } + //Tilesmethod->set_active (2); if (pp->wavelet.Tilesmethod == "full") { @@ -1558,6 +1580,11 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) Backmethod->set_active_text(M("GENERAL_UNCHANGED")); } + if (!pedited->wavelet.complexmethod) { + complexmethod->set_active_text(M("GENERAL_UNCHANGED")); + } + + if (!pedited->wavelet.Tilesmethod) { Tilesmethod->set_active_text(M("GENERAL_UNCHANGED")); } @@ -1774,6 +1801,15 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) } else { sup->hide(); } + + if (complexmethod->get_active_row_number() == 0) { + updateGUIToMode(0); + convertParamToNormal(); + + } else { + updateGUIToMode(1); + } + } /***************************************************************************************************** @@ -1786,6 +1822,7 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) CLmethodconn.block(false); Backmethodconn.block(false); Tilesmethodconn.block(false); + complexmethodconn.block(false); daubcoeffmethodconn.block(false); CHmethodconn.block(false); CHSLmethodconn.block(false); @@ -1965,6 +2002,7 @@ void Wavelet::write(ProcParams* pp, ParamsEdited* pedited) pedited->wavelet.CLmethod = CLmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->wavelet.Backmethod = Backmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->wavelet.Tilesmethod = Tilesmethod->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->wavelet.complexmethod = complexmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->wavelet.daubcoeffmethod = daubcoeffmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->wavelet.CHmethod = CHmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->wavelet.CHSLmethod = CHSLmethod->get_active_text() != M("GENERAL_UNCHANGED"); @@ -2168,6 +2206,12 @@ void Wavelet::write(ProcParams* pp, ParamsEdited* pedited) // pp->wavelet.Tilesmethod = "lit"; } + if (complexmethod->get_active_row_number() == 0) { + pp->wavelet.complexmethod = "normal"; + } else if (complexmethod->get_active_row_number() == 1) { + pp->wavelet.complexmethod = "expert"; + } + if (daubcoeffmethod->get_active_row_number() == 0) { pp->wavelet.daubcoeffmethod = "2_"; } else if (daubcoeffmethod->get_active_row_number() == 1) { @@ -2835,6 +2879,79 @@ void Wavelet::ushamethodChanged() } + +void Wavelet::convertParamToNormal() +{ + const WaveletParams def_params; + disableListener(); + //contrast + offset->setValue(def_params.offset); + //chroma + expchroma->setEnabled(def_params.expchroma); + CHmethod->set_active(2); + //denoise + chromfi->setValue(def_params.chromfi); + chromco->setValue(def_params.chromco); + //toning + exptoning->setEnabled(def_params.exptoning); + //gamut + median->set_active(def_params.median); + avoid->set_active(def_params.avoid); + hueskin->setValue(def_params.hueskin); + skinprotect->setValue(def_params.skinprotect); + //blur + expbl->setEnabled(def_params.expbl); + //edge sharpness + lipst->set_active(def_params.lipst); + lipstUpdateUI(); + edgesensi->setValue(def_params.edgesensi); + edgeampli->setValue(def_params.edgeampli); + NPmethod->set_active(0); + enableListener(); + + // Update GUI based on converted widget parameters: +} + +void Wavelet::updateGUIToMode(int mode) +{ + if(mode ==0) { + offset->hide(); + ctboxch->hide(); + expgamut->hide(); + exptoning->hide(); + chroFrame->hide(); + expbl->hide(); + lipst->hide(); + } else { + offset->show(); + ctboxch->show(); + expgamut->show(); + exptoning->show(); + chroFrame->show(); + expbl->show(); + lipst->show(); + } + +} + + +void Wavelet::complexmethodChanged() +{ + if (complexmethod->get_active_row_number() == 0) { + updateGUIToMode(0); + convertParamToNormal(); + + } else { + updateGUIToMode(1); + } + + if (listener && (multiImage || getEnabled())) { + listener->panelChanged(EvWavcomplexmet, complexmethod->get_active_text()); + } +} + + + void Wavelet::TilesmethodChanged() { //TilesmethodUpdateUI(); @@ -2916,6 +3033,7 @@ void Wavelet::setBatchMode(bool batchMode) CLmethod->append(M("GENERAL_UNCHANGED")); Backmethod->append(M("GENERAL_UNCHANGED")); Tilesmethod->append(M("GENERAL_UNCHANGED")); + complexmethod->append(M("GENERAL_UNCHANGED")); daubcoeffmethod->append(M("GENERAL_UNCHANGED")); CHmethod->append(M("GENERAL_UNCHANGED")); Medgreinf->append(M("GENERAL_UNCHANGED")); diff --git a/rtgui/wavelet.h b/rtgui/wavelet.h index 6daabcd67..127be0efa 100644 --- a/rtgui/wavelet.h +++ b/rtgui/wavelet.h @@ -47,7 +47,6 @@ class Wavelet final : public: Wavelet(); ~Wavelet() override; - bool wavComputed_(); void adjusterChanged(Adjuster* a, double newval) override; void autoOpenCurve() override; @@ -102,6 +101,7 @@ private: rtengine::ProcEvent EvWavrangeab; rtengine::ProcEvent EvWavprotab; rtengine::ProcEvent EvWavlevelshc; + rtengine::ProcEvent EvWavcomplexmet; LabGrid *labgrid; @@ -121,6 +121,7 @@ private: void LmethodChanged(); void MedgreinfChanged(); void TMmethodChanged(); + void complexmethodChanged(); void TilesmethodChanged(); void avoidToggled(); void showmaskToggled (); @@ -143,7 +144,8 @@ private: void ushamethodChanged(); void updateGUI(); void updateGUImaxlev(); - + void convertParamToNormal(); + void updateGUIToMode(int mode); void HSmethodUpdateUI(); void CHmethodUpdateUI(); // void CHSLmethodChangedUI(); @@ -297,6 +299,8 @@ private: sigc::connection CLmethodconn; MyComboBoxText* const Backmethod; sigc::connection Backmethodconn; + MyComboBoxText* const complexmethod; + sigc::connection complexmethodconn; MyComboBoxText* const Tilesmethod; sigc::connection Tilesmethodconn; MyComboBoxText* const daubcoeffmethod; @@ -338,6 +342,7 @@ private: Gtk::HBox* const neutrHBox; Gtk::HBox* const usharpHBox; + Gtk::HBox* const ctboxch; sigc::connection enableChromaConn, enableContrastConn, enableEdgeConn, enabletmConn, enableFinalConn, enableclariConn; sigc::connection enableNoiseConn, enableResidConn, enableToningConn;