summaryrefslogtreecommitdiff
path: root/pixman/pixman-bits-image.c
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-11-22 10:15:06 -0500
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-12-08 10:50:51 -0500
commit6915f3e24f4169260a8ad6ab7ff3087388dbe5db (patch)
tree72fecac8f291af02b0fae3911f10330f70ea46c9 /pixman/pixman-bits-image.c
parent68760d3fe1351cb745aedcada7d765edc08bbe8b (diff)
Add new pixman_filter_create_separable_convolution() API
This new API is a helper function to create filter parameters suitable for use with PIXMAN_FILTER_SEPARABLE_CONVOLUTION. For each dimension, given a scale factor, reconstruction and sample filter kernels, and a subsampling resolution, this function will compute a convolution of the two kernels scaled appropriately, then sample that convolution and return the resulting vectors in a form suitable for being used as parameters to PIXMAN_FILTER_SEPARABLE_CONVOLUTION. The filter kernels offered are the following: - IMPULSE: Dirac delta function, ie., point sampling - BOX: Box filter - LINEAR: Linear filter, aka. "Tent" filter - CUBIC: Cubic filter, currently Mitchell-Netravali - GAUSSIAN: Gaussian function, sigma=1, support=3*sigma - LANCZOS2: Two-lobed Lanczos filter - LANCZOS3: Three-lobed Lanczos filter - LANCZOS3_STRETCHED: Three-lobed Lanczos filter, stretched by 4/3.0. This is the "Nice" filter from Dirty Pixels by Jim Blinn. The intended way to use this function is to extract scaling factors from the transformation and then pass those to this function to get a filter suitable for compositing with that transformation. The filter kernels can be chosen according to quality and performance tradeoffs. To get equivalent quality to GdkPixbuf for downscalings, use BOX for both reconstruction and sampling. For upscalings, use LINEAR for reconstruction and IMPULSE for sampling (though note that for upscaling in both X and Y directions, simply using PIXMAN_FILTER_BILINEAR will likely be a better choice).
Diffstat (limited to 'pixman/pixman-bits-image.c')
-rw-r--r--pixman/pixman-bits-image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 97db108..e76b78c 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -427,7 +427,7 @@ bits_image_fetch_pixel_convolution (bits_image_t *image,
}
static uint32_t
-bits_image_fetch_pixel_convolution_separable (bits_image_t *image,
+bits_image_fetch_pixel_separable_convolution (bits_image_t *image,
pixman_fixed_t x,
pixman_fixed_t y,
get_pixel_t get_pixel)
@@ -548,7 +548,7 @@ bits_image_fetch_pixel_filtered (bits_image_t *image,
break;
case PIXMAN_FILTER_SEPARABLE_CONVOLUTION:
- return bits_image_fetch_pixel_convolution_separable (image, x, y, get_pixel);
+ return bits_image_fetch_pixel_separable_convolution (image, x, y, get_pixel);
break;
default: