embedded_graphics_framebuf::backends

Trait FrameBufferBackend

Source
pub trait FrameBufferBackend {
    type Color: PixelColor;

    // Required methods
    fn set(&mut self, index: usize, color: Self::Color);
    fn get(&self, index: usize) -> Self::Color;
    fn nr_elements(&self) -> usize;
}
Expand description

This trait marks the requirements for backends for a FrameBuf.

In a basic scenario this is just some memory. But one could implement more elaborate backends which allow manipulation of the data on the fly.

Required Associated Types§

Required Methods§

Source

fn set(&mut self, index: usize, color: Self::Color)

Sets a pixel to the respective color

Source

fn get(&self, index: usize) -> Self::Color

Returns a pixels color

Source

fn nr_elements(&self) -> usize

Nr of elements in the backend

Implementations on Foreign Types§

Source§

impl<'a, C: PixelColor, const N: usize> FrameBufferBackend for &'a mut [C; N]

Source§

type Color = C

Source§

fn set(&mut self, index: usize, color: C)

Source§

fn get(&self, index: usize) -> C

Source§

fn nr_elements(&self) -> usize

Source§

impl<C: PixelColor, const N: usize> FrameBufferBackend for [C; N]

Source§

type Color = C

Source§

fn set(&mut self, index: usize, color: C)

Source§

fn get(&self, index: usize) -> C

Source§

fn nr_elements(&self) -> usize

Implementors§

Source§

impl<'a, C> FrameBufferBackend for EndianCorrectedBuffer<'a, C>
where C: IntoStorage<Storage = u16> + PixelColor + From<RawU16>, RawU16: From<C>,

Source§

type Color = C