[cairo] How to export image_surface pixel data?
vladimirv at gmail.com
Wed Jan 18 15:40:27 PST 2006
The internal backend methods acquire_dest_image and release_dest_image
already have this exact API; I'm not sure whether it should really be
exposed, though. It's possible to get the exact same semantics by
just creating a temporary surface of your width/height, drawing your
original surface to it, doing whatever munging you want, and drawing
On 1/18/06, mental at rydia.net <mental at rydia.net> wrote:
> 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
> 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.
> cairo mailing list
> cairo at cairographics.org
More information about the cairo