[Pixman] [PATCH v8 13/14] Added big comment to filter
spitzak at gmail.com
spitzak at gmail.com
Mon Jan 4 21:49:00 PST 2016
From: Bill Spitzak <spitzak at gmail.com>
v8: first version
Signed-off-by: Bill Spitzak <spitzak at gmail.com>
pixman/pixman-filter.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index 3237036..0961cfc 100644
@@ -313,7 +313,28 @@ gnuplot_filter(int width, int samples, const pixman_fixed_t* p)
/* Create the parameter list for a SEPARABLE_CONVOLUTION filter
- * with the given kernels and scale parameters
+ * The reconstruct filter is scaled by 1, while the sample filter is
+ * scaled by scale, and they are convolved together. Note that scale
+ * is the inverse of how the image is being scaled, if the image is
+ * being made smaller, the filter gets larger.
+ * Some interesting reconstruct.sample combinations:
+ * IMPULSE.x - Uses the sample function only. Only works for scale >= 1. This
+ * is useful for matching other software that does not convolve,
+ * for large scale it is almost identical to BOX.x but the filter
+ * is slightly smaller and thus faster.
+ * x.IMPULSE - Uses the reconstruct function only, scale is ignored.
+ * LINEAR.IMPULSE - Matches bilinear filtering
+ * BOX.BOX - Produces a trapazoid-shape. Narrowest possible filter with antialiasing.
+ * This is equal to LINEAR.IMPULSE at scale == 1. Matches a lot of other
+ * software, some call it "box", others call it "linear"
+ * IMPULSE.LINEAR - Some software calls this "linear" or "triangle". Not a good filter.
+ * LINEAR.LINEAR - non-negative cubic. What some software calls "cubic interpolation".
+ * IMPULSE.LANCZOS2 - Close to what a lot of other software calls "cubic interpolation"
+ * IMPULSE.CUBIC - Often called "mitchell" in other software
+ * IMPULSE.GAUSSIAN - Technically accurate but usually considered too blurry
PIXMAN_EXPORT pixman_fixed_t *
pixman_filter_create_separable_convolution (int *n_values,
More information about the Pixman