pub trait FramebufferIO {
    fn write_frame(&mut self, frame: &[u8]);
    fn write_pixel(&mut self, pos: Point2<i32>, v: color);
    fn read_pixel(&self, pos: Point2<u32>) -> color;
    fn read_offset(&self, ofst: isize) -> u8;
    fn dump_region(&self, rect: mxcfb_rect) -> Result<Vec<u8>, &'static str>;
    fn restore_region(
        &mut self,
        rect: mxcfb_rect,
        data: &[u8]
    ) -> Result<u32, &'static str>; }

Required Methods§

Writes an arbitrary length frame into the framebuffer

Writes a single pixel at pos with value v

Reads the value of the pixel at pos

Reads the value at offset ofst from the mmapp’ed framebuffer region

Dumps the contents of the specified rectangle into a Vec<u8> from which you can later create a CompressedCanvasState or pass to restore_region(). The pixel format is rgb565_le.

Restores into the framebuffer the contents of the specified rectangle from a u8 slice

Implementors§