[cairo] [RFC] writing large png's.

Matt Rice ratmice at gmail.com
Sat May 3 05:40:47 PDT 2008


not proposing this go in as its clearly not ready, but it appears to
function somewhat
(passes the testsuite here with no new failures),

just figured i'd ask for comments before I attempt the next paragraph...

a few implementations of _surface_acquire_source_image need to
implement usage of interest_rect
this could cause for example with the write_png function i've
implemented for the entire image to be just copies
of the first row of pixels.

and i'm pretty sure i'm not going be able to test all the surface
types... (win32 or quartz),
and couldn't get the directfb or xcb working easily though i didn't
try very hard :/

anyhow this doesn't in any way attempt increase the size of an image
surface you can create,
just increase the size of a png you can write through
cairo_surface_write_to_png_stream,
by creating the image surface in chunks (currently 1 row at a time) rather
than creating a large image surface containing the entire surface...

the attached "large-surface.c" probably isn't large enough to fail
with existing cairo
but at least shows the usage i was envisioning, easy to increase the
width/height though..

current limitations of the patch include inability to cope with very wide images
as it only creates chunks based on height, i'm not sure if there is
some bit we can flip in libpng
to write vertical rows or not..

clearly though acquiring single pixel rows may not be the best idea...

cc'ing John as he asked a related question last month and didn't
appear to get a reply.

cheers..
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interest_rect.diff
Type: text/x-patch
Size: 31105 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080503/4495e7a4/attachment-0001.bin 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: large-surface.c
Url: http://lists.cairographics.org/archives/cairo/attachments/20080503/4495e7a4/attachment-0001.txt 


More information about the cairo mailing list