pub enum FilterFunction {
Blur {
radius: f32,
},
Brightness {
amount: f32,
},
Contrast {
amount: f32,
},
Grayscale {
amount: f32,
},
HueRotate {
angle: f32,
},
Invert {
amount: f32,
},
Opacity {
amount: f32,
},
Saturate {
amount: f32,
},
Sepia {
amount: f32,
},
}Expand description
High-level filter functions for common effects (CSS filter functions).
These match the CSS Filter Effects specification and provide simple, commonly-used visual effects without needing to construct a filter graph.
See: https://drafts.fxtf.org/filter-effects/#filter-functions
Variants§
Blur
Gaussian blur effect.
Applies a Gaussian blur to the input image. Larger radius values produce more blur. The blur is applied equally in all directions.
Note: Per the W3C Filter Effects specification, this radius parameter
represents the standard deviation (σ) of the Gaussian function, not the
effective blur range. The effective blur range is approximately 3× this value.
Fields
Brightness
Brightness adjustment.
Adjusts the brightness of the input image using a linear multiplier.
Fields
Contrast
Contrast adjustment.
Adjusts the contrast of the input image.
Fields
Grayscale
Grayscale conversion.
Converts the input to grayscale. Amount controls the strength of the conversion.
Fields
HueRotate
Hue rotation.
Rotates the hue of all colors in the input image by the specified angle.
Fields
Invert
Color inversion.
Inverts the colors of the input image.
Fields
Opacity
Opacity adjustment.
Multiplies the alpha channel by the specified amount.
Fields
Saturate
Saturation adjustment.
Adjusts the color saturation of the input image.
Fields
Sepia
Sepia tone effect.
Applies a sepia tone effect (vintage/old photo appearance).
Trait Implementations§
Source§impl Clone for FilterFunction
impl Clone for FilterFunction
Source§fn clone(&self) -> FilterFunction
fn clone(&self) -> FilterFunction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more