[−][src]Struct embedded_graphics::mock_display::MockDisplay
Mock display struct
See the module documentation for usage and examples.
Methods
impl<C> MockDisplay<C> where
C: PixelColor,
[src]
C: PixelColor,
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]
C: PixelColor + ColorMapping<C>,
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]
C: PixelColor,
fn clone(&self) -> MockDisplay<C>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<C: Copy> Copy for MockDisplay<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C> Debug for MockDisplay<C> where
C: PixelColor + ColorMapping<C>,
[src]
C: PixelColor + ColorMapping<C>,
impl<C> Default for MockDisplay<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C> DrawTarget<C> for MockDisplay<C> where
C: PixelColor,
[src]
C: PixelColor,
type Error = Infallible
Error type to return when a drawing operation fails. Read more
fn draw_pixel(&mut self, pixel: Pixel<C>) -> 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> where
Self: Sized,
[src]
Self: Sized,
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<'a, 'b, I>(
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
&'b I: IntoPixelIter<C>,
I: ImageDimensions,
C: PixelColor + From<<C as PixelColor>::Raw>,
[src]
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
&'b I: IntoPixelIter<C>,
I: ImageDimensions,
C: PixelColor + From<<C as PixelColor>::Raw>,
impl<C> PartialEq<MockDisplay<C>> for MockDisplay<C> where
C: PixelColor,
[src]
C: PixelColor,
fn eq(&self, other: &MockDisplay<C>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
Auto Trait Implementations
impl<C> Send for MockDisplay<C> where
C: Send,
C: Send,
impl<C> Sync for MockDisplay<C> where
C: Sync,
C: Sync,
impl<C> Unpin for MockDisplay<C> where
C: Unpin,
C: Unpin,
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> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: PartialEq<T> + Copy + Any + Debug,
[src]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
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>,
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,