pub enum ImageFilter {
Blur {
sigma_x: f32,
sigma_y: f32,
},
Color(ColorFilter),
DropShadow {
offset: Point,
sigma_x: f32,
sigma_y: f32,
color: Color,
},
Compose {
outer: Arc<ImageFilter>,
inner: Arc<ImageFilter>,
},
}Expand description
ImageFilter transforms a rasterized draw or layer.
In a composition, the inner filter runs first and feeds the outer filter.
Variants§
Blur
Blur applies a Gaussian blur in local x and y units.
Fields
Color(ColorFilter)
Color applies a color filter after rasterization.
DropShadow
DropShadow composites the input over a blurred, colored copy of its alpha.
Fields
Compose
Compose applies inner and then outer.
Fields
outer: Arc<ImageFilter>outer receives the filtered result of inner.
inner: Arc<ImageFilter>inner receives the original input.
Implementations§
Source§impl ImageFilter
impl ImageFilter
Sourcepub fn blur(sigma_x: f32, sigma_y: f32) -> Self
pub fn blur(sigma_x: f32, sigma_y: f32) -> Self
blur creates a Gaussian image filter with nonnegative sigmas.
Sourcepub fn color(filter: ColorFilter) -> Self
pub fn color(filter: ColorFilter) -> Self
color creates an image filter from a color filter.
Sourcepub fn compose(outer: ImageFilter, inner: ImageFilter) -> Self
pub fn compose(outer: ImageFilter, inner: ImageFilter) -> Self
compose applies inner first and outer second.
Sourcepub fn drop_shadow(
offset: Point,
sigma_x: f32,
sigma_y: f32,
color: Color,
) -> Self
pub fn drop_shadow( offset: Point, sigma_x: f32, sigma_y: f32, color: Color, ) -> Self
drop_shadow creates a shadow that retains the original input.
Sourcepub fn is_nop(&self) -> bool
pub fn is_nop(&self) -> bool
is_nop reports whether the filter leaves every input pixel unchanged.
Sourcepub fn padding(&self) -> [f32; 2]
pub fn padding(&self) -> [f32; 2]
padding returns conservative local x and y expansion for this filter.
Sourcepub fn modifies_transparent_black(&self) -> bool
pub fn modifies_transparent_black(&self) -> bool
modifies_transparent_black reports whether this filter can create
visible output from a transparent input pixel.
Trait Implementations§
Source§impl Clone for ImageFilter
impl Clone for ImageFilter
Source§fn clone(&self) -> ImageFilter
fn clone(&self) -> ImageFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more