[cairo] Large image support?
M Joonas Pihlaja
jpihlaja at cc.helsinki.fi
Wed Apr 1 06:04:49 PDT 2009
Hi Ian,
On Wed, 1 Apr 2009, Ian Britten wrote:
> Hi all,
> I was wondering what support, if any, Cairo might have for working
> with large images?
It doesn't really have any explicit support. There are some internal
limits you're likely to start hitting if you exceed 32k pixels in
width or height for any source or destination, or start using larger
zoom factors than 32000:1. Generally, for large images you're going
to need a tile based approach, and the 50000x50000 sized images you
mentioned are already in this realm.
> 1) Rendering large images
> We can have lots of raster data to render, both in terms of
> large images, and/or many images to render. Naively loading
> all the source pixels into Cairo image surface(s) and then
> asking Cairo to downsample to a particular size on the output
> surface will likely exceed the available memory.
I expect you'll need to to do some sort of external mip-mapping style
solution for this case.
> 2) Creating large images
> We have workflows where users need to generate very large
> high-res images (eg: 50000x50000 pixels). Again in this case,
> simply trying to allocate a Cairo image surface that size will
> likely exceed the available memory.
Again, tile based approaches rule here. If some of your path geometry
is particularly local, then it might make sense to stuff them in a
spatial index so that you only render that geometry which is visible.
Similarly if it's very non-local then figuring out quickly whether the
entire tile is going to be covered by some geometry can be done with a
spatial index filter. Depending on your geometry, both can be big
wins.
Cheers,
Joonas
More information about the cairo
mailing list