[cairo] transparency with alpha channel RGBA
uraymeiviar at yahoo.com
Tue Oct 27 04:27:16 PDT 2009
few question, i'am trying to build openGL application which most of the textures are generated by Cairo, I create cairo surface using cairo_image_surface_create_for_data() with CAIRO_FORMAT_ARGB32 format and fetch the data to the GPU texture, but my problem is, on these codes:
cairo_set_source_rgba (this->canvas, 1.0, 1.0, 1.0, 0.5);
cairo_set_operator (this->canvas, CAIRO_OPERATOR_SOURCE);
I got grayed texture instead of white texture with half transparency, on the cairo surface data I got 0x808080808080...
instead of 0xFFFFFF80FFFFFF80FF.... it seems that the white color (1.0,1.0,1.0) are premultiplied by its alpha channel value of (0.5) resulting to (0.5,0.5,0.5,0.5 = 0x80808080...).
how do I get, non-premultiplied color so my openGL texture will have correct alpha channel values?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo