From c1fa8a82cff69a6f23b4ea1e9aecfb04661b5193 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 3 Jun 2020 14:10:25 +0200 Subject: [PATCH 1/2] Fixed bug in procparams blurcol --- rtdata/languages/default | 2 +- rtengine/procparams.cc | 3 ++- rtgui/locallabtools.cc | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index cc50eb4eb..3c6cdf839 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2743,7 +2743,7 @@ TP_LOCALLAB_STRGRID;Strength TP_LOCALLAB_STRRETI_TOOLTIP;if Strength Retinex < 0.2 only Dehaze is enabled.\nif Strength Retinex >= 0.1 Dehaze is in luminance mode. TP_LOCALLAB_STRUC;Structure TP_LOCALLAB_STRUCCOL1;Structure Spot -TP_LOCALLAB_STRUCT_TOOLTIP;Use Sobel algorithm to take into account structure in shape detection.\nyou can have a preview by activating "mask and modifications - Show structure spot".\n\nCan be used in conjunction with masks (expert) structure, blur, wavelet to improve edge detection +TP_LOCALLAB_STRUCT_TOOLTIP;Use Sobel algorithm to take into account structure in shape detection.\nyou can have a preview by activating "mask and modifications - Show structure spot".\n\nCan be used in conjunction with masks (expert) structure, blur, wavelet to improve edge detection.\n\nNeeds maskless adjustments to be activated (lightness, exposure...) TP_LOCALLAB_STRUCCOL;Structure TP_LOCALLAB_STRUMASKCOL;Structure mask strength TP_LOCALLAB_STRUMASK_TOOLTIP;Generate a structure mask with difference between surface areas and reliefs.\nIf structure mask as tool is enabled, this mask is used in addition to the other tools (gamma, slope, contrast curve ...) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e5cc10515..9b92ae04c 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2716,7 +2716,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : special(false), toolcol(true), enaColorMask(false), - fftColorMask(false), + fftColorMask(true), CCmaskcurve{ static_cast(FCT_MinMaxCPoints), 0.0, @@ -5207,6 +5207,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->strcolh, "Locallab", "Strcolh_" + index_str, spot.strcolh, keyFile); saveToKeyfile(!pedited || spot_edited->angcol, "Locallab", "Angcol_" + index_str, spot.angcol, keyFile); saveToKeyfile(!pedited || spot_edited->blurcolde, "Locallab", "Blurcolde_" + index_str, spot.blurcolde, keyFile); + saveToKeyfile(!pedited || spot_edited->blurcol, "Locallab", "Blurcol_" + index_str, spot.blurcol, keyFile); saveToKeyfile(!pedited || spot_edited->contcol, "Locallab", "Contcol_" + index_str, spot.contcol, keyFile); saveToKeyfile(!pedited || spot_edited->blendmaskcol, "Locallab", "Blendmaskcol_" + index_str, spot.blendmaskcol, keyFile); saveToKeyfile(!pedited || spot_edited->radmaskcol, "Locallab", "Radmaskcol_" + index_str, spot.radmaskcol, keyFile); diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 4f781bde9..f40f892a1 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -447,7 +447,7 @@ LocallabColor::LocallabColor(): blurFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABBLURM")))), fftColorMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTCOL_MASK")))), contcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTCOL"), 0., 200., 0.5, 0.))), - blurcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURCOL"), 0.2, 100., 0.5, 0.2))), + blurcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURCOL"), 0.2, 200., 0.5, 0.2))), blendmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), radmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), -10.0, 1000.0, 0.1, 0.))), lapmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPMASKCOL"), 0.0, 100.0, 0.1, 0.))), @@ -2156,7 +2156,7 @@ void LocallabColor::updateColorGUI2() void LocallabColor::updateColorGUI3() { - const double temp = blurcol->getValue(); +/* const double temp = blurcol->getValue(); if (fftColorMask->get_active()) { blurcol->setLimits(0.2, 1000., 0.5, 0.2); @@ -2165,6 +2165,7 @@ void LocallabColor::updateColorGUI3() } blurcol->setValue(temp); + */ } /* ==== LocallabExposure ==== */ From 17f981e288504f4a7309108d1944102e414633e0 Mon Sep 17 00:00:00 2001 From: Pandagrapher Date: Wed, 3 Jun 2020 18:44:20 +0200 Subject: [PATCH 2/2] Fixes bug with 'blurcol' and 'lcradius' when FFT is active --- rtgui/locallabtools.cc | 11 +++++------ rtgui/locallabtools2.cc | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index f40f892a1..e6c671636 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -447,7 +447,7 @@ LocallabColor::LocallabColor(): blurFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABBLURM")))), fftColorMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTCOL_MASK")))), contcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTCOL"), 0., 200., 0.5, 0.))), - blurcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURCOL"), 0.2, 200., 0.5, 0.2))), + blurcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURCOL"), 0.2, 100., 0.5, 0.2))), blendmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), radmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), -10.0, 1000.0, 0.1, 0.))), lapmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPMASKCOL"), 0.0, 100.0, 0.1, 0.))), @@ -1121,6 +1121,9 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param toolcol->set_active(spot.toolcol); fftColorMask->set_active(spot.fftColorMask); contcol->setValue(spot.contcol); + // Update GUI according to fftColorMash button state + // Note: Contrary to the others, shall be called before setting 'blurcol' value + updateColorGUI3(); blurcol->setValue(spot.blurcol); blendmaskcol->setValue(spot.blendmaskcol); radmaskcol->setValue(spot.radmaskcol); @@ -1147,9 +1150,6 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param // Update GUI according to merMethod combobox state updateColorGUI2(); - // Update GUI according to fftColorMash button state - updateColorGUI3(); - // Note: No need to manage pedited as batch mode is deactivated for Locallab } @@ -2156,7 +2156,7 @@ void LocallabColor::updateColorGUI2() void LocallabColor::updateColorGUI3() { -/* const double temp = blurcol->getValue(); + const double temp = blurcol->getValue(); if (fftColorMask->get_active()) { blurcol->setLimits(0.2, 1000., 0.5, 0.2); @@ -2165,7 +2165,6 @@ void LocallabColor::updateColorGUI3() } blurcol->setValue(temp); - */ } /* ==== LocallabExposure ==== */ diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 0b0e8b228..698af9795 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -2668,6 +2668,10 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa localcontMethod->set_active(1); } + fftwlc->set_active(spot.fftwlc); + // Update Local contrast GUI according to fftwlc button state + // Note: Contrary to the others, shall be called before setting 'lcradius' value + updateContrastGUI3(); lcradius->setValue((double)spot.lcradius); lcamount->setValue(spot.lcamount); lcdarkness->setValue(spot.lcdarkness); @@ -2743,7 +2747,6 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa deltad->setValue(spot.deltad); wavshapecomp->setCurve(spot.loccompwavcurve); fatres->setValue(spot.fatres); - fftwlc->set_active(spot.fftwlc); enalcMask->set_active(spot.enalcMask); CCmasklcshape->setCurve(spot.CCmasklccurve); LLmasklcshape->setCurve(spot.LLmasklccurve); @@ -2766,9 +2769,6 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa // Update Local contrast GUI according to waveshow button state updateContrastGUI2(); - // Update Local contrast GUI according to fftwlc button state - updateContrastGUI3(); - // Note: No need to manage pedited as batch mode is deactivated for Locallab }