diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 3951980dd..bb25ad04e 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -867,8 +867,6 @@ void Crop::update (int todo) int realspot = params.locallab.nbspot; // bool tata = true; - bool locutili = parent->locutili; - for (int sp = 1; sp < maxspot; sp++) { if (sp != realspot) { @@ -1162,8 +1160,8 @@ void Crop::update (int todo) params.locallab.sobelref = parent->sobelrefs[sp]; - parent->ipf.Lab_Local (params.locallab, 1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop, trafx / skip, trafy / skip, cropx / skip, cropy / skip, skips (parent->fw, skip), skips (parent->fh, skip), parent->fw, parent->fh, locutili, skip, locRETgainCurve, locallutili, lllocalcurve2, - loclhCurve, lochhCurve, LHutili, HHutili, cclocalcurve2, localskutili, sklocalcurve2, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref, params.locallab.sobelref); + parent->ipf.Lab_Local (1, (float**)shbuffer, labnCrop, labnCrop, reservCrop, cropx / skip, cropy / skip, skips (parent->fw, skip), skips (parent->fh, skip), skip, locRETgainCurve, lllocalcurve2, + loclhCurve, lochhCurve, LHutili, HHutili, cclocalcurve2, localskutili, sklocalcurve2, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); lllocalcurve2.clear(); cclocalcurve2.clear(); sklocalcurve2.clear(); @@ -1547,8 +1545,8 @@ void Crop::update (int todo) params.locallab.chromaref = parent->chromarefs[sp]; params.locallab.lumaref = parent->lumarefs[sp]; params.locallab.sobelref = parent->sobelrefs[sp]; - parent->ipf.Lab_Local (params.locallab, 1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop, trafx / skip, trafy / skip, cropx / skip, cropy / skip, skips (parent->fw, skip), skips (parent->fh, skip), parent->fw, parent->fh, locutili, skip, locRETgainCurve, locallutili, lllocalcurve2, loclhCurve, lochhCurve, - LHutili, HHutili, cclocalcurve2, localskutili, sklocalcurve2, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref, params.locallab.sobelref); + parent->ipf.Lab_Local (1, (float**)shbuffer, labnCrop, labnCrop, reservCrop, cropx / skip, cropy / skip, skips (parent->fw, skip), skips (parent->fh, skip), skip, locRETgainCurve, lllocalcurve2, loclhCurve, lochhCurve, + LHutili, HHutili, cclocalcurve2, localskutili, sklocalcurve2, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); lllocalcurve2.clear(); cclocalcurve2.clear(); diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 26f7dad29..c56c939f3 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -2158,7 +2158,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) params.locallab.chromaref = dataspot[maxdata - 3][sp]; params.locallab.lumaref = dataspot[maxdata - 2][sp]; params.locallab.sobelref = dataspot[maxdata - 1][sp]; - bool locutili = false; params.locallab.circrad = circrads[sp] = dataspot[2][sp]; params.locallab.locX = locx[sp] = dataspot[3][sp]; params.locallab.locY = locy[sp] = dataspot[4][sp]; @@ -2614,7 +2613,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) double huere, chromare, lumare; double sobelre; - ipf.calc_ref (3, sp, (float**)shbuffer, nprevl, nprevl, 0, 0, 0, 0, pW, pH, fw, fh, locutili, scale, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, sklocalcurve, huere, chromare, lumare, sobelre); + ipf.calc_ref (nprevl, nprevl, 0, 0, pW, pH, scale, huere, chromare, lumare, sobelre); huer = huere; chromar = chromare; lumar = lumare ; @@ -2629,8 +2628,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) dataspot[maxdata - 2][sp] = lumarefs[sp] = params.locallab.lumaref; dataspot[maxdata - 1][sp] = sobelrefs[sp] = params.locallab.sobelref; //printf("sp=%i huerefsp=%f\n", sp, huerefs[sp]); - ipf.Lab_Local (params.locallab, 3, sp, (float**)shbuffer, nprevl, nprevl, reserv, 0, 0, 0, 0, pW, pH, fw, fh, locutili, scale, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, lochhCurve, - LHutili, HHutili, cclocalcurve, localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref, params.locallab.sobelref); + ipf.Lab_Local (3, (float**)shbuffer, nprevl, nprevl, reserv, 0, 0, pW, pH, scale, locRETgainCurve, lllocalcurve, loclhCurve, lochhCurve, + LHutili, HHutili, cclocalcurve, localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); lllocalcurve.clear(); cclocalcurve.clear(); sklocalcurve.clear(); @@ -3167,8 +3166,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) params.locallab.lumaref = lumarefs[sp]; params.locallab.sobelref = sobelrefs[sp]; - ipf.Lab_Local (params.locallab, 3, sp, (float**)shbuffer, nprevl, nprevl, reserv, 0, 0, 0, 0, pW, pH, fw, fh, locutili, scale, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, lochhCurve, LHutili, HHutili, cclocalcurve, - localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref, params.locallab.sobelref); + ipf.Lab_Local (3, (float**)shbuffer, nprevl, nprevl, reserv, 0, 0, pW, pH, scale, locRETgainCurve, lllocalcurve, loclhCurve, lochhCurve, LHutili, HHutili, cclocalcurve, + localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); lllocalcurve.clear(); cclocalcurve.clear(); sklocalcurve.clear(); diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 2b6400751..eb839df83 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -288,33 +288,33 @@ public: int pitch, int scale, const int luma, const int chroma/*, LUTf & Lcurve, LUTf & abcurve*/ ); //locallab void MSRLocal (float** luminance, float** templ, const float* const *originalLuminance, const int width, const int height, const LocallabParams &loc, const int skip, const LocretigainCurve &locRETgainCcurve, const int chrome, const int scall, const float krad, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax); - void calc_ref (int call, int sp, float** shbuffer, LabImage* original, LabImage* transformed, int sx, int sy, int cx, int cy, int oW, int oH, int fw, int fh, bool locutili, int sk, const LocretigainCurve & locRETgainCcurve, bool locallutili, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, LUTf & cclocalcurve, LUTf & sklocalcurve, double &huere, double &chromare, double &lumare, double &sobelref); - void copy_ref (int call, int sp, LabImage* spotbuffer, LabImage* original, LabImage* transformed, int sx, int sy, int cx, int cy, int oW, int oH, int fw, int fh, int sk, const struct local_params & lp, double &huerefspot, double &chromarefspot, double &lumarefspot); - void paste_ref (int call, int sp, LabImage* spotbuffer, LabImage* original, LabImage* transformed, int sx, int sy, int cx, int cy, int oW, int oH, int fw, int fh, int sk, const struct local_params & lp, double &huerefspot, double &chromarefspot, double &lumarefspot); - void Lab_Local (LocallabParams &loc, int call, int sp, float** shbuffer, LabImage* original, LabImage* transformed, LabImage* reserved, int sx, int sy, int cx, int cy, int oW, int oH, int fw, int fh, bool locutili, int sk, const LocretigainCurve & locRETgainCcurve, bool locallutili, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, bool &LHutili, bool &HHutili, LUTf & cclocalcurve, bool & localskutili, LUTf & sklocalcurve, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, double &hueref, double &chromaref, double &lumaref, double &sobelref); + void calc_ref (LabImage* original, LabImage* transformed, int cx, int cy, int oW, int oH, int sk, double &huere, double &chromare, double &lumare, double &sobelref); + void copy_ref (LabImage* spotbuffer, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const struct local_params & lp, double &huerefspot, double &chromarefspot, double &lumarefspot); + void paste_ref (LabImage* spotbuffer, LabImage* transformed, int cx, int cy, int sk, const struct local_params & lp); + void Lab_Local (int call, float** shbuffer, LabImage* original, LabImage* transformed, LabImage* reserved, int cx, int cy, int oW, int oH, int sk, const LocretigainCurve & locRETgainCcurve, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, bool &LHutili, bool &HHutili, LUTf & cclocalcurve, bool & localskutili, LUTf & sklocalcurve, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, double &hueref, double &chromaref, double &lumaref); void addGaNoise (LabImage *lab, LabImage *dst, const float mean, const float variance, const int sk); void BlurNoise_Localold (int call, const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy); void InverseBlurNoise_Local (const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy); - void Reti_Local (int call, float ** buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy, int chro); + void Reti_Local (float ** buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy, int chro); void InverseReti_Local (const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy, int chro); - void Contrast_Local (int call, float ave, LabImage * bufcontorig, float ** buflightc, float moy, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, float pm, struct local_contra &lco, float lumaref, float av, const struct local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); - void cbdl_Local (int call, int sp, float ** buflight, float ** bufchrom, float **loctemp, float **loctempch, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy, int chro); - void BlurNoise_Local (int call, int sp, LabImage* tmp1, LabImage* tmp2, float ** buflight, float ** bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); - void TM_Local (int call, int sp, LabImage* tmp1, float ** buflight, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); + void Contrast_Local (int call, float ** buflightc, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, float pm, struct local_contra &lco, float lumaref, const struct local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); + void cbdl_Local (float ** buflight, float ** bufchrom, float **loctemp, float **loctempch, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy, int chro); + void BlurNoise_Local (int call, LabImage* tmp1, LabImage* tmp2, float ** buflight, float ** bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); + void TM_Local (LabImage* tmp1, float ** buflight, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); static void strcurv_data (std::string retistr, int *s_datc, int &siz); void InverseContrast_Local (float ave, const struct local_contra& lco, const struct local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); - void vibrancelocal (const local_params& lp, int bfw, int bfh, LabImage* lab, LabImage* dest, bool & localskutili, LUTf & sklocalcurve); - void Expose_Local (int sen, int call, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, const LabImage * const tmp1, int cx, int cy); + void vibrancelocal (int bfw, int bfh, LabImage* lab, LabImage* dest, bool & localskutili, LUTf & sklocalcurve); + void Expose_Local (int sen, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, const LabImage * const tmp1, int cx, int cy); void exlabLocal (const local_params& lp, int bfh, int bfw, LabImage* bufexporig, LabImage* lab, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve); - void Exclude_Local (int sen, int call, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * rsv, int cx, int cy); + void Exclude_Local (int sen, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * rsv, int cx, int cy); void DeNoise_Local (int call, const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy); - void ColorLight_Local (int call, LabImage * bufcolorig, float **buflight, float **bufchro, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, int sp, float moy, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, bool locallutili, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, LUTf & cclocalcurve, float chprov, float cligh, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); + void ColorLight_Local (int call, LabImage * bufcolorig, float **buflight, float **bufchro, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); void InverseColorLight_Local (const struct local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); - void Sharp_Local (int call, int sp, float **loctemp, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); - void InverseSharp_Local (int sp, float **loctemp, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); + void Sharp_Local (int call, float **loctemp, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); + void InverseSharp_Local (float **loctemp, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy); void Tile_calc (int tilesize, int overlap, int kall, int imwidth, int imheight, int &numtiles_W, int &numtiles_H, int &tilewidth, int &tileheight, int &tileWskip, int &tileHskip); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 4ce90c287..5b5447d0c 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -54,7 +54,7 @@ #define CLIPCHRO(x) LIM(x,0.f, 140.f) #define CLIPRET(x) LIM(x,-99.5f, 99.5f) #define CLIP1(x) LIM(x, 0.f, 1.f) - +#pragma GCC diagnostic warning "-Wextra" namespace { @@ -644,7 +644,7 @@ void ImProcFunctions::strcurv_data (std::string retistr, int *s_datc, int &siz) } -void ImProcFunctions::vibrancelocal (const local_params& lp, int bfw, int bfh, LabImage* lab, LabImage* dest, bool & localskutili, LUTf & sklocalcurve) +void ImProcFunctions::vibrancelocal (int bfw, int bfh, LabImage* lab, LabImage* dest, bool & localskutili, LUTf & sklocalcurve) { if (!params->locallab.expvibrance) { return; @@ -1629,7 +1629,7 @@ void ImProcFunctions::DeNoise_Local (int call, const struct local_params& lp, La } -void ImProcFunctions::cbdl_Local (int call, int sp, float ** buflight, float ** bufchrom, float **loctemp, float **loctempch, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int chro) +void ImProcFunctions::cbdl_Local (float ** buflight, float ** bufchrom, float **loctemp, float **loctempch, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int chro) { //local CBDL BENCHFUN @@ -1992,7 +1992,7 @@ void ImProcFunctions::cbdl_Local (int call, int sp, float ** buflight, float ** } -void ImProcFunctions::TM_Local (int call, int sp, LabImage * tmp1, float **buflight, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) +void ImProcFunctions::TM_Local (LabImage * tmp1, float **buflight, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) { //local TM BENCHFUN @@ -2301,7 +2301,7 @@ void ImProcFunctions::TM_Local (int call, int sp, LabImage * tmp1, float **bufli -void ImProcFunctions::BlurNoise_Local (int call, int sp, LabImage * tmp1, LabImage * tmp2, float ** buflight, float ** bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) +void ImProcFunctions::BlurNoise_Local (int call, LabImage * tmp1, LabImage * tmp2, float ** buflight, float ** bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) { //local BLUR BENCHFUN @@ -2746,7 +2746,7 @@ void ImProcFunctions::InverseReti_Local (const struct local_params & lp, LabImag -void ImProcFunctions::Reti_Local (int call, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, const LabImage * const tmp1, int cx, int cy, int chro) +void ImProcFunctions::Reti_Local (float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, const LabImage * const tmp1, int cx, int cy, int chro) { //local retinex @@ -3228,7 +3228,7 @@ struct local_contra { float al, bl; }; -void ImProcFunctions::Contrast_Local (int call, float ave, LabImage * bufcontorig, float ** buflightc, float moy, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, float pm, struct local_contra & lco, float lumaref, float av, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) +void ImProcFunctions::Contrast_Local (int call, float ** buflightc, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, float pm, struct local_contra & lco, float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) { BENCHFUN // contrast - perhaps for 4 areas if need @@ -3680,7 +3680,7 @@ static void calclight (float lum, float koef, float & lumnew, bool inv) } -void ImProcFunctions::InverseSharp_Local (int sp, float **loctemp, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) +void ImProcFunctions::InverseSharp_Local (float **loctemp, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) { //local sharp // BENCHFUN @@ -3878,7 +3878,7 @@ void ImProcFunctions::InverseSharp_Local (int sp, float **loctemp, const float h } -void ImProcFunctions::Sharp_Local (int call, int sp, float **loctemp, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) +void ImProcFunctions::Sharp_Local (int call, float **loctemp, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) { BENCHFUN const float ach = (float)lp.trans / 100.f; @@ -4105,7 +4105,7 @@ void ImProcFunctions::Sharp_Local (int call, int sp, float **loctemp, const floa } -void ImProcFunctions::Exclude_Local (int sen, int call, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * rsv, int cx, int cy) +void ImProcFunctions::Exclude_Local (int sen, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * rsv, int cx, int cy) { //local exposure @@ -4516,7 +4516,7 @@ void ImProcFunctions::Exclude_Local (int sen, int call, float **buflight, float -void ImProcFunctions::Expose_Local (int sen, int call, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, const LabImage * const tmp1, int cx, int cy) +void ImProcFunctions::Expose_Local (int sen, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, const LabImage * const tmp1, int cx, int cy) { //local exposure @@ -4926,7 +4926,7 @@ void ImProcFunctions::Expose_Local (int sen, int call, float **buflight, float * } -void ImProcFunctions::ColorLight_Local (int call, LabImage * bufcolorig, float ** buflight, float ** bufchro, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, int sp, float moy, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, bool locallutili, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, LUTf & cclocalcurve, float chprov, float cligh, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) +void ImProcFunctions::ColorLight_Local (int call, LabImage * bufcolorig, float ** buflight, float ** bufchro, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy) { BENCHFUN // chroma and lightness @@ -5747,7 +5747,7 @@ void ImProcFunctions::InverseColorLight_Local (const struct local_params & lp, L } } -void ImProcFunctions::calc_ref (int call, int sp, float** shbuffer, LabImage * original, LabImage * transformed, int sx, int sy, int cx, int cy, int oW, int oH, int fw, int fh, bool locutili, int sk, const LocretigainCurve & locRETgainCcurve, bool locallutili, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, LUTf & cclocalcurve, LUTf & sklocalcurve, double & hueref, double & chromaref, double & lumaref, double &sobelref) +void ImProcFunctions::calc_ref (LabImage * original, LabImage * transformed, int cx, int cy, int oW, int oH, int sk, double & hueref, double & chromaref, double & lumaref, double &sobelref) { if (params->locallab.enabled) { //always calculate hueref, chromaref, lumaref before others operations use in normal mode for all modules exceprt denoise @@ -5849,7 +5849,7 @@ void ImProcFunctions::calc_ref (int call, int sp, float** shbuffer, LabImage * o } } -void ImProcFunctions::copy_ref (int call, int sp, LabImage * spotbuffer, LabImage * original, LabImage * transformed, int sx, int sy, int cx, int cy, int oW, int oH, int fw, int fh, int sk, const struct local_params & lp, double & huerefspot, double & chromarefspot, double & lumarefspot) +void ImProcFunctions::copy_ref (LabImage * spotbuffer, LabImage * original, LabImage * transformed, int cx, int cy, int sk, const struct local_params & lp, double & huerefspot, double & chromarefspot, double & lumarefspot) { if (params->locallab.enabled) { @@ -5911,7 +5911,7 @@ void ImProcFunctions::copy_ref (int call, int sp, LabImage * spotbuffer, LabImag } } -void ImProcFunctions::paste_ref (int call, int sp, LabImage * spotbuffer, LabImage * original, LabImage * transformed, int sx, int sy, int cx, int cy, int oW, int oH, int fw, int fh, int sk, const struct local_params & lp, double & huerefspot, double & chromarefspot, double & lumarefspot) +void ImProcFunctions::paste_ref (LabImage * spotbuffer, LabImage * transformed, int cx, int cy, int sk, const struct local_params & lp) { if (params->locallab.enabled) { @@ -5940,9 +5940,9 @@ void ImProcFunctions::paste_ref (int call, int sp, LabImage * spotbuffer, LabIma } } -void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** shbuffer, LabImage * original, LabImage * transformed, LabImage * reserved, int sx, int sy, int cx, int cy, int oW, int oH, int fw, int fh, bool locutili, int sk, - const LocretigainCurve & locRETgainCcurve, bool locallutili, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, - bool &LHutili, bool &HHutili, LUTf & cclocalcurve, bool & localskutili, LUTf & sklocalcurve, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, double & hueref, double & chromaref, double & lumaref, double & sobelref) +void ImProcFunctions::Lab_Local (int call, float** shbuffer, LabImage * original, LabImage * transformed, LabImage * reserved, int cx, int cy, int oW, int oH, int sk, + const LocretigainCurve & locRETgainCcurve, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, + bool &LHutili, bool &HHutili, LUTf & cclocalcurve, bool & localskutili, LUTf & sklocalcurve, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, double & hueref, double & chromaref, double & lumaref) { //general call of others functions : important return hueref, chromaref, lumaref if (params->locallab.enabled) { @@ -5955,7 +5955,6 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** #endif int del = 3; // to avoid crash with [loy - begy] and [lox - begx] and bfh bfw // with gtk2 [loy - begy-1] [lox - begx -1 ] and del = 1 - float moy = 0.f; struct local_params lp; calcLocalParams (oW, oH, params->locallab, lp); @@ -6198,7 +6197,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** bufchro[ir][jr] = rch; } - Exclude_Local (1, call, buflight, bufchro, hueplus, huemoins, hueref, dhueex, chromaref, lumaref, lp, original, transformed, bufreserv, cx, cy); + Exclude_Local (1, buflight, bufchro, hueplus, huemoins, hueref, dhueex, chromaref, lumaref, lp, original, transformed, bufreserv, cx, cy); delete deltasobelL; @@ -6400,7 +6399,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** bufchro[ir][jr] = rch; } - BlurNoise_Local (call, sp, tmp1, tmp2, buflight, bufchro, hueplus, huemoins, hueref, dhuebn, chromaref, lumaref, lp, original, transformed, cx, cy); + BlurNoise_Local (call, tmp1, tmp2, buflight, bufchro, hueplus, huemoins, hueref, dhuebn, chromaref, lumaref, lp, original, transformed, cx, cy); } else { @@ -6826,11 +6825,9 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** } LabImage *bufcolorig = nullptr; - float chprov = 1.f; float chpro = 1.f; float cligh = 1.f; float clighL = 1.f; - float clighmax ; float **buflight = nullptr; float **bufchro = nullptr; float **buflightslid = nullptr; @@ -6906,7 +6903,6 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** bufhh[ir][jr] = 0.f; } - clighmax = 0.f; /* int yStart = lp.yc - lp.lyT - cy; int yEnd = lp.yc + lp.ly - cy; @@ -7001,7 +6997,6 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** bufcolorig->L[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas bufcolorig->a[loy - begy][lox - begx] = original->a[y][x];//fill square buffer with datas bufcolorig->b[loy - begy][lox - begx] = original->b[y][x];//fill square buffer with datas - chprov = 0.f; chpro = 0.f; //Chroma curve @@ -7076,7 +7071,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** } - ColorLight_Local (call, bufcolorig, buflight, bufchro, bufhh, buflightslid, LHutili, HHutili, sp, moy, hueplus, huemoins, hueref, dhue, chromaref, lumaref, locallutili, lllocalcurve, loclhCurve, lochhCurve, cclocalcurve, chprov, clighmax, lp, original, transformed, cx, cy); + ColorLight_Local (call, bufcolorig, buflight, bufchro, bufhh, buflightslid, LHutili, HHutili, hueplus, huemoins, hueref, dhue, chromaref, lumaref, lllocalcurve, loclhCurve, lochhCurve, lp, original, transformed, cx, cy); if (call <= 3) { @@ -7274,7 +7269,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** } - Contrast_Local (call, ave, bufcontorig, buflightc, moy, hueplus, huemoins, hueref, dhue, chromaref, pm, lco, lumaref, av, lp, original, transformed, cx, cy); + Contrast_Local (call, buflightc, hueplus, huemoins, hueref, dhue, chromaref, pm, lco, lumaref, lp, original, transformed, cx, cy); if (call <= 3) { @@ -7452,7 +7447,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** } // printf ("min=%2.2f max=%2.2f", minc, maxc); - Expose_Local (1, call, buflight, bufl_ab, hueplus, huemoins, hueref, dhueex, chromaref, lumaref, lp, original, transformed, bufexpfin, cx, cy); + Expose_Local (1, buflight, bufl_ab, hueplus, huemoins, hueref, dhueex, chromaref, lumaref, lp, original, transformed, bufexpfin, cx, cy); } @@ -7569,7 +7564,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** - ImProcFunctions::vibrancelocal (lp, bfw, bfh, bufexporig, bufexpfin, localskutili, sklocalcurve); + ImProcFunctions::vibrancelocal (bfw, bfh, bufexporig, bufexpfin, localskutili, sklocalcurve); // float maxc = -10000.f; @@ -7617,7 +7612,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** } // printf ("min=%2.2f max=%2.2f", minc, maxc); - Expose_Local (2, call, buflight, bufl_ab, hueplus, huemoins, hueref, dhuev, chromaref, lumaref, lp, original, transformed, bufexpfin, cx, cy); + Expose_Local (2, buflight, bufl_ab, hueplus, huemoins, hueref, dhuev, chromaref, lumaref, lp, original, transformed, bufexpfin, cx, cy); } @@ -7752,7 +7747,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** // printf ("min=%2.2f max=%2.2f", minc, maxc); - TM_Local (call, sp, tmp1, buflight, hueplus, huemoins, hueref, dhuetm, chromaref, lumaref, lp, original, transformed, cx, cy); + TM_Local (tmp1, buflight, hueplus, huemoins, hueref, dhuetm, chromaref, lumaref, lp, original, transformed, cx, cy); if (call <= 3) { delete bufgb; @@ -7898,7 +7893,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** - cbdl_Local (call, sp, buflight, bufchrom, loctemp, loctempch, hueplus, huemoins, hueref, dhuecb, chromaref, lumaref, lp, original, transformed, cx, cy, 0); + cbdl_Local (buflight, bufchrom, loctemp, loctempch, hueplus, huemoins, hueref, dhuecb, chromaref, lumaref, lp, original, transformed, cx, cy, 0); for (int i = 0; i < bfh; i++) { @@ -7945,7 +7940,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** } } - cbdl_Local (call, sp, buflight, bufchrom, loctemp, loctempch, hueplus, huemoins, hueref, dhuecb, chromaref, lumaref, lp, original, transformed, cx, cy, 1); + cbdl_Local (buflight, bufchrom, loctemp, loctempch, hueplus, huemoins, hueref, dhuecb, chromaref, lumaref, lp, original, transformed, cx, cy, 1); } for (int i = 0; i < bfh; i++) { @@ -8042,7 +8037,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** } //sharpen ellipse and transition - Sharp_Local (call, sp, loctemp, hueplus, huemoins, hueref, dhuesha, chromaref, lumaref, lp, original, transformed, cx, cy); + Sharp_Local (call, loctemp, hueplus, huemoins, hueref, dhuesha, chromaref, lp, original, transformed, cx, cy); } else if (lp.invshar && lp.shrad > 0.42 && call < 3 && lp.sharpena) { int GW = original->W; @@ -8062,7 +8057,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** huemoins = hueref - dhuesha + 2.f * rtengine::RT_PI; } - InverseSharp_Local (sp, loctemp, hueplus, huemoins, hueref, dhuesha, chromaref, lumaref, lp, original, transformed, cx, cy); + InverseSharp_Local (loctemp, hueplus, huemoins, hueref, dhuesha, chromaref, lp, original, transformed, cx, cy); } // } @@ -8229,7 +8224,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** if (!lp.invret) { - Reti_Local (call, buflight, bufchro, hueplus, huemoins, hueref, dhueret, chromaref, lumaref, lp, original, transformed, tmpl, cx, cy, 0); + Reti_Local (buflight, bufchro, hueplus, huemoins, hueref, dhueret, chromaref, lumaref, lp, original, transformed, tmpl, cx, cy, 0); } else { InverseReti_Local (lp, original, transformed, tmpl, cx, cy, 0); } @@ -8323,7 +8318,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float** if (!lp.invret) { - Reti_Local (call, buflight, bufchro, hueplus, huemoins, hueref, dhueret, chromaref, lumaref, lp, original, transformed, tmpl, cx, cy, 1); + Reti_Local (buflight, bufchro, hueplus, huemoins, hueref, dhueret, chromaref, lumaref, lp, original, transformed, tmpl, cx, cy, 1); } else { InverseReti_Local (lp, original, transformed, tmpl, cx, cy, 1); } diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 2e8a16f5f..553a82d20 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1017,7 +1017,6 @@ private: params.labCurve.lccurve, curve1, curve2, satcurve, lhskcurve, 1); - bool locutili = false; // bool locallutili = false; // bool localcutili = false; reservView->CopyFrom (labView); @@ -1984,14 +1983,14 @@ private: double huere, chromare, lumare; double sobelre; - ipf.calc_ref (2, sp, (float**)shbuffer, labView, labView, 0, 0, 0, 0, fw, fh, fw, fh, locutili, 1, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, sklocalcurve, huere, chromare, lumare, sobelre); + ipf.calc_ref (labView, labView, 0, 0, fw, fh, 1, huere, chromare, lumare, sobelre); params.locallab.hueref = huere; params.locallab.chromaref = chromare; params.locallab.lumaref = lumare; params.locallab.sobelref = sobelre; - ipf.Lab_Local (params.locallab, 2, sp, (float**)shbuffer, labView, labView, reservView, 0, 0, 0, 0, fw, fh, fw, fh, locutili, 1, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, lochhCurve, - LHutili, HHutili, cclocalcurve, localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref, params.locallab.sobelref); + ipf.Lab_Local (2, (float**)shbuffer, labView, labView, reservView, 0, 0, fw, fh, 1, locRETgainCurve, lllocalcurve, loclhCurve, lochhCurve, + LHutili, HHutili, cclocalcurve, localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); lllocalcurve.clear(); cclocalcurve.clear(); sklocalcurve.clear();