diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index 0d13ad2e4..654b84dde 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -35,12 +35,12 @@ namespace rtengine { constexpr int maxlevel = 6; -constexpr int maxlevelloc = 5; +constexpr int maxlevelloc = 6;//5 constexpr float noise = 2000; //sequence of scales constexpr int scales[maxlevel] = {1, 2, 4, 8, 16, 32}; -constexpr int scalesloc[5] = {1, 2, 4, 8, 16}; +constexpr int scalesloc[6] = {1, 2, 4, 8, 16, 32}; extern const Settings* settings; //sequence of scales @@ -297,10 +297,10 @@ void ImProcFunctions::cbdl_local_temp(float ** src, float ** loctemp, int srcwid } int level; - float multi[5] = {1.f, 1.f, 1.f, 1.f, 1.f}; - float scalefl[5]; + float multi[6] = {1.f, 1.f, 1.f, 1.f, 1.f, 1.f}; + float scalefl[6]; - for (int lv = 0; lv < 5; lv++) { + for (int lv = 0; lv < 6; lv++) { scalefl[lv] = ((float) scalesloc[lv]) / (float) scaleprev; if (lv >= 1) { diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index e8aeaedbf..febc6f8a4 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -255,7 +255,7 @@ struct local_params { float noiselc; float noisecf; float noisecc; - float mulloc[5]; + float mulloc[6]; float threshol; // float chromacb; float strengt; @@ -477,9 +477,9 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_noisecf = ((float)locallab.spots.at(sp).noisechrof) / 10.f; float local_noisecc = ((float)locallab.spots.at(sp).noisechroc) / 10.f; - float multi[5]; + float multi[6]; - for (int y = 0; y < 5; y++) { + for (int y = 0; y < 6; y++) { multi[y] = ((float) locallab.spots.at(sp).mult[y]); } @@ -689,7 +689,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.rewe = rewe; lp.senstm = local_sensitm; - for (int y = 0; y < 5; y++) { + for (int y = 0; y < 6; y++) { lp.mulloc[y] = CLIP04(multi[y]);//to prevent crash with old pp3 integer } @@ -3917,7 +3917,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o // but with qualmet = 2 (default for best quality) we must denoise chroma with little values to prevent artifacts due to variations of Hue // but if user select volontary denoise, it is that choice the good (prioritary) bool execcolor = (lp.chro != 0.f || lp.ligh != 0.f || lp.cont != 0); // only if one slider ore more is engaged - bool execbdl = (lp.mulloc[0] != 1.f || lp.mulloc[1] != 1.f || lp.mulloc[2] != 1.f || lp.mulloc[3] != 1.f || lp.mulloc[4] != 1.f) ;//only if user want cbdl + bool execbdl = (lp.mulloc[0] != 1.f || lp.mulloc[1] != 1.f || lp.mulloc[2] != 1.f || lp.mulloc[3] != 1.f || lp.mulloc[4] != 1.f || lp.mulloc[5] != 1.f) ;//only if user want cbdl bool execdenoi = noiscfactiv && ((lp.colorena && execcolor) || (lp.tonemapena && lp.strengt != 0.f) || (lp.cbdlena && execbdl) || (lp.sfena && lp.strng > 0.f) || (lp.lcena && lp.lcamount > 0.f) || (lp.sharpena && lp.shrad > 0.42) || (lp.retiena && lp.str > 0.f) || (lp.exposena && lp.expcomp != 0.f) || (lp.expvib && lp.past != 0.f)); if (((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f) && lp.denoiena) || execdenoi) { // sk == 1 ?? @@ -5015,7 +5015,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o //end TM //begin cbdl - if ((lp.mulloc[0] != 1.f || lp.mulloc[1] != 1.f || lp.mulloc[2] != 1.f || lp.mulloc[3] != 1.f || lp.mulloc[4] != 1.f || lp.clarityml != 0.f || lp.contresid != 0.f || lp.enacbMask || lp.showmaskcbmet == 2 || lp.showmaskcbmet == 3 || lp.showmaskcbmet == 4) && lp.cbdlena) { + if ((lp.mulloc[0] != 1.f || lp.mulloc[1] != 1.f || lp.mulloc[2] != 1.f || lp.mulloc[3] != 1.f || lp.mulloc[4] != 1.f || lp.mulloc[5] != 1.f || lp.clarityml != 0.f || lp.contresid != 0.f || lp.enacbMask || lp.showmaskcbmet == 2 || lp.showmaskcbmet == 3 || lp.showmaskcbmet == 4) && lp.cbdlena) { if (call <= 3) { //call from simpleprocess dcrop improcc const int ystart = std::max(static_cast(lp.yc - lp.lyT) - cy, 0); const int yend = std::min(static_cast(lp.yc + lp.ly) - cy, original->H); @@ -5024,7 +5024,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int bfh = yend - ystart; int bfw = xend - xstart; - if (bfw > 32 && bfh > 32) { + if (bfw > 65 && bfh > 65) { array2D bufsh(bfw, bfh); array2D &buflight = bufsh; JaggedArray bufchrom(bfw, bfh, true); @@ -5169,12 +5169,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } - if(lp.clarityml != 0.f && lp.mulloc[4] == 1.0) {//enabled last level to retrieve level 5 and residual image in case user not select level 5 - lp.mulloc[4]= 1.001f; + if(lp.clarityml != 0.f && lp.mulloc[5] == 1.0) {//enabled last level to retrieve level 5 and residual image in case user not select level 5 + lp.mulloc[5]= 1.001f; } - if(lp.contresid != 0.f && lp.mulloc[4] == 1.0) {//enabled last level to retrieve level 5 and residual image in case user not select level 5 - lp.mulloc[4]= 1.001f; + if(lp.contresid != 0.f && lp.mulloc[5] == 1.0) {//enabled last level to retrieve level 5 and residual image in case user not select level 5 + lp.mulloc[5]= 1.001f; } ImProcFunctions::cbdl_local_temp(bufsh, loctemp->L, bfw, bfh, lp.mulloc, 1.f, lp.threshol, lp.clarityml, lp.contresid, lp.blurcbdl, skinprot, false, b_l, t_l, t_r, b_r, choice, sk, multiThread); @@ -5217,7 +5217,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } - float multc[5]; + float multc[6]; float clarich = 0.5f * lp.clarityml; if(clarich > 0.f && lp.mulloc[0] == 1.f) { //to enabled in case of user select only clarity @@ -5228,7 +5228,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o lp.mulloc[0] = 1.01f; } - for (int lv = 0; lv < 5; lv++) { + for (int lv = 0; lv < 6; lv++) { multc[lv] = rtengine::max((lp.chromacb * ((float) lp.mulloc[lv] - 1.f) / 100.f) + 1.f, 0.f); } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 37c2ab696..b07e6a824 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2495,7 +2495,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : sensilc(19), // Contrast by detail levels expcbdl(false), - mult{1.0, 1.0, 1.0, 1.0, 1.0}, + mult{1.0, 1.0, 1.0, 1.0, 1.0, 1.0}, chromacbdl(0), threshold(0.2), sensicb(15), @@ -2693,7 +2693,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Constrast by detail levels && expcbdl == other.expcbdl && [this, &other]()->bool { - for (int i = 0; i < 5; i++) + for (int i = 0; i < 6; i++) { if (mult[i] != other.mult[i]) { return false; @@ -3846,7 +3846,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Contrast by detail levels saveToKeyfile(!pedited || pedited->locallab.spots.at(i).expcbdl, "Locallab", "Expcbdl_" + std::to_string(i), spot.expcbdl, keyFile); - for (int j = 0; j < 5; j++) { + for (int j = 0; j < 6; j++) { saveToKeyfile(!pedited || pedited->locallab.spots.at(i).mult[j], "Locallab", "Mult" + std::to_string(j) + "_" + std::to_string(i), spot.mult[j], keyFile); } @@ -5140,7 +5140,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) // Contrast by detail levels assignFromKeyfile(keyFile, "Locallab", "Expcbdl_" + std::to_string(i), pedited, spot.expcbdl, spotEdited.expcbdl); - for (int j = 0; j < 5; j ++) { + for (int j = 0; j < 6; j ++) { assignFromKeyfile(keyFile, "Locallab", "Mult" + std::to_string(j) + "_" + std::to_string(i), pedited, spot.mult[j], spotEdited.mult[j]); } diff --git a/rtengine/procparams.h b/rtengine/procparams.h index e35dda5e6..4163d719c 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1096,7 +1096,7 @@ struct LocallabParams { int sensilc; // Contrast by detail levels bool expcbdl; - double mult[5]; + double mult[6]; int chromacbdl; double threshold; int sensicb; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index e670259d7..ec853121d 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -932,13 +932,13 @@ Locallab::Locallab(): expmaskcb->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskcb)); expmaskcb->setLevel (2); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { Glib::ustring ss; ss = Glib::ustring::format(i); if (i == 0) { ss += Glib::ustring::compose(" (%1)", M("TP_DIRPYREQUALIZER_LUMAFINEST")); - } else if (i == 4) { + } else if (i == 5) { ss += Glib::ustring::compose(" (%1)", M("TP_DIRPYREQUALIZER_LUMACOARSEST")); } @@ -1011,7 +1011,7 @@ Locallab::Locallab(): lumacontrastPlusPressedConn = lumacontrastPlusButton->signal_pressed().connect(sigc::mem_fun(*this, &Locallab::lumacontrastPlusPressed)); cbdlBox->pack_start(*buttonBox); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { cbdlBox->pack_start(*multiplier[i]); } @@ -1313,7 +1313,7 @@ void Locallab::lumaneutralPressed() { // printf("lumaneutralPressed\n"); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { multiplier[i]->setValue(1.0); } @@ -1325,8 +1325,8 @@ void Locallab::lumacontrastPlusPressed() { // printf("lumacontrastPlusPressed\n"); - for (int i = 0; i < 5; i++) { - float inc = (5 - i); + for (int i = 0; i < 6; i++) { + float inc = (6 - i); multiplier[i]->setValue(multiplier[i]->getValue() + 0.01f * inc); } @@ -1338,8 +1338,8 @@ void Locallab::lumacontrastMinusPressed() { // printf("lumacontrastMinusPressed\n"); - for (int i = 0; i < 5; i++) { - float inc = - (5 - i); + for (int i = 0; i < 6; i++) { + float inc = - (6 - i); multiplier[i]->setValue(multiplier[i]->getValue() + 0.01f * inc); } @@ -2039,7 +2039,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) // Contrast by detail levels pp->locallab.spots.at(pp->locallab.selspot).expcbdl = expcbdl->getEnabled(); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { pp->locallab.spots.at(pp->locallab.selspot).mult[i] = multiplier[i]->getValue(); } @@ -2238,7 +2238,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) // Contrast by detail levels pe->locallab.spots.at(pp->locallab.selspot).expcbdl = pe->locallab.spots.at(pp->locallab.selspot).expcbdl || !expcbdl->get_inconsistent(); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { pe->locallab.spots.at(pp->locallab.selspot).mult[i] = pe->locallab.spots.at(pp->locallab.selspot).mult[i] || multiplier[i]->getEditedState(); } @@ -2439,7 +2439,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) // Contrast by detail levels pedited->locallab.spots.at(pp->locallab.selspot).expcbdl = pedited->locallab.spots.at(pp->locallab.selspot).expcbdl || !expcbdl->get_inconsistent(); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { pedited->locallab.spots.at(pp->locallab.selspot).mult[i] = pedited->locallab.spots.at(pp->locallab.selspot).mult[i] || multiplier[i]->getEditedState(); } @@ -3393,7 +3393,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lclightness->setDefault(defSpot->lclightness); sensilc->setDefault((double)defSpot->sensilc); // Contrast by detail levels - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { multiplier[i]->setDefault(defSpot->mult[i]); } @@ -3514,7 +3514,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lclightness->setDefaultEditedState(Irrelevant); sensilc->setDefaultEditedState(Irrelevant); // Contrast by detail levels - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { multiplier[i]->setDefaultEditedState(Irrelevant); } @@ -3639,7 +3639,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lclightness->setDefaultEditedState(defSpotState->lclightness ? Edited : UnEdited); sensilc->setDefaultEditedState(defSpotState->sensilc ? Edited : UnEdited); // Contrast by detail levels - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { multiplier[i]->setDefaultEditedState(defSpotState->mult[i] ? Edited : UnEdited); } @@ -4213,7 +4213,7 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) // Contrast by detail levels if (getEnabled() && expcbdl->getEnabled()) { - if (a == multiplier[0] || a == multiplier[1] || a == multiplier[2] || a == multiplier[3] || a == multiplier[4]) { + if (a == multiplier[0] || a == multiplier[1] || a == multiplier[2] || a == multiplier[3] || a == multiplier[4] || a == multiplier[5]) { if (listener) { listener->panelChanged(EvlocallabEqualizer, Glib::ustring::compose("%1, %2, %3, %4, %5", @@ -4493,7 +4493,7 @@ void Locallab::setBatchMode(bool batchMode) lclightness->showEditedCB(); sensilc->showEditedCB(); // Contrast by detail levels - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { multiplier[i]->showEditedCB(); } @@ -4947,7 +4947,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con // Contrast by detail levels expcbdl->setEnabled(pp->locallab.spots.at(index).expcbdl); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { multiplier[i]->setValue(pp->locallab.spots.at(index).mult[i]); } @@ -5180,7 +5180,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con // Contrast by detail levels expcbdl->set_inconsistent(!spotState->expcbdl); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { multiplier[i]->setEditedState(spotState->mult[i] ? Edited : UnEdited); } diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 8fbb3830c..d5a5d3e9e 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -189,7 +189,7 @@ private: Adjuster* const lclightness; Adjuster* const sensilc; // Contrast by detail levels - Adjuster* multiplier[5]; + Adjuster* multiplier[6]; Adjuster* const chromacbdl; Adjuster* const threshold; Adjuster* const clarityml; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 48dea544e..88145837c 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1086,7 +1086,7 @@ void ParamsEdited::initFrom(const std::vector& // Contrast by detail levels locallab.spots.at(j).expcbdl = locallab.spots.at(j).expcbdl && pSpot.expcbdl == otherSpot.expcbdl; - for (int k = 0; k < 5; k++) { + 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]; } @@ -3141,7 +3141,7 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).expcbdl = mods.locallab.spots.at(i).expcbdl; } - for (int j = 0; j < 5; j++) { + 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]; } @@ -4558,7 +4558,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Contrast by detail levels expcbdl = v; - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 6; i++) { mult[i] = v; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 0536577f1..441d02f0e 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -512,7 +512,7 @@ public: bool sensilc; // Contrast by detail levels bool expcbdl; - bool mult[5]; + bool mult[6]; bool chromacbdl; bool threshold; bool sensicb;