[cairo] pixman box filtering code prototype
jeff at infidigm.net
Fri Nov 7 12:29:31 PST 2008
On Fri, Nov 07, 2008 at 02:54:27AM +0100, Soeren Sandmann wrote:
> > > > Here's an update. It should be basically correct at this time (although
> > > > it doesn't filter masks yet...). It still needs cleanup and
> > > > optimization.
> The thing that bothers me about this approach, is that it makes
> pixman's filters not really behave as advertised. "Integer box
> filtering, followed by whatever you actually asked for", is not the
> same as "what you actually asked for".
One way to think about it would be having separate minification and
magnification filters, similar to OpenGL. So in pixman this would
probably involve two new filter types: BILINEAR_BOX and NEAREST_BOX in
addition to BILINEAR and NEAREST.
> If we do need something like this, could it be done by adding a new
> "integer box" filter, then having cairo do the two step operation? As
> Bill said, it seems like that would be equivalent, and it would have
> the advantage of pixman filters behaving in a well-defined way.
An approach like this could work. Though I wouldn't want to implement
the downscaling as a pixman filter. The code I'm working on only does
rectilinear downscaling and I want to keep it that way for performance
reasons. Therefore if it was to become two passes I'd want an api
pixman_obtain_downscaled_image(pixman_image_t image, pixman_fixed_t xscale, pixman_fixed_t yscale);
which could also take a pixman_downscale_filter_t perhaps.
This would probably require extending XRender though.
More information about the cairo