FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    EffectImagePixels

    struct · ferroui-base · v0.5.0

    struct EffectImagePixels
    

    The pixels of an EffectImage: premultiplied RGBA, eight bits a channel, rows of width * 4 bytes without padding.

    View source

    Members

    new

    fn new(width: usize, height: usize, rgba: impl Into<Arc<[u8]>>) -> Option<Self>
    

    Pixels of width by height from rgba (premultiplied, width * 4 bytes a row); None when the length does not match.

    Source

    width

    fn width(self: &Self) -> usize
    

    The width in pixels.

    Source

    height

    fn height(self: &Self) -> usize
    

    The height in pixels.

    Source

    rgba

    fn rgba(self: &Self) -> &[u8]
    

    The premultiplied RGBA bytes.

    Source

    texel

    fn texel(self: &Self, x: i64, y: i64) -> [u8; 4]
    

    The texel at column x and row y; transparent beyond the image.

    Source

    sample_stretched

    fn sample_stretched(self: &Self, coord: [f32; 2], layer_size: [f32; 2]) -> [u8; 4]
    

    The image at coord (device pixels of the area of an effect whose size is layer_size) as the programs of the shader effects sample a child (the convention of ShaderEffectDescription): the image stretched over the area, the texel under coord * size / layer_size (single precision, in that order), transparent beyond the image.

    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
    • Clone
    • Debug
    • StructuralPartialEq
    • PartialEq

    Availability

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