[Pixman] New separable filter generator
Krzysztof Kosiński
tweenk.pl at gmail.com
Mon Jun 23 20:05:39 PDT 2014
2014-06-18 20:50 GMT+02:00 Bill Spitzak <spitzak at gmail.com>:
> This patch is for Cairo but I now feel the correct solution is to place
> this in pixman (and thus into XRender). Although the patch is for Cairo
> it primarily consists of a replacement for pixman_generate_separable_filter
> and changes to how it is called for the GOOD and BEST settings. I could
> try to rewrite it as a pixman patch if desired.
>
> Would appreciate any feedback at all on this. Thank you!
>
> This code contains an all-new filter generator to replace the one that is
> in pixman. Results in 222 pass/298 failed image tests, which is much better
> than the previous versions of this patch.
>
> Filter generator (which should probably be in pixman):
>
> - Single filter, no "reconstruction" and "sample" filter
> - Filters for derivative < 1 work
> - Fixed IMPULSE and BOX
> - Added TRIANGLE, CATMULL, NOTCH. Remove LANZCOS2.
> - Renamed CUBIC to MITCHELL
>
> Cairo's filter settings:
>
> - CAIRO_FILTER_GOOD: uses BOX filter for scales less than .75 in either
> direction. Uses PIXMAN_FILTER_GOOD (ie BILINEAR) otherwise.
>
> - CAIRO_FILTER_BEST: uses CATMULL filter always. Upscaling more than 2x will
> produce anti-aliased square pixels, similar to OS/X.
>
> - CAIRO_FILTER_GAUSSIAN: this obsolete value is used to test other filters.
> The program must declare and poke the filter into the static varialbe
> ikernel. This should be removed for production code.
>
> NYI: This version uses the fallback for xlib always. The xlib and xcb backends
> must be rewritten to use the fallback version if filtering is needed. Or the
> filtering code must be moved to XRender.
This looks way better and more comprehensive than my attempts at
fixing the downscaling problem. I would support getting this into
trunk, preferably along with the rest of your patches, before the 1.14
release.
It looks like the magic value 1.35 used in
_pixman_image_set_properties is undocumented - was it derived
experimentally?
Unfortunately I won't have time to test how this works with Inkscape
for the next 2-3 weeks.
Regards, Krzysztof
More information about the Pixman
mailing list