[cairo] [RFC] Cairo operators expressed in shader syntax

Bill Spitzak spitzak at thefoundry.co.uk
Fri May 18 01:38:53 PDT 2007


jose_ogp at juno.com wrote:

>> 	So, the proposal here is to logically divide the operators
>> 	into 4 groups by what definition we use:
>>
>> 	 OVER, ATOP, DEST, DEST_OVER, DEST_OUT, XOR, ADD
>>
>> 	   All definitions equivalent
>>
>> 	 SOURCE, CLEAR
>>
>> 	   (mask IN clip) ? src OP dest : dest
>>
>> 	 IN, OUT, DEST_IN, DEST_ATOP
>>
>> 	   clip ? (src IN mask) OP dest : dest
>>
>> 	 SATURATE
>>
>> 	   (src IN mask IN clip) OP dest

> 	This is a somewhat interesting topic. In my limited
> experience of having played with these a bit, I've found that
> it seems to matter what the 'context' is in which the 'operations'
> are considred as being applied -- ie. wether one is considering
> an op as 'drawing' a (possibly patterned) geometric figure,
> or as 'compositing' some color data (to a 'dst').

The "context" in this case is decided by which of the src, mask, and 
clip have the shape you are talking about:

src = compositing
mask = geometric figure
clip = don't change any pixels outside of this, used for windowing, etc.


More information about the cairo mailing list