[cairo] How to export image_surface pixel data?

mental at rydia.net mental at rydia.net
Tue Jan 17 16:08:27 PST 2006


The mention of lock/unlock leaves me wishing for an additional API
something like...

 cairo_surface_t *
 cairo_surface_get_image(cairo_surface_t *surface,
                         int              x_offset,
                         int              y_offset,
                         int              width,
                         int              height);

Which would flush the given surface, and return an image surface
which you could use cairo_image_surface_get_data() etc. directly
on.

For image surfaces, this would generally just create another image
surface offset into the same buffer as the "parent".  For other
types of surface, this might actually blit/draw to a temporary
buffer and create a temporary image surface from that.

When you finish the "child" surface, it would either mark_dirty the
parent surface (in the case of a parent image surface), or blit
back to the parent.

Drawing operations on the parent surface would be disallowed until
the child surface was finished.

Rough idea, anyway.  I don't know how this should relate to e.g.
some of the group stuff.

-mental


More information about the cairo mailing list