[cairo] pixman box filtering code prototype

Aron Rubin aron.rubin at lmco.com
Wed Oct 15 10:17:38 PDT 2008


Frédéric Plourde wrote:
>> No. The upscaing quality is worse than bilinear. It is closer too
>> nearest neighbour. An algorithm like this is closer to what you'd want
>> for Postscript or PDF rendering though.
>>   
> Am I wrong or the current upscaling quality with bilinear isn't that bad 
> ?  It was really the downscaling case that was hurting bad so far... and 
> one approach could be to use Jeff's box filtering for dowscaling cases 
> (I mean as soon as scaleX OR scaleY is below 1.0) and, SWITCH to former 
> bilinear algorithm for upscaling cases... It's seems acceptable in my 
> mind, but maybe it's not in phase with cairo's philosophy ?
> 
> So briefly, our GOOD scenario would be :
> 
>    box filtering for downscaling
>    bilinear for pure upscaling (both dimensions)

To be clear or at least consistent with OpenGL lingo and mipmapping, I
would say box filtering for minification and bilinear for magnification.

I do have some concern with the distortion displayed at similar
resolution by the box filtering example. Also how does this interact
with rotation and compositing in terms of number of copies accesses and
cache misses?

> 
> what do you think ?
> -fred-
> 
>> For the default case, I think a better approach is to do a rectangular
>> box filter down to the scaled size and then do bilinear sampling from
>> this downscaled version as necessary. I think this should be more
>> performant than my box filtering code and should give the desired
>> quality for any affine matrix...
>>
>> -Jeff
>> _______________________________________________
>> cairo mailing list
>> cairo at cairographics.org
>> http://lists.cairographics.org/mailman/listinfo/cairo
>>   
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


-- 

ssh aron at rubinium.org cat /dev/brain | grep ^work:

Aron Rubin                       Senior Member, Engineering Staff
Lockheed Martin                  E-Mail: arubin at atl.lmco.com
Advanced Technology Laboratories Phone:  856.792.9865
3 Executive Campus               Fax:    856.792.9930
Cherry Hill, NJ USA 08002        Web:    http://www.atl.lmco.com


More information about the cairo mailing list