[][src]Struct epd_waveshare::graphics::VarDisplay

pub struct VarDisplay<'a> { /* fields omitted */ }

A variable Display without a predefined buffer

The buffer can be created as following: buffer: [DEFAULT_BACKGROUND_COLOR.get_byte_value(); WIDTH / 8 * HEIGHT]

Example:

let width = 128;
let height = 296;

let mut buffer = [DEFAULT_BACKGROUND_COLOR.get_byte_value(); 128 / 8 * 296];
let mut display = VarDisplay::new(width, height, &mut buffer);

display.set_rotation(DisplayRotation::Rotate90);

display.draw(
    Line::new(Coord::new(0, 120), Coord::new(0, 295))
        .with_stroke(Some(Color::Black))
        .into_iter(),
);

Methods

impl<'a> VarDisplay<'a>[src]

pub fn new(width: u32, height: u32, buffer: &'a mut [u8]) -> VarDisplay<'a>[src]

Trait Implementations

impl<'a> Display for VarDisplay<'a>[src]

fn clear_buffer(&mut self, background_color: Color)[src]

Clears the buffer of the display with the chosen background color

fn draw_helper<T>(&mut self, width: u32, height: u32, item_pixels: T) where
    T: Iterator<Item = Pixel<Color>>, 
[src]

Helperfunction for the Embedded Graphics draw trait Read more

impl<'a> Drawing<Color> for VarDisplay<'a>[src]

Auto Trait Implementations

impl<'a> Send for VarDisplay<'a>

impl<'a> Sync for VarDisplay<'a>

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]