FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ConvolveMatrixEffect

    struct · ferroui-base · v0.5.0

    struct ConvolveMatrixEffect
    

    Convolves its source with a kernel (Win2D ConvolveMatrixEffect, the SVG feConvolveMatrix primitive): each pixel becomes the sum of the pixels around it weighted by the kernel, divided by divisor, plus bias (ConvolveMatrix has the exact rule). The kernel steps over device pixels. Animatable: Divisor, Bias and the elements of the kernel, KernelMatrix0 to KernelMatrix24 (row by row).

    Deviation (winui-composition.md): kernels of up to 5 by 5 elements load (a larger one is EffectTypeNotSupported); KernelOffset, KernelScale and InterpolationMode are not members; the elements of the kernel are animatable (WinUI animates none of them), so that a custom effect can derive its kernel from its parameters.

    View source

    Members

    name

    name: String
    

    The name of the effect.

    Source

    kernel_width

    kernel_width: u32
    

    The number of columns of the kernel (default 3).

    Source

    kernel_height

    kernel_height: u32
    

    The number of rows of the kernel (default 3).

    Source

    kernel_matrix

    kernel_matrix: Vec<f32>
    

    The elements of the kernel, row by row, kernel_width * kernel_height of them (default the 3 by 3 identity).

    Source

    divisor

    divisor: f32
    

    What the weighted sum is divided by (default 1; 0 is taken as 1).

    Source

    bias

    bias: f32
    

    What is added to the result, 0 to 1 a channel (default 0).

    Source

    border_mode

    border_mode: EffectBorderMode
    

    How the edges of the source are treated: Soft reads transparent pixels beyond them (the default), Hard repeats the edge pixels.

    Source

    preserve_alpha

    preserve_alpha: bool
    

    Whether the alpha is kept and the colours are convolved un-premultiplied (default false: the four premultiplied channels are convolved).

    Source

    clamp_output

    clamp_output: bool
    

    Whether the output is clamped (stored; the drawing contexts clamp).

    Source

    source

    source: Option<GraphicsEffectSource>
    

    The input.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • From<ConvolveMatrixEffect>
    • Clone
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.