From b1cef839bdefe6202c82070b1b285002679d8161 Mon Sep 17 00:00:00 2001 From: homm Date: Mon, 13 Oct 2014 04:40:44 +0400 Subject: [PATCH] fix window calculation --- libImaging/BoxBlur.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libImaging/BoxBlur.c b/libImaging/BoxBlur.c index 61cfa7f3c..676a6cdc7 100644 --- a/libImaging/BoxBlur.c +++ b/libImaging/BoxBlur.c @@ -17,7 +17,7 @@ HorizontalBoxBlur32(Imaging im, Imaging imOut, float floatRadius) int radius = (int) floatRadius; UINT8 rem = (UINT8) (256 * (floatRadius - radius)); - int w = (int) (256 * (floatRadius * 2 + 1)); + int w = 256 * (radius * 2 + 1) + rem * 2; int w2 = w / 2; // printf("%d %d %d\n", rem, w, w2); @@ -100,7 +100,7 @@ HorizontalBoxBlur8(Imaging im, Imaging imOut, float floatRadius) int radius = (int) floatRadius; UINT8 rem = (UINT8) (256 * (floatRadius - radius)); - int w = (int) (256 * (floatRadius * 2 + 1)); + int w = 256 * (radius * 2 + 1) + rem * 2; int w2 = w / 2; ImagingSectionEnter(&cookie);