From 7db1225cd62392b53356373599c3fdad9eee9d17 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 13 Dec 2020 00:18:09 +0100 Subject: [PATCH] Fix blur processing when constrained to region --- .../Processing/Processors/Convolution/BokehBlurProcessor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor.cs index 243bc46cb1..b3844ded84 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor.cs @@ -136,14 +136,14 @@ public void Invoke(int y) // The target buffer is zeroed initially and then it accumulates the results // of each partial convolution, so we don't have to clear it here as well - ref Vector4 targetBase = ref this.targetValues.GetElementUnsafe(0, y); + ref Vector4 targetBase = ref this.targetValues.GetElementUnsafe(boundsX, y); ref Complex64 kernelBase = ref this.kernel[0]; for (int kY = 0; kY < kernelSize; kY++) { // Get the precalculated source sample row for this kernel row and copy to our buffer int sampleY = Unsafe.Add(ref sampleRowBase, kY); - ref ComplexVector4 sourceBase = ref this.sourceValues.GetElementUnsafe(boundsX, sampleY); + ref ComplexVector4 sourceBase = ref this.sourceValues.GetElementUnsafe(0, sampleY); Complex64 factor = Unsafe.Add(ref kernelBase, kY); for (int x = 0; x < boundsWidth; x++)