[−][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); let _ = Line::new(Point::new(0, 120), Point::new(0, 295)) .into_styled(PrimitiveStyle::with_stroke(Black, 1)) .draw(&mut display);
Methods
impl<'a> VarDisplay<'a>[src]
pub fn new(width: u32, height: u32, buffer: &'a mut [u8]) -> VarDisplay<'a>[src]
Create a new variable sized display.
Buffersize must be at least width / 8 * height bytes.
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]
fn draw_helper(
&mut self,
width: u32,
height: u32,
pixel: Pixel<BinaryColor>
) -> Result<(), Self::Error>[src]
&mut self,
width: u32,
height: u32,
pixel: Pixel<BinaryColor>
) -> Result<(), Self::Error>
impl<'a> DrawTarget<BinaryColor> for VarDisplay<'a>[src]
type Error = Infallible
Error type to return when a drawing operation fails. Read more
fn draw_pixel(&mut self, pixel: Pixel<BinaryColor>) -> Result<(), Self::Error>[src]
fn size(&self) -> Size[src]
fn draw_iter<T>(&mut self, item: T) -> Result<(), Self::Error> where
T: IntoIterator<Item = Pixel<C>>, [src]
T: IntoIterator<Item = Pixel<C>>,
fn clear(&mut self, color: C) -> Result<(), Self::Error>[src]
fn draw_line(
&mut self,
item: &Styled<Line, PrimitiveStyle<C>>
) -> Result<(), Self::Error>[src]
&mut self,
item: &Styled<Line, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_triangle(
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>[src]
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_rectangle(
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>[src]
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_circle(
&mut self,
item: &Styled<Circle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>[src]
&mut self,
item: &Styled<Circle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_image<'b, I>(
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
C: PixelColor + From<<C as PixelColor>::Raw>,
I: ImageDimensions,
&'b I: IntoPixelIter<C>, [src]
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
C: PixelColor + From<<C as PixelColor>::Raw>,
I: ImageDimensions,
&'b I: IntoPixelIter<C>,
Auto Trait Implementations
impl<'a> RefUnwindSafe for VarDisplay<'a>
impl<'a> Send for VarDisplay<'a>
impl<'a> Sync for VarDisplay<'a>
impl<'a> Unpin for VarDisplay<'a>
impl<'a> !UnwindSafe for VarDisplay<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
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> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,