[cairo] downscaling capabilities

Bill Spitzak spitzak at thefoundry.co.uk
Sat Apr 19 12:16:23 PDT 2008


> Owen Taylor a écrit :

>> I'm going to directly disagree here and suggest that for
>> CAIRO_FILTER_GOOD, the right algorithm is:
>>
>>  - Scale down by factors of 2 repeatedly until you are less than 2 times
>>    the target scale factor
>>  - Bilinearly sample from the result
>>
>> There are certainly disadvantages to this to this approach:
>>
>>  - Works worse with non-uniform scales (that contract more in one
>>    direction than others)

If you are going to do this each time it is quite possible to use a 
different power of 2 horizontally than vertically.

Actually I think if you are calculating this each time than you can do 
any integer, not just a power of 2, and the speed is pretty much the 
same? I do agree that an integer scale with a box filter is far faster 
than any other kind of filtering.


More information about the cairo mailing list