From a6acb2a7565eda185dd9382cb12894311bff9817 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 29 Jan 2020 11:15:51 +0100 Subject: [PATCH] Changes to GUI pyramid --- rtdata/languages/default | 6 ++- rtengine/procevents.h | 1 + rtengine/procparams.cc | 4 ++ rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 1 + rtgui/locallab.cc | 83 +++++++++++++++++++++++++++++++++------- rtgui/locallab.h | 4 ++ rtgui/paramsedited.cc | 7 ++++ rtgui/paramsedited.h | 1 + 9 files changed, 93 insertions(+), 15 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 361e70910..6bd26397d 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1143,6 +1143,7 @@ HISTORY_MSG_905;Local - Contrast Wavelet Edge Sharpness HISTORY_MSG_906;Local - Contrast Wavelet ES sensitivity HISTORY_MSG_907;Local - Contrast Wavelet ES amplification HISTORY_MSG_908;Local - Contrast Wavelet ES neighboring +HISTORY_MSG_909;Local - Contrast Wavelet ES show HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2311,6 +2312,7 @@ TP_LOCALLAB_DETAILSH;Details TP_LOCALLAB_DETAILTHR;Detail threshold Luminance Chroma (DCT ƒ) TP_LOCALLAB_DUPLSPOTNAME;Copy TP_LOCALLAB_EDGFRA;Edge Sharpness +TP_LOCALLAB_EDGSHOW;Show all tools TP_LOCALLAB_ELI;Elipse TP_LOCALLAB_ENABLE_AFTER_MASK;Use Tone Mapping TP_LOCALLAB_ENABLE_MASK;Enable mask @@ -2416,9 +2418,9 @@ TP_LOCALLAB_LMASK_LL_TOOLTIP;Give priority to action on midtones and high lights TP_LOCALLAB_LOCCONT;Unsharp Mask TP_LOCALLAB_LOC_CONTRAST;Local contrast & Wavelet Pyramid Ψ TP_LOCALLAB_LOC_CONTRASTPYR;Ψ Pyramid 1: -TP_LOCALLAB_LOC_CONTRASTPYRLAB; Clarity & Blend - Graduated - Edge Sharpness +TP_LOCALLAB_LOC_CONTRASTPYRLAB; Graduated Filter - Edge Sharpness - Blur TP_LOCALLAB_LOC_CONTRASTPYR2;Ψ Pyramid 2: -TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contrast by Levels- Tone Mapping(s) - Blur +TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contrast by Levels- Tone Mapping(s) TP_LOCALLAB_LOG;Encoding log TP_LOCALLAB_LOGAUTO;Automatic TP_LOCALLAB_LOGFRA;Source Gray Point diff --git a/rtengine/procevents.h b/rtengine/procevents.h index a1fc740b8..65d0518d3 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -934,6 +934,7 @@ enum ProcEventCode { Evlocallabedgw = 905, Evlocallabbasew = 906, EvlocallablocalneiMethod = 907, + Evlocallabwaveshow = 908, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 4de477bdb..f663fc775 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2755,6 +2755,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : blurlc(true), wavblur(false), wavedg(false), + waveshow(false), wavcont(false), wavcomp(false), wavgradl(false), @@ -3201,6 +3202,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && blurlc == other.blurlc && wavblur == other.wavblur && wavedg == other.wavedg + && waveshow == other.waveshow && wavcont == other.wavcont && wavcomp == other.wavcomp && wavgradl == other.wavgradl @@ -4614,6 +4616,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blurlc, "Locallab", "Blurlc_" + std::to_string(i), spot.blurlc, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).wavblur, "Locallab", "Wavblur_" + std::to_string(i), spot.wavblur, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).wavedg, "Locallab", "Wavedg_" + std::to_string(i), spot.wavedg, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).waveshow, "Locallab", "Waveshow_" + std::to_string(i), spot.waveshow, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).wavcont, "Locallab", "Wavcont_" + std::to_string(i), spot.wavcont, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).wavcomp, "Locallab", "Wavcomp_" + std::to_string(i), spot.wavcomp, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).wavgradl, "Locallab", "Wavgradl_" + std::to_string(i), spot.wavgradl, keyFile); @@ -6182,6 +6185,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Blurlc_" + std::to_string(i), pedited, spot.blurlc, spotEdited.blurlc); assignFromKeyfile(keyFile, "Locallab", "Wavblur_" + std::to_string(i), pedited, spot.wavblur, spotEdited.wavblur); assignFromKeyfile(keyFile, "Locallab", "Wavedg_" + std::to_string(i), pedited, spot.wavedg, spotEdited.wavedg); + assignFromKeyfile(keyFile, "Locallab", "Waveshow_" + std::to_string(i), pedited, spot.waveshow, spotEdited.waveshow); assignFromKeyfile(keyFile, "Locallab", "Wavcont_" + std::to_string(i), pedited, spot.wavcont, spotEdited.wavcont); assignFromKeyfile(keyFile, "Locallab", "Wavcomp_" + std::to_string(i), pedited, spot.wavcomp, spotEdited.wavcomp); assignFromKeyfile(keyFile, "Locallab", "Wavgradl_" + std::to_string(i), pedited, spot.wavgradl, spotEdited.wavgradl); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 56ff61a1c..105a876ed 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1298,6 +1298,7 @@ struct LocallabParams { bool blurlc; bool wavblur; bool wavedg; + bool waveshow; bool wavcont; bool wavcomp; bool wavgradl; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 45a304999..2ca7daae4 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -938,6 +938,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabedgw LUMINANCECURVE, //Evlocallabbasew LUMINANCECURVE, //EvlocallablocalneiMethod + LUMINANCECURVE //Evlocallabwaveshow }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 345caf948..a4daa196e 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -715,6 +715,8 @@ wavcomp(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_COMPFRA")))), wavcompre(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_COMPREFRA")))), wavgradl(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_GRALWFRA")))), wavedg(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_EDGFRA")))), +waveshow(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_EDGSHOW")))), + //CBDL enacbMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), //encoding log @@ -816,6 +818,7 @@ retiBox(Gtk::manage(new ToolParamBlock())), maskretiBox(Gtk::manage(new ToolParamBlock())), mask7(Gtk::manage(new ToolParamBlock())), edgsBox(Gtk::manage(new ToolParamBlock())), +edgsBoxshow(Gtk::manage(new ToolParamBlock())), labgrid(Gtk::manage(new LabGrid(EvLocallabLabGridValue, M("TP_LOCALLAB_LABGRID_VALUES")))), labgridmerg(Gtk::manage(new LabGrid(EvLocallabLabGridmergValue, M("TP_LOCALLAB_LABGRID_VALUES"), false))), @@ -2909,6 +2912,7 @@ pe(nullptr) wavcompreConn = wavcompre->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::wavcompreChanged)); wavgradlConn = wavgradl->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::wavgradlChanged)); wavedgConn = wavedg->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::wavedgChanged)); + waveshowConn = waveshow->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::waveshowChanged)); origlcConn = origlc->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::origlcChanged)); csThreshold->setAdjusterListener(this); @@ -3111,22 +3115,27 @@ pe(nullptr) wavedg->set_tooltip_text(M("TP_LOCALLAB_WAVEEDG_TOOLTIP")); } Gtk::HSeparator* const separatoredg = Gtk::manage(new Gtk::HSeparator()); + Gtk::HSeparator* const separatoredg2 = Gtk::manage(new Gtk::HSeparator()); + waveshow->set_active(false); - // ToolParamBlock* const edgsBox = Gtk::manage(new ToolParamBlock()); +// ToolParamBlock* const edgsBoxshow = Gtk::manage(new ToolParamBlock()); edgsBox->pack_start(*strengthw); - edgsBox->pack_start(*radiusw); - edgsBox->pack_start(*detailw); + edgsBoxshow->pack_start(*radiusw); + edgsBoxshow->pack_start(*detailw); // edgsBox->pack_start(*localedgMethod); - edgsBox->pack_start(*edbox); + edgsBoxshow->pack_start(*edbox); edgsBox->pack_start(*LocalcurveEditorwavedg, Gtk::PACK_SHRINK, 4); edgsBox->pack_start(*gradw); - edgsBox->pack_start(*tloww); - edgsBox->pack_start(*thigw); - edgsBox->pack_start(*separatoredg); + edgsBoxshow->pack_start(*separatoredg2); + edgsBoxshow->pack_start(*tloww); + edgsBoxshow->pack_start(*thigw); + edgsBoxshow->pack_start(*separatoredg); + edgsBox->pack_start(*waveshow); - edgsBox->pack_start(*edgw); - edgsBox->pack_start(*basew); - edgsBox->pack_start(*ctboxNP); + edgsBoxshow->pack_start(*edgw); + edgsBoxshow->pack_start(*basew); + edgsBoxshow->pack_start(*ctboxNP); + edgsBox->pack_start(*edgsBoxshow); edgFrame->add(*edgsBox); Gtk::HSeparator* const separatorblu = Gtk::manage(new Gtk::HSeparator()); @@ -3203,17 +3212,17 @@ pe(nullptr) expcontrastpyr->setLevel(2); ToolParamBlock* const blurcontBox = Gtk::manage(new ToolParamBlock()); ToolParamBlock* const blurcontBox2 = Gtk::manage(new ToolParamBlock()); - blurcontBox->pack_start(*clariFrame); +// blurcontBox->pack_start(*clariFrame); blurcontBox->pack_start(*gradwavFrame); blurcontBox->pack_start(*edgFrame); blurcontBox2->pack_start(*contFrame); blurcontBox2->pack_start(*compreFrame); // if (complexsoft < 2) { - blurcontBox2->pack_start(*compFrame); + blurcontBox2->pack_start(*compFrame); // } - blurcontBox2->pack_start(*blurlevelFrame); + blurcontBox->pack_start(*blurlevelFrame); expcontrastpyr->add(*blurcontBox, false); expcontrastpyr2->add(*blurcontBox2, false); @@ -3223,6 +3232,7 @@ pe(nullptr) } ToolParamBlock* const contrastBox = Gtk::manage(new ToolParamBlock()); + Gtk::HSeparator* const separatorcontr = Gtk::manage(new Gtk::HSeparator()); if (complexsoft < 2) { contrastBox->pack_start(*localcontMethod); @@ -3247,6 +3257,8 @@ pe(nullptr) contrastBox->pack_start(*residchro); // } contrastBox->pack_start(*sensilc); + contrastBox->pack_start(*separatorcontr); + contrastBox->pack_start(*clariFrame); // if (complexsoft < 2) { contrastBox->pack_start(*expcontrastpyr); @@ -5547,6 +5559,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).blurlc = blurlc->get_active(); pp->locallab.spots.at(pp->locallab.selspot).wavblur = wavblur->get_active(); pp->locallab.spots.at(pp->locallab.selspot).wavedg = wavedg->get_active(); + pp->locallab.spots.at(pp->locallab.selspot).waveshow = waveshow->get_active(); pp->locallab.spots.at(pp->locallab.selspot).wavcont = wavcont->get_active(); pp->locallab.spots.at(pp->locallab.selspot).wavcomp = wavcomp->get_active(); pp->locallab.spots.at(pp->locallab.selspot).wavcompre = wavcompre->get_active(); @@ -5999,6 +6012,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).blurlc = pe->locallab.spots.at(pp->locallab.selspot).blurlc || !blurlc->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).wavblur = pe->locallab.spots.at(pp->locallab.selspot).wavblur || !wavblur->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).wavedg = pe->locallab.spots.at(pp->locallab.selspot).wavedg || !wavedg->get_inconsistent(); + pe->locallab.spots.at(pp->locallab.selspot).waveshow = pe->locallab.spots.at(pp->locallab.selspot).waveshow || !waveshow->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).wavcont = pe->locallab.spots.at(pp->locallab.selspot).wavcont || !wavcont->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).wavcomp = pe->locallab.spots.at(pp->locallab.selspot).wavcomp || !wavcomp->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).wavgradl = pe->locallab.spots.at(pp->locallab.selspot).wavgradl || !wavgradl->get_inconsistent(); @@ -6434,6 +6448,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).blurlc = pedited->locallab.spots.at(pp->locallab.selspot).blurlc || !blurlc->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).wavblur = pedited->locallab.spots.at(pp->locallab.selspot).wavblur || !wavblur->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).wavedg = pedited->locallab.spots.at(pp->locallab.selspot).wavedg || !wavedg->get_inconsistent(); + pedited->locallab.spots.at(pp->locallab.selspot).waveshow = pedited->locallab.spots.at(pp->locallab.selspot).waveshow || !waveshow->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).wavcont = pedited->locallab.spots.at(pp->locallab.selspot).wavcont || !wavcont->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).wavcomp = pedited->locallab.spots.at(pp->locallab.selspot).wavcomp || !wavcomp->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).wavgradl = pedited->locallab.spots.at(pp->locallab.selspot).wavgradl || !wavgradl->get_inconsistent(); @@ -7072,6 +7087,7 @@ void Locallab::localcontMethodChanged() blurlc->show(); wavblur->show(); wavedg->show(); + waveshow->show(); origlc->hide(); strwav->hide(); angwav->hide(); @@ -7117,6 +7133,7 @@ void Locallab::localcontMethodChanged() blurlc->show(); wavblur->show(); wavedg->show(); + waveshow->show(); origlc->show(); strwav->show(); angwav->show(); @@ -8821,6 +8838,35 @@ void Locallab::wavedgChanged() } } +void Locallab::waveshowChanged() +{ + + if (waveshow->get_active()){ + edgsBoxshow->show(); + } else { + edgsBoxshow->hide(); + } + + if (multiImage) { + if (waveshow->get_inconsistent()) { + waveshow->set_inconsistent(false); + waveshowConn.block(true); + waveshow->set_active(false); + waveshowConn.block(false); + } + } + + if (getEnabled() && expcontrast->getEnabled()) { + if (listener) { + if (waveshow->get_active()) { + listener->panelChanged(Evlocallabwaveshow, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(Evlocallabwaveshow, M("GENERAL_DISABLED")); + } + } + } +} + void Locallab::wavcontChanged() { @@ -12069,6 +12115,7 @@ void Locallab::enableListener() blurlcConn.block(false); wavblurConn.block(false); wavedgConn.block(false); + waveshowConn.block(false); wavcontConn.block(false); wavcompConn.block(false); wavgradlConn.block(false); @@ -12177,6 +12224,7 @@ void Locallab::disableListener() blurlcConn.block(true); wavblurConn.block(true); wavedgConn.block(true); + waveshowConn.block(true); wavcontConn.block(true); wavcompConn.block(true); wavgradlConn.block(true); @@ -12863,6 +12911,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con blurlc->set_active(pp->locallab.spots.at(index).blurlc); wavblur->set_active(pp->locallab.spots.at(index).wavblur); wavedg->set_active(pp->locallab.spots.at(index).wavedg); + waveshow->set_active(pp->locallab.spots.at(index).waveshow); wavcont->set_active(pp->locallab.spots.at(index).wavcont); wavcomp->set_active(pp->locallab.spots.at(index).wavcomp); wavgradl->set_active(pp->locallab.spots.at(index).wavgradl); @@ -12884,6 +12933,11 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con edgsBox->hide(); } + if (waveshow->get_active()){ + edgsBoxshow->show(); + } else { + edgsBoxshow->hide(); + } if (pp->locallab.spots.at(index).localcontMethod == "loc") { localcontMethod->set_active(0); @@ -13426,6 +13480,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con blurlc->set_inconsistent(multiImage && !spotState->blurlc); wavblur->set_inconsistent(multiImage && !spotState->wavblur); wavedg->set_inconsistent(multiImage && !spotState->wavedg); + waveshow->set_inconsistent(multiImage && !spotState->waveshow); wavcont->set_inconsistent(multiImage && !spotState->wavcont); wavcomp->set_inconsistent(multiImage && !spotState->wavcomp); wavgradl->set_inconsistent(multiImage && !spotState->wavgradl); @@ -13993,6 +14048,7 @@ void Locallab::updateSpecificGUIState() blurlc->show(); wavblur->show(); wavedg->show(); + waveshow->show(); origlc->hide(); strengthw->hide(); radiusw->hide(); @@ -14038,6 +14094,7 @@ void Locallab::updateSpecificGUIState() blurlc->show(); wavblur->show(); wavedg->show(); + waveshow->show(); origlc->show(); strengthw->show(); radiusw->show(); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 4d187ed1a..1617dc5fc 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -524,6 +524,8 @@ private: sigc::connection wavgradlConn; Gtk::CheckButton* const wavedg; sigc::connection wavedgConn; + Gtk::CheckButton* const waveshow; + sigc::connection waveshowConn; //CBDL Gtk::CheckButton* const enacbMask; @@ -662,6 +664,7 @@ private: ToolParamBlock* const maskretiBox; ToolParamBlock* const mask7; ToolParamBlock* const edgsBox; + ToolParamBlock* const edgsBoxshow; LabGrid* const labgrid; LabGrid* const labgridmerg; Gtk::Label* const mMLabels; @@ -753,6 +756,7 @@ private: void wavcompreChanged(); void wavgradlChanged(); void wavedgChanged(); + void waveshowChanged(); //CBDL void enacbMaskChanged(); // ComboBox event functions diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 6b24b9e18..38d28fdaf 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1293,6 +1293,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).blurlc = locallab.spots.at(j).blurlc && pSpot.blurlc == otherSpot.blurlc; locallab.spots.at(j).wavblur = locallab.spots.at(j).wavblur && pSpot.wavblur == otherSpot.wavblur; locallab.spots.at(j).wavedg = locallab.spots.at(j).wavedg && pSpot.wavedg == otherSpot.wavedg; + locallab.spots.at(j).waveshow = locallab.spots.at(j).waveshow && pSpot.waveshow == otherSpot.waveshow; locallab.spots.at(j).wavcont = locallab.spots.at(j).wavcont && pSpot.wavcont == otherSpot.wavcont; locallab.spots.at(j).wavcomp = locallab.spots.at(j).wavcomp && pSpot.wavcomp == otherSpot.wavcomp; locallab.spots.at(j).wavgradl = locallab.spots.at(j).wavgradl && pSpot.wavgradl == otherSpot.wavgradl; @@ -4172,6 +4173,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).wavedg = mods.locallab.spots.at(i).wavedg; } + if (locallab.spots.at(i).waveshow) { + toEdit.locallab.spots.at(i).waveshow = mods.locallab.spots.at(i).waveshow; + } + if (locallab.spots.at(i).wavcont) { toEdit.locallab.spots.at(i).wavcont = mods.locallab.spots.at(i).wavcont; } @@ -5770,6 +5775,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : blurlc(v), wavblur(v), wavedg(v), + waveshow(v), wavcont(v), wavcomp(v), wavgradl(v), @@ -6193,6 +6199,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) blurlc = v; wavblur = v; wavedg = v; + waveshow = v; wavcont = v; wavcomp = v; wavgradl = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 915f4ae61..2f4e766b9 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -724,6 +724,7 @@ public: bool blurlc; bool wavblur; bool wavedg; + bool waveshow; bool wavcont; bool wavcomp; bool wavgradl;