pub trait ILockedFramebuffer {
// Required methods
fn address(&self) -> *mut u8;
fn with_data(&self, access: &mut dyn FnMut(&mut [u8]));
fn size(&self) -> PixelSize;
fn row_bytes(&self) -> i32;
fn dpi(&self) -> Vector;
fn format(&self) -> PixelFormat;
fn alpha_format(&self) -> AlphaFormat;
fn dispose(&self);
}Expand description
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.
Required Methods§
Sourcefn address(&self) -> *mut u8
fn address(&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.
Sourcefn with_data(&self, access: &mut dyn FnMut(&mut [u8]))
fn with_data(&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.
Sourcefn format(&self) -> PixelFormat
fn format(&self) -> PixelFormat
The pixel format.
Sourcefn alpha_format(&self) -> AlphaFormat
fn alpha_format(&self) -> AlphaFormat
The alpha format.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".