On 02/04/2016 02:39 AM, Oded Gabbay wrote:
On Tue, Feb 2, 2016 at 8:28 AM, <[email protected]> wrote:
From: Bill Spitzak <[email protected]>
Due to normalization these filters must all be identical (a single 1.0).
Also make IMPULSE.IMPULSE produce a width=1 filter, rather than zero
(which did not work).
v7: Replaced earlier tests for BOX.IMPULSE
v10: Moved code to filter_width function
Signed-off-by: Bill Spitzak <[email protected]>
---
pixman/pixman-filter.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index 10fa398..520ce92 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -341,7 +341,13 @@ static int
filter_width(pixman_kernel_t reconstruct, pixman_kernel_t sample,
double* size, int* subsample_bits)
{
- return ceil (filters[reconstruct].width + *size * filters[sample].width);
+ int width = ceil (filters[reconstruct].width + *size *
filters[sample].width);
+ if (width <= 1)
+ {
+ width = 1;
+ *subsample_bits = 0;
+ }
+ return width;
}
/* Create the parameter list for a SEPARABLE_CONVOLUTION filter
--
1.9.1
_______________________________________________
Pixman mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pixman
I would need to see some form of test/example that is affected by this
patch, as I don't have the knowledge to even ACK it.
Otherwise, you will need to get someone else to review this (Soren ?).
If the filter has one sample it is by definition 1.0 since the filters
are normalized. Since every filter must match the subsample position
does not matter.
However this code is really only hit for some degenerate cases that are
not really used, as it matches the IMPULSE option, so it is probably ok
to leave the subsamples alone. I think it is necessary to avoid a width
of zero as the other code does not like it.
_______________________________________________
Pixman mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pixman