From 11f16aaca6b263b7a3bc6d15058aa0438608b856 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sat, 7 Sep 2019 11:08:27 +0200 Subject: [PATCH] Clean code exposure PDE --- rtdata/languages/default | 2 +- rtengine/iplocallab.cc | 23 +++-------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 613e062ff..e9c6b1e0f 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2086,7 +2086,7 @@ TP_LOCALLAB_LIGHTRETI;Lightness TP_LOCALLAB_THRESRETI;Threshold TP_LOCALLAB_DENOIS;Denoise TP_LOCALLAB_DEHAZ;Dehaze -TP_LOCALLAB_EXPMETHOD_TOOLTIP;Standard : use an algorithm similar as main Exposure but in L*a*b* and taking account of deltaE.\n\nLaplacian & PDE : use another algorithm also with deltaE and with Poisson equation to solve Laplacian in Fourier space.\nPDE lead to very different results and needs differents settings that Standard\nMay be usefull for low exposure.\nPDE reduce artifacts and noise. +TP_LOCALLAB_EXPMETHOD_TOOLTIP;Standard : use an algorithm similar as main Exposure but in L*a*b* and taking account of deltaE.\n\nLaplacian & PDE : use another algorithm also with deltaE and with Poisson equation to solve Laplacian in Fourier space.\nPDE lead to very different results and needs differents settings that Standard (negative black, gamma < 1,...)\nMay be usefull for low exposure.\nPDE reduce artifacts and noise. TP_LOCALLAB_FFTW;Use Fast Fourier Transform TP_LOCALLAB_GRIDONE;Color Toning TP_LOCALLAB_GRIDTWO;Direct diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 607a6d08f..88b2a75f5 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -9089,8 +9089,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o float *datain = new float[bfwr * bfhr]; float *dataout = new float[bfwr * bfhr]; float *dataor = new float[bfwr * bfhr]; - Imagefloat *tmpImage = nullptr; - tmpImage = new Imagefloat(bfwr, bfhr); float gam = params->locallab.spots.at(sp).gamm; float igam = 1.f / gam; #ifdef _OPENMP @@ -9099,19 +9097,9 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o for (int y = 0; y < bfhr; y++) { for (int x = 0; x < bfwr; x++) { - float LogL = 1.f; - float X, Y, Z; - float L = bufexpfin->L[y][x] / 32768.f; -/* float a = bufexpfin->a[y][x]; - float b = bufexpfin->b[y][x]; - Color::Lab2XYZ(L, a, b, X, Y, Z); - tmpImage->r(y, x) = X; - tmpImage->g(y, x) = Y; - tmpImage->b(y, x) = Z; -*/ + float L = LIM01(bufexpfin->L[y][x] / 32768.f);//chnage gamma for Laplacian L = pow(L, gam); L *= 32768.f; - datain[y * bfwr + x] = L; dataor[y * bfwr + x] = L; } @@ -9125,17 +9113,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o for (int y = 0; y < bfhr; y++) { for (int x = 0; x < bfwr; x++) { - // float X = tmpImage->r(y, x); - float Y = dataout[y * bfwr + x] / 32768.f; - // float Z = tmpImage->b(y, x); - // float L, a , b; - // Color::XYZ2Lab(X, Y, Z, L, a, b); + float Y = dataout[y * bfwr + x] / 32768.f;//inverse Laplacian gamma Y = pow(Y, igam); Y *= 32768.f; - bufexpfin->L[y][x] = Y; //dataout[y * bfwr + x] ; + bufexpfin->L[y][x] = Y; } } - delete tmpImage; delete [] datain; delete [] dataout;