From ff5919be4abbcdd4d1d29125bb2b8f424c880af1 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 6 Mar 2017 16:52:31 +0100 Subject: [PATCH] Shadows/Highlights: Use iterated boxblur for radius > 40 when Sharp mask is disabled, fixes #3730 --- rtengine/shmap.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rtengine/shmap.cc b/rtengine/shmap.cc index 65c1070a2..a92264117 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -85,12 +85,21 @@ void SHMap::update (Imagefloat* img, double radius, double lumi[3], bool hq, int if (!hq) { fillLuminance( img, map, lumi); + float *buffer = nullptr; + + if(radius > 40.) { + // When we pass another buffer to gaussianBlur, it will use iterated boxblur which is less prone to artifacts + buffer = new float[W * H]; + } + #ifdef _OPENMP #pragma omp parallel #endif { - gaussianBlur (map, map, W, H, radius); + gaussianBlur (map, map, W, H, radius, buffer); } + + delete [] buffer; } else {