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 read_into(&self, offset: usize, out: &mut [u8]) -> usize;
    fn write_from(&mut self, offset: usize, src: &[u8]) -> usize;
    fn fill_bytes(&mut self, offset: usize, len: usize, value: u8);
    fn copy_rows_to(
        &self,
        dst: *mut u8,
        dst_stride: usize,
        damage: Damage,
        bpp_bytes: usize,
    );
}
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 read_into(&self, offset: usize, out: &mut [u8]) -> usize

Copy out.len() bytes starting at byte offset of the surface.

Source

fn write_from(&mut self, offset: usize, src: &[u8]) -> usize

Copy src into the surface at byte offset.

Source

fn fill_bytes(&mut self, offset: usize, len: usize, value: u8)

Fill len bytes at offset with value.

Source

fn copy_rows_to( &self, dst: *mut u8, dst_stride: usize, damage: Damage, bpp_bytes: usize, )

Copy one damage rectangle to a physical framebuffer.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§