[cairo] MIPMAPPING cairo.

Frédéric Plourde frederic.plourde at polymtl.ca
Wed Oct 15 06:14:04 PDT 2008


> 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.
Mhh.. yep, pretty sure. What's happening maybe is that the source image 
"http://img58.imageshack.us/img58/8669/src1231x1504np1.png" gets 
automatically resized in FF3 (and other browsers ?), but is really 
bigger than it seems. So, we're really talking about downscaling with a 
large factor.... which kills text image as you've seen.

>
> 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.
>

We already have those specific filters in Cairo, that you're talking 
about... those are FAST, GOOD and BEST. right now, we're defaulting to 
GOOD (which leads to plain bilinear downscaling), but if you're playing 
with the little cairo_downscale.c program attached to last email, you'll 
see that I'm targetting filter BEST for that.

Anyway,  mipmapping is good, as we all know, for animation-like series 
of redrawings. That's where it wins... if not, the pyramid-building step 
overhead is so large that we certainly DON'T want to use mipmapping for 
one-shot scalings !  That's why a simple yet very nice box filtering 
algorithm (written by jeff muizelaar) is on its way to be reviewed here 
within the next few days.

-fred-


More information about the cairo mailing list