From 28739b840088ead6909de96529d7ddcf664e53cb Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 8 Nov 2020 11:36:31 +0100 Subject: [PATCH] dehaze saturation adjuster for local adjustments, #5972 --- rtdata/languages/default | 2 +- rtengine/ipdehaze.cc | 92 +++++++++++++++------------------------- rtengine/iplocallab.cc | 8 ++-- rtengine/procevents.h | 2 +- rtengine/procparams.cc | 8 ++-- rtengine/procparams.h | 2 +- rtengine/refreshmap.cc | 2 +- rtgui/locallabtools.h | 5 +-- rtgui/locallabtools2.cc | 51 ++++++---------------- rtgui/paramsedited.cc | 10 ++--- rtgui/paramsedited.h | 2 +- 11 files changed, 68 insertions(+), 116 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 569f59a99..23ad9f33a 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1005,7 +1005,7 @@ HISTORY_MSG_747;Local Spot created HISTORY_MSG_748;Local - Exp Denoise HISTORY_MSG_749;Local - Reti Depth HISTORY_MSG_750;Local - Reti Mode log - lin -HISTORY_MSG_751;Local - Reti Dehaze luminance +HISTORY_MSG_751;Local - Reti Dehaze saturation HISTORY_MSG_752;Local - Reti Offset HISTORY_MSG_753;Local - Reti Transmission map HISTORY_MSG_754;Local - Reti Clip diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index 59cf35035..6ae8be27b 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -313,10 +313,6 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) const int H = img->getHeight(); const float strength = LIM01(float(dehazeParams.strength) / 100.f * 0.9f); - if (settings->verbose) { - std::cout << "dehaze: strength = " << strength << std::endl; - } - array2D dark(W, H); int patchsize = max(int(5 / scale), 2); @@ -384,7 +380,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) const float depth = -float(dehazeParams.depth) / 100.f; const float t0 = max(1e-3f, std::exp(depth * maxDistance)); - const float teps = 1e-3f; + constexpr float teps = 1.f + 1e-3f; const float satBlend = dehazeParams.saturation / 100.f; const TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); @@ -392,6 +388,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) const vfloat wsv[3] = {F2V(ws[1][0]), F2V(ws[1][1]),F2V(ws[1][2])}; #endif const float ambientY = Color::rgbLuminance(ambient[0], ambient[1], ambient[2], ws); + #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif @@ -414,8 +411,8 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) const vfloat g = LVFU(img->g(y, x)); const vfloat b = LVFU(img->b(y, x)); // ... t >= tl to avoid negative values - const vfloat tlv = onev - vminf(r / ambient0v, vminf(g / ambient1v, b / ambient2v)); - const vfloat mtv = vmaxf(LVFU(dark[y][x]), vmaxf(tlv + tepsv, t0v)); + const vfloat tlv = tepsv - vminf(r / ambient0v, vminf(g / ambient1v, b / ambient2v)); + const vfloat mtv = vmaxf(LVFU(dark[y][x]), vmaxf(tlv, t0v)); if (dehazeParams.showDepthMap) { const vfloat valv = vclampf(onev - mtv, ZEROV, onev) * cmaxChannelv; STVFU(img->r(y, x), valv); @@ -437,8 +434,8 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) const float g = img->g(y, x); const float b = img->b(y, x); // ... t >= tl to avoid negative values - const float tl = 1.f - min(r / ambient[0], g / ambient[1], b / ambient[2]); - const float mt = max(dark[y][x], t0, tl + teps); + const float tl = teps - min(r / ambient[0], g / ambient[1], b / ambient[2]); + const float mt = max(dark[y][x], t0, tl); if (dehazeParams.showDepthMap) { img->r(y, x) = img->g(y, x) = img->b(y, x) = LIM01(1.f - mt) * maxChannel; } else { @@ -453,19 +450,15 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) } } - - void ImProcFunctions::dehazeloc(Imagefloat *img, const DehazeParams &dehazeParams) { //J.Desmis 12 2019 - this version derived from ART, is slower than the main from maximum 10% - probably use of SSE //Probably Ingo could solved this problem in some times - BENCHFUN + if (!dehazeParams.enabled || dehazeParams.strength == 0.0) { return; } - - const float maxChannel = normalize(img, multiThread); const int W = img->getWidth(); @@ -473,10 +466,6 @@ void ImProcFunctions::dehazeloc(Imagefloat *img, const DehazeParams &dehazeParam const float strength = LIM01(float(std::abs(dehazeParams.strength)) / 100.f * 0.9f); const bool add_haze = dehazeParams.strength < 0; - if (settings->verbose) { - std::cout << "dehaze: strength = " << strength << std::endl; - } - array2D dark(W, H); int patchsize = max(int(5 / scale), 2); @@ -546,11 +535,11 @@ void ImProcFunctions::dehazeloc(Imagefloat *img, const DehazeParams &dehazeParam } const float depth = -float(dehazeParams.depth) / 100.f; - const float teps = 1e-6f; + constexpr float teps = 1e-6f; const float t0 = max(teps, std::exp(depth * maxDistance)); -// const bool luminance = dehazeParams.luminance; - const bool luminance = true; + const float satBlend = dehazeParams.saturation / 100.f; + const TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); const float ambientY = Color::rgbLuminance(ambient[0], ambient[1], ambient[2], ws); @@ -559,56 +548,43 @@ void ImProcFunctions::dehazeloc(Imagefloat *img, const DehazeParams &dehazeParam #endif for (int y = 0; y < H; ++y) { - int x = 0; - for (; x < W; ++x) { + for (int x = 0; x < W; ++x) { // ensure that the transmission is such that to avoid clipping... - float rgb[3] = { img->r(y, x), img->g(y, x), img->b(y, x) }; + const float rIn = img->r(y, x); + const float gIn = img->g(y, x); + const float bIn = img->b(y, x); // ... t >= tl to avoid negative values - float tl = 1.f - min(rgb[0] / ambient[0], rgb[1] / ambient[1], rgb[2] / ambient[2]); - // // ... t >= tu to avoid values > 1 - // float tu = t0 - teps; - // for (int c = 0; c < 3; ++c) { - // if (ambient[c] < 1) { - // tu = max(tu, (rgb[c] - ambient[c])/(1.f - ambient[c])); - // } - // } - float &ir = img->r(y, x); - float &ig = img->g(y, x); - float &ib = img->b(y, x); - const float mt = max(dark[y][x], t0, tl + teps); + const float tl = 1.f + teps - min(rIn / ambient[0], gIn / ambient[1], bIn / ambient[2]); + const float mt = max(dark[y][x], t0, tl); if (dehazeParams.showDepthMap) { img->r(y, x) = img->g(y, x) = img->b(y, x) = LIM01(1.f - mt) * maxChannel; - } else if (luminance) { - float Y = Color::rgbLuminance(img->r(y, x), img->g(y, x), img->b(y, x), ws); - float YY = (Y - ambientY) / mt + ambientY; - + } else { + float f = 1.f; + const float Y = Color::rgbLuminance(rIn, gIn, bIn, ws); if (Y > 1e-5f) { + float YY = (Y - ambientY) / mt + ambientY; if (add_haze) { YY = Y + Y - YY; } - - float f = YY / Y; - ir = rgb[0] * f; - ig = rgb[1] * f; - ib = rgb[2] * f; - + f = YY / Y; } - } else { - float r = ((rgb[0] - ambient[0]) / mt + ambient[0]); - float g = ((rgb[1] - ambient[1]) / mt + ambient[1]); - float b = ((rgb[2] - ambient[2]) / mt + ambient[2]); + const float r1 = rIn * f; + const float g1 = gIn * f; + const float b1 = bIn * f; + + float r2 = ((rIn - ambient[0]) / mt + ambient[0]); + float g2 = ((gIn - ambient[1]) / mt + ambient[1]); + float b2 = ((bIn - ambient[2]) / mt + ambient[2]); if (add_haze) { - ir += (ir - r); - ig += (ig - g); - ib += (ib - b); - } else { - ir = r; - ig = g; - ib = b; + r2 = rIn + rIn - r2; + g2 = gIn + gIn - g2; + b2 = bIn + bIn - b2; } - + img->r(y, x) = intp(satBlend, r2, r1); + img->g(y, x) = intp(satBlend, g2, g1); + img->b(y, x) = intp(satBlend, b2, b1); } } } diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 94f341bf6..a11b34beb 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -498,6 +498,7 @@ struct local_params { float trans; float feath; int dehaze; + int dehazeSaturation; int depth; bool inv; bool invex; @@ -752,8 +753,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.showmaskblmet = llblMask; lp.showmasklogmet = lllogMask; lp.showmask_met = ll_Mask; - printf("mask=%i \n", lp.showmasklogmet); - + lp.enaColorMask = locallab.spots.at(sp).enaColorMask && llsoftMask == 0 && llColorMask == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible lp.enaColorMaskinv = locallab.spots.at(sp).enaColorMask && llColorMaskinv == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible lp.enaExpMask = locallab.spots.at(sp).enaExpMask && llExpMask == 0 && llColorMask == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible @@ -1005,6 +1005,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall int local_sensih = locallab.spots.at(sp).sensih; int local_dehaze = locallab.spots.at(sp).dehaz; int local_depth = locallab.spots.at(sp).depth; + int local_dehazeSaturation = locallab.spots.at(sp).dehazeSaturation; int local_sensicb = locallab.spots.at(sp).sensicb; float local_clarityml = (float) locallab.spots.at(sp).clarityml; float local_contresid = (float) locallab.spots.at(sp).contresid; @@ -1260,6 +1261,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.sens = local_sensi; lp.sensh = local_sensih; lp.dehaze = local_dehaze; + lp.dehazeSaturation = local_dehazeSaturation; lp.depth = local_depth; lp.senscb = local_sensicb; lp.clarityml = local_clarityml; @@ -12356,8 +12358,8 @@ void ImProcFunctions::Lab_Local( dehazeParams.enabled = true; dehazeParams.strength = lp.dehaze; dehazeParams.showDepthMap = false; + dehazeParams.saturation = lp.dehazeSaturation; dehazeParams.depth = lp.depth; -// dehazeParams.luminance = true; lab2rgb(*bufexpfin, *tmpImage.get(), params->icm.workingProfile); dehazeloc(tmpImage.get(), dehazeParams); rgb2lab(*tmpImage.get(), *bufexpfin, params->icm.workingProfile); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index ceea08f42..9f4e3e77c 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -773,7 +773,7 @@ enum ProcEventCode { EvlocallabexnoiseMethod = 747, Evlocallabdepth = 748, Evlocallabloglin = 749, - Evlocallablumonly = 750, + EvlocallabdehazeSaturation = 750, Evlocallaboffs = 751, EvlocallabCTtransCurve = 752, Evlocallabcliptm = 753, diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 29739506c..48a5e70b2 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3485,7 +3485,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : inversret(false), equilret(true), loglin(false), - lumonly(false), + dehazeSaturation(50.0), softradiusret(40.0), CCmaskreticurve{ static_cast(FCT_MinMaxCPoints), @@ -4350,7 +4350,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && inversret == other.inversret && equilret == other.equilret && loglin == other.loglin - && lumonly == other.lumonly + && dehazeSaturation == other.dehazeSaturation && softradiusret == other.softradiusret && CCmaskreticurve == other.CCmaskreticurve && LLmaskreticurve == other.LLmaskreticurve @@ -5908,7 +5908,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->inversret, "Locallab", "Inversret_" + index_str, spot.inversret, keyFile); saveToKeyfile(!pedited || spot_edited->equilret, "Locallab", "Equilret_" + index_str, spot.equilret, keyFile); saveToKeyfile(!pedited || spot_edited->loglin, "Locallab", "Loglin_" + index_str, spot.loglin, keyFile); - saveToKeyfile(!pedited || spot_edited->lumonly, "Locallab", "Lumonly_" + index_str, spot.lumonly, keyFile); + saveToKeyfile(!pedited || spot_edited->dehazeSaturation, "Locallab", "dehazeSaturation_" + index_str, spot.dehazeSaturation, keyFile); saveToKeyfile(!pedited || spot_edited->softradiusret, "Locallab", "Softradiusret_" + index_str, spot.softradiusret, keyFile); saveToKeyfile(!pedited || spot_edited->CCmaskreticurve, "Locallab", "CCmaskretiCurve_" + index_str, spot.CCmaskreticurve, keyFile); saveToKeyfile(!pedited || spot_edited->LLmaskreticurve, "Locallab", "LLmaskretiCurve_" + index_str, spot.LLmaskreticurve, keyFile); @@ -7685,7 +7685,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Inversret_" + index_str, pedited, spot.inversret, spotEdited.inversret); assignFromKeyfile(keyFile, "Locallab", "Equilret_" + index_str, pedited, spot.equilret, spotEdited.equilret); assignFromKeyfile(keyFile, "Locallab", "Loglin_" + index_str, pedited, spot.loglin, spotEdited.loglin); - assignFromKeyfile(keyFile, "Locallab", "Lumonly_" + index_str, pedited, spot.lumonly, spotEdited.lumonly); + assignFromKeyfile(keyFile, "Locallab", "dehazeSaturation" + index_str, pedited, spot.dehazeSaturation, spotEdited.dehazeSaturation); assignFromKeyfile(keyFile, "Locallab", "Softradiusret_" + index_str, pedited, spot.softradiusret, spotEdited.softradiusret); assignFromKeyfile(keyFile, "Locallab", "CCmaskretiCurve_" + index_str, pedited, spot.CCmaskreticurve, spotEdited.CCmaskreticurve); assignFromKeyfile(keyFile, "Locallab", "LLmaskretiCurve_" + index_str, pedited, spot.LLmaskreticurve, spotEdited.LLmaskreticurve); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 3e3c5c424..39992d88b 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1292,7 +1292,7 @@ struct LocallabParams { bool inversret; bool equilret; bool loglin; - bool lumonly; + double dehazeSaturation; double softradiusret; std::vector CCmaskreticurve; std::vector LLmaskreticurve; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 0a2cae7fa..e424ef14d 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -777,7 +777,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvlocallabexnoiseMethod LUMINANCECURVE, // Evlocallabdepth LUMINANCECURVE, // Evlocallabloglin - LUMINANCECURVE, // Evlocallablumonly + LUMINANCECURVE, // EvlocallabdehazeSaturation LUMINANCECURVE, // Evlocallaboffs LUMINANCECURVE, // EvlocallabCTtransCurve LUMINANCECURVE, // Evlocallabcliptm diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 1e4b1ad30..c221983c1 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -827,7 +827,7 @@ private: Gtk::Frame* const dehaFrame; Adjuster* const dehaz; Adjuster* const depth; - Gtk::CheckButton* const lumonly; + Adjuster* const dehazeSaturation; Gtk::Frame* const retiFrame; Adjuster* const str; Gtk::CheckButton* const loglin; @@ -872,7 +872,7 @@ private: DiagonalCurveEditor* const Lmaskretishape; Gtk::CheckButton* const inversret; - sigc::connection lumonlyConn, loglinConn, retinexMethodConn, fftwretiConn, equilretConn, showmaskretiMethodConn, enaretiMaskConn, enaretiMasktmapConn, inversretConn; + sigc::connection loglinConn, retinexMethodConn, fftwretiConn, equilretConn, showmaskretiMethodConn, enaretiMaskConn, enaretiMasktmapConn, inversretConn; public: LocallabRetinex(); @@ -903,7 +903,6 @@ private: void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; - void lumonlyChanged(); void loglinChanged(); void retinexMethodChanged(); void fftwretiChanged(); diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 972a4257d..52d5d9ad3 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -686,7 +686,7 @@ LocallabRetinex::LocallabRetinex(): dehaFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_DEHAFRA")))), dehaz(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DEHAZ"), -100, 100, 1, 0))), depth(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DEPTH"), 0, 100, 1, 25))), - lumonly(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_LUMONLY")))), + dehazeSaturation(Gtk::manage(new Adjuster(M("TP_DEHAZE_SATURATION"), 0, 100, 1, 50))), retiFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RETIFRA")))), str(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STR"), 0., 100., 0.2, 0.))), loglin(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_LOGLIN")))), @@ -736,10 +736,9 @@ LocallabRetinex::LocallabRetinex(): // Parameter Retinex specific widgets dehaz->setAdjusterListener(this); + dehazeSaturation->setAdjusterListener(this); depth->setAdjusterListener(this); - lumonlyConn = lumonly->signal_toggled().connect(sigc::mem_fun(*this, &LocallabRetinex::lumonlyChanged)); - retiFrame->set_label_align(0.025, 0.5); str->setAdjusterListener(this); @@ -865,7 +864,7 @@ LocallabRetinex::LocallabRetinex(): ToolParamBlock* const dehaBox = Gtk::manage(new ToolParamBlock()); dehaBox->pack_start(*dehaz); dehaBox->pack_start(*depth); - dehaBox->pack_start(*lumonly); + dehaBox->pack_start(*dehazeSaturation); dehaFrame->add(*dehaBox); auxBox->add(*dehaFrame); ToolParamBlock* const deharetiBox = Gtk::manage(new ToolParamBlock()); @@ -1060,7 +1059,6 @@ void LocallabRetinex::disableListener() { LocallabTool::disableListener(); - lumonlyConn.block(true); loglinConn.block(true); retinexMethodConn.block(true); fftwretiConn.block(true); @@ -1075,7 +1073,6 @@ void LocallabRetinex::enableListener() { LocallabTool::enableListener(); - lumonlyConn.block(false); loglinConn.block(false); retinexMethodConn.block(false); fftwretiConn.block(false); @@ -1105,7 +1102,7 @@ void LocallabRetinex::read(const rtengine::procparams::ProcParams* pp, const Par dehaz->setValue((double)spot.dehaz); depth->setValue((double)spot.depth); - lumonly->set_active(spot.lumonly); + dehazeSaturation->setValue((double)spot.dehazeSaturation); str->setValue(spot.str); loglin->set_active(spot.loglin); sensih->setValue((double)spot.sensih); @@ -1178,7 +1175,7 @@ void LocallabRetinex::write(rtengine::procparams::ProcParams* pp, ParamsEdited* spot.dehaz = dehaz->getIntValue(); spot.depth = depth->getIntValue(); - spot.lumonly = lumonly->get_active(); + spot.dehazeSaturation = dehazeSaturation->getIntValue(); spot.str = str->getValue(); spot.loglin = loglin->get_active(); spot.sensih = sensih->getIntValue(); @@ -1232,6 +1229,7 @@ void LocallabRetinex::setDefaults(const rtengine::procparams::ProcParams* defPar // Set default values for adjuster widgets dehaz->setDefault((double)defSpot.dehaz); + dehazeSaturation->setDefault((double)defSpot.dehazeSaturation); depth->setDefault((double)defSpot.depth); str->setDefault(defSpot.str); sensih->setDefault((double)defSpot.sensih); @@ -1276,6 +1274,13 @@ void LocallabRetinex::adjusterChanged(Adjuster* a, double newval) } } + if (a == dehazeSaturation) { + if (listener) { + listener->panelChanged(EvlocallabdehazeSaturation, + dehazeSaturation->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == depth) { if (listener) { listener->panelChanged(Evlocallabdepth, @@ -1535,16 +1540,6 @@ void LocallabRetinex::convertParamToNormal() void LocallabRetinex::convertParamToSimple() { - const LocallabParams::LocallabSpot defSpot; - - // Disable all listeners - disableListener(); - - // Set hidden specific GUI widgets in Simple mode to default spot values - lumonly->set_active(defSpot.lumonly); - - // Enable all listeners - enableListener(); } void LocallabRetinex::updateGUIToMode(const modeType new_type) @@ -1552,10 +1547,8 @@ void LocallabRetinex::updateGUIToMode(const modeType new_type) switch (new_type) { case Simple: // Expert and Normal mode widgets are hidden in Simple mode - lumonly->hide(); retiFrame->hide(); retitoolFrame->hide(); - break; case Normal: @@ -1563,13 +1556,10 @@ void LocallabRetinex::updateGUIToMode(const modeType new_type) retiFrame->hide(); retitoolFrame->hide(); // Specific Simple mode widgets are shown in Normal mode - lumonly->show(); - break; case Expert: // Show widgets hidden in Normal and Simple mode - lumonly->show(); retiFrame->show(); retitoolFrame->show(); } @@ -1592,21 +1582,6 @@ void LocallabRetinex::updateMaskBackground(const double normChromar, const doubl ); } -void LocallabRetinex::lumonlyChanged() -{ - if (isLocActivated && exp->getEnabled()) { - if (listener) { - if (lumonly->get_active()) { - listener->panelChanged(Evlocallablumonly, - M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); - } else { - listener->panelChanged(Evlocallablumonly, - M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); - } - } - } -} - void LocallabRetinex::loglinChanged() { if (isLocActivated && exp->getEnabled()) { diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 5e5fade1f..2543a25f7 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1360,7 +1360,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).inversret = locallab.spots.at(j).inversret && pSpot.inversret == otherSpot.inversret; locallab.spots.at(j).equilret = locallab.spots.at(j).equilret && pSpot.equilret == otherSpot.equilret; locallab.spots.at(j).loglin = locallab.spots.at(j).loglin && pSpot.loglin == otherSpot.loglin; - locallab.spots.at(j).lumonly = locallab.spots.at(j).lumonly && pSpot.lumonly == otherSpot.lumonly; + locallab.spots.at(j).dehazeSaturation = locallab.spots.at(j).dehazeSaturation && pSpot.dehazeSaturation == otherSpot.dehazeSaturation; locallab.spots.at(j).softradiusret = locallab.spots.at(j).softradiusret && pSpot.softradiusret == otherSpot.softradiusret; locallab.spots.at(j).CCmaskreticurve = locallab.spots.at(j).CCmaskreticurve && pSpot.CCmaskreticurve == otherSpot.CCmaskreticurve; locallab.spots.at(j).LLmaskreticurve = locallab.spots.at(j).LLmaskreticurve && pSpot.LLmaskreticurve == otherSpot.LLmaskreticurve; @@ -4357,8 +4357,8 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).loglin = mods.locallab.spots.at(i).loglin; } - if (locallab.spots.at(i).lumonly) { - toEdit.locallab.spots.at(i).lumonly = mods.locallab.spots.at(i).lumonly; + if (locallab.spots.at(i).dehazeSaturation) { + toEdit.locallab.spots.at(i).dehazeSaturation = mods.locallab.spots.at(i).dehazeSaturation; } if (locallab.spots.at(i).softradiusret) { @@ -6625,7 +6625,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : inversret(v), equilret(v), loglin(v), - lumonly(v), + dehazeSaturation(v), softradiusret(v), CCmaskreticurve(v), LLmaskreticurve(v), @@ -7139,7 +7139,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) inversret = v; equilret = v; loglin = v; - lumonly = v; + dehazeSaturation = v; softradiusret = v; CCmaskreticurve = v; LLmaskreticurve = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 7d682c4f9..523999e67 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -700,7 +700,7 @@ public: bool inversret; bool equilret; bool loglin; - bool lumonly; + bool dehazeSaturation; bool softradiusret; bool CCmaskreticurve; bool LLmaskreticurve;