Skip to main content

DisplayScreen

Trait DisplayScreen 

Source
pub trait DisplayScreen: Send + Sync {
    // Required methods
    fn width(&self) -> u32;
    fn height(&self) -> u32;
    fn stride(&self) -> u32;
    fn bpp(&self) -> u8;
    fn pixels(&self) -> *const u8;
    fn pixels_mut(&mut self) -> *mut u8;
}
Expand description

Trait for an individual display screen (offscreen buffer).

Required Methods§

Source

fn width(&self) -> u32

Width in pixels.

Source

fn height(&self) -> u32

Height in pixels.

Source

fn stride(&self) -> u32

Bytes per row (stride).

Source

fn bpp(&self) -> u8

Bits per pixel.

Source

fn pixels(&self) -> *const u8

Pointer to the raw pixel data.

Source

fn pixels_mut(&mut self) -> *mut u8

Mutable pointer to the raw pixel data.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§