Local adjustments - Strength control on Spot - tools - issue 6221 (#6223)

* Add strength to local contrast and wavelet

* Added strength to Color and Light

* Added strength to Denoise

* Added strength to shadows highlight Tone equalizer

* Added strength to Dynamic Range and exposure

* Added strength to Tone mapping

* Small improvment to Dynamic Range
This commit is contained in:
Desmis
2021-05-04 07:27:55 +02:00
committed by GitHub
parent 227a2e8cd6
commit f22482c204
11 changed files with 334 additions and 25 deletions

View File

@@ -416,6 +416,7 @@ LocallabColor::LocallabColor():
// Color & Light specific widgets
lumFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LUMFRA")))),
reparcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGREPART"), 1.0, 100.0, 1., 100.0))),
lightness(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LIGHTNESS"), -100, 500, 1, 0))),
contrast(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTRAST"), -100, 100, 1, 0))),
chroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMA"), -100, 150, 1, 0))),
@@ -525,6 +526,8 @@ LocallabColor::LocallabColor():
lightness->setAdjusterListener(this);
reparcol->setAdjusterListener(this);
contrast->setAdjusterListener(this);
chroma->setAdjusterListener(this);
@@ -787,6 +790,7 @@ LocallabColor::LocallabColor():
csThresholdcol->setAdjusterListener(this);
// Add Color & Light specific widgets to GUI
pack_start(*reparcol);
ToolParamBlock* const lumBox = Gtk::manage(new ToolParamBlock());
lumBox->pack_start(*lightness);
lumBox->pack_start(*contrast);
@@ -957,6 +961,7 @@ void LocallabColor::updateAdviceTooltips(const bool showTooltips)
if (showTooltips) {
lumFrame->set_tooltip_text(M("TP_LOCALLAB_EXPCOLOR_TOOLTIP"));
lightness->set_tooltip_text(M("TP_LOCALLAB_LIGHTN_TOOLTIP"));
reparcol->set_tooltip_text(M("TP_LOCALLAB_REPARCOL_TOOLTIP"));
gridMethod->set_tooltip_text(M("TP_LOCALLAB_GRIDMETH_TOOLTIP"));
strengthgrid->set_tooltip_text(M("TP_LOCALLAB_STRENGRID_TOOLTIP"));
blurcolde->set_tooltip_text(M("TP_LOCALLAB_BLURCOLDE_TOOLTIP"));
@@ -1008,6 +1013,7 @@ void LocallabColor::updateAdviceTooltips(const bool showTooltips)
} else {
lumFrame->set_tooltip_text("");
lightness->set_tooltip_text("");
reparcol->set_tooltip_text("");
gridMethod->set_tooltip_text("");
strengthgrid->set_tooltip_text("");
blurcolde->set_tooltip_text("");
@@ -1124,6 +1130,7 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param
complexity->set_active(spot.complexcolor);
lightness->setValue(spot.lightness);
reparcol->setValue(spot.reparcol);
contrast->setValue(spot.contrast);
chroma->setValue(spot.chroma);
curvactiv->set_active(spot.curvactiv);
@@ -1298,6 +1305,7 @@ void LocallabColor::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe
spot.complexcolor = complexity->get_active_row_number();
spot.lightness = lightness->getIntValue();
spot.reparcol = reparcol->getValue();
spot.contrast = contrast->getIntValue();
spot.chroma = chroma->getIntValue();
spot.curvactiv = curvactiv->get_active();
@@ -1461,6 +1469,7 @@ void LocallabColor::setDefaults(const rtengine::procparams::ProcParams* defParam
// Set default value for adjuster, labgrid and threshold adjuster widgets
lightness->setDefault((double)defSpot.lightness);
reparcol->setDefault(defSpot.reparcol);
contrast->setDefault((double)defSpot.contrast);
chroma->setDefault((double)defSpot.chroma);
labgrid->setDefault(defSpot.labgridALow / LocallabParams::LABGRIDL_CORR_MAX,
@@ -1515,6 +1524,13 @@ void LocallabColor::adjusterChanged(Adjuster* a, double newval)
}
}
if (a == reparcol) {
if (listener) {
listener->panelChanged(Evlocallabreparcol,
reparcol->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == contrast) {
if (listener) {
listener->panelChanged(Evlocallabcontrast,
@@ -2376,6 +2392,7 @@ void LocallabColor::updateColorGUI1()
showmaskcolMethodinv->show();
contcol->hide();
blurcol->hide();
reparcol->hide();
} else {
gridFrame->show();
@@ -2407,6 +2424,7 @@ void LocallabColor::updateColorGUI1()
showmaskcolMethodConninv.block(false);
contcol->show();
blurcol->show();
reparcol->show();
}
}
@@ -2488,6 +2506,7 @@ LocallabExposure::LocallabExposure():
// pdeFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_PDEFRA")))),
exppde(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_PDEFRA")))),
laplacexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPLACEXP"), 0.0, 100.0, 0.1, 0.))),
reparexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGREPART"), 1.0, 100.0, 1., 100.0))),
linear(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LINEAR"), 0.01, 1., 0.01, 0.05))),
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))),
@@ -2499,7 +2518,7 @@ LocallabExposure::LocallabExposure():
fatdetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATDETAIL"), -100., 300., 1., 0.))),
norm(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_EQUIL")))),
fatlevel(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATLEVEL"), 0.5, 2.0, 0.01, 1.))),
fatanchor(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATANCHORA"), 0.5, 2.0, 0.01, 1.))),
fatanchor(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATANCHOR"), 0.1, 100.0, 0.01, 50., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))),
sensiex(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))),
structexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))),
blurexpde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))),
@@ -2562,6 +2581,7 @@ LocallabExposure::LocallabExposure():
setExpandAlignProperties(expfat, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
laplacexp->setAdjusterListener(this);
reparexp->setAdjusterListener(this);
linear->setAdjusterListener(this);
@@ -2701,7 +2721,8 @@ LocallabExposure::LocallabExposure():
mask2expCurveEditorG->curveListComplete();
// Add Color & Light specific widgets to GUI
// pack_start(*expMethod);
pack_start(*sensiex);
pack_start(*reparexp);
ToolParamBlock* const pdeBox = Gtk::manage(new ToolParamBlock());
pdeBox->pack_start(*laplacexp);
pdeBox->pack_start(*linear);
@@ -2721,13 +2742,12 @@ LocallabExposure::LocallabExposure():
fatBox->pack_start(*fatdetail);
// fatBox->pack_start(*norm);
// fatBox->pack_start(*fatlevel);
// fatBox->pack_start(*fatanchor);
fatBox->pack_start(*fatanchor);
// fatFrame->add(*fatBox);
expfat->add(*fatBox, false);
// pack_start(*fatFrame);
pack_start(*expfat);
pack_start(*expcomp);
pack_start(*sensiex);
pack_start(*structexp);
pack_start(*blurexpde);
ToolParamBlock* const toolBox = Gtk::manage(new ToolParamBlock());
@@ -2822,6 +2842,7 @@ void LocallabExposure::updateAdviceTooltips(const bool showTooltips)
higthrese->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP"));
blurexpde->set_tooltip_text(M("TP_LOCALLAB_BLURCOLDE_TOOLTIP"));
laplacexp->set_tooltip_text(M("TP_LOCALLAB_EXPLAP_TOOLTIP"));
reparexp->set_tooltip_text(M("TP_LOCALLAB_REPAREXP_TOOLTIP"));
linear->set_tooltip_text(M("TP_LOCALLAB_EXPLAPLIN_TOOLTIP"));
balanexp->set_tooltip_text(M("TP_LOCALLAB_EXPLAPBAL_TOOLTIP"));
gamm->set_tooltip_text(M("TP_LOCALLAB_EXPLAPGAMM_TOOLTIP"));
@@ -2856,6 +2877,7 @@ void LocallabExposure::updateAdviceTooltips(const bool showTooltips)
blurexpde->set_tooltip_text("");
exprecove->set_tooltip_markup("");
laplacexp->set_tooltip_text("");
reparexp->set_tooltip_text("");
linear->set_tooltip_text("");
balanexp->set_tooltip_text("");
gamm->set_tooltip_text("");
@@ -2946,6 +2968,7 @@ void LocallabExposure::read(const rtengine::procparams::ProcParams* pp, const Pa
}
*/
laplacexp->setValue(spot.laplacexp);
reparexp->setValue(spot.reparexp);
linear->setValue(spot.linear);
balanexp->setValue(spot.balanexp);
gamm->setValue(spot.gamm);
@@ -3037,6 +3060,7 @@ void LocallabExposure::write(rtengine::procparams::ProcParams* pp, ParamsEdited*
}
*/
spot.laplacexp = laplacexp->getValue();
spot.reparexp = reparexp->getValue();
spot.linear = linear->getValue();
spot.balanexp = balanexp->getValue();
spot.gamm = gamm->getValue();
@@ -3101,6 +3125,7 @@ void LocallabExposure::setDefaults(const rtengine::procparams::ProcParams* defPa
// Set default values for adjuster widgets
laplacexp->setDefault(defSpot.laplacexp);
reparexp->setDefault(defSpot.reparexp);
linear->setDefault(defSpot.linear);
balanexp->setDefault(defSpot.balanexp);
gamm->setDefault(defSpot.gamm);
@@ -3153,6 +3178,13 @@ void LocallabExposure::adjusterChanged(Adjuster* a, double newval)
}
}
if (a == reparexp) {
if (listener) {
listener->panelChanged(Evlocallabreparexp,
reparexp->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == linear) {
if (listener) {
listener->panelChanged(Evlocallablinear,
@@ -3449,12 +3481,9 @@ void LocallabExposure::convertParamToNormal()
slomaskexp->setValue(defSpot.slomaskexp);
strmaskexp->setValue(defSpot.strmaskexp);
angmaskexp->setValue(defSpot.angmaskexp);
// fatlevel->setValue(defSpot.fatlevel);
// fatanchor->setValue(defSpot.fatanchor);
decaye->setValue(defSpot.decaye);
// norm->set_active(defSpot.enaExpMask);
fatlevel->setValue(defSpot.fatlevel);
fatanchor->setValue(defSpot.fatanchor);
// Enable all listeners
enableListener();
@@ -3530,7 +3559,7 @@ void LocallabExposure::updateGUIToMode(const modeType new_type)
}
norm->show();
fatlevel->hide();
fatanchor->hide();
fatanchor->show();
// Specific Simple mode widgets are shown in Normal mode
if (!inversex->get_active()) { // Keep widget hidden when invers is toggled
@@ -3774,6 +3803,7 @@ void LocallabExposure::updateExposureGUI3()
expMethod->hide();
expcomp->setLabel(M("TP_LOCALLAB_EXPCOMPINV"));
exprecove->hide();
reparexp->hide();
// Manage specific case where expMethod is different from 0
if (expMethod->get_active_row_number() > 0) {
@@ -3802,6 +3832,7 @@ void LocallabExposure::updateExposureGUI3()
expgradexp->show();
exprecove->show();
}
reparexp->show();
showmaskexpMethodinv->hide();
// Reset hidden mask combobox
@@ -3818,6 +3849,7 @@ LocallabShadow::LocallabShadow():
// Shadow highlight specific widgets
shMethod(Gtk::manage(new MyComboBoxText())),
reparsh(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGREPART"), 1.0, 100.0, 1., 100.0))),
multipliersh([]() -> std::array<Adjuster *, 5>
{
std::array<Adjuster*, 5> res = {};
@@ -3895,6 +3927,7 @@ LocallabShadow::LocallabShadow():
}
detailSH->setAdjusterListener(this);
reparsh->setAdjusterListener(this);
highlights->setAdjusterListener(this);
@@ -3995,6 +4028,7 @@ LocallabShadow::LocallabShadow():
fatanchorSH->setAdjusterListener(this);
// Add Shadow highlight specific widgets to GUI
pack_start(*reparsh);
pack_start(*shMethod);
for (const auto multiplier : multipliersh) {
@@ -4091,6 +4125,7 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips)
}
gamSH->set_tooltip_text(M("TP_LOCALLAB_SHTRC_TOOLTIP"));
reparsh->set_tooltip_text(M("TP_LOCALLAB_REPARSH_TOOLTIP"));
sloSH->set_tooltip_text(M("TP_LOCALLAB_SHTRC_TOOLTIP"));
strSH->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP"));
exprecovs->set_tooltip_markup(M("TP_LOCALLAB_MASKRESH_TOOLTIP"));
@@ -4131,6 +4166,7 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips)
multiplier->set_tooltip_text("");
}
gamSH->set_tooltip_text("");
reparsh->set_tooltip_text("");
sloSH->set_tooltip_text("");
strSH->set_tooltip_text("");
blurSHde->set_tooltip_text("");
@@ -4221,6 +4257,7 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para
decays->setValue((double)spot.decays);
detailSH->setValue((double)spot.detailSH);
reparsh->setValue(spot.reparsh);
highlights->setValue((double)spot.highlights);
h_tonalwidth->setValue((double)spot.h_tonalwidth);
shadows->setValue(spot.shadows);
@@ -4285,6 +4322,7 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p
}
spot.detailSH = detailSH->getIntValue();
spot.reparsh = reparsh->getValue();
spot.highlights = highlights->getIntValue();
spot.h_tonalwidth = h_tonalwidth->getIntValue();
spot.shadows = shadows->getIntValue();
@@ -4332,6 +4370,7 @@ void LocallabShadow::setDefaults(const rtengine::procparams::ProcParams* defPara
}
detailSH->setDefault((double)defSpot.detailSH);
reparsh->setDefault(defSpot.reparsh);
highlights->setDefault((double)defSpot.highlights);
h_tonalwidth->setDefault((double)defSpot.h_tonalwidth);
shadows->setDefault((double)defSpot.shadows);
@@ -4382,6 +4421,13 @@ void LocallabShadow::adjusterChanged(Adjuster* a, double newval)
}
}
if (a == reparsh) {
if (listener) {
listener->panelChanged(Evlocallabreparsh,
reparsh->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == highlights) {
if (listener) {
listener->panelChanged(Evlocallabhighlights,
@@ -4858,11 +4904,13 @@ void LocallabShadow::updateShadowGUI1()
showmaskSHMethodConn.block(false);
showmaskSHMethodinv->show();
exprecovs->hide();
reparsh->hide();
} else {
if (mode == Expert || mode == Normal) { // Keep widget hidden in Simple mode
expgradsh->show();
exprecovs->show();
}
reparsh->show();
showmaskSHMethod->show();
showmaskSHMethodinv->hide();
@@ -6337,6 +6385,7 @@ LocallabBlur::LocallabBlur():
nlgam(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLGAM"), 2., 5., 0.1, 3.))),
bilateral(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BILATERAL"), 0, 100, 1, 0))),
sensiden(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))),
reparden(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGREPART"), 1.0, 100.0, 1., 100.0))),
neutral(Gtk::manage (new Gtk::Button (M ("TP_RETINEX_NEUTRAL")))),
expmaskbl(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWPLUS")))),
showmaskblMethod(Gtk::manage(new MyComboBoxText())),
@@ -6522,6 +6571,7 @@ LocallabBlur::LocallabBlur():
nlgam->setAdjusterListener(this);
sensiden->setAdjusterListener(this);
reparden->setAdjusterListener(this);
setExpandAlignProperties (neutral, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
@@ -6670,7 +6720,8 @@ LocallabBlur::LocallabBlur():
detailFrame->add(*detailBox);
wavBox->pack_start(*detailFrame);
denoisebox->pack_start(*sensiden);
denoisebox->pack_start(*reparden);
ToolParamBlock* const nlbox = Gtk::manage(new ToolParamBlock());
nlbox->pack_start(*nlstr);
nlbox->pack_start(*nldet);
@@ -6770,6 +6821,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
strength->set_tooltip_text(M("TP_LOCALLAB_NOISE_TOOLTIP"));
grainFrame->set_tooltip_text(M("TP_LOCALLAB_GRAIN_TOOLTIP"));
sensibn->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP"));
reparden->set_tooltip_text(M("TP_LOCALLAB_REPARDEN_TOOLTIP"));
medMethod->set_tooltip_text(M("TP_LOCALLAB_MEDIAN_TOOLTIP"));
itera->set_tooltip_text(M("TP_LOCALLAB_MEDIANITER_TOOLTIP"));
fftwbl->set_tooltip_text(M("TP_LOCALLAB_FFTMASK_TOOLTIP"));
@@ -6838,6 +6890,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
strength->set_tooltip_text("");
grainFrame->set_tooltip_text("");
sensibn->set_tooltip_text("");
reparden->set_tooltip_text("");
medMethod->set_tooltip_text("");
itera->set_tooltip_text("");
fftwbl->set_tooltip_text("");
@@ -6867,7 +6920,6 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
nlpat->set_tooltip_text("");
nlrad->set_tooltip_text("");
nlgam->set_tooltip_text("");
sensibn->set_tooltip_text("");
blurMethod->set_tooltip_markup("");
expdenoise->set_tooltip_markup("");
wavshapeden->setTooltip("");
@@ -7052,6 +7104,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params
higthres->setValue((double)spot.higthres);
epsbl->setValue((double)spot.epsbl);
sensibn->setValue((double)spot.sensibn);
reparden->setValue(spot.reparden);
recothresd->setValue((double)spot.recothresd);
lowthresd->setValue((double)spot.lowthresd);
midthresd->setValue((double)spot.midthresd);
@@ -7198,6 +7251,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped
spot.higthres = higthres->getValue();
spot.epsbl = epsbl->getIntValue();
spot.sensibn = sensibn->getIntValue();
spot.reparden = reparden->getValue();
spot.recothresd = recothresd->getValue();
spot.lowthresd = lowthresd->getValue();
spot.midthresd = midthresd->getValue();
@@ -7307,6 +7361,7 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams
higthres->setDefault((double)defSpot.higthres);
epsbl->setDefault((double)defSpot.epsbl);
sensibn->setDefault((double)defSpot.sensibn);
reparden->setDefault(defSpot.reparden);
recothresd->setDefault((double)defSpot.recothresd);
lowthresd->setDefault((double)defSpot.lowthresd);
midthresd->setDefault((double)defSpot.midthresd);
@@ -7656,6 +7711,13 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval)
}
}
if (a == reparden) {
if (listener) {
listener->panelChanged(Evlocallabreparden,
reparden->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == strumaskbl) {
if (listener) {
listener->panelChanged(Evlocallabstrumaskbl,