diff --git a/rtdata/languages/default b/rtdata/languages/default index be1dcd2c3..722c502b5 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1153,6 +1153,10 @@ HISTORY_MSG_912;Local - Blur Guide filter strength HISTORY_MSG_913;Local - Contrast Wavelet Sigma DR HISTORY_MSG_914;Local - Blur Wavelet Sigma BL HISTORY_MSG_915;Local - Edge Wavelet Sigma ED +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_CAT02PRESET;Cat02 automatic preset HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction @@ -2481,6 +2485,7 @@ 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(s) +TP_LOCALLAB_LOC_RESIDPYR;Residual Image Main TP_LOCALLAB_LOG;Encoding log TP_LOCALLAB_LOGAUTO;Automatic TP_LOCALLAB_LOGFRA;Source Gray Point @@ -2584,6 +2589,10 @@ TP_LOCALLAB_RESIDBLUR;Blur Residual Image TP_LOCALLAB_RESIDCHRO;Residual image Chroma TP_LOCALLAB_RESIDCOMP;Compress Residual image TP_LOCALLAB_RESIDCONT;Residual image Contrast +TP_LOCALLAB_RESIDHI;Highlights +TP_LOCALLAB_RESIDHITHR;Highlights threshold +TP_LOCALLAB_RESIDSHA;Shadows +TP_LOCALLAB_RESIDSHATHR;Shadows threshold TP_LOCALLAB_RETI;Dehaze - Retinex Strong local contrast TP_LOCALLAB_RETIFRA;Retinex TP_LOCALLAB_RETIM;Original Retinex @@ -2655,6 +2664,7 @@ TP_LOCALLAB_SHOWSTRUC;Show structure Spot TP_LOCALLAB_SHOWSTRUCEX;Show structure Spot - disabled in "normal" TP_LOCALLAB_SHOWT;4 - Mask and modifications TP_LOCALLAB_SHOWVI;3 - Mask and modifications +TP_LOCALLAB_SHRESFRA;Shadows/Highlights TP_LOCALLAB_SIGMAWAV;Damper TP_LOCALLAB_SIM;Simple TP_LOCALLAB_SLOMASKCOL;Slope mask diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 9fd3bcaf8..2f24f95a2 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -938,6 +938,10 @@ enum ProcEventCode { Evlocallabsigmadr = 912, Evlocallabsigmabl = 913, Evlocallabsigmaed = 914, + Evlocallabresidsha = 915, + Evlocallabresidshathr = 916, + Evlocallabresidhi = 917, + Evlocallabresidhithr = 918, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 0d3562680..801393408 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3338,6 +3338,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : lclightness(1.0), levelwav(4), residcont(0.0), + residsha(0.0), + residshathr(30.0), + residhi(0.0), + residhithr(70.0), residblur(0.0), levelblur(0.0), sigmabl(1.0), @@ -3947,6 +3951,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && lclightness == other.lclightness && levelwav == other.levelwav && residcont == other.residcont + && residsha == other.residsha + && residshathr == other.residshathr + && residhi == other.residhi + && residhithr == other.residhithr && residblur == other.residblur && levelblur == other.levelblur && sigmabl == other.sigmabl @@ -5387,6 +5395,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->lclightness, "Locallab", "Lclightness_" + index_str, spot.lclightness, keyFile); saveToKeyfile(!pedited || spot_edited->levelwav, "Locallab", "Levelwav_" + index_str, spot.levelwav, keyFile); saveToKeyfile(!pedited || spot_edited->residcont, "Locallab", "Residcont_" + index_str, spot.residcont, keyFile); + saveToKeyfile(!pedited || spot_edited->residsha, "Locallab", "Residsha_" + index_str, spot.residsha, keyFile); + saveToKeyfile(!pedited || spot_edited->residshathr, "Locallab", "Residshathr_" + index_str, spot.residshathr, keyFile); + saveToKeyfile(!pedited || spot_edited->residhi, "Locallab", "Residhi_" + index_str, spot.residhi, keyFile); + saveToKeyfile(!pedited || spot_edited->residhithr, "Locallab", "Residhithr_" + index_str, spot.residhithr, keyFile); saveToKeyfile(!pedited || spot_edited->residblur, "Locallab", "Residblur_" + index_str, spot.residblur, keyFile); saveToKeyfile(!pedited || spot_edited->levelblur, "Locallab", "Levelblur_" + index_str, spot.levelblur, keyFile); saveToKeyfile(!pedited || spot_edited->sigmabl, "Locallab", "Sigmabl_" + index_str, spot.sigmabl, keyFile); @@ -7036,6 +7048,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Lclightness_" + index_str, pedited, spot.lclightness, spotEdited.lclightness); assignFromKeyfile(keyFile, "Locallab", "Levelwav_" + index_str, pedited, spot.levelwav, spotEdited.levelwav); assignFromKeyfile(keyFile, "Locallab", "Residcont_" + index_str, pedited, spot.residcont, spotEdited.residcont); + assignFromKeyfile(keyFile, "Locallab", "Residsha_" + index_str, pedited, spot.residsha, spotEdited.residsha); + assignFromKeyfile(keyFile, "Locallab", "Residshathr_" + index_str, pedited, spot.residshathr, spotEdited.residshathr); + assignFromKeyfile(keyFile, "Locallab", "Residhi_" + index_str, pedited, spot.residhi, spotEdited.residhi); + assignFromKeyfile(keyFile, "Locallab", "Residhithr_" + index_str, pedited, spot.residhithr, spotEdited.residhithr); assignFromKeyfile(keyFile, "Locallab", "Residblur_" + index_str, pedited, spot.residblur, spotEdited.residblur); assignFromKeyfile(keyFile, "Locallab", "Levelblur_" + index_str, pedited, spot.levelblur, spotEdited.levelblur); assignFromKeyfile(keyFile, "Locallab", "Sigmabl_" + index_str, pedited, spot.sigmabl, spotEdited.sigmabl); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index fd1e5fbc6..264a52cdf 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1292,6 +1292,10 @@ struct LocallabParams { double lclightness; int levelwav; double residcont; + double residsha; + double residshathr; + double residhi; + double residhithr; double residblur; double levelblur; double sigmabl; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 3363728a2..0d0c6edc2 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -941,7 +941,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabstrbl LUMINANCECURVE, // Evlocallabsigmadr LUMINANCECURVE, // Evlocallabsigmabl - LUMINANCECURVE // Evlocallabsigmaed + LUMINANCECURVE, // Evlocallabsigmaed + LUMINANCECURVE, // Evlocallabresidsha + LUMINANCECURVE, // Evlocallabresidshathr + LUMINANCECURVE, // Evlocallabresidhi + LUMINANCECURVE // Evlocallabresidhithr }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index f01e4672e..a60649dbf 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -885,8 +885,14 @@ private: FlatCurveEditor* const wavshape; Adjuster* const levelwav; ThresholdAdjuster* const csThreshold; + MyExpander* const expresidpyr; Adjuster* const residcont; Adjuster* const residchro; + Gtk::Frame* const shresFrame; + Adjuster* const residsha; + Adjuster* const residshathr; + Adjuster* const residhi; + Adjuster* const residhithr; Adjuster* const sensilc; Gtk::Frame* const clariFrame; Adjuster* const clarilres; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 9ff47d399..a34ffdf32 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -2006,8 +2006,14 @@ LocallabContrast::LocallabContrast(): wavshape(static_cast(LocalcurveEditorwav->addCurve(CT_Flat, "", nullptr, false, false))), levelwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELWAV"), 1, 9, 1, 4))), csThreshold(Gtk::manage(new ThresholdAdjuster(M("TP_LOCALLAB_CSTHRESHOLD"), 0, 9, 0, 0, 6, 6, 0, false))), + 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.))), + residhithr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDHITHR"), 0., 100., 1., 70.))), sensilc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 30))), clariFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CLARIFRA")))), clarilres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARILRES"), -20., 100., 0.5, 0.))), @@ -2126,10 +2132,26 @@ LocallabContrast::LocallabContrast(): csThreshold->setAdjusterListener(this); + Gtk::HBox* const LresTitleHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Label* const LresLabel = Gtk::manage(new Gtk::Label()); + LresLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_RESIDPYR")) + Glib::ustring("")); + LresLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + LresTitleHBox->pack_start(*LresLabel, Gtk::PACK_EXPAND_WIDGET, 0); + expresidpyr->setLabel(LresTitleHBox); + setExpandAlignProperties(expresidpyr, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + residcont->setAdjusterListener(this); residchro->setAdjusterListener(this); + residsha->setAdjusterListener(this); + + residshathr->setAdjusterListener(this); + + residhi->setAdjusterListener(this); + + residhithr->setAdjusterListener(this); + sensilc->setAdjusterListener(this); if (showtooltip) { @@ -2381,6 +2403,7 @@ LocallabContrast::LocallabContrast(): if (complexsoft < 2) { pack_start(*localcontMethod); } + shresFrame->set_label_align(0.025, 0.5); pack_start(*lcradius); pack_start(*lcamount); @@ -2389,8 +2412,19 @@ LocallabContrast::LocallabContrast(): pack_start(*LocalcurveEditorwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor // pack_start(*levelwav); pack_start(*csThreshold); - pack_start(*residcont); - pack_start(*residchro); + ToolParamBlock* const resiBox = Gtk::manage(new ToolParamBlock()); + resiBox->pack_start(*residcont); + resiBox->pack_start(*residchro); + ToolParamBlock* const shresBox = Gtk::manage(new ToolParamBlock()); + shresBox->pack_start(*residsha); + shresBox->pack_start(*residshathr); + shresBox->pack_start(*residhi); + shresBox->pack_start(*residhithr); + + shresFrame->add(*shresBox); + resiBox->pack_start(*shresFrame); + expresidpyr->add(*resiBox, false); + pack_start(*expresidpyr); pack_start(*sensilc); Gtk::HSeparator* const separatorcontr = Gtk::manage(new Gtk::HSeparator()); pack_start(*separatorcontr); @@ -2526,6 +2560,7 @@ void LocallabContrast::getMaskView(int &colorMask, int &colorMaskinv, int &expMa void LocallabContrast::setDefaultExpanderVisibility() { + expresidpyr->set_expanded(false); expcontrastpyr->set_expanded(false); expcontrastpyr2->set_expanded(false); expmasklc->set_expanded(false); @@ -2608,6 +2643,10 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa 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); @@ -2723,6 +2762,10 @@ void LocallabContrast::write(rtengine::procparams::ProcParams* pp, ParamsEdited* 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(); @@ -2813,6 +2856,10 @@ void LocallabContrast::setDefaults(const rtengine::procparams::ProcParams* defPa csThreshold->setDefault(defSpot.csthreshold); residcont->setDefault(defSpot.residcont); residchro->setDefault(defSpot.residchro); + residsha->setDefault(defSpot.residsha); + residshathr->setDefault(defSpot.residshathr); + residhi->setDefault(defSpot.residhi); + residhithr->setDefault(defSpot.residhithr); sensilc->setDefault((double)defSpot.sensilc); clarilres->setDefault(defSpot.clarilres); claricres->setDefault(defSpot.claricres); @@ -2901,6 +2948,34 @@ void LocallabContrast::adjusterChanged(Adjuster* a, double newval) } } + if (a == residsha) { + if (listener) { + listener->panelChanged(Evlocallabresidsha, + residsha->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == residshathr) { + if (listener) { + listener->panelChanged(Evlocallabresidshathr, + residshathr->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == residhi) { + if (listener) { + listener->panelChanged(Evlocallabresidhi, + residhi->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == residhithr) { + if (listener) { + listener->panelChanged(Evlocallabresidhithr, + residhithr->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == sensilc) { if (listener) { listener->panelChanged(Evlocallabsensilc, @@ -3466,6 +3541,11 @@ void LocallabContrast::updateContrastGUI1() csThreshold->hide(); residcont->hide(); residchro->hide(); + residsha->hide(); + residshathr->hide(); + residhi->hide(); + residhithr->hide(); + shresFrame->hide(); clariFrame->hide(); strwav->hide(); angwav->hide(); @@ -3507,6 +3587,11 @@ void LocallabContrast::updateContrastGUI1() csThreshold->show(); residcont->show(); residchro->show(); + residsha->show(); + residshathr->show(); + residhi->show(); + residhithr->show(); + shresFrame->show(); clariFrame->show(); strwav->show(); angwav->show(); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 6de3dc550..faabd8f65 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1320,6 +1320,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).lclightness = locallab.spots.at(j).lclightness && pSpot.lclightness == otherSpot.lclightness; locallab.spots.at(j).levelwav = locallab.spots.at(j).levelwav && pSpot.levelwav == otherSpot.levelwav; locallab.spots.at(j).residcont = locallab.spots.at(j).residcont && pSpot.residcont == otherSpot.residcont; + locallab.spots.at(j).residsha = locallab.spots.at(j).residsha && pSpot.residsha == otherSpot.residsha; + locallab.spots.at(j).residshathr = locallab.spots.at(j).residshathr && pSpot.residshathr == otherSpot.residshathr; + locallab.spots.at(j).residhi = locallab.spots.at(j).residhi && pSpot.residhi == otherSpot.residhi; + locallab.spots.at(j).residhithr = locallab.spots.at(j).residhithr && pSpot.residhithr == otherSpot.residhithr; locallab.spots.at(j).residblur = locallab.spots.at(j).residblur && pSpot.residblur == otherSpot.residblur; locallab.spots.at(j).levelblur = locallab.spots.at(j).levelblur && pSpot.levelblur == otherSpot.levelblur; locallab.spots.at(j).sigmabl = locallab.spots.at(j).sigmabl && pSpot.sigmabl == otherSpot.sigmabl; @@ -4202,6 +4206,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).residcont = mods.locallab.spots.at(i).residcont; } + if (locallab.spots.at(i).residsha) { + toEdit.locallab.spots.at(i).residsha = mods.locallab.spots.at(i).residsha; + } + + if (locallab.spots.at(i).residshathr) { + toEdit.locallab.spots.at(i).residshathr = mods.locallab.spots.at(i).residshathr; + } + + if (locallab.spots.at(i).residhi) { + toEdit.locallab.spots.at(i).residhi = mods.locallab.spots.at(i).residhi; + } + + if (locallab.spots.at(i).residhithr) { + toEdit.locallab.spots.at(i).residhithr = mods.locallab.spots.at(i).residhithr; + } + if (locallab.spots.at(i).residblur) { toEdit.locallab.spots.at(i).residblur = mods.locallab.spots.at(i).residblur; } @@ -4222,6 +4242,7 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).residcomp = mods.locallab.spots.at(i).residcomp; } + if (locallab.spots.at(i).sigma) { toEdit.locallab.spots.at(i).sigma = mods.locallab.spots.at(i).sigma; } @@ -5979,6 +6000,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : lclightness(v), levelwav(v), residcont(v), + residsha(v), + residshathr(v), + residhi(v), + residhithr(v), residblur(v), levelblur(v), sigmabl(v), @@ -6414,6 +6439,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) lclightness = v; levelwav = v; residcont = v; + residsha = v; + residshathr = v; + residhi = v; + residhithr = v; residblur = v; levelblur = v; sigmabl = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index e27c6e455..26626f196 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -720,6 +720,10 @@ public: bool lclightness; bool levelwav; bool residcont; + bool residsha; + bool residshathr; + bool residhi; + bool residhithr; bool residblur; bool levelblur; bool sigmabl;