From d0d79c7d596645485c8f5b754239005133a47551 Mon Sep 17 00:00:00 2001 From: Pandagrapher Date: Sun, 3 May 2020 13:48:05 +0200 Subject: [PATCH 1/5] Improve complexity mode management for Locallab tools Changes: - For each Locallab tool, a complexity mode can now be chosen (by defaut, "Expert") to reduce or not the number of tool parameters. Fixed issues: - Some tool parameters had their values forced to a default one in "Normal" mode whereas it shouldn't. --- rtdata/languages/default | 4 + rtengine/procevents.h | 2 + rtengine/procparams.cc | 45 ++ rtengine/procparams.h | 11 + rtengine/refreshmap.cc | 6 +- rtgui/locallabtools.cc | 1090 ++++++++++++++++++++++---------------- rtgui/locallabtools.h | 41 +- rtgui/locallabtools2.cc | 374 ++++++++----- rtgui/paramsedited.cc | 77 +++ rtgui/paramsedited.h | 11 + 10 files changed, 1053 insertions(+), 608 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 185a2d9933..d9d7557f46 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1157,6 +1157,8 @@ HISTORY_MSG_916;Local - Residual wavelet shadows HISTORY_MSG_917;Local - Residual wavelet shadows threshold HISTORY_MSG_918;Local - Residual wavelet highlights HISTORY_MSG_919;Local - Residual wavelet highlights threshold +HISTORY_MSG_920;Local - Tool complexity mode +HISTORY_MSG_921;Local - Tool complexity mode HISTORY_MSG_CAT02PRESET;Cat02 automatic preset HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction @@ -2545,6 +2547,8 @@ TP_LOCALLAB_MERTWO;Substract TP_LOCALLAB_METHOD_TOOLTIP;'Enhanced + chroma denoise' significantly increases processing times.\nBut reduce artifacts. TP_LOCALLAB_MLABEL;Restored datas Min=%1 Max=%2 (Clip - Offset) TP_LOCALLAB_MLABEL_TOOLTIP;'Should be' near min=0 max=32768 but others values are possible.\nYou can act on Clip Restored datas and Offset to normalize.\n\nRestored image with no mixture. +TP_LOCALLAB_MODE_EXPERT;Expert +TP_LOCALLAB_MODE_NORMAL;Normal TP_LOCALLAB_MRFIV;Background TP_LOCALLAB_MRFOU;Previous Spot TP_LOCALLAB_MRONE;None diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 5584ac9f8a..1971e4ff6d 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -942,6 +942,8 @@ enum ProcEventCode { Evlocallabresidshathr = 916, Evlocallabresidhi = 917, Evlocallabresidhithr = 918, + EvlocallabcomplexityWithRefresh = 919, + EvlocallabcomplexityWithoutRefresh = 920, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 60333b2f63..cdd76aa607 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2540,6 +2540,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Color & Light visicolor(false), expcolor(false), + complexcolor(0), curvactiv(false), lightness(0), contrast(0), @@ -2756,6 +2757,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Exposure visiexpose(false), expexpose(false), + complexexpose(0), expcomp(0.0), hlcompr(0), hlcomprthresh(0), @@ -2851,6 +2853,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Shadow highlight visishadhigh(false), expshadhigh(false), + complexshadhigh(0), shMethod("std"), multsh{0, 0, 0, 0, 0}, highlights(0), @@ -2930,6 +2933,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Vibrance visivibrance(false), expvibrance(false), + complexvibrance(0), saturated(0), pastels(0), warm(0), @@ -3007,6 +3011,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Soft Light visisoft(false), expsoft(false), + complexsoft(0), streng(0), sensisf(15), laplace(25.), @@ -3014,6 +3019,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Blur & Noise visiblur(false), expblur(false), + complexblur(0), radius(1.5), strength(0), sensibn(40), @@ -3135,6 +3141,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Tone Mapping visitonemap(false), exptonemap(false), + complextonemap(0), stren(0.5), gamma(1.0), estop(1.4), @@ -3208,6 +3215,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Retinex visireti(false), expreti(false), + complexreti(0), retinexMethod("high"), str(0.2), chrrt(0.0), @@ -3321,6 +3329,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Sharpening visisharp(false), expsharp(false), + complexsharp(0), sharcontrast(20), sharradius(0.75), sharamount(100), @@ -3332,6 +3341,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Local Contrast visicontrast(false), expcontrast(false), + complexcontrast(0), lcradius(80), lcamount(0.0), lcdarkness(1.0), @@ -3526,6 +3536,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Contrast by detail levels visicbdl(false), expcbdl(false), + complexcbdl(0), mult{1.0, 1.0, 1.0, 1.0, 1.0, 1.0}, chromacbdl(0.), threshold(0.2), @@ -3650,6 +3661,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Color & Light && visicolor == other.visicolor && expcolor == other.expcolor + && complexcolor == other.complexcolor && curvactiv == other.curvactiv && lightness == other.lightness && contrast == other.contrast @@ -3712,6 +3724,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Exposure && visiexpose == other.visiexpose && expexpose == other.expexpose + && complexexpose == other.complexexpose && expcomp == other.expcomp && hlcompr == other.hlcompr && hlcomprthresh == other.hlcomprthresh @@ -3754,6 +3767,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Shadow highlight && visishadhigh == other.visishadhigh && expshadhigh == other.expshadhigh + && complexshadhigh == other.complexshadhigh && shMethod == other.shMethod && [this, &other]() -> bool { @@ -3793,6 +3807,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Vibrance && visivibrance == other.visivibrance && expvibrance == other.expvibrance + && complexvibrance == other.complexvibrance && saturated == other.saturated && pastels == other.pastels && warm == other.warm @@ -3820,6 +3835,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Soft Light && visisoft == other.visisoft && expsoft == other.expsoft + && complexsoft == other.complexsoft && streng == other.streng && sensisf == other.sensisf && laplace == other.laplace @@ -3827,6 +3843,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Blur & Noise && visiblur == other.visiblur && expblur == other.expblur + && complexblur == other.complexblur && radius == other.radius && strength == other.strength && sensibn == other.sensibn @@ -3876,6 +3893,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Tone Mapping && visitonemap == other.visitonemap && exptonemap == other.exptonemap + && complextonemap == other.complextonemap && stren == other.stren && gamma == other.gamma && estop == other.estop @@ -3901,6 +3919,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Retinex && visireti == other.visireti && expreti == other.expreti + && complexreti == other.complexreti && retinexMethod == other.retinexMethod && str == other.str && chrrt == other.chrrt @@ -3938,6 +3957,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Sharpening && visisharp == other.visisharp && expsharp == other.expsharp + && complexsharp == other.complexsharp && sharcontrast == other.sharcontrast && sharradius == other.sharradius && sharamount == other.sharamount @@ -3949,6 +3969,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Local contrast && visicontrast == other.visicontrast && expcontrast == other.expcontrast + && complexcontrast == other.complexcontrast && lcradius == other.lcradius && lcamount == other.lcamount && lcdarkness == other.lcdarkness @@ -4019,6 +4040,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Constrast by detail levels && visicbdl == other.visicbdl && expcbdl == other.expcbdl + && complexcbdl == other.complexcbdl && [this, &other]() -> bool { for (int i = 0; i < 6; ++i) { @@ -5091,6 +5113,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Color & Light if ((!pedited || spot_edited->visicolor) && spot.visicolor) { saveToKeyfile(!pedited || spot_edited->expcolor, "Locallab", "Expcolor_" + index_str, spot.expcolor, keyFile); + saveToKeyfile(!pedited || spot_edited->complexcolor, "Locallab", "Complexcolor_" + index_str, spot.complexcolor, keyFile); saveToKeyfile(!pedited || spot_edited->curvactiv, "Locallab", "Curvactiv_" + index_str, spot.curvactiv, keyFile); saveToKeyfile(!pedited || spot_edited->lightness, "Locallab", "Lightness_" + index_str, spot.lightness, keyFile); saveToKeyfile(!pedited || spot_edited->contrast, "Locallab", "Contrast_" + index_str, spot.contrast, keyFile); @@ -5153,6 +5176,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Exposure if ((!pedited || spot_edited->visiexpose) && spot.visiexpose) { saveToKeyfile(!pedited || spot_edited->expexpose, "Locallab", "Expexpose_" + index_str, spot.expexpose, keyFile); + saveToKeyfile(!pedited || spot_edited->complexexpose, "Locallab", "Complexexpose_" + index_str, spot.complexexpose, keyFile); saveToKeyfile(!pedited || spot_edited->expcomp, "Locallab", "Expcomp_" + index_str, spot.expcomp, keyFile); saveToKeyfile(!pedited || spot_edited->hlcompr, "Locallab", "Hlcompr_" + index_str, spot.hlcompr, keyFile); saveToKeyfile(!pedited || spot_edited->hlcomprthresh, "Locallab", "Hlcomprthresh_" + index_str, spot.hlcomprthresh, keyFile); @@ -5196,6 +5220,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Shadow highlight if ((!pedited || spot_edited->visishadhigh) && spot.visishadhigh) { saveToKeyfile(!pedited || spot_edited->expshadhigh, "Locallab", "Expshadhigh_" + index_str, spot.expshadhigh, keyFile); + saveToKeyfile(!pedited || spot_edited->complexshadhigh, "Locallab", "Complexshadhigh_" + index_str, spot.complexshadhigh, keyFile); saveToKeyfile(!pedited || spot_edited->shMethod, "Locallab", "ShMethod_" + index_str, spot.shMethod, keyFile); for (int j = 0; j < 5; j++) { @@ -5231,6 +5256,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Vibrance if ((!pedited || spot_edited->visivibrance) && spot.visivibrance) { saveToKeyfile(!pedited || spot_edited->expvibrance, "Locallab", "Expvibrance_" + index_str, spot.expvibrance, keyFile); + saveToKeyfile(!pedited || spot_edited->complexvibrance, "Locallab", "Complexvibrance_" + index_str, spot.complexvibrance, keyFile); saveToKeyfile(!pedited || spot_edited->saturated, "Locallab", "Saturated_" + index_str, spot.saturated, keyFile); saveToKeyfile(!pedited || spot_edited->pastels, "Locallab", "Pastels_" + index_str, spot.pastels, keyFile); saveToKeyfile(!pedited || spot_edited->warm, "Locallab", "Warm_" + index_str, spot.warm, keyFile); @@ -5259,6 +5285,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Soft Light if ((!pedited || spot_edited->visisoft) && spot.visisoft) { saveToKeyfile(!pedited || spot_edited->expsoft, "Locallab", "Expsoft_" + index_str, spot.expsoft, keyFile); + saveToKeyfile(!pedited || spot_edited->complexsoft, "Locallab", "Complexsoft_" + index_str, spot.complexsoft, keyFile); saveToKeyfile(!pedited || spot_edited->streng, "Locallab", "Streng_" + index_str, spot.streng, keyFile); saveToKeyfile(!pedited || spot_edited->sensisf, "Locallab", "Sensisf_" + index_str, spot.sensisf, keyFile); saveToKeyfile(!pedited || spot_edited->laplace, "Locallab", "Laplace_" + index_str, spot.laplace, keyFile); @@ -5267,6 +5294,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Blur & Noise if ((!pedited || spot_edited->visiblur) && spot.visiblur) { saveToKeyfile(!pedited || spot_edited->expblur, "Locallab", "Expblur_" + index_str, spot.expblur, keyFile); + saveToKeyfile(!pedited || spot_edited->complexblur, "Locallab", "Complexblur_" + index_str, spot.complexblur, keyFile); saveToKeyfile(!pedited || spot_edited->radius, "Locallab", "Radius_" + index_str, spot.radius, keyFile); saveToKeyfile(!pedited || spot_edited->strength, "Locallab", "Strength_" + index_str, spot.strength, keyFile); saveToKeyfile(!pedited || spot_edited->sensibn, "Locallab", "Sensibn_" + index_str, spot.sensibn, keyFile); @@ -5317,6 +5345,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Tone Mapping if ((!pedited || spot_edited->visitonemap) && spot.visitonemap) { saveToKeyfile(!pedited || spot_edited->exptonemap, "Locallab", "Exptonemap_" + index_str, spot.exptonemap, keyFile); + saveToKeyfile(!pedited || spot_edited->complextonemap, "Locallab", "Complextonemap_" + index_str, spot.complextonemap, keyFile); saveToKeyfile(!pedited || spot_edited->stren, "Locallab", "Stren_" + index_str, spot.stren, keyFile); saveToKeyfile(!pedited || spot_edited->gamma, "Locallab", "Gamma_" + index_str, spot.gamma, keyFile); saveToKeyfile(!pedited || spot_edited->estop, "Locallab", "Estop_" + index_str, spot.estop, keyFile); @@ -5343,6 +5372,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Retinex if ((!pedited || spot_edited->visireti) && spot.visireti) { saveToKeyfile(!pedited || spot_edited->expreti, "Locallab", "Expreti_" + index_str, spot.expreti, keyFile); + saveToKeyfile(!pedited || spot_edited->complexreti, "Locallab", "Complexreti_" + index_str, spot.complexreti, keyFile); saveToKeyfile(!pedited || spot_edited->retinexMethod, "Locallab", "retinexMethod_" + index_str, spot.retinexMethod, keyFile); saveToKeyfile(!pedited || spot_edited->str, "Locallab", "Str_" + index_str, spot.str, keyFile); saveToKeyfile(!pedited || spot_edited->chrrt, "Locallab", "Chrrt_" + index_str, spot.chrrt, keyFile); @@ -5381,6 +5411,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Sharpening if ((!pedited || spot_edited->visisharp) && spot.visisharp) { saveToKeyfile(!pedited || spot_edited->expsharp, "Locallab", "Expsharp_" + index_str, spot.expsharp, keyFile); + saveToKeyfile(!pedited || spot_edited->complexsharp, "Locallab", "Complexsharp_" + index_str, spot.complexsharp, keyFile); saveToKeyfile(!pedited || spot_edited->sharcontrast, "Locallab", "Sharcontrast_" + index_str, spot.sharcontrast, keyFile); saveToKeyfile(!pedited || spot_edited->sharradius, "Locallab", "Sharradius_" + index_str, spot.sharradius, keyFile); saveToKeyfile(!pedited || spot_edited->sharamount, "Locallab", "Sharamount_" + index_str, spot.sharamount, keyFile); @@ -5393,6 +5424,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Local Contrast if ((!pedited || spot_edited->visicontrast) && spot.visicontrast) { saveToKeyfile(!pedited || spot_edited->expcontrast, "Locallab", "Expcontrast_" + index_str, spot.expcontrast, keyFile); + saveToKeyfile(!pedited || spot_edited->complexcontrast, "Locallab", "Complexcontrast_" + index_str, spot.complexcontrast, keyFile); saveToKeyfile(!pedited || spot_edited->lcradius, "Locallab", "Lcradius_" + index_str, spot.lcradius, keyFile); saveToKeyfile(!pedited || spot_edited->lcamount, "Locallab", "Lcamount_" + index_str, spot.lcamount, keyFile); saveToKeyfile(!pedited || spot_edited->lcdarkness, "Locallab", "Lcdarkness_" + index_str, spot.lcdarkness, keyFile); @@ -5464,6 +5496,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Contrast by detail levels if ((!pedited || spot_edited->visicbdl) && spot.visicbdl) { saveToKeyfile(!pedited || spot_edited->expcbdl, "Locallab", "Expcbdl_" + index_str, spot.expcbdl, keyFile); + saveToKeyfile(!pedited || spot_edited->complexcbdl, "Locallab", "Complexcbdl_" + index_str, spot.complexcbdl, keyFile); for (int j = 0; j < 6; j++) { saveToKeyfile(!pedited || spot_edited->mult[j], "Locallab", "Mult" + std::to_string(j) + "_" + index_str, spot.mult[j], keyFile); @@ -6685,6 +6718,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visicolor = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexcolor_" + index_str, pedited, spot.complexcolor, spotEdited.complexcolor); assignFromKeyfile(keyFile, "Locallab", "Curvactiv_" + index_str, pedited, spot.curvactiv, spotEdited.curvactiv); assignFromKeyfile(keyFile, "Locallab", "Lightness_" + index_str, pedited, spot.lightness, spotEdited.lightness); assignFromKeyfile(keyFile, "Locallab", "Contrast_" + index_str, pedited, spot.contrast, spotEdited.contrast); @@ -6761,6 +6795,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visiexpose = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexexpose_" + index_str, pedited, spot.complexexpose, spotEdited.complexexpose); assignFromKeyfile(keyFile, "Locallab", "Expcomp_" + index_str, pedited, spot.expcomp, spotEdited.expcomp); assignFromKeyfile(keyFile, "Locallab", "Hlcompr_" + index_str, pedited, spot.hlcompr, spotEdited.hlcompr); assignFromKeyfile(keyFile, "Locallab", "Hlcomprthresh_" + index_str, pedited, spot.hlcomprthresh, spotEdited.hlcomprthresh); @@ -6807,6 +6842,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visishadhigh = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexshadhigh_" + index_str, pedited, spot.complexshadhigh, spotEdited.complexshadhigh); assignFromKeyfile(keyFile, "Locallab", "ShMethod_" + index_str, pedited, spot.shMethod, spotEdited.shMethod); for (int j = 0; j < 5; j ++) { @@ -6847,6 +6883,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visivibrance = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexvibrance_" + index_str, pedited, spot.complexvibrance, spotEdited.complexvibrance); assignFromKeyfile(keyFile, "Locallab", "Saturated_" + index_str, pedited, spot.saturated, spotEdited.saturated); assignFromKeyfile(keyFile, "Locallab", "Pastels_" + index_str, pedited, spot.pastels, spotEdited.pastels); assignFromKeyfile(keyFile, "Locallab", "Warm_" + index_str, pedited, spot.warm, spotEdited.warm); @@ -6888,6 +6925,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visisoft = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexsoft_" + index_str, pedited, spot.complexsoft, spotEdited.complexsoft); assignFromKeyfile(keyFile, "Locallab", "Streng_" + index_str, pedited, spot.streng, spotEdited.streng); assignFromKeyfile(keyFile, "Locallab", "Sensisf_" + index_str, pedited, spot.sensisf, spotEdited.sensisf); assignFromKeyfile(keyFile, "Locallab", "Laplace_" + index_str, pedited, spot.laplace, spotEdited.laplace); @@ -6899,6 +6937,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visiblur = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexblur_" + index_str, pedited, spot.complexblur, spotEdited.complexblur); assignFromKeyfile(keyFile, "Locallab", "Radius_" + index_str, pedited, spot.radius, spotEdited.radius); assignFromKeyfile(keyFile, "Locallab", "Strength_" + index_str, pedited, spot.strength, spotEdited.strength); assignFromKeyfile(keyFile, "Locallab", "Sensibn_" + index_str, pedited, spot.sensibn, spotEdited.sensibn); @@ -6961,6 +7000,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visitonemap = true; } + assignFromKeyfile(keyFile, "Locallab", "Complextonemap_" + index_str, pedited, spot.complextonemap, spotEdited.complextonemap); assignFromKeyfile(keyFile, "Locallab", "Stren_" + index_str, pedited, spot.stren, spotEdited.stren); assignFromKeyfile(keyFile, "Locallab", "Gamma_" + index_str, pedited, spot.gamma, spotEdited.gamma); assignFromKeyfile(keyFile, "Locallab", "Estop_" + index_str, pedited, spot.estop, spotEdited.estop); @@ -6990,6 +7030,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visireti = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexreti_" + index_str, pedited, spot.complexreti, spotEdited.complexreti); assignFromKeyfile(keyFile, "Locallab", "retinexMethod_" + index_str, pedited, spot.retinexMethod, spotEdited.retinexMethod); assignFromKeyfile(keyFile, "Locallab", "Str_" + index_str, pedited, spot.str, spotEdited.str); assignFromKeyfile(keyFile, "Locallab", "Chrrt_" + index_str, pedited, spot.chrrt, spotEdited.chrrt); @@ -7031,6 +7072,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visisharp = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexsharp_" + index_str, pedited, spot.complexsharp, spotEdited.complexsharp); assignFromKeyfile(keyFile, "Locallab", "Sharcontrast_" + index_str, pedited, spot.sharcontrast, spotEdited.sharcontrast); assignFromKeyfile(keyFile, "Locallab", "Sharradius_" + index_str, pedited, spot.sharradius, spotEdited.sharradius); assignFromKeyfile(keyFile, "Locallab", "Sharamount_" + index_str, pedited, spot.sharamount, spotEdited.sharamount); @@ -7046,6 +7088,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visicontrast = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexcontrast_" + index_str, pedited, spot.complexcontrast, spotEdited.complexcontrast); assignFromKeyfile(keyFile, "Locallab", "Lcradius_" + index_str, pedited, spot.lcradius, spotEdited.lcradius); assignFromKeyfile(keyFile, "Locallab", "Lcamount_" + index_str, pedited, spot.lcamount, spotEdited.lcamount); assignFromKeyfile(keyFile, "Locallab", "Lcdarkness_" + index_str, pedited, spot.lcdarkness, spotEdited.lcdarkness); @@ -7131,6 +7174,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.visicbdl = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexcbdl_" + index_str, pedited, spot.complexcbdl, spotEdited.complexcbdl); + for (int j = 0; j < 6; j ++) { assignFromKeyfile(keyFile, "Locallab", "Mult" + std::to_string(j) + "_" + index_str, pedited, spot.mult[j], spotEdited.mult[j]); } diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 2ec4b7f904..a1320ee5a4 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -995,6 +995,7 @@ struct LocallabParams { // Color & Light bool visicolor; bool expcolor; + int complexcolor; bool curvactiv; int lightness; int contrast; @@ -1057,6 +1058,7 @@ struct LocallabParams { // Exposure bool visiexpose; bool expexpose; + int complexexpose; double expcomp; int hlcompr; int hlcomprthresh; @@ -1099,6 +1101,7 @@ struct LocallabParams { // Shadow highlight bool visishadhigh; bool expshadhigh; + int complexshadhigh; Glib::ustring shMethod; // std, tone int multsh[5]; int highlights; @@ -1130,6 +1133,7 @@ struct LocallabParams { // Vibrance bool visivibrance; bool expvibrance; + int complexvibrance; int saturated; int pastels; int warm; @@ -1157,6 +1161,7 @@ struct LocallabParams { // Soft Light bool visisoft; bool expsoft; + int complexsoft; int streng; int sensisf; double laplace; @@ -1164,6 +1169,7 @@ struct LocallabParams { // Blur & Noise bool visiblur; bool expblur; + int complexblur; double radius; int strength; int sensibn; @@ -1213,6 +1219,7 @@ struct LocallabParams { // Tone Mapping bool visitonemap; bool exptonemap; + int complextonemap; double stren; double gamma; double estop; @@ -1238,6 +1245,7 @@ struct LocallabParams { // Retinex bool visireti; bool expreti; + int complexreti; Glib::ustring retinexMethod; // low, uni, high double str; double chrrt; @@ -1275,6 +1283,7 @@ struct LocallabParams { // Sharpening bool visisharp; bool expsharp; + int complexsharp; int sharcontrast; double sharradius; int sharamount; @@ -1286,6 +1295,7 @@ struct LocallabParams { // Local Contrast bool visicontrast; bool expcontrast; + int complexcontrast; int lcradius; double lcamount; double lcdarkness; @@ -1356,6 +1366,7 @@ struct LocallabParams { // Contrast by detail levels bool visicbdl; bool expcbdl; + int complexcbdl; double mult[6]; double chromacbdl; double threshold; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 3fd6cebc9c..c8654568db 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -938,14 +938,16 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabwaveshow LUMINANCECURVE, // EvLocallabSpotwavMethod LUMINANCECURVE, // EvlocallabchroMethod - LUMINANCECURVE, // Evlocallabstrbl + LUMINANCECURVE, // Evlocallabstrbl LUMINANCECURVE, // Evlocallabsigmadr LUMINANCECURVE, // Evlocallabsigmabl LUMINANCECURVE, // Evlocallabsigmaed LUMINANCECURVE, // Evlocallabresidsha LUMINANCECURVE, // Evlocallabresidshathr LUMINANCECURVE, // Evlocallabresidhi - LUMINANCECURVE // Evlocallabresidhithr + LUMINANCECURVE, // Evlocallabresidhithr + LUMINANCECURVE, // EvlocallabcomplexityWithRefresh + M_VOID // EvlocallabcomplexityWithoutRefresh }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 2893877593..7ee4b22685 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -119,12 +119,16 @@ static double blurRadius2Slider(double radius) } /* ==== LocallabTool ==== */ -LocallabTool::LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustring UILabel, bool need11): +LocallabTool::LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustring UILabel, bool need11, bool needMode): ToolPanel(toolName, need11), // LocallabTool parameters + needMode(needMode), isLocActivated(false), - locToolListener(nullptr) + locToolListener(nullptr), + + // LocallabTool generic widgets + complexity(Gtk::manage(new MyComboBoxText())) { const bool showtooltip = options.showtooltip; @@ -143,6 +147,18 @@ LocallabTool::LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustr removeEvBox->add(*removeImage); titleBox->pack_end(*removeEvBox, Gtk::PACK_SHRINK, 4); + if (needMode) { + complexity->append(M("TP_LOCALLAB_MODE_EXPERT")); + complexity->append(M("TP_LOCALLAB_MODE_NORMAL")); + complexity->set_active(0); + complexity->setPreferredWidth(100, -1); + complexityConn = complexity->signal_changed().connect(sigc::mem_fun(*this, &LocallabTool::complexityModeChanged)); + titleBox->pack_end(*complexity, Gtk::PACK_SHRINK, 2); + } + + Gtk::VSeparator* const separator = Gtk::manage(new Gtk::VSeparator()); + titleBox->pack_end(*separator, Gtk::PACK_SHRINK, 0); + if (need100Percent) { RTImage* titleImage = Gtk::manage(new RTImage("one-to-one-small.png")); @@ -290,12 +306,20 @@ void LocallabTool::disableListener() ToolPanel::disableListener(); enaExpConn.block(true); + + if (needMode) { + complexityConn.block(true); + } } void LocallabTool::enableListener() { ToolPanel::enableListener(); enaExpConn.block(false); + + if (needMode) { + complexityConn.block(false); + } } bool LocallabTool::on_remove_change(GdkEventButton* event) @@ -317,6 +341,32 @@ void LocallabTool::foldThemAll(GdkEventButton* event) } } +void LocallabTool::complexityModeChanged() +{ + if (complexity->get_active_row_number() == Normal) { // New selected mode is Normal one + // Convert tool widget parameters + convertParamToNormal(); + + // Update GUI based on new mode + updateGUIToMode(Normal); + + // Raise event with refreshing + if (listener) { + listener->panelChanged(EvlocallabcomplexityWithRefresh, + M("TP_LOCALLAB_MODE_NORMAL") + " (" + escapeHtmlChars(spotName) + ")"); + } + } else { // New selected mode is Expert one + // Update GUI based on new mode + updateGUIToMode(Expert); + + // Raise event without refreshing + if (listener) { + listener->panelChanged(EvlocallabcomplexityWithoutRefresh, + M("TP_LOCALLAB_MODE_EXPERT") + " (" + escapeHtmlChars(spotName) + ")"); + } + } +} + /* ==== LocallabColor ==== */ LocallabColor::LocallabColor(): LocallabTool(this, M("TP_LOCALLAB_COLOR_TOOLNAME"), M("TP_LOCALLAB_COFR"), false), @@ -375,8 +425,10 @@ LocallabColor::LocallabColor(): CCmaskshape(static_cast(maskCurveEditorG->addCurve(CT_Flat, "C(C)", nullptr, false, false))), LLmaskshape(static_cast(maskCurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false))), HHmaskshape(static_cast(maskCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true))), + struFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABSTRUM")))), strumaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUMASKCOL"), 0., 200., 0.1, 0.))), toolcol(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_TOOLCOL")))), + 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))), @@ -408,7 +460,6 @@ LocallabColor::LocallabColor(): const LocallabParams::LocallabSpot defSpot; const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; // Parameter Color & Light specific widgets curvactivConn = curvactiv->signal_toggled().connect(sigc::mem_fun(*this, &LocallabColor::curvactivChanged)); @@ -701,10 +752,14 @@ LocallabColor::LocallabColor(): maskCurveEditorG->curveListComplete(); + struFrame->set_label_align(0.025, 0.5); + strumaskcol->setAdjusterListener(this); toolcolConn = toolcol->signal_toggled().connect(sigc::mem_fun(*this, &LocallabColor::toolcolChanged)); + blurFrame->set_label_align(0.025, 0.5); + fftColorMaskConn = fftColorMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabColor::fftColorMaskChanged)); contcol->setAdjusterListener(this); @@ -794,24 +849,13 @@ LocallabColor::LocallabColor(): pack_start(*superFrame); pack_start(*sensi); pack_start(*structcol); - - if (complexsoft < 2) { - pack_start(*blurcolde); - pack_start(*softradiuscol); - } - + pack_start(*blurcolde); + pack_start(*softradiuscol); pack_start(*invers); ToolParamBlock* const gradcolBox = Gtk::manage(new ToolParamBlock()); gradcolBox->pack_start(*strcol); - - if (complexsoft < 2) { - gradcolBox->pack_start(*strcolab); - } - - if (complexsoft < 2) { - gradcolBox->pack_start(*strcolh); - } - + gradcolBox->pack_start(*strcolab); + gradcolBox->pack_start(*strcolh); gradcolBox->pack_start(*angcol); expgradcol->add(*gradcolBox, false); pack_start(*expgradcol, false, false); @@ -821,15 +865,11 @@ LocallabColor::LocallabColor(): qualcurvbox->pack_start(*qualitycurveMethod); curvBox->pack_start(*qualcurvbox); curvBox->pack_start(*llCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - - if (complexsoft < 2) { - curvBox->pack_start(*clCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - curvBox->pack_start(*HCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - curvBox->pack_start(*H2CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - curvBox->pack_start(*rgbCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - curvBox->pack_start(*special); - } - + curvBox->pack_start(*clCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + curvBox->pack_start(*HCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + curvBox->pack_start(*H2CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + curvBox->pack_start(*rgbCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + curvBox->pack_start(*special); expcurvcol->add(*curvBox, false); pack_start(*expcurvcol, false, false); ToolParamBlock* const mask7Box = Gtk::manage(new ToolParamBlock()); @@ -849,19 +889,11 @@ LocallabColor::LocallabColor(): gridmerBox->pack_start(*merlucol); gridmerFrame->add(*gridmerBox); mergecolBox->pack_start(*gridmerFrame); - - if (complexsoft < 2) { - merge1colFrame->add(*mergecolBox); - } - + merge1colFrame->add(*mergecolBox); mask7->pack_start(*merge1colFrame); mask7Box->pack_start(*mask7); expmaskcol1->add(*mask7Box, false); - - if (complexsoft < 2) { - pack_start(*expmaskcol1, false, false); - } - + pack_start(*expmaskcol1, false, false); Gtk::Frame* const mergecolFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_MERGECOLFRA"))); mergecolFrame->set_label_align(0.025, 0.5); ToolParamBlock* const maskcolBox = Gtk::manage(new ToolParamBlock()); @@ -869,63 +901,31 @@ LocallabColor::LocallabColor(): maskcolBox->pack_start(*showmaskcolMethodinv, Gtk::PACK_SHRINK, 4); maskcolBox->pack_start(*enaColorMask, Gtk::PACK_SHRINK, 0); maskcolBox->pack_start(*maskCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - Gtk::Frame* const struFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABSTRUM"))); - struFrame->set_label_align(0.025, 0.5); ToolParamBlock* const strumBox = Gtk::manage(new ToolParamBlock()); - - if (complexsoft < 2) { - strumBox->pack_start(*strumaskcol); - strumBox->pack_start(*toolcol); - } - + strumBox->pack_start(*strumaskcol); + strumBox->pack_start(*toolcol); struFrame->add(*strumBox); - - if (complexsoft < 2) { - maskcolBox->pack_start(*struFrame, Gtk::PACK_SHRINK, 0); - } - - Gtk::Frame* const blurFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABBLURM"))); - blurFrame->set_label_align(0.025, 0.5); + maskcolBox->pack_start(*struFrame, Gtk::PACK_SHRINK, 0); ToolParamBlock* const blurmBox = Gtk::manage(new ToolParamBlock()); - - if (complexsoft < 2) { - blurmBox->pack_start(*fftColorMask, Gtk::PACK_SHRINK, 0); - blurmBox->pack_start(*contcol); - blurmBox->pack_start(*blurcol); - } - + blurmBox->pack_start(*fftColorMask, Gtk::PACK_SHRINK, 0); + blurmBox->pack_start(*contcol); + blurmBox->pack_start(*blurcol); blurFrame->add(*blurmBox); - - if (complexsoft < 2) { - maskcolBox->pack_start(*blurFrame, Gtk::PACK_SHRINK, 0); - } - + maskcolBox->pack_start(*blurFrame, Gtk::PACK_SHRINK, 0); maskcolBox->pack_start(*blendmaskcol, Gtk::PACK_SHRINK, 0); Gtk::Frame* const toolcolFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_TOOLMASK"))); toolcolFrame->set_label_align(0.025, 0.5); ToolParamBlock* const toolcolBox = Gtk::manage(new ToolParamBlock()); toolcolBox->pack_start(*radmaskcol, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 1) { - toolcolBox->pack_start(*lapmaskcol, Gtk::PACK_SHRINK, 0); - } - + toolcolBox->pack_start(*lapmaskcol, Gtk::PACK_SHRINK, 0); toolcolBox->pack_start(*chromaskcol, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 2) { - toolcolBox->pack_start(*gammaskcol, Gtk::PACK_SHRINK, 0); - toolcolBox->pack_start(*slomaskcol, Gtk::PACK_SHRINK, 0); - toolcolBox->pack_start(*shadmaskcol, Gtk::PACK_SHRINK, 0); - toolcolBox->pack_start(*maskHCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - } - + toolcolBox->pack_start(*gammaskcol, Gtk::PACK_SHRINK, 0); + toolcolBox->pack_start(*slomaskcol, Gtk::PACK_SHRINK, 0); + toolcolBox->pack_start(*shadmaskcol, Gtk::PACK_SHRINK, 0); + toolcolBox->pack_start(*maskHCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor toolcolBox->pack_start(*mask2CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - - if (complexsoft < 1) { - toolcolBox->pack_start(*mask2CurveEditorGwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - toolcolBox->pack_start(*csThresholdcol, Gtk::PACK_SHRINK, 0); - } - + toolcolBox->pack_start(*mask2CurveEditorGwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + toolcolBox->pack_start(*csThresholdcol, Gtk::PACK_SHRINK, 0); toolcolFrame->add(*toolcolBox); maskcolBox->pack_start(*toolcolFrame); mergecolFrame->add(*maskcolBox); @@ -1020,8 +1020,6 @@ void LocallabColor::enableListener() void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -1033,6 +1031,7 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param exp->set_visible(pp->locallab.spots.at(index).visicolor); exp->setEnabled(pp->locallab.spots.at(index).expcolor); + complexity->set_active(pp->locallab.spots.at(index).complexcolor); curvactiv->set_active(pp->locallab.spots.at(index).curvactiv); lightness->setValue(pp->locallab.spots.at(index).lightness); @@ -1053,26 +1052,12 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param strengthgrid->setValue(pp->locallab.spots.at(index).strengthgrid); sensi->setValue(pp->locallab.spots.at(index).sensi); structcol->setValue(pp->locallab.spots.at(index).structcol); - - if (complexsoft < 2) { - blurcolde->setValue(pp->locallab.spots.at(index).blurcolde); - softradiuscol->setValue(pp->locallab.spots.at(index).softradiuscol); - } else { - blurcolde->setValue(5.); - softradiuscol->setValue(0.); - } - + blurcolde->setValue(pp->locallab.spots.at(index).blurcolde); + softradiuscol->setValue(pp->locallab.spots.at(index).softradiuscol); invers->set_active(pp->locallab.spots.at(index).invers); strcol->setValue(pp->locallab.spots.at(index).strcol); - - if (complexsoft < 2) { - strcolab->setValue(pp->locallab.spots.at(index).strcolab); - strcolh->setValue(pp->locallab.spots.at(index).strcolh); - } else { - strcolab->setValue(0.); - strcolh->setValue(0.); - } - + strcolab->setValue(pp->locallab.spots.at(index).strcolab); + strcolh->setValue(pp->locallab.spots.at(index).strcolh); angcol->setValue(pp->locallab.spots.at(index).angcol); if (pp->locallab.spots.at(index).qualitycurveMethod == "none") { @@ -1083,18 +1068,10 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param llshape->setCurve(pp->locallab.spots.at(index).llcurve); ccshape->setCurve(pp->locallab.spots.at(index).cccurve); - - if (complexsoft < 2) { - clshape->setCurve(pp->locallab.spots.at(index).clcurve); - lcshape->setCurve(pp->locallab.spots.at(index).lccurve); - LHshape->setCurve(pp->locallab.spots.at(index).LHcurve); - HHshape->setCurve(pp->locallab.spots.at(index).HHcurve); - } else { - clshape->reset(); - lcshape->reset(); - LHshape->reset(); - HHshape->reset(); - } + clshape->setCurve(pp->locallab.spots.at(index).clcurve); + lcshape->setCurve(pp->locallab.spots.at(index).lccurve); + LHshape->setCurve(pp->locallab.spots.at(index).LHcurve); + HHshape->setCurve(pp->locallab.spots.at(index).HHcurve); if (pp->locallab.spots.at(index).toneMethod == "one") { toneMethod->set_active(0); @@ -1106,25 +1083,19 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param toneMethod->set_active(3); } - if (complexsoft < 2) { - rgbshape->setCurve(pp->locallab.spots.at(index).rgbcurve); - special->set_active(pp->locallab.spots.at(index).special); - - if (pp->locallab.spots.at(index).merMethod == "mone") { - merMethod->set_active(0); - } else if (pp->locallab.spots.at(index).merMethod == "mtwo") { - merMethod->set_active(1); - } else if (pp->locallab.spots.at(index).merMethod == "mthr") { - merMethod->set_active(2); - } else if (pp->locallab.spots.at(index).merMethod == "mfou") { - merMethod->set_active(3); - } else if (pp->locallab.spots.at(index).merMethod == "mfiv") { - merMethod->set_active(4); - } - } else { - rgbshape->reset(); - special->set_active(false); + rgbshape->setCurve(pp->locallab.spots.at(index).rgbcurve); + special->set_active(pp->locallab.spots.at(index).special); + + if (pp->locallab.spots.at(index).merMethod == "mone") { merMethod->set_active(0); + } else if (pp->locallab.spots.at(index).merMethod == "mtwo") { + merMethod->set_active(1); + } else if (pp->locallab.spots.at(index).merMethod == "mthr") { + merMethod->set_active(2); + } else if (pp->locallab.spots.at(index).merMethod == "mfou") { + merMethod->set_active(3); + } else if (pp->locallab.spots.at(index).merMethod == "mfiv") { + merMethod->set_active(4); } if (pp->locallab.spots.at(index).mergecolMethod == "one") { @@ -1183,59 +1154,30 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param CCmaskshape->setCurve(pp->locallab.spots.at(index).CCmaskcurve); LLmaskshape->setCurve(pp->locallab.spots.at(index).LLmaskcurve); HHmaskshape->setCurve(pp->locallab.spots.at(index).HHmaskcurve); - - if (complexsoft < 2) { - strumaskcol->setValue(pp->locallab.spots.at(index).strumaskcol); - toolcol->set_active(pp->locallab.spots.at(index).toolcol); - fftColorMask->set_active(pp->locallab.spots.at(index).fftColorMask); - contcol->setValue(pp->locallab.spots.at(index).contcol); - blurcol->setValue(pp->locallab.spots.at(index).blurcol); - } else { - strumaskcol->setValue(0.); - toolcol->set_active(false); - fftColorMask->set_active(false); - contcol->setValue(0.); - blurcol->setLimits(0.2, 100., 0.5, 0.2); - blurcol->setValue(pp->locallab.spots.at(index).blurcol); - } - + strumaskcol->setValue(pp->locallab.spots.at(index).strumaskcol); + toolcol->set_active(pp->locallab.spots.at(index).toolcol); + fftColorMask->set_active(pp->locallab.spots.at(index).fftColorMask); + contcol->setValue(pp->locallab.spots.at(index).contcol); + blurcol->setValue(pp->locallab.spots.at(index).blurcol); blendmaskcol->setValue(pp->locallab.spots.at(index).blendmaskcol); radmaskcol->setValue(pp->locallab.spots.at(index).radmaskcol); - - if (complexsoft < 2) { - lapmaskcol->setValue(pp->locallab.spots.at(index).lapmaskcol); - } else { - lapmaskcol->setValue(0.); - } - + lapmaskcol->setValue(pp->locallab.spots.at(index).lapmaskcol); chromaskcol->setValue(pp->locallab.spots.at(index).chromaskcol); - - if (complexsoft < 2) { - gammaskcol->setValue(pp->locallab.spots.at(index).gammaskcol); - slomaskcol->setValue(pp->locallab.spots.at(index).slomaskcol); - shadmaskcol->setValue(pp->locallab.spots.at(index).shadmaskcol); - HHhmaskshape->setCurve(pp->locallab.spots.at(index).HHhmaskcurve); - } else { - gammaskcol->setValue(1.); - slomaskcol->setValue(0.); - shadmaskcol->setValue(0.); - HHhmaskshape->reset(); - } - + gammaskcol->setValue(pp->locallab.spots.at(index).gammaskcol); + slomaskcol->setValue(pp->locallab.spots.at(index).slomaskcol); + shadmaskcol->setValue(pp->locallab.spots.at(index).shadmaskcol); + HHhmaskshape->setCurve(pp->locallab.spots.at(index).HHhmaskcurve); Lmaskshape->setCurve(pp->locallab.spots.at(index).Lmaskcurve); - - if (complexsoft == 0) { - LLmaskcolshapewav->setCurve(pp->locallab.spots.at(index).LLmaskcolcurvewav); - } else { - LLmaskcolshapewav->reset(); - } - + LLmaskcolshapewav->setCurve(pp->locallab.spots.at(index).LLmaskcolcurvewav); csThresholdcol->setValue(pp->locallab.spots.at(index).csthresholdcol); } // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Update GUI according to invers button state updateColorGUI1(); @@ -1255,6 +1197,7 @@ void LocallabColor::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).expcolor = exp->getEnabled(); pp->locallab.spots.at(index).visicolor = exp->get_visible(); + pp->locallab.spots.at(index).complexcolor = complexity->get_active_row_number(); pp->locallab.spots.at(index).curvactiv = curvactiv->get_active(); pp->locallab.spots.at(index).lightness = lightness->getIntValue(); @@ -1763,6 +1706,181 @@ void LocallabColor::enabledChanged() } } +void LocallabColor::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + blurcolde->setValue((double)defSpot.blurcolde); + softradiuscol->setValue(defSpot.softradiuscol); + strcolab->setValue(defSpot.strcolab); + strcolh->setValue(defSpot.strcolh); + clshape->setCurve(defSpot.clcurve); + lcshape->setCurve(defSpot.lccurve); + LHshape->setCurve(defSpot.LHcurve); + HHshape->setCurve(defSpot.HHcurve); + + if (defSpot.toneMethod == "one") { + toneMethod->set_active(0); + } else if (defSpot.toneMethod == "two") { + toneMethod->set_active(1); + } else if (defSpot.toneMethod == "thr") { + toneMethod->set_active(2); + } else if (defSpot.toneMethod == "fou") { + toneMethod->set_active(3); + } + + rgbshape->setCurve(defSpot.rgbcurve); + special->set_active(defSpot.special); + + if (defSpot.merMethod == "mone") { + merMethod->set_active(0); + } else if (defSpot.merMethod == "mtwo") { + merMethod->set_active(1); + } else if (defSpot.merMethod == "mthr") { + merMethod->set_active(2); + } else if (defSpot.merMethod == "mfou") { + merMethod->set_active(3); + } else if (defSpot.merMethod == "mfiv") { + merMethod->set_active(4); + } + + if (defSpot.mergecolMethod == "one") { + mergecolMethod->set_active(0); + } else if (defSpot.mergecolMethod == "two") { + mergecolMethod->set_active(1); + } else if (defSpot.mergecolMethod == "thr") { + mergecolMethod->set_active(2); + } else if (defSpot.mergecolMethod == "fou") { + mergecolMethod->set_active(3); + } else if (defSpot.mergecolMethod == "fiv") { + mergecolMethod->set_active(4); + } else if (defSpot.mergecolMethod == "six") { + mergecolMethod->set_active(5); + } else if (defSpot.mergecolMethod == "sev") { + mergecolMethod->set_active(6); + } else if (defSpot.mergecolMethod == "sev0") { + mergecolMethod->set_active(7); + } else if (defSpot.mergecolMethod == "sev1") { + mergecolMethod->set_active(8); + } else if (defSpot.mergecolMethod == "sev2") { + mergecolMethod->set_active(9); + } else if (defSpot.mergecolMethod == "hei") { + mergecolMethod->set_active(10); + } else if (defSpot.mergecolMethod == "nin") { + mergecolMethod->set_active(11); + } else if (defSpot.mergecolMethod == "ten") { + mergecolMethod->set_active(12); + } else if (defSpot.mergecolMethod == "ele") { + mergecolMethod->set_active(13); + } else if (defSpot.mergecolMethod == "twe") { + mergecolMethod->set_active(14); + } else if (defSpot.mergecolMethod == "thi") { + mergecolMethod->set_active(15); + } else if (defSpot.mergecolMethod == "for") { + mergecolMethod->set_active(16); + } else if (defSpot.mergecolMethod == "hue") { + mergecolMethod->set_active(17); + } else if (defSpot.mergecolMethod == "sat") { + mergecolMethod->set_active(18); + } else if (defSpot.mergecolMethod == "col") { + mergecolMethod->set_active(19); + } else if (defSpot.mergecolMethod == "lum") { + mergecolMethod->set_active(20); + } + + mercol->setValue(defSpot.mercol); + opacol->setValue(defSpot.opacol); + conthrcol->setValue(defSpot.conthrcol); + labgridmerg->setParams(0, 0, + defSpot.labgridAHighmerg / LocallabParams::LABGRIDL_CORR_MAX, + defSpot.labgridBHighmerg / LocallabParams::LABGRIDL_CORR_MAX, + false); + merlucol->setValue(defSpot.merlucol); + strumaskcol->setValue(defSpot.strumaskcol); + toolcol->set_active(defSpot.toolcol); + fftColorMask->set_active(defSpot.fftColorMask); + contcol->setValue(defSpot.contcol); + lapmaskcol->setValue(defSpot.lapmaskcol); + gammaskcol->setValue(defSpot.gammaskcol); + slomaskcol->setValue(defSpot.slomaskcol); + shadmaskcol->setValue((double)defSpot.shadmaskcol); + HHhmaskshape->setCurve(defSpot.HHhmaskcurve); + LLmaskcolshapewav->setCurve(defSpot.LLmaskcolcurvewav); + csThresholdcol->setValue(defSpot.csthresholdcol); + + // Enable all listeners + enableListener(); + + // Update GUI based on converted widget parameters: + // - Update GUI according to merMethod combobox state + updateColorGUI2(); + // - Update GUI according to fftColorMash button state + updateColorGUI3(); +} + +void LocallabColor::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + blurcolde->hide(); + softradiuscol->hide(); + strcolab->hide(); + strcolh->hide(); + clCurveEditorG->hide(); + HCurveEditorG->hide(); + H2CurveEditorG->hide(); + rgbCurveEditorG->hide(); + special->hide(); + expmaskcol1->hide(); + struFrame->hide(); + blurFrame->hide(); + lapmaskcol->hide(); + gammaskcol->hide(); + slomaskcol->hide(); + shadmaskcol->hide(); + maskHCurveEditorG->hide(); + mask2CurveEditorGwav->hide(); + csThresholdcol->hide(); + } else { + // Advanced widgets are shown in Expert mode + blurcolde->show(); + + if (!invers->get_active()) { // Keep widget hidden when invers is toggled + softradiuscol->show(); + } + + strcolab->show(); + strcolh->show(); + + if (!invers->get_active()) { // Keep widgets hidden when invers is toggled + clCurveEditorG->show(); + HCurveEditorG->show(); + } + + H2CurveEditorG->show(); + rgbCurveEditorG->show(); + special->show(); + + if (!invers->get_active()) { // Keep widget hidden when invers is toggled + expmaskcol1->show(); + } + + struFrame->show(); + blurFrame->show(); + lapmaskcol->show(); + gammaskcol->show(); + slomaskcol->show(); + shadmaskcol->show(); + maskHCurveEditorG->show(); + mask2CurveEditorGwav->show(); + csThresholdcol->show(); + } +} + void LocallabColor::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) { idle_register.add( @@ -1967,6 +2085,8 @@ void LocallabColor::fftColorMaskChanged() void LocallabColor::updateColorGUI1() { + const int mode = complexity->get_active_row_number(); + if (invers->get_active()) { gridFrame->hide(); structcol->hide(); @@ -1988,13 +2108,21 @@ void LocallabColor::updateColorGUI1() } else { gridFrame->show(); structcol->show(); - softradiuscol->show(); + + if (mode == Normal) { // Keep widget hidden in Normal mode + softradiuscol->show(); + } + expgradcol->show(); labqualcurv->show(); qualitycurveMethod->show(); - clCurveEditorG->show(); - HCurveEditorG->show(); - expmaskcol1->show(); + + if (mode == Normal) { // Keep widgets hidden in Normal mode + clCurveEditorG->show(); + HCurveEditorG->show(); + expmaskcol1->show(); + } + showmaskcolMethod->show(); showmaskcolMethodinv->hide(); // Reset hidden mask combobox @@ -2031,7 +2159,6 @@ void LocallabColor::updateColorGUI2() break; case 2: - sensi->set_sensitive(false); invers->set_sensitive(false); H2CurveEditorG->set_sensitive(true); rgbCurveEditorG->set_sensitive(false); @@ -2135,7 +2262,6 @@ LocallabExposure::LocallabExposure(): const LocallabParams::LocallabSpot defSpot; const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; // Parameter Exposure specific widgets if (showtooltip) { @@ -2410,27 +2536,15 @@ LocallabExposure::LocallabExposure(): maskexpBox->pack_start(*maskexpCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor maskexpBox->pack_start(*blendmaskexp, Gtk::PACK_SHRINK, 0); maskexpBox->pack_start(*radmaskexp, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 1) { - maskexpBox->pack_start(*lapmaskexp, Gtk::PACK_SHRINK, 0); - } - + maskexpBox->pack_start(*lapmaskexp, Gtk::PACK_SHRINK, 0); maskexpBox->pack_start(*chromaskexp, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 2) { - maskexpBox->pack_start(*gammaskexp, Gtk::PACK_SHRINK, 0); - maskexpBox->pack_start(*slomaskexp, Gtk::PACK_SHRINK, 0); - } - + maskexpBox->pack_start(*gammaskexp, Gtk::PACK_SHRINK, 0); + maskexpBox->pack_start(*slomaskexp, Gtk::PACK_SHRINK, 0); ToolParamBlock* const gradmaskBox = Gtk::manage(new ToolParamBlock()); gradmaskBox->pack_start(*strmaskexp); gradmaskBox->pack_start(*angmaskexp); gradFramemask->add(*gradmaskBox); - - if (complexsoft < 2) { - maskexpBox->pack_start(*gradFramemask); - } - + maskexpBox->pack_start(*gradFramemask); maskexpBox->pack_start(*mask2expCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor expmaskexp->add(*maskexpBox, false); pack_start(*expmaskexp, false, false); @@ -2496,8 +2610,6 @@ void LocallabExposure::enableListener() void LocallabExposure::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -2509,6 +2621,7 @@ void LocallabExposure::read(const rtengine::procparams::ProcParams* pp, const Pa exp->set_visible(pp->locallab.spots.at(index).visiexpose); exp->setEnabled(pp->locallab.spots.at(index).expexpose); + complexity->set_active(pp->locallab.spots.at(index).complexexpose); if (pp->locallab.spots.at(index).expMethod == "std") { expMethod->set_active(0); @@ -2555,33 +2668,21 @@ void LocallabExposure::read(const rtengine::procparams::ProcParams* pp, const Pa HHmaskexpshape->setCurve(pp->locallab.spots.at(index).HHmaskexpcurve); blendmaskexp->setValue(pp->locallab.spots.at(index).blendmaskexp); radmaskexp->setValue(pp->locallab.spots.at(index).radmaskexp); - - if (complexsoft == 0) { - lapmaskexp->setValue(pp->locallab.spots.at(index).lapmaskexp); - } else { - lapmaskexp->setValue(0.); - } - + lapmaskexp->setValue(pp->locallab.spots.at(index).lapmaskexp); chromaskexp->setValue(pp->locallab.spots.at(index).chromaskexp); - - if (complexsoft < 2) { - gammaskexp->setValue(pp->locallab.spots.at(index).gammaskexp); - slomaskexp->setValue(pp->locallab.spots.at(index).slomaskexp); - strmaskexp->setValue(pp->locallab.spots.at(index).strmaskexp); - angmaskexp->setValue(pp->locallab.spots.at(index).angmaskexp); - } else { - gammaskexp->setValue(1.); - slomaskexp->setValue(0.); - strmaskexp->setValue(0.); - angmaskexp->setValue(0.); - } - + gammaskexp->setValue(pp->locallab.spots.at(index).gammaskexp); + slomaskexp->setValue(pp->locallab.spots.at(index).slomaskexp); + strmaskexp->setValue(pp->locallab.spots.at(index).strmaskexp); + angmaskexp->setValue(pp->locallab.spots.at(index).angmaskexp); Lmaskexpshape->setCurve(pp->locallab.spots.at(index).Lmaskexpcurve); } // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Update shcompr sensitivity according to black and shadex value updateExposureGUI1(); @@ -2601,6 +2702,7 @@ void LocallabExposure::write(rtengine::procparams::ProcParams* pp, ParamsEdited* if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).expexpose = exp->getEnabled(); pp->locallab.spots.at(index).visiexpose = exp->get_visible(); + pp->locallab.spots.at(index).complexexpose = complexity->get_active_row_number(); if (expMethod->get_active_row_number() == 0) { pp->locallab.spots.at(index).expMethod = "std"; @@ -2969,6 +3071,40 @@ void LocallabExposure::enabledChanged() } } +void LocallabExposure::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + lapmaskexp->setValue(defSpot.lapmaskexp); + gammaskexp->setValue(defSpot.gammaskexp); + slomaskexp->setValue(defSpot.slomaskexp); + strmaskexp->setValue(defSpot.strmaskexp); + angmaskexp->setValue(defSpot.angmaskexp); + + // Enable all listeners + enableListener(); +} + +void LocallabExposure::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + lapmaskexp->hide(); + gammaskexp->hide(); + slomaskexp->hide(); + gradFramemask->hide(); + } else { + // Advanced widgets are shown in Expert mode + lapmaskexp->show(); + gammaskexp->show(); + slomaskexp->show(); + gradFramemask->show(); + } +} void LocallabExposure::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) { @@ -3224,7 +3360,6 @@ LocallabShadow::LocallabShadow(): const LocallabParams::LocallabSpot defSpot; const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; // Parameter Shadow highlight specific widgets if (showtooltip) { @@ -3383,9 +3518,7 @@ LocallabShadow::LocallabShadow(): fatanchorSH->setAdjusterListener(this); // Add Shadow highlight specific widgets to GUI - if (complexsoft < 2) { - pack_start(*shMethod); - } + pack_start(*shMethod); for (int i = 0; i < 5; ++i) { pack_start(*multipliersh[i]); @@ -3398,11 +3531,7 @@ LocallabShadow::LocallabShadow(): pack_start(*s_tonalwidth); pack_start(*sh_radius); pack_start(*sensihs); - - if (complexsoft < 2) { - pack_start(*blurSHde); - } - + pack_start(*blurSHde); ToolParamBlock* const gammBox = Gtk::manage(new ToolParamBlock()); gammBox->pack_start(*gamSH); gammBox->pack_start(*sloSH); @@ -3421,28 +3550,16 @@ LocallabShadow::LocallabShadow(): maskSHBox->pack_start(*maskSHCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor maskSHBox->pack_start(*blendmaskSH, Gtk::PACK_SHRINK, 0); maskSHBox->pack_start(*radmaskSH, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 1) { - maskSHBox->pack_start(*lapmaskSH, Gtk::PACK_SHRINK, 0); - } - + maskSHBox->pack_start(*lapmaskSH, Gtk::PACK_SHRINK, 0); maskSHBox->pack_start(*chromaskSH, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 2) { - maskSHBox->pack_start(*gammaskSH, Gtk::PACK_SHRINK, 0); - maskSHBox->pack_start(*slomaskSH, Gtk::PACK_SHRINK, 0); - } - + maskSHBox->pack_start(*gammaskSH, Gtk::PACK_SHRINK, 0); + maskSHBox->pack_start(*slomaskSH, Gtk::PACK_SHRINK, 0); maskSHBox->pack_start(*mask2SHCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor ToolParamBlock* const fatSHBox = Gtk::manage(new ToolParamBlock()); fatSHBox->pack_start(*fatamountSH); fatSHBox->pack_start(*fatanchorSH); fatSHFrame->add(*fatSHBox); - - if (complexsoft < 1) { - maskSHBox->pack_start(*fatSHFrame); - } - + maskSHBox->pack_start(*fatSHFrame); expmasksh->add(*maskSHBox, false); pack_start(*expmasksh, false, false); } @@ -3501,8 +3618,6 @@ void LocallabShadow::enableListener() void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -3514,14 +3629,11 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para exp->set_visible(pp->locallab.spots.at(index).visishadhigh); exp->setEnabled(pp->locallab.spots.at(index).expshadhigh); + complexity->set_active(pp->locallab.spots.at(index).complexshadhigh); - if (complexsoft < 2) { - if (pp->locallab.spots.at(index).shMethod == "std") { - shMethod->set_active(0); - } else if (pp->locallab.spots.at(index).shMethod == "tone") { - shMethod->set_active(1); - } - } else { + if (pp->locallab.spots.at(index).shMethod == "std") { + shMethod->set_active(0); + } else if (pp->locallab.spots.at(index).shMethod == "tone") { shMethod->set_active(1); } @@ -3530,21 +3642,9 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para } detailSH->setValue((double)pp->locallab.spots.at(index).detailSH); - - if (complexsoft < 2) { - highlights->setValue((double)pp->locallab.spots.at(index).highlights); - } else { - highlights->setValue(0.); - } - + highlights->setValue((double)pp->locallab.spots.at(index).highlights); h_tonalwidth->setValue((double)pp->locallab.spots.at(index).h_tonalwidth); - - if (complexsoft < 2) { - shadows->setValue(pp->locallab.spots.at(index).shadows); - } else { - shadows->setValue(0.); - } - + shadows->setValue(pp->locallab.spots.at(index).shadows); s_tonalwidth->setValue((double)pp->locallab.spots.at(index).s_tonalwidth); sh_radius->setValue((double)pp->locallab.spots.at(index).sh_radius); sensihs->setValue((double)pp->locallab.spots.at(index).sensihs); @@ -3560,23 +3660,10 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para HHmaskSHshape->setCurve(pp->locallab.spots.at(index).HHmaskSHcurve); blendmaskSH->setValue((double)pp->locallab.spots.at(index).blendmaskSH); radmaskSH->setValue(pp->locallab.spots.at(index).radmaskSH); - - if (complexsoft == 0) { - lapmaskSH->setValue(pp->locallab.spots.at(index).lapmaskSH); - } else { - lapmaskSH->setValue(0.); - } - + lapmaskSH->setValue(pp->locallab.spots.at(index).lapmaskSH); chromaskSH->setValue(pp->locallab.spots.at(index).chromaskSH); - - if (complexsoft < 2) { - gammaskSH->setValue(pp->locallab.spots.at(index).gammaskSH); - slomaskSH->setValue(pp->locallab.spots.at(index).slomaskSH); - } else { - gammaskSH->setValue(1.); - slomaskSH->setValue(0.); - } - + gammaskSH->setValue(pp->locallab.spots.at(index).gammaskSH); + slomaskSH->setValue(pp->locallab.spots.at(index).slomaskSH); LmaskSHshape->setCurve(pp->locallab.spots.at(index).LmaskSHcurve); fatamountSH->setValue(pp->locallab.spots.at(index).fatamountSH); fatanchorSH->setValue(pp->locallab.spots.at(index).fatanchorSH); @@ -3585,6 +3672,9 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Update shadow highlight GUI according to inverssh button state updateShadowGUI1(); @@ -3601,6 +3691,7 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).expshadhigh = exp->getEnabled(); pp->locallab.spots.at(index).visishadhigh = exp->get_visible(); + pp->locallab.spots.at(index).complexshadhigh = complexity->get_active_row_number(); if (shMethod->get_active_row_number() == 0) { pp->locallab.spots.at(index).shMethod = "std"; @@ -3886,6 +3977,56 @@ void LocallabShadow::enabledChanged() } } +void LocallabShadow::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + if (defSpot.shMethod == "std") { + shMethod->set_active(0); + } else if (defSpot.shMethod == "tone") { + shMethod->set_active(1); + } + + blurSHde->setValue((double)defSpot.blurSHde); + lapmaskSH->setValue(defSpot.lapmaskSH); + gammaskSH->setValue(defSpot.gammaskSH); + slomaskSH->setValue(defSpot.slomaskSH); + fatamountSH->setValue(defSpot.fatamountSH); + fatanchorSH->setValue(defSpot.fatanchorSH); + + // Enable all listeners + enableListener(); + + // Update GUI based on converted widget parameters: + // - Update shadow highlight GUI according to shMethod combobox state + updateShadowGUI2(); +} + +void LocallabShadow::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + shMethod->hide(); + blurSHde->hide(); + lapmaskSH->hide(); + gammaskSH->hide(); + slomaskSH->hide(); + fatSHFrame->hide(); + } else { + // Advanced widgets are shown in Expert mode + shMethod->show(); + blurSHde->show(); + lapmaskSH->show(); + gammaskSH->show(); + slomaskSH->show(); + fatSHFrame->show(); + } +} + void LocallabShadow::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) { idle_register.add( @@ -4079,15 +4220,10 @@ LocallabVibrance::LocallabVibrance(): const LocallabParams::LocallabSpot defSpot; const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; // Parameter Vibrance specific widgets saturated->setAdjusterListener(this); - if (complexsoft == 2) { - pastels->setLabel(M("TP_LOCALLAB_PASTELS2")); - } - pastels->setAdjusterListener(this); if (showtooltip) { @@ -4238,34 +4374,19 @@ LocallabVibrance::LocallabVibrance(): mask2vibCurveEditorG->curveListComplete(); // Add Vibrance specific widgets to GUI - if (complexsoft < 2) { - pack_start(*saturated, Gtk::PACK_SHRINK, 0); - } - + pack_start(*saturated, Gtk::PACK_SHRINK, 0); pack_start(*pastels, Gtk::PACK_SHRINK, 0); pack_start(*warm, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 2) { - pack_start(*psThreshold, Gtk::PACK_SHRINK, 0); - pack_start(*protectSkins, Gtk::PACK_SHRINK, 0); - pack_start(*avoidColorShift, Gtk::PACK_SHRINK, 0); - pack_start(*pastSatTog, Gtk::PACK_SHRINK, 0); - } - + pack_start(*psThreshold, Gtk::PACK_SHRINK, 0); + pack_start(*protectSkins, Gtk::PACK_SHRINK, 0); + pack_start(*avoidColorShift, Gtk::PACK_SHRINK, 0); + pack_start(*pastSatTog, Gtk::PACK_SHRINK, 0); pack_start(*sensiv, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 2) { - pack_start(*curveEditorGG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - } - + pack_start(*curveEditorGG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor ToolParamBlock* const gradvibBox = Gtk::manage(new ToolParamBlock()); gradvibBox->pack_start(*strvib); - - if (complexsoft < 2) { - gradvibBox->pack_start(*strvibab); - gradvibBox->pack_start(*strvibh); - } - + gradvibBox->pack_start(*strvibab); + gradvibBox->pack_start(*strvibh); gradvibBox->pack_start(*angvib); expgradvib->add(*gradvibBox, false); pack_start(*expgradvib); @@ -4275,18 +4396,10 @@ LocallabVibrance::LocallabVibrance(): maskvibBox->pack_start(*maskvibCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor maskvibBox->pack_start(*blendmaskvib, Gtk::PACK_SHRINK, 0); maskvibBox->pack_start(*radmaskvib, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 1) { - maskvibBox->pack_start(*lapmaskvib, Gtk::PACK_SHRINK, 0); - } - + maskvibBox->pack_start(*lapmaskvib, Gtk::PACK_SHRINK, 0); maskvibBox->pack_start(*chromaskvib, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 2) { - maskvibBox->pack_start(*gammaskvib, Gtk::PACK_SHRINK, 0); - maskvibBox->pack_start(*slomaskvib, Gtk::PACK_SHRINK, 0); - } - + maskvibBox->pack_start(*gammaskvib, Gtk::PACK_SHRINK, 0); + maskvibBox->pack_start(*slomaskvib, Gtk::PACK_SHRINK, 0); maskvibBox->pack_start(*mask2vibCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor expmaskvib->add(*maskvibBox, false); pack_start(*expmaskvib, false, false); @@ -4343,8 +4456,6 @@ void LocallabVibrance::enableListener() void LocallabVibrance::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -4356,6 +4467,7 @@ void LocallabVibrance::read(const rtengine::procparams::ProcParams* pp, const Pa exp->set_visible(pp->locallab.spots.at(index).visivibrance); exp->setEnabled(pp->locallab.spots.at(index).expvibrance); + complexity->set_active(pp->locallab.spots.at(index).complexvibrance); saturated->setValue(pp->locallab.spots.at(index).saturated); pastels->setValue(pp->locallab.spots.at(index).pastels); @@ -4365,23 +4477,10 @@ void LocallabVibrance::read(const rtengine::procparams::ProcParams* pp, const Pa avoidColorShift->set_active(pp->locallab.spots.at(index).avoidcolorshift); pastSatTog->set_active(pp->locallab.spots.at(index).pastsattog); sensiv->setValue(pp->locallab.spots.at(index).sensiv); - - if (complexsoft < 2) { - skinTonesCurve->setCurve(pp->locallab.spots.at(index).skintonescurve); - } else { - skinTonesCurve->reset(); - } - + skinTonesCurve->setCurve(pp->locallab.spots.at(index).skintonescurve); strvib->setValue(pp->locallab.spots.at(index).strvib); - - if (complexsoft == 0) { - strvibab->setValue(pp->locallab.spots.at(index).strvibab); - strvibh->setValue(pp->locallab.spots.at(index).strvibh); - } else { - strvibab->setValue(0.); - strvibh->setValue(0.); - } - + strvibab->setValue(pp->locallab.spots.at(index).strvibab); + strvibh->setValue(pp->locallab.spots.at(index).strvibh); angvib->setValue(pp->locallab.spots.at(index).angvib); enavibMask->set_active(pp->locallab.spots.at(index).enavibMask); CCmaskvibshape->setCurve(pp->locallab.spots.at(index).CCmaskvibcurve); @@ -4389,29 +4488,19 @@ void LocallabVibrance::read(const rtengine::procparams::ProcParams* pp, const Pa HHmaskvibshape->setCurve(pp->locallab.spots.at(index).HHmaskvibcurve); blendmaskvib->setValue(pp->locallab.spots.at(index).blendmaskvib); radmaskvib->setValue(pp->locallab.spots.at(index).radmaskvib); - - if (complexsoft == 0) { - lapmaskvib->setValue(pp->locallab.spots.at(index).lapmaskvib); - } else { - lapmaskvib->setValue(0.); - } - + lapmaskvib->setValue(pp->locallab.spots.at(index).lapmaskvib); chromaskvib->setValue(pp->locallab.spots.at(index).chromaskvib); - - if (complexsoft < 2) { - gammaskvib->setValue(pp->locallab.spots.at(index).gammaskvib); - slomaskvib->setValue(pp->locallab.spots.at(index).slomaskvib); - } else { - gammaskvib->setValue(1.); - slomaskvib->setValue(0.); - } - + gammaskvib->setValue(pp->locallab.spots.at(index).gammaskvib); + slomaskvib->setValue(pp->locallab.spots.at(index).slomaskvib); Lmaskvibshape->setCurve(pp->locallab.spots.at(index).Lmaskvibcurve); } // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Update vibrance GUI according to pastsattog button state updateVibranceGUI(); @@ -4425,6 +4514,7 @@ void LocallabVibrance::write(rtengine::procparams::ProcParams* pp, ParamsEdited* if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).expvibrance = exp->getEnabled(); pp->locallab.spots.at(index).visivibrance = exp->get_visible(); + pp->locallab.spots.at(index).complexvibrance = complexity->get_active_row_number(); pp->locallab.spots.at(index).saturated = saturated->getIntValue(); pp->locallab.spots.at(index).pastels = pastels->getIntValue(); @@ -4704,6 +4794,67 @@ void LocallabVibrance::enabledChanged() } } +void LocallabVibrance::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + saturated->setValue((double)defSpot.saturated); + psThreshold->setValue(defSpot.psthreshold); + protectSkins->set_active(defSpot.protectskins); + avoidColorShift->set_active(defSpot.avoidcolorshift); + pastSatTog->set_active(defSpot.pastsattog); + skinTonesCurve->setCurve(defSpot.skintonescurve); + strvibab->setValue(defSpot.strvibab); + strvibh->setValue(defSpot.strvibh); + lapmaskvib->setValue(defSpot.lapmaskvib); + gammaskvib->setValue(defSpot.gammaskvib); + slomaskvib->setValue(defSpot.slomaskvib); + + // Enable all listeners + enableListener(); + + // Update GUI based on converted widget parameters: + // - Update vibrance GUI according to pastsattog button state + updateVibranceGUI(); +} + +void LocallabVibrance::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + saturated->hide(); + pastels->setLabel(M("TP_LOCALLAB_PASTELS2")); + psThreshold->hide(); + protectSkins->hide(); + avoidColorShift->hide(); + pastSatTog->hide(); + curveEditorGG->hide(); + strvibab->hide(); + strvibh->hide(); + lapmaskvib->hide(); + gammaskvib->hide(); + slomaskvib->hide(); + } else { + // Advanced widgets are shown in Expert mode + saturated->show(); + pastels->setLabel(M("TP_VIBRANCE_PASTELS")); + psThreshold->show(); + protectSkins->show(); + avoidColorShift->show(); + pastSatTog->show(); + curveEditorGG->show(); + strvibab->show(); + strvibh->show(); + lapmaskvib->show(); + gammaskvib->show(); + slomaskvib->show(); + } +} + void LocallabVibrance::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) { idle_register.add( @@ -4823,7 +4974,6 @@ LocallabSoft::LocallabSoft(): sensisf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 1, 100, 1, 15))) { const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; // Parameter Soft light specific widgets softMethod->append(M("TP_LOCALLAB_SOFTM")); @@ -4858,10 +5008,7 @@ LocallabSoft::LocallabSoft(): sensisf->setAdjusterListener(this); // Add Soft light specific widgets to GUI - if (complexsoft < 2) { - pack_start(*softMethod); - } - + pack_start(*softMethod); Gtk::Label* const labelsoftmethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_SHOWDCT") + ":")); ctboxsoftmethod->pack_start(*labelsoftmethod, Gtk::PACK_SHRINK, 4); ctboxsoftmethod->pack_start(*showmasksoftMethod); @@ -4901,8 +5048,6 @@ void LocallabSoft::enableListener() void LocallabSoft::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -4914,20 +5059,15 @@ void LocallabSoft::read(const rtengine::procparams::ProcParams* pp, const Params exp->set_visible(pp->locallab.spots.at(index).visisoft); exp->setEnabled(pp->locallab.spots.at(index).expsoft); + complexity->set_active(pp->locallab.spots.at(index).complexsoft); - if (complexsoft < 2) { - if (pp->locallab.spots.at(index).softMethod == "soft") { - softMethod->set_active(0); - } else if (pp->locallab.spots.at(index).softMethod == "reti") { - softMethod->set_active(1); - } - - streng->setValue((double)pp->locallab.spots.at(index).streng); - } else { + if (pp->locallab.spots.at(index).softMethod == "soft") { softMethod->set_active(0); - streng->setValue(1.); + } else if (pp->locallab.spots.at(index).softMethod == "reti") { + softMethod->set_active(1); } + streng->setValue((double)pp->locallab.spots.at(index).streng); sensisf->setValue((double)pp->locallab.spots.at(index).sensisf); laplace->setValue(pp->locallab.spots.at(index).laplace); } @@ -4935,6 +5075,9 @@ void LocallabSoft::read(const rtengine::procparams::ProcParams* pp, const Params // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Update soft light GUI according to softMethod combobox updateSoftGUI(); @@ -4948,6 +5091,7 @@ void LocallabSoft::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).expsoft = exp->getEnabled(); pp->locallab.spots.at(index).visisoft = exp->get_visible(); + pp->locallab.spots.at(index).complexsoft = complexity->get_active_row_number(); if (softMethod->get_active_row_number() == 0) { pp->locallab.spots.at(index).softMethod = "soft"; @@ -5020,6 +5164,39 @@ void LocallabSoft::enabledChanged() } } +void LocallabSoft::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + if (defSpot.softMethod == "soft") { + softMethod->set_active(0); + } else if (defSpot.softMethod == "reti") { + softMethod->set_active(1); + } + + // Enable all listeners + enableListener(); + + // Update GUI based on converted widget parameters: + // - Update soft light GUI according to softMethod combobox + updateSoftGUI(); +} + +void LocallabSoft::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + softMethod->hide(); + } else { + // Advanced widgets are shown in Expert mode + softMethod->show(); + } +} + void LocallabSoft::softMethodChanged() { // Update soft light GUI according to softMethod combobox @@ -5131,7 +5308,6 @@ LocallabBlur::LocallabBlur(): const LocallabParams::LocallabSpot defSpot; const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; // Parameter Blur, Noise & Denoise specific widgets setExpandAlignProperties(expblnoise, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); @@ -5367,11 +5543,7 @@ LocallabBlur::LocallabBlur(): // Add Blur, Noise & Denoise specific widgets to GUI ToolParamBlock* const blnoisebox = Gtk::manage(new ToolParamBlock()); blnoisebox->pack_start(*blMethod); - - if (complexsoft < 2) { - blnoisebox->pack_start(*fftwbl, Gtk::PACK_SHRINK, 0); - } - + blnoisebox->pack_start(*fftwbl, Gtk::PACK_SHRINK, 0); blnoisebox->pack_start(*radius); blnoisebox->pack_start(*strength); ToolParamBlock* const grainBox = Gtk::manage(new ToolParamBlock()); @@ -5416,37 +5588,21 @@ LocallabBlur::LocallabBlur(): maskblBox->pack_start(*showmaskblMethod, Gtk::PACK_SHRINK, 4); maskblBox->pack_start(*enablMask, Gtk::PACK_SHRINK, 0); maskblBox->pack_start(*maskblCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - - if (complexsoft < 2) { - maskblBox->pack_start(*strumaskbl, Gtk::PACK_SHRINK, 0); - maskblBox->pack_start(*toolbl, Gtk::PACK_SHRINK, 0); - } - + maskblBox->pack_start(*strumaskbl, Gtk::PACK_SHRINK, 0); + maskblBox->pack_start(*toolbl, Gtk::PACK_SHRINK, 0); Gtk::HSeparator* const separatorstrubl = Gtk::manage(new Gtk::HSeparator()); maskblBox->pack_start(*separatorstrubl, Gtk::PACK_SHRINK, 2); maskblBox->pack_start(*blendmaskbl, Gtk::PACK_SHRINK, 0); ToolParamBlock* const toolblBox = Gtk::manage(new ToolParamBlock()); toolblBox->pack_start(*radmaskbl, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 1) { - toolblBox->pack_start(*lapmaskbl, Gtk::PACK_SHRINK, 0); - } - + toolblBox->pack_start(*lapmaskbl, Gtk::PACK_SHRINK, 0); toolblBox->pack_start(*chromaskbl, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 2) { - toolblBox->pack_start(*gammaskbl, Gtk::PACK_SHRINK, 0); - toolblBox->pack_start(*slomaskbl, Gtk::PACK_SHRINK, 0); - toolblBox->pack_start(*shadmaskbl, Gtk::PACK_SHRINK, 0); - } - + toolblBox->pack_start(*gammaskbl, Gtk::PACK_SHRINK, 0); + toolblBox->pack_start(*slomaskbl, Gtk::PACK_SHRINK, 0); + toolblBox->pack_start(*shadmaskbl, Gtk::PACK_SHRINK, 0); toolblBox->pack_start(*mask2blCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - - if (complexsoft < 1) { - toolblBox->pack_start(*mask2blCurveEditorGwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - toolblBox->pack_start(*csThresholdblur, Gtk::PACK_SHRINK, 0); - } - + toolblBox->pack_start(*mask2blCurveEditorGwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + toolblBox->pack_start(*csThresholdblur, Gtk::PACK_SHRINK, 0); toolblFrame->add(*toolblBox); maskblBox->pack_start(*toolblFrame); expmaskbl->add(*maskblBox, false); @@ -5512,8 +5668,6 @@ void LocallabBlur::enableListener() void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -5525,6 +5679,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params exp->set_visible(pp->locallab.spots.at(index).visiblur); exp->setEnabled(pp->locallab.spots.at(index).expblur); + complexity->set_active(pp->locallab.spots.at(index).complexblur); if (pp->locallab.spots.at(index).blMethod == "blur") { blMethod->set_active(0); @@ -5534,32 +5689,23 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params blMethod->set_active(2); } - if (complexsoft < 2) { - fftwbl->set_active(pp->locallab.spots.at(index).fftwbl); - } else { - fftwbl->set_active(false); - } - + fftwbl->set_active(pp->locallab.spots.at(index).fftwbl); radius->setValue(pp->locallab.spots.at(index).radius); strength->setValue(pp->locallab.spots.at(index).strength); isogr->setValue((double)pp->locallab.spots.at(index).isogr); strengr->setValue((double)pp->locallab.spots.at(index).strengr); scalegr->setValue((double)pp->locallab.spots.at(index).scalegr); - if (complexsoft < 2) { - if (pp->locallab.spots.at(index).medMethod == "none") { - medMethod->set_active(0); - } else if (pp->locallab.spots.at(index).medMethod == "33") { - medMethod->set_active(1); - } else if (pp->locallab.spots.at(index).medMethod == "55") { - medMethod->set_active(2); - } else if (pp->locallab.spots.at(index).medMethod == "77") { - medMethod->set_active(3); - } else if (pp->locallab.spots.at(index).medMethod == "99") { - medMethod->set_active(4); - } - } else { + if (pp->locallab.spots.at(index).medMethod == "none") { medMethod->set_active(0); + } else if (pp->locallab.spots.at(index).medMethod == "33") { + medMethod->set_active(1); + } else if (pp->locallab.spots.at(index).medMethod == "55") { + medMethod->set_active(2); + } else if (pp->locallab.spots.at(index).medMethod == "77") { + medMethod->set_active(3); + } else if (pp->locallab.spots.at(index).medMethod == "99") { + medMethod->set_active(4); } itera->setValue((double)pp->locallab.spots.at(index).itera); @@ -5601,49 +5747,26 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params CCmaskblshape->setCurve(pp->locallab.spots.at(index).CCmaskblcurve); LLmaskblshape->setCurve(pp->locallab.spots.at(index).LLmaskblcurve); HHmaskblshape->setCurve(pp->locallab.spots.at(index).HHmaskblcurve); - - if (complexsoft < 2) { - strumaskbl->setValue(pp->locallab.spots.at(index).strumaskbl); - } else { - strumaskbl->setValue(0.); - } - + strumaskbl->setValue(pp->locallab.spots.at(index).strumaskbl); toolbl->set_active(pp->locallab.spots.at(index).toolbl); blendmaskbl->setValue((double)pp->locallab.spots.at(index).blendmaskbl); radmaskbl->setValue(pp->locallab.spots.at(index).radmaskbl); - - if (complexsoft == 0) { - lapmaskbl->setValue(pp->locallab.spots.at(index).lapmaskbl); - } else { - lapmaskbl->setValue(0.); - } - + lapmaskbl->setValue(pp->locallab.spots.at(index).lapmaskbl); chromaskbl->setValue(pp->locallab.spots.at(index).chromaskbl); - - if (complexsoft < 2) { - gammaskbl->setValue(pp->locallab.spots.at(index).gammaskbl); - slomaskbl->setValue(pp->locallab.spots.at(index).slomaskbl); - shadmaskbl->setValue((double)pp->locallab.spots.at(index).shadmaskbl); - } else { - gammaskbl->setValue(1.); - slomaskbl->setValue(0.); - shadmaskbl->setValue(0.); - } - + gammaskbl->setValue(pp->locallab.spots.at(index).gammaskbl); + slomaskbl->setValue(pp->locallab.spots.at(index).slomaskbl); + shadmaskbl->setValue((double)pp->locallab.spots.at(index).shadmaskbl); Lmaskblshape->setCurve(pp->locallab.spots.at(index).Lmaskblcurve); - - if (complexsoft == 0) { - LLmaskblshapewav->setCurve(pp->locallab.spots.at(index).LLmaskblcurvewav); - } else { - LLmaskblshapewav->reset(); - } - + LLmaskblshapewav->setCurve(pp->locallab.spots.at(index).LLmaskblcurvewav); csThresholdblur->setValue(pp->locallab.spots.at(index).csthresholdblur); } // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Update Blur & Noise GUI according to blMethod combobox state updateBlurGUI(); @@ -5657,6 +5780,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).expblur = exp->getEnabled(); pp->locallab.spots.at(index).visiblur = exp->get_visible(); + pp->locallab.spots.at(index).complexblur = complexity->get_active_row_number(); if (blMethod->get_active_row_number() == 0) { pp->locallab.spots.at(index).blMethod = "blur"; @@ -6080,6 +6204,58 @@ void LocallabBlur::enabledChanged() } } +void LocallabBlur::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + fftwbl->set_active(defSpot.fftwbl); + strumaskbl->setValue(defSpot.strumaskbl); + toolbl->set_active(defSpot.toolbl); + lapmaskbl->setValue(defSpot.lapmaskbl); + gammaskbl->setValue(defSpot.gammaskbl); + slomaskbl->setValue(defSpot.slomaskbl); + shadmaskbl->setValue((double)defSpot.shadmaskbl); + LLmaskblshapewav->setCurve(defSpot.LLmaskblcurvewav); + csThresholdblur->setValue(defSpot.csthresholdblur); + + // Enable all listeners + enableListener(); +} + +void LocallabBlur::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + fftwbl->hide(); + strumaskbl->hide(); + toolbl->hide(); + lapmaskbl->hide(); + gammaskbl->hide(); + slomaskbl->hide(); + shadmaskbl->hide(); + mask2blCurveEditorGwav->hide(); + csThresholdblur->hide(); + } else { + // Advanced widgets are shown in Expert mode + if (blMethod->get_active_row_number() == 0) { // Keep widget hidden when blMethod is > 0 + fftwbl->show(); + } + + strumaskbl->show(); + toolbl->show(); + lapmaskbl->show(); + gammaskbl->show(); + slomaskbl->show(); + shadmaskbl->show(); + mask2blCurveEditorGwav->show(); + csThresholdblur->show(); + } +} + void LocallabBlur::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) { idle_register.add( diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 9446a38ac2..c9e22f948a 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -49,21 +49,29 @@ class LocallabTool: public AdjusterListener { protected: + // LocallabTool mode enumeration + enum modeType { + Expert = 0, + Normal = 1 + }; + // LocallabTool parameters + bool needMode; bool isLocActivated; Glib::ustring spotName; LocallabToolListener* locToolListener; // LocallabTool generic widgets MyExpander* exp; + MyComboBoxText* const complexity; - sigc::connection enaExpConn; + sigc::connection enaExpConn, complexityConn; IdleRegister idle_register; public: // Locallab tool constructor/destructor - LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustring UILabel, bool need11 = false); + LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustring UILabel, bool need11 = false, bool needMode = true); virtual ~LocallabTool(); // Getter for Locallab tool expander @@ -142,8 +150,13 @@ class LocallabTool: // Tool expander event function void foldThemAll(GdkEventButton* event); + // Complexity mode event function + void complexityModeChanged(); + // To be implemented virtual void enabledChanged() {}; + virtual void convertParamToNormal() {}; // Only necessary when using mode + virtual void updateGUIToMode(const modeType new_type) {}; // Only necessary when using mode }; /* ==== LocallabColor ==== */ @@ -207,8 +220,10 @@ class LocallabColor: FlatCurveEditor* const CCmaskshape; FlatCurveEditor* const LLmaskshape; FlatCurveEditor* const HHmaskshape; + Gtk::Frame* const struFrame; Adjuster* const strumaskcol; Gtk::CheckButton* const toolcol; + Gtk::Frame* const blurFrame; Gtk::CheckButton* const fftColorMask; Adjuster* const contcol; Adjuster* const blurcol; @@ -254,6 +269,8 @@ class LocallabColor: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -355,6 +372,8 @@ class LocallabExposure: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -435,6 +454,8 @@ class LocallabShadow: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -514,6 +535,8 @@ class LocallabVibrance: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -557,6 +580,8 @@ class LocallabSoft: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void softMethodChanged(); void showmasksoftMethodChanged(); @@ -654,6 +679,8 @@ class LocallabBlur: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -724,6 +751,8 @@ class LocallabTone: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -812,6 +841,8 @@ class LocallabRetinex: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -864,6 +895,8 @@ class LocallabSharp: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void inversshaChanged(); void showmasksharMethodChanged(); @@ -993,6 +1026,8 @@ class LocallabContrast: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -1074,6 +1109,8 @@ class LocallabCBDL: private: void enabledChanged() override; + void convertParamToNormal() override; + void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 55c4ec1279..8660eb6309 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -146,7 +146,6 @@ LocallabTone::LocallabTone(): Lmasktmshape(static_cast(mask2tmCurveEditorG->addCurve(CT_Diagonal, "L(L)"))) { const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; const LocallabParams::LocallabSpot defSpot; @@ -280,19 +279,11 @@ LocallabTone::LocallabTone(): // pack_start(*amount); // To use if we change transit_shapedetect parameters pack_start(*stren); pack_start(*equiltm); - - if (complexsoft < 2) { - pack_start(*gamma); - pack_start(*satur); - } - + pack_start(*gamma); + pack_start(*satur); pack_start(*estop); pack_start(*scaltm); - - if (complexsoft < 2) { - pack_start(*rewei); - } - + pack_start(*rewei); // pack_start(*softradiustm); // Always bad with TM ?? pack_start(*sensitm); ToolParamBlock* const masktmBox = Gtk::manage(new ToolParamBlock()); @@ -301,19 +292,11 @@ LocallabTone::LocallabTone(): masktmBox->pack_start(*enatmMaskaft, Gtk::PACK_SHRINK, 0); masktmBox->pack_start(*masktmCurveEditorG, Gtk::PACK_SHRINK, 4); masktmBox->pack_start(*blendmasktm, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 1) { - masktmBox->pack_start(*lapmasktm, Gtk::PACK_SHRINK, 0); - } - + masktmBox->pack_start(*lapmasktm, Gtk::PACK_SHRINK, 0); masktmBox->pack_start(*radmasktm, Gtk::PACK_SHRINK, 0); masktmBox->pack_start(*chromasktm, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 2) { - masktmBox->pack_start(*gammasktm, Gtk::PACK_SHRINK, 0); - masktmBox->pack_start(*slomasktm, Gtk::PACK_SHRINK, 0); - } - + masktmBox->pack_start(*gammasktm, Gtk::PACK_SHRINK, 0); + masktmBox->pack_start(*slomasktm, Gtk::PACK_SHRINK, 0); masktmBox->pack_start(*mask2tmCurveEditorG, Gtk::PACK_SHRINK, 4); expmasktm->add(*masktmBox, false); pack_start(*expmasktm, false, false); @@ -364,8 +347,6 @@ void LocallabTone::enableListener() void LocallabTone::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -377,28 +358,16 @@ void LocallabTone::read(const rtengine::procparams::ProcParams* pp, const Params exp->set_visible(pp->locallab.spots.at(index).visitonemap); exp->setEnabled(pp->locallab.spots.at(index).exptonemap); + complexity->set_active(pp->locallab.spots.at(index).complextonemap); amount->setValue(pp->locallab.spots.at(index).amount); stren->setValue(pp->locallab.spots.at(index).stren); equiltm->set_active(pp->locallab.spots.at(index).equiltm); - - if (complexsoft < 2) { - gamma->setValue(pp->locallab.spots.at(index).gamma); - satur->setValue(pp->locallab.spots.at(index).satur); - } else { - gamma->setValue(1.); - satur->setValue(0.); - } - + gamma->setValue(pp->locallab.spots.at(index).gamma); + satur->setValue(pp->locallab.spots.at(index).satur); estop->setValue(pp->locallab.spots.at(index).estop); scaltm->setValue(pp->locallab.spots.at(index).scaltm); - - if (complexsoft < 2) { - rewei->setValue((double)pp->locallab.spots.at(index).rewei); - } else { - rewei->setValue(0.); - } - + rewei->setValue((double)pp->locallab.spots.at(index).rewei); softradiustm->setValue(pp->locallab.spots.at(index).softradiustm); sensitm->setValue((double)pp->locallab.spots.at(index).sensitm); enatmMask->set_active(pp->locallab.spots.at(index).enatmMask); @@ -407,30 +376,20 @@ void LocallabTone::read(const rtengine::procparams::ProcParams* pp, const Params LLmasktmshape->setCurve(pp->locallab.spots.at(index).LLmasktmcurve); HHmasktmshape->setCurve(pp->locallab.spots.at(index).HHmasktmcurve); blendmasktm->setValue((double)pp->locallab.spots.at(index).blendmasktm); - - if (complexsoft == 0) { - lapmasktm->setValue(pp->locallab.spots.at(index).lapmasktm); - } else { - lapmasktm->setValue(0.); - } - + lapmasktm->setValue(pp->locallab.spots.at(index).lapmasktm); radmasktm->setValue(pp->locallab.spots.at(index).radmasktm); chromasktm->setValue(pp->locallab.spots.at(index).chromasktm); - - if (complexsoft < 2) { - gammasktm->setValue(pp->locallab.spots.at(index).gammasktm); - slomasktm->setValue(pp->locallab.spots.at(index).slomasktm); - } else { - gammasktm->setValue(1.); - slomasktm->setValue(0.); - } - + gammasktm->setValue(pp->locallab.spots.at(index).gammasktm); + slomasktm->setValue(pp->locallab.spots.at(index).slomasktm); Lmasktmshape->setCurve(pp->locallab.spots.at(index).Lmasktmcurve); } // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Note: No need to manage pedited as batch mode is deactivated for Locallab } @@ -441,6 +400,7 @@ void LocallabTone::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).exptonemap = exp->getEnabled(); pp->locallab.spots.at(index).visitonemap = exp->get_visible(); + pp->locallab.spots.at(index).complextonemap = complexity->get_active_row_number(); pp->locallab.spots.at(index).amount = amount->getValue(); pp->locallab.spots.at(index).stren = stren->getValue(); @@ -655,6 +615,46 @@ void LocallabTone::enabledChanged() } } +void LocallabTone::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + gamma->setValue(defSpot.gamma); + satur->setValue(defSpot.satur); + rewei->setValue((double)defSpot.rewei); + lapmasktm->setValue(defSpot.lapmasktm); + gammasktm->setValue(defSpot.gammasktm); + slomasktm->setValue(defSpot.slomasktm); + + // Enable all listeners + enableListener(); +} + +void LocallabTone::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + gamma->hide(); + satur->hide(); + rewei->hide(); + lapmasktm->hide(); + gammasktm->hide(); + slomasktm->hide(); + } else { + // Advanced widgets are shown in Expert mode + gamma->show(); + satur->show(); + rewei->show(); + lapmasktm->show(); + gammasktm->show(); + slomasktm->show(); + } +} + void LocallabTone::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) { idle_register.add( @@ -784,7 +784,6 @@ LocallabRetinex::LocallabRetinex(): inversret(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))) { const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; const LocallabParams::LocallabSpot defSpot; @@ -1011,11 +1010,7 @@ LocallabRetinex::LocallabRetinex(): deharetiBox->pack_start(*str); deharetiBox->pack_start(*loglin); retiFrame->add(*deharetiBox); - - if (complexsoft < 1) { - auxBox->add(*retiFrame); - } - + auxBox->add(*retiFrame); ToolParamBlock* const scopeBox = Gtk::manage(new ToolParamBlock()); scopeBox->pack_start(*sensih); auxBox->add(*scopeBox); @@ -1146,8 +1141,6 @@ void LocallabRetinex::enableListener() void LocallabRetinex::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -1159,17 +1152,12 @@ void LocallabRetinex::read(const rtengine::procparams::ProcParams* pp, const Par exp->set_visible(pp->locallab.spots.at(index).visireti); exp->setEnabled(pp->locallab.spots.at(index).expreti); + complexity->set_active(pp->locallab.spots.at(index).complexreti); dehaz->setValue((double)pp->locallab.spots.at(index).dehaz); depth->setValue((double)pp->locallab.spots.at(index).depth); lumonly->set_active(pp->locallab.spots.at(index).lumonly); - - if (complexsoft < 2) { - str->setValue(pp->locallab.spots.at(index).str); - } else { - str->setValue(0.); - } - + str->setValue(pp->locallab.spots.at(index).str); loglin->set_active(pp->locallab.spots.at(index).loglin); sensih->setValue((double)pp->locallab.spots.at(index).sensih); @@ -1213,6 +1201,9 @@ void LocallabRetinex::read(const rtengine::procparams::ProcParams* pp, const Par // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Update Retinex GUI according to scalereti adjuster value updateRetinexGUI1(); @@ -1232,6 +1223,7 @@ void LocallabRetinex::write(rtengine::procparams::ProcParams* pp, ParamsEdited* if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).expreti = exp->getEnabled(); pp->locallab.spots.at(index).visireti = exp->get_visible(); + pp->locallab.spots.at(index).complexreti = complexity->get_active_row_number(); pp->locallab.spots.at(index).dehaz = dehaz->getIntValue(); pp->locallab.spots.at(index).depth = depth->getIntValue(); @@ -1530,6 +1522,36 @@ void LocallabRetinex::enabledChanged() } } +void LocallabRetinex::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + str->setValue(defSpot.str); + loglin->set_active(defSpot.loglin); + + // Enable all listeners + enableListener(); + + // Update GUI based on converted widget parameters: + // - Update Retinex GUI according to str adjuster value + updateRetinexGUI3(); +} + +void LocallabRetinex::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + retiFrame->hide(); + } else { + // Advanced widgets are shown in Expert mode + retiFrame->show(); + } +} + void LocallabRetinex::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) { idle_register.add( @@ -1728,7 +1750,6 @@ LocallabSharp::LocallabSharp(): showmasksharMethod(Gtk::manage(new MyComboBoxText())) { const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; // Parameter Sharpening specific widgets if (showtooltip) { @@ -1772,13 +1793,9 @@ LocallabSharp::LocallabSharp(): pack_start(*sharcontrast); pack_start(*sharradius); pack_start(*sharamount); - - if (complexsoft < 2) { - pack_start(*shardamping); - pack_start(*shariter); - pack_start(*sharblur); - } - + pack_start(*shardamping); + pack_start(*shariter); + pack_start(*sharblur); pack_start(*sensisha); pack_start(*inverssha); ToolParamBlock* const sharfBox = Gtk::manage(new ToolParamBlock()); @@ -1817,8 +1834,6 @@ void LocallabSharp::enableListener() void LocallabSharp::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -1830,21 +1845,14 @@ void LocallabSharp::read(const rtengine::procparams::ProcParams* pp, const Param exp->set_visible(pp->locallab.spots.at(index).visisharp); exp->setEnabled(pp->locallab.spots.at(index).expsharp); + complexity->set_active(pp->locallab.spots.at(index).complexsharp); sharcontrast->setValue((double)pp->locallab.spots.at(index).sharcontrast); sharradius->setValue(pp->locallab.spots.at(index).sharradius); sharamount->setValue((double)pp->locallab.spots.at(index).sharamount); - - if (complexsoft < 2) { - shardamping->setValue((double)pp->locallab.spots.at(index).shardamping); - shariter->setValue((double)pp->locallab.spots.at(index).shariter); - sharblur->setValue(pp->locallab.spots.at(index).sharblur); - } else { - shardamping->setValue(0.); - shariter->setValue(30.); - sharblur->setValue(0.2); - } - + shardamping->setValue((double)pp->locallab.spots.at(index).shardamping); + shariter->setValue((double)pp->locallab.spots.at(index).shariter); + sharblur->setValue(pp->locallab.spots.at(index).sharblur); sensisha->setValue((double)pp->locallab.spots.at(index).sensisha); inverssha->set_active(pp->locallab.spots.at(index).inverssha); } @@ -1852,6 +1860,9 @@ void LocallabSharp::read(const rtengine::procparams::ProcParams* pp, const Param // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Note: No need to manage pedited as batch mode is deactivated for Locallab } @@ -1862,6 +1873,7 @@ void LocallabSharp::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).expsharp = exp->getEnabled(); pp->locallab.spots.at(index).visisharp = exp->get_visible(); + pp->locallab.spots.at(index).complexsharp = complexity->get_active_row_number(); pp->locallab.spots.at(index).sharcontrast = sharcontrast->getIntValue(); pp->locallab.spots.at(index).sharradius = sharradius->getValue(); @@ -1965,6 +1977,37 @@ void LocallabSharp::enabledChanged() } } +void LocallabSharp::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + shardamping->setValue((double)defSpot.shardamping); + shariter->setValue((double)defSpot.shariter); + sharblur->setValue(defSpot.sharblur); + + // Enable all listeners + enableListener(); +} + +void LocallabSharp::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + shardamping->hide(); + shariter->hide(); + sharblur->hide(); + } else { + // Advanced widgets are shown in Expert mode + shardamping->show(); + shariter->show(); + sharblur->show(); + } +} + void LocallabSharp::inversshaChanged() { if (isLocActivated && exp->getEnabled()) { @@ -2090,7 +2133,6 @@ LocallabContrast::LocallabContrast(): Lmasklcshape(static_cast(mask2lcCurveEditorG->addCurve(CT_Diagonal, "L(L)"))) { const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; const LocallabParams::LocallabSpot defSpot; @@ -2104,10 +2146,6 @@ LocallabContrast::LocallabContrast(): localcontMethod->set_active(0); localcontMethodConn = localcontMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabContrast::localcontMethodChanged)); - if (complexsoft == 2) { - lcradius->setLimits(20, 100, 1, 80); - } - lcradius->setAdjusterListener(this); lcamount->setAdjusterListener(this); @@ -2164,12 +2202,13 @@ LocallabContrast::LocallabContrast(): claricres->setAdjusterListener(this); - clarisoft->setLogScale(10, -10); - clarisoft->setAdjusterListener(this); if (showtooltip) { clarisoft->set_tooltip_markup(M("TP_LOCALLAB_CLARISOFT_TOOLTIP")); } + clarisoft->setLogScale(10, -10); + clarisoft->setAdjusterListener(this); + origlcConn = origlc->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::origlcChanged)); Gtk::HBox* const LCTitleHBox = Gtk::manage(new Gtk::HBox()); @@ -2307,7 +2346,7 @@ LocallabContrast::LocallabContrast(): wavcompConn = wavcomp->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavcompChanged)); if (showtooltip) { - // sigmadc->set_tooltip_text(M("TP_LOCALLAB_COMPFRAME_TOOLTIP")); + // sigmadc->set_tooltip_text(M("TP_LOCALLAB_COMPFRAME_TOOLTIP")); } sigmadc->setAdjusterListener(this); @@ -2404,11 +2443,8 @@ LocallabContrast::LocallabContrast(): mask2lcCurveEditorG->curveListComplete(); // Add Local contrast specific widgets to GUI - if (complexsoft < 2) { - pack_start(*localcontMethod); - } + pack_start(*localcontMethod); shresFrame->set_label_align(0.025, 0.5); - pack_start(*lcradius); pack_start(*lcamount); pack_start(*lcdarkness); @@ -2424,7 +2460,6 @@ LocallabContrast::LocallabContrast(): shresBox->pack_start(*residshathr); shresBox->pack_start(*residhi); shresBox->pack_start(*residhithr); - shresFrame->add(*shresBox); resiBox->pack_start(*shresFrame); expresidpyr->add(*resiBox, false); @@ -2514,18 +2549,14 @@ LocallabContrast::LocallabContrast(): compBox->pack_start(*sigmadc); compBox->pack_start(*deltad); compBox->pack_start(*LocalcurveEditorwavcomp, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor -// Gtk::HSeparator* const separatorcomp = Gtk::manage(new Gtk::HSeparator()); -// compBox->pack_start(*separatorcomp); - //compBox->pack_start(*fatres); + // Gtk::HSeparator* const separatorcomp = Gtk::manage(new Gtk::HSeparator()); + // compBox->pack_start(*separatorcomp); + // compBox->pack_start(*fatres); compFrame->add(*compBox); blurcontBox2->pack_start(*compFrame); expcontrastpyr2->add(*blurcontBox2, false); pack_start(*expcontrastpyr2); - - if (complexsoft < 2) { - pack_start(*fftwlc); - } - + pack_start(*fftwlc); ToolParamBlock* const masklcBox = Gtk::manage(new ToolParamBlock()); masklcBox->pack_start(*showmasklcMethod, Gtk::PACK_SHRINK, 4); masklcBox->pack_start(*enalcMask, Gtk::PACK_SHRINK, 0); @@ -2614,8 +2645,6 @@ void LocallabContrast::enableListener() void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -2627,14 +2656,11 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa exp->set_visible(pp->locallab.spots.at(index).visicontrast); exp->setEnabled(pp->locallab.spots.at(index).expcontrast); + complexity->set_active(pp->locallab.spots.at(index).complexcontrast); - if (complexsoft < 2) { - if (pp->locallab.spots.at(index).localcontMethod == "loc") { - localcontMethod->set_active(0); - } else if (pp->locallab.spots.at(index).localcontMethod == "wav") { - localcontMethod->set_active(1); - } - } else { + if (pp->locallab.spots.at(index).localcontMethod == "loc") { + localcontMethod->set_active(0); + } else if (pp->locallab.spots.at(index).localcontMethod == "wav") { localcontMethod->set_active(1); } @@ -2711,13 +2737,7 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa deltad->setValue(pp->locallab.spots.at(index).deltad); wavshapecomp->setCurve(pp->locallab.spots.at(index).loccompwavcurve); fatres->setValue(pp->locallab.spots.at(index).fatres); - - if (complexsoft < 2) { - fftwlc->set_active(pp->locallab.spots.at(index).fftwlc); - } else { - fftwlc->set_active(false); - } - + fftwlc->set_active(pp->locallab.spots.at(index).fftwlc); enalcMask->set_active(pp->locallab.spots.at(index).enalcMask); CCmasklcshape->setCurve(pp->locallab.spots.at(index).CCmasklccurve); LLmasklcshape->setCurve(pp->locallab.spots.at(index).LLmasklccurve); @@ -2731,6 +2751,9 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Update Local contrast GUI according to localcontMethod combobox value updateContrastGUI1(); @@ -2750,6 +2773,7 @@ void LocallabContrast::write(rtengine::procparams::ProcParams* pp, ParamsEdited* if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).expcontrast = exp->getEnabled(); pp->locallab.spots.at(index).visicontrast = exp->get_visible(); + pp->locallab.spots.at(index).complexcontrast = complexity->get_active_row_number(); if (localcontMethod->get_active_row_number() == 0) { pp->locallab.spots.at(index).localcontMethod = "loc"; @@ -3300,6 +3324,45 @@ void LocallabContrast::enabledChanged() } } +void LocallabContrast::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + if (defSpot.localcontMethod == "loc") { + localcontMethod->set_active(0); + } else if (defSpot.localcontMethod == "wav") { + localcontMethod->set_active(1); + } + + fftwlc->set_active(defSpot.fftwlc); + + // Enable all listeners + enableListener(); + + // Update GUI based on converted widget parameters: + // - Update Local contrast GUI according to localcontMethod combobox value + updateContrastGUI1(); + // - Update Local contrast GUI according to fftwlc button state + updateContrastGUI3(); +} + +void LocallabContrast::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + localcontMethod->hide(); + fftwlc->hide(); + } else { + // Advanced widgets are shown in Expert mode + localcontMethod->show(); + fftwlc->show(); + } +} + void LocallabContrast::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) { idle_register.add( @@ -3707,7 +3770,6 @@ LocallabCBDL::LocallabCBDL(): lumacontrastPlusButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMACONTRAST_PLUS")))) { const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; const LocallabParams::LocallabSpot defSpot; @@ -3851,7 +3913,7 @@ LocallabCBDL::LocallabCBDL(): pack_start(*separator, Gtk::PACK_SHRINK, 2); pack_start(*chromacbdl); pack_start(*threshold); - // pack_start(*blurcbdl); + // pack_start(*blurcbdl); ToolParamBlock* const residBox = Gtk::manage(new ToolParamBlock()); residBox->pack_start(*clarityml); residBox->pack_start(*contresid); @@ -3865,11 +3927,7 @@ LocallabCBDL::LocallabCBDL(): maskcbBox->pack_start(*maskcbCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor maskcbBox->pack_start(*blendmaskcb, Gtk::PACK_SHRINK, 0); maskcbBox->pack_start(*radmaskcb, Gtk::PACK_SHRINK, 0); - - if (complexsoft < 1) { - maskcbBox->pack_start(*lapmaskcb, Gtk::PACK_SHRINK, 0); - } - + maskcbBox->pack_start(*lapmaskcb, Gtk::PACK_SHRINK, 0); maskcbBox->pack_start(*chromaskcb, Gtk::PACK_SHRINK, 0); maskcbBox->pack_start(*gammaskcb, Gtk::PACK_SHRINK, 0); maskcbBox->pack_start(*slomaskcb, Gtk::PACK_SHRINK, 0); @@ -3927,8 +3985,6 @@ void LocallabCBDL::enableListener() void LocallabCBDL::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -3940,6 +3996,7 @@ void LocallabCBDL::read(const rtengine::procparams::ProcParams* pp, const Params exp->set_visible(pp->locallab.spots.at(index).visicbdl); exp->setEnabled(pp->locallab.spots.at(index).expcbdl); + complexity->set_active(pp->locallab.spots.at(index).complexcbdl); for (int i = 0; i < 6; i++) { multiplier[i]->setValue(pp->locallab.spots.at(index).mult[i]); @@ -3958,13 +4015,7 @@ void LocallabCBDL::read(const rtengine::procparams::ProcParams* pp, const Params HHmaskcbshape->setCurve(pp->locallab.spots.at(index).HHmaskcbcurve); blendmaskcb->setValue((double)pp->locallab.spots.at(index).blendmaskcb); radmaskcb->setValue(pp->locallab.spots.at(index).radmaskcb); - - if (complexsoft == 0) { - lapmaskcb->setValue(pp->locallab.spots.at(index).lapmaskcb); - } else { - lapmaskcb->setValue(0.); - } - + lapmaskcb->setValue(pp->locallab.spots.at(index).lapmaskcb); chromaskcb->setValue(pp->locallab.spots.at(index).chromaskcb); gammaskcb->setValue(pp->locallab.spots.at(index).gammaskcb); slomaskcb->setValue(pp->locallab.spots.at(index).slomaskcb); @@ -3974,6 +4025,9 @@ void LocallabCBDL::read(const rtengine::procparams::ProcParams* pp, const Params // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Note: No need to manage pedited as batch mode is deactivated for Locallab } @@ -3984,6 +4038,7 @@ void LocallabCBDL::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped if (index < (int)pp->locallab.spots.size()) { pp->locallab.spots.at(index).expcbdl = exp->getEnabled(); pp->locallab.spots.at(index).visicbdl = exp->get_visible(); + pp->locallab.spots.at(index).complexcbdl = complexity->get_active_row_number(); for (int i = 0; i < 6; i++) { pp->locallab.spots.at(index).mult[i] = multiplier[i]->getValue(); @@ -4200,6 +4255,31 @@ void LocallabCBDL::enabledChanged() } } +void LocallabCBDL::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + lapmaskcb->setValue(defSpot.lapmaskcb); + + // Enable all listeners + enableListener(); +} + +void LocallabCBDL::updateGUIToMode(const modeType new_type) +{ + if (new_type == Normal) { + // Advanced widgets are hidden in Normal mode + lapmaskcb->hide(); + } else { + // Advanced widgets are shown in Expert mode + lapmaskcb->show(); + } +} + void LocallabCBDL::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) { idle_register.add( @@ -4277,7 +4357,7 @@ void LocallabCBDL::lumacontrastPlusPressed() /* ==== LocallabLog ==== */ LocallabLog::LocallabLog(): - LocallabTool(this, M("TP_LOCALLAB_LOG_TOOLNAME"), M("TP_LOCALLAB_LOG"), false), + LocallabTool(this, M("TP_LOCALLAB_LOG_TOOLNAME"), M("TP_LOCALLAB_LOG"), false, false), // Log encoding specific widgets logPFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOGPFRA")))), diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index d9feb91347..a5c8138d36 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1019,6 +1019,7 @@ void ParamsEdited::initFrom(const std::vector& // Color & Light locallab.spots.at(j).visicolor = locallab.spots.at(j).visicolor && pSpot.visicolor == otherSpot.visicolor; locallab.spots.at(j).expcolor = locallab.spots.at(j).expcolor && pSpot.expcolor == otherSpot.expcolor; + locallab.spots.at(j).complexcolor = locallab.spots.at(j).complexcolor && pSpot.complexcolor == otherSpot.complexcolor; locallab.spots.at(j).curvactiv = locallab.spots.at(j).curvactiv && pSpot.curvactiv == otherSpot.curvactiv; locallab.spots.at(j).lightness = locallab.spots.at(j).lightness && pSpot.lightness == otherSpot.lightness; locallab.spots.at(j).contrast = locallab.spots.at(j).contrast && pSpot.contrast == otherSpot.contrast; @@ -1081,6 +1082,7 @@ void ParamsEdited::initFrom(const std::vector& // Exposure locallab.spots.at(j).visiexpose = locallab.spots.at(j).visiexpose && pSpot.visiexpose == otherSpot.visiexpose; locallab.spots.at(j).expexpose = locallab.spots.at(j).expexpose && pSpot.expexpose == otherSpot.expexpose; + locallab.spots.at(j).complexexpose = locallab.spots.at(j).complexexpose && pSpot.complexexpose == otherSpot.complexexpose; locallab.spots.at(j).expcomp = locallab.spots.at(j).expcomp && pSpot.expcomp == otherSpot.expcomp; locallab.spots.at(j).hlcompr = locallab.spots.at(j).hlcompr && pSpot.hlcompr == otherSpot.hlcompr; locallab.spots.at(j).hlcomprthresh = locallab.spots.at(j).hlcomprthresh && pSpot.hlcomprthresh == otherSpot.hlcomprthresh; @@ -1123,6 +1125,7 @@ void ParamsEdited::initFrom(const std::vector& // Shadow highlight locallab.spots.at(j).visishadhigh = locallab.spots.at(j).visishadhigh && pSpot.visishadhigh == otherSpot.visishadhigh; locallab.spots.at(j).expshadhigh = locallab.spots.at(j).expshadhigh && pSpot.expshadhigh == otherSpot.expshadhigh; + locallab.spots.at(j).complexshadhigh = locallab.spots.at(j).complexshadhigh && pSpot.complexshadhigh == otherSpot.complexshadhigh; locallab.spots.at(j).shMethod = locallab.spots.at(j).shMethod && pSpot.shMethod == otherSpot.shMethod; for (int k = 0; k < 5; k++) { @@ -1158,6 +1161,7 @@ void ParamsEdited::initFrom(const std::vector& // Vibrance locallab.spots.at(j).visivibrance = locallab.spots.at(j).visivibrance && pSpot.visivibrance == otherSpot.visivibrance; locallab.spots.at(j).expvibrance = locallab.spots.at(j).expvibrance && pSpot.expvibrance == otherSpot.expvibrance; + locallab.spots.at(j).complexvibrance = locallab.spots.at(j).complexvibrance && pSpot.complexvibrance == otherSpot.complexvibrance; locallab.spots.at(j).saturated = locallab.spots.at(j).saturated && pSpot.saturated == otherSpot.saturated; locallab.spots.at(j).pastels = locallab.spots.at(j).pastels && pSpot.pastels == otherSpot.pastels; locallab.spots.at(j).warm = locallab.spots.at(j).warm && pSpot.warm == otherSpot.warm; @@ -1185,6 +1189,7 @@ void ParamsEdited::initFrom(const std::vector& // Soft Light locallab.spots.at(j).visisoft = locallab.spots.at(j).visisoft && pSpot.visisoft == otherSpot.visisoft; locallab.spots.at(j).expsoft = locallab.spots.at(j).expsoft && pSpot.expsoft == otherSpot.expsoft; + locallab.spots.at(j).complexsoft = locallab.spots.at(j).complexsoft && pSpot.complexsoft == otherSpot.complexsoft; locallab.spots.at(j).streng = locallab.spots.at(j).streng && pSpot.streng == otherSpot.streng; locallab.spots.at(j).sensisf = locallab.spots.at(j).sensisf && pSpot.sensisf == otherSpot.sensisf; locallab.spots.at(j).laplace = locallab.spots.at(j).laplace && pSpot.laplace == otherSpot.laplace; @@ -1192,6 +1197,7 @@ void ParamsEdited::initFrom(const std::vector& // Blur & Noise locallab.spots.at(j).visiblur = locallab.spots.at(j).visiblur && pSpot.visiblur == otherSpot.visiblur; locallab.spots.at(j).expblur = locallab.spots.at(j).expblur && pSpot.expblur == otherSpot.expblur; + locallab.spots.at(j).complexblur = locallab.spots.at(j).complexblur && pSpot.complexblur == otherSpot.complexblur; locallab.spots.at(j).radius = locallab.spots.at(j).radius && pSpot.radius == otherSpot.radius; locallab.spots.at(j).strength = locallab.spots.at(j).strength && pSpot.strength == otherSpot.strength; locallab.spots.at(j).sensibn = locallab.spots.at(j).sensibn && pSpot.sensibn == otherSpot.sensibn; @@ -1241,6 +1247,7 @@ void ParamsEdited::initFrom(const std::vector& // Tone Mapping locallab.spots.at(j).visitonemap = locallab.spots.at(j).visitonemap && pSpot.visitonemap == otherSpot.visitonemap; locallab.spots.at(j).exptonemap = locallab.spots.at(j).exptonemap && pSpot.exptonemap == otherSpot.exptonemap; + locallab.spots.at(j).complextonemap = locallab.spots.at(j).complextonemap && pSpot.complextonemap == otherSpot.complextonemap; locallab.spots.at(j).stren = locallab.spots.at(j).stren && pSpot.stren == otherSpot.stren; locallab.spots.at(j).gamma = locallab.spots.at(j).gamma && pSpot.gamma == otherSpot.gamma; locallab.spots.at(j).estop = locallab.spots.at(j).estop && pSpot.estop == otherSpot.estop; @@ -1266,6 +1273,7 @@ void ParamsEdited::initFrom(const std::vector& // Retinex locallab.spots.at(j).visireti = locallab.spots.at(j).visireti && pSpot.visireti == otherSpot.visireti; locallab.spots.at(j).expreti = locallab.spots.at(j).expreti && pSpot.expreti == otherSpot.expreti; + locallab.spots.at(j).complexreti = locallab.spots.at(j).complexreti && pSpot.complexreti == otherSpot.complexreti; locallab.spots.at(j).retinexMethod = locallab.spots.at(j).retinexMethod && pSpot.retinexMethod == otherSpot.retinexMethod; locallab.spots.at(j).str = locallab.spots.at(j).str && pSpot.str == otherSpot.str; locallab.spots.at(j).chrrt = locallab.spots.at(j).chrrt && pSpot.chrrt == otherSpot.chrrt; @@ -1303,6 +1311,7 @@ void ParamsEdited::initFrom(const std::vector& // Sharpening locallab.spots.at(j).visisharp = locallab.spots.at(j).visisharp && pSpot.visisharp == otherSpot.visisharp; locallab.spots.at(j).expsharp = locallab.spots.at(j).expsharp && pSpot.expsharp == otherSpot.expsharp; + locallab.spots.at(j).complexsharp = locallab.spots.at(j).complexsharp && pSpot.complexsharp == otherSpot.complexsharp; locallab.spots.at(j).sharcontrast = locallab.spots.at(j).sharcontrast && pSpot.sharcontrast == otherSpot.sharcontrast; locallab.spots.at(j).sharradius = locallab.spots.at(j).sharradius && pSpot.sharradius == otherSpot.sharradius; locallab.spots.at(j).sharamount = locallab.spots.at(j).sharamount && pSpot.sharamount == otherSpot.sharamount; @@ -1314,6 +1323,7 @@ void ParamsEdited::initFrom(const std::vector& // Local Contrast locallab.spots.at(j).visicontrast = locallab.spots.at(j).visicontrast && pSpot.visicontrast == otherSpot.visicontrast; locallab.spots.at(j).expcontrast = locallab.spots.at(j).expcontrast && pSpot.expcontrast == otherSpot.expcontrast; + locallab.spots.at(j).complexcontrast = locallab.spots.at(j).complexcontrast && pSpot.complexcontrast == otherSpot.complexcontrast; locallab.spots.at(j).lcradius = locallab.spots.at(j).lcradius && pSpot.lcradius == otherSpot.lcradius; locallab.spots.at(j).lcamount = locallab.spots.at(j).lcamount && pSpot.lcamount == otherSpot.lcamount; locallab.spots.at(j).lcdarkness = locallab.spots.at(j).lcdarkness && pSpot.lcdarkness == otherSpot.lcdarkness; @@ -1384,6 +1394,7 @@ void ParamsEdited::initFrom(const std::vector& // Contrast by detail levels locallab.spots.at(j).visicbdl = locallab.spots.at(j).visicbdl && pSpot.visicbdl == otherSpot.visicbdl; locallab.spots.at(j).expcbdl = locallab.spots.at(j).expcbdl && pSpot.expcbdl == otherSpot.expcbdl; + locallab.spots.at(j).complexcbdl = locallab.spots.at(j).complexcbdl && pSpot.complexcbdl == otherSpot.complexcbdl; for (int k = 0; k < 6; k++) { locallab.spots.at(j).mult[k] = locallab.spots.at(j).mult[k] && pSpot.mult[k] == otherSpot.mult[k]; @@ -3043,6 +3054,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expcolor = mods.locallab.spots.at(i).expcolor; } + if (locallab.spots.at(i).complexcolor) { + toEdit.locallab.spots.at(i).complexcolor = mods.locallab.spots.at(i).complexcolor; + } + if (locallab.spots.at(i).curvactiv) { toEdit.locallab.spots.at(i).curvactiv = mods.locallab.spots.at(i).curvactiv; } @@ -3288,6 +3303,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expexpose = mods.locallab.spots.at(i).expexpose; } + if (locallab.spots.at(i).complexexpose) { + toEdit.locallab.spots.at(i).complexexpose = mods.locallab.spots.at(i).complexexpose; + } + if (locallab.spots.at(i).expcomp) { toEdit.locallab.spots.at(i).expcomp = mods.locallab.spots.at(i).expcomp; } @@ -3453,6 +3472,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expshadhigh = mods.locallab.spots.at(i).expshadhigh; } + if (locallab.spots.at(i).complexshadhigh) { + toEdit.locallab.spots.at(i).complexshadhigh = mods.locallab.spots.at(i).complexshadhigh; + } + if (locallab.spots.at(i).shMethod) { toEdit.locallab.spots.at(i).shMethod = mods.locallab.spots.at(i).shMethod; } @@ -3576,6 +3599,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expvibrance = mods.locallab.spots.at(i).expvibrance; } + if (locallab.spots.at(i).complexvibrance) { + toEdit.locallab.spots.at(i).complexvibrance = mods.locallab.spots.at(i).complexvibrance; + } + if (locallab.spots.at(i).saturated) { toEdit.locallab.spots.at(i).saturated = mods.locallab.spots.at(i).saturated; } @@ -3681,6 +3708,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expsoft = mods.locallab.spots.at(i).expsoft; } + if (locallab.spots.at(i).complexsoft) { + toEdit.locallab.spots.at(i).complexsoft = mods.locallab.spots.at(i).complexsoft; + } + if (locallab.spots.at(i).streng) { toEdit.locallab.spots.at(i).streng = mods.locallab.spots.at(i).streng; } @@ -3706,6 +3737,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expblur = mods.locallab.spots.at(i).expblur; } + if (locallab.spots.at(i).complexblur) { + toEdit.locallab.spots.at(i).complexblur = mods.locallab.spots.at(i).complexblur; + } + if (locallab.spots.at(i).radius) { toEdit.locallab.spots.at(i).radius = mods.locallab.spots.at(i).radius; } @@ -3899,6 +3934,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).exptonemap = mods.locallab.spots.at(i).exptonemap; } + if (locallab.spots.at(i).complextonemap) { + toEdit.locallab.spots.at(i).complextonemap = mods.locallab.spots.at(i).complextonemap; + } + if (locallab.spots.at(i).stren) { toEdit.locallab.spots.at(i).stren = mods.locallab.spots.at(i).stren; } @@ -3996,6 +4035,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expreti = mods.locallab.spots.at(i).expreti; } + if (locallab.spots.at(i).complexreti) { + toEdit.locallab.spots.at(i).complexreti = mods.locallab.spots.at(i).complexreti; + } + if (locallab.spots.at(i).retinexMethod) { toEdit.locallab.spots.at(i).retinexMethod = mods.locallab.spots.at(i).retinexMethod; } @@ -4141,6 +4184,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expsharp = mods.locallab.spots.at(i).expsharp; } + if (locallab.spots.at(i).complexsharp) { + toEdit.locallab.spots.at(i).complexsharp = mods.locallab.spots.at(i).complexsharp; + } + if (locallab.spots.at(i).sharcontrast) { toEdit.locallab.spots.at(i).sharcontrast = mods.locallab.spots.at(i).sharcontrast; } @@ -4182,6 +4229,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expcontrast = mods.locallab.spots.at(i).expcontrast; } + if (locallab.spots.at(i).complexcontrast) { + toEdit.locallab.spots.at(i).complexcontrast = mods.locallab.spots.at(i).complexcontrast; + } + if (locallab.spots.at(i).lcradius) { toEdit.locallab.spots.at(i).lcradius = mods.locallab.spots.at(i).lcradius; } @@ -4460,6 +4511,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expcbdl = mods.locallab.spots.at(i).expcbdl; } + if (locallab.spots.at(i).complexcbdl) { + toEdit.locallab.spots.at(i).complexcbdl = mods.locallab.spots.at(i).complexcbdl; + } + for (int j = 0; j < 6; j++) { if (locallab.spots.at(i).mult[j]) { toEdit.locallab.spots.at(i).mult[j] = mods.locallab.spots.at(i).mult[j]; @@ -5703,6 +5758,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Color & Light visicolor(v), expcolor(v), + complexcolor(v), curvactiv(v), lightness(v), contrast(v), @@ -5765,6 +5821,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Exposure visiexpose(v), expexpose(v), + complexexpose(v), expcomp(v), hlcompr(v), hlcomprthresh(v), @@ -5807,6 +5864,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Shadow highlight visishadhigh(v), expshadhigh(v), + complexshadhigh(v), shMethod(v), multsh{v, v, v, v, v, v}, highlights(v), @@ -5838,6 +5896,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Vibrance visivibrance(v), expvibrance(v), + complexvibrance(v), saturated(v), pastels(v), warm(v), @@ -5865,6 +5924,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Soft Light visisoft(v), expsoft(v), + complexsoft(v), streng(v), sensisf(v), laplace(v), @@ -5872,6 +5932,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Blur & Noise visiblur(v), expblur(v), + complexblur(v), radius(v), strength(v), sensibn(v), @@ -5921,6 +5982,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Tone Mapping visitonemap(v), exptonemap(v), + complextonemap(v), stren(v), gamma(v), estop(v), @@ -5946,6 +6008,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Retinex visireti(v), expreti(v), + complexreti(v), retinexMethod(v), str(v), chrrt(v), @@ -5983,6 +6046,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Sharpening visisharp(v), expsharp(v), + complexsharp(v), sharcontrast(v), sharradius(v), sharamount(v), @@ -5994,6 +6058,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Local Contrast visicontrast(v), expcontrast(v), + complexcontrast(v), lcradius(v), lcamount(v), lcdarkness(v), @@ -6064,6 +6129,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Contrast by detail levels visicbdl(v), expcbdl(v), + complexcbdl(v), mult{v, v, v, v, v, v}, chromacbdl(v), threshold(v), @@ -6138,6 +6204,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Color & Light visicolor = v; expcolor = v; + complexcolor = v; curvactiv = v; lightness = v; contrast = v; @@ -6200,6 +6267,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Exposure visiexpose = v; expexpose = v; + complexexpose = v; expcomp = v; hlcompr = v; hlcomprthresh = v; @@ -6242,6 +6310,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Shadow highlight visishadhigh = v; expshadhigh = v; + complexshadhigh = v; shMethod = v; for (int i = 0; i < 5; i++) { @@ -6277,6 +6346,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Vibrance visivibrance = v; expvibrance = v; + complexvibrance = v; saturated = v; pastels = v; warm = v; @@ -6304,6 +6374,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Soft Light visisoft = v; expsoft = v; + complexsoft = v; streng = v; sensisf = v; laplace = v; @@ -6311,6 +6382,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Blur & Noise visiblur = v; expblur = v; + complexblur = v; radius = v; strength = v; sensibn = v; @@ -6360,6 +6432,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Tone Mapping visitonemap = v; exptonemap = v; + complextonemap = v; stren = v; gamma = v; estop = v; @@ -6385,6 +6458,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Retinex visireti = v; expreti = v; + complexreti = v; retinexMethod = v; str = v; chrrt = v; @@ -6422,6 +6496,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Sharpening visisharp = v; expsharp = v; + complexsharp = v; sharcontrast = v; sharradius = v; sharamount = v; @@ -6433,6 +6508,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Local Contrast visicontrast = v; expcontrast = v; + complexcontrast = v; lcradius = v; lcamount = v; lcdarkness = v; @@ -6503,6 +6579,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Contrast by detail levels visicbdl = v; expcbdl = v; + complexcbdl = v; for (int i = 0; i < 6; i++) { mult[i] = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index d11569ab7d..2149bea024 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -423,6 +423,7 @@ class LocallabParamsEdited // Color & Light bool visicolor; bool expcolor; + bool complexcolor; bool curvactiv; bool lightness; bool contrast; @@ -485,6 +486,7 @@ class LocallabParamsEdited // Exposure bool visiexpose; bool expexpose; + bool complexexpose; bool expcomp; bool hlcompr; bool hlcomprthresh; @@ -527,6 +529,7 @@ class LocallabParamsEdited // Shadow highlight bool visishadhigh; bool expshadhigh; + bool complexshadhigh; bool shMethod; bool multsh[6]; bool highlights; @@ -558,6 +561,7 @@ class LocallabParamsEdited // Vibrance bool visivibrance; bool expvibrance; + bool complexvibrance; bool saturated; bool pastels; bool warm; @@ -585,6 +589,7 @@ class LocallabParamsEdited // Soft Light bool visisoft; bool expsoft; + bool complexsoft; bool streng; bool sensisf; bool laplace; @@ -592,6 +597,7 @@ class LocallabParamsEdited // Blur & Noise bool visiblur; bool expblur; + bool complexblur; bool radius; bool strength; bool sensibn; @@ -641,6 +647,7 @@ class LocallabParamsEdited // Tone Mapping bool visitonemap; bool exptonemap; + bool complextonemap; bool stren; bool gamma; bool estop; @@ -666,6 +673,7 @@ class LocallabParamsEdited // Retinex bool visireti; bool expreti; + bool complexreti; bool retinexMethod; bool str; bool chrrt; @@ -703,6 +711,7 @@ class LocallabParamsEdited // Sharpening bool visisharp; bool expsharp; + bool complexsharp; bool sharcontrast; bool sharradius; bool sharamount; @@ -714,6 +723,7 @@ class LocallabParamsEdited // Local Contrast bool visicontrast; bool expcontrast; + bool complexcontrast; bool lcradius; bool lcamount; bool lcdarkness; @@ -784,6 +794,7 @@ class LocallabParamsEdited // Contrast by detail levels bool visicbdl; bool expcbdl; + bool complexcbdl; bool mult[6]; bool chromacbdl; bool threshold; From bdb8a95b14176dfbbcb0df2ebdcf7b438430f0ae Mon Sep 17 00:00:00 2001 From: Pandagrapher Date: Mon, 4 May 2020 20:03:58 +0200 Subject: [PATCH 2/5] Use default complexity mode defined in preferences when adding tool --- rtdata/languages/default | 1 - rtgui/controlspotpanel.cc | 26 +++++--------------------- rtgui/locallab.cc | 24 +++++++----------------- rtgui/locallabtools.cc | 17 ++++++++++++++++- rtgui/options.cc | 2 +- rtgui/preferences.cc | 8 +------- 6 files changed, 30 insertions(+), 48 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index d9d7557f46..f3067f8e62 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1551,7 +1551,6 @@ PREFERENCES_CLUTSDIR;HaldCLUT directory PREFERENCES_CMMBPC;Black point compensation PREFERENCES_COMPLEXITYLOC;Complexity Local Adjustements PREFERENCES_COMPLEXITY_EXP;Expert -PREFERENCES_COMPLEXITY_CONF;Confirmed PREFERENCES_COMPLEXITY_NORM;Normal PREFERENCES_CROP;Crop Editing PREFERENCES_CROP_AUTO_FIT;Automatically zoom to fit the crop diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 0c1d812502..ea7ead2003 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -94,7 +94,6 @@ ControlSpotPanel::ControlSpotPanel(): maskPrevActive(false) { const bool showtooltip = options.showtooltip; - const int complexsoft = options.complexity; Gtk::HBox* const hbox1_ = Gtk::manage(new Gtk::HBox(true, 4)); buttonaddconn_ = button_add_->signal_clicked().connect( @@ -230,10 +229,7 @@ ControlSpotPanel::ControlSpotPanel(): sigc::mem_fun( *this, &ControlSpotPanel::shapeMethodChanged)); ctboxshapemethod->pack_start(*shapeMethod_); - - if (complexsoft < 2) { - pack_start(*ctboxshapemethod); - } + pack_start(*ctboxshapemethod); pack_start(*locX_); locX_->setAdjusterListener(this); @@ -271,10 +267,7 @@ ControlSpotPanel::ControlSpotPanel(): sigc::mem_fun( *this, &ControlSpotPanel::qualityMethodChanged)); ctboxqualitymethod->pack_start(*qualityMethod_); - - if (complexsoft < 2) { - pack_start(*ctboxqualitymethod); - } + pack_start(*ctboxqualitymethod); Gtk::Frame* const transitFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_TRANSIT"))); transitFrame->set_label_align(0.025, 0.5); @@ -338,14 +331,8 @@ ControlSpotPanel::ControlSpotPanel(): colorde_->set_tooltip_text(M("TP_LOCALLAB_COLORDE_TOOLTIP")); } - if (complexsoft < 2) { - artifBox->pack_start(*struc_); - } - - if (complexsoft < 2) { - artifBox->pack_start(*thresh_); - } - + artifBox->pack_start(*struc_); + artifBox->pack_start(*thresh_); artifBox->pack_start(*iter_); artifBox->pack_start(*balan_); artifBox->pack_start(*balanh_); @@ -393,10 +380,7 @@ ControlSpotPanel::ControlSpotPanel(): savrest_->set_tooltip_text(M("TP_LOCALLAB_SAVREST_TOOLTIP")); } - if (complexsoft < 1) { - maskBox->pack_start(*laplac_); - } - + maskBox->pack_start(*laplac_); maskBox->pack_start(*deltae_); maskBox->pack_start(*scopemask_); // maskBox->pack_start(*shortc_); diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index e329bdbf92..ec30bb29ac 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -20,14 +20,11 @@ * 2019 Pierre Cabrera */ #include "locallab.h" -#include "options.h" #include "../rtengine/procparams.h" using namespace rtengine; using namespace procparams; -extern Options options; - /* ==== LocallabToolList ==== */ LocallabToolList::LocallabToolList(): // Tool list GUI elements @@ -219,9 +216,6 @@ Locallab::Locallab(): void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { - // printf("Locallab read\n"); - const int complexsoft = options.complexity; - // Disable all listeners disableListener(); @@ -264,18 +258,14 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit r->sensiexclu = pp->locallab.spots.at(i).sensiexclu; r->structexclu = pp->locallab.spots.at(i).structexclu; - if (complexsoft < 2) { - if (pp->locallab.spots.at(i).shapeMethod == "IND") { - r->shapeMethod = 0; - } else if (pp->locallab.spots.at(i).shapeMethod == "SYM") { - r->shapeMethod = 1; - } else if (pp->locallab.spots.at(i).shapeMethod == "INDSL") { - r->shapeMethod = 2; - } else { - r->shapeMethod = 3; - } - } else { + if (pp->locallab.spots.at(i).shapeMethod == "IND") { r->shapeMethod = 0; + } else if (pp->locallab.spots.at(i).shapeMethod == "SYM") { + r->shapeMethod = 1; + } else if (pp->locallab.spots.at(i).shapeMethod == "INDSL") { + r->shapeMethod = 2; + } else { + r->shapeMethod = 3; } r->locX = pp->locallab.spots.at(i).loc.at(0); diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 7ee4b22685..5f79d9713f 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -190,7 +190,22 @@ void LocallabTool::addLocallabTool(bool raiseEvent) exp->set_visible(true); // Raise event if required - if (raiseEvent) { + if (raiseEvent) { // Note: Event is only raised when a tool is added by user + if (needMode) { + // Set complexity mode according to chosen default one + complexityConn.block(true); + complexity->set_active(options.complexity); + complexityConn.block(false); + + // Update GUI accordingly + if (complexity->get_active_row_number() == Normal) { + convertParamToNormal(); + updateGUIToMode(Normal); + } else { + updateGUIToMode(Expert); + } + } + if (listener) { listener->panelChanged(EvlocallabToolAdded, toolName + " (" + escapeHtmlChars(spotName) + ")"); diff --git a/rtgui/options.cc b/rtgui/options.cc index 5a32f604ac..b86de1bb4d 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -451,7 +451,7 @@ void Options::setDefaults() histogramHeight = 200; histogramDrawMode = 0; curvebboxpos = 1; - complexity = 2; + complexity = 1; prevdemo = PD_Sidecar; rgbDenoiseThreadLimit = 0; diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index c283fb824e..fa3165110a 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -939,16 +939,10 @@ Gtk::Widget* Preferences::getGeneralPanel() complexitylocal = Gtk::manage(new Gtk::ComboBoxText()); setExpandAlignProperties(complexitylocal, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); complexitylocal->append(M("PREFERENCES_COMPLEXITY_EXP")); - complexitylocal->append(M("PREFERENCES_COMPLEXITY_CONF")); complexitylocal->append(M("PREFERENCES_COMPLEXITY_NORM")); - complexitylocal->set_active(2); - Gtk::Label* complexitylocalRestartL = Gtk::manage(new Gtk::Label(Glib::ustring("(") + M("PREFERENCES_APPLNEXTSTARTUP") + ")")); - setExpandAlignProperties(complexitylocalRestartL, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); + complexitylocal->set_active(1); workflowGrid->attach_next_to(*complexityL, *curveBBoxPosL, Gtk::POS_BOTTOM, 1, 1); workflowGrid->attach_next_to(*complexitylocal, *curveBBoxPosC, Gtk::POS_BOTTOM, 1, 1); - workflowGrid->attach_next_to(*complexitylocalRestartL, *curveBBoxPosRestartL, Gtk::POS_BOTTOM, 1, 1); - - ckbHistogramPositionLeft = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_HISTOGRAMPOSITIONLEFT"))); setExpandAlignProperties(ckbHistogramPositionLeft, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); From aa418703467c4e949065181f0da14a32c4e1964d Mon Sep 17 00:00:00 2001 From: Pandagrapher Date: Wed, 6 May 2020 13:14:54 +0200 Subject: [PATCH 3/5] Various changes in Locallab GUI - Modified some Locallab tool default parameters - Updates some labels - Expanders visibility state is now kept when using history - New added tool has now its visibily state resetted to default one - Code cleanup --- rtdata/languages/default | 6 +- rtengine/procparams.cc | 2 +- rtgui/locallab.cc | 36 +- rtgui/locallab.h | 4 +- rtgui/locallabtools.cc | 1136 +++++++++++++++++++------------------- rtgui/locallabtools2.cc | 828 +++++++++++++-------------- rtgui/toolpanelcoord.cc | 5 +- 7 files changed, 1028 insertions(+), 989 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 60d2d54ea9..c96424e0db 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2490,11 +2490,11 @@ TP_LOCALLAB_LINEAR;Linearity TP_LOCALLAB_LMASK_LEVEL_TOOLTIP;Give priority to action on midtones and high lights and by choosing the concerned wavelet levels 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 Ψ Big defects +TP_LOCALLAB_LOC_CONTRAST;Local contrast - Wavelet TP_LOCALLAB_LOC_CONTRASTPYR;Ψ Pyramid 1: TP_LOCALLAB_LOC_CONTRASTPYRLAB; Graduated Filter - Edge Sharpness - Blur TP_LOCALLAB_LOC_CONTRASTPYR2;Ψ Pyramid 2: -TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contrast by Levels- Tone Mapping- Dir. Contrast +TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contrast by Levels- Tone Mapping - Dir. Contrast TP_LOCALLAB_LOC_RESIDPYR;Residual Image Main TP_LOCALLAB_LOG;Encoding log TP_LOCALLAB_LOGAUTO;Automatic @@ -2639,7 +2639,7 @@ TP_LOCALLAB_SH1;Shadows Highlights TP_LOCALLAB_SH2;Equalizer TP_LOCALLAB_SHADEX;Shadows TP_LOCALLAB_SHADEXCOMP;Shadows compression & tonal width -TP_LOCALLAB_SHADHIGH;Shadows Highlights-Gradient - Tone Equalizer - TRC +TP_LOCALLAB_SHADHIGH;Shadows Highlight - Tone equalizer TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP;Can be used instead - or in complement - of exposure module in difficult cases.\nThe use of Denoise may be necessary : lightening the shadows.\n\nCan be used as graduated filter (increase Scope) TP_LOCALLAB_SHAMASKCOL;Shadows mask TP_LOCALLAB_SHAPETYPE;Shape RT-spot area diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 4483c079e3..874ce94772 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3394,7 +3394,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : wavgradl(false), wavcompre(false), origlc(false), - localcontMethod("wav"), + localcontMethod("loc"), localedgMethod("thr"), localneiMethod("low"), locwavcurve{ diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index f70d10cbb1..5c104b5478 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -357,9 +357,6 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit // Enable all listeners enableListener(); - // Open/re-open all Locallab tools expanders - openAllTools(); - // Note: No need to manage pedited as batch mode is deactivated for Locallab } @@ -528,9 +525,6 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited // Update default values according to selected spot setDefaults(pp, pedited); - // Open/re-open all Locallab tools expanders - openAllTools(); - // Note: No need to manage pedited as batch mode is deactivated for Locallab break; @@ -587,9 +581,6 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited // Update default values according to selected spot setDefaults(pp, pedited); - // Open/re-open all Locallab tools expanders - openAllTools(); - // Note: No need to manage pedited as batch mode is deactivated for Locallab break; @@ -651,9 +642,6 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited // Update default values according to selected spot setDefaults(pp, pedited); - // Open/re-open all Locallab tools expanders - openAllTools(); - // Note: No need to manage pedited as batch mode is deactivated for Locallab break; @@ -810,9 +798,6 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited // Update default values according to selected spot setDefaults(pp, pedited); - // Open/re-open all Locallab tools expanders - openAllTools(); - // Note: No need to manage pedited as batch mode is deactivated for Locallab break; @@ -1090,14 +1075,6 @@ void Locallab::foldAllButOne(LocallabTool* except) } } -void Locallab::addTool(Gtk::Box* where, LocallabTool* tool) -{ - tool->getExpander()->setLevel(3); - where->pack_start(*tool->getExpander(), false, false); - locallabTools.push_back(tool); - tool->setLocallabToolListener(this); -} - void Locallab::openAllTools() { for (auto tool : locallabTools) { @@ -1108,6 +1085,14 @@ void Locallab::openAllTools() } } +void Locallab::addTool(Gtk::Box* where, LocallabTool* tool) +{ + tool->getExpander()->setLevel(3); + where->pack_start(*tool->getExpander(), false, false); + locallabTools.push_back(tool); + tool->setLocallabToolListener(this); +} + void Locallab::setParamEditable(bool cond) { // Update params editable state for controlspotpanel @@ -1152,6 +1137,11 @@ void Locallab::locallabToolToAdd(const Glib::ustring &toolname) { for (auto tool : locallabTools) { if (tool->getToolName() == toolname) { + // Set expanders visibility default state when adding tool + tool->setExpanded(true); + tool->setDefaultExpanderVisibility(); + + // Add tool tool->addLocallabTool(true); } } diff --git a/rtgui/locallab.h b/rtgui/locallab.h index f76abfd1fc..c9f812a789 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -181,14 +181,12 @@ class Locallab : // Locallab tools expanders management functions void foldAllButOne(LocallabTool* except); + void openAllTools(); private: // Locallab tools management functions void addTool(Gtk::Box* where, LocallabTool* tool); - // Locallab tools management functions - void openAllTools(); - // Locallab GUI management function void setParamEditable(bool cond); diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index a1adc13a24..e432b97882 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -1042,149 +1042,151 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot - - exp->set_visible(pp->locallab.spots.at(index).visicolor); - exp->setEnabled(pp->locallab.spots.at(index).expcolor); - complexity->set_active(pp->locallab.spots.at(index).complexcolor); - - curvactiv->set_active(pp->locallab.spots.at(index).curvactiv); - lightness->setValue(pp->locallab.spots.at(index).lightness); - contrast->setValue(pp->locallab.spots.at(index).contrast); - chroma->setValue(pp->locallab.spots.at(index).chroma); - labgrid->setParams(pp->locallab.spots.at(index).labgridALow / LocallabParams::LABGRIDL_CORR_MAX, - pp->locallab.spots.at(index).labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, - pp->locallab.spots.at(index).labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, - pp->locallab.spots.at(index).labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX, + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spotName = spot.name; // Update spot name according to selected spot + + exp->set_visible(spot.visicolor); + exp->setEnabled(spot.expcolor); + complexity->set_active(spot.complexcolor); + + curvactiv->set_active(spot.curvactiv); + lightness->setValue(spot.lightness); + contrast->setValue(spot.contrast); + chroma->setValue(spot.chroma); + labgrid->setParams(spot.labgridALow / LocallabParams::LABGRIDL_CORR_MAX, + spot.labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, + spot.labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, + spot.labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX, false); - if (pp->locallab.spots.at(index).gridMethod == "one") { + if (spot.gridMethod == "one") { gridMethod->set_active(0); - } else if (pp->locallab.spots.at(index).gridMethod == "two") { + } else if (spot.gridMethod == "two") { gridMethod->set_active(1); } - strengthgrid->setValue(pp->locallab.spots.at(index).strengthgrid); - sensi->setValue(pp->locallab.spots.at(index).sensi); - structcol->setValue(pp->locallab.spots.at(index).structcol); - blurcolde->setValue(pp->locallab.spots.at(index).blurcolde); - softradiuscol->setValue(pp->locallab.spots.at(index).softradiuscol); - invers->set_active(pp->locallab.spots.at(index).invers); - strcol->setValue(pp->locallab.spots.at(index).strcol); - strcolab->setValue(pp->locallab.spots.at(index).strcolab); - strcolh->setValue(pp->locallab.spots.at(index).strcolh); - angcol->setValue(pp->locallab.spots.at(index).angcol); + strengthgrid->setValue(spot.strengthgrid); + sensi->setValue(spot.sensi); + structcol->setValue(spot.structcol); + blurcolde->setValue(spot.blurcolde); + softradiuscol->setValue(spot.softradiuscol); + invers->set_active(spot.invers); + strcol->setValue(spot.strcol); + strcolab->setValue(spot.strcolab); + strcolh->setValue(spot.strcolh); + angcol->setValue(spot.angcol); - if (pp->locallab.spots.at(index).qualitycurveMethod == "none") { + if (spot.qualitycurveMethod == "none") { qualitycurveMethod->set_active(0); - } else if (pp->locallab.spots.at(index).qualitycurveMethod == "std") { + } else if (spot.qualitycurveMethod == "std") { qualitycurveMethod->set_active(1); } - llshape->setCurve(pp->locallab.spots.at(index).llcurve); - ccshape->setCurve(pp->locallab.spots.at(index).cccurve); - clshape->setCurve(pp->locallab.spots.at(index).clcurve); - lcshape->setCurve(pp->locallab.spots.at(index).lccurve); - LHshape->setCurve(pp->locallab.spots.at(index).LHcurve); - HHshape->setCurve(pp->locallab.spots.at(index).HHcurve); + llshape->setCurve(spot.llcurve); + ccshape->setCurve(spot.cccurve); + clshape->setCurve(spot.clcurve); + lcshape->setCurve(spot.lccurve); + LHshape->setCurve(spot.LHcurve); + HHshape->setCurve(spot.HHcurve); - if (pp->locallab.spots.at(index).toneMethod == "one") { + if (spot.toneMethod == "one") { toneMethod->set_active(0); - } else if (pp->locallab.spots.at(index).toneMethod == "two") { + } else if (spot.toneMethod == "two") { toneMethod->set_active(1); - } else if (pp->locallab.spots.at(index).toneMethod == "thr") { + } else if (spot.toneMethod == "thr") { toneMethod->set_active(2); - } else if (pp->locallab.spots.at(index).toneMethod == "fou") { + } else if (spot.toneMethod == "fou") { toneMethod->set_active(3); } - rgbshape->setCurve(pp->locallab.spots.at(index).rgbcurve); - special->set_active(pp->locallab.spots.at(index).special); + rgbshape->setCurve(spot.rgbcurve); + special->set_active(spot.special); - if (pp->locallab.spots.at(index).merMethod == "mone") { + if (spot.merMethod == "mone") { merMethod->set_active(0); - } else if (pp->locallab.spots.at(index).merMethod == "mtwo") { + } else if (spot.merMethod == "mtwo") { merMethod->set_active(1); - } else if (pp->locallab.spots.at(index).merMethod == "mthr") { + } else if (spot.merMethod == "mthr") { merMethod->set_active(2); - } else if (pp->locallab.spots.at(index).merMethod == "mfou") { + } else if (spot.merMethod == "mfou") { merMethod->set_active(3); - } else if (pp->locallab.spots.at(index).merMethod == "mfiv") { + } else if (spot.merMethod == "mfiv") { merMethod->set_active(4); } - if (pp->locallab.spots.at(index).mergecolMethod == "one") { + if (spot.mergecolMethod == "one") { mergecolMethod->set_active(0); - } else if (pp->locallab.spots.at(index).mergecolMethod == "two") { + } else if (spot.mergecolMethod == "two") { mergecolMethod->set_active(1); - } else if (pp->locallab.spots.at(index).mergecolMethod == "thr") { + } else if (spot.mergecolMethod == "thr") { mergecolMethod->set_active(2); - } else if (pp->locallab.spots.at(index).mergecolMethod == "fou") { + } else if (spot.mergecolMethod == "fou") { mergecolMethod->set_active(3); - } else if (pp->locallab.spots.at(index).mergecolMethod == "fiv") { + } else if (spot.mergecolMethod == "fiv") { mergecolMethod->set_active(4); - } else if (pp->locallab.spots.at(index).mergecolMethod == "six") { + } else if (spot.mergecolMethod == "six") { mergecolMethod->set_active(5); - } else if (pp->locallab.spots.at(index).mergecolMethod == "sev") { + } else if (spot.mergecolMethod == "sev") { mergecolMethod->set_active(6); - } else if (pp->locallab.spots.at(index).mergecolMethod == "sev0") { + } else if (spot.mergecolMethod == "sev0") { mergecolMethod->set_active(7); - } else if (pp->locallab.spots.at(index).mergecolMethod == "sev1") { + } else if (spot.mergecolMethod == "sev1") { mergecolMethod->set_active(8); - } else if (pp->locallab.spots.at(index).mergecolMethod == "sev2") { + } else if (spot.mergecolMethod == "sev2") { mergecolMethod->set_active(9); - } else if (pp->locallab.spots.at(index).mergecolMethod == "hei") { + } else if (spot.mergecolMethod == "hei") { mergecolMethod->set_active(10); - } else if (pp->locallab.spots.at(index).mergecolMethod == "nin") { + } else if (spot.mergecolMethod == "nin") { mergecolMethod->set_active(11); - } else if (pp->locallab.spots.at(index).mergecolMethod == "ten") { + } else if (spot.mergecolMethod == "ten") { mergecolMethod->set_active(12); - } else if (pp->locallab.spots.at(index).mergecolMethod == "ele") { + } else if (spot.mergecolMethod == "ele") { mergecolMethod->set_active(13); - } else if (pp->locallab.spots.at(index).mergecolMethod == "twe") { + } else if (spot.mergecolMethod == "twe") { mergecolMethod->set_active(14); - } else if (pp->locallab.spots.at(index).mergecolMethod == "thi") { + } else if (spot.mergecolMethod == "thi") { mergecolMethod->set_active(15); - } else if (pp->locallab.spots.at(index).mergecolMethod == "for") { + } else if (spot.mergecolMethod == "for") { mergecolMethod->set_active(16); - } else if (pp->locallab.spots.at(index).mergecolMethod == "hue") { + } else if (spot.mergecolMethod == "hue") { mergecolMethod->set_active(17); - } else if (pp->locallab.spots.at(index).mergecolMethod == "sat") { + } else if (spot.mergecolMethod == "sat") { mergecolMethod->set_active(18); - } else if (pp->locallab.spots.at(index).mergecolMethod == "col") { + } else if (spot.mergecolMethod == "col") { mergecolMethod->set_active(19); - } else if (pp->locallab.spots.at(index).mergecolMethod == "lum") { + } else if (spot.mergecolMethod == "lum") { mergecolMethod->set_active(20); } - mercol->setValue(pp->locallab.spots.at(index).mercol); - opacol->setValue(pp->locallab.spots.at(index).opacol); - conthrcol->setValue(pp->locallab.spots.at(index).conthrcol); + mercol->setValue(spot.mercol); + opacol->setValue(spot.opacol); + conthrcol->setValue(spot.conthrcol); labgridmerg->setParams(0, 0, - pp->locallab.spots.at(index).labgridAHighmerg / LocallabParams::LABGRIDL_CORR_MAX, - pp->locallab.spots.at(index).labgridBHighmerg / LocallabParams::LABGRIDL_CORR_MAX, + spot.labgridAHighmerg / LocallabParams::LABGRIDL_CORR_MAX, + spot.labgridBHighmerg / LocallabParams::LABGRIDL_CORR_MAX, false); - merlucol->setValue(pp->locallab.spots.at(index).merlucol); - enaColorMask->set_active(pp->locallab.spots.at(index).enaColorMask); - CCmaskshape->setCurve(pp->locallab.spots.at(index).CCmaskcurve); - LLmaskshape->setCurve(pp->locallab.spots.at(index).LLmaskcurve); - HHmaskshape->setCurve(pp->locallab.spots.at(index).HHmaskcurve); - strumaskcol->setValue(pp->locallab.spots.at(index).strumaskcol); - toolcol->set_active(pp->locallab.spots.at(index).toolcol); - fftColorMask->set_active(pp->locallab.spots.at(index).fftColorMask); - contcol->setValue(pp->locallab.spots.at(index).contcol); - blurcol->setValue(pp->locallab.spots.at(index).blurcol); - blendmaskcol->setValue(pp->locallab.spots.at(index).blendmaskcol); - radmaskcol->setValue(pp->locallab.spots.at(index).radmaskcol); - lapmaskcol->setValue(pp->locallab.spots.at(index).lapmaskcol); - chromaskcol->setValue(pp->locallab.spots.at(index).chromaskcol); - gammaskcol->setValue(pp->locallab.spots.at(index).gammaskcol); - slomaskcol->setValue(pp->locallab.spots.at(index).slomaskcol); - shadmaskcol->setValue(pp->locallab.spots.at(index).shadmaskcol); - HHhmaskshape->setCurve(pp->locallab.spots.at(index).HHhmaskcurve); - Lmaskshape->setCurve(pp->locallab.spots.at(index).Lmaskcurve); - LLmaskcolshapewav->setCurve(pp->locallab.spots.at(index).LLmaskcolcurvewav); - csThresholdcol->setValue(pp->locallab.spots.at(index).csthresholdcol); + merlucol->setValue(spot.merlucol); + enaColorMask->set_active(spot.enaColorMask); + CCmaskshape->setCurve(spot.CCmaskcurve); + LLmaskshape->setCurve(spot.LLmaskcurve); + HHmaskshape->setCurve(spot.HHmaskcurve); + strumaskcol->setValue(spot.strumaskcol); + toolcol->set_active(spot.toolcol); + fftColorMask->set_active(spot.fftColorMask); + contcol->setValue(spot.contcol); + blurcol->setValue(spot.blurcol); + blendmaskcol->setValue(spot.blendmaskcol); + radmaskcol->setValue(spot.radmaskcol); + lapmaskcol->setValue(spot.lapmaskcol); + chromaskcol->setValue(spot.chromaskcol); + gammaskcol->setValue(spot.gammaskcol); + slomaskcol->setValue(spot.slomaskcol); + shadmaskcol->setValue(spot.shadmaskcol); + HHhmaskshape->setCurve(spot.HHhmaskcurve); + Lmaskshape->setCurve(spot.Lmaskcurve); + LLmaskcolshapewav->setCurve(spot.LLmaskcolcurvewav); + csThresholdcol->setValue(spot.csthresholdcol); } // Enable all listeners @@ -1210,154 +1212,156 @@ void LocallabColor::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).expcolor = exp->getEnabled(); - pp->locallab.spots.at(index).visicolor = exp->get_visible(); - pp->locallab.spots.at(index).complexcolor = complexity->get_active_row_number(); - - pp->locallab.spots.at(index).curvactiv = curvactiv->get_active(); - pp->locallab.spots.at(index).lightness = lightness->getIntValue(); - pp->locallab.spots.at(index).contrast = contrast->getIntValue(); - pp->locallab.spots.at(index).chroma = chroma->getIntValue(); - labgrid->getParams(pp->locallab.spots.at(index).labgridALow, - pp->locallab.spots.at(index).labgridBLow, - pp->locallab.spots.at(index).labgridAHigh, - pp->locallab.spots.at(index).labgridBHigh); - pp->locallab.spots.at(index).labgridALow *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(index).labgridAHigh *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(index).labgridBLow *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(index).labgridBHigh *= LocallabParams::LABGRIDL_CORR_MAX; + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.expcolor = exp->getEnabled(); + spot.visicolor = exp->get_visible(); + spot.complexcolor = complexity->get_active_row_number(); + + spot.curvactiv = curvactiv->get_active(); + spot.lightness = lightness->getIntValue(); + spot.contrast = contrast->getIntValue(); + spot.chroma = chroma->getIntValue(); + labgrid->getParams(spot.labgridALow, + spot.labgridBLow, + spot.labgridAHigh, + spot.labgridBHigh); + spot.labgridALow *= LocallabParams::LABGRIDL_CORR_MAX; + spot.labgridAHigh *= LocallabParams::LABGRIDL_CORR_MAX; + spot.labgridBLow *= LocallabParams::LABGRIDL_CORR_MAX; + spot.labgridBHigh *= LocallabParams::LABGRIDL_CORR_MAX; if (gridMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).gridMethod = "one"; + spot.gridMethod = "one"; } else if (gridMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).gridMethod = "two"; + spot.gridMethod = "two"; } - pp->locallab.spots.at(index).strengthgrid = strengthgrid->getIntValue(); - pp->locallab.spots.at(index).sensi = sensi->getIntValue(); - pp->locallab.spots.at(index).structcol = structcol->getIntValue(); - pp->locallab.spots.at(index).blurcolde = blurcolde->getIntValue(); - pp->locallab.spots.at(index).softradiuscol = softradiuscol->getValue(); - pp->locallab.spots.at(index).invers = invers->get_active(); - pp->locallab.spots.at(index).strcol = strcol->getValue(); - pp->locallab.spots.at(index).strcolab = strcolab->getValue(); - pp->locallab.spots.at(index).strcolh = strcolh->getValue(); - pp->locallab.spots.at(index).angcol = angcol->getValue(); + spot.strengthgrid = strengthgrid->getIntValue(); + spot.sensi = sensi->getIntValue(); + spot.structcol = structcol->getIntValue(); + spot.blurcolde = blurcolde->getIntValue(); + spot.softradiuscol = softradiuscol->getValue(); + spot.invers = invers->get_active(); + spot.strcol = strcol->getValue(); + spot.strcolab = strcolab->getValue(); + spot.strcolh = strcolh->getValue(); + spot.angcol = angcol->getValue(); if (qualitycurveMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).qualitycurveMethod = "none"; + spot.qualitycurveMethod = "none"; } else if (qualitycurveMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).qualitycurveMethod = "std"; + spot.qualitycurveMethod = "std"; } - pp->locallab.spots.at(index).llcurve = llshape->getCurve(); - pp->locallab.spots.at(index).cccurve = ccshape->getCurve(); - pp->locallab.spots.at(index).clcurve = clshape->getCurve(); - pp->locallab.spots.at(index).lccurve = lcshape->getCurve(); - pp->locallab.spots.at(index).LHcurve = LHshape->getCurve(); - pp->locallab.spots.at(index).HHcurve = HHshape->getCurve(); + spot.llcurve = llshape->getCurve(); + spot.cccurve = ccshape->getCurve(); + spot.clcurve = clshape->getCurve(); + spot.lccurve = lcshape->getCurve(); + spot.LHcurve = LHshape->getCurve(); + spot.HHcurve = HHshape->getCurve(); if (toneMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).toneMethod = "one"; + spot.toneMethod = "one"; } else if (toneMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).toneMethod = "two"; + spot.toneMethod = "two"; } else if (toneMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(index).toneMethod = "thr"; + spot.toneMethod = "thr"; } else if (toneMethod->get_active_row_number() == 3) { - pp->locallab.spots.at(index).toneMethod = "fou"; + spot.toneMethod = "fou"; } - pp->locallab.spots.at(index).rgbcurve = rgbshape->getCurve(); - pp->locallab.spots.at(index).special = special->get_active(); + spot.rgbcurve = rgbshape->getCurve(); + spot.special = special->get_active(); if (merMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).merMethod = "mone"; + spot.merMethod = "mone"; } else if (merMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).merMethod = "mtwo"; + spot.merMethod = "mtwo"; } else if (merMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(index).merMethod = "mthr"; + spot.merMethod = "mthr"; } else if (merMethod->get_active_row_number() == 3) { - pp->locallab.spots.at(index).merMethod = "mfou"; + spot.merMethod = "mfou"; } else if (merMethod->get_active_row_number() == 4) { - pp->locallab.spots.at(index).merMethod = "mfiv"; + spot.merMethod = "mfiv"; } if (mergecolMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).mergecolMethod = "one"; + spot.mergecolMethod = "one"; } else if (mergecolMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).mergecolMethod = "two"; + spot.mergecolMethod = "two"; } else if (mergecolMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(index).mergecolMethod = "thr"; + spot.mergecolMethod = "thr"; } else if (mergecolMethod->get_active_row_number() == 3) { - pp->locallab.spots.at(index).mergecolMethod = "fou"; + spot.mergecolMethod = "fou"; } else if (mergecolMethod->get_active_row_number() == 4) { - pp->locallab.spots.at(index).mergecolMethod = "fiv"; + spot.mergecolMethod = "fiv"; } else if (mergecolMethod->get_active_row_number() == 5) { - pp->locallab.spots.at(index).mergecolMethod = "six"; + spot.mergecolMethod = "six"; } else if (mergecolMethod->get_active_row_number() == 6) { - pp->locallab.spots.at(index).mergecolMethod = "sev"; + spot.mergecolMethod = "sev"; } else if (mergecolMethod->get_active_row_number() == 7) { - pp->locallab.spots.at(index).mergecolMethod = "sev0"; + spot.mergecolMethod = "sev0"; } else if (mergecolMethod->get_active_row_number() == 8) { - pp->locallab.spots.at(index).mergecolMethod = "sev1"; + spot.mergecolMethod = "sev1"; } else if (mergecolMethod->get_active_row_number() == 9) { - pp->locallab.spots.at(index).mergecolMethod = "sev2"; + spot.mergecolMethod = "sev2"; } else if (mergecolMethod->get_active_row_number() == 10) { - pp->locallab.spots.at(index).mergecolMethod = "hei"; + spot.mergecolMethod = "hei"; } else if (mergecolMethod->get_active_row_number() == 11) { - pp->locallab.spots.at(index).mergecolMethod = "nin"; + spot.mergecolMethod = "nin"; } else if (mergecolMethod->get_active_row_number() == 12) { - pp->locallab.spots.at(index).mergecolMethod = "ten"; + spot.mergecolMethod = "ten"; } else if (mergecolMethod->get_active_row_number() == 13) { - pp->locallab.spots.at(index).mergecolMethod = "ele"; + spot.mergecolMethod = "ele"; } else if (mergecolMethod->get_active_row_number() == 14) { - pp->locallab.spots.at(index).mergecolMethod = "twe"; + spot.mergecolMethod = "twe"; } else if (mergecolMethod->get_active_row_number() == 15) { - pp->locallab.spots.at(index).mergecolMethod = "thi"; + spot.mergecolMethod = "thi"; } else if (mergecolMethod->get_active_row_number() == 16) { - pp->locallab.spots.at(index).mergecolMethod = "for"; + spot.mergecolMethod = "for"; } else if (mergecolMethod->get_active_row_number() == 17) { - pp->locallab.spots.at(index).mergecolMethod = "hue"; + spot.mergecolMethod = "hue"; } else if (mergecolMethod->get_active_row_number() == 18) { - pp->locallab.spots.at(index).mergecolMethod = "sat"; + spot.mergecolMethod = "sat"; } else if (mergecolMethod->get_active_row_number() == 19) { - pp->locallab.spots.at(index).mergecolMethod = "col"; + spot.mergecolMethod = "col"; } else if (mergecolMethod->get_active_row_number() == 20) { - pp->locallab.spots.at(index).mergecolMethod = "lum"; - } - - pp->locallab.spots.at(index).mercol = mercol->getValue(); - pp->locallab.spots.at(index).opacol = opacol->getValue(); - pp->locallab.spots.at(index).conthrcol = conthrcol->getValue(); - labgridmerg->getParams(pp->locallab.spots.at(index).labgridALowmerg, - pp->locallab.spots.at(index).labgridBLowmerg, - pp->locallab.spots.at(index).labgridAHighmerg, - pp->locallab.spots.at(index).labgridBHighmerg); - pp->locallab.spots.at(index).labgridALowmerg *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(index).labgridAHighmerg *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(index).labgridBLowmerg *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(index).labgridBHighmerg *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(index).merlucol = merlucol->getValue(); - pp->locallab.spots.at(index).enaColorMask = enaColorMask->get_active(); - pp->locallab.spots.at(index).CCmaskcurve = CCmaskshape->getCurve(); - pp->locallab.spots.at(index).LLmaskcurve = LLmaskshape->getCurve(); - pp->locallab.spots.at(index).HHmaskcurve = HHmaskshape->getCurve(); - pp->locallab.spots.at(index).strumaskcol = strumaskcol->getValue(); - pp->locallab.spots.at(index).toolcol = toolcol->get_active(); - pp->locallab.spots.at(index).fftColorMask = fftColorMask->get_active(); - pp->locallab.spots.at(index).contcol = contcol->getValue(); - pp->locallab.spots.at(index).blurcol = blurcol->getValue(); - pp->locallab.spots.at(index).blendmaskcol = blendmaskcol->getIntValue(); - pp->locallab.spots.at(index).radmaskcol = radmaskcol->getValue(); - pp->locallab.spots.at(index).lapmaskcol = lapmaskcol->getValue(); - pp->locallab.spots.at(index).chromaskcol = chromaskcol->getValue(); - pp->locallab.spots.at(index).gammaskcol = gammaskcol->getValue(); - pp->locallab.spots.at(index).slomaskcol = slomaskcol->getValue(); - pp->locallab.spots.at(index).shadmaskcol = shadmaskcol->getIntValue(); - pp->locallab.spots.at(index).HHhmaskcurve = HHhmaskshape->getCurve(); - pp->locallab.spots.at(index).Lmaskcurve = Lmaskshape->getCurve(); - pp->locallab.spots.at(index).LLmaskcolcurvewav = LLmaskcolshapewav->getCurve(); - pp->locallab.spots.at(index).csthresholdcol = csThresholdcol->getValue(); + spot.mergecolMethod = "lum"; + } + + spot.mercol = mercol->getValue(); + spot.opacol = opacol->getValue(); + spot.conthrcol = conthrcol->getValue(); + labgridmerg->getParams(spot.labgridALowmerg, + spot.labgridBLowmerg, + spot.labgridAHighmerg, + spot.labgridBHighmerg); + spot.labgridALowmerg *= LocallabParams::LABGRIDL_CORR_MAX; + spot.labgridAHighmerg *= LocallabParams::LABGRIDL_CORR_MAX; + spot.labgridBLowmerg *= LocallabParams::LABGRIDL_CORR_MAX; + spot.labgridBHighmerg *= LocallabParams::LABGRIDL_CORR_MAX; + spot.merlucol = merlucol->getValue(); + spot.enaColorMask = enaColorMask->get_active(); + spot.CCmaskcurve = CCmaskshape->getCurve(); + spot.LLmaskcurve = LLmaskshape->getCurve(); + spot.HHmaskcurve = HHmaskshape->getCurve(); + spot.strumaskcol = strumaskcol->getValue(); + spot.toolcol = toolcol->get_active(); + spot.fftColorMask = fftColorMask->get_active(); + spot.contcol = contcol->getValue(); + spot.blurcol = blurcol->getValue(); + spot.blendmaskcol = blendmaskcol->getIntValue(); + spot.radmaskcol = radmaskcol->getValue(); + spot.lapmaskcol = lapmaskcol->getValue(); + spot.chromaskcol = chromaskcol->getValue(); + spot.gammaskcol = gammaskcol->getValue(); + spot.slomaskcol = slomaskcol->getValue(); + spot.shadmaskcol = shadmaskcol->getIntValue(); + spot.HHhmaskcurve = HHhmaskshape->getCurve(); + spot.Lmaskcurve = Lmaskshape->getCurve(); + spot.LLmaskcolcurvewav = LLmaskcolshapewav->getCurve(); + spot.csthresholdcol = csThresholdcol->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -1368,7 +1372,7 @@ void LocallabColor::setDefaults(const rtengine::procparams::ProcParams* defParam const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default value for adjuster, labgrid and threshold adjuster widgets lightness->setDefault((double)defSpot.lightness); @@ -2632,64 +2636,66 @@ void LocallabExposure::read(const rtengine::procparams::ProcParams* pp, const Pa const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); - exp->set_visible(pp->locallab.spots.at(index).visiexpose); - exp->setEnabled(pp->locallab.spots.at(index).expexpose); - complexity->set_active(pp->locallab.spots.at(index).complexexpose); + spotName = spot.name; // Update spot name according to selected spot - if (pp->locallab.spots.at(index).expMethod == "std") { + exp->set_visible(spot.visiexpose); + exp->setEnabled(spot.expexpose); + complexity->set_active(spot.complexexpose); + + if (spot.expMethod == "std") { expMethod->set_active(0); - } else if (pp->locallab.spots.at(index).expMethod == "pde") { + } else if (spot.expMethod == "pde") { expMethod->set_active(1); } - laplacexp->setValue(pp->locallab.spots.at(index).laplacexp); - linear->setValue(pp->locallab.spots.at(index).linear); - balanexp->setValue(pp->locallab.spots.at(index).balanexp); - gamm->setValue(pp->locallab.spots.at(index).gamm); + laplacexp->setValue(spot.laplacexp); + linear->setValue(spot.linear); + balanexp->setValue(spot.balanexp); + gamm->setValue(spot.gamm); - if (pp->locallab.spots.at(index).exnoiseMethod == "one") { + if (spot.exnoiseMethod == "one") { exnoiseMethod->set_active(0); - } else if (pp->locallab.spots.at(index).exnoiseMethod == "med") { + } else if (spot.exnoiseMethod == "med") { exnoiseMethod->set_active(1); - } else if (pp->locallab.spots.at(index).exnoiseMethod == "medhi") { + } else if (spot.exnoiseMethod == "medhi") { exnoiseMethod->set_active(2); } - fatamount->setValue(pp->locallab.spots.at(index).fatamount); - fatdetail->setValue(pp->locallab.spots.at(index).fatdetail); - fatlevel->setValue(pp->locallab.spots.at(index).fatlevel); - fatanchor->setValue(pp->locallab.spots.at(index).fatanchor); - sensiex->setValue(pp->locallab.spots.at(index).sensiex); - structexp->setValue(pp->locallab.spots.at(index).structexp); - blurexpde->setValue(pp->locallab.spots.at(index).blurexpde); - expcomp->setValue(pp->locallab.spots.at(index).expcomp); - black->setValue(pp->locallab.spots.at(index).black); - hlcompr->setValue(pp->locallab.spots.at(index).hlcompr); - hlcomprthresh->setValue(pp->locallab.spots.at(index).hlcomprthresh); - shadex->setValue(pp->locallab.spots.at(index).shadex); - shcompr->setValue(pp->locallab.spots.at(index).shcompr); - expchroma->setValue(pp->locallab.spots.at(index).expchroma); - shapeexpos->setCurve(pp->locallab.spots.at(index).excurve); - strexp->setValue(pp->locallab.spots.at(index).strexp); - angexp->setValue(pp->locallab.spots.at(index).angexp); - softradiusexp->setValue(pp->locallab.spots.at(index).softradiusexp); - inversex->set_active(pp->locallab.spots.at(index).inversex); - enaExpMask->set_active(pp->locallab.spots.at(index).enaExpMask); - enaExpMaskaft->set_active(pp->locallab.spots.at(index).enaExpMaskaft); - CCmaskexpshape->setCurve(pp->locallab.spots.at(index).CCmaskexpcurve); - LLmaskexpshape->setCurve(pp->locallab.spots.at(index).LLmaskexpcurve); - HHmaskexpshape->setCurve(pp->locallab.spots.at(index).HHmaskexpcurve); - blendmaskexp->setValue(pp->locallab.spots.at(index).blendmaskexp); - radmaskexp->setValue(pp->locallab.spots.at(index).radmaskexp); - lapmaskexp->setValue(pp->locallab.spots.at(index).lapmaskexp); - chromaskexp->setValue(pp->locallab.spots.at(index).chromaskexp); - gammaskexp->setValue(pp->locallab.spots.at(index).gammaskexp); - slomaskexp->setValue(pp->locallab.spots.at(index).slomaskexp); - strmaskexp->setValue(pp->locallab.spots.at(index).strmaskexp); - angmaskexp->setValue(pp->locallab.spots.at(index).angmaskexp); - Lmaskexpshape->setCurve(pp->locallab.spots.at(index).Lmaskexpcurve); + fatamount->setValue(spot.fatamount); + fatdetail->setValue(spot.fatdetail); + fatlevel->setValue(spot.fatlevel); + fatanchor->setValue(spot.fatanchor); + sensiex->setValue(spot.sensiex); + structexp->setValue(spot.structexp); + blurexpde->setValue(spot.blurexpde); + expcomp->setValue(spot.expcomp); + black->setValue(spot.black); + hlcompr->setValue(spot.hlcompr); + hlcomprthresh->setValue(spot.hlcomprthresh); + shadex->setValue(spot.shadex); + shcompr->setValue(spot.shcompr); + expchroma->setValue(spot.expchroma); + shapeexpos->setCurve(spot.excurve); + strexp->setValue(spot.strexp); + angexp->setValue(spot.angexp); + softradiusexp->setValue(spot.softradiusexp); + inversex->set_active(spot.inversex); + enaExpMask->set_active(spot.enaExpMask); + enaExpMaskaft->set_active(spot.enaExpMaskaft); + CCmaskexpshape->setCurve(spot.CCmaskexpcurve); + LLmaskexpshape->setCurve(spot.LLmaskexpcurve); + HHmaskexpshape->setCurve(spot.HHmaskexpcurve); + blendmaskexp->setValue(spot.blendmaskexp); + radmaskexp->setValue(spot.radmaskexp); + lapmaskexp->setValue(spot.lapmaskexp); + chromaskexp->setValue(spot.chromaskexp); + gammaskexp->setValue(spot.gammaskexp); + slomaskexp->setValue(spot.slomaskexp); + strmaskexp->setValue(spot.strmaskexp); + angmaskexp->setValue(spot.angmaskexp); + Lmaskexpshape->setCurve(spot.Lmaskexpcurve); } // Enable all listeners @@ -2715,62 +2721,64 @@ void LocallabExposure::write(rtengine::procparams::ProcParams* pp, ParamsEdited* const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).expexpose = exp->getEnabled(); - pp->locallab.spots.at(index).visiexpose = exp->get_visible(); - pp->locallab.spots.at(index).complexexpose = complexity->get_active_row_number(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.expexpose = exp->getEnabled(); + spot.visiexpose = exp->get_visible(); + spot.complexexpose = complexity->get_active_row_number(); if (expMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).expMethod = "std"; + spot.expMethod = "std"; } else if (expMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).expMethod = "pde"; + spot.expMethod = "pde"; } - pp->locallab.spots.at(index).laplacexp = laplacexp->getValue(); - pp->locallab.spots.at(index).linear = linear->getValue(); - pp->locallab.spots.at(index).balanexp = balanexp->getValue(); - pp->locallab.spots.at(index).gamm = gamm->getValue(); + spot.laplacexp = laplacexp->getValue(); + spot.linear = linear->getValue(); + spot.balanexp = balanexp->getValue(); + spot.gamm = gamm->getValue(); if (exnoiseMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).exnoiseMethod = "none"; + spot.exnoiseMethod = "none"; } else if (exnoiseMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).exnoiseMethod = "med"; + spot.exnoiseMethod = "med"; } else if (exnoiseMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(index).exnoiseMethod = "medhi"; - } - - pp->locallab.spots.at(index).fatamount = fatamount->getValue(); - pp->locallab.spots.at(index).fatdetail = fatdetail->getValue(); - pp->locallab.spots.at(index).fatlevel = fatlevel->getValue(); - pp->locallab.spots.at(index).fatanchor = fatanchor->getValue(); - pp->locallab.spots.at(index).sensiex = sensiex->getIntValue(); - pp->locallab.spots.at(index).structexp = structexp->getIntValue(); - pp->locallab.spots.at(index).blurexpde = blurexpde->getIntValue(); - pp->locallab.spots.at(index).expcomp = expcomp->getValue(); - pp->locallab.spots.at(index).black = black->getIntValue(); - pp->locallab.spots.at(index).hlcompr = hlcompr->getIntValue(); - pp->locallab.spots.at(index).hlcomprthresh = hlcomprthresh->getIntValue(); - pp->locallab.spots.at(index).shadex = shadex->getIntValue(); - pp->locallab.spots.at(index).shcompr = shcompr->getIntValue(); - pp->locallab.spots.at(index).expchroma = expchroma->getIntValue(); - pp->locallab.spots.at(index).excurve = shapeexpos->getCurve(); - pp->locallab.spots.at(index).strexp = strexp->getValue(); - pp->locallab.spots.at(index).angexp = angexp->getValue(); - pp->locallab.spots.at(index).softradiusexp = softradiusexp->getValue(); - pp->locallab.spots.at(index).inversex = inversex->get_active(); - pp->locallab.spots.at(index).enaExpMask = enaExpMask->get_active(); - pp->locallab.spots.at(index).enaExpMaskaft = enaExpMaskaft->get_active(); - pp->locallab.spots.at(index).CCmaskexpcurve = CCmaskexpshape->getCurve(); - pp->locallab.spots.at(index).LLmaskexpcurve = LLmaskexpshape->getCurve(); - pp->locallab.spots.at(index).HHmaskexpcurve = HHmaskexpshape->getCurve(); - pp->locallab.spots.at(index).blendmaskexp = blendmaskexp->getIntValue(); - pp->locallab.spots.at(index).radmaskexp = radmaskexp->getValue(); - pp->locallab.spots.at(index).lapmaskexp = lapmaskexp->getValue(); - pp->locallab.spots.at(index).chromaskexp = chromaskexp->getValue(); - pp->locallab.spots.at(index).gammaskexp = gammaskexp->getValue(); - pp->locallab.spots.at(index).slomaskexp = slomaskexp->getValue(); - pp->locallab.spots.at(index).strmaskexp = strmaskexp->getValue(); - pp->locallab.spots.at(index).angmaskexp = angmaskexp->getValue(); - pp->locallab.spots.at(index).Lmaskexpcurve = Lmaskexpshape->getCurve(); + spot.exnoiseMethod = "medhi"; + } + + spot.fatamount = fatamount->getValue(); + spot.fatdetail = fatdetail->getValue(); + spot.fatlevel = fatlevel->getValue(); + spot.fatanchor = fatanchor->getValue(); + spot.sensiex = sensiex->getIntValue(); + spot.structexp = structexp->getIntValue(); + spot.blurexpde = blurexpde->getIntValue(); + spot.expcomp = expcomp->getValue(); + spot.black = black->getIntValue(); + spot.hlcompr = hlcompr->getIntValue(); + spot.hlcomprthresh = hlcomprthresh->getIntValue(); + spot.shadex = shadex->getIntValue(); + spot.shcompr = shcompr->getIntValue(); + spot.expchroma = expchroma->getIntValue(); + spot.excurve = shapeexpos->getCurve(); + spot.strexp = strexp->getValue(); + spot.angexp = angexp->getValue(); + spot.softradiusexp = softradiusexp->getValue(); + spot.inversex = inversex->get_active(); + spot.enaExpMask = enaExpMask->get_active(); + spot.enaExpMaskaft = enaExpMaskaft->get_active(); + spot.CCmaskexpcurve = CCmaskexpshape->getCurve(); + spot.LLmaskexpcurve = LLmaskexpshape->getCurve(); + spot.HHmaskexpcurve = HHmaskexpshape->getCurve(); + spot.blendmaskexp = blendmaskexp->getIntValue(); + spot.radmaskexp = radmaskexp->getValue(); + spot.lapmaskexp = lapmaskexp->getValue(); + spot.chromaskexp = chromaskexp->getValue(); + spot.gammaskexp = gammaskexp->getValue(); + spot.slomaskexp = slomaskexp->getValue(); + spot.strmaskexp = strmaskexp->getValue(); + spot.angmaskexp = angmaskexp->getValue(); + spot.Lmaskexpcurve = Lmaskexpshape->getCurve(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -2781,7 +2789,7 @@ void LocallabExposure::setDefaults(const rtengine::procparams::ProcParams* defPa const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default values for adjuster widgets laplacexp->setDefault(defSpot.laplacexp); @@ -3640,48 +3648,50 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); - exp->set_visible(pp->locallab.spots.at(index).visishadhigh); - exp->setEnabled(pp->locallab.spots.at(index).expshadhigh); - complexity->set_active(pp->locallab.spots.at(index).complexshadhigh); + spotName = spot.name; // Update spot name according to selected spot - if (pp->locallab.spots.at(index).shMethod == "std") { + exp->set_visible(spot.visishadhigh); + exp->setEnabled(spot.expshadhigh); + complexity->set_active(spot.complexshadhigh); + + if (spot.shMethod == "std") { shMethod->set_active(0); - } else if (pp->locallab.spots.at(index).shMethod == "tone") { + } else if (spot.shMethod == "tone") { shMethod->set_active(1); } for (int i = 0; i < 5; i++) { - multipliersh[i]->setValue((double)pp->locallab.spots.at(index).multsh[i]); - } - - detailSH->setValue((double)pp->locallab.spots.at(index).detailSH); - highlights->setValue((double)pp->locallab.spots.at(index).highlights); - h_tonalwidth->setValue((double)pp->locallab.spots.at(index).h_tonalwidth); - shadows->setValue(pp->locallab.spots.at(index).shadows); - s_tonalwidth->setValue((double)pp->locallab.spots.at(index).s_tonalwidth); - sh_radius->setValue((double)pp->locallab.spots.at(index).sh_radius); - sensihs->setValue((double)pp->locallab.spots.at(index).sensihs); - blurSHde->setValue((double)pp->locallab.spots.at(index).blurSHde); - gamSH->setValue(pp->locallab.spots.at(index).gamSH); - sloSH->setValue(pp->locallab.spots.at(index).sloSH); - strSH->setValue(pp->locallab.spots.at(index).strSH); - angSH->setValue(pp->locallab.spots.at(index).angSH); - inverssh->set_active(pp->locallab.spots.at(index).inverssh); - enaSHMask->set_active(pp->locallab.spots.at(index).enaSHMask); - CCmaskSHshape->setCurve(pp->locallab.spots.at(index).CCmaskSHcurve); - LLmaskSHshape->setCurve(pp->locallab.spots.at(index).LLmaskSHcurve); - HHmaskSHshape->setCurve(pp->locallab.spots.at(index).HHmaskSHcurve); - blendmaskSH->setValue((double)pp->locallab.spots.at(index).blendmaskSH); - radmaskSH->setValue(pp->locallab.spots.at(index).radmaskSH); - lapmaskSH->setValue(pp->locallab.spots.at(index).lapmaskSH); - chromaskSH->setValue(pp->locallab.spots.at(index).chromaskSH); - gammaskSH->setValue(pp->locallab.spots.at(index).gammaskSH); - slomaskSH->setValue(pp->locallab.spots.at(index).slomaskSH); - LmaskSHshape->setCurve(pp->locallab.spots.at(index).LmaskSHcurve); - fatamountSH->setValue(pp->locallab.spots.at(index).fatamountSH); - fatanchorSH->setValue(pp->locallab.spots.at(index).fatanchorSH); + multipliersh[i]->setValue((double)spot.multsh[i]); + } + + detailSH->setValue((double)spot.detailSH); + highlights->setValue((double)spot.highlights); + h_tonalwidth->setValue((double)spot.h_tonalwidth); + shadows->setValue(spot.shadows); + s_tonalwidth->setValue((double)spot.s_tonalwidth); + sh_radius->setValue((double)spot.sh_radius); + sensihs->setValue((double)spot.sensihs); + blurSHde->setValue((double)spot.blurSHde); + gamSH->setValue(spot.gamSH); + sloSH->setValue(spot.sloSH); + strSH->setValue(spot.strSH); + angSH->setValue(spot.angSH); + inverssh->set_active(spot.inverssh); + enaSHMask->set_active(spot.enaSHMask); + CCmaskSHshape->setCurve(spot.CCmaskSHcurve); + LLmaskSHshape->setCurve(spot.LLmaskSHcurve); + HHmaskSHshape->setCurve(spot.HHmaskSHcurve); + blendmaskSH->setValue((double)spot.blendmaskSH); + radmaskSH->setValue(spot.radmaskSH); + lapmaskSH->setValue(spot.lapmaskSH); + chromaskSH->setValue(spot.chromaskSH); + gammaskSH->setValue(spot.gammaskSH); + slomaskSH->setValue(spot.slomaskSH); + LmaskSHshape->setCurve(spot.LmaskSHcurve); + fatamountSH->setValue(spot.fatamountSH); + fatanchorSH->setValue(spot.fatanchorSH); } // Enable all listeners @@ -3704,46 +3714,48 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).expshadhigh = exp->getEnabled(); - pp->locallab.spots.at(index).visishadhigh = exp->get_visible(); - pp->locallab.spots.at(index).complexshadhigh = complexity->get_active_row_number(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.expshadhigh = exp->getEnabled(); + spot.visishadhigh = exp->get_visible(); + spot.complexshadhigh = complexity->get_active_row_number(); if (shMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).shMethod = "std"; + spot.shMethod = "std"; } else if (shMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).shMethod = "tone"; + spot.shMethod = "tone"; } for (int i = 0; i < 5; i++) { - pp->locallab.spots.at(index).multsh[i] = multipliersh[i]->getIntValue(); - } - - pp->locallab.spots.at(index).detailSH = detailSH->getIntValue(); - pp->locallab.spots.at(index).highlights = highlights->getIntValue(); - pp->locallab.spots.at(index).h_tonalwidth = h_tonalwidth->getIntValue(); - pp->locallab.spots.at(index).shadows = shadows->getIntValue(); - pp->locallab.spots.at(index).s_tonalwidth = s_tonalwidth->getIntValue(); - pp->locallab.spots.at(index).sh_radius = sh_radius->getIntValue(); - pp->locallab.spots.at(index).sensihs = sensihs->getIntValue(); - pp->locallab.spots.at(index).blurSHde = blurSHde->getIntValue(); - pp->locallab.spots.at(index).gamSH = gamSH->getValue(); - pp->locallab.spots.at(index).sloSH = sloSH->getValue(); - pp->locallab.spots.at(index).strSH = strSH->getValue(); - pp->locallab.spots.at(index).angSH = angSH->getValue(); - pp->locallab.spots.at(index).inverssh = inverssh->get_active(); - pp->locallab.spots.at(index).enaSHMask = enaSHMask->get_active(); - pp->locallab.spots.at(index).LLmaskSHcurve = LLmaskSHshape->getCurve(); - pp->locallab.spots.at(index).CCmaskSHcurve = CCmaskSHshape->getCurve(); - pp->locallab.spots.at(index).HHmaskSHcurve = HHmaskSHshape->getCurve(); - pp->locallab.spots.at(index).blendmaskSH = blendmaskSH->getIntValue(); - pp->locallab.spots.at(index).radmaskSH = radmaskSH->getValue(); - pp->locallab.spots.at(index).lapmaskSH = lapmaskSH->getValue(); - pp->locallab.spots.at(index).chromaskSH = chromaskSH->getValue(); - pp->locallab.spots.at(index).gammaskSH = gammaskSH->getValue(); - pp->locallab.spots.at(index).slomaskSH = slomaskSH->getValue(); - pp->locallab.spots.at(index).LmaskSHcurve = LmaskSHshape->getCurve(); - pp->locallab.spots.at(index).fatamountSH = fatamountSH->getValue(); - pp->locallab.spots.at(index).fatanchorSH = fatanchorSH->getValue(); + spot.multsh[i] = multipliersh[i]->getIntValue(); + } + + spot.detailSH = detailSH->getIntValue(); + spot.highlights = highlights->getIntValue(); + spot.h_tonalwidth = h_tonalwidth->getIntValue(); + spot.shadows = shadows->getIntValue(); + spot.s_tonalwidth = s_tonalwidth->getIntValue(); + spot.sh_radius = sh_radius->getIntValue(); + spot.sensihs = sensihs->getIntValue(); + spot.blurSHde = blurSHde->getIntValue(); + spot.gamSH = gamSH->getValue(); + spot.sloSH = sloSH->getValue(); + spot.strSH = strSH->getValue(); + spot.angSH = angSH->getValue(); + spot.inverssh = inverssh->get_active(); + spot.enaSHMask = enaSHMask->get_active(); + spot.LLmaskSHcurve = LLmaskSHshape->getCurve(); + spot.CCmaskSHcurve = CCmaskSHshape->getCurve(); + spot.HHmaskSHcurve = HHmaskSHshape->getCurve(); + spot.blendmaskSH = blendmaskSH->getIntValue(); + spot.radmaskSH = radmaskSH->getValue(); + spot.lapmaskSH = lapmaskSH->getValue(); + spot.chromaskSH = chromaskSH->getValue(); + spot.gammaskSH = gammaskSH->getValue(); + spot.slomaskSH = slomaskSH->getValue(); + spot.LmaskSHcurve = LmaskSHshape->getCurve(); + spot.fatamountSH = fatamountSH->getValue(); + spot.fatanchorSH = fatanchorSH->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -3754,7 +3766,7 @@ void LocallabShadow::setDefaults(const rtengine::procparams::ProcParams* defPara const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default values for adjuster widgets for (int i = 0; i < 5; i++) { @@ -4478,36 +4490,38 @@ void LocallabVibrance::read(const rtengine::procparams::ProcParams* pp, const Pa const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot - - exp->set_visible(pp->locallab.spots.at(index).visivibrance); - exp->setEnabled(pp->locallab.spots.at(index).expvibrance); - complexity->set_active(pp->locallab.spots.at(index).complexvibrance); - - saturated->setValue(pp->locallab.spots.at(index).saturated); - pastels->setValue(pp->locallab.spots.at(index).pastels); - warm->setValue(pp->locallab.spots.at(index).warm); - psThreshold->setValue(pp->locallab.spots.at(index).psthreshold); - protectSkins->set_active(pp->locallab.spots.at(index).protectskins); - avoidColorShift->set_active(pp->locallab.spots.at(index).avoidcolorshift); - pastSatTog->set_active(pp->locallab.spots.at(index).pastsattog); - sensiv->setValue(pp->locallab.spots.at(index).sensiv); - skinTonesCurve->setCurve(pp->locallab.spots.at(index).skintonescurve); - strvib->setValue(pp->locallab.spots.at(index).strvib); - strvibab->setValue(pp->locallab.spots.at(index).strvibab); - strvibh->setValue(pp->locallab.spots.at(index).strvibh); - angvib->setValue(pp->locallab.spots.at(index).angvib); - enavibMask->set_active(pp->locallab.spots.at(index).enavibMask); - CCmaskvibshape->setCurve(pp->locallab.spots.at(index).CCmaskvibcurve); - LLmaskvibshape->setCurve(pp->locallab.spots.at(index).LLmaskvibcurve); - HHmaskvibshape->setCurve(pp->locallab.spots.at(index).HHmaskvibcurve); - blendmaskvib->setValue(pp->locallab.spots.at(index).blendmaskvib); - radmaskvib->setValue(pp->locallab.spots.at(index).radmaskvib); - lapmaskvib->setValue(pp->locallab.spots.at(index).lapmaskvib); - chromaskvib->setValue(pp->locallab.spots.at(index).chromaskvib); - gammaskvib->setValue(pp->locallab.spots.at(index).gammaskvib); - slomaskvib->setValue(pp->locallab.spots.at(index).slomaskvib); - Lmaskvibshape->setCurve(pp->locallab.spots.at(index).Lmaskvibcurve); + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spotName = spot.name; // Update spot name according to selected spot + + exp->set_visible(spot.visivibrance); + exp->setEnabled(spot.expvibrance); + complexity->set_active(spot.complexvibrance); + + saturated->setValue(spot.saturated); + pastels->setValue(spot.pastels); + warm->setValue(spot.warm); + psThreshold->setValue(spot.psthreshold); + protectSkins->set_active(spot.protectskins); + avoidColorShift->set_active(spot.avoidcolorshift); + pastSatTog->set_active(spot.pastsattog); + sensiv->setValue(spot.sensiv); + skinTonesCurve->setCurve(spot.skintonescurve); + strvib->setValue(spot.strvib); + strvibab->setValue(spot.strvibab); + strvibh->setValue(spot.strvibh); + angvib->setValue(spot.angvib); + enavibMask->set_active(spot.enavibMask); + CCmaskvibshape->setCurve(spot.CCmaskvibcurve); + LLmaskvibshape->setCurve(spot.LLmaskvibcurve); + HHmaskvibshape->setCurve(spot.HHmaskvibcurve); + blendmaskvib->setValue(spot.blendmaskvib); + radmaskvib->setValue(spot.radmaskvib); + lapmaskvib->setValue(spot.lapmaskvib); + chromaskvib->setValue(spot.chromaskvib); + gammaskvib->setValue(spot.gammaskvib); + slomaskvib->setValue(spot.slomaskvib); + Lmaskvibshape->setCurve(spot.Lmaskvibcurve); } // Enable all listeners @@ -4527,34 +4541,36 @@ void LocallabVibrance::write(rtengine::procparams::ProcParams* pp, ParamsEdited* const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).expvibrance = exp->getEnabled(); - pp->locallab.spots.at(index).visivibrance = exp->get_visible(); - pp->locallab.spots.at(index).complexvibrance = complexity->get_active_row_number(); - - pp->locallab.spots.at(index).saturated = saturated->getIntValue(); - pp->locallab.spots.at(index).pastels = pastels->getIntValue(); - pp->locallab.spots.at(index).warm = warm->getIntValue(); - pp->locallab.spots.at(index).psthreshold = psThreshold->getValue(); - pp->locallab.spots.at(index).protectskins = protectSkins->get_active(); - pp->locallab.spots.at(index).avoidcolorshift = avoidColorShift->get_active(); - pp->locallab.spots.at(index).pastsattog = pastSatTog->get_active(); - pp->locallab.spots.at(index).sensiv = sensiv->getIntValue(); - pp->locallab.spots.at(index).skintonescurve = skinTonesCurve->getCurve(); - pp->locallab.spots.at(index).strvib = strvib->getValue(); - pp->locallab.spots.at(index).strvibab = strvibab->getValue(); - pp->locallab.spots.at(index).strvibh = strvibh->getValue(); - pp->locallab.spots.at(index).angvib = angvib->getValue(); - pp->locallab.spots.at(index).enavibMask = enavibMask->get_active(); - pp->locallab.spots.at(index).CCmaskvibcurve = CCmaskvibshape->getCurve(); - pp->locallab.spots.at(index).LLmaskvibcurve = LLmaskvibshape->getCurve(); - pp->locallab.spots.at(index).HHmaskvibcurve = HHmaskvibshape->getCurve(); - pp->locallab.spots.at(index).blendmaskvib = blendmaskvib->getIntValue(); - pp->locallab.spots.at(index).radmaskvib = radmaskvib->getValue(); - pp->locallab.spots.at(index).lapmaskvib = lapmaskvib->getValue(); - pp->locallab.spots.at(index).chromaskvib = chromaskvib->getValue(); - pp->locallab.spots.at(index).gammaskvib = gammaskvib->getValue(); - pp->locallab.spots.at(index).slomaskvib = slomaskvib->getValue(); - pp->locallab.spots.at(index).Lmaskvibcurve = Lmaskvibshape->getCurve(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.expvibrance = exp->getEnabled(); + spot.visivibrance = exp->get_visible(); + spot.complexvibrance = complexity->get_active_row_number(); + + spot.saturated = saturated->getIntValue(); + spot.pastels = pastels->getIntValue(); + spot.warm = warm->getIntValue(); + spot.psthreshold = psThreshold->getValue(); + spot.protectskins = protectSkins->get_active(); + spot.avoidcolorshift = avoidColorShift->get_active(); + spot.pastsattog = pastSatTog->get_active(); + spot.sensiv = sensiv->getIntValue(); + spot.skintonescurve = skinTonesCurve->getCurve(); + spot.strvib = strvib->getValue(); + spot.strvibab = strvibab->getValue(); + spot.strvibh = strvibh->getValue(); + spot.angvib = angvib->getValue(); + spot.enavibMask = enavibMask->get_active(); + spot.CCmaskvibcurve = CCmaskvibshape->getCurve(); + spot.LLmaskvibcurve = LLmaskvibshape->getCurve(); + spot.HHmaskvibcurve = HHmaskvibshape->getCurve(); + spot.blendmaskvib = blendmaskvib->getIntValue(); + spot.radmaskvib = radmaskvib->getValue(); + spot.lapmaskvib = lapmaskvib->getValue(); + spot.chromaskvib = chromaskvib->getValue(); + spot.gammaskvib = gammaskvib->getValue(); + spot.slomaskvib = slomaskvib->getValue(); + spot.Lmaskvibcurve = Lmaskvibshape->getCurve(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -4565,7 +4581,7 @@ void LocallabVibrance::setDefaults(const rtengine::procparams::ProcParams* defPa const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default values for adjuster and threshold adjuster widgets saturated->setDefault((double)defSpot.saturated); @@ -5070,21 +5086,23 @@ void LocallabSoft::read(const rtengine::procparams::ProcParams* pp, const Params const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); - exp->set_visible(pp->locallab.spots.at(index).visisoft); - exp->setEnabled(pp->locallab.spots.at(index).expsoft); - complexity->set_active(pp->locallab.spots.at(index).complexsoft); + spotName = spot.name; // Update spot name according to selected spot - if (pp->locallab.spots.at(index).softMethod == "soft") { + exp->set_visible(spot.visisoft); + exp->setEnabled(spot.expsoft); + complexity->set_active(spot.complexsoft); + + if (spot.softMethod == "soft") { softMethod->set_active(0); - } else if (pp->locallab.spots.at(index).softMethod == "reti") { + } else if (spot.softMethod == "reti") { softMethod->set_active(1); } - streng->setValue((double)pp->locallab.spots.at(index).streng); - sensisf->setValue((double)pp->locallab.spots.at(index).sensisf); - laplace->setValue(pp->locallab.spots.at(index).laplace); + streng->setValue((double)spot.streng); + sensisf->setValue((double)spot.sensisf); + laplace->setValue(spot.laplace); } // Enable all listeners @@ -5104,19 +5122,21 @@ void LocallabSoft::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).expsoft = exp->getEnabled(); - pp->locallab.spots.at(index).visisoft = exp->get_visible(); - pp->locallab.spots.at(index).complexsoft = complexity->get_active_row_number(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.expsoft = exp->getEnabled(); + spot.visisoft = exp->get_visible(); + spot.complexsoft = complexity->get_active_row_number(); if (softMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).softMethod = "soft"; + spot.softMethod = "soft"; } else if (softMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).softMethod = "reti"; + spot.softMethod = "reti"; } - pp->locallab.spots.at(index).streng = streng->getIntValue(); - pp->locallab.spots.at(index).sensisf = sensisf->getIntValue(); - pp->locallab.spots.at(index).laplace = laplace->getValue(); + spot.streng = streng->getIntValue(); + spot.sensisf = sensisf->getIntValue(); + spot.laplace = laplace->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -5127,7 +5147,7 @@ void LocallabSoft::setDefaults(const rtengine::procparams::ProcParams* defParams const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default value for adjuster widgets streng->setDefault((double)defSpot.streng); @@ -5690,90 +5710,92 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); - exp->set_visible(pp->locallab.spots.at(index).visiblur); - exp->setEnabled(pp->locallab.spots.at(index).expblur); - complexity->set_active(pp->locallab.spots.at(index).complexblur); + spotName = spot.name; // Update spot name according to selected spot - if (pp->locallab.spots.at(index).blMethod == "blur") { + exp->set_visible(spot.visiblur); + exp->setEnabled(spot.expblur); + complexity->set_active(spot.complexblur); + + if (spot.blMethod == "blur") { blMethod->set_active(0); - } else if (pp->locallab.spots.at(index).blMethod == "med") { + } else if (spot.blMethod == "med") { blMethod->set_active(1); - } else if (pp->locallab.spots.at(index).blMethod == "guid") { + } else if (spot.blMethod == "guid") { blMethod->set_active(2); } - fftwbl->set_active(pp->locallab.spots.at(index).fftwbl); - radius->setValue(pp->locallab.spots.at(index).radius); - strength->setValue(pp->locallab.spots.at(index).strength); - isogr->setValue((double)pp->locallab.spots.at(index).isogr); - strengr->setValue((double)pp->locallab.spots.at(index).strengr); - scalegr->setValue((double)pp->locallab.spots.at(index).scalegr); + fftwbl->set_active(spot.fftwbl); + radius->setValue(spot.radius); + strength->setValue(spot.strength); + isogr->setValue((double)spot.isogr); + strengr->setValue((double)spot.strengr); + scalegr->setValue((double)spot.scalegr); - if (pp->locallab.spots.at(index).medMethod == "none") { + if (spot.medMethod == "none") { medMethod->set_active(0); - } else if (pp->locallab.spots.at(index).medMethod == "33") { + } else if (spot.medMethod == "33") { medMethod->set_active(1); - } else if (pp->locallab.spots.at(index).medMethod == "55") { + } else if (spot.medMethod == "55") { medMethod->set_active(2); - } else if (pp->locallab.spots.at(index).medMethod == "77") { + } else if (spot.medMethod == "77") { medMethod->set_active(3); - } else if (pp->locallab.spots.at(index).medMethod == "99") { + } else if (spot.medMethod == "99") { medMethod->set_active(4); } - itera->setValue((double)pp->locallab.spots.at(index).itera); - guidbl->setValue((double)pp->locallab.spots.at(index).guidbl); - strbl->setValue((double)pp->locallab.spots.at(index).strbl); - epsbl->setValue((double)pp->locallab.spots.at(index).epsbl); - sensibn->setValue((double)pp->locallab.spots.at(index).sensibn); + itera->setValue((double)spot.itera); + guidbl->setValue((double)spot.guidbl); + strbl->setValue((double)spot.strbl); + epsbl->setValue((double)spot.epsbl); + sensibn->setValue((double)spot.sensibn); - if (pp->locallab.spots.at(index).blurMethod == "norm") { + if (spot.blurMethod == "norm") { blurMethod->set_active(0); - } else if (pp->locallab.spots.at(index).blurMethod == "inv") { + } else if (spot.blurMethod == "inv") { blurMethod->set_active(1); } - if (pp->locallab.spots.at(index).chroMethod == "lum") { + if (spot.chroMethod == "lum") { chroMethod->set_active(0); - } else if (pp->locallab.spots.at(index).chroMethod == "chr") { + } else if (spot.chroMethod == "chr") { chroMethod->set_active(1); - } else if (pp->locallab.spots.at(index).chroMethod == "all") { + } else if (spot.chroMethod == "all") { chroMethod->set_active(2); } - activlum->set_active(pp->locallab.spots.at(index).activlum); - wavshapeden->setCurve(pp->locallab.spots.at(index).locwavcurveden); - noiselumf0->setValue(pp->locallab.spots.at(index).noiselumf0); - noiselumf->setValue(pp->locallab.spots.at(index).noiselumf); - noiselumf2->setValue(pp->locallab.spots.at(index).noiselumf2); - noiselumc->setValue(pp->locallab.spots.at(index).noiselumc); - noiselumdetail->setValue(pp->locallab.spots.at(index).noiselumdetail); - noiselequal->setValue((double)pp->locallab.spots.at(index).noiselequal); - noisechrof->setValue(pp->locallab.spots.at(index).noisechrof); - noisechroc->setValue(pp->locallab.spots.at(index).noisechroc); - noisechrodetail->setValue(pp->locallab.spots.at(index).noisechrodetail); - detailthr->setValue((double)pp->locallab.spots.at(index).detailthr); - adjblur->setValue((double)pp->locallab.spots.at(index).adjblur); - bilateral->setValue((double)pp->locallab.spots.at(index).bilateral); - sensiden->setValue((double)pp->locallab.spots.at(index).sensiden); - enablMask->set_active(pp->locallab.spots.at(index).enablMask); - CCmaskblshape->setCurve(pp->locallab.spots.at(index).CCmaskblcurve); - LLmaskblshape->setCurve(pp->locallab.spots.at(index).LLmaskblcurve); - HHmaskblshape->setCurve(pp->locallab.spots.at(index).HHmaskblcurve); - strumaskbl->setValue(pp->locallab.spots.at(index).strumaskbl); - toolbl->set_active(pp->locallab.spots.at(index).toolbl); - blendmaskbl->setValue((double)pp->locallab.spots.at(index).blendmaskbl); - radmaskbl->setValue(pp->locallab.spots.at(index).radmaskbl); - lapmaskbl->setValue(pp->locallab.spots.at(index).lapmaskbl); - chromaskbl->setValue(pp->locallab.spots.at(index).chromaskbl); - gammaskbl->setValue(pp->locallab.spots.at(index).gammaskbl); - slomaskbl->setValue(pp->locallab.spots.at(index).slomaskbl); - shadmaskbl->setValue((double)pp->locallab.spots.at(index).shadmaskbl); - Lmaskblshape->setCurve(pp->locallab.spots.at(index).Lmaskblcurve); - LLmaskblshapewav->setCurve(pp->locallab.spots.at(index).LLmaskblcurvewav); - csThresholdblur->setValue(pp->locallab.spots.at(index).csthresholdblur); + activlum->set_active(spot.activlum); + wavshapeden->setCurve(spot.locwavcurveden); + noiselumf0->setValue(spot.noiselumf0); + noiselumf->setValue(spot.noiselumf); + noiselumf2->setValue(spot.noiselumf2); + noiselumc->setValue(spot.noiselumc); + noiselumdetail->setValue(spot.noiselumdetail); + noiselequal->setValue((double)spot.noiselequal); + noisechrof->setValue(spot.noisechrof); + noisechroc->setValue(spot.noisechroc); + noisechrodetail->setValue(spot.noisechrodetail); + detailthr->setValue((double)spot.detailthr); + adjblur->setValue((double)spot.adjblur); + bilateral->setValue((double)spot.bilateral); + sensiden->setValue((double)spot.sensiden); + enablMask->set_active(spot.enablMask); + CCmaskblshape->setCurve(spot.CCmaskblcurve); + LLmaskblshape->setCurve(spot.LLmaskblcurve); + HHmaskblshape->setCurve(spot.HHmaskblcurve); + strumaskbl->setValue(spot.strumaskbl); + toolbl->set_active(spot.toolbl); + blendmaskbl->setValue((double)spot.blendmaskbl); + radmaskbl->setValue(spot.radmaskbl); + lapmaskbl->setValue(spot.lapmaskbl); + chromaskbl->setValue(spot.chromaskbl); + gammaskbl->setValue(spot.gammaskbl); + slomaskbl->setValue(spot.slomaskbl); + shadmaskbl->setValue((double)spot.shadmaskbl); + Lmaskblshape->setCurve(spot.Lmaskblcurve); + LLmaskblshapewav->setCurve(spot.LLmaskblcurvewav); + csThresholdblur->setValue(spot.csthresholdblur); } // Enable all listeners @@ -5793,88 +5815,90 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).expblur = exp->getEnabled(); - pp->locallab.spots.at(index).visiblur = exp->get_visible(); - pp->locallab.spots.at(index).complexblur = complexity->get_active_row_number(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.expblur = exp->getEnabled(); + spot.visiblur = exp->get_visible(); + spot.complexblur = complexity->get_active_row_number(); if (blMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).blMethod = "blur"; + spot.blMethod = "blur"; } else if (blMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).blMethod = "med"; + spot.blMethod = "med"; } else if (blMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(index).blMethod = "guid"; + spot.blMethod = "guid"; } - pp->locallab.spots.at(index).fftwbl = fftwbl->get_active(); - pp->locallab.spots.at(index).radius = radius->getValue(); - pp->locallab.spots.at(index).strength = strength->getIntValue(); - pp->locallab.spots.at(index).isogr = isogr->getIntValue(); - pp->locallab.spots.at(index).strengr = strengr->getIntValue(); - pp->locallab.spots.at(index).scalegr = scalegr->getIntValue(); + spot.fftwbl = fftwbl->get_active(); + spot.radius = radius->getValue(); + spot.strength = strength->getIntValue(); + spot.isogr = isogr->getIntValue(); + spot.strengr = strengr->getIntValue(); + spot.scalegr = scalegr->getIntValue(); if (medMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).medMethod = "none"; + spot.medMethod = "none"; } else if (medMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).medMethod = "33"; + spot.medMethod = "33"; } else if (medMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(index).medMethod = "55"; + spot.medMethod = "55"; } else if (medMethod->get_active_row_number() == 3) { - pp->locallab.spots.at(index).medMethod = "77"; + spot.medMethod = "77"; } else if (medMethod->get_active_row_number() == 4) { - pp->locallab.spots.at(index).medMethod = "99"; + spot.medMethod = "99"; } - pp->locallab.spots.at(index).itera = itera->getIntValue(); - pp->locallab.spots.at(index).guidbl = guidbl->getIntValue(); - pp->locallab.spots.at(index).strbl = strbl->getIntValue(); - pp->locallab.spots.at(index).epsbl = epsbl->getIntValue(); - pp->locallab.spots.at(index).sensibn = sensibn->getIntValue(); + spot.itera = itera->getIntValue(); + spot.guidbl = guidbl->getIntValue(); + spot.strbl = strbl->getIntValue(); + spot.epsbl = epsbl->getIntValue(); + spot.sensibn = sensibn->getIntValue(); if (blurMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).blurMethod = "norm"; + spot.blurMethod = "norm"; } else if (blurMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).blurMethod = "inv"; + spot.blurMethod = "inv"; } if (chroMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).chroMethod = "lum"; + spot.chroMethod = "lum"; } else if (chroMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).chroMethod = "chr"; + spot.chroMethod = "chr"; } else if (chroMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(index).chroMethod = "all"; - } - - pp->locallab.spots.at(index).activlum = activlum->get_active(); - pp->locallab.spots.at(index).locwavcurveden = wavshapeden->getCurve(); - pp->locallab.spots.at(index).noiselumf0 = noiselumf0->getValue(); - pp->locallab.spots.at(index).noiselumf = noiselumf->getValue(); - pp->locallab.spots.at(index).noiselumf2 = noiselumf2->getValue(); - pp->locallab.spots.at(index).noiselumc = noiselumc->getValue(); - pp->locallab.spots.at(index).noiselumdetail = noiselumdetail->getValue(); - pp->locallab.spots.at(index).noiselequal = noiselequal->getIntValue(); - pp->locallab.spots.at(index).noisechrof = noisechrof->getValue(); - pp->locallab.spots.at(index).noisechroc = noisechroc->getValue(); - pp->locallab.spots.at(index).noisechrodetail = noisechrodetail->getValue(); - pp->locallab.spots.at(index).detailthr = detailthr->getIntValue(); - pp->locallab.spots.at(index).adjblur = adjblur->getIntValue(); - pp->locallab.spots.at(index).bilateral = bilateral->getIntValue(); - pp->locallab.spots.at(index).sensiden = sensiden->getIntValue(); - pp->locallab.spots.at(index).enablMask = enablMask->get_active(); - pp->locallab.spots.at(index).LLmaskblcurve = LLmaskblshape->getCurve(); - pp->locallab.spots.at(index).CCmaskblcurve = CCmaskblshape->getCurve(); - pp->locallab.spots.at(index).HHmaskblcurve = HHmaskblshape->getCurve(); - pp->locallab.spots.at(index).strumaskbl = strumaskbl->getValue(); - pp->locallab.spots.at(index).toolbl = toolbl->get_active(); - pp->locallab.spots.at(index).blendmaskbl = blendmaskbl->getIntValue(); - pp->locallab.spots.at(index).radmaskbl = radmaskbl->getValue(); - pp->locallab.spots.at(index).lapmaskbl = lapmaskbl->getValue(); - pp->locallab.spots.at(index).chromaskbl = chromaskbl->getValue(); - pp->locallab.spots.at(index).gammaskbl = gammaskbl->getValue(); - pp->locallab.spots.at(index).slomaskbl = slomaskbl->getValue(); - pp->locallab.spots.at(index).shadmaskbl = shadmaskbl->getIntValue(); - pp->locallab.spots.at(index).Lmaskblcurve = Lmaskblshape->getCurve(); - pp->locallab.spots.at(index).LLmaskblcurvewav = LLmaskblshapewav->getCurve(); - pp->locallab.spots.at(index).csthresholdblur = csThresholdblur->getValue(); + spot.chroMethod = "all"; + } + + spot.activlum = activlum->get_active(); + spot.locwavcurveden = wavshapeden->getCurve(); + spot.noiselumf0 = noiselumf0->getValue(); + spot.noiselumf = noiselumf->getValue(); + spot.noiselumf2 = noiselumf2->getValue(); + spot.noiselumc = noiselumc->getValue(); + spot.noiselumdetail = noiselumdetail->getValue(); + spot.noiselequal = noiselequal->getIntValue(); + spot.noisechrof = noisechrof->getValue(); + spot.noisechroc = noisechroc->getValue(); + spot.noisechrodetail = noisechrodetail->getValue(); + spot.detailthr = detailthr->getIntValue(); + spot.adjblur = adjblur->getIntValue(); + spot.bilateral = bilateral->getIntValue(); + spot.sensiden = sensiden->getIntValue(); + spot.enablMask = enablMask->get_active(); + spot.LLmaskblcurve = LLmaskblshape->getCurve(); + spot.CCmaskblcurve = CCmaskblshape->getCurve(); + spot.HHmaskblcurve = HHmaskblshape->getCurve(); + spot.strumaskbl = strumaskbl->getValue(); + spot.toolbl = toolbl->get_active(); + spot.blendmaskbl = blendmaskbl->getIntValue(); + spot.radmaskbl = radmaskbl->getValue(); + spot.lapmaskbl = lapmaskbl->getValue(); + spot.chromaskbl = chromaskbl->getValue(); + spot.gammaskbl = gammaskbl->getValue(); + spot.slomaskbl = slomaskbl->getValue(); + spot.shadmaskbl = shadmaskbl->getIntValue(); + spot.Lmaskblcurve = Lmaskblshape->getCurve(); + spot.LLmaskblcurvewav = LLmaskblshapewav->getCurve(); + spot.csthresholdblur = csThresholdblur->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -5885,7 +5909,7 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default value for adjuster and threshold adjuster widgets radius->setDefault(defSpot.radius); diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 2553336def..34c5b3acd5 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -354,34 +354,36 @@ void LocallabTone::read(const rtengine::procparams::ProcParams* pp, const Params const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot - - exp->set_visible(pp->locallab.spots.at(index).visitonemap); - exp->setEnabled(pp->locallab.spots.at(index).exptonemap); - complexity->set_active(pp->locallab.spots.at(index).complextonemap); - - amount->setValue(pp->locallab.spots.at(index).amount); - stren->setValue(pp->locallab.spots.at(index).stren); - equiltm->set_active(pp->locallab.spots.at(index).equiltm); - gamma->setValue(pp->locallab.spots.at(index).gamma); - satur->setValue(pp->locallab.spots.at(index).satur); - estop->setValue(pp->locallab.spots.at(index).estop); - scaltm->setValue(pp->locallab.spots.at(index).scaltm); - rewei->setValue((double)pp->locallab.spots.at(index).rewei); - softradiustm->setValue(pp->locallab.spots.at(index).softradiustm); - sensitm->setValue((double)pp->locallab.spots.at(index).sensitm); - enatmMask->set_active(pp->locallab.spots.at(index).enatmMask); - enatmMaskaft->set_active(pp->locallab.spots.at(index).enatmMaskaft); - CCmasktmshape->setCurve(pp->locallab.spots.at(index).CCmasktmcurve); - LLmasktmshape->setCurve(pp->locallab.spots.at(index).LLmasktmcurve); - HHmasktmshape->setCurve(pp->locallab.spots.at(index).HHmasktmcurve); - blendmasktm->setValue((double)pp->locallab.spots.at(index).blendmasktm); - lapmasktm->setValue(pp->locallab.spots.at(index).lapmasktm); - radmasktm->setValue(pp->locallab.spots.at(index).radmasktm); - chromasktm->setValue(pp->locallab.spots.at(index).chromasktm); - gammasktm->setValue(pp->locallab.spots.at(index).gammasktm); - slomasktm->setValue(pp->locallab.spots.at(index).slomasktm); - Lmasktmshape->setCurve(pp->locallab.spots.at(index).Lmasktmcurve); + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spotName = spot.name; // Update spot name according to selected spot + + exp->set_visible(spot.visitonemap); + exp->setEnabled(spot.exptonemap); + complexity->set_active(spot.complextonemap); + + amount->setValue(spot.amount); + stren->setValue(spot.stren); + equiltm->set_active(spot.equiltm); + gamma->setValue(spot.gamma); + satur->setValue(spot.satur); + estop->setValue(spot.estop); + scaltm->setValue(spot.scaltm); + rewei->setValue((double)spot.rewei); + softradiustm->setValue(spot.softradiustm); + sensitm->setValue((double)spot.sensitm); + enatmMask->set_active(spot.enatmMask); + enatmMaskaft->set_active(spot.enatmMaskaft); + CCmasktmshape->setCurve(spot.CCmasktmcurve); + LLmasktmshape->setCurve(spot.LLmasktmcurve); + HHmasktmshape->setCurve(spot.HHmasktmcurve); + blendmasktm->setValue((double)spot.blendmasktm); + lapmasktm->setValue(spot.lapmasktm); + radmasktm->setValue(spot.radmasktm); + chromasktm->setValue(spot.chromasktm); + gammasktm->setValue(spot.gammasktm); + slomasktm->setValue(spot.slomasktm); + Lmasktmshape->setCurve(spot.Lmasktmcurve); } // Enable all listeners @@ -398,32 +400,34 @@ void LocallabTone::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).exptonemap = exp->getEnabled(); - pp->locallab.spots.at(index).visitonemap = exp->get_visible(); - pp->locallab.spots.at(index).complextonemap = complexity->get_active_row_number(); - - pp->locallab.spots.at(index).amount = amount->getValue(); - pp->locallab.spots.at(index).stren = stren->getValue(); - pp->locallab.spots.at(index).equiltm = equiltm->get_active(); - pp->locallab.spots.at(index).gamma = gamma->getValue(); - pp->locallab.spots.at(index).satur = satur->getValue(); - pp->locallab.spots.at(index).estop = estop->getValue(); - pp->locallab.spots.at(index).scaltm = scaltm->getValue(); - pp->locallab.spots.at(index).rewei = rewei->getIntValue(); - pp->locallab.spots.at(index).softradiustm = softradiustm->getValue(); - pp->locallab.spots.at(index).sensitm = sensitm->getIntValue(); - pp->locallab.spots.at(index).enatmMask = enatmMask->get_active(); - pp->locallab.spots.at(index).enatmMaskaft = enatmMaskaft->get_active(); - pp->locallab.spots.at(index).LLmasktmcurve = LLmasktmshape->getCurve(); - pp->locallab.spots.at(index).CCmasktmcurve = CCmasktmshape->getCurve(); - pp->locallab.spots.at(index).HHmasktmcurve = HHmasktmshape->getCurve(); - pp->locallab.spots.at(index).blendmasktm = blendmasktm->getIntValue(); - pp->locallab.spots.at(index).lapmasktm = lapmasktm->getValue(); - pp->locallab.spots.at(index).radmasktm = radmasktm->getValue(); - pp->locallab.spots.at(index).chromasktm = chromasktm->getValue(); - pp->locallab.spots.at(index).gammasktm = gammasktm->getValue(); - pp->locallab.spots.at(index).slomasktm = slomasktm->getValue(); - pp->locallab.spots.at(index).Lmasktmcurve = Lmasktmshape->getCurve(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.exptonemap = exp->getEnabled(); + spot.visitonemap = exp->get_visible(); + spot.complextonemap = complexity->get_active_row_number(); + + spot.amount = amount->getValue(); + spot.stren = stren->getValue(); + spot.equiltm = equiltm->get_active(); + spot.gamma = gamma->getValue(); + spot.satur = satur->getValue(); + spot.estop = estop->getValue(); + spot.scaltm = scaltm->getValue(); + spot.rewei = rewei->getIntValue(); + spot.softradiustm = softradiustm->getValue(); + spot.sensitm = sensitm->getIntValue(); + spot.enatmMask = enatmMask->get_active(); + spot.enatmMaskaft = enatmMaskaft->get_active(); + spot.LLmasktmcurve = LLmasktmshape->getCurve(); + spot.CCmasktmcurve = CCmasktmshape->getCurve(); + spot.HHmasktmcurve = HHmasktmshape->getCurve(); + spot.blendmasktm = blendmasktm->getIntValue(); + spot.lapmasktm = lapmasktm->getValue(); + spot.radmasktm = radmasktm->getValue(); + spot.chromasktm = chromasktm->getValue(); + spot.gammasktm = gammasktm->getValue(); + spot.slomasktm = slomasktm->getValue(); + spot.Lmasktmcurve = Lmasktmshape->getCurve(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -434,7 +438,7 @@ void LocallabTone::setDefaults(const rtengine::procparams::ProcParams* defParams const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default values for adjuster widgets amount->setDefault(defSpot.amount); @@ -1148,54 +1152,56 @@ void LocallabRetinex::read(const rtengine::procparams::ProcParams* pp, const Par const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); - exp->set_visible(pp->locallab.spots.at(index).visireti); - exp->setEnabled(pp->locallab.spots.at(index).expreti); - complexity->set_active(pp->locallab.spots.at(index).complexreti); + spotName = spot.name; // Update spot name according to selected spot - dehaz->setValue((double)pp->locallab.spots.at(index).dehaz); - depth->setValue((double)pp->locallab.spots.at(index).depth); - lumonly->set_active(pp->locallab.spots.at(index).lumonly); - str->setValue(pp->locallab.spots.at(index).str); - loglin->set_active(pp->locallab.spots.at(index).loglin); - sensih->setValue((double)pp->locallab.spots.at(index).sensih); + exp->set_visible(spot.visireti); + exp->setEnabled(spot.expreti); + complexity->set_active(spot.complexreti); - if (pp->locallab.spots.at(index).retinexMethod == "low") { + dehaz->setValue((double)spot.dehaz); + depth->setValue((double)spot.depth); + lumonly->set_active(spot.lumonly); + str->setValue(spot.str); + loglin->set_active(spot.loglin); + sensih->setValue((double)spot.sensih); + + if (spot.retinexMethod == "low") { retinexMethod->set_active(0); - } else if (pp->locallab.spots.at(index).retinexMethod == "uni") { + } else if (spot.retinexMethod == "uni") { retinexMethod->set_active(1); } else { retinexMethod->set_active(2); } - fftwreti->set_active(pp->locallab.spots.at(index).fftwreti); - equilret->set_active(pp->locallab.spots.at(index).equilret); - neigh->setValue(pp->locallab.spots.at(index).neigh); - vart->setValue(pp->locallab.spots.at(index).vart); - scalereti->setValue(pp->locallab.spots.at(index).scalereti); - limd->setValue(pp->locallab.spots.at(index).limd); - offs->setValue(pp->locallab.spots.at(index).offs); - chrrt->setValue(pp->locallab.spots.at(index).chrrt); - darkness->setValue(pp->locallab.spots.at(index).darkness); - lightnessreti->setValue(pp->locallab.spots.at(index).lightnessreti); - cliptm->setValue(pp->locallab.spots.at(index).cliptm); - softradiusret->setValue(pp->locallab.spots.at(index).softradiusret); - cTtransshape->setCurve(pp->locallab.spots.at(index).localTtranscurve); - cTgainshape->setCurve(pp->locallab.spots.at(index).localTgaincurve); - enaretiMask->set_active(pp->locallab.spots.at(index).enaretiMask); - enaretiMasktmap->set_active(pp->locallab.spots.at(index).enaretiMasktmap); - CCmaskretishape->setCurve(pp->locallab.spots.at(index).CCmaskreticurve); - LLmaskretishape->setCurve(pp->locallab.spots.at(index).LLmaskreticurve); - HHmaskretishape->setCurve(pp->locallab.spots.at(index).HHmaskreticurve); - blendmaskreti->setValue((double)pp->locallab.spots.at(index).blendmaskreti); - radmaskreti->setValue(pp->locallab.spots.at(index).radmaskreti); - lapmaskreti->setValue(pp->locallab.spots.at(index).lapmaskreti); - chromaskreti->setValue(pp->locallab.spots.at(index).chromaskreti); - gammaskreti->setValue(pp->locallab.spots.at(index).gammaskreti); - slomaskreti->setValue(pp->locallab.spots.at(index).slomaskreti); - Lmaskretishape->setCurve(pp->locallab.spots.at(index).Lmaskreticurve); - inversret->set_active(pp->locallab.spots.at(index).inversret); + fftwreti->set_active(spot.fftwreti); + equilret->set_active(spot.equilret); + neigh->setValue(spot.neigh); + vart->setValue(spot.vart); + scalereti->setValue(spot.scalereti); + limd->setValue(spot.limd); + offs->setValue(spot.offs); + chrrt->setValue(spot.chrrt); + darkness->setValue(spot.darkness); + lightnessreti->setValue(spot.lightnessreti); + cliptm->setValue(spot.cliptm); + softradiusret->setValue(spot.softradiusret); + cTtransshape->setCurve(spot.localTtranscurve); + cTgainshape->setCurve(spot.localTgaincurve); + enaretiMask->set_active(spot.enaretiMask); + enaretiMasktmap->set_active(spot.enaretiMasktmap); + CCmaskretishape->setCurve(spot.CCmaskreticurve); + LLmaskretishape->setCurve(spot.LLmaskreticurve); + HHmaskretishape->setCurve(spot.HHmaskreticurve); + blendmaskreti->setValue((double)spot.blendmaskreti); + radmaskreti->setValue(spot.radmaskreti); + lapmaskreti->setValue(spot.lapmaskreti); + chromaskreti->setValue(spot.chromaskreti); + gammaskreti->setValue(spot.gammaskreti); + slomaskreti->setValue(spot.slomaskreti); + Lmaskretishape->setCurve(spot.Lmaskreticurve); + inversret->set_active(spot.inversret); } // Enable all listeners @@ -1221,52 +1227,54 @@ void LocallabRetinex::write(rtengine::procparams::ProcParams* pp, ParamsEdited* const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).expreti = exp->getEnabled(); - pp->locallab.spots.at(index).visireti = exp->get_visible(); - pp->locallab.spots.at(index).complexreti = complexity->get_active_row_number(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.expreti = exp->getEnabled(); + spot.visireti = exp->get_visible(); + spot.complexreti = complexity->get_active_row_number(); - pp->locallab.spots.at(index).dehaz = dehaz->getIntValue(); - pp->locallab.spots.at(index).depth = depth->getIntValue(); - pp->locallab.spots.at(index).lumonly = lumonly->get_active(); - pp->locallab.spots.at(index).str = str->getValue(); - pp->locallab.spots.at(index).loglin = loglin->get_active(); - pp->locallab.spots.at(index).sensih = sensih->getIntValue(); + spot.dehaz = dehaz->getIntValue(); + spot.depth = depth->getIntValue(); + spot.lumonly = lumonly->get_active(); + spot.str = str->getValue(); + spot.loglin = loglin->get_active(); + spot.sensih = sensih->getIntValue(); if (retinexMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).retinexMethod = "low"; + spot.retinexMethod = "low"; } else if (retinexMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).retinexMethod = "uni"; + spot.retinexMethod = "uni"; } else if (retinexMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(index).retinexMethod = "high"; - } - - pp->locallab.spots.at(index).fftwreti = fftwreti->get_active(); - pp->locallab.spots.at(index).equilret = equilret->get_active(); - pp->locallab.spots.at(index).neigh = neigh->getValue(); - pp->locallab.spots.at(index).vart = vart->getValue(); - pp->locallab.spots.at(index).scalereti = scalereti->getValue(); - pp->locallab.spots.at(index).limd = limd->getValue(); - pp->locallab.spots.at(index).offs = offs->getValue(); - pp->locallab.spots.at(index).chrrt = chrrt->getValue(); - pp->locallab.spots.at(index).darkness = darkness->getValue(); - pp->locallab.spots.at(index).lightnessreti = lightnessreti->getValue(); - pp->locallab.spots.at(index).cliptm = cliptm->getValue(); - pp->locallab.spots.at(index).softradiusret = softradiusret->getValue(); - pp->locallab.spots.at(index).localTtranscurve = cTtransshape->getCurve(); - pp->locallab.spots.at(index).localTgaincurve = cTgainshape->getCurve(); - pp->locallab.spots.at(index).enaretiMask = enaretiMask->get_active(); - pp->locallab.spots.at(index).enaretiMasktmap = enaretiMasktmap->get_active(); - pp->locallab.spots.at(index).CCmaskreticurve = CCmaskretishape->getCurve(); - pp->locallab.spots.at(index).LLmaskreticurve = LLmaskretishape->getCurve(); - pp->locallab.spots.at(index).HHmaskreticurve = HHmaskretishape->getCurve(); - pp->locallab.spots.at(index).blendmaskreti = blendmaskreti->getIntValue(); - pp->locallab.spots.at(index).radmaskreti = radmaskreti->getValue(); - pp->locallab.spots.at(index).lapmaskreti = lapmaskreti->getValue(); - pp->locallab.spots.at(index).chromaskreti = chromaskreti->getValue(); - pp->locallab.spots.at(index).gammaskreti = gammaskreti->getValue(); - pp->locallab.spots.at(index).slomaskreti = slomaskreti->getValue(); - pp->locallab.spots.at(index).Lmaskreticurve = Lmaskretishape->getCurve(); - pp->locallab.spots.at(index).inversret = inversret->get_active(); + spot.retinexMethod = "high"; + } + + spot.fftwreti = fftwreti->get_active(); + spot.equilret = equilret->get_active(); + spot.neigh = neigh->getValue(); + spot.vart = vart->getValue(); + spot.scalereti = scalereti->getValue(); + spot.limd = limd->getValue(); + spot.offs = offs->getValue(); + spot.chrrt = chrrt->getValue(); + spot.darkness = darkness->getValue(); + spot.lightnessreti = lightnessreti->getValue(); + spot.cliptm = cliptm->getValue(); + spot.softradiusret = softradiusret->getValue(); + spot.localTtranscurve = cTtransshape->getCurve(); + spot.localTgaincurve = cTgainshape->getCurve(); + spot.enaretiMask = enaretiMask->get_active(); + spot.enaretiMasktmap = enaretiMasktmap->get_active(); + spot.CCmaskreticurve = CCmaskretishape->getCurve(); + spot.LLmaskreticurve = LLmaskretishape->getCurve(); + spot.HHmaskreticurve = HHmaskretishape->getCurve(); + spot.blendmaskreti = blendmaskreti->getIntValue(); + spot.radmaskreti = radmaskreti->getValue(); + spot.lapmaskreti = lapmaskreti->getValue(); + spot.chromaskreti = chromaskreti->getValue(); + spot.gammaskreti = gammaskreti->getValue(); + spot.slomaskreti = slomaskreti->getValue(); + spot.Lmaskreticurve = Lmaskretishape->getCurve(); + spot.inversret = inversret->get_active(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -1277,7 +1285,7 @@ void LocallabRetinex::setDefaults(const rtengine::procparams::ProcParams* defPar const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default values for adjuster widgets dehaz->setDefault((double)defSpot.dehaz); @@ -1841,20 +1849,22 @@ void LocallabSharp::read(const rtengine::procparams::ProcParams* pp, const Param const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spotName = spot.name; // Update spot name according to selected spot - exp->set_visible(pp->locallab.spots.at(index).visisharp); - exp->setEnabled(pp->locallab.spots.at(index).expsharp); - complexity->set_active(pp->locallab.spots.at(index).complexsharp); + exp->set_visible(spot.visisharp); + exp->setEnabled(spot.expsharp); + complexity->set_active(spot.complexsharp); - sharcontrast->setValue((double)pp->locallab.spots.at(index).sharcontrast); - sharradius->setValue(pp->locallab.spots.at(index).sharradius); - sharamount->setValue((double)pp->locallab.spots.at(index).sharamount); - shardamping->setValue((double)pp->locallab.spots.at(index).shardamping); - shariter->setValue((double)pp->locallab.spots.at(index).shariter); - sharblur->setValue(pp->locallab.spots.at(index).sharblur); - sensisha->setValue((double)pp->locallab.spots.at(index).sensisha); - inverssha->set_active(pp->locallab.spots.at(index).inverssha); + sharcontrast->setValue((double)spot.sharcontrast); + sharradius->setValue(spot.sharradius); + sharamount->setValue((double)spot.sharamount); + shardamping->setValue((double)spot.shardamping); + shariter->setValue((double)spot.shariter); + sharblur->setValue(spot.sharblur); + sensisha->setValue((double)spot.sensisha); + inverssha->set_active(spot.inverssha); } // Enable all listeners @@ -1871,18 +1881,20 @@ void LocallabSharp::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).expsharp = exp->getEnabled(); - pp->locallab.spots.at(index).visisharp = exp->get_visible(); - pp->locallab.spots.at(index).complexsharp = complexity->get_active_row_number(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); - pp->locallab.spots.at(index).sharcontrast = sharcontrast->getIntValue(); - pp->locallab.spots.at(index).sharradius = sharradius->getValue(); - pp->locallab.spots.at(index).sharamount = sharamount->getIntValue(); - pp->locallab.spots.at(index).shardamping = shardamping->getIntValue(); - pp->locallab.spots.at(index).shariter = shariter->getIntValue(); - pp->locallab.spots.at(index).sharblur = sharblur->getValue(); - pp->locallab.spots.at(index).sensisha = sensisha->getIntValue(); - pp->locallab.spots.at(index).inverssha = inverssha->get_active(); + spot.expsharp = exp->getEnabled(); + spot.visisharp = exp->get_visible(); + spot.complexsharp = complexity->get_active_row_number(); + + spot.sharcontrast = sharcontrast->getIntValue(); + spot.sharradius = sharradius->getValue(); + spot.sharamount = sharamount->getIntValue(); + spot.shardamping = shardamping->getIntValue(); + spot.shariter = shariter->getIntValue(); + spot.sharblur = sharblur->getValue(); + spot.sensisha = sensisha->getIntValue(); + spot.inverssha = inverssha->get_active(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -1893,7 +1905,7 @@ void LocallabSharp::setDefaults(const rtengine::procparams::ProcParams* defParam const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default values for adjuster widgets sharcontrast->setDefault((double)defSpot.sharcontrast); @@ -2661,102 +2673,104 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spotName = spot.name; // Update spot name according to selected spot - exp->set_visible(pp->locallab.spots.at(index).visicontrast); - exp->setEnabled(pp->locallab.spots.at(index).expcontrast); - complexity->set_active(pp->locallab.spots.at(index).complexcontrast); + exp->set_visible(spot.visicontrast); + exp->setEnabled(spot.expcontrast); + complexity->set_active(spot.complexcontrast); - if (pp->locallab.spots.at(index).localcontMethod == "loc") { + if (spot.localcontMethod == "loc") { localcontMethod->set_active(0); - } else if (pp->locallab.spots.at(index).localcontMethod == "wav") { + } else if (spot.localcontMethod == "wav") { localcontMethod->set_active(1); } - lcradius->setValue((double)pp->locallab.spots.at(index).lcradius); - lcamount->setValue(pp->locallab.spots.at(index).lcamount); - lcdarkness->setValue(pp->locallab.spots.at(index).lcdarkness); - lclightness->setValue(pp->locallab.spots.at(index).lclightness); - sigmalc->setValue(pp->locallab.spots.at(index).sigmalc); - wavshape->setCurve(pp->locallab.spots.at(index).locwavcurve); - levelwav->setValue((double)pp->locallab.spots.at(index).levelwav); - csThreshold->setValue(pp->locallab.spots.at(index).csthreshold); - residcont->setValue(pp->locallab.spots.at(index).residcont); - residchro->setValue(pp->locallab.spots.at(index).residchro); - residsha->setValue(pp->locallab.spots.at(index).residsha); - residshathr->setValue(pp->locallab.spots.at(index).residshathr); - residhi->setValue(pp->locallab.spots.at(index).residhi); - residhithr->setValue(pp->locallab.spots.at(index).residhithr); - sensilc->setValue((double)pp->locallab.spots.at(index).sensilc); - clarilres->setValue(pp->locallab.spots.at(index).clarilres); - claricres->setValue(pp->locallab.spots.at(index).claricres); - clarisoft->setValue(pp->locallab.spots.at(index).clarisoft); - origlc->set_active(pp->locallab.spots.at(index).origlc); - wavgradl->set_active(pp->locallab.spots.at(index).wavgradl); - sigmalc2->setValue(pp->locallab.spots.at(index).sigmalc2); - strwav->setValue(pp->locallab.spots.at(index).strwav); - angwav->setValue(pp->locallab.spots.at(index).angwav); - wavedg->set_active(pp->locallab.spots.at(index).wavedg); - strengthw->setValue(pp->locallab.spots.at(index).strengthw); - sigmaed->setValue(pp->locallab.spots.at(index).sigmaed); - wavshapeedg->setCurve(pp->locallab.spots.at(index).locedgwavcurve); - gradw->setValue(pp->locallab.spots.at(index).gradw); - waveshow->set_active(pp->locallab.spots.at(index).waveshow); - radiusw->setValue(pp->locallab.spots.at(index).radiusw); - detailw->setValue(pp->locallab.spots.at(index).detailw); - - if (pp->locallab.spots.at(index).localedgMethod == "fir") { + lcradius->setValue((double)spot.lcradius); + lcamount->setValue(spot.lcamount); + lcdarkness->setValue(spot.lcdarkness); + lclightness->setValue(spot.lclightness); + sigmalc->setValue(spot.sigmalc); + wavshape->setCurve(spot.locwavcurve); + levelwav->setValue((double)spot.levelwav); + csThreshold->setValue(spot.csthreshold); + residcont->setValue(spot.residcont); + residchro->setValue(spot.residchro); + residsha->setValue(spot.residsha); + residshathr->setValue(spot.residshathr); + residhi->setValue(spot.residhi); + residhithr->setValue(spot.residhithr); + sensilc->setValue((double)spot.sensilc); + clarilres->setValue(spot.clarilres); + claricres->setValue(spot.claricres); + clarisoft->setValue(spot.clarisoft); + origlc->set_active(spot.origlc); + wavgradl->set_active(spot.wavgradl); + sigmalc2->setValue(spot.sigmalc2); + strwav->setValue(spot.strwav); + angwav->setValue(spot.angwav); + wavedg->set_active(spot.wavedg); + strengthw->setValue(spot.strengthw); + sigmaed->setValue(spot.sigmaed); + wavshapeedg->setCurve(spot.locedgwavcurve); + gradw->setValue(spot.gradw); + waveshow->set_active(spot.waveshow); + radiusw->setValue(spot.radiusw); + detailw->setValue(spot.detailw); + + if (spot.localedgMethod == "fir") { localedgMethod->set_active(0); - } else if (pp->locallab.spots.at(index).localedgMethod == "sec") { + } else if (spot.localedgMethod == "sec") { localedgMethod->set_active(1); - } else if (pp->locallab.spots.at(index).localedgMethod == "thr") { + } else if (spot.localedgMethod == "thr") { localedgMethod->set_active(2); } - tloww->setValue(pp->locallab.spots.at(index).tloww); - thigw->setValue(pp->locallab.spots.at(index).thigw); - edgw->setValue(pp->locallab.spots.at(index).edgw); - basew->setValue(pp->locallab.spots.at(index).basew); + tloww->setValue(spot.tloww); + thigw->setValue(spot.thigw); + edgw->setValue(spot.edgw); + basew->setValue(spot.basew); - if (pp->locallab.spots.at(index).localneiMethod == "none") { + if (spot.localneiMethod == "none") { localneiMethod->set_active(0); - } else if (pp->locallab.spots.at(index).localneiMethod == "low") { + } else if (spot.localneiMethod == "low") { localneiMethod->set_active(1); - } else if (pp->locallab.spots.at(index).localneiMethod == "high") { + } else if (spot.localneiMethod == "high") { localneiMethod->set_active(2); } - wavblur->set_active(pp->locallab.spots.at(index).wavblur); - levelblur->setValue(pp->locallab.spots.at(index).levelblur); - sigmabl->setValue(pp->locallab.spots.at(index).sigmabl); - chromablu->setValue(pp->locallab.spots.at(index).chromablu); - wavshapelev->setCurve(pp->locallab.spots.at(index).loclevwavcurve); - residblur->setValue(pp->locallab.spots.at(index).residblur); - blurlc->set_active(pp->locallab.spots.at(index).blurlc); - wavcont->set_active(pp->locallab.spots.at(index).wavcont); - sigma->setValue(pp->locallab.spots.at(index).sigma); - offset->setValue(pp->locallab.spots.at(index).offset); - chromalev->setValue(pp->locallab.spots.at(index).chromalev); - wavshapecon->setCurve(pp->locallab.spots.at(index).locconwavcurve); - wavcompre->set_active(pp->locallab.spots.at(index).wavcompre); - wavshapecompre->setCurve(pp->locallab.spots.at(index).loccomprewavcurve); - sigmadr->setValue(pp->locallab.spots.at(index).sigmadr); - threswav->setValue(pp->locallab.spots.at(index).threswav); - residcomp->setValue(pp->locallab.spots.at(index).residcomp); - wavcomp->set_active(pp->locallab.spots.at(index).wavcomp); - sigmadc->setValue(pp->locallab.spots.at(index).sigmadc); - deltad->setValue(pp->locallab.spots.at(index).deltad); - wavshapecomp->setCurve(pp->locallab.spots.at(index).loccompwavcurve); - fatres->setValue(pp->locallab.spots.at(index).fatres); - fftwlc->set_active(pp->locallab.spots.at(index).fftwlc); - enalcMask->set_active(pp->locallab.spots.at(index).enalcMask); - CCmasklcshape->setCurve(pp->locallab.spots.at(index).CCmasklccurve); - LLmasklcshape->setCurve(pp->locallab.spots.at(index).LLmasklccurve); - HHmasklcshape->setCurve(pp->locallab.spots.at(index).HHmasklccurve); - blendmasklc->setValue((double)pp->locallab.spots.at(index).blendmasklc); - radmasklc->setValue(pp->locallab.spots.at(index).radmasklc); - chromasklc->setValue(pp->locallab.spots.at(index).chromasklc); - Lmasklcshape->setCurve(pp->locallab.spots.at(index).Lmasklccurve); + wavblur->set_active(spot.wavblur); + levelblur->setValue(spot.levelblur); + sigmabl->setValue(spot.sigmabl); + chromablu->setValue(spot.chromablu); + wavshapelev->setCurve(spot.loclevwavcurve); + residblur->setValue(spot.residblur); + blurlc->set_active(spot.blurlc); + wavcont->set_active(spot.wavcont); + sigma->setValue(spot.sigma); + offset->setValue(spot.offset); + chromalev->setValue(spot.chromalev); + wavshapecon->setCurve(spot.locconwavcurve); + wavcompre->set_active(spot.wavcompre); + wavshapecompre->setCurve(spot.loccomprewavcurve); + sigmadr->setValue(spot.sigmadr); + threswav->setValue(spot.threswav); + residcomp->setValue(spot.residcomp); + wavcomp->set_active(spot.wavcomp); + sigmadc->setValue(spot.sigmadc); + 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); + HHmasklcshape->setCurve(spot.HHmasklccurve); + blendmasklc->setValue((double)spot.blendmasklc); + radmasklc->setValue(spot.radmasklc); + chromasklc->setValue(spot.chromasklc); + Lmasklcshape->setCurve(spot.Lmasklccurve); } // Enable all listeners @@ -2782,100 +2796,102 @@ void LocallabContrast::write(rtengine::procparams::ProcParams* pp, ParamsEdited* const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).expcontrast = exp->getEnabled(); - pp->locallab.spots.at(index).visicontrast = exp->get_visible(); - pp->locallab.spots.at(index).complexcontrast = complexity->get_active_row_number(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.expcontrast = exp->getEnabled(); + spot.visicontrast = exp->get_visible(); + spot.complexcontrast = complexity->get_active_row_number(); if (localcontMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).localcontMethod = "loc"; + spot.localcontMethod = "loc"; } else if (localcontMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).localcontMethod = "wav"; - } - - pp->locallab.spots.at(index).lcradius = lcradius->getIntValue(); - pp->locallab.spots.at(index).lcamount = lcamount->getValue(); - pp->locallab.spots.at(index).lcdarkness = lcdarkness->getValue(); - pp->locallab.spots.at(index).lclightness = lclightness->getValue(); - pp->locallab.spots.at(index).sigmalc = sigmalc->getValue(); - pp->locallab.spots.at(index).locwavcurve = wavshape->getCurve(); - pp->locallab.spots.at(index).levelwav = levelwav->getIntValue(); - pp->locallab.spots.at(index).csthreshold = csThreshold->getValue(); - pp->locallab.spots.at(index).residcont = residcont->getValue(); - pp->locallab.spots.at(index).residchro = residchro->getValue(); - pp->locallab.spots.at(index).residsha = residsha->getValue(); - pp->locallab.spots.at(index).residshathr = residshathr->getValue(); - pp->locallab.spots.at(index).residhi = residhi->getValue(); - pp->locallab.spots.at(index).residhithr = residhithr->getValue(); - pp->locallab.spots.at(index).sensilc = sensilc->getIntValue(); - pp->locallab.spots.at(index).clarilres = clarilres->getValue(); - pp->locallab.spots.at(index).claricres = claricres->getValue(); - pp->locallab.spots.at(index).clarisoft = clarisoft->getValue(); - pp->locallab.spots.at(index).origlc = origlc->get_active(); - pp->locallab.spots.at(index).wavgradl = wavgradl->get_active(); - pp->locallab.spots.at(index).sigmalc2 = sigmalc2->getValue(); - pp->locallab.spots.at(index).strwav = strwav->getValue(); - pp->locallab.spots.at(index).angwav = angwav->getValue(); - pp->locallab.spots.at(index).wavedg = wavedg->get_active(); - pp->locallab.spots.at(index).strengthw = strengthw->getValue(); - pp->locallab.spots.at(index).sigmaed = sigmaed->getValue(); - pp->locallab.spots.at(index).locedgwavcurve = wavshapeedg->getCurve(); - pp->locallab.spots.at(index).gradw = gradw->getValue(); - pp->locallab.spots.at(index).waveshow = waveshow->get_active(); - pp->locallab.spots.at(index).radiusw = radiusw->getValue(); - pp->locallab.spots.at(index).detailw = detailw->getValue(); + spot.localcontMethod = "wav"; + } + + spot.lcradius = lcradius->getIntValue(); + spot.lcamount = lcamount->getValue(); + spot.lcdarkness = lcdarkness->getValue(); + spot.lclightness = lclightness->getValue(); + spot.sigmalc = sigmalc->getValue(); + spot.locwavcurve = wavshape->getCurve(); + spot.levelwav = levelwav->getIntValue(); + spot.csthreshold = csThreshold->getValue(); + spot.residcont = residcont->getValue(); + spot.residchro = residchro->getValue(); + spot.residsha = residsha->getValue(); + spot.residshathr = residshathr->getValue(); + spot.residhi = residhi->getValue(); + spot.residhithr = residhithr->getValue(); + spot.sensilc = sensilc->getIntValue(); + spot.clarilres = clarilres->getValue(); + spot.claricres = claricres->getValue(); + spot.clarisoft = clarisoft->getValue(); + spot.origlc = origlc->get_active(); + spot.wavgradl = wavgradl->get_active(); + spot.sigmalc2 = sigmalc2->getValue(); + spot.strwav = strwav->getValue(); + spot.angwav = angwav->getValue(); + spot.wavedg = wavedg->get_active(); + spot.strengthw = strengthw->getValue(); + spot.sigmaed = sigmaed->getValue(); + spot.locedgwavcurve = wavshapeedg->getCurve(); + spot.gradw = gradw->getValue(); + spot.waveshow = waveshow->get_active(); + spot.radiusw = radiusw->getValue(); + spot.detailw = detailw->getValue(); if (localedgMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).localedgMethod = "fir"; + spot.localedgMethod = "fir"; } else if (localedgMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).localedgMethod = "sec"; + spot.localedgMethod = "sec"; } else if (localedgMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(index).localedgMethod = "thr"; + spot.localedgMethod = "thr"; } - pp->locallab.spots.at(index).tloww = tloww->getValue(); - pp->locallab.spots.at(index).thigw = thigw->getValue(); - pp->locallab.spots.at(index).edgw = edgw->getValue(); - pp->locallab.spots.at(index).basew = basew->getValue(); + spot.tloww = tloww->getValue(); + spot.thigw = thigw->getValue(); + spot.edgw = edgw->getValue(); + spot.basew = basew->getValue(); if (localneiMethod->get_active_row_number() == 0) { - pp->locallab.spots.at(index).localneiMethod = "none"; + spot.localneiMethod = "none"; } else if (localneiMethod->get_active_row_number() == 1) { - pp->locallab.spots.at(index).localneiMethod = "low"; + spot.localneiMethod = "low"; } else if (localneiMethod->get_active_row_number() == 2) { - pp->locallab.spots.at(index).localneiMethod = "high"; - } - - pp->locallab.spots.at(index).wavblur = wavblur->get_active(); - pp->locallab.spots.at(index).levelblur = levelblur->getValue(); - pp->locallab.spots.at(index).sigmabl = sigmabl->getValue(); - pp->locallab.spots.at(index).chromablu = chromablu->getValue(); - pp->locallab.spots.at(index).loclevwavcurve = wavshapelev->getCurve(); - pp->locallab.spots.at(index).residblur = residblur->getValue(); - pp->locallab.spots.at(index).blurlc = blurlc->get_active(); - pp->locallab.spots.at(index).wavcont = wavcont->get_active(); - pp->locallab.spots.at(index).sigma = sigma->getValue(); - pp->locallab.spots.at(index).offset = offset->getValue(); - pp->locallab.spots.at(index).chromalev = chromalev->getValue(); - pp->locallab.spots.at(index).locconwavcurve = wavshapecon->getCurve(); - pp->locallab.spots.at(index).wavcompre = wavcompre->get_active(); - pp->locallab.spots.at(index).loccomprewavcurve = wavshapecompre->getCurve(); - pp->locallab.spots.at(index).sigmadr = sigmadr->getValue(); - pp->locallab.spots.at(index).threswav = threswav->getValue(); - pp->locallab.spots.at(index).residcomp = residcomp->getValue(); - pp->locallab.spots.at(index).wavcomp = wavcomp->get_active(); - pp->locallab.spots.at(index).sigmadc = sigmadc->getValue(); - pp->locallab.spots.at(index).deltad = deltad->getValue(); - pp->locallab.spots.at(index).loccompwavcurve = wavshapecomp->getCurve(); - pp->locallab.spots.at(index).fatres = fatres->getValue(); - pp->locallab.spots.at(index).fftwlc = fftwlc->get_active(); - pp->locallab.spots.at(index).enalcMask = enalcMask->get_active(); - pp->locallab.spots.at(index).CCmasklccurve = CCmasklcshape->getCurve(); - pp->locallab.spots.at(index).LLmasklccurve = LLmasklcshape->getCurve(); - pp->locallab.spots.at(index).HHmasklccurve = HHmasklcshape->getCurve(); - pp->locallab.spots.at(index).blendmasklc = blendmasklc->getIntValue(); - pp->locallab.spots.at(index).radmasklc = radmasklc->getValue(); - pp->locallab.spots.at(index).chromasklc = chromasklc->getValue(); - pp->locallab.spots.at(index).Lmasklccurve = Lmasklcshape->getCurve(); + spot.localneiMethod = "high"; + } + + spot.wavblur = wavblur->get_active(); + spot.levelblur = levelblur->getValue(); + spot.sigmabl = sigmabl->getValue(); + spot.chromablu = chromablu->getValue(); + spot.loclevwavcurve = wavshapelev->getCurve(); + spot.residblur = residblur->getValue(); + spot.blurlc = blurlc->get_active(); + spot.wavcont = wavcont->get_active(); + spot.sigma = sigma->getValue(); + spot.offset = offset->getValue(); + spot.chromalev = chromalev->getValue(); + spot.locconwavcurve = wavshapecon->getCurve(); + spot.wavcompre = wavcompre->get_active(); + spot.loccomprewavcurve = wavshapecompre->getCurve(); + spot.sigmadr = sigmadr->getValue(); + spot.threswav = threswav->getValue(); + spot.residcomp = residcomp->getValue(); + spot.wavcomp = wavcomp->get_active(); + spot.sigmadc = sigmadc->getValue(); + spot.deltad = deltad->getValue(); + spot.loccompwavcurve = wavshapecomp->getCurve(); + spot.fatres = fatres->getValue(); + spot.fftwlc = fftwlc->get_active(); + spot.enalcMask = enalcMask->get_active(); + spot.CCmasklccurve = CCmasklcshape->getCurve(); + spot.LLmasklccurve = LLmasklcshape->getCurve(); + spot.HHmasklccurve = HHmasklcshape->getCurve(); + spot.blendmasklc = blendmasklc->getIntValue(); + spot.radmasklc = radmasklc->getValue(); + spot.chromasklc = chromasklc->getValue(); + spot.Lmasklccurve = Lmasklcshape->getCurve(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -2886,7 +2902,7 @@ void LocallabContrast::setDefaults(const rtengine::procparams::ProcParams* defPa const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default values for adjuster and threshold adjuster widgets lcradius->setDefault((double)defSpot.lcradius); @@ -3957,34 +3973,36 @@ void LocallabCBDL::read(const rtengine::procparams::ProcParams* pp, const Params const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); - exp->set_visible(pp->locallab.spots.at(index).visicbdl); - exp->setEnabled(pp->locallab.spots.at(index).expcbdl); - complexity->set_active(pp->locallab.spots.at(index).complexcbdl); + spotName = spot.name; // Update spot name according to selected spot + + exp->set_visible(spot.visicbdl); + exp->setEnabled(spot.expcbdl); + complexity->set_active(spot.complexcbdl); for (int i = 0; i < 6; i++) { - multiplier[i]->setValue(pp->locallab.spots.at(index).mult[i]); - } - - chromacbdl->setValue(pp->locallab.spots.at(index).chromacbdl); - threshold->setValue(pp->locallab.spots.at(index).threshold); - blurcbdl->setValue(pp->locallab.spots.at(index).blurcbdl); - clarityml->setValue(pp->locallab.spots.at(index).clarityml); - contresid->setValue((double)pp->locallab.spots.at(index).contresid); - softradiuscb->setValue(pp->locallab.spots.at(index).softradiuscb); - sensicb->setValue((double)pp->locallab.spots.at(index).sensicb); - enacbMask->set_active(pp->locallab.spots.at(index).enacbMask); - CCmaskcbshape->setCurve(pp->locallab.spots.at(index).CCmaskcbcurve); - LLmaskcbshape->setCurve(pp->locallab.spots.at(index).LLmaskcbcurve); - HHmaskcbshape->setCurve(pp->locallab.spots.at(index).HHmaskcbcurve); - blendmaskcb->setValue((double)pp->locallab.spots.at(index).blendmaskcb); - radmaskcb->setValue(pp->locallab.spots.at(index).radmaskcb); - lapmaskcb->setValue(pp->locallab.spots.at(index).lapmaskcb); - chromaskcb->setValue(pp->locallab.spots.at(index).chromaskcb); - gammaskcb->setValue(pp->locallab.spots.at(index).gammaskcb); - slomaskcb->setValue(pp->locallab.spots.at(index).slomaskcb); - Lmaskcbshape->setCurve(pp->locallab.spots.at(index).Lmaskcbcurve); + multiplier[i]->setValue(spot.mult[i]); + } + + chromacbdl->setValue(spot.chromacbdl); + threshold->setValue(spot.threshold); + blurcbdl->setValue(spot.blurcbdl); + clarityml->setValue(spot.clarityml); + contresid->setValue((double)spot.contresid); + softradiuscb->setValue(spot.softradiuscb); + sensicb->setValue((double)spot.sensicb); + enacbMask->set_active(spot.enacbMask); + CCmaskcbshape->setCurve(spot.CCmaskcbcurve); + LLmaskcbshape->setCurve(spot.LLmaskcbcurve); + HHmaskcbshape->setCurve(spot.HHmaskcbcurve); + blendmaskcb->setValue((double)spot.blendmaskcb); + radmaskcb->setValue(spot.radmaskcb); + lapmaskcb->setValue(spot.lapmaskcb); + chromaskcb->setValue(spot.chromaskcb); + gammaskcb->setValue(spot.gammaskcb); + slomaskcb->setValue(spot.slomaskcb); + Lmaskcbshape->setCurve(spot.Lmaskcbcurve); } // Enable all listeners @@ -4001,32 +4019,34 @@ void LocallabCBDL::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).expcbdl = exp->getEnabled(); - pp->locallab.spots.at(index).visicbdl = exp->get_visible(); - pp->locallab.spots.at(index).complexcbdl = complexity->get_active_row_number(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.expcbdl = exp->getEnabled(); + spot.visicbdl = exp->get_visible(); + spot.complexcbdl = complexity->get_active_row_number(); for (int i = 0; i < 6; i++) { - pp->locallab.spots.at(index).mult[i] = multiplier[i]->getValue(); - } - - pp->locallab.spots.at(index).chromacbdl = chromacbdl->getValue(); - pp->locallab.spots.at(index).threshold = threshold->getValue(); - pp->locallab.spots.at(index).blurcbdl = blurcbdl->getValue(); - pp->locallab.spots.at(index).clarityml = clarityml->getValue(); - pp->locallab.spots.at(index).contresid = contresid->getIntValue(); - pp->locallab.spots.at(index).softradiuscb = softradiuscb->getValue(); - pp->locallab.spots.at(index).sensicb = sensicb->getIntValue(); - pp->locallab.spots.at(index).enacbMask = enacbMask->get_active(); - pp->locallab.spots.at(index).LLmaskcbcurve = LLmaskcbshape->getCurve(); - pp->locallab.spots.at(index).CCmaskcbcurve = CCmaskcbshape->getCurve(); - pp->locallab.spots.at(index).HHmaskcbcurve = HHmaskcbshape->getCurve(); - pp->locallab.spots.at(index).blendmaskcb = blendmaskcb->getIntValue(); - pp->locallab.spots.at(index).radmaskcb = radmaskcb->getValue(); - pp->locallab.spots.at(index).lapmaskcb = lapmaskcb->getValue(); - pp->locallab.spots.at(index).chromaskcb = chromaskcb->getValue(); - pp->locallab.spots.at(index).gammaskcb = gammaskcb->getValue(); - pp->locallab.spots.at(index).slomaskcb = slomaskcb->getValue(); - pp->locallab.spots.at(index).Lmaskcbcurve = Lmaskcbshape->getCurve(); + spot.mult[i] = multiplier[i]->getValue(); + } + + spot.chromacbdl = chromacbdl->getValue(); + spot.threshold = threshold->getValue(); + spot.blurcbdl = blurcbdl->getValue(); + spot.clarityml = clarityml->getValue(); + spot.contresid = contresid->getIntValue(); + spot.softradiuscb = softradiuscb->getValue(); + spot.sensicb = sensicb->getIntValue(); + spot.enacbMask = enacbMask->get_active(); + spot.LLmaskcbcurve = LLmaskcbshape->getCurve(); + spot.CCmaskcbcurve = CCmaskcbshape->getCurve(); + spot.HHmaskcbcurve = HHmaskcbshape->getCurve(); + spot.blendmaskcb = blendmaskcb->getIntValue(); + spot.radmaskcb = radmaskcb->getValue(); + spot.lapmaskcb = lapmaskcb->getValue(); + spot.chromaskcb = chromaskcb->getValue(); + spot.gammaskcb = gammaskcb->getValue(); + spot.slomaskcb = slomaskcb->getValue(); + spot.Lmaskcbcurve = Lmaskcbshape->getCurve(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -4037,7 +4057,7 @@ void LocallabCBDL::setDefaults(const rtengine::procparams::ProcParams* defParams const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default values for adjuster widgets for (int i = 0; i < 6; i++) { @@ -4425,23 +4445,25 @@ void LocallabLog::read(const rtengine::procparams::ProcParams* pp, const ParamsE const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - spotName = pp->locallab.spots.at(index).name; // Update spot name according to selected spot + const LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spotName = spot.name; // Update spot name according to selected spot - exp->set_visible(pp->locallab.spots.at(index).visilog); - exp->setEnabled(pp->locallab.spots.at(index).explog); + exp->set_visible(spot.visilog); + exp->setEnabled(spot.explog); - autocompute->set_active(pp->locallab.spots.at(index).autocompute); - blackEv->setValue(pp->locallab.spots.at(index).blackEv); - whiteEv->setValue(pp->locallab.spots.at(index).whiteEv); - fullimage->set_active(pp->locallab.spots.at(index).fullimage); - Autogray->set_active(pp->locallab.spots.at(index).Autogray); - sourceGray->setValue(pp->locallab.spots.at(index).sourceGray); - targetGray->setValue(pp->locallab.spots.at(index).targetGray); - detail->setValue(pp->locallab.spots.at(index).detail); - baselog->setValue(pp->locallab.spots.at(index).baselog); - sensilog->setValue((double)pp->locallab.spots.at(index).sensilog); - strlog->setValue(pp->locallab.spots.at(index).strlog); - anglog->setValue(pp->locallab.spots.at(index).anglog); + autocompute->set_active(spot.autocompute); + blackEv->setValue(spot.blackEv); + whiteEv->setValue(spot.whiteEv); + fullimage->set_active(spot.fullimage); + Autogray->set_active(spot.Autogray); + sourceGray->setValue(spot.sourceGray); + targetGray->setValue(spot.targetGray); + detail->setValue(spot.detail); + baselog->setValue(spot.baselog); + sensilog->setValue((double)spot.sensilog); + strlog->setValue(spot.strlog); + anglog->setValue(spot.anglog); } // Enable all listeners @@ -4458,21 +4480,23 @@ void LocallabLog::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi const int index = pp->locallab.selspot; if (index < (int)pp->locallab.spots.size()) { - pp->locallab.spots.at(index).explog = exp->getEnabled(); - pp->locallab.spots.at(index).visilog = exp->get_visible(); - - pp->locallab.spots.at(index).autocompute = autocompute->get_active(); - pp->locallab.spots.at(index).blackEv = blackEv->getValue(); - pp->locallab.spots.at(index).whiteEv = whiteEv->getValue(); - pp->locallab.spots.at(index).fullimage = fullimage->get_active(); - pp->locallab.spots.at(index).Autogray = Autogray->get_active(); - pp->locallab.spots.at(index).sourceGray = sourceGray->getValue(); - pp->locallab.spots.at(index).targetGray = targetGray->getValue(); - pp->locallab.spots.at(index).detail = detail->getValue(); - pp->locallab.spots.at(index).baselog = baselog->getValue(); - pp->locallab.spots.at(index).sensilog = sensilog->getIntValue(); - pp->locallab.spots.at(index).strlog = strlog->getValue(); - pp->locallab.spots.at(index).anglog = anglog->getValue(); + LocallabParams::LocallabSpot& spot = pp->locallab.spots.at(index); + + spot.explog = exp->getEnabled(); + spot.visilog = exp->get_visible(); + + spot.autocompute = autocompute->get_active(); + spot.blackEv = blackEv->getValue(); + spot.whiteEv = whiteEv->getValue(); + spot.fullimage = fullimage->get_active(); + spot.Autogray = Autogray->get_active(); + spot.sourceGray = sourceGray->getValue(); + spot.targetGray = targetGray->getValue(); + spot.detail = detail->getValue(); + spot.baselog = baselog->getValue(); + spot.sensilog = sensilog->getIntValue(); + spot.strlog = strlog->getValue(); + spot.anglog = anglog->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -4483,7 +4507,7 @@ void LocallabLog::setDefaults(const rtengine::procparams::ProcParams* defParams, const int index = defParams->locallab.selspot; if (index < (int)defParams->locallab.spots.size()) { - const LocallabParams::LocallabSpot defSpot = defParams->locallab.spots.at(index); + const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default value for adjuster widgets blackEv->setDefault(defSpot.blackEv); diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index b6d9325a09..a2a2970428 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -629,6 +629,9 @@ void ToolPanelCoordinator::profileChange( if (event == rtengine::EvPhotoLoaded || event == rtengine::EvProfileChanged) { toolPanel->autoOpenCurve(); + + // For Locallab, reset tool expanders visibility only when a photo or profile is loaded + locallab->openAllTools(); } } @@ -1206,4 +1209,4 @@ bool ToolPanelCoordinator::getFilmNegativeExponents(rtengine::Coord spotA, rteng bool ToolPanelCoordinator::getRawSpotValues(rtengine::Coord spot, int spotSize, std::array& rawValues) { return ipc && ipc->getRawSpotValues(spot.x, spot.y, spotSize, rawValues); -} \ No newline at end of file +} From bb95dd7a1ba692fc12713eefc7fdfad4a42857a7 Mon Sep 17 00:00:00 2001 From: Pandagrapher Date: Fri, 8 May 2020 12:34:10 +0200 Subject: [PATCH 4/5] Improves Locallab tools advice tooltips management Other: - GUI widgets cleanup --- rtdata/languages/default | 8 +- rtgui/editorpanel.cc | 7 + rtgui/editorpanel.h | 1 + rtgui/filecatalog.cc | 13 - rtgui/filecatalog.h | 1 - rtgui/locallab.cc | 16 + rtgui/locallab.h | 3 + rtgui/locallabtools.cc | 647 ++++++++++++--------------------------- rtgui/locallabtools.h | 45 +-- rtgui/locallabtools2.cc | 497 +++++++++++------------------- rtgui/preferences.cc | 2 - rtgui/rtwindow.cc | 2 +- rtgui/toolpanelcoord.cc | 6 + rtgui/toolpanelcoord.h | 2 +- 14 files changed, 448 insertions(+), 802 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index c96424e0db..9500904412 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1672,7 +1672,7 @@ PREFERENCES_SHOWBASICEXIF;Show basic Exif info PREFERENCES_SHOWDATETIME;Show date and time PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show Filmstrip toolbar PREFERENCES_SHOWEXPOSURECOMPENSATION;Append exposure compensation -PREFERENCES_SHOWTOOLTIP;Show Local Adjustements Tooltips +PREFERENCES_SHOWTOOLTIP;Show Local Adjustements advice tooltips PREFERENCES_SHTHRESHOLD;Threshold for clipped shadows PREFERENCES_SINGLETAB;Single Editor Tab Mode PREFERENCES_SINGLETABVERTAB;Single Editor Tab Mode, Vertical Tabs @@ -2375,7 +2375,7 @@ TP_LOCALLAB_CURVNONE;Disable curves TP_LOCALLAB_DARKRETI;Darkness TP_LOCALLAB_DEHAFRA;Dehaze TP_LOCALLAB_DEHAZ;Strength -TP_LOCALLAB_DEHAZ_TOOLTIP;Negative values add haze +TP_LOCALLAB_DEHAZ_TOOLTIP;Negative values adds haze TP_LOCALLAB_DELTAD;Delta balance TP_LOCALLAB_DELTAEC;Mask ΔE Image TP_LOCALLAB_DENOIS;Ψ Denoise @@ -2629,7 +2629,7 @@ TP_LOCALLAB_SENSIDEN;Scope TP_LOCALLAB_SENSIEXCLU;Scope TP_LOCALLAB_SENSIEXCLU_TOOLTIP;Adjust color to include in exclusion! TP_LOCALLAB_SENSIH;Scope -TP_LOCALLAB_SENSIH_TOOLTIP; Adjust scope of action:\nSmall values limit action to colors very similar to those under the center spot.\nHigh values let the tool act upon a wider range of colors.\nValues smaller than 20 lead to a better algorithm. +TP_LOCALLAB_SENSIH_TOOLTIP;Adjust scope of action:\nSmall values limit action to colors very similar to those under the center spot.\nHigh values let the tool act upon a wider range of colors.\nValues smaller than 20 lead to a better algorithm. TP_LOCALLAB_SENSILOG;Scope TP_LOCALLAB_SENSIS;Scope TP_LOCALLAB_SENSIS_TOOLTIP;Adjust scope of action:\nSmall values limit action to colors very similar to those under the center spot.\nHigh values let the tool act upon a wider range of colors.\nValues smaller than 20 lead to a better algorithm. @@ -2662,7 +2662,7 @@ TP_LOCALLAB_SHOWFOURIER;Fourier ƒ(dct) TP_LOCALLAB_SHOWLAPLACE;∆ Laplacian (first) TP_LOCALLAB_SHOWLC;6 - Mask and modifications TP_LOCALLAB_SHOWMASK;Show mask -TP_LOCALLAB_SHOWMASKCOL_TOOLTIP;Display modifications.\nBeware, you can only view one modification (color and light or Exposure or Shadows-Highlight or TM or CBDL or Retinex MSR or Blur).\n\nUse Mask is before algorihtm shape detection +TP_LOCALLAB_SHOWMASKCOL_TOOLTIP;Display mask modifications.\nBeware, you can only view one tool mask at the same time.\n\nNote: Use Mask is before algorihtm shape detection. TP_LOCALLAB_SHOWMASKSOFT_TOOLTIP;Show process Fourier:\nShows the different stages of the process.\nLaplace - builds the second derivative according to the threshold (first step).\nFourier -shows the transformed Laplacian with DCT.\nPoisson - show solution of Poisson DCE.\nNormalize - show result without normalization luminance. TP_LOCALLAB_SHOWMNONE;None TP_LOCALLAB_SHOWMODIF;Show modifications without mask diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 93e704d576..669dd491a9 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -957,6 +957,13 @@ void EditorPanel::writeToolExpandedStatus (std::vector &tpOpen) } } +void EditorPanel::updateShowtooltipVisibility (bool showtooltip) +{ + if (tpc) { + tpc->updateShowtooltipVisibility (showtooltip); + } +} + void EditorPanel::showTopPanel (bool show) { if (tbTopPanel_1->get_active() != show) { diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 8993fea072..8267935070 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -79,6 +79,7 @@ class EditorPanel final : void writeOptions(); void writeToolExpandedStatus (std::vector &tpOpen); + void updateShowtooltipVisibility (bool showtooltip); void showTopPanel (bool show); bool isRealized() diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 8249b7c34d..102c17daf3 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -1976,19 +1976,6 @@ void FileCatalog::updateFBQueryTB (bool singleRow) hbToolBar1->unreference(); } -void FileCatalog::updateShowtooltipVisibility (bool showtooltip) -{ - if (showtooltip) { - showToolBar(); - } else { - hideToolBar(); - } - - refreshHeight(); -} - - - void FileCatalog::updateFBToolBarVisibility (bool showFilmStripToolBar) { if (showFilmStripToolBar) { diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 5f3623c2c6..1941539216 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -258,7 +258,6 @@ class FileCatalog final : public Gtk::VBox, bool Query_key_pressed(GdkEventKey *event); void updateFBQueryTB (bool singleRow); void updateFBToolBarVisibility (bool showFilmStripToolBar); - void updateShowtooltipVisibility (bool showtooltip); void tbLeftPanel_1_toggled (); void tbLeftPanel_1_visible (bool visible); diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 5c104b5478..5d3171613d 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -20,11 +20,15 @@ * 2019 Pierre Cabrera */ #include "locallab.h" + +#include "options.h" #include "../rtengine/procparams.h" using namespace rtengine; using namespace procparams; +extern Options options; + /* ==== LocallabToolList ==== */ LocallabToolList::LocallabToolList(): // Tool list GUI elements @@ -209,6 +213,11 @@ Locallab::Locallab(): // Show all widgets show_all(); + // Update Locallab tools advice tooltips visibility based on saved option + for (auto tool : locallabTools) { + tool->updateAdviceTooltips(options.showtooltip); + } + // By default, if no photo is loaded, all Locallab tools are removed and it's not possible to add them // (to be necessary called after "show_all" function) setParamEditable(false); @@ -1085,6 +1094,13 @@ void Locallab::openAllTools() } } +void Locallab::updateShowtooltipVisibility(bool showtooltip) +{ + for (auto tool : locallabTools) { + tool->updateAdviceTooltips(showtooltip); + } +} + void Locallab::addTool(Gtk::Box* where, LocallabTool* tool) { tool->getExpander()->setLevel(3); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index c9f812a789..d4a269f78d 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -183,6 +183,9 @@ class Locallab : void foldAllButOne(LocallabTool* except); void openAllTools(); + // Locallab tools advice tooltips management function + void updateShowtooltipVisibility(bool showtooltip); + private: // Locallab tools management functions void addTool(Gtk::Box* where, LocallabTool* tool); diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index e432b97882..f360d944f1 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -130,8 +130,6 @@ LocallabTool::LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustr // LocallabTool generic widgets complexity(Gtk::manage(new MyComboBoxText())) { - const bool showtooltip = options.showtooltip; - // Create expander title bar Gtk::HBox* const titleBox = Gtk::manage(new Gtk::HBox()); Gtk::Label* const titleLabel = Gtk::manage(new Gtk::Label()); @@ -160,12 +158,8 @@ LocallabTool::LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustr titleBox->pack_end(*separator, Gtk::PACK_SHRINK, 0); if (need100Percent) { - RTImage* titleImage = Gtk::manage(new RTImage("one-to-one-small.png")); - - if (showtooltip) { - titleImage->set_tooltip_text(M("TP_GENERAL_11SCALE_TOOLTIP")); - } - + RTImage* const titleImage = Gtk::manage(new RTImage("one-to-one-small.png")); + titleImage->set_tooltip_text(M("TP_GENERAL_11SCALE_TOOLTIP")); titleBox->pack_end(*titleImage, Gtk::PACK_SHRINK, 0); } @@ -474,17 +468,11 @@ LocallabColor::LocallabColor(): const LocallabParams::LocallabSpot defSpot; - const bool showtooltip = options.showtooltip; - // Parameter Color & Light specific widgets curvactivConn = curvactiv->signal_toggled().connect(sigc::mem_fun(*this, &LocallabColor::curvactivChanged)); lightness->setAdjusterListener(this); - if (showtooltip) { - lightness->set_tooltip_text(M("TP_LOCALLAB_EXPCOLOR_TOOLTIP")); - } - contrast->setAdjusterListener(this); chroma->setAdjusterListener(this); @@ -500,10 +488,6 @@ LocallabColor::LocallabColor(): sensi->setAdjusterListener(this); - if (showtooltip) { - sensi->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); - } - structcol->setAdjusterListener(this); blurcolde->setAdjusterListener(this); @@ -517,57 +501,31 @@ LocallabColor::LocallabColor(): strcol->setAdjusterListener(this); - if (showtooltip) { - strcol->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); - } - strcolab->setAdjusterListener(this); - - if (showtooltip) { - strcolab->set_tooltip_text(M("TP_LOCALLAB_GRADSTRAB_TOOLTIP")); - } + strcolab->set_tooltip_text(M("TP_LOCALLAB_GRADSTRAB_TOOLTIP")); strcolh->setAdjusterListener(this); - - if (showtooltip) { - strcolh->set_tooltip_text(M("TP_LOCALLAB_GRADSTRHUE_TOOLTIP")); - } + strcolh->set_tooltip_text(M("TP_LOCALLAB_GRADSTRHUE_TOOLTIP")); angcol->setAdjusterListener(this); - - if (showtooltip) { - angcol->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); - } + angcol->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); setExpandAlignProperties(expcurvcol, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); qualitycurveMethod->append(M("TP_LOCALLAB_CURVNONE")); qualitycurveMethod->append(M("TP_LOCALLAB_CURVCURR")); qualitycurveMethod->set_active(0); - - if (showtooltip) { - qualitycurveMethod->set_tooltip_markup(M("TP_LOCALLAB_CURVEMETHOD_TOOLTIP")); - } - qualitycurveMethodConn = qualitycurveMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabColor::qualitycurveMethodChanged)); llCurveEditorG->setCurveListener(this); llshape->setResetCurve(DiagonalCurveType(defSpot.llcurve.at(0)), defSpot.llcurve); - - if (showtooltip) { - llshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - + llshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); llshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); llshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); ccshape->setResetCurve(DiagonalCurveType(defSpot.cccurve.at(0)), defSpot.cccurve); - - if (showtooltip) { - ccshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - + ccshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); ccshape->setBottomBarColorProvider(this, 4); ccshape->setLeftBarColorProvider(this, 1); @@ -576,20 +534,12 @@ LocallabColor::LocallabColor(): clCurveEditorG->setCurveListener(this); clshape->setResetCurve(DiagonalCurveType(defSpot.clcurve.at(0)), defSpot.clcurve); - - if (showtooltip) { - clshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - + clshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); clshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); clshape->setLeftBarColorProvider(this, 1); lcshape->setResetCurve(DiagonalCurveType(defSpot.lccurve.at(0)), defSpot.lccurve); - - if (showtooltip) { - lcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - + lcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); lcshape->setBottomBarColorProvider(this, 4); lcshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); @@ -599,11 +549,7 @@ LocallabColor::LocallabColor(): LHshape->setIdentityValue(0.); LHshape->setResetCurve(FlatCurveType(defSpot.LHcurve.at(0)), defSpot.LHcurve); - - if (showtooltip) { - LHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - + LHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); LHshape->setCurveColorProvider(this, 3); LHshape->setBottomBarBgGradient(six_shape); @@ -613,11 +559,7 @@ LocallabColor::LocallabColor(): HHshape->setIdentityValue(0.); HHshape->setResetCurve(FlatCurveType(defSpot.HHcurve.at(0)), defSpot.HHcurve); - - if (showtooltip) { - HHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - + HHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); HHshape->setCurveColorProvider(this, 3); HHshape->setBottomBarBgGradient(six_shape); @@ -633,11 +575,7 @@ LocallabColor::LocallabColor(): toneMethodConn = toneMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabColor::toneMethodChanged)); rgbshape->setResetCurve(DiagonalCurveType(defSpot.rgbcurve.at(0)), defSpot.rgbcurve); - - if (showtooltip) { - rgbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - + rgbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); rgbshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); rgbshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); @@ -683,28 +621,12 @@ LocallabColor::LocallabColor(): opacol->setAdjusterListener(this); - if (showtooltip) { - opacol->set_tooltip_text(M("TP_LOCALLAB_MERGEOPA_TOOLTIP")); - } - conthrcol->setAdjusterListener(this); - if (showtooltip) { - conthrcol->set_tooltip_text(M("TP_LOCALLAB_MERGEOPA_TOOLTIP")); - } - - if (showtooltip) { - gridmerFrame->set_tooltip_text(M("TP_LOCALLAB_GRIDFRAME_TOOLTIP")); - } - merlucol->setAdjusterListener(this); setExpandAlignProperties(expmaskcol, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - if (showtooltip) { - expmaskcol->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); - } - showmaskcolMethod->append(M("TP_LOCALLAB_SHOWMNONE")); showmaskcolMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmaskcolMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); @@ -712,21 +634,13 @@ LocallabColor::LocallabColor(): showmaskcolMethod->append(M("TP_LOCALLAB_SHOWSTRUC")); showmaskcolMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmaskcolMethod->set_active(0); - - if (showtooltip) { - showmaskcolMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmaskcolMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskcolMethodConn = showmaskcolMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabColor::showmaskcolMethodChanged)); showmaskcolMethodinv->append(M("TP_LOCALLAB_SHOWMNONE")); showmaskcolMethodinv->append(M("TP_LOCALLAB_SHOWMASK")); showmaskcolMethodinv->set_active(0); - - if (showtooltip) { - showmaskcolMethodinv->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmaskcolMethodinv->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskcolMethodConninv = showmaskcolMethodinv->signal_changed().connect(sigc::mem_fun(*this, &LocallabColor::showmaskcolMethodChangedinv)); enaColorMaskConn = enaColorMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabColor::enaColorMaskChanged)); @@ -735,33 +649,14 @@ LocallabColor::LocallabColor(): CCmaskshape->setIdentityValue(0.); CCmaskshape->setResetCurve(FlatCurveType(defSpot.CCmaskcurve.at(0)), defSpot.CCmaskcurve); - - if (showtooltip) { - CCmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - CCmaskshape->setBottomBarColorProvider(this, 1); LLmaskshape->setIdentityValue(0.); LLmaskshape->setResetCurve(FlatCurveType(defSpot.LLmaskcurve.at(0)), defSpot.LLmaskcurve); - - if (showtooltip) { - LLmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - LLmaskshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); - if (showtooltip) { - LLmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - HHmaskshape->setIdentityValue(0.); HHmaskshape->setResetCurve(FlatCurveType(defSpot.HHmaskcurve.at(0)), defSpot.HHmaskcurve); - - if (showtooltip) { - HHmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - HHmaskshape->setCurveColorProvider(this, 2); HHmaskshape->setBottomBarColorProvider(this, 2); @@ -786,16 +681,8 @@ LocallabColor::LocallabColor(): radmaskcol->setLogScale(10, -10); radmaskcol->setAdjusterListener(this); - if (showtooltip) { - radmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - lapmaskcol->setAdjusterListener(this); - if (showtooltip) { - lapmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - chromaskcol->setAdjusterListener(this); gammaskcol->setAdjusterListener(this); @@ -808,11 +695,7 @@ LocallabColor::LocallabColor(): HHhmaskshape->setIdentityValue(0.); HHhmaskshape->setResetCurve(FlatCurveType(defSpot.HHhmaskcurve.at(0)), defSpot.HHhmaskcurve); - - if (showtooltip) { - HHhmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } - + HHhmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); HHhmaskshape->setCurveColorProvider(this, 2); HHhmaskshape->setBottomBarColorProvider(this, 2); @@ -821,11 +704,6 @@ LocallabColor::LocallabColor(): mask2CurveEditorG->setCurveListener(this); Lmaskshape->setResetCurve(DiagonalCurveType(defSpot.Lmaskcurve.at(0)), defSpot.Lmaskcurve); - - if (showtooltip) { - Lmaskshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - } - Lmaskshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); Lmaskshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); @@ -835,11 +713,6 @@ LocallabColor::LocallabColor(): LLmaskcolshapewav->setIdentityValue(0.); LLmaskcolshapewav->setResetCurve(FlatCurveType(defSpot.LLmaskcolcurvewav.at(0)), defSpot.LLmaskcolcurvewav); - - if (showtooltip) { - LLmaskcolshapewav->setTooltip(M("TP_LOCALLAB_LMASK_LEVEL_TOOLTIP")); - } - LLmaskcolshapewav->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); mask2CurveEditorGwav->curveListComplete(); @@ -987,6 +860,43 @@ void LocallabColor::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, colorMaskinv = showmaskcolMethodinv->get_active_row_number(); } +void LocallabColor::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + lightness->set_tooltip_text(M("TP_LOCALLAB_EXPCOLOR_TOOLTIP")); + sensi->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); + strcol->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); + qualitycurveMethod->set_tooltip_markup(M("TP_LOCALLAB_CURVEMETHOD_TOOLTIP")); + opacol->set_tooltip_text(M("TP_LOCALLAB_MERGEOPA_TOOLTIP")); + conthrcol->set_tooltip_text(M("TP_LOCALLAB_MERGEOPA_TOOLTIP")); + gridmerFrame->set_tooltip_text(M("TP_LOCALLAB_GRIDFRAME_TOOLTIP")); + expmaskcol->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + CCmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + LLmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + radmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + lapmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + Lmaskshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + LLmaskcolshapewav->setTooltip(M("TP_LOCALLAB_LMASK_LEVEL_TOOLTIP")); + } else { + lightness->set_tooltip_text(""); + sensi->set_tooltip_text(""); + strcol->set_tooltip_text(""); + qualitycurveMethod->set_tooltip_text(""); + opacol->set_tooltip_text(""); + conthrcol->set_tooltip_text(""); + gridmerFrame->set_tooltip_text(""); + expmaskcol->set_tooltip_text(""); + CCmaskshape->setTooltip(""); + LLmaskshape->setTooltip(""); + HHmaskshape->setTooltip(""); + radmaskcol->set_tooltip_text(""); + lapmaskcol->set_tooltip_text(""); + Lmaskshape->setTooltip(""); + LLmaskcolshapewav->setTooltip(""); + } +} + void LocallabColor::setDefaultExpanderVisibility() { expgradcol->set_expanded(false); @@ -2232,7 +2142,6 @@ LocallabExposure::LocallabExposure(): linear(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LINEAR"), 0., 1., 0.01, 0.3))), balanexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BALANEXP"), 0.5, 1.5, 0.01, 1.0))), gamm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMM"), 0.2, 1.3, 0.01, 0.4))), - ctboxexpmethod(Gtk::manage(new Gtk::HBox())), exnoiseMethod(Gtk::manage(new MyComboBoxText())), fatFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATFRA")))), fatamount(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATAMOUNT"), 1., 100., 1., 1.))), @@ -2280,28 +2189,14 @@ LocallabExposure::LocallabExposure(): { const LocallabParams::LocallabSpot defSpot; - const bool showtooltip = options.showtooltip; - // Parameter Exposure specific widgets - if (showtooltip) { - exp->set_tooltip_text(M("TP_LOCALLAB_EXPOSURE_TOOLTIP")); - } - expMethod->append(M("TP_LOCALLAB_STD")); expMethod->append(M("TP_LOCALLAB_PDE")); expMethod->set_active(0); expMethodConn = expMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabExposure::expMethodChanged)); - if (showtooltip) { - expMethod->set_tooltip_text(M("TP_LOCALLAB_EXPMETHOD_TOOLTIP")); - } - pdeFrame->set_label_align(0.025, 0.5); - if (showtooltip) { - pdeFrame->set_tooltip_text(M("TP_LOCALLAB_PDEFRAME_TOOLTIP")); - } - laplacexp->setAdjusterListener(this); linear->setAdjusterListener(this); @@ -2316,16 +2211,8 @@ LocallabExposure::LocallabExposure(): exnoiseMethod->set_active(0); exnoiseMethodConn = exnoiseMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabExposure::exnoiseMethodChanged)); - if (showtooltip) { - exnoiseMethod->set_tooltip_text(M("TP_LOCALLAB_EXPMETHOD_TOOLTIP")); - } - fatFrame->set_label_align(0.025, 0.5); - if (showtooltip) { - fatFrame->set_tooltip_text(M("TP_LOCALLAB_FATFRAME_TOOLTIP")); - } - fatamount->setAdjusterListener(this); fatdetail->setAdjusterListener(this); @@ -2336,10 +2223,6 @@ LocallabExposure::LocallabExposure(): sensiex->setAdjusterListener(this); - if (showtooltip) { - sensiex->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); - } - structexp->setAdjusterListener(this); blurexpde->setAdjusterListener(this); @@ -2363,11 +2246,6 @@ LocallabExposure::LocallabExposure(): curveEditorG->setCurveListener(this); shapeexpos->setResetCurve(DiagonalCurveType(defSpot.excurve.at(0)), defSpot.excurve); - - if (showtooltip) { - shapeexpos->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_TONES_TOOLTIP")); - } - shapeexpos->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1}}); shapeexpos->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1}}); @@ -2377,15 +2255,8 @@ LocallabExposure::LocallabExposure(): strexp->setAdjusterListener(this); - if (showtooltip) { - strexp->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); - } - angexp->setAdjusterListener(this); - - if (showtooltip) { - angexp->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); - } + angexp->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); softradiusexp->setLogScale(10, -10); softradiusexp->setAdjusterListener(this); @@ -2394,10 +2265,6 @@ LocallabExposure::LocallabExposure(): setExpandAlignProperties(expmaskexp, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - if (showtooltip) { - expmaskexp->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); - } - showmaskexpMethod->append(M("TP_LOCALLAB_SHOWMNONE")); showmaskexpMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmaskexpMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); @@ -2405,21 +2272,13 @@ LocallabExposure::LocallabExposure(): showmaskexpMethod->append(M("TP_LOCALLAB_SHOWSTRUCEX")); showmaskexpMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmaskexpMethod->set_active(0); - - if (showtooltip) { - showmaskexpMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmaskexpMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskexpMethodConn = showmaskexpMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabExposure::showmaskexpMethodChanged)); showmaskexpMethodinv->append(M("TP_LOCALLAB_SHOWMNONE")); showmaskexpMethodinv->append(M("TP_LOCALLAB_SHOWMASK")); showmaskexpMethodinv->set_active(0); - - if (showtooltip) { - showmaskexpMethodinv->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmaskexpMethodinv->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskexpMethodConninv = showmaskexpMethodinv->signal_changed().connect(sigc::mem_fun(*this, &LocallabExposure::showmaskexpMethodChangedinv)); enaExpMaskConn = enaExpMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabExposure::enaExpMaskChanged)); @@ -2430,29 +2289,14 @@ LocallabExposure::LocallabExposure(): CCmaskexpshape->setIdentityValue(0.); CCmaskexpshape->setResetCurve(FlatCurveType(defSpot.CCmaskexpcurve.at(0)), defSpot.CCmaskexpcurve); - - if (showtooltip) { - CCmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - CCmaskexpshape->setBottomBarColorProvider(this, 1); LLmaskexpshape->setIdentityValue(0.); LLmaskexpshape->setResetCurve(FlatCurveType(defSpot.LLmaskexpcurve.at(0)), defSpot.LLmaskexpcurve); - - if (showtooltip) { - LLmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - LLmaskexpshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1}}); HHmaskexpshape->setIdentityValue(0.); HHmaskexpshape->setResetCurve(FlatCurveType(defSpot.HHmaskexpcurve.at(0)), defSpot.HHmaskexpcurve); - - if (showtooltip) { - HHmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - HHmaskexpshape->setCurveColorProvider(this, 2); HHmaskexpshape->setBottomBarColorProvider(this, 2); @@ -2463,16 +2307,8 @@ LocallabExposure::LocallabExposure(): radmaskexp->setLogScale(10, -10); radmaskexp->setAdjusterListener(this); - if (showtooltip) { - radmaskexp->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - lapmaskexp->setAdjusterListener(this); - if (showtooltip) { - lapmaskexp->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - chromaskexp->setAdjusterListener(this); gammaskexp->setAdjusterListener(this); @@ -2483,24 +2319,12 @@ LocallabExposure::LocallabExposure(): strmaskexp->setAdjusterListener(this); - if (showtooltip) { - strmaskexp->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); - } - angmaskexp->setAdjusterListener(this); - - if (showtooltip) { - angmaskexp->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); - } + angmaskexp->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); mask2expCurveEditorG->setCurveListener(this); Lmaskexpshape->setResetCurve(DiagonalCurveType(defSpot.Lmaskexpcurve.at(0)), defSpot.Lmaskexpcurve); - - if (showtooltip) { - Lmaskexpshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - } - Lmaskexpshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1}}); Lmaskexpshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1}}); @@ -2513,6 +2337,7 @@ LocallabExposure::LocallabExposure(): pdeBox->pack_start(*linear); pdeBox->pack_start(*balanexp); pdeBox->pack_start(*gamm); + Gtk::HBox* const ctboxexpmethod = Gtk::manage(new Gtk::HBox()); Gtk::Label* const labelexpmethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_NOISEMETH") + ":")); ctboxexpmethod->pack_start(*labelexpmethod, Gtk::PACK_SHRINK, 4); ctboxexpmethod->pack_start(*exnoiseMethod); @@ -2594,6 +2419,45 @@ void LocallabExposure::getMaskView(int &colorMask, int &colorMaskinv, int &expMa expMaskinv = showmaskexpMethodinv->get_active_row_number(); } +void LocallabExposure::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + exp->set_tooltip_text(M("TP_LOCALLAB_EXPOSURE_TOOLTIP")); + expMethod->set_tooltip_text(M("TP_LOCALLAB_EXPMETHOD_TOOLTIP")); + pdeFrame->set_tooltip_text(M("TP_LOCALLAB_PDEFRAME_TOOLTIP")); + exnoiseMethod->set_tooltip_text(M("TP_LOCALLAB_EXPMETHOD_TOOLTIP")); + fatFrame->set_tooltip_text(M("TP_LOCALLAB_FATFRAME_TOOLTIP")); + sensiex->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); + shapeexpos->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_TONES_TOOLTIP")); + strexp->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); + expmaskexp->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + CCmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + LLmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + radmaskexp->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + lapmaskexp->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + strmaskexp->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); + Lmaskexpshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + } else { + exp->set_tooltip_text(""); + expMethod->set_tooltip_text(""); + pdeFrame->set_tooltip_text(""); + exnoiseMethod->set_tooltip_text(""); + fatFrame->set_tooltip_text(""); + sensiex->set_tooltip_text(""); + shapeexpos->setTooltip(""); + strexp->set_tooltip_text(""); + expmaskexp->set_tooltip_text(""); + CCmaskexpshape->setTooltip(""); + LLmaskexpshape->setTooltip(""); + HHmaskexpshape->setTooltip(""); + radmaskexp->set_tooltip_text(""); + lapmaskexp->set_tooltip_text(""); + strmaskexp->set_tooltip_text(""); + Lmaskexpshape->setTooltip(""); + } +} + void LocallabExposure::setDefaultExpanderVisibility() { exptoolexp->set_expanded(false); @@ -3353,7 +3217,6 @@ LocallabShadow::LocallabShadow(): sh_radius(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_RADIUS"), 0, 100, 1, 40))), sensihs(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), blurSHde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), - gamFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GAMFRA")))), gamSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMSH"), 0.25, 15.0, 0.01, 2.4))), sloSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOSH"), 0.0, 150.0, 0.01, 12.92))), expgradsh(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_EXPGRAD")))), @@ -3382,13 +3245,7 @@ LocallabShadow::LocallabShadow(): { const LocallabParams::LocallabSpot defSpot; - const bool showtooltip = options.showtooltip; - // Parameter Shadow highlight specific widgets - if (showtooltip) { - exp->set_tooltip_text(M("TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP")); - } - shMethod->append(M("TP_LOCALLAB_SH1")); shMethod->append(M("TP_LOCALLAB_SH2")); shMethod->set_active(0); @@ -3414,8 +3271,6 @@ LocallabShadow::LocallabShadow(): blurSHde->setAdjusterListener(this); - gamFrame->set_label_align(0.025, 0.5); - gamSH->setAdjusterListener(this); sloSH->setAdjusterListener(this); @@ -3424,46 +3279,26 @@ LocallabShadow::LocallabShadow(): strSH->setAdjusterListener(this); - if (showtooltip) { - strSH->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); - } - angSH->setAdjusterListener(this); - - if (showtooltip) { - angSH->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); - } + angSH->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); inversshConn = inverssh->signal_toggled().connect(sigc::mem_fun(*this, &LocallabShadow::inversshChanged)); setExpandAlignProperties(expmasksh, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - if (showtooltip) { - expmasksh->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); - } - showmaskSHMethod->append(M("TP_LOCALLAB_SHOWMNONE")); showmaskSHMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmaskSHMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); showmaskSHMethod->append(M("TP_LOCALLAB_SHOWMASK")); showmaskSHMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmaskSHMethod->set_active(0); - - if (showtooltip) { - showmaskSHMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmaskSHMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskSHMethodConn = showmaskSHMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabShadow::showmaskSHMethodChanged)); showmaskSHMethodinv->append(M("TP_LOCALLAB_SHOWMNONE")); showmaskSHMethodinv->append(M("TP_LOCALLAB_SHOWMASK")); - showmaskSHMethodinv->set_active(0); - - if (showtooltip) { - showmaskSHMethodinv->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmaskSHMethodinv->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskSHMethodConninv = showmaskSHMethodinv->signal_changed().connect(sigc::mem_fun(*this, &LocallabShadow::showmaskSHMethodChangedinv)); enaSHMaskConn = enaSHMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabShadow::enaSHMaskChanged)); @@ -3472,29 +3307,14 @@ LocallabShadow::LocallabShadow(): CCmaskSHshape->setIdentityValue(0.); CCmaskSHshape->setResetCurve(FlatCurveType(defSpot.CCmaskSHcurve.at(0)), defSpot.CCmaskSHcurve); - - if (showtooltip) { - CCmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - CCmaskSHshape->setBottomBarColorProvider(this, 1); LLmaskSHshape->setIdentityValue(0.); LLmaskSHshape->setResetCurve(FlatCurveType(defSpot.LLmaskSHcurve.at(0)), defSpot.LLmaskSHcurve); - - if (showtooltip) { - LLmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - LLmaskSHshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); HHmaskSHshape->setIdentityValue(0.); HHmaskSHshape->setResetCurve(FlatCurveType(defSpot.HHmaskSHcurve.at(0)), defSpot.HHmaskSHcurve); - - if (showtooltip) { - HHmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - HHmaskSHshape->setCurveColorProvider(this, 2); HHmaskSHshape->setBottomBarColorProvider(this, 2); @@ -3505,16 +3325,8 @@ LocallabShadow::LocallabShadow(): radmaskSH->setLogScale(10, -10); radmaskSH->setAdjusterListener(this); - if (showtooltip) { - radmaskSH->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - lapmaskSH->setAdjusterListener(this); - if (showtooltip) { - lapmaskSH->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - chromaskSH->setAdjusterListener(this); gammaskSH->setAdjusterListener(this); @@ -3524,11 +3336,6 @@ LocallabShadow::LocallabShadow(): mask2SHCurveEditorG->setCurveListener(this); LmaskSHshape->setResetCurve(DiagonalCurveType(defSpot.LmaskSHcurve.at(0)), defSpot.LmaskSHcurve); - - if (showtooltip) { - LmaskSHshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - } - LmaskSHshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); LmaskSHshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); @@ -3555,6 +3362,8 @@ LocallabShadow::LocallabShadow(): pack_start(*sh_radius); pack_start(*sensihs); pack_start(*blurSHde); + Gtk::Frame* const gamFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GAMFRA"))); + gamFrame->set_label_align(0.025, 0.5); ToolParamBlock* const gammBox = Gtk::manage(new ToolParamBlock()); gammBox->pack_start(*gamSH); gammBox->pack_start(*sloSH); @@ -3611,6 +3420,31 @@ void LocallabShadow::getMaskView(int &colorMask, int &colorMaskinv, int &expMask shMaskinv = showmaskSHMethodinv->get_active_row_number(); } +void LocallabShadow::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + exp->set_tooltip_text(M("TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP")); + strSH->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); + expmasksh->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + CCmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + LLmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + radmaskSH->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + lapmaskSH->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + LmaskSHshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + } else { + exp->set_tooltip_text(""); + strSH->set_tooltip_text(""); + expmasksh->set_tooltip_text(""); + CCmaskSHshape->setTooltip(""); + LLmaskSHshape->setTooltip(""); + HHmaskSHshape->setTooltip(""); + radmaskSH->set_tooltip_text(""); + lapmaskSH->set_tooltip_text(""); + LmaskSHshape->setTooltip(""); + } +} + void LocallabShadow::setDefaultExpanderVisibility() { expgradsh->set_expanded(false); @@ -4246,23 +4080,14 @@ LocallabVibrance::LocallabVibrance(): const LocallabParams::LocallabSpot defSpot; - const bool showtooltip = options.showtooltip; - // Parameter Vibrance specific widgets saturated->setAdjusterListener(this); pastels->setAdjusterListener(this); - if (showtooltip) { - warm->set_tooltip_text(M("TP_LOCALLAB_WARM_TOOLTIP")); - } - warm->setAdjusterListener(this); - if (showtooltip) { - psThreshold->set_tooltip_markup(M("TP_VIBRANCE_PSTHRESHOLD_TOOLTIP")); - } - + psThreshold->set_tooltip_markup(M("TP_VIBRANCE_PSTHRESHOLD_TOOLTIP")); psThreshold->setAdjusterListener(this); pskinsConn = protectSkins->signal_toggled().connect(sigc::mem_fun(*this, &LocallabVibrance::protectskins_toggled)); @@ -4275,10 +4100,7 @@ LocallabVibrance::LocallabVibrance(): curveEditorGG->setCurveListener(this); - if (showtooltip) { - skinTonesCurve->setTooltip(M("TP_VIBRANCE_CURVEEDITOR_SKINTONES_TOOLTIP")); - } - + skinTonesCurve->setTooltip(M("TP_VIBRANCE_CURVEEDITOR_SKINTONES_TOOLTIP")); std::vector mskinTonesCurve; // -0.1 rad < Hue < 1.6 rad Color::hsv2rgb01(0.92f, 0.45f, 0.6f, R, G, B); @@ -4297,47 +4119,26 @@ LocallabVibrance::LocallabVibrance(): setExpandAlignProperties(expgradvib, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - if (showtooltip) { - strvib->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); - } - strvib->setAdjusterListener(this); - if (showtooltip) { - strvibab->set_tooltip_text(M("TP_LOCALLAB_GRADSTRAB_TOOLTIP")); - } - + strvibab->set_tooltip_text(M("TP_LOCALLAB_GRADSTRAB_TOOLTIP")); strvibab->setAdjusterListener(this); - if (showtooltip) { - strvibh->set_tooltip_text(M("TP_LOCALLAB_GRADSTRHUE_TOOLTIP")); - } - + strvibh->set_tooltip_text(M("TP_LOCALLAB_GRADSTRHUE_TOOLTIP")); strvibh->setAdjusterListener(this); - if (showtooltip) { - angvib->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); - } - + angvib->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); angvib->setAdjusterListener(this); setExpandAlignProperties(expmaskvib, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - if (showtooltip) { - expmaskvib->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); - } - showmaskvibMethod->append(M("TP_LOCALLAB_SHOWMNONE")); showmaskvibMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmaskvibMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); showmaskvibMethod->append(M("TP_LOCALLAB_SHOWMASK")); showmaskvibMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmaskvibMethod->set_active(0); - - if (showtooltip) { - showmaskvibMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmaskvibMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskvibMethodConn = showmaskvibMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabVibrance::showmaskvibMethodChanged)); enavibMaskConn = enavibMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabVibrance::enavibMaskChanged)); @@ -4346,29 +4147,14 @@ LocallabVibrance::LocallabVibrance(): CCmaskvibshape->setIdentityValue(0.); CCmaskvibshape->setResetCurve(FlatCurveType(defSpot.CCmaskvibcurve.at(0)), defSpot.CCmaskvibcurve); - - if (showtooltip) { - CCmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - CCmaskvibshape->setBottomBarColorProvider(this, 1); LLmaskvibshape->setIdentityValue(0.); LLmaskvibshape->setResetCurve(FlatCurveType(defSpot.LLmaskvibcurve.at(0)), defSpot.LLmaskvibcurve); - - if (showtooltip) { - LLmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - LLmaskvibshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); HHmaskvibshape->setIdentityValue(0.); HHmaskvibshape->setResetCurve(FlatCurveType(defSpot.HHmaskvibcurve.at(0)), defSpot.HHmaskvibcurve); - - if (showtooltip) { - HHmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - HHmaskvibshape->setCurveColorProvider(this, 2); HHmaskvibshape->setBottomBarColorProvider(this, 2); @@ -4390,11 +4176,6 @@ LocallabVibrance::LocallabVibrance(): mask2vibCurveEditorG->setCurveListener(this); Lmaskvibshape->setResetCurve(DiagonalCurveType(defSpot.Lmaskvibcurve.at(0)), defSpot.Lmaskvibcurve); - - if (showtooltip) { - Lmaskvibshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - } - Lmaskvibshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); Lmaskvibshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); @@ -4453,6 +4234,27 @@ void LocallabVibrance::getMaskView(int &colorMask, int &colorMaskinv, int &expMa vibMask = showmaskvibMethod->get_active_row_number(); } +void LocallabVibrance::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + warm->set_tooltip_text(M("TP_LOCALLAB_WARM_TOOLTIP")); + strvib->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); + expmaskvib->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + CCmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + LLmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + Lmaskvibshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + } else { + warm->set_tooltip_text(""); + strvib->set_tooltip_text(""); + expmaskvib->set_tooltip_text(""); + CCmaskvibshape->setTooltip(""); + LLmaskvibshape->setTooltip(""); + HHmaskvibshape->setTooltip(""); + Lmaskvibshape->setTooltip(""); + } +} + void LocallabVibrance::setDefaultExpanderVisibility() { expgradvib->set_expanded(false); @@ -5004,17 +4806,10 @@ LocallabSoft::LocallabSoft(): laplace(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPLACE"), 0., 100., 0.5, 25.))), sensisf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 1, 100, 1, 15))) { - const bool showtooltip = options.showtooltip; - // Parameter Soft light specific widgets softMethod->append(M("TP_LOCALLAB_SOFTM")); softMethod->append(M("TP_LOCALLAB_RETIM")); softMethod->set_active(0); - - if (showtooltip) { - softMethod->set_tooltip_markup(M("TP_LOCALLAB_SOFTMETHOD_TOOLTIP")); - } - softMethodConn = softMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabSoft::softMethodChanged)); showmasksoftMethod->append(M("TP_LOCALLAB_SHOWMNONE")); @@ -5025,11 +4820,7 @@ LocallabSoft::LocallabSoft(): showmasksoftMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmasksoftMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmasksoftMethod->set_active(0); - - if (showtooltip) { - showmasksoftMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKSOFT_TOOLTIP")); - } - + showmasksoftMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKSOFT_TOOLTIP")); showmasksoftMethodConn = showmasksoftMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabSoft::showmasksoftMethodChanged)); streng->setAdjusterListener(this); @@ -5061,6 +4852,15 @@ void LocallabSoft::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, softMask = showmasksoftMethod->get_active_row_number(); } +void LocallabSoft::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + softMethod->set_tooltip_markup(M("TP_LOCALLAB_SOFTMETHOD_TOOLTIP")); + } else { + softMethod->set_tooltip_text(""); + } +} + void LocallabSoft::disableListener() { LocallabTool::disableListener(); @@ -5327,7 +5127,6 @@ LocallabBlur::LocallabBlur(): strumaskbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUMASKCOL"), 0., 200., 0.1, 0.))), toolbl(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_TOOLCOL")))), blendmaskbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), - toolblFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_TOOLMASK")))), radmaskbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), -10.0, 1000.0, 0.1, 0.))), lapmaskbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPMASKCOL"), 0.0, 100.0, 0.1, 0.))), chromaskbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), @@ -5342,15 +5141,9 @@ LocallabBlur::LocallabBlur(): { const LocallabParams::LocallabSpot defSpot; - const bool showtooltip = options.showtooltip; - // Parameter Blur, Noise & Denoise specific widgets setExpandAlignProperties(expblnoise, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - if (showtooltip) { - expblnoise->set_tooltip_markup(M("TP_LOCALLAB_BLUMETHOD_TOOLTIP")); - } - blMethod->append(M("TP_LOCALLAB_BLUR")); blMethod->append(M("TP_LOCALLAB_BLMED")); blMethod->append(M("TP_LOCALLAB_BLGUID")); @@ -5359,10 +5152,6 @@ LocallabBlur::LocallabBlur(): fftwblConn = fftwbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::fftwblChanged)); - if (showtooltip) { - radius->set_tooltip_text(M("TP_LOCALLAB_RADIUS_TOOLTIP")); - } - radius->setAdjusterListener(this); strength->setAdjusterListener(this); @@ -5392,20 +5181,11 @@ LocallabBlur::LocallabBlur(): epsbl->setAdjusterListener(this); - if (showtooltip) { - sensibn->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); - } - sensibn->setAdjusterListener(this); blurMethod->append(M("TP_LOCALLAB_BLNORM")); blurMethod->append(M("TP_LOCALLAB_BLINV")); blurMethod->set_active(0); - - if (showtooltip) { - blurMethod->set_tooltip_markup(M("TP_LOCALLAB_BLMETHOD_TOOLTIP")); - } - blurMethodConn = blurMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabBlur::blurMethodChanged)); chroMethod->append(M("TP_LOCALLAB_BLLO")); @@ -5418,19 +5198,11 @@ LocallabBlur::LocallabBlur(): setExpandAlignProperties(expdenoise, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - if (showtooltip) { - expdenoise->set_tooltip_markup(M("TP_LOCALLAB_DENOI_TOOLTIP")); - } - LocalcurveEditorwavden->setCurveListener(this); wavshapeden->setIdentityValue(0.); wavshapeden->setResetCurve(FlatCurveType(defSpot.locwavcurveden.at(0)), defSpot.locwavcurveden); - if (showtooltip) { - wavshapeden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); - } - LocalcurveEditorwavden->curveListComplete(); noiselumf0->setAdjusterListener(this); @@ -5439,10 +5211,6 @@ LocallabBlur::LocallabBlur(): noiselumf2->setAdjusterListener(this); - if (showtooltip) { - noiselumc->set_tooltip_text(M("TP_LOCALLAB_NOISECHROC_TOOLTIP")); - } - noiselumc->setAdjusterListener(this); noiselumdetail->setAdjusterListener(this); @@ -5451,10 +5219,7 @@ LocallabBlur::LocallabBlur(): noisechrof->setAdjusterListener(this); - if (showtooltip) { - noisechroc->set_tooltip_text(M("TP_LOCALLAB_NOISECHROC_TOOLTIP")); - } - + noisechroc->set_tooltip_text(M("TP_LOCALLAB_NOISECHROC_TOOLTIP")); noisechroc->setAdjusterListener(this); noisechrodetail->setAdjusterListener(this); @@ -5469,21 +5234,13 @@ LocallabBlur::LocallabBlur(): setExpandAlignProperties(expmaskbl, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - if (showtooltip) { - expmaskbl->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); - } - showmaskblMethod->append(M("TP_LOCALLAB_SHOWMNONE")); showmaskblMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmaskblMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); showmaskblMethod->append(M("TP_LOCALLAB_SHOWMASK")); showmaskblMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmaskblMethod->set_active(0); - - if (showtooltip) { - showmaskblMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmaskblMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskblMethodConn = showmaskblMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabBlur::showmaskblMethodChanged)); enablMaskConn = enablMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::enablMaskChanged)); @@ -5492,29 +5249,14 @@ LocallabBlur::LocallabBlur(): CCmaskblshape->setIdentityValue(0.); CCmaskblshape->setResetCurve(FlatCurveType(defSpot.CCmaskblcurve.at(0)), defSpot.CCmaskblcurve); - - if (showtooltip) { - CCmaskblshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - CCmaskblshape->setBottomBarColorProvider(this, 1); LLmaskblshape->setIdentityValue(0.); LLmaskblshape->setResetCurve(FlatCurveType(defSpot.LLmaskblcurve.at(0)), defSpot.LLmaskblcurve); - - if (showtooltip) { - LLmaskblshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - LLmaskblshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); HHmaskblshape->setIdentityValue(0.); HHmaskblshape->setResetCurve(FlatCurveType(defSpot.HHmaskblcurve.at(0)), defSpot.HHmaskblcurve); - - if (showtooltip) { - HHmaskblshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - HHmaskblshape->setCurveColorProvider(this, 2); HHmaskblshape->setBottomBarColorProvider(this, 2); @@ -5526,18 +5268,8 @@ LocallabBlur::LocallabBlur(): blendmaskbl->setAdjusterListener(this); - toolblFrame->set_label_align(0.025, 0.5); - - if (showtooltip) { - radmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - radmaskbl->setAdjusterListener(this); - if (showtooltip) { - lapmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - lapmaskbl->setAdjusterListener(this); chromaskbl->setAdjusterListener(this); @@ -5551,11 +5283,6 @@ LocallabBlur::LocallabBlur(): mask2blCurveEditorG->setCurveListener(this); Lmaskblshape->setResetCurve(DiagonalCurveType(defSpot.Lmaskblcurve.at(0)), defSpot.Lmaskblcurve); - - if (showtooltip) { - Lmaskblshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - } - Lmaskblshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); Lmaskblshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); mask2blCurveEditorG->curveListComplete(); @@ -5564,11 +5291,6 @@ LocallabBlur::LocallabBlur(): LLmaskblshapewav->setIdentityValue(0.); LLmaskblshapewav->setResetCurve(FlatCurveType(defSpot.LLmaskblcurvewav.at(0)), defSpot.LLmaskblcurvewav); - - if (showtooltip) { - LLmaskblshapewav->setTooltip(M("TP_LOCALLAB_LMASK_LEVEL_TOOLTIP")); - } - LLmaskblshapewav->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); mask2blCurveEditorGwav->curveListComplete(); @@ -5628,6 +5350,8 @@ LocallabBlur::LocallabBlur(): Gtk::HSeparator* const separatorstrubl = Gtk::manage(new Gtk::HSeparator()); maskblBox->pack_start(*separatorstrubl, Gtk::PACK_SHRINK, 2); maskblBox->pack_start(*blendmaskbl, Gtk::PACK_SHRINK, 0); + Gtk::Frame* const toolblFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_TOOLMASK"))); + toolblFrame->set_label_align(0.025, 0.5); ToolParamBlock* const toolblBox = Gtk::manage(new ToolParamBlock()); toolblBox->pack_start(*radmaskbl, Gtk::PACK_SHRINK, 0); toolblBox->pack_start(*lapmaskbl, Gtk::PACK_SHRINK, 0); @@ -5664,6 +5388,43 @@ void LocallabBlur::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, blMask = showmaskblMethod->get_active_row_number(); } +void LocallabBlur::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + expblnoise->set_tooltip_markup(M("TP_LOCALLAB_BLUMETHOD_TOOLTIP")); + radius->set_tooltip_text(M("TP_LOCALLAB_RADIUS_TOOLTIP")); + sensibn->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); + blurMethod->set_tooltip_markup(M("TP_LOCALLAB_BLMETHOD_TOOLTIP")); + expdenoise->set_tooltip_markup(M("TP_LOCALLAB_DENOI_TOOLTIP")); + wavshapeden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); + noiselumc->set_tooltip_text(M("TP_LOCALLAB_NOISECHROC_TOOLTIP")); + expmaskbl->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + CCmaskblshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + LLmaskblshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmaskblshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + radmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + lapmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + Lmaskblshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + LLmaskblshapewav->setTooltip(M("TP_LOCALLAB_LMASK_LEVEL_TOOLTIP")); + } else { + expblnoise->set_tooltip_text(""); + radius->set_tooltip_text(""); + sensibn->set_tooltip_text(""); + blurMethod->set_tooltip_text(""); + expdenoise->set_tooltip_text(""); + wavshapeden->setTooltip(""); + noiselumc->set_tooltip_text(""); + expmaskbl->set_tooltip_text(""); + CCmaskblshape->setTooltip(""); + LLmaskblshape->setTooltip(""); + HHmaskblshape->setTooltip(""); + radmaskbl->set_tooltip_text(""); + lapmaskbl->set_tooltip_text(""); + Lmaskblshape->setTooltip(""); + LLmaskblshapewav->setTooltip(""); + } +} + void LocallabBlur::setDefaultExpanderVisibility() { expblnoise->set_expanded(false); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 239ccc9978..87bcb955df 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -121,6 +121,9 @@ class LocallabTool: virtual void resetMaskView() {}; virtual void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) {}; + // Advice tooltips management function + virtual void updateAdviceTooltips(const bool showTooltips) {}; + /* Notes: - callerId #1: Mask CC shape (bottom bar) + Color CC/LC shape (left bar) - callerId #2: Mask HH shape (main curve and bottom bar) @@ -253,6 +256,8 @@ class LocallabColor: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -306,7 +311,6 @@ class LocallabExposure: Adjuster* const linear; Adjuster* const balanexp; Adjuster* const gamm; - Gtk::HBox* const ctboxexpmethod; MyComboBoxText* const exnoiseMethod; Gtk::Frame* const fatFrame; Adjuster* const fatamount; @@ -361,6 +365,8 @@ class LocallabExposure: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -407,7 +413,6 @@ class LocallabShadow: Adjuster* const sh_radius; Adjuster* const sensihs; Adjuster* const blurSHde; - Gtk::Frame* const gamFrame; Adjuster* const gamSH; Adjuster* const sloSH; MyExpander* const expgradsh; @@ -443,6 +448,8 @@ class LocallabShadow: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -518,6 +525,8 @@ class LocallabVibrance: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -571,6 +580,8 @@ class LocallabSoft: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void disableListener() override; void enableListener() override; void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override; @@ -641,7 +652,6 @@ class LocallabBlur: Adjuster* const strumaskbl; Gtk::CheckButton* const toolbl; Adjuster* const blendmaskbl; - Gtk::Frame* const toolblFrame; Adjuster* const radmaskbl; Adjuster* const lapmaskbl; Adjuster* const chromaskbl; @@ -663,6 +673,8 @@ class LocallabBlur: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -740,6 +752,8 @@ class LocallabTone: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -769,7 +783,6 @@ class LocallabRetinex: { private: // Retinex specific widgets - Gtk::Frame* const dehaFrame; Adjuster* const dehaz; Adjuster* const depth; Gtk::CheckButton* const lumonly; @@ -778,7 +791,6 @@ class LocallabRetinex: Gtk::CheckButton* const loglin; Adjuster* const sensih; Gtk::Frame* const retitoolFrame; - ToolParamBlock* const retiBox; MyComboBoxText* const retinexMethod; Gtk::CheckButton* const fftwreti; Gtk::CheckButton* const equilret; @@ -801,7 +813,6 @@ class LocallabRetinex: CurveEditorGroup* const LocalcurveEditorgainT; FlatCurveEditor* const cTgainshape; MyExpander* const expmaskreti; - ToolParamBlock* const maskretiBox; MyComboBoxText* const showmaskretiMethod; Gtk::CheckButton* const enaretiMask; Gtk::CheckButton* const enaretiMasktmap; @@ -830,6 +841,8 @@ class LocallabRetinex: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -875,7 +888,6 @@ class LocallabSharp: Adjuster* const sharblur; Adjuster* const sensisha; Gtk::CheckButton* const inverssha; - Gtk::Frame* const sharFrame; MyComboBoxText* const showmasksharMethod; sigc::connection inversshaConn, showmasksharMethodConn; @@ -886,6 +898,8 @@ class LocallabSharp: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void disableListener() override; void enableListener() override; void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override; @@ -922,7 +936,6 @@ class LocallabContrast: MyExpander* const expresidpyr; Adjuster* const residcont; Adjuster* const residchro; - Gtk::Frame* const shresFrame; Adjuster* const residsha; Adjuster* const residshathr; Adjuster* const residhi; @@ -934,14 +947,11 @@ class LocallabContrast: Adjuster* const clarisoft; Gtk::CheckButton* const origlc; MyExpander* const expcontrastpyr; - Gtk::Frame* const gradwavFrame; Gtk::CheckButton* const wavgradl; Adjuster* const sigmalc2; Adjuster* const strwav; Adjuster* const angwav; - Gtk::Frame* const edgFrame; Gtk::CheckButton* const wavedg; - ToolParamBlock* const edgsBox; Adjuster* const strengthw; Adjuster* const sigmaed; CurveEditorGroup* const LocalcurveEditorwavedg; @@ -956,9 +966,7 @@ class LocallabContrast: Adjuster* const thigw; Adjuster* const edgw; Adjuster* const basew; - Gtk::Label* const labmNP; MyComboBoxText* const localneiMethod; - Gtk::Frame* const blurlevelFrame; Gtk::CheckButton* const wavblur; Adjuster* const levelblur; Adjuster* const sigmabl; @@ -968,21 +976,18 @@ class LocallabContrast: Adjuster* const residblur; Gtk::CheckButton* const blurlc; MyExpander* const expcontrastpyr2; - Gtk::Frame* const contFrame; Gtk::CheckButton* const wavcont; Adjuster* const sigma; Adjuster* const offset; Adjuster* const chromalev; CurveEditorGroup* const LocalcurveEditorwavcon; FlatCurveEditor* const wavshapecon; - Gtk::Frame* const compreFrame; Gtk::CheckButton* const wavcompre; CurveEditorGroup* const LocalcurveEditorwavcompre; FlatCurveEditor* const wavshapecompre; Adjuster* const sigmadr; Adjuster* const threswav; Adjuster* const residcomp; - Gtk::Frame* const compFrame; Gtk::CheckButton* const wavcomp; Adjuster* const sigmadc; Adjuster* const deltad; @@ -1012,6 +1017,8 @@ class LocallabContrast: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -1064,7 +1071,6 @@ class LocallabCBDL: Adjuster* const chromacbdl; Adjuster* const threshold; Adjuster* const blurcbdl; - Gtk::Frame* const residFrame; Adjuster* const clarityml; Adjuster* const contresid; Adjuster* const softradiuscb; @@ -1100,6 +1106,8 @@ class LocallabCBDL: void resetMaskView() override; void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask) override; + void updateAdviceTooltips(const bool showTooltips) override; + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -1130,19 +1138,16 @@ class LocallabLog: public LocallabTool { private: - Gtk::Frame* const logPFrame; Gtk::ToggleButton* const autocompute; Adjuster* const blackEv; Adjuster* const whiteEv; Gtk::CheckButton* const fullimage; - Gtk::Frame* const logFrame; Gtk::CheckButton* const Autogray; Adjuster* const sourceGray; Adjuster* const targetGray; Adjuster* const detail; Adjuster* const baselog; Adjuster* const sensilog; - Gtk::Frame* const gradlogFrame; Adjuster* const strlog; Adjuster* const anglog; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 34c5b3acd5..39e1df1696 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -145,15 +145,9 @@ LocallabTone::LocallabTone(): mask2tmCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK2"))), Lmasktmshape(static_cast(mask2tmCurveEditorG->addCurve(CT_Diagonal, "L(L)"))) { - const bool showtooltip = options.showtooltip; - const LocallabParams::LocallabSpot defSpot; // Parameter Tone Mapping specific widgets - if (showtooltip) { - exp->set_tooltip_text(M("TP_LOCALLAB_TONEMAP_TOOLTIP")); - } - amount->setAdjusterListener(this); stren->setAdjusterListener(this); @@ -166,44 +160,24 @@ LocallabTone::LocallabTone(): estop->setAdjusterListener(this); - if (showtooltip) { - estop->set_tooltip_text(M("TP_LOCALLAB_TONEMAPESTOP_TOOLTIP")); - } - scaltm->setAdjusterListener(this); rewei->setAdjusterListener(this); - if (showtooltip) { - rewei->set_tooltip_text(M("TP_LOCALLAB_TONEMAPESTOP_TOOLTIP")); - } - softradiustm->setLogScale(10, -10); softradiustm->setAdjusterListener(this); sensitm->setAdjusterListener(this); - if (showtooltip) { - sensitm->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); - } - setExpandAlignProperties(expmasktm, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - if (showtooltip) { - expmasktm->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); - } - showmasktmMethod->append(M("TP_LOCALLAB_SHOWMNONE")); showmasktmMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmasktmMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); showmasktmMethod->append(M("TP_LOCALLAB_SHOWMASK")); showmasktmMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmasktmMethod->set_active(0); - - if (showtooltip) { - showmasktmMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmasktmMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmasktmMethodConn = showmasktmMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabTone::showmasktmMethodChanged)); enatmMaskConn = enatmMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabTone::enatmMaskChanged)); @@ -214,29 +188,14 @@ LocallabTone::LocallabTone(): CCmasktmshape->setIdentityValue(0.); CCmasktmshape->setResetCurve(FlatCurveType(defSpot.CCmasktmcurve.at(0)), defSpot.CCmasktmcurve); - - if (showtooltip) { - CCmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - CCmasktmshape->setBottomBarColorProvider(this, 1); LLmasktmshape->setIdentityValue(0.); LLmasktmshape->setResetCurve(FlatCurveType(defSpot.LLmasktmcurve.at(0)), defSpot.LLmasktmcurve); - - if (showtooltip) { - LLmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - LLmasktmshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); HHmasktmshape->setIdentityValue(0.); HHmasktmshape->setResetCurve(FlatCurveType(defSpot.HHmasktmcurve.at(0)), defSpot.HHmasktmcurve); - - if (showtooltip) { - HHmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - HHmasktmshape->setCurveColorProvider(this, 2); HHmasktmshape->setBottomBarColorProvider(this, 2); @@ -246,17 +205,9 @@ LocallabTone::LocallabTone(): lapmasktm->setAdjusterListener(this); - if (showtooltip) { - lapmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - radmasktm->setLogScale(10, -10); radmasktm->setAdjusterListener(this); - if (showtooltip) { - radmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - chromasktm->setAdjusterListener(this); gammasktm->setAdjusterListener(this); @@ -265,11 +216,6 @@ LocallabTone::LocallabTone(): mask2tmCurveEditorG->setCurveListener(this); Lmasktmshape->setResetCurve(DiagonalCurveType(defSpot.Lmasktmcurve.at(0)), defSpot.Lmasktmcurve); - - if (showtooltip) { - Lmasktmshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - } - Lmasktmshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); Lmasktmshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); @@ -320,6 +266,35 @@ void LocallabTone::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, tmMask = showmasktmMethod->get_active_row_number(); } +void LocallabTone::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + exp->set_tooltip_text(M("TP_LOCALLAB_TONEMAP_TOOLTIP")); + estop->set_tooltip_text(M("TP_LOCALLAB_TONEMAPESTOP_TOOLTIP")); + rewei->set_tooltip_text(M("TP_LOCALLAB_TONEMAPESTOP_TOOLTIP")); + sensitm->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); + expmasktm->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + CCmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + LLmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + lapmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + radmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + Lmasktmshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + } else { + exp->set_tooltip_text(""); + estop->set_tooltip_text(""); + rewei->set_tooltip_text(""); + sensitm->set_tooltip_text(""); + expmasktm->set_tooltip_text(""); + CCmasktmshape->setTooltip(""); + LLmasktmshape->setTooltip(""); + HHmasktmshape->setTooltip(""); + lapmasktm->set_tooltip_text(""); + radmasktm->set_tooltip_text(""); + Lmasktmshape->setTooltip(""); + } +} + void LocallabTone::setDefaultExpanderVisibility() { expmasktm->set_expanded(false); @@ -737,7 +712,6 @@ LocallabRetinex::LocallabRetinex(): LocallabTool(this, M("TP_LOCALLAB_RET_TOOLNAME"), M("TP_LOCALLAB_RETI"), true), // Retinex specific widgets - 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")))), @@ -746,7 +720,6 @@ LocallabRetinex::LocallabRetinex(): loglin(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_LOGLIN")))), sensih(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIH"), 0, 100, 1, 60))), retitoolFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RETITOOLFRA")))), - retiBox(Gtk::manage(new ToolParamBlock())), retinexMethod(Gtk::manage(new MyComboBoxText())), fftwreti(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTW")))), equilret(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_EQUIL")))), @@ -769,7 +742,6 @@ LocallabRetinex::LocallabRetinex(): LocalcurveEditorgainT(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_TRANSMISSIONGAIN"))), cTgainshape(static_cast(LocalcurveEditorgainT->addCurve(CT_Flat, "", nullptr, false, false))), expmaskreti(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWR")))), - maskretiBox(Gtk::manage(new ToolParamBlock())), showmaskretiMethod(Gtk::manage(new MyComboBoxText())), enaretiMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), enaretiMasktmap(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_TM_MASK")))), @@ -787,17 +759,10 @@ LocallabRetinex::LocallabRetinex(): Lmaskretishape(static_cast(mask2retiCurveEditorG->addCurve(CT_Diagonal, "L(L)"))), inversret(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))) { - const bool showtooltip = options.showtooltip; - const LocallabParams::LocallabSpot defSpot; // Parameter Retinex specific widgets - dehaFrame->set_label_align(0.025, 0.5); - - if (showtooltip) { - dehaz->set_tooltip_text(M("TP_LOCALLAB_DEHAZ_TOOLTIP")); - } - + dehaz->set_tooltip_text(M("TP_LOCALLAB_DEHAZ_TOOLTIP")); dehaz->setAdjusterListener(this); depth->setAdjusterListener(this); @@ -810,10 +775,6 @@ LocallabRetinex::LocallabRetinex(): loglinConn = loglin->signal_toggled().connect(sigc::mem_fun(*this, &LocallabRetinex::loglinChanged)); - if (showtooltip) { - sensih->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); - } - sensih->setAdjusterListener(this); retitoolFrame->set_label_align(0.025, 0.5); @@ -822,31 +783,15 @@ LocallabRetinex::LocallabRetinex(): retinexMethod->append(M("TP_RETINEX_UNIFORM")); retinexMethod->append(M("TP_RETINEX_HIGH")); retinexMethod->set_active(0); - - if (showtooltip) { - retinexMethod->set_tooltip_markup(M("TP_LOCRETI_METHOD_TOOLTIP")); - } - + retinexMethod->set_tooltip_markup(M("TP_LOCRETI_METHOD_TOOLTIP")); retinexMethodConn = retinexMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabRetinex::retinexMethodChanged)); - if (showtooltip) { - fftwreti->set_tooltip_text(M("TP_LOCALLAB_RETI_FFTW_TOOLTIP")); - } - fftwretiConn = fftwreti->signal_toggled().connect(sigc::mem_fun(*this, &LocallabRetinex::fftwretiChanged)); equilretConn = equilret->signal_toggled().connect(sigc::mem_fun(*this, &LocallabRetinex::equilretChanged)); - if (showtooltip) { - neigh->set_tooltip_text(M("TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP")); - } - neigh->setAdjusterListener(this); - if (showtooltip) { - vart->set_tooltip_text(M("TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP")); - } - vart->setAdjusterListener(this); scalereti->setAdjusterListener(this); @@ -865,10 +810,6 @@ LocallabRetinex::LocallabRetinex(): cliptm->setAdjusterListener(this); - if (showtooltip) { - softradiusret->set_tooltip_text(M("TP_LOCALLAB_GUIDFILTER_TOOLTIP")); - } - softradiusret->setLogScale(10, -10); softradiusret->setAdjusterListener(this); @@ -877,22 +818,10 @@ LocallabRetinex::LocallabRetinex(): cTtransshape->setIdentityValue(0.); cTtransshape->setResetCurve(FlatCurveType(defSpot.localTtranscurve.at(0)), defSpot.localTtranscurve); - if (showtooltip) { - cTtransshape->setTooltip(M("TP_LOCALLAB_TRANSMISSION_TOOLTIP")); - } - LocalcurveEditortransT->curveListComplete(); - if (showtooltip) { - mMLabels->set_tooltip_markup(M("TP_LOCALLAB_MLABEL_TOOLTIP")); - } - setExpandAlignProperties(mMLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); - if (showtooltip) { - transLabels->set_tooltip_markup(M("TP_LOCALLAB_TLABEL_TOOLTIP")); - } - setExpandAlignProperties(transLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); setExpandAlignProperties(transLabels2, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); @@ -902,16 +831,8 @@ LocallabRetinex::LocallabRetinex(): cTgainshape->setIdentityValue(0.); cTgainshape->setResetCurve(FlatCurveType(defSpot.localTgaincurve.at(0)), defSpot.localTgaincurve); - if (showtooltip) { - cTgainshape->setTooltip(M("TP_RETINEX_GAINTRANSMISSION_TOOLTIP")); - } - LocalcurveEditorgainT->curveListComplete(); - if (showtooltip) { - expmaskreti->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); - } - setExpandAlignProperties(expmaskreti, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); showmaskretiMethod->append(M("TP_LOCALLAB_SHOWMNONE")); @@ -920,48 +841,25 @@ LocallabRetinex::LocallabRetinex(): showmaskretiMethod->append(M("TP_LOCALLAB_SHOWMASK")); showmaskretiMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmaskretiMethod->set_active(0); - - if (showtooltip) { - showmaskretiMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmaskretiMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskretiMethodConn = showmaskretiMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabRetinex::showmaskretiMethodChanged)); enaretiMaskConn = enaretiMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabRetinex::enaretiMaskChanged)); - if (showtooltip) { - enaretiMasktmap->set_tooltip_markup(M("TP_LOCALLAB_ENARETIMASKTMAP_TOOLTIP")); - } - enaretiMasktmapConn = enaretiMasktmap->signal_toggled().connect(sigc::mem_fun(*this, &LocallabRetinex::enaretiMasktmapChanged)); maskretiCurveEditorG->setCurveListener(this); CCmaskretishape->setIdentityValue(0.); CCmaskretishape->setResetCurve(FlatCurveType(defSpot.CCmaskreticurve.at(0)), defSpot.CCmaskreticurve); - - if (showtooltip) { - CCmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - CCmaskretishape->setBottomBarColorProvider(this, 1); LLmaskretishape->setIdentityValue(0.); LLmaskretishape->setResetCurve(FlatCurveType(defSpot.LLmaskreticurve.at(0)), defSpot.LLmaskreticurve); - - if (showtooltip) { - LLmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - LLmaskretishape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); HHmaskretishape->setIdentityValue(0.); HHmaskretishape->setResetCurve(FlatCurveType(defSpot.HHmaskreticurve.at(0)), defSpot.HHmaskreticurve); - - if (showtooltip) { - HHmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - HHmaskretishape->setCurveColorProvider(this, 2); HHmaskretishape->setBottomBarColorProvider(this, 2); @@ -969,16 +867,8 @@ LocallabRetinex::LocallabRetinex(): blendmaskreti->setAdjusterListener(this); - if (showtooltip) { - radmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - radmaskreti->setAdjusterListener(this); - if (showtooltip) { - lapmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - lapmaskreti->setAdjusterListener(this); chromaskreti->setAdjusterListener(this); @@ -990,11 +880,6 @@ LocallabRetinex::LocallabRetinex(): mask2retiCurveEditorG->setCurveListener(this); Lmaskretishape->setResetCurve(DiagonalCurveType(defSpot.Lmaskreticurve.at(0)), defSpot.Lmaskreticurve); - - if (showtooltip) { - Lmaskretishape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - } - Lmaskretishape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); Lmaskretishape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); @@ -1004,6 +889,8 @@ LocallabRetinex::LocallabRetinex(): // Add Retinex specific widgets to GUI ToolParamBlock* const auxBox = Gtk::manage(new ToolParamBlock()); + Gtk::Frame* const dehaFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_DEHAFRA"))); + dehaFrame->set_label_align(0.025, 0.5); ToolParamBlock* const dehaBox = Gtk::manage(new ToolParamBlock()); dehaBox->pack_start(*dehaz); dehaBox->pack_start(*depth); @@ -1019,6 +906,7 @@ LocallabRetinex::LocallabRetinex(): scopeBox->pack_start(*sensih); auxBox->add(*scopeBox); pack_start(*auxBox); + ToolParamBlock* const retiBox = Gtk::manage(new ToolParamBlock()); retiBox->pack_start(*retinexMethod); retiBox->pack_start(*fftwreti); retiBox->pack_start(*equilret); @@ -1040,6 +928,7 @@ LocallabRetinex::LocallabRetinex(): toolretiBox->pack_start(*LocalcurveEditorgainT, Gtk::PACK_SHRINK, 4); expretitools->add(*toolretiBox, false); retiBox->pack_start(*expretitools, false, false); + ToolParamBlock* const maskretiBox = Gtk::manage(new ToolParamBlock()); maskretiBox->pack_start(*showmaskretiMethod, Gtk::PACK_SHRINK, 4); maskretiBox->pack_start(*enaretiMask, Gtk::PACK_SHRINK, 0); maskretiBox->pack_start(*enaretiMasktmap, Gtk::PACK_SHRINK, 0); @@ -1107,6 +996,47 @@ void LocallabRetinex::getMaskView(int &colorMask, int &colorMaskinv, int &expMas retiMask = showmaskretiMethod->get_active_row_number(); } +void LocallabRetinex::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + sensih->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); + fftwreti->set_tooltip_text(M("TP_LOCALLAB_RETI_FFTW_TOOLTIP")); + neigh->set_tooltip_text(M("TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP")); + vart->set_tooltip_text(M("TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP")); + softradiusret->set_tooltip_text(M("TP_LOCALLAB_GUIDFILTER_TOOLTIP")); + cTtransshape->setTooltip(M("TP_LOCALLAB_TRANSMISSION_TOOLTIP")); + mMLabels->set_tooltip_markup(M("TP_LOCALLAB_MLABEL_TOOLTIP")); + transLabels->set_tooltip_markup(M("TP_LOCALLAB_TLABEL_TOOLTIP")); + cTgainshape->setTooltip(M("TP_RETINEX_GAINTRANSMISSION_TOOLTIP")); + expmaskreti->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + enaretiMasktmap->set_tooltip_markup(M("TP_LOCALLAB_ENARETIMASKTMAP_TOOLTIP")); + CCmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + LLmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + radmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + lapmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + Lmaskretishape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + } else { + sensih->set_tooltip_text(""); + fftwreti->set_tooltip_text(""); + neigh->set_tooltip_text(""); + vart->set_tooltip_text(""); + softradiusret->set_tooltip_text(""); + cTtransshape->setTooltip(""); + mMLabels->set_tooltip_text(""); + transLabels->set_tooltip_text(""); + cTgainshape->setTooltip(""); + expmaskreti->set_tooltip_text(""); + enaretiMasktmap->set_tooltip_text(""); + CCmaskretishape->setTooltip(""); + LLmaskretishape->setTooltip(""); + HHmaskretishape->setTooltip(""); + radmaskreti->set_tooltip_text(""); + lapmaskreti->set_tooltip_text(""); + Lmaskretishape->setTooltip(""); + } +} + void LocallabRetinex::setDefaultExpanderVisibility() { expretitools->set_expanded(false); @@ -1754,16 +1684,9 @@ LocallabSharp::LocallabSharp(): sharblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARBLUR"), 0.2, 2.0, 0.05, 0.2))), sensisha(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 19))), inverssha(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), - sharFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHARFRAME")))), showmasksharMethod(Gtk::manage(new MyComboBoxText())) { - const bool showtooltip = options.showtooltip; - // Parameter Sharpening specific widgets - if (showtooltip) { - exp->set_tooltip_text(M("TP_LOCALLAB_EXPSHARP_TOOLTIP")); - } - sharcontrast->setAdjusterListener(this); sharradius->setAdjusterListener(this); @@ -1776,25 +1699,15 @@ LocallabSharp::LocallabSharp(): sharblur->setAdjusterListener(this); - if (showtooltip) { - sensisha->set_tooltip_text(M("TP_LOCALLAB_SENSIS_TOOLTIP")); - } - sensisha->setAdjusterListener(this); inversshaConn = inverssha->signal_toggled().connect(sigc::mem_fun(*this, &LocallabSharp::inversshaChanged)); - sharFrame->set_label_align(0.025, 0.5); - showmasksharMethod->append(M("TP_LOCALLAB_SHOWMNONE")); showmasksharMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmasksharMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmasksharMethod->set_active(0); - - if (showtooltip) { - showmasksharMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmasksharMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmasksharMethodConn = showmasksharMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabSharp::showmasksharMethodChanged)); // Add Sharpening specific widgets to GUI @@ -1806,6 +1719,8 @@ LocallabSharp::LocallabSharp(): pack_start(*sharblur); pack_start(*sensisha); pack_start(*inverssha); + Gtk::Frame* const sharFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHARFRAME"))); + sharFrame->set_label_align(0.025, 0.5); ToolParamBlock* const sharfBox = Gtk::manage(new ToolParamBlock()); sharfBox->pack_start(*showmasksharMethod); sharFrame->add(*sharfBox); @@ -1824,6 +1739,17 @@ void LocallabSharp::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, sharMask = showmasksharMethod->get_active_row_number(); } +void LocallabSharp::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + exp->set_tooltip_text(M("TP_LOCALLAB_EXPSHARP_TOOLTIP")); + sensisha->set_tooltip_text(M("TP_LOCALLAB_SENSIS_TOOLTIP")); + } else { + exp->set_tooltip_text(""); + sensisha->set_tooltip_text(""); + } +} + void LocallabSharp::disableListener() { LocallabTool::disableListener(); @@ -2065,7 +1991,6 @@ LocallabContrast::LocallabContrast(): expresidpyr(Gtk::manage(new MyExpander(false, Gtk::manage(new Gtk::HBox())))), residcont(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCONT"), -100, 100, 1, 0))), residchro(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCHRO"), -100., 100., 1., 0.))), - shresFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHRESFRA")))), residsha(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDSHA"), -100., 100., 1., 0.))), residshathr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDSHATHR"), 0., 100., 1., 30.))), residhi(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDHI"), -100., 100., 1., 0.))), @@ -2077,14 +2002,11 @@ LocallabContrast::LocallabContrast(): clarisoft(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), -10.0, 1000.0, 0.5, 1.))), origlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ORIGLC")))), expcontrastpyr(Gtk::manage(new MyExpander(false, Gtk::manage(new Gtk::HBox())))), - gradwavFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADWAVFRA")))), wavgradl(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_GRALWFRA")))), sigmalc2(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))), strwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -4.0, 4.0, 0.05, 0.))), angwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -180, 180, 0.1, 0.))), - edgFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_EDGSHARPFRA")))), wavedg(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_EDGFRA")))), - edgsBox(Gtk::manage(new ToolParamBlock())), strengthw(Gtk::manage(new Adjuster(M("TP_WAVELET_EDVAL"), 0., 100.0, 0.5, 0.))), sigmaed(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))), LocalcurveEditorwavedg(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVEDG"))), @@ -2099,9 +2021,7 @@ LocallabContrast::LocallabContrast(): thigw(Gtk::manage(new Adjuster(M("TP_WAVELET_EDGEDETECTTHR2"), -10., 100.0, 1., 0.))), edgw(Gtk::manage(new Adjuster(M("TP_WAVELET_EDGESENSI"), 0., 100.0, 1., 60.))), basew(Gtk::manage(new Adjuster(M("TP_WAVELET_EDGEAMPLI"), 0., 100.0, 1., 10.))), - labmNP(Gtk::manage(new Gtk::Label(M("TP_WAVELET_NPTYPE") + ":"))), localneiMethod(Gtk::manage(new MyComboBoxText())), - blurlevelFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_BLURLEVELFRA")))), wavblur(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLURLEVELFRA")))), levelblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELBLUR"), 0., 100., 0.5, 0.))), sigmabl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))), @@ -2111,21 +2031,18 @@ LocallabContrast::LocallabContrast(): residblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDBLUR"), 0., 100., 0.5, 0.))), blurlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLURLC")))), expcontrastpyr2(Gtk::manage(new MyExpander(false, Gtk::manage(new Gtk::HBox())))), - contFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CONTFRA")))), wavcont(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_CONTFRA")))), sigma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))), offset(Gtk::manage(new Adjuster(M("TP_LOCALLAB_OFFSETWAV"), 0.33, 1.66, 0.01, 1., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), chromalev(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMALEV"), 0.1, 5., 0.1, 1.))), LocalcurveEditorwavcon(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVCON"))), wavshapecon(static_cast(LocalcurveEditorwavcon->addCurve(CT_Flat, "", nullptr, false, false))), - compreFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_COMPREFRA")))), wavcompre(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_COMPREFRA")))), LocalcurveEditorwavcompre(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVCOMPRE"))), wavshapecompre(static_cast(LocalcurveEditorwavcompre->addCurve(CT_Flat, "", nullptr, false, false))), sigmadr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))), threswav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRESWAV"), 0.9, 2., 0.01, 1.4))), residcomp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCOMP"), -1., 1., 0.01, 0.))), - compFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_COMPFRA")))), wavcomp(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_COMPFRA")))), sigmadc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 3., 0.01, 1.))), deltad(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DELTAD"), -3., 3., 0.1, 0.))),//, Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), @@ -2146,15 +2063,9 @@ LocallabContrast::LocallabContrast(): mask2lcCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK2"))), Lmasklcshape(static_cast(mask2lcCurveEditorG->addCurve(CT_Diagonal, "L(L)"))) { - const bool showtooltip = options.showtooltip; - const LocallabParams::LocallabSpot defSpot; // Parameter Local contrast specific widgets - if (showtooltip) { - exp->set_tooltip_text(M("TP_LOCALLAB_EXPCONTRAST_TOOLTIP")); - } - localcontMethod->append(M("TP_LOCALLAB_LOCCONT")); localcontMethod->append(M("TP_LOCALLAB_WAVE")); localcontMethod->set_active(0); @@ -2177,10 +2088,6 @@ LocallabContrast::LocallabContrast(): LocalcurveEditorwav->curveListComplete(); - if (showtooltip) { - levelwav->set_tooltip_markup(M("TP_LOCALLAB_LEVELWAV_TOOLTIP")); - } - levelwav->setAdjusterListener(this); csThreshold->setAdjusterListener(this); @@ -2197,8 +2104,6 @@ LocallabContrast::LocallabContrast(): residchro->setAdjusterListener(this); - shresFrame->set_label_align(0.025, 0.5); - residsha->setAdjusterListener(this); residshathr->setAdjusterListener(this); @@ -2209,20 +2114,12 @@ LocallabContrast::LocallabContrast(): sensilc->setAdjusterListener(this); - if (showtooltip) { - clariFrame->set_tooltip_markup(M("TP_LOCALLAB_CLARI_TOOLTIP")); - } - clariFrame->set_label_align(0.025, 0.5); clarilres->setAdjusterListener(this); claricres->setAdjusterListener(this); - if (showtooltip) { - clarisoft->set_tooltip_markup(M("TP_LOCALLAB_CLARISOFT_TOOLTIP")); - } - clarisoft->setLogScale(10, -10); clarisoft->setAdjusterListener(this); @@ -2236,8 +2133,6 @@ LocallabContrast::LocallabContrast(): expcontrastpyr->setLabel(LCTitleHBox); setExpandAlignProperties(expcontrastpyr, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - gradwavFrame->set_label_align(0.025, 0.5); - wavgradlConn = wavgradl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavgradlChanged)); sigmalc2->setAdjusterListener(this); @@ -2246,12 +2141,6 @@ LocallabContrast::LocallabContrast(): angwav->setAdjusterListener(this); - edgFrame->set_label_align(0.025, 0.5); - - if (showtooltip) { - wavedg->set_tooltip_text(M("TP_LOCALLAB_WAVEEDG_TOOLTIP")); - } - wavedgConn = wavedg->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavedgChanged)); strengthw->setAdjusterListener(this); @@ -2293,8 +2182,6 @@ LocallabContrast::LocallabContrast(): localneiMethod->set_active(0); localneiMethodConn = localneiMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabContrast::localneiMethodChanged)); - blurlevelFrame->set_label_align(0.025, 0.5); - wavblurConn = wavblur->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavblurChanged)); levelblur->setAdjusterListener(this); @@ -2322,8 +2209,6 @@ LocallabContrast::LocallabContrast(): expcontrastpyr2->setLabel(LCTitleHBox2); setExpandAlignProperties(expcontrastpyr2, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - contFrame->set_label_align(0.025, 0.5); - wavcontConn = wavcont->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavcontChanged)); sigma->setAdjusterListener(this); @@ -2332,11 +2217,6 @@ LocallabContrast::LocallabContrast(): chromalev->setAdjusterListener(this); - if (showtooltip) { - chromalev->set_tooltip_text(M("TP_LOCALLAB_CHROMABLU_TOOLTIP")); - chromablu->set_tooltip_text(M("TP_LOCALLAB_CHROMABLU_TOOLTIP")); - } - LocalcurveEditorwavcon->setCurveListener(this); wavshapecon->setIdentityValue(0.); @@ -2344,18 +2224,13 @@ LocallabContrast::LocallabContrast(): LocalcurveEditorwavcon->curveListComplete(); - compreFrame->set_label_align(0.025, 0.5); - wavcompreConn = wavcompre->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavcompreChanged)); LocalcurveEditorwavcompre->setCurveListener(this); wavshapecompre->setIdentityValue(0.); wavshapecompre->setResetCurve(FlatCurveType(defSpot.loccomprewavcurve.at(0)), defSpot.loccomprewavcurve); - - if (showtooltip) { - wavshapecompre->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - } + wavshapecompre->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); LocalcurveEditorwavcompre->curveListComplete(); @@ -2365,8 +2240,6 @@ LocallabContrast::LocallabContrast(): residcomp->setAdjusterListener(this); - compFrame->set_label_align(0.025, 0.5); - wavcompConn = wavcomp->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavcompChanged)); sigmadc->setAdjusterListener(this); @@ -2383,16 +2256,8 @@ LocallabContrast::LocallabContrast(): fatres->setAdjusterListener(this); - if (showtooltip) { - fftwlc->set_tooltip_text(M("TP_LOCALLAB_LC_FFTW_TOOLTIP")); - } - fftwlcConn = fftwlc->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::fftwlcChanged)); - if (showtooltip) { - expmasklc->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); - } - setExpandAlignProperties(expmasklc, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); showmasklcMethod->append(M("TP_LOCALLAB_SHOWMNONE")); @@ -2401,11 +2266,7 @@ LocallabContrast::LocallabContrast(): showmasklcMethod->append(M("TP_LOCALLAB_SHOWMASK")); showmasklcMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmasklcMethod->set_active(0); - - if (showtooltip) { - showmasklcMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmasklcMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmasklcMethodConn = showmasklcMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabContrast::showmasklcMethodChanged)); enalcMaskConn = enalcMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::enalcMaskChanged)); @@ -2414,29 +2275,14 @@ LocallabContrast::LocallabContrast(): CCmasklcshape->setIdentityValue(0.); CCmasklcshape->setResetCurve(FlatCurveType(defSpot.CCmasklccurve.at(0)), defSpot.CCmasklccurve); - - if (showtooltip) { - CCmasklcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - CCmasklcshape->setBottomBarColorProvider(this, 1); LLmasklcshape->setIdentityValue(0.); LLmasklcshape->setResetCurve(FlatCurveType(defSpot.LLmasklccurve.at(0)), defSpot.LLmasklccurve); - - if (showtooltip) { - LLmasklcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - LLmasklcshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); HHmasklcshape->setIdentityValue(0.); HHmasklcshape->setResetCurve(FlatCurveType(defSpot.HHmasklccurve.at(0)), defSpot.HHmasklccurve); - - if (showtooltip) { - HHmasklcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - HHmasklcshape->setCurveColorProvider(this, 2); HHmasklcshape->setBottomBarColorProvider(this, 2); @@ -2452,11 +2298,6 @@ LocallabContrast::LocallabContrast(): mask2lcCurveEditorG->setCurveListener(this); Lmasklcshape->setResetCurve(DiagonalCurveType(defSpot.Lmasklccurve.at(0)), defSpot.Lmasklccurve); - - if (showtooltip) { - Lmasklcshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - } - Lmasklcshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); Lmasklcshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); @@ -2472,6 +2313,8 @@ LocallabContrast::LocallabContrast(): pack_start(*LocalcurveEditorwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor // pack_start(*levelwav); pack_start(*csThreshold); + Gtk::Frame* const shresFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHRESFRA"))); + shresFrame->set_label_align(0.025, 0.5); ToolParamBlock* const resiBox = Gtk::manage(new ToolParamBlock()); resiBox->pack_start(*residcont); resiBox->pack_start(*residchro); @@ -2495,6 +2338,8 @@ LocallabContrast::LocallabContrast(): clariFrame->add(*clariBox); pack_start(*clariFrame); ToolParamBlock* const blurcontBox = Gtk::manage(new ToolParamBlock()); + Gtk::Frame* const gradwavFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADWAVFRA"))); + gradwavFrame->set_label_align(0.025, 0.5); gradwavFrame->set_label_widget(*wavgradl); ToolParamBlock* const gradwavBox = Gtk::manage(new ToolParamBlock()); gradwavBox->pack_start(*sigmalc2); @@ -2502,7 +2347,10 @@ LocallabContrast::LocallabContrast(): gradwavBox->pack_start(*angwav); gradwavFrame->add(*gradwavBox); blurcontBox->pack_start(*gradwavFrame); + Gtk::Frame* const edgFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_EDGSHARPFRA"))); + edgFrame->set_label_align(0.025, 0.5); edgFrame->set_label_widget(*wavedg); + ToolParamBlock* const edgsBox = Gtk::manage(new ToolParamBlock()); edgsBox->pack_start(*strengthw); edgsBox->pack_start(*sigmaed); edgsBox->pack_start(*LocalcurveEditorwavedg, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor @@ -2524,12 +2372,15 @@ LocallabContrast::LocallabContrast(): edgsBoxshow->pack_start(*edgw); edgsBoxshow->pack_start(*basew); Gtk::HBox* const ctboxNP = Gtk::manage(new Gtk::HBox()); + Gtk::Label* const labmNP = Gtk::manage(new Gtk::Label(M("TP_WAVELET_NPTYPE") + ":")); ctboxNP->pack_start(*labmNP, Gtk::PACK_SHRINK, 1); ctboxNP->pack_start(*localneiMethod); edgsBoxshow->pack_start(*ctboxNP); edgsBox->pack_start(*edgsBoxshow); edgFrame->add(*edgsBox); blurcontBox->pack_start(*edgFrame); + Gtk::Frame* const blurlevelFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_BLURLEVELFRA"))); + blurlevelFrame->set_label_align(0.025, 0.5); blurlevelFrame->set_label_widget(*wavblur); Gtk::VBox* const blurlevcontBox = Gtk::manage(new Gtk::VBox()); blurlevcontBox->set_spacing(2); @@ -2546,6 +2397,8 @@ LocallabContrast::LocallabContrast(): expcontrastpyr->add(*blurcontBox, false); pack_start(*expcontrastpyr); ToolParamBlock* const blurcontBox2 = Gtk::manage(new ToolParamBlock()); + Gtk::Frame* const contFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CONTFRA"))); + contFrame->set_label_align(0.025, 0.5); Gtk::VBox* const contlevBox = Gtk::manage(new Gtk::VBox()); contlevBox->set_spacing(2); contFrame->set_label_widget(*wavcont); @@ -2555,6 +2408,8 @@ LocallabContrast::LocallabContrast(): contlevBox->pack_start(*LocalcurveEditorwavcon, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor contFrame->add(*contlevBox); blurcontBox2->pack_start(*contFrame); + Gtk::Frame* const compreFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_COMPREFRA"))); + compreFrame->set_label_align(0.025, 0.5); Gtk::VBox* const compreBox = Gtk::manage(new Gtk::VBox()); compreBox->set_spacing(2); compreFrame->set_label_widget(*wavcompre); @@ -2564,6 +2419,8 @@ LocallabContrast::LocallabContrast(): compreBox->pack_start(*residcomp); compreFrame->add(*compreBox); blurcontBox2->pack_start(*compreFrame); + Gtk::Frame* const compFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_COMPFRA"))); + compFrame->set_label_align(0.025, 0.5); Gtk::VBox* const compBox = Gtk::manage(new Gtk::VBox()); compBox->set_spacing(2); compFrame->set_label_widget(*wavcomp); @@ -2614,6 +2471,39 @@ void LocallabContrast::getMaskView(int &colorMask, int &colorMaskinv, int &expMa lcMask = showmasklcMethod->get_active_row_number(); } +void LocallabContrast::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + exp->set_tooltip_text(M("TP_LOCALLAB_EXPCONTRAST_TOOLTIP")); + levelwav->set_tooltip_markup(M("TP_LOCALLAB_LEVELWAV_TOOLTIP")); + clariFrame->set_tooltip_markup(M("TP_LOCALLAB_CLARI_TOOLTIP")); + clarisoft->set_tooltip_markup(M("TP_LOCALLAB_CLARISOFT_TOOLTIP")); + wavedg->set_tooltip_text(M("TP_LOCALLAB_WAVEEDG_TOOLTIP")); + chromablu->set_tooltip_text(M("TP_LOCALLAB_CHROMABLU_TOOLTIP")); + chromalev->set_tooltip_text(M("TP_LOCALLAB_CHROMABLU_TOOLTIP")); + fftwlc->set_tooltip_text(M("TP_LOCALLAB_LC_FFTW_TOOLTIP")); + expmasklc->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + CCmasklcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + LLmasklcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmasklcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + Lmasklcshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + } else { + exp->set_tooltip_text(""); + levelwav->set_tooltip_text(""); + clariFrame->set_tooltip_text(""); + clarisoft->set_tooltip_text(""); + wavedg->set_tooltip_text(""); + chromablu->set_tooltip_text(""); + chromalev->set_tooltip_text(""); + fftwlc->set_tooltip_text(""); + expmasklc->set_tooltip_text(""); + CCmasklcshape->setTooltip(""); + LLmasklcshape->setTooltip(""); + HHmasklcshape->setTooltip(""); + Lmasklcshape->setTooltip(""); + } +} + void LocallabContrast::setDefaultExpanderVisibility() { expresidpyr->set_expanded(false); @@ -3725,7 +3615,6 @@ LocallabCBDL::LocallabCBDL(): chromacbdl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMACBDL"), 0., 1.5, 0.01, 0.))), threshold(Gtk::manage(new Adjuster(M("TP_DIRPYREQUALIZER_THRESHOLD"), 0, 1., 0.01, 0.2))), blurcbdl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURCBDL"), 0., 100., 0.1, 0.))), - residFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RESID")))), clarityml(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARITYML"), 0.1, 100., 0.1, 0.1))), contresid(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTRESID"), -100, 100, 1, 0))), softradiuscb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), -10.0, 1000.0, 0.5, 0.))), @@ -3750,31 +3639,19 @@ LocallabCBDL::LocallabCBDL(): lumaneutralButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMANEUTRAL")))), lumacontrastPlusButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMACONTRAST_PLUS")))) { - const bool showtooltip = options.showtooltip; - const LocallabParams::LocallabSpot defSpot; // Parameter CBDL specific widgets - if (showtooltip) { - exp->set_tooltip_text(M("TP_LOCALLAB_EXPCBDL_TOOLTIP")); - } - for (const auto adj : multiplier) { adj->setAdjusterListener(this); } - if (showtooltip) { - chromacbdl->set_tooltip_text(M("TP_LOCALLAB_CHROMACB_TOOLTIP")); - } - chromacbdl->setAdjusterListener(this); threshold->setAdjusterListener(this); blurcbdl->setAdjusterListener(this); - residFrame->set_label_align(0.025, 0.5); - clarityml->setAdjusterListener(this); contresid->setAdjusterListener(this); @@ -3782,27 +3659,15 @@ LocallabCBDL::LocallabCBDL(): softradiuscb->setLogScale(10, -10); softradiuscb->setAdjusterListener(this); - if (showtooltip) { - sensicb->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); - } - sensicb->setAdjusterListener(this); - if (showtooltip) { - expmaskcb->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); - } - showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMNONE")); showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMASK")); showmaskcbMethod->append(M("TP_LOCALLAB_PREVIEWSEL")); showmaskcbMethod->set_active(0); - - if (showtooltip) { - showmaskcbMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - } - + showmaskcbMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskcbMethodConn = showmaskcbMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabCBDL::showmaskcbMethodChanged)); enacbMaskConn = enacbMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabCBDL::enacbMaskChanged)); @@ -3811,29 +3676,14 @@ LocallabCBDL::LocallabCBDL(): CCmaskcbshape->setIdentityValue(0.); CCmaskcbshape->setResetCurve(FlatCurveType(defSpot.CCmaskcbcurve.at(0)), defSpot.CCmaskcbcurve); - - if (showtooltip) { - CCmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - CCmaskcbshape->setBottomBarColorProvider(this, 1); LLmaskcbshape->setIdentityValue(0.); LLmaskcbshape->setResetCurve(FlatCurveType(defSpot.LLmaskcbcurve.at(0)), defSpot.LLmaskcbcurve); - - if (showtooltip) { - LLmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - LLmaskcbshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); HHmaskcbshape->setIdentityValue(0.); HHmaskcbshape->setResetCurve(FlatCurveType(defSpot.HHmaskcbcurve.at(0)), defSpot.HHmaskcbcurve); - - if (showtooltip) { - HHmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - } - HHmaskcbshape->setCurveColorProvider(this, 2); HHmaskcbshape->setBottomBarColorProvider(this, 2); @@ -3841,17 +3691,9 @@ LocallabCBDL::LocallabCBDL(): blendmaskcb->setAdjusterListener(this); - if (showtooltip) { - radmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - radmaskcb->setLogScale(10, -10); radmaskcb->setAdjusterListener(this); - if (showtooltip) { - lapmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - } - lapmaskcb->setAdjusterListener(this); chromaskcb->setAdjusterListener(this); @@ -3863,11 +3705,6 @@ LocallabCBDL::LocallabCBDL(): mask2cbCurveEditorG->setCurveListener(this); Lmaskcbshape->setResetCurve(DiagonalCurveType(defSpot.Lmaskcbcurve.at(0)), defSpot.Lmaskcbcurve); - - if (showtooltip) { - Lmaskcbshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - } - Lmaskcbshape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); Lmaskcbshape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); @@ -3895,6 +3732,8 @@ LocallabCBDL::LocallabCBDL(): pack_start(*chromacbdl); pack_start(*threshold); // pack_start(*blurcbdl); + Gtk::Frame* const residFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RESID"))); + residFrame->set_label_align(0.025, 0.5); ToolParamBlock* const residBox = Gtk::manage(new ToolParamBlock()); residBox->pack_start(*clarityml); residBox->pack_start(*contresid); @@ -3935,6 +3774,33 @@ void LocallabCBDL::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, cbMask = showmaskcbMethod->get_active_row_number(); } +void LocallabCBDL::updateAdviceTooltips(const bool showTooltips) +{ + if (showTooltips) { + exp->set_tooltip_text(M("TP_LOCALLAB_EXPCBDL_TOOLTIP")); + chromacbdl->set_tooltip_text(M("TP_LOCALLAB_CHROMACB_TOOLTIP")); + sensicb->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); + expmaskcb->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + CCmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + LLmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + radmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + lapmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + Lmaskcbshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + } else { + exp->set_tooltip_text(""); + chromacbdl->set_tooltip_text(""); + sensicb->set_tooltip_text(""); + expmaskcb->set_tooltip_text(""); + CCmaskcbshape->setTooltip(""); + LLmaskcbshape->setTooltip(""); + HHmaskcbshape->setTooltip(""); + radmaskcb->set_tooltip_text(""); + lapmaskcb->set_tooltip_text(""); + Lmaskcbshape->setTooltip(""); + } +} + void LocallabCBDL::setDefaultExpanderVisibility() { expmaskcb->set_expanded(false); @@ -4345,25 +4211,20 @@ LocallabLog::LocallabLog(): LocallabTool(this, M("TP_LOCALLAB_LOG_TOOLNAME"), M("TP_LOCALLAB_LOG"), false, false), // Log encoding specific widgets - logPFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOGPFRA")))), autocompute(Gtk::manage(new Gtk::ToggleButton(M("TP_LOCALLAB_LOGAUTO")))), blackEv(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLACK_EV"), -16.0, 0.0, 0.1, -5.0))), whiteEv(Gtk::manage(new Adjuster(M("TP_LOCALLAB_WHITE_EV"), 0.0, 32.0, 0.1, 10.0))), fullimage(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FULLIMAGE")))), - logFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOGFRA")))), Autogray(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AUTOGRAY")))), sourceGray(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOURCE_GRAY"), 1.0, 100.0, 0.1, 10.0))), targetGray(Gtk::manage(new Adjuster(M("TP_LOCALLAB_TARGET_GRAY"), 5.0, 80.0, 0.1, 18.0))), detail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAIL"), 0., 1., 0.01, 0.6))), baselog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BASELOG"), 1.3, 8., 0.05, 2., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), sensilog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSILOG"), 0, 100, 1, 50))), - gradlogFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADLOGFRA")))), strlog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -2.0, 2.0, 0.05, 0.))), anglog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -180, 180, 0.1, 0.))) { // Parameter Log encoding specific widgets - logPFrame->set_label_align(0.025, 0.5); - autoconn = autocompute->signal_toggled().connect(sigc::mem_fun(*this, &LocallabLog::autocomputeToggled)); blackEv->setLogScale(2, -8); @@ -4374,8 +4235,6 @@ LocallabLog::LocallabLog(): fullimageConn = fullimage->signal_toggled().connect(sigc::mem_fun(*this, &LocallabLog::fullimageChanged)); - logFrame->set_label_align(0.025, 0.5); - AutograyConn = Autogray->signal_toggled().connect(sigc::mem_fun(*this, &LocallabLog::AutograyChanged)); sourceGray->setAdjusterListener(this); @@ -4388,13 +4247,13 @@ LocallabLog::LocallabLog(): sensilog->setAdjusterListener(this); - gradlogFrame->set_label_align(0.025, 0.5); - strlog->setAdjusterListener(this); anglog->setAdjusterListener(this); - // Add Log encoding specific widgets to HUI + // Add Log encoding specific widgets to GUI + Gtk::Frame* const logPFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOGPFRA"))); + logPFrame->set_label_align(0.025, 0.5); ToolParamBlock* const logPBox = Gtk::manage(new ToolParamBlock()); logPBox->pack_start(*autocompute); logPBox->pack_start(*blackEv); @@ -4402,6 +4261,8 @@ LocallabLog::LocallabLog(): logPBox->pack_start(*fullimage); logPFrame->add(*logPBox); pack_start(*logPFrame); + Gtk::Frame* const logFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOGFRA"))); + logFrame->set_label_align(0.025, 0.5); ToolParamBlock* const logFBox = Gtk::manage(new ToolParamBlock()); logFBox->pack_start(*Autogray); logFBox->pack_start(*sourceGray); @@ -4411,6 +4272,8 @@ LocallabLog::LocallabLog(): pack_start(*detail); pack_start(*baselog); pack_start(*sensilog); + Gtk::Frame* const gradlogFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADLOGFRA"))); + gradlogFrame->set_label_align(0.025, 0.5); ToolParamBlock* const gradlogBox = Gtk::manage(new ToolParamBlock()); gradlogBox->pack_start(*strlog); gradlogBox->pack_start(*anglog); diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index fa3165110a..43aa2f7d79 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -2428,8 +2428,6 @@ void Preferences::workflowUpdate() parent->updateShowtooltipVisibility(moptions.showtooltip); } - moptions.showtooltip = ckbshowtooltiplocallab->get_active(); - if (moptions.histogramPosition != options.histogramPosition) { // Update the position of the Histogram parent->updateHistogramPosition(options.histogramPosition, moptions.histogramPosition); diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 9163a11625..c1b7777677 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -1098,7 +1098,7 @@ void RTWindow::updateFBToolBarVisibility (bool showFilmStripToolBar) void RTWindow::updateShowtooltipVisibility (bool showtooltip) { - fpanel->fileCatalog->updateShowtooltipVisibility (showtooltip); + epanel->updateShowtooltipVisibility (showtooltip); } void RTWindow::updateHistogramPosition (int oldPosition, int newPosition) diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index a2a2970428..1f7e1d3b5a 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -826,6 +826,12 @@ void ToolPanelCoordinator::writeToolExpandedStatus(std::vector &tpOpen) } +void ToolPanelCoordinator::updateShowtooltipVisibility (bool showtooltip) +{ + locallab->updateShowtooltipVisibility(showtooltip); +} + + void ToolPanelCoordinator::spotWBselected(int x, int y, Thumbnail* thm) { if (!ipc) { diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index 7418834541..190da818b1 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -281,7 +281,7 @@ class ToolPanelCoordinator : void readOptions(); void writeOptions(); void writeToolExpandedStatus(std::vector &tpOpen); - + void updateShowtooltipVisibility (bool showtooltip); // wbprovider interface void getAutoWB (double& temp, double& green, double equal, double tempBias) override From fb3d2e4b4b21c6f78baad2afa679f40c4ff079f2 Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 8 May 2020 12:57:24 +0200 Subject: [PATCH 5/5] Various improvments to labels and default choice --- rtdata/languages/default | 6 +++--- rtgui/locallabtools.cc | 12 ++++++------ rtgui/locallabtools2.cc | 4 ++++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 9500904412..0ffe73d12e 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2738,12 +2738,12 @@ TP_LOCALLAB_VIS_TOOLTIP;Click to show/hide selected Control Spot.\nCtr TP_LOCALLAB_LIST_NAME;Add tool to current spot... TP_LOCALLAB_COLOR_TOOLNAME;Locallab Color&Light TP_LOCALLAB_EXP_TOOLNAME;Locallab Exposure -TP_LOCALLAB_SH_TOOLNAME;Locallab Shadows Highlight +TP_LOCALLAB_SH_TOOLNAME;Locallab Shadows Highlight & Tone Equalizer TP_LOCALLAB_VIB_TOOLNAME;Locallab Vibrance -TP_LOCALLAB_SOFT_TOOLNAME;Locallab Soft Light +TP_LOCALLAB_SOFT_TOOLNAME;Locallab Soft Light & Original Retinex TP_LOCALLAB_BLUR_TOOLNAME;Locallab Blur, Noise & Denoise TP_LOCALLAB_TONE_TOOLNAME;Locallab Tone Mapping -TP_LOCALLAB_RET_TOOLNAME;Locallab Retinex +TP_LOCALLAB_RET_TOOLNAME;Locallab Dehaze & Retinex TP_LOCALLAB_SHARP_TOOLNAME;Locallab Sharpening TP_LOCALLAB_LC_TOOLNAME;Locallab Local Constrast & Wavelet TP_LOCALLAB_CBDL_TOOLNAME;Locallab CBDL diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index f360d944f1..4a95a3421b 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -3491,9 +3491,9 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para complexity->set_active(spot.complexshadhigh); if (spot.shMethod == "std") { - shMethod->set_active(0); - } else if (spot.shMethod == "tone") { shMethod->set_active(1); + } else if (spot.shMethod == "tone") { + shMethod->set_active(0); } for (int i = 0; i < 5; i++) { @@ -3554,9 +3554,9 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p spot.visishadhigh = exp->get_visible(); spot.complexshadhigh = complexity->get_active_row_number(); - if (shMethod->get_active_row_number() == 0) { + if (shMethod->get_active_row_number() == 1) { spot.shMethod = "std"; - } else if (shMethod->get_active_row_number() == 1) { + } else if (shMethod->get_active_row_number() == 0) { spot.shMethod = "tone"; } @@ -3847,9 +3847,9 @@ void LocallabShadow::convertParamToNormal() // Set hidden GUI widgets in Normal mode to default spot values if (defSpot.shMethod == "std") { - shMethod->set_active(0); - } else if (defSpot.shMethod == "tone") { shMethod->set_active(1); + } else if (defSpot.shMethod == "tone") { + shMethod->set_active(0); } blurSHde->setValue((double)defSpot.blurSHde); diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 39e1df1696..bd2c040872 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -1484,9 +1484,13 @@ void LocallabRetinex::updateGUIToMode(const modeType new_type) if (new_type == Normal) { // Advanced widgets are hidden in Normal mode retiFrame->hide(); + retitoolFrame->hide(); + expretitools->hide(); } else { // Advanced widgets are shown in Expert mode retiFrame->show(); + retitoolFrame->show(); + expretitools->show(); } }