pub enum CompositeOp {
Over,
Under,
In,
Out,
Atop,
Xor,
}Expand description
Porter-Duff alpha-compositing operator for combining two video layers.
Unlike BlendMode (which operates on pixel values), these
operators combine layers by their alpha channels. At least the top layer must
carry an alpha channel (e.g. rgba or yuva420p).
There is no blend all_mode token for Porter-Duff compositing, so this type
has no FfmpegToken impl; each operator maps to a specific FFmpeg construction
(overlay or blend with a per-channel expression) in the filter graph.
Variants§
Over
Top layer rendered over the bottom (standard alpha compositing).
Built via overlay=format=auto:shortest=1.
Under
Bottom layer rendered over the top; Over with the inputs swapped.
Built via overlay with swapped input order.
In
Top layer masked by the bottom layer’s alpha (intersection).
Built via blend with c0_expr='B*A/255'.
Out
Top layer visible only where the bottom layer is transparent.
Built via blend with c0_expr='B*(255-A)/255'.
Atop
Top layer placed atop the bottom; visible only where the bottom is opaque.
Built via blend with c0_expr='B*A/255 + A*(255-B)/255'.
Xor
Pixels from exactly one layer (XOR of opaque regions).
Built via blend with c0_expr='B*(255-A)/255 + A*(255-B)/255'.
Trait Implementations§
Source§impl Clone for CompositeOp
impl Clone for CompositeOp
Source§fn clone(&self) -> CompositeOp
fn clone(&self) -> CompositeOp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CompositeOp
Source§impl Debug for CompositeOp
impl Debug for CompositeOp
Source§impl Default for CompositeOp
impl Default for CompositeOp
Source§fn default() -> CompositeOp
fn default() -> CompositeOp
impl Eq for CompositeOp
Source§impl PartialEq for CompositeOp
impl PartialEq for CompositeOp
Source§fn eq(&self, other: &CompositeOp) -> bool
fn eq(&self, other: &CompositeOp) -> bool
self and other values to be equal, and is used by ==.