[cairo] Problems blending with different platforms

Soeren Sandmann sandmann at daimi.au.dk
Fri Dec 11 07:59:30 PST 2009


M Joonas Pihlaja <jpihlaja at cc.helsinki.fi> writes:

> > I found that if the alpha value of an image in the pixel is 0, but RGB data
> > is not, I would get the proper blending behavior on the x86 but the MIPS
> > would produce a destination pixel with 0 alpha.
> [...]
> 
> Pixman assumes that the incoming ARGB data is in premultiplied format, 
> so that the r,g,b pixel components actually contain the value 
> a/255*{red or green or blue}.  In premultiplied format the r,g,b 
> values ought to therefore always be <= a.

RGB values > a is a somewhat strange case, but it is supposed to
work. The OVER equation says

        s + (1 - sa) * d

and that is well-defined even when RGB > a. When sa is 0, this case
degenerates to s + d, which can't cause an alpha value of 0 with a
saturating addition.


Soren


More information about the cairo mailing list