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 ==.impl StructuralPartialEq for CompositeOp
Auto Trait Implementations§
impl Freeze for CompositeOp
impl RefUnwindSafe for CompositeOp
impl Send for CompositeOp
impl Sync for CompositeOp
impl Unpin for CompositeOp
impl UnsafeUnpin for CompositeOp
impl UnwindSafe for CompositeOp
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