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),
Denoise {
method: DenoiseMethod,
strength: 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.
Denoise
Spatial denoise with a selectable algorithm (see DenoiseMethod)
and a strength in 0.0..=1.0 (default 0.5) that blends the filtered
result back with the source (0 = off, 1 = fully denoised). Applied to
luma + chroma. 8-bit only.
Trait Implementations§
Source§impl Clone for VideoFilter
impl Clone for VideoFilter
Source§fn clone(&self) -> VideoFilter
fn clone(&self) -> VideoFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
self and other values to be equal, and is used by ==.