pub enum BlendMode {
Show 40 variants
Normal,
Multiply,
Screen,
Overlay,
SoftLight,
HardLight,
ColorDodge,
ColorBurn,
Darken,
Lighten,
Difference,
Exclusion,
Add,
Subtract,
And,
Average,
Bleach,
Divide,
Extremity,
Freeze,
Geometric,
Glow,
GrainExtract,
GrainMerge,
HardMix,
HardOverlay,
Harmonic,
Heat,
Interpolate,
LinearLight,
Multiply128,
Negation,
Or,
Phoenix,
PinLight,
Reflect,
SoftDifference,
Stain,
VividLight,
Xor,
}Expand description
Specifies how two video layers are combined during compositing.
Each variant corresponds 1:1 to a mode of FFmpeg’s blend filter
all_mode option (40 modes total, matching vf_blend.c). BlendMode::Normal
is the standard alpha-over composite, built via the overlay filter; every
other variant is built via blend all_mode=<token>. The canonical token for
each variant is provided by FfmpegToken (all variants map to a valid token).
For Porter-Duff alpha compositing (over / under / in / out / atop / xor)
use CompositeOp instead — that is a separate concept
(alpha channel operators, not pixel-value blend modes). Note BlendMode::Xor
is the arithmetic xor blend, distinct from CompositeOp::Xor.
Variants§
Normal
Standard alpha-over composite (top * opacity + bottom * (1 − opacity)).
Built via overlay=format=auto:shortest=1 (token: normal).
Multiply
Multiply per-channel pixel values; darkens. blend all_mode=multiply.
Screen
Inverse of multiply; lightens. blend all_mode=screen.
Overlay
Multiply/Screen by base luminance. blend all_mode=overlay.
SoftLight
Gentle contrast enhancement. blend all_mode=softlight.
HardLight
Harsher Overlay driven by the top layer. blend all_mode=hardlight.
ColorDodge
Brightens the base. blend all_mode=dodge.
ColorBurn
Darkens the base. blend all_mode=burn.
Darken
Keeps the darker pixel per channel. blend all_mode=darken.
Lighten
Keeps the lighter pixel per channel. blend all_mode=lighten.
Difference
Per-channel absolute difference. blend all_mode=difference.
Exclusion
Lower-contrast Difference. blend all_mode=exclusion.
Add
Linear addition, clamped. blend all_mode=addition.
Subtract
Linear subtraction, clamped. blend all_mode=subtract.
And
Bitwise AND of the two pixels. blend all_mode=and.
Average
Arithmetic mean of the two pixels. blend all_mode=average.
Bleach
Bleach-bypass look. blend all_mode=bleach.
Divide
Per-channel division. blend all_mode=divide.
Extremity
Extremity (distance from mid-grey). blend all_mode=extremity.
Freeze
Freeze. blend all_mode=freeze.
Geometric
Geometric mean. blend all_mode=geometric.
Glow
Glow. blend all_mode=glow.
GrainExtract
Grain extract (alias of difference128). blend all_mode=grainextract.
GrainMerge
Grain merge (alias of addition128). blend all_mode=grainmerge.
HardMix
Hard mix. blend all_mode=hardmix.
HardOverlay
Hard overlay. blend all_mode=hardoverlay.
Harmonic
Harmonic mean. blend all_mode=harmonic.
Heat
Heat. blend all_mode=heat.
Interpolate
Linear interpolation. blend all_mode=interpolate.
LinearLight
Linear light. blend all_mode=linearlight.
Multiply128
Multiply scaled by 128. blend all_mode=multiply128.
Negation
Negation. blend all_mode=negation.
Or
Bitwise OR of the two pixels. blend all_mode=or.
Phoenix
Phoenix. blend all_mode=phoenix.
PinLight
Pin light. blend all_mode=pinlight.
Reflect
Reflect. blend all_mode=reflect.
SoftDifference
Soft difference. blend all_mode=softdifference.
Stain
Stain. blend all_mode=stain.
VividLight
Vivid light. blend all_mode=vividlight.
Xor
Arithmetic XOR of the two pixels. blend all_mode=xor.
Distinct from the Porter-Duff CompositeOp::Xor.
Trait Implementations§
impl Copy for BlendMode
impl Eq for BlendMode
Source§impl FfmpegToken for BlendMode
impl FfmpegToken for BlendMode
fn ffmpeg_token(&self) -> Option<&'static str>
impl StructuralPartialEq for BlendMode
Auto Trait Implementations§
impl Freeze for BlendMode
impl RefUnwindSafe for BlendMode
impl Send for BlendMode
impl Sync for BlendMode
impl Unpin for BlendMode
impl UnsafeUnpin for BlendMode
impl UnwindSafe for BlendMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more