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§

source

type Color: PixelColor

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]

§

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]

§

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>,

§

type Color = C