Skip to main content

ImageFilterConfig

Enum ImageFilterConfig 

Source
#[non_exhaustive]
pub enum ImageFilterConfig { Direct(ImageFilter), Blur { sigma_x: f64, sigma_y: f64, bounded: bool, }, Compose { outer: Rc<ImageFilterConfig>, inner: Rc<ImageFilterConfig>, }, }
Expand description

A description of an ImageFilter that is resolved against an ImageFilterContext at paint time.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Direct(ImageFilter)

A configuration that always resolves to the given filter (Dart’s default constructor).

§

Blur

A Gaussian blur, optionally bounded to the render object’s bounds.

Fields

§sigma_x: f64

The standard deviation along the horizontal axis.

§sigma_y: f64

The standard deviation along the vertical axis.

§bounded: bool

Whether the blur is confined to the context’s bounds.

§

Compose

outer applied to the result of inner; Dart’s ImageFilterConfig.compose.

Fields

§outer: Rc<ImageFilterConfig>

The configuration that receives the filtered result of inner.

§inner: Rc<ImageFilterConfig>

The configuration that receives the original input.

Implementations§

Source§

impl ImageFilterConfig

Source

pub const fn new(filter: ImageFilter) -> ImageFilterConfig

Creates a configuration that resolves to filter unchanged.

This is also how a inset_embedder::ColorFilter is wrapped, since Dart’s ColorFilter is itself a ui.ImageFilter: pass ImageFilter::Color(filter).

Source

pub const fn blur() -> ImageFilterConfig

Creates a blur configuration; Dart’s named arguments are the setters.

Source

pub fn compose( outer: ImageFilterConfig, inner: ImageFilterConfig, ) -> ImageFilterConfig

Composes the inner configuration with outer, to combine their effects.

Creates a single ImageFilterConfig that when applied, has the same effect as subsequently applying inner and outer, i.e. result = outer(inner(source)).

Source

pub fn sigma_x(self, value: f64) -> ImageFilterConfig

Dart ImageFilterConfig.blur(sigmaX:).

Source

pub fn sigma_y(self, value: f64) -> ImageFilterConfig

Dart ImageFilterConfig.blur(sigmaY:).

Source

pub fn bounded(self, value: bool) -> ImageFilterConfig

Dart ImageFilterConfig.blur(bounded:).

Source

pub fn resolve(&self, context: ImageFilterContext) -> ImageFilter

Resolves this configuration into an ImageFilter for the given context.

Source

pub fn filter(&self) -> Option<&ImageFilter>

The filter this configuration was created from, for a direct configuration.

Source

pub fn debug_short_description(&self) -> String

A short description for debugging.

Trait Implementations§

Source§

impl Clone for ImageFilterConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ImageFilterConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ImageFilterConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ImageFilterConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ImageFilterConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>