Struct embedded_graphics::drawable::Pixel
source · [−]pub struct Pixel<C: PixelColor>(pub Point, pub C);
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..100)
.map(|i| Pixel(Point::new(i, i * 2), BinaryColor::On))
.draw(&mut display)?;
Tuple Fields
0: Point
1: C
Trait Implementations
sourceimpl<C: Clone + PixelColor> Clone for Pixel<C>
impl<C: Clone + PixelColor> Clone for Pixel<C>
sourceimpl<C: Debug + PixelColor> Debug for Pixel<C>
impl<C: Debug + PixelColor> Debug for Pixel<C>
sourceimpl<C: Default + PixelColor> Default for Pixel<C>
impl<C: Default + PixelColor> Default for Pixel<C>
sourceimpl<C> Drawable<C> for Pixel<C> where
C: PixelColor,
impl<C> Drawable<C> for Pixel<C> where
C: PixelColor,
sourceimpl<C: Hash + PixelColor> Hash for Pixel<C>
impl<C: Hash + PixelColor> Hash for Pixel<C>
sourceimpl<C: Ord + PixelColor> Ord for Pixel<C>
impl<C: Ord + PixelColor> Ord for Pixel<C>
sourceimpl<C: PartialOrd + PixelColor> PartialOrd<Pixel<C>> for Pixel<C>
impl<C: PartialOrd + PixelColor> PartialOrd<Pixel<C>> for Pixel<C>
sourcefn partial_cmp(&self, other: &Pixel<C>) -> Option<Ordering>
fn partial_cmp(&self, other: &Pixel<C>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
impl<C: Copy + PixelColor> Copy for Pixel<C>
impl<C: Eq + PixelColor> Eq for Pixel<C>
impl<C: PixelColor> StructuralEq for Pixel<C>
impl<C: PixelColor> StructuralPartialEq for Pixel<C>
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more