Struct embedded_graphics::Pixel[][src]

pub struct Pixel<C>(pub Point, pub C)
where
    C: PixelColor
;

A single pixel.

Pixel objects are used to specify the position and color of drawn pixels.

Examples

The Drawable trait is implemented for Pixel which allows single pixels to be drawn to a DrawTarget:

use embedded_graphics::{pixelcolor::BinaryColor, prelude::*};

Pixel(Point::new(1, 2), BinaryColor::On).draw(&mut display)?;

Iterators with Pixel items can also be drawn:

use embedded_graphics::{pixelcolor::BinaryColor, prelude::*};

(0..32)
    .map(|i| Pixel(Point::new(i, i * 2), BinaryColor::On))
    .draw(&mut display)?;

Trait Implementations

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

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

impl<C> Debug for Pixel<C> where
    C: Debug + PixelColor
[src]

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

impl<C> Drawable for Pixel<C> where
    C: PixelColor
[src]

type Color = C

The pixel color type.

type Output = ()

The return type of the draw method. Read more

impl<C> Eq for Pixel<C> where
    C: Eq + PixelColor
[src]

impl<C> Hash for Pixel<C> where
    C: Hash + PixelColor
[src]

impl<C> Ord for Pixel<C> where
    C: Ord + PixelColor
[src]

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

impl<C> PartialOrd<Pixel<C>> for Pixel<C> where
    C: PartialOrd<C> + PixelColor
[src]

impl<C> StructuralEq for Pixel<C> where
    C: PixelColor
[src]

impl<C> StructuralPartialEq for Pixel<C> where
    C: PixelColor
[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for Pixel<C> where
    C: RefUnwindSafe

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

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

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

impl<C> UnwindSafe for Pixel<C> where
    C: UnwindSafe

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<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,