[cairo] CAIRO_OPERATOR_XOR documentation

Bryce Harrington bryce at osg.samsung.com
Tue Apr 7 15:21:42 PDT 2015


On Mon, Apr 06, 2015 at 06:36:53PM -0700, Richard Billington wrote:
> If I interpret this correctly (quoting from
> http://cairographics.org/operators/):
> 
>    Resulting alpha (aR)    Resulting color (xR)
>    aA + aB − 2·aA·aB    (xaA·(1−aB) + xaB·(1−aA))/aR
> 
> If the alpha value for both A and B is 1, then nothing will be drawn
> anywhere? That is, I have something drawn on surface A with alpha at
> 1.0, and I have something on the receiving surface drawn with alpha
> at 1.0. This results in aR = 0.0 so everything in B becomes
> transparent?

Check the truth table for XOR:

    https://en.wikipedia.org/wiki/Exclusive_or

Also, look down at the xor example on the alpha blending page

    https://en.wikipedia.org/wiki/Alpha_compositing

> -- 
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo



More information about the cairo mailing list