Name
ccontext:SetOperator -- set current compositing operator
Synopsis
ccontext:SetOperator(op)
Function
Sets the compositing operator to be used for all drawing operations. The op parameter can be one of the following constants:

#CAIRO_OPERATOR_CLEAR
Clear destination layer (bounded)
#CAIRO_OPERATOR_SOURCE
Replace destination layer (bounded).
#CAIRO_OPERATOR_OVER
Draw source layer on top of destination layer (bounded).
#CAIRO_OPERATOR_IN
Draw source where there was destination content (unbounded).
#CAIRO_OPERATOR_OUT
Draw source where there was no destination content (unbounded).
#CAIRO_OPERATOR_ATOP
Draw source on top of destination content and only there.
#CAIRO_OPERATOR_DEST
Ignore the source.
#CAIRO_OPERATOR_DEST_OVER
Draw destination on top of source.
#CAIRO_OPERATOR_DEST_IN
Leave destination only where there was source content (unbounded).
#CAIRO_OPERATOR_DEST_OUT
Leave destination only where there was no source content.
#CAIRO_OPERATOR_DEST_ATOP
Leave destination on top of source content and only there (unbounded).
#CAIRO_OPERATOR_XOR
Source and destination are shown where there is only one of them.
#CAIRO_OPERATOR_ADD
Source and destination layers are accumulated.
#CAIRO_OPERATOR_SATURATE
Like over, but assuming source and dest are disjoint geometries.
#CAIRO_OPERATOR_MULTIPLY
Source and destination layers are multiplied. This causes the result to be at least as dark as the darker inputs.
#CAIRO_OPERATOR_SCREEN
Source and destination are complemented and multiplied. This causes the result to be at least as light as the lighter inputs.
#CAIRO_OPERATOR_OVERLAY
Multiplies or screens, depending on the lightness of the destination color.
#CAIRO_OPERATOR_DARKEN
Replaces the destination with the source if it is darker, otherwise keeps the source.
#CAIRO_OPERATOR_LIGHTEN
Replaces the destination with the source if it is lighter, otherwise keeps the source.
#CAIRO_OPERATOR_COLOR_DODGE
Brightens the destination color to reflect the source color.
#CAIRO_OPERATOR_COLOR_BURN
Darkens the destination color to reflect the source color.
#CAIRO_OPERATOR_HARD_LIGHT
Multiplies or screens, dependent on source color.
#CAIRO_OPERATOR_SOFT_LIGHT
Darkens or lightens, dependent on source color.
#CAIRO_OPERATOR_DIFFERENCE
Takes the difference of the source and destination color.
#CAIRO_OPERATOR_EXCLUSION
Produces an effect similar to difference, but with lower contrast.
#CAIRO_OPERATOR_HSL_HUE
Creates a color with the hue of the source and the saturation and luminosity of the target.
#CAIRO_OPERATOR_HSL_SATURATION
Creates a color with the saturation of the source and the hue and luminosity of the target. Painting with this mode onto a gray area produces no change.
#CAIRO_OPERATOR_HSL_COLOR
Creates a color with the hue and saturation of the source and the luminosity of the target. This preserves the gray levels of the target and is useful for coloring monochrome images or tinting color images.
#CAIRO_OPERATOR_HSL_LUMINOSITY
Creates a color with the luminosity of the source and the hue and saturation of the target. This produces an inverse effect to #CAIRO_OPERATOR_HSL_COLOR.

The default operator is #CAIRO_OPERATOR_OVER.

Inputs
op
a compositing operator (see above)

Show TOC