[cairo] output png fully-formatted png image to STDOUT or memory location

Dominic Lachowicz domlachowicz at gmail.com
Wed Feb 11 11:40:07 PST 2009


There's cairo_surface_write_to_png_stream(). Call that, with your
"closure" = stdout, and your write function just a small wrapper
around fwrite().

Of course, you could write to a byte buffer in memory, and pass that
to an ImageMagick blob just as easily.

On Wed, Feb 11, 2009 at 2:33 PM, Pablo Romero <romero619 at hotmail.com> wrote:
>
> Hello,
> IM trying to find a way to feed a cairo png image to imagemagick without having to write to a temporary disk file.
>
> I looked into using cairo's image_surface_get_data() to return a pointer to the image pixels, but that unfortunately points to the raw image pixels, and I need to pass the full, "ready-to-write-to-disk" png image to imagemagick.
>
> Is it possible to write a png file to STDOUT or to a specific, pre-allocated memory location???
>
> more specifically, I only need 1 function from imagemagick that isnt avaible in cairo:
> "setcompressionquality"
>
> is it possible to set the compression quality on a png image in cairo????
> this way I wouldnt have to deal with imagemagick
>
>
>
> _________________________________________________________________
> Windows Live™: Keep your life in sync.
> http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_022009
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>



-- 
Counting bodies like sheep to the rhythm of the war drums.


More information about the cairo mailing list