[cairo] operator CAIRO_OPERATOR_XOR

Carl Worth cworth at east.isi.edu
Mon Jul 5 07:43:40 PDT 2004


On Wed, 19 May 2004 14:34:58 +0200 (CEST), Roman Bednarek wrote:
>   Is there any example with CAIRO_OPERATOR_XOR? I cannot make it work:-(

Here's an example:

	http://cairographics.org/samples/operator_xor.html

> When I add
> cairo_set_operator (ct, CAIRO_OPERATOR_XOR);
> to draw_shapes() in cairo demo the window is black(with only text), the
> same happens in my program.

An important point here is that CAIRO_OPERATOR_XOR is the Porter/Duff
XOR compositing operator [1]. It is not a bitwise XOR operator.

-Carl

[1] T. Porter & T. Duff - Compositing Digital Images Computer Graphics
Volume 18, Number 3 July 1984 pp 253-259.

PDF available from: http://www.keithp.com/~keithp/porterduff/p253-porter.pd




More information about the cairo mailing list