Skip to main content

Lcd

Trait Lcd 

Source
pub trait Lcd {
    type Pixel: AsByteSlice + Copy;

    // Required methods
    fn info(&self) -> (LcdSize, usize);
    fn encode(&self, rgb: RGB) -> Self::Pixel;
    fn set_data(&mut self, x1y1: LcdXY, x2y2: LcdXY, data: &[u8]) -> Result<()>;
}
Expand description

Primitives that an LCD must define.

Required Associated Types§

Source

type Pixel: AsByteSlice + Copy

The primitive type of the pixel data.

Required Methods§

Source

fn info(&self) -> (LcdSize, usize)

Returns the dimensions of the LCD and size of the Pixel (stride).

Source

fn encode(&self, rgb: RGB) -> Self::Pixel

Encodes an rgb color into the Pixel expected by the LCD.

Source

fn set_data(&mut self, x1y1: LcdXY, x2y2: LcdXY, data: &[u8]) -> Result<()>

Fills the area expressed by x1y1 to x2y2 by the pixel data. The length of data should be the size of the window in pixels multiplied by the Pixel size.

Implementors§