[Pixman] [PATCH 09/15] pixman-filter: put filter error on center pixel
spitzak at gmail.com
spitzak at gmail.com
Sat Dec 12 10:06:38 PST 2015
From: Bill Spitzak <spitzak at gmail.com>
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.9.1
More information about the Pixman
mailing list