[cairo] Downsampling interpolation

Bryce W. Harrington b.harrington at samsung.com
Tue Aug 13 13:08:05 PDT 2013


On Fri, Aug 09, 2013 at 12:19:10AM +0000, Bryce W. Harrington wrote:
> On Tue, Aug 06, 2013 at 10:01:39AM -0400, Hunter Loftis wrote:
> > Hi everyone - new to cairo, just browsed through a bunch of old discussions and commits to learn about the < 0.5 downsampling issue (cairo always linearly interpolates between two values, so at < 0.5 results look terrible).
> > 
> > Is there any path to a solution within cairo, or would that be terribly complex? My alternative is to repeatedly downsample at 0.5 until the ratio is > 0.5 in order to hit my downsample target. Obviously pretty kludgy but it'd get the job done.
> > 
> 
> Did you look at the downscaling patch that was posted about a month ago?
> I believe it's still on the docket to go in after the next release.
> 
> If you'd like, I can stick it into a git tree for you.  I've been
> working on some tests to go along with it.

I've posted this patch along with the tests here:

  http://cgit.freedesktop.org/~bryce/cairo/  # branch = downscaling

Note you may need a newer version of pixman than provided by your
distro.  I just did a git checkout of current pixman, built it, then
built cairo against it like this:

 pixman_CFLAGS="-I/home/bryce/src/pixman/pixman/pixman/" \
 pixman_LIBS="-L/home/bryce/src/pixman/pixman/pixman/ -lpixman-1" \
 ./configure
 make


(Fwiw, the tests are still a WIP; I've got a few changes I need to do
before they're ready to go mainline.)

Bryce


More information about the cairo mailing list