#[repr(u8)]pub enum CompositeOperation {
Show 26 variants
SourceOver = 0,
SourceIn = 1,
SourceOut = 2,
SourceAtop = 3,
DestinationOver = 4,
DestinationIn = 5,
DestinationOut = 6,
DestinationAtop = 7,
Lighter = 8,
Copy = 9,
Xor = 10,
Multiply = 11,
Screen = 12,
Overlay = 13,
Darken = 14,
Lighten = 15,
ColorDodge = 16,
ColorBurn = 17,
HardLight = 18,
SoftLight = 19,
Difference = 20,
Exclusion = 21,
Hue = 22,
Saturation = 23,
Color = 24,
Luminosity = 25,
}Variants§
SourceOver = 0
This is the default setting and draws new shapes on top of the existing canvas content.
SourceIn = 1
The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent.
SourceOut = 2
The new shape is drawn where it doesn’t overlap the existing canvas content.
SourceAtop = 3
The new shape is only drawn where it overlaps the existing canvas content.
DestinationOver = 4
New shapes are drawn behind the existing canvas content.
DestinationIn = 5
The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent.
DestinationOut = 6
The existing content is kept where it doesn’t overlap the new shape.
DestinationAtop = 7
The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content.
Lighter = 8
Where both shapes overlap the color is determined by adding color values.
Copy = 9
Only the new shape is shown.
Xor = 10
Shapes are made transparent where both overlap and drawn normal everywhere else.
Multiply = 11
The pixels of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result.
Screen = 12
The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply)
Overlay = 13
A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter.
Darken = 14
Retains the darkest pixels of both layers.
Lighten = 15
Retains the lightest pixels of both layers.
ColorDodge = 16
Divides the bottom layer by the inverted top layer.
ColorBurn = 17
Divides the inverted bottom layer by the top layer, and then inverts the result.
HardLight = 18
A combination of multiply and screen like overlay, but with top and bottom layer swapped.
SoftLight = 19
A softer version of hardLight. Pure black or white does not result in pure black or white.
Difference = 20
Subtracts the bottom layer from the top layer or the other way round to always get a positive value.
Exclusion = 21
Like difference, but with lower contrast.
Hue = 22
Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.
Saturation = 23
Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.
Color = 24
Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.
Luminosity = 25
Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.
Trait Implementations§
Source§impl Clone for CompositeOperation
impl Clone for CompositeOperation
Source§fn clone(&self) -> CompositeOperation
fn clone(&self) -> CompositeOperation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more