[cairo] Pre-Multiplied Color

Matthew Allen fret at memecode.com
Mon Jul 4 19:18:11 PDT 2005


Hi all,

I'm working with cairo and SDL... and cairo by default uses pre-multiplied color and SDL only does non-premultiplied colour. So my problem is that I can't get the 2 libraries to agree on a common color/alpha format. Now from my research it seems cairo is moving towards being able to support both forms. And there are rumours about SDL supporting both sometime as well... but it seems cairo is a lot closer to supporting what I need. Which is non-pre-mul color+alpha in the rendered output.

Basic background on what I'm doing... cairo in client process (window client region) -> shared memory bitmap/framebuffer -> server process adds more cairo drawing (window decor) -> SDL -> screen. It's a gui, ala osx panther but for linux. It's already working but the blended pixels on the edges of the title bar where it has a rounded corner are too dark because of the mul/pre-mul issue. It's also going to wreck the shadows and global window alpha when I get to that.

Screenshot:
http://www.memecode.com/images/blog/alloy.png

Regards
--
Matthew Allen




More information about the cairo mailing list