Re: CAIRO_FORMAT_A1 image source color

sthustfo <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAEA28T9zuvCXYOFjDqpR4Nov-x1LahzZUQJJ2jhPoQoK+YyFEg@mail.gmail.com>
Thanks, the example works perfectly.

However, I have a further query. You mentioned earlier that

>Please note that CAIRO_FORMAT_A1 and CAIRO_FORMAT_A8 are *not* monochrome
>images. They describe images without any colors at all which only contain
an
>alpha channel. Only when generating a PNG are these images interpreted as
>monochrome.

Now suppose I want to get access to the raw A1 (monochrome) data using
cairo_image_surface_get_data(), then this is not possible because as you
mentioned it contains only alpha channel. The interpretation happens during
PNG writing. Is there any way around this? One option I can think of is to
take a look at how cairo_surface_write_to_png() operates on the data (alpha
channel), and similarly implement the same to get access to raw data.

Thanks.



On Sun, Mar 30, 2014 at 5:01 PM, Uli Schlachter <[email protected]> wrote:

> On 29.03.2014 19:48, Uli Schlachter wrote:
> [...]
> > Anyway, attached is a quick example for this.
> [...]
>
> I hate it when this happens. Now with attachment and, just because I can,
> the
> resulting PNG!
>
> Uli
> --
> A learning experience is one of those things that say,
> 'You know that thing you just did? Don't do that.'
>                      -- Douglas Adams
>

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.