Struct embedded_graphics::Pixel
source · pub struct Pixel<C>(pub Point, pub C)
where
C: PixelColor;
Expand description
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)?;
Tuple Fields§
§0: Point
§1: C
Trait Implementations§
source§impl<C> Drawable for Pixel<C>where
C: PixelColor,
impl<C> Drawable for Pixel<C>where C: PixelColor,
source§impl<C> Ord for Pixel<C>where
C: Ord + PixelColor,
impl<C> Ord for Pixel<C>where C: Ord + PixelColor,
source§impl<C> PartialEq<Pixel<C>> for Pixel<C>where
C: PartialEq<C> + PixelColor,
impl<C> PartialEq<Pixel<C>> for Pixel<C>where C: PartialEq<C> + PixelColor,
source§impl<C> PartialOrd<Pixel<C>> for Pixel<C>where
C: PartialOrd<C> + PixelColor,
impl<C> PartialOrd<Pixel<C>> for Pixel<C>where C: PartialOrd<C> + PixelColor,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<C> Copy for Pixel<C>where C: Copy + PixelColor,
impl<C> Eq for Pixel<C>where C: Eq + PixelColor,
impl<C> StructuralEq for Pixel<C>where C: PixelColor,
impl<C> StructuralPartialEq for Pixel<C>where C: PixelColor,
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§
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.