reading raw (cairo surface) image data from memory
Posted: 2009-02-09T07:09:00-07:00
Hi,
dont know if this is possible or if anyone has experience with this.
I have an existing app that uses cairo.
I need to modify a cairo "image surface" IN MEMORY before writing to disk.
I can get an unsigned char pointer to the data in memory using cairos "image_surface_get_data" function.
However I dont know the length, since cairo apparently doesnt provide this info.
Im guessing that it should just be (pixel_height)*(pixel_width)*(4) for RGBA right??? need help on this...
Also, Im assuming that I would simply pass this info to MagickReadImageBlob(), correct???
something like "MagickReadImageBlob(mw,blobptr,3600)"
also need help figuring out how to this...
last question: the in-memory image is a png file.
Im not clear if the image has 'meta-data' that IM can read & figure out, or if I have to manually set the image attributes in my magickwand prior (or after?) reading the blob...how does this work???
Please help, thanks...
dont know if this is possible or if anyone has experience with this.
I have an existing app that uses cairo.
I need to modify a cairo "image surface" IN MEMORY before writing to disk.
I can get an unsigned char pointer to the data in memory using cairos "image_surface_get_data" function.
However I dont know the length, since cairo apparently doesnt provide this info.
Im guessing that it should just be (pixel_height)*(pixel_width)*(4) for RGBA right??? need help on this...
Also, Im assuming that I would simply pass this info to MagickReadImageBlob(), correct???
something like "MagickReadImageBlob(mw,blobptr,3600)"
also need help figuring out how to this...
last question: the in-memory image is a png file.
Im not clear if the image has 'meta-data' that IM can read & figure out, or if I have to manually set the image attributes in my magickwand prior (or after?) reading the blob...how does this work???
Please help, thanks...