[cairo] MIPMAPPING cairo.

Bill Spitzak spitzak at thefoundry.co.uk
Tue Oct 14 14:29:36 PDT 2008

Frédéric Plourde wrote:

> For those who don't have time to run the test cases, here are some 
> visual examples !
> 1 - Uniform scalings (Xscale = Yscale)
> ========================
> * Former 'nearest' and 'bilinear" modes :
>   nearest : 
> http://img84.imageshack.us/img84/5474/dest1231x1504to840x1026wc9.png
>   bilinear : 
> http://img388.imageshack.us/img388/6500/dest1231x1504to840x1026cw3.png

Are you sure this bilinear sample is correct? It looks far worse than 
anything I have seen. Looks more like the image was scaled to 50% and 
the binlinearly scaled up. The current algorithim only fails if the 
scale is less than 60% or so.

New examples look very good, though.

I don't like there being lots of options for how to filter. This 
counter-intuitively locks down the algorithm so that it cannot be 
changed or improved in the future. For instance the default certainly 
should not be BILINEAR but instead one of these new filters. However the 
current Cairo api has the word "BILINEAR" in it.

Users are interested in these settings:

1. "nice" scaling. They don't care one bit about the algorithm. This is 
the default, and emulation of the existing Cairo API should turn 
"BILINEAR" into this.

2. "no antialiasing" which is the same as "nearest" here. The purpose is 
to emulate really bad backends. Emulation of the existing Cario API 
should turn "NEAREST" into this.

3. *maybe* they are interested in "even nicer but slower". However in my 
experience all backends eventually merge "nice" and "even nicer but 
slower" into the same algorithm.

I recommend the Cairo api be more like this, with no implication as to 
what the algorithm is.

Bill Spitzak, Senior Software Engineer
The Foundry, 618 Hampton Drive, Venice, CA, 90291, USA
Tel: +1 310 399-4555 * Fax: +1 310 450-4516 * Web: www.thefoundry.co.uk
The Foundry Visionmongers Ltd * Registered in England and Wales No: 4642027

More information about the cairo mailing list