[Pixman] [PATCH pixman 09/15] pixman-filter: put filter error on center pixel

Bill Spitzak spitzak at gmail.com
Wed Apr 29 12:04:57 PDT 2015


Any error in filter normalization is placed on the center of odd-sized filters,
rather than 1 pixel to the right.

In particular this fixes the 1-wide filters produced by impulse sampling
so they are 1.0 rather than 0.0.
---
 pixman/pixman-filter.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index 0cd4a68..fbc657d 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -299,7 +299,7 @@ create_1d_filter (int              width,
 	}
 
 	if (new_total != pixman_fixed_1)
-	    *(p - width / 2) += (pixman_fixed_1 - new_total);
+	    *(p - (width + 1) / 2) += (pixman_fixed_1 - new_total);
     }
 }
 
-- 
1.7.9.5



More information about the Pixman mailing list