diff --git a/rtdata/languages/default b/rtdata/languages/default index e2efc13a8..7f402ea46 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1118,6 +1118,7 @@ HISTORY_MSG_879;Local - LC Chroma levels HISTORY_MSG_880;Local - LC Chroma blur levels HISTORY_MSG_881;Local - Contrast Offset Luminance HISTORY_MSG_882;Local - Contrast Blur +HISTORY_MSG_883;Local - Contrast By Levels HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 5ed40956d..7c08464d7 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -321,7 +321,7 @@ public: const LocwavCurve & loclevwavCurve, bool & loclevwavutili, bool wavcurvelev, const LocwavCurve & locconwavCurve, bool & locconwavutili, bool wavcurvecon, const LocwavCurve & loccompwavCurve, bool & loccompwavutili, bool wavcurvecomp, - float sigm, float offs,int & maxlvl, float fatdet, float fatanch, float chromalev, float chromablu, bool blurlc, bool blurena); + float sigm, float offs,int & maxlvl, float fatdet, float fatanch, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena); void wavcont(wavelet_decomposition &wdspot, float ****templevel, int level_bl, int maxlvl, const LocwavCurve & loclevwavCurve, bool & loclevwavutili, diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index a0fd54601..ee81bcbb4 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -4079,7 +4079,7 @@ void ImProcFunctions::maskcalccol(int call, bool invmask, bool pde, int bfw, int bool wavcurvecon = false; bool loccompwavutili = false; bool wavcurvecomp = false; - wavcontrast4(bufmaskblurcol->L, nullptr, nullptr, contrast, 0.f, 0.f, 0.f, bfw, bfh, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurvecolwav, lmasutilicolwav, dummy, loclevwavutili, wavcurvelev, dummy, locconwavutili, wavcurvecon, dummy, loccompwavutili, wavcurvecomp, 1.f, 1.f, maxlvl, 0.f, 0.f, 1.f, 1.f, false, false); + wavcontrast4(bufmaskblurcol->L, nullptr, nullptr, contrast, 0.f, 0.f, 0.f, bfw, bfh, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurvecolwav, lmasutilicolwav, dummy, loclevwavutili, wavcurvelev, dummy, locconwavutili, wavcurvecon, dummy, loccompwavutili, wavcurvecomp, 1.f, 1.f, maxlvl, 0.f, 0.f, 1.f, 1.f, false, false, false); } @@ -7114,7 +7114,7 @@ void ImProcFunctions::wavcontrast4(float ** tmp, float ** tmpa, float ** tmpb, f const LocwavCurve & locwavCurve, bool & locwavutili, const LocwavCurve & loclevwavCurve, bool & loclevwavutili, bool wavcurvelev, const LocwavCurve & locconwavCurve, bool & locconwavutili, bool wavcurvecon, const LocwavCurve & loccompwavCurve, bool & loccompwavutili, bool wavcurvecomp, - float sigm, float offs, int & maxlvl, float fatdet, float fatanch, float chromalev, float chromablu, bool blurlc, bool blurena) + float sigm, float offs, int & maxlvl, float fatdet, float fatanch, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena) { wavelet_decomposition *wdspot = new wavelet_decomposition(tmp[0], bfw, bfh, maxlvl, 1, sk, numThreads, 6); @@ -7316,7 +7316,7 @@ void ImProcFunctions::wavcontrast4(float ** tmp, float ** tmpa, float ** tmpb, f } } - if (wavcurvecon) {//contrast by levels for luminance + if (wavcurvecon && levelena) {//contrast by levels for luminance wavcbd(*wdspot, level_bl, maxlvl, locconwavCurve, locconwavutili, sigm, offs, 1.f, sk); } @@ -7403,7 +7403,7 @@ void ImProcFunctions::wavcontrast4(float ** tmp, float ** tmpa, float ** tmpb, f wdspot->reconstruct(tmp[0], 1.f); delete wdspot; - if (wavcurvecon && (chromalev != 1.f)) { // a and b if need ) {//contrast by levels for chroma a and b + if (wavcurvecon && (chromalev != 1.f) && levelena) { // a and b if need ) {//contrast by levels for chroma a and b wdspota = new wavelet_decomposition(tmpa[0], bfw, bfh, maxlvl, 1, sk, numThreads, 6); if (wdspota->memoryAllocationFailed) { @@ -7426,7 +7426,7 @@ void ImProcFunctions::wavcontrast4(float ** tmp, float ** tmpa, float ** tmpb, f } - if (wavcurvelev && radlevblur > 0.f) {//chroma blur if need + if (wavcurvelev && radlevblur > 0.f && blurena) {//chroma blur if need if (!blurlc) { // a wdspota = new wavelet_decomposition(tmpa[0], bfw, bfh, maxlvl, 1, sk, numThreads, 6); @@ -9542,7 +9542,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bool wavcurvecon = false; bool loccompwavutili = false; bool wavcurvecomp = false; - wavcontrast4(bufmaskblurbl->L, nullptr, nullptr, contrast, 0.f, 0.f, 0.f, GW, GH, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurveblwav, lmasutiliblwav, dummy, loclevwavutili, wavcurvelev, dummy, locconwavutili, wavcurvecon, dummy, loccompwavutili, wavcurvecomp, 1.f, 1.f, maxlvl, 0.f, 0.f, 1.f, 1.f, false, false); + wavcontrast4(bufmaskblurbl->L, nullptr, nullptr, contrast, 0.f, 0.f, 0.f, GW, GH, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurveblwav, lmasutiliblwav, dummy, loclevwavutili, wavcurvelev, dummy, locconwavutili, wavcurvecon, dummy, loccompwavutili, wavcurvecomp, 1.f, 1.f, maxlvl, 0.f, 0.f, 1.f, 1.f, false, false, false); } int shado = params->locallab.spots.at(sp).shadmaskbl; @@ -11477,8 +11477,9 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o const float chrol = params->locallab.spots.at(sp).chromalev; const float chrobl = params->locallab.spots.at(sp).chromablu; const bool blurena = params->locallab.spots.at(sp).wavblur; + const bool levelena = params->locallab.spots.at(sp).wavcont; - wavcontrast4(tmp1->L, tmp1->a, tmp1->b, contrast, fatres, radblur, radlevblur, tmp1->W, tmp1->H, level_bl, level_hl, level_br, level_hr, sk, numThreads, locwavCurve, locwavutili, loclevwavCurve, loclevwavutili, wavcurvelev, locconwavCurve, locconwavutili, wavcurvecon, loccompwavCurve, loccompwavutili, wavcurvecomp, sigma, offs, maxlvl, fatdet, fatanch, chrol, chrobl, blurlc, blurena); + wavcontrast4(tmp1->L, tmp1->a, tmp1->b, contrast, fatres, radblur, radlevblur, tmp1->W, tmp1->H, level_bl, level_hl, level_br, level_hr, sk, numThreads, locwavCurve, locwavutili, loclevwavCurve, loclevwavutili, wavcurvelev, locconwavCurve, locconwavutili, wavcurvecon, loccompwavCurve, loccompwavutili, wavcurvecomp, sigma, offs, maxlvl, fatdet, fatanch, chrol, chrobl, blurlc, blurena, levelena); const float satur = params->locallab.spots.at(sp).residchro; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 19f2770a1..d84be3b6b 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -908,6 +908,7 @@ enum ProcEventCode { Evlocallabchromablu = 879, Evlocallaboffset = 880, Evlocallabwavblur = 881, + Evlocallabwavcont = 882, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 1780ccc48..929ed571b 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2740,6 +2740,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : fftwlc(false), blurlc(true), wavblur(false), + wavcont(false), origlc(false), localcontMethod("loc"), locwavcurve{(double)FCT_MinMaxCPoints, 0.0, 0.5, 0.35, 0.35, 1., 0.5, 0.35, 0.35}, @@ -3149,6 +3150,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && fftwlc == other.fftwlc && blurlc == other.blurlc && wavblur == other.wavblur + && wavcont == other.wavcont && origlc == other.origlc && localcontMethod == other.localcontMethod && locwavcurve == other.locwavcurve @@ -4537,6 +4539,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).fftwlc, "Locallab", "Fftwlc_" + std::to_string(i), spot.fftwlc, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blurlc, "Locallab", "Blurlc_" + std::to_string(i), spot.blurlc, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).wavblur, "Locallab", "Wavblur_" + std::to_string(i), spot.wavblur, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).wavcont, "Locallab", "Wavcont_" + std::to_string(i), spot.wavcont, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).origlc, "Locallab", "Origlc_" + std::to_string(i), spot.origlc, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).localcontMethod, "Locallab", "localcontMethod_" + std::to_string(i), spot.localcontMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).locwavcurve, "Locallab", "LocwavCurve_" + std::to_string(i), spot.locwavcurve, keyFile); @@ -6076,6 +6079,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Fftwlc_" + std::to_string(i), pedited, spot.fftwlc, spotEdited.fftwlc); assignFromKeyfile(keyFile, "Locallab", "Blurlc_" + std::to_string(i), pedited, spot.blurlc, spotEdited.blurlc); assignFromKeyfile(keyFile, "Locallab", "Wavblur_" + std::to_string(i), pedited, spot.wavblur, spotEdited.wavblur); + assignFromKeyfile(keyFile, "Locallab", "Wavcont_" + std::to_string(i), pedited, spot.wavcont, spotEdited.wavcont); assignFromKeyfile(keyFile, "Locallab", "Origlc_" + std::to_string(i), pedited, spot.origlc, spotEdited.origlc); assignFromKeyfile(keyFile, "Locallab", "localcontMethod_" + std::to_string(i), pedited, spot.localcontMethod, spotEdited.localcontMethod); assignFromKeyfile(keyFile, "Locallab", "LocwavCurve_" + std::to_string(i), pedited, spot.locwavcurve, spotEdited.locwavcurve); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 6f29c1bfe..630b617f3 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1283,6 +1283,7 @@ struct LocallabParams { bool fftwlc; bool blurlc; bool wavblur; + bool wavcont; bool origlc; Glib::ustring localcontMethod; std::vector locwavcurve; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 5fb59fd6d..ee3069054 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -911,7 +911,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabchromalev LUMINANCECURVE, //Evlocallabchromablu LUMINANCECURVE, //Evlocallaboffset - LUMINANCECURVE //Evlocallabwavblur + LUMINANCECURVE, //Evlocallabwavblur + LUMINANCECURVE //Evlocallabwavcont }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index dc88cdf90..448d343d6 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -688,6 +688,7 @@ blurlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLURLC")))), origlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ORIGLC")))), enalcMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), wavblur(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLURLEVELFRA")))), +wavcont(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_CONTFRA")))), //CBDL enacbMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), //encoding log @@ -2835,6 +2836,7 @@ pe(nullptr) blurlcConn = blurlc->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::blurlcChanged)); wavblurConn = wavblur->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::wavblurChanged)); + wavcontConn = wavcont->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::wavcontChanged)); origlcConn = origlc->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::origlcChanged)); csThreshold->setAdjusterListener(this); @@ -2967,7 +2969,12 @@ pe(nullptr) blurlevelFrame->add(*blurlevcontBox); contFrame->set_label_align(0.025, 0.5); - ToolParamBlock* const contlevBox = Gtk::manage(new ToolParamBlock()); +// ToolParamBlock* const contlevBox = Gtk::manage(new ToolParamBlock()); + Gtk::VBox *contlevBox = Gtk::manage ( new Gtk::VBox()); + contlevBox->set_spacing(2); + wavcont->set_active (true); + contFrame->set_label_widget(*wavcont); + contlevBox->pack_start(*sigma); contlevBox->pack_start(*offset); contlevBox->pack_start(*chromalev); @@ -5295,6 +5302,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).fftwlc = fftwlc->get_active(); pp->locallab.spots.at(pp->locallab.selspot).blurlc = blurlc->get_active(); pp->locallab.spots.at(pp->locallab.selspot).wavblur = wavblur->get_active(); + pp->locallab.spots.at(pp->locallab.selspot).wavcont = wavcont->get_active(); pp->locallab.spots.at(pp->locallab.selspot).origlc = origlc->get_active(); pp->locallab.spots.at(pp->locallab.selspot).locwavcurve = wavshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).csthreshold = csThreshold->getValue(); @@ -5707,6 +5715,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).fftwlc = pe->locallab.spots.at(pp->locallab.selspot).fftwlc || !fftwlc->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).blurlc = pe->locallab.spots.at(pp->locallab.selspot).blurlc || !blurlc->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).wavblur = pe->locallab.spots.at(pp->locallab.selspot).wavblur || !wavblur->get_inconsistent(); + pe->locallab.spots.at(pp->locallab.selspot).wavcont = pe->locallab.spots.at(pp->locallab.selspot).wavcont || !wavcont->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).origlc = pe->locallab.spots.at(pp->locallab.selspot).origlc || !origlc->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).localcontMethod = pe->locallab.spots.at(pp->locallab.selspot).localcontMethod || localcontMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).locwavcurve = pe->locallab.spots.at(pp->locallab.selspot).locwavcurve || !wavshape->isUnChanged(); @@ -6118,6 +6127,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).fftwlc = pedited->locallab.spots.at(pp->locallab.selspot).fftwlc || !fftwlc->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).blurlc = pedited->locallab.spots.at(pp->locallab.selspot).blurlc || !blurlc->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).wavblur = pedited->locallab.spots.at(pp->locallab.selspot).wavblur || !wavblur->get_inconsistent(); + pedited->locallab.spots.at(pp->locallab.selspot).wavcont = pedited->locallab.spots.at(pp->locallab.selspot).wavcont || !wavcont->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).origlc = pedited->locallab.spots.at(pp->locallab.selspot).origlc || !origlc->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).locwavcurve = pedited->locallab.spots.at(pp->locallab.selspot).locwavcurve || !wavshape->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).loclevwavcurve = pedited->locallab.spots.at(pp->locallab.selspot).loclevwavcurve || !wavshapelev->isUnChanged(); @@ -8310,6 +8320,29 @@ void Locallab::wavblurChanged() } } +void Locallab::wavcontChanged() +{ + + if (multiImage) { + if (wavcont->get_inconsistent()) { + wavcont->set_inconsistent(false); + wavcontConn.block(true); + wavcont->set_active(false); + wavcontConn.block(false); + } + } + + if (getEnabled() && expcontrast->getEnabled()) { + if (listener) { + if (wavcont->get_active()) { + listener->panelChanged(Evlocallabwavcont, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(Evlocallabwavcont, M("GENERAL_DISABLED")); + } + } + } +} + void Locallab::origlcChanged() { @@ -11319,6 +11352,7 @@ void Locallab::enableListener() fftwlcConn.block(false); blurlcConn.block(false); wavblurConn.block(false); + wavcontConn.block(false); origlcConn.block(false); showmasklcMethodConn.block(false); enalcMaskConn.block(false); @@ -11418,6 +11452,7 @@ void Locallab::disableListener() fftwlcConn.block(true); blurlcConn.block(true); wavblurConn.block(true); + wavcontConn.block(true); origlcConn.block(true); showmasklcMethodConn.block(true); enalcMaskConn.block(true); @@ -12091,6 +12126,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con fftwlc->set_active(pp->locallab.spots.at(index).fftwlc); blurlc->set_active(pp->locallab.spots.at(index).blurlc); wavblur->set_active(pp->locallab.spots.at(index).wavblur); + wavcont->set_active(pp->locallab.spots.at(index).wavcont); origlc->set_active(pp->locallab.spots.at(index).origlc); csThreshold->setValue(pp->locallab.spots.at(index).csthreshold); @@ -12607,6 +12643,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con fftwlc->set_inconsistent(multiImage && !spotState->fftwlc); blurlc->set_inconsistent(multiImage && !spotState->blurlc); wavblur->set_inconsistent(multiImage && !spotState->wavblur); + wavcont->set_inconsistent(multiImage && !spotState->wavcont); origlc->set_inconsistent(multiImage && !spotState->origlc); wavshape->setUnChanged(!spotState->locwavcurve); wavshapelev->setUnChanged(!spotState->loclevwavcurve); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 1f38a106a..b2ee2231b 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -492,6 +492,8 @@ private: sigc::connection enalcMaskConn; Gtk::CheckButton* const wavblur; sigc::connection wavblurConn; + Gtk::CheckButton* const wavcont; + sigc::connection wavcontConn; //CBDL @@ -700,6 +702,7 @@ private: void origlcChanged(); void enalcMaskChanged(); void wavblurChanged(); + void wavcontChanged(); //CBDL void enacbMaskChanged(); // ComboBox event functions diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index c81df52c5..fcf23ecc6 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1276,6 +1276,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).fftwlc = locallab.spots.at(j).fftwlc && pSpot.fftwlc == otherSpot.fftwlc; locallab.spots.at(j).blurlc = locallab.spots.at(j).blurlc && pSpot.blurlc == otherSpot.blurlc; locallab.spots.at(j).wavblur = locallab.spots.at(j).wavblur && pSpot.wavblur == otherSpot.wavblur; + locallab.spots.at(j).wavcont = locallab.spots.at(j).wavcont && pSpot.wavcont == otherSpot.wavcont; locallab.spots.at(j).origlc = locallab.spots.at(j).origlc && pSpot.origlc == otherSpot.origlc; locallab.spots.at(j).localcontMethod = locallab.spots.at(j).localcontMethod && pSpot.localcontMethod == otherSpot.localcontMethod; locallab.spots.at(j).locwavcurve = locallab.spots.at(j).locwavcurve && pSpot.locwavcurve == otherSpot.locwavcurve; @@ -4082,6 +4083,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).wavblur = mods.locallab.spots.at(i).wavblur; } + if (locallab.spots.at(i).wavcont) { + toEdit.locallab.spots.at(i).wavcont = mods.locallab.spots.at(i).wavcont; + } + if (locallab.spots.at(i).origlc) { toEdit.locallab.spots.at(i).origlc = mods.locallab.spots.at(i).origlc; } @@ -5630,6 +5635,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : fftwlc(v), blurlc(v), wavblur(v), + wavcont(v), origlc(v), localcontMethod(v), locwavcurve(v), @@ -6029,6 +6035,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) fftwlc = v; blurlc = v; wavblur = v; + wavcont = v; origlc = v; localcontMethod = v; locwavcurve = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index f17d8114f..8ba38f669 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -709,6 +709,7 @@ public: bool fftwlc; bool blurlc; bool wavblur; + bool wavcont; bool origlc; bool localcontMethod; bool locwavcurve;