[][src]Struct embedded_graphics::mock_display::MockDisplay

pub struct MockDisplay<C>(_)
where
    C: PixelColor
;

Mock display struct

See the module documentation for usage and examples.

Methods

impl<C> MockDisplay<C> where
    C: PixelColor
[src]

pub fn new() -> Self[src]

Creates a new empty mock display.

pub fn width(&self) -> usize[src]

Returns the width of the display.

pub fn height(&self) -> usize[src]

Returns the height of the display.

pub fn get_pixel(&self, p: Point) -> Option<C>[src]

Returns the color of a pixel.

pub fn set_pixel(&mut self, p: Point, color: Option<C>)[src]

Changes the color of a pixel.

impl<C> MockDisplay<C> where
    C: PixelColor + ColorMapping<C>, 
[src]

pub fn from_pattern(pattern: &[&str]) -> MockDisplay<C>[src]

Creates a new mock display from a character pattern.

The color pattern is specified by a slice of string slices. Each string slice represents a row of pixels and every character a single pixel.

A space character in the pattern represents a pixel which wasn't modified by any drawing routine and is left in the default state. All other characters are converted by implementations of the ColorMapping trait.

Trait Implementations

impl<C: Clone> Clone for MockDisplay<C> where
    C: PixelColor
[src]

impl<C: Copy> Copy for MockDisplay<C> where
    C: PixelColor
[src]

impl<C> Debug for MockDisplay<C> where
    C: PixelColor + ColorMapping<C>, 
[src]

impl<C> Default for MockDisplay<C> where
    C: PixelColor
[src]

impl<C> DrawTarget<C> for MockDisplay<C> where
    C: PixelColor
[src]

type Error = Infallible

Error type to return when a drawing operation fails. Read more

impl<C> PartialEq<MockDisplay<C>> for MockDisplay<C> where
    C: PixelColor
[src]

Auto Trait Implementations

impl<C> Send for MockDisplay<C> where
    C: Send

impl<C> Sync for MockDisplay<C> where
    C: Sync

impl<C> Unpin for MockDisplay<C> where
    C: Unpin

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,