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§
Source§impl<C> Drawable<C> for Pixel<C>where
C: PixelColor,
impl<C> Drawable<C> for Pixel<C>where
C: PixelColor,
Source§impl<C: Ord + PixelColor> Ord for Pixel<C>
impl<C: Ord + PixelColor> Ord for Pixel<C>
Source§impl<C: PartialOrd + PixelColor> PartialOrd for Pixel<C>
impl<C: PartialOrd + PixelColor> PartialOrd for Pixel<C>
impl<C: Copy + PixelColor> Copy for Pixel<C>
impl<C: Eq + PixelColor> Eq for Pixel<C>
impl<C: PixelColor> StructuralPartialEq for Pixel<C>
Auto Trait Implementations§
impl<C> Freeze for Pixel<C>where
C: Freeze,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.