- All Implemented Interfaces:
Serializable
,Comparable<Operator>
,Constable
cairo_operator_t is used to set the compositing operator for all cairo
drawing operations.
The default operator is CAIRO_OPERATOR_OVER.
The operators marked as unbounded modify their destination even outside of the mask layer (that is, their effect is not bound by the mask layer). However, their effect can still be limited by way of clipping.
To keep things simple, the operator descriptions here document the behavior for when both source and destination are either fully transparent or fully opaque. The actual implementation works for translucent layers too. For a more detailed explanation of the effects of each operator, including the mathematical definitions, see https://cairographics.org/operators/ .
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionsource and destination layers are accumulateddraw source on top of destination content and only thereclear destination layer (bounded)darkens the destination color to reflect the source color.brightens the destination color to reflect the source color.replaces the destination with the source if it is darker, otherwise keeps the source.ignore the sourceleave destination on top of source content and only there (unbounded)leave destination only where there was source content (unbounded)leave destination only where there was no source contentdraw destination on top of sourceTakes the difference of the source and destination color.Produces an effect similar to difference, but with lower contrast.Multiplies or screens, dependent on source color.Creates a color with the hue and saturation of the source and the luminosity of the target.Creates a color with the hue of the source and the saturation and luminosity of the target.Creates a color with the luminosity of the source and the hue and saturation of the target.Creates a color with the saturation of the source and the hue and luminosity of the target.draw source where there was destination content (unbounded)replaces the destination with the source if it is lighter, otherwise keeps the source.source and destination layers are multiplied.draw source where there was no destination content (unbounded)draw source layer on top of destination layer (bounded)multiplies or screens, depending on the lightness of the destination color.like over, but assuming source and dest are disjoint geometriessource and destination are complemented and multiplied.Darkens or lightens, dependent on source color.replace destination layer (bounded)source and destination are shown where there is only one of them -
Method Summary
Modifier and TypeMethodDescriptionstatic org.gnome.glib.Type
getType()
Get the CairoOperator GTypeint
getValue()
Return the value of this enumstatic Operator
of
(int ordinal) Returns the enum constant for the given ordinal (its position in the enum declaration).static Operator
Returns the enum constant of this class with the specified name.static Operator[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CLEAR
-
SOURCE
-
OVER
draw source layer on top of destination layer (bounded)- Since:
- 1.0
-
IN
draw source where there was destination content (unbounded)- Since:
- 1.0
-
OUT
draw source where there was no destination content (unbounded)- Since:
- 1.0
-
ATOP
draw source on top of destination content and only there- Since:
- 1.0
-
DEST
-
DEST_OVER
-
DEST_IN
leave destination only where there was source content (unbounded)- Since:
- 1.0
-
DEST_OUT
leave destination only where there was no source content- Since:
- 1.0
-
DEST_ATOP
leave destination on top of source content and only there (unbounded)- Since:
- 1.0
-
XOR
source and destination are shown where there is only one of them- Since:
- 1.0
-
ADD
-
SATURATE
like over, but assuming source and dest are disjoint geometries- Since:
- 1.0
-
MULTIPLY
source and destination layers are multiplied. This causes the result to be at least as dark as the darker inputs.- Since:
- 1.10
-
SCREEN
source and destination are complemented and multiplied. This causes the result to be at least as light as the lighter inputs.- Since:
- 1.10
-
OVERLAY
multiplies or screens, depending on the lightness of the destination color.- Since:
- 1.10
-
DARKEN
replaces the destination with the source if it is darker, otherwise keeps the source.- Since:
- 1.10
-
LIGHTEN
replaces the destination with the source if it is lighter, otherwise keeps the source.- Since:
- 1.10
-
COLOR_DODGE
brightens the destination color to reflect the source color.- Since:
- 1.10
-
COLOR_BURN
darkens the destination color to reflect the source color.- Since:
- 1.10
-
HARD_LIGHT
Multiplies or screens, dependent on source color.- Since:
- 1.10
-
SOFT_LIGHT
-
DIFFERENCE
Takes the difference of the source and destination color.- Since:
- 1.10
-
EXCLUSION
Produces an effect similar to difference, but with lower contrast.- Since:
- 1.10
-
HSL_HUE
Creates a color with the hue of the source and the saturation and luminosity of the target.- Since:
- 1.0
-
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.- Since:
- 1.10
-
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.- Since:
- 1.10
-
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 HSL_COLOR.- Since:
- 1.10
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public int getValue()Return the value of this enum- Returns:
- the value
-
of
Returns the enum constant for the given ordinal (its position in the enum declaration).- Parameters:
ordinal
- the position in the enum declaration, starting from zero- Returns:
- the enum constant for the given ordinal
-
getType
public static org.gnome.glib.Type getType()Get the CairoOperator GType- Returns:
- the GType
-