Struct embedded_graphics_core::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
sourceimpl<C: Clone> Clone for Pixel<C>where
C: PixelColor,
impl<C: Clone> Clone for Pixel<C>where
C: PixelColor,
sourceimpl<C: Debug> Debug for Pixel<C>where
C: PixelColor,
impl<C: Debug> Debug for Pixel<C>where
C: PixelColor,
sourceimpl<C: Default> Default for Pixel<C>where
C: PixelColor,
impl<C: Default> Default for Pixel<C>where
C: PixelColor,
sourceimpl<C> Drawable for Pixel<C>where
C: PixelColor,
impl<C> Drawable for Pixel<C>where
C: PixelColor,
sourceimpl<C: Hash> Hash for Pixel<C>where
C: PixelColor,
impl<C: Hash> Hash for Pixel<C>where
C: PixelColor,
sourceimpl<C: Ord> Ord for Pixel<C>where
C: PixelColor,
impl<C: Ord> Ord for Pixel<C>where
C: PixelColor,
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<C: PartialEq> PartialEq<Pixel<C>> for Pixel<C>where
C: PixelColor,
impl<C: PartialEq> PartialEq<Pixel<C>> for Pixel<C>where
C: PixelColor,
sourceimpl<C: PartialOrd> PartialOrd<Pixel<C>> for Pixel<C>where
C: PixelColor,
impl<C: PartialOrd> PartialOrd<Pixel<C>> for Pixel<C>where
C: PixelColor,
sourcefn partial_cmp(&self, other: &Pixel<C>) -> Option<Ordering>
fn partial_cmp(&self, other: &Pixel<C>) -> Option<Ordering>
1.0.0 · sourcefn 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> Copy for Pixel<C>where
C: PixelColor,
impl<C: Eq> Eq for Pixel<C>where
C: 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedAs for T
impl<T> CheckedAs for T
sourcefn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
sourcefn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
sourceimpl<T> OverflowingAs for T
impl<T> OverflowingAs for T
sourcefn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
sourcefn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
sourceimpl<T> SaturatingAs for T
impl<T> SaturatingAs for T
sourcefn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
sourcefn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
sourceimpl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
sourcefn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
sourcefn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
sourceimpl<T> WrappingAs for T
impl<T> WrappingAs for T
sourcefn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
sourcefn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.