#[non_exhaustive]#[repr(u8)]pub enum BlendMethod {
Show 17 variants
Normal = 0,
Multiply = 1,
Screen = 2,
Overlay = 3,
Darken = 4,
Lighten = 5,
ColorDodge = 6,
ColorBurn = 7,
HardLight = 8,
SoftLight = 9,
Difference = 10,
Exclusion = 11,
Hue = 12,
Saturation = 13,
Color = 14,
Luminosity = 15,
Add = 16,
}Expand description
Blending method for compositing paint objects.
Covers thorvg’s user-facing blend modes (Tvg_Blend_Method
NORMAL..=ADD). The C enum’s TVG_BLEND_METHOD_COMPOSITION
(= 255) is deliberately omitted: it is an internal value the engine
uses for intermediate composition, not a mode callers select. Blend
is write-only in the C API (there is no tvg_paint_get_blend_method),
so the engine never hands a value back that would need mapping here —
hence this enum has only to_raw and no from_raw.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Normal = 0
Source is drawn over the destination (the default, no blending).
Multiply = 1
Multiplies source and destination — always darkens.
Screen = 2
Inverse-multiplies — always lightens.
Overlay = 3
Multiply in dark areas, Screen in light areas.
Darken = 4
Keeps the darker of source and destination per channel.
Lighten = 5
Keeps the lighter of source and destination per channel.
ColorDodge = 6
Brightens the destination to reflect the source.
ColorBurn = 7
Darkens the destination to reflect the source.
HardLight = 8
Overlay with source and destination swapped.
SoftLight = 9
A softer variant of HardLight.
Difference = 10
Absolute difference of source and destination per channel.
Exclusion = 11
Like Difference but with lower contrast.
Hue = 12
Hue of the source with destination saturation and luminosity.
Saturation = 13
Saturation of the source with destination hue and luminosity.
Color = 14
Hue and saturation of the source with destination luminosity.
Luminosity = 15
Luminosity of the source with destination hue and saturation.
Add = 16
Additive blending — sums source and destination per channel.
Trait Implementations§
Source§impl Clone for BlendMethod
impl Clone for BlendMethod
Source§fn clone(&self) -> BlendMethod
fn clone(&self) -> BlendMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more