[cairo] output png fully-formatted png image to STDOUT or memory location
Gerdus van Zyl
gerdusvanzyl at gmail.com
Thu Feb 12 10:07:25 PST 2009
Why can't you just pass the raw pixels to imagemagick?
(MagickImportImagePixels) or you could try the low-fi approach of
running the command line tools on the cairo created png.
~G
On Thu, Feb 12, 2009 at 5:47 PM, Pablo Romero <romero619 at hotmail.com> wrote:
>
>
> Could someone please walk me through setting up a simple "cairo_write_func_t" function, that would print a png image to STDOUT and/or to a byte buffer in memory???
>
> Im not a very strong C programmer.
> Thanks,
> P.Romero
>
>
>
> ----------------------------------------
>> Date: Wed, 11 Feb 2009 14:40:07 -0500
>> Subject: Re: [cairo] output png fully-formatted png image to STDOUT or memory location
>> From: domlachowicz at gmail.com
>> To: romero619 at hotmail.com
>> CC: cairo at cairographics.org
>>
>> 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 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.
> _________________________________________________________________
> Windows Live™: Keep your life in sync.
> http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_allup_howitworks_022009
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>
More information about the cairo
mailing list