diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index e026a2820..52b58d01f 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -834,7 +834,7 @@ void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data LUTf irangefn(0x20000); { const float noisehi = 1.33f * noise * sensicrash * dirpyrThreshold / expf(level * log(3.0)), noiselo = 0.66f * noise * sensicrash * dirpyrThreshold / expf(level * log(3.0)); - //printf("level=%i multlev=%f noisehi=%f noiselo=%f skinprot=%f\n",level,mult[level], noisehi, noiselo, skinprot); + // printf("level=%i multlev=%f noisehi=%f noiselo=%f skinprot=%f\n",level,mult[level], noisehi, noiselo, skinprot); // printf("noihi=%f noilo=%f\n", noisehi, noiselo); for (int i = 0; i < 0x20000; i++) { @@ -867,6 +867,7 @@ void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data if(blurcb > 0.f && choice == 0) { AlignedBuffer blurbufcbdl(width * height); float rad = 0.05f * blurcb * fabs((level + 1) * (multbis[level] - 1.f)); + // printf("rad=%f level=%i\n", rad, level); #ifdef _OPENMP #pragma omp parallel if (multiThread) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index c34dce4d8..60f705255 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -207,7 +207,7 @@ struct local_params { float slomaSH; float radmacb; float blendmacb; - float chromacb; + float chromacbm; float gammacb; float slomacb; float struexp; @@ -257,7 +257,7 @@ struct local_params { float noisecc; float mulloc[6]; float threshol; -// float chromacb; + float chromacb; float strengt; float gamm; float esto; @@ -612,7 +612,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.slomaSH = slomaskSH; lp.blendmacb = blendmaskcb; lp.radmacb = radmaskcb; - lp.chromacb = chromaskcb; + lp.chromacbm = chromaskcb; lp.gammacb = gammaskcb; lp.slomacb = slomaskcb; @@ -4862,7 +4862,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o array2D guid(bfw, bfh); float meanfab, fab; - mean_fab(xstart, ystart, bfw, bfh, loctemp.get(), original, fab, meanfab, lp.chromaSH); + mean_fab(xstart, ystart, bfw, bfh, loctemp.get(), original, fab, meanfab, lp.chromacbm); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) @@ -4995,7 +4995,11 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o 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; } - + /* + for (int lv = 0; lv < 6; lv++) { + printf("mulloc=%f lv=%i\n", lp.mulloc[lv], lv); + } + */ 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); if (lp.softradiuscb > 0.f) { @@ -5048,7 +5052,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } 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); + multc[lv] = rtengine::max((lp.chromacb * ((float) lp.mulloc[lv] - 1.f)) + 1.f, 0.01f); + // printf("multc=%f lev=%i\n", multc[lv], lv); } choice = 1; ImProcFunctions::cbdl_local_temp(bufsh, loctemp->L, bfw, bfh, multc, rtengine::max(lp.chromacb, 1.f), lp.threshol, clarich, 0.f, lp.blurcbdl, skinprot, false, b_l, t_l, t_r, b_r, choice, sk, multiThread); diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 8c1e7e7d5..62ecdce4b 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2498,7 +2498,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Contrast by detail levels expcbdl(false), mult{1.0, 1.0, 1.0, 1.0, 1.0, 1.0}, - chromacbdl(0), + chromacbdl(0.), threshold(0.2), sensicb(15), clarityml(0.1), diff --git a/rtengine/procparams.h b/rtengine/procparams.h index bfdd3d905..79ed6b8e5 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1099,7 +1099,7 @@ struct LocallabParams { // Contrast by detail levels bool expcbdl; double mult[6]; - int chromacbdl; + double chromacbdl; double threshold; int sensicb; double clarityml; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 32d44ebb8..1b9ef3a88 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -169,7 +169,7 @@ Locallab::Locallab(): lclightness(Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_LIGHTNESS"), 0, 3.0, 0.01, 1.0))), sensilc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 19))), // Contrast by detail levels - chromacbdl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMACBDL"), 0, 300, 1, 0))), + 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))), 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))), @@ -2064,7 +2064,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).mult[i] = multiplier[i]->getValue(); } - pp->locallab.spots.at(pp->locallab.selspot).chromacbdl = chromacbdl->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).chromacbdl = chromacbdl->getValue(); pp->locallab.spots.at(pp->locallab.selspot).threshold = threshold->getValue(); pp->locallab.spots.at(pp->locallab.selspot).sensicb = sensicb->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).clarityml = clarityml->getValue(); @@ -3424,7 +3424,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe multiplier[i]->setDefault(defSpot->mult[i]); } - chromacbdl->setDefault((double)defSpot->chromacbdl); + chromacbdl->setDefault(defSpot->chromacbdl); threshold->setDefault(defSpot->threshold); sensicb->setDefault((double)defSpot->sensicb); clarityml->setDefault(defSpot->clarityml);