FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ILockedFramebuffer

    trait · ferroui-base · v0.5.0

    trait ILockedFramebuffer
    

    A locked framebuffer: a block of pixel memory that can be read and written until it is disposed, at which point its content is presented or committed.

    View source

    Members

    address

    fn address(self: &Self) -> *mut u8
    

    The address of the first pixel.

    The memory is row_bytes() * size().height bytes long and stays valid until dispose is called.

    Source

    with_data

    fn with_data(self: &Self, access: &mut dyn FnMut(&mut [u8]) -> ())
    

    Gives access the pixel memory as a slice of row_bytes() * size().height bytes.

    This is the safe counterpart of address. The framebuffer must not be accessed again from within access.

    Source

    size

    fn size(self: &Self) -> PixelSize
    

    The framebuffer size in device pixels.

    Source

    row_bytes

    fn row_bytes(self: &Self) -> i32
    

    The number of bytes per row.

    Source

    dpi

    fn dpi(self: &Self) -> Vector
    

    The DPI of the underlying screen.

    Source

    format

    fn format(self: &Self) -> PixelFormat
    

    The pixel format.

    Source

    alpha_format

    fn alpha_format(self: &Self) -> AlphaFormat
    

    The alpha format.

    Source

    dispose

    fn dispose(self: &Self)
    

    Unlocks the framebuffer.

    Source

    Availability

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