From 0c22f589525f29018a8373569208b519bdc39bff Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 6 May 2019 14:51:31 +0200 Subject: [PATCH] Change int to double - variables TM - clear cache needs --- rtengine/improcfun.cc | 10 +++++----- rtengine/iplocallab.cc | 10 +++++----- rtengine/procparams.cc | 10 +++++----- rtengine/procparams.h | 10 +++++----- rtgui/locallab.cc | 30 +++++++++++++++--------------- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index cb6c555e9..2e8c800be 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -5288,10 +5288,10 @@ void ImProcFunctions::EPDToneMapCIE(CieImage *ncie, float a_w, float c_, int Wid void ImProcFunctions::EPDToneMaplocal(int sp, LabImage *lab, LabImage *tmp1, unsigned int Iterates, int skip) { - float stren = ((float)params->locallab.spots.at(sp).stren) / 100.f; - float edgest = ((float)params->locallab.spots.at(sp).estop) / 100.f; - float sca = ((float)params->locallab.spots.at(sp).scaltm) / 10.f; - float gamm = ((float)params->locallab.spots.at(sp).gamma) / 100.f; + float stren = ((float)params->locallab.spots.at(sp).stren); + float edgest = ((float)params->locallab.spots.at(sp).estop); + float sca = ((float)params->locallab.spots.at(sp).scaltm); + float gamm = ((float)params->locallab.spots.at(sp).gamma); float satur = ((float)params->locallab.spots.at(sp).satur) / 100.f; float rew = ((float)params->locallab.spots.at(sp).rewei); //Pointers to whole data and size of it. @@ -5356,7 +5356,7 @@ void ImProcFunctions::EPDToneMaplocal(int sp, LabImage *lab, LabImage *tmp1, uns //Restore past range, also desaturate a bit per Mantiuk's Color correction for tone mapping. float s = (1.0f + 38.7889f) * powf(Compression, 1.5856f) / (1.0f + 38.7889f * powf(Compression, 1.5856f)); float sat = s + 0.3f * s * satur; - //printf("s=%f sat=%f \n", s, sat); + printf("s=%f sat=%f \n", s, sat); if(sat == 1.f) sat = 1.001f; #ifdef _OPENMP #pragma omp parallel for // removed schedule(dynamic,10) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 8c7c65596..0bc51c9cb 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -385,10 +385,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall int w = oW; int h = oH; int circr = locallab.spots.at(sp).circrad; - float streng = ((float)locallab.spots.at(sp).stren) / 100.f; - float gam = ((float)locallab.spots.at(sp).gamma) / 100.f; - float est = ((float)locallab.spots.at(sp).estop) / 100.f; - float scal_tm = ((float)locallab.spots.at(sp).scaltm) / 10.f; + float streng = ((float)locallab.spots.at(sp).stren); + float gam = ((float)locallab.spots.at(sp).gamma); + float est = ((float)locallab.spots.at(sp).estop); + float scal_tm = ((float)locallab.spots.at(sp).scaltm); float rewe = ((float)locallab.spots.at(sp).rewei); float amo = ((float)locallab.spots.at(sp).amount); float strlight = ((float)locallab.spots.at(sp).streng); @@ -5250,7 +5250,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o #endif for (int y = 0; y < bfh; y++) { for (int x = 0; x < bfw; x++) { - tmp1->L[y][x] = 0.01f* (lp.amo * tmp1->L[y][x] + (100.f - lp.amo) * bufgb->L[y][x]); + tmp1->L[y][x] = (lp.amo * tmp1->L[y][x] + (1.f - lp.amo) * bufgb->L[y][x]); } } */ diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index ecc46e667..8c1e7e7d5 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2457,15 +2457,15 @@ LocallabParams::LocallabSpot::LocallabSpot() : activlum(false), // Tone Mapping exptonemap(false), - stren(10), - gamma(100), - estop(70), - scaltm(40), + stren(0.5), + gamma(1.0), + estop(0.5), + scaltm(4.0), rewei(0), satur(0.), sensitm(19), softradiustm(0.0), - amount(95), + amount(95.), // Retinex expreti(false), retinexMethod("high"), diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 04d14c9cb..bfdd3d905 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1058,15 +1058,15 @@ struct LocallabParams { bool activlum; // Tone Mapping bool exptonemap; - int stren; - int gamma; - int estop; - int scaltm; + double stren; + double gamma; + double estop; + double scaltm; int rewei; double satur; int sensitm; double softradiustm; - int amount; + double amount; // Retinex bool expreti; Glib::ustring retinexMethod; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index af1f65bfb..32d44ebb8 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -137,14 +137,14 @@ Locallab::Locallab(): strength(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGTH"), 0, 100, 1, 0))), sensibn(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIBN"), 0, 100, 1, 40))), // Tone Mapping - stren(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STREN"), -50, 200, 1, 10))), - gamma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAM"), 40, 400, 1, 100))), - estop(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ESTOP"), 10, 400, 1, 70))), - scaltm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALTM"), 1, 100, 1, 40))), + stren(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STREN"), -0.5, 2.0, 0.01, 0.5))), + gamma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAM"), 0.4, 4.0, 0.11, 1.0))), + estop(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ESTOP"), 0.1, 4.0, 0.01, 0.5))), + scaltm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALTM"), 0.1, 10.0, 0.01, 4.0))), rewei(Gtk::manage(new Adjuster(M("TP_LOCALLAB_REWEI"), 0, 3, 1, 0))), sensitm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), softradiustm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.1, 0.))), - amount(Gtk::manage(new Adjuster(M("TP_LOCALLAB_AMOUNT"), 50, 100, 1, 95))), + amount(Gtk::manage(new Adjuster(M("TP_LOCALLAB_AMOUNT"), 50., 100.0, 0.5, 95.))), satur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SATUR"), -100., 100., 0.1, 0.))),//by default satur = 0 ==> use Mantiuk value // Retinex str(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STR"), 0, 100, 1, 0))), @@ -2011,15 +2011,15 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).activlum = activlum->get_active(); // Tone Mapping pp->locallab.spots.at(pp->locallab.selspot).exptonemap = exptonemap->getEnabled(); - pp->locallab.spots.at(pp->locallab.selspot).stren = stren->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).gamma = gamma->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).estop = estop->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).scaltm = scaltm->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).stren = stren->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).gamma = gamma->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).estop = estop->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).scaltm = scaltm->getValue(); pp->locallab.spots.at(pp->locallab.selspot).rewei = rewei->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).satur = satur->getValue(); pp->locallab.spots.at(pp->locallab.selspot).sensitm = sensitm->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).softradiustm = softradiustm->getValue(); - pp->locallab.spots.at(pp->locallab.selspot).amount = amount->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).amount = amount->getValue(); // Retinex pp->locallab.spots.at(pp->locallab.selspot).expreti = expreti->getEnabled(); @@ -3388,15 +3388,15 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe strength->setDefault((double)defSpot->strength); sensibn->setDefault((double)defSpot->sensibn); // Tone Mapping - stren->setDefault((double)defSpot->stren); - gamma->setDefault((double)defSpot->gamma); - estop->setDefault((double)defSpot->estop); - scaltm->setDefault((double)defSpot->scaltm); + stren->setDefault(defSpot->stren); + gamma->setDefault(defSpot->gamma); + estop->setDefault(defSpot->estop); + scaltm->setDefault(defSpot->scaltm); rewei->setDefault((double)defSpot->rewei); satur->setDefault(defSpot->satur); sensitm->setDefault((double)defSpot->sensitm); softradiustm->setDefault(defSpot->softradiustm); - amount->setDefault((double)defSpot->amount); + amount->setDefault(defSpot->amount); // Retinex str->setDefault((double)defSpot->str); chrrt->setDefault((double)defSpot->chrrt);