[−][src]Struct epd_waveshare::graphics::VarDisplay
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 buffer(&self) -> &[u8][src]
fn get_mut_buffer(&mut self) -> &mut [u8][src]
fn set_rotation(&mut self, rotation: DisplayRotation)[src]
fn rotation(&self) -> DisplayRotation[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]
T: Iterator<Item = Pixel<Color>>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,