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.
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.
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.
size
fn size(self: &Self) -> PixelSize
The framebuffer size in device pixels.
row_bytes
fn row_bytes(self: &Self) -> i32
The number of bytes per row.
dpi
fn dpi(self: &Self) -> Vector
The DPI of the underlying screen.
format
fn format(self: &Self) -> PixelFormat
The pixel format.
alpha_format
fn alpha_format(self: &Self) -> AlphaFormat
The alpha format.
dispose
fn dispose(self: &Self)
Unlocks the framebuffer.
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.