pub enum VideoFilter {
Crop {
w: u32,
h: u32,
x: Option<u32>,
y: Option<u32>,
},
Pad {
w: u32,
h: u32,
x: Option<u32>,
y: Option<u32>,
},
HFlip,
VFlip,
Rotate(u32),
Grayscale,
Overlay {
image: String,
x: u32,
y: u32,
},
Invert,
Brightness(i32),
Contrast(f32),
Saturation(f32),
}Expand description
One video-filter step. The canonical, code-interpreted representation.
Variants§
Crop
Crop a w×h region. Centred when x/y are omitted, else at (x, y).
Pad
Pad into a w×h canvas (neutral black). Centred when x/y are omitted.
HFlip
Mirror horizontally (left↔right).
VFlip
Mirror vertically (top↔bottom).
Rotate(u32)
Rotate clockwise by 90, 180, or 270 degrees (90/270 swap width↔height).
Grayscale
Drop chroma — set U/V to neutral so the image is grayscale.
Overlay
Alpha-composite a PNG (logo / watermark) at top-left (x, y). 8-bit only.
Invert
Invert (negate) luma + chroma. 8-bit only.
Brightness(i32)
Add a luma offset (-255..=255); brighten/darken. 8-bit only.
Contrast(f32)
Scale luma contrast around mid-grey (1.0 = unchanged). 8-bit only.
Saturation(f32)
Scale chroma saturation around neutral (0 = grayscale, 1.0 = unchanged). 8-bit only.
Trait Implementations§
Source§impl Clone for VideoFilter
impl Clone for VideoFilter
Source§fn clone(&self) -> VideoFilter
fn clone(&self) -> VideoFilter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VideoFilter
impl Debug for VideoFilter
Source§impl Display for VideoFilter
impl Display for VideoFilter
Source§impl PartialEq for VideoFilter
impl PartialEq for VideoFilter
Source§fn eq(&self, other: &VideoFilter) -> bool
fn eq(&self, other: &VideoFilter) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VideoFilter
Auto Trait Implementations§
impl Freeze for VideoFilter
impl RefUnwindSafe for VideoFilter
impl Send for VideoFilter
impl Sync for VideoFilter
impl Unpin for VideoFilter
impl UnsafeUnpin for VideoFilter
impl UnwindSafe for VideoFilter
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
Mutably borrows from an owned value. Read more