[Pixman] [PATCH v9 12/15] pixman-filter: Made reconstruct==impulse and scale < 1 set scale to 1

spitzak at gmail.com spitzak at gmail.com
Fri Jan 22 01:42:10 PST 2016


From: Bill Spitzak <spitzak at gmail.com>

This replaces settings that don't work (because the filter cannot be normalized)
with something that produces an image.

v7: First version with this. Previously you got lots of strange garbage filters
 that depended on the implementation.

Signed-off-by: Bill Spitzak <spitzak at gmail.com>
---
 pixman/pixman-filter.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index 6137f08..7a751ba 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -356,6 +356,8 @@ pixman_filter_create_separable_convolution (int             *n_values,
     int subsample_x, subsample_y;
     int width, height;
 
+    if (reconstruct_x == PIXMAN_KERNEL_IMPULSE && sx < 1.0)
+	sx = 1.0;
     width = ceil (filters[reconstruct_x].width + sx * filters[sample_x].width);
     if (width <= 1)
     {
@@ -364,6 +366,8 @@ pixman_filter_create_separable_convolution (int             *n_values,
     }
     subsample_x = (1 << subsample_bits_x);
 
+    if (reconstruct_y == PIXMAN_KERNEL_IMPULSE && sy < 1.0)
+	sy = 1.0;
     height = ceil (filters[reconstruct_y].width + sy * filters[sample_y].width);
     if (height <= 1)
     {
-- 
1.9.1



More information about the Pixman mailing list