From 39978fffe4661596978f01cff5d69e3cc49e863e Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 19 Apr 2017 16:48:00 +0200 Subject: [PATCH] Fix another bug in Sharp --- rtengine/iplocallab.cc | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index c06ae222d..8c4e38eee 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -3637,6 +3637,9 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * bufgb->b[ir][jr] = 0.f; } + + + int yStart = lp.yc - lp.lyT - cy; int yEnd = lp.yc + lp.ly - cy; int xStart = lp.xc - lp.lxL - cx; @@ -4728,23 +4731,23 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * const JaggedArray bufsh (bfw, bfh, true); const JaggedArray hbuffer (bfw, bfh); - int yStart = lp.yc - lp.lyT - cy; - int yEnd = lp.yc + lp.ly - cy; - int xStart = lp.xc - lp.lxL - cx; - int xEnd = lp.xc + lp.lx - cx; - int begy = lp.yc - lp.lyT; - int begx = lp.xc - lp.lxL; #ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) + #pragma omp parallel for #endif - for (int y = yStart; y < yEnd ; y++) { - int loy = cy + y; + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + int begx = int (lp.xc - lp.lxL); + int begy = int (lp.yc - lp.lyT); - for (int x = xStart, lox = cx + x; x < xEnd; x++, lox++) { - bufsh[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas + if (lox >= (lp.xc - lp.lxL) && lox < (lp.xc + lp.lx) && loy >= (lp.yc - lp.lyT) && loy < (lp.yc + lp.ly)) { + bufsh[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas + } } - } + + // } //sharpen only square area instaed of all image ImProcFunctions::deconvsharpeningloc (bufsh, hbuffer, bfw, bfh, loctemp, params->locallab.shardamping, (double)params->locallab.sharradius / 100., params->locallab.shariter, params->locallab.sharamount);