[−][src]Struct embedded_layout::prelude::Pixel
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)?;
Trait Implementations
impl<C> Clone for Pixel<C> where
C: PixelColor + Clone,
[src]
C: PixelColor + Clone,
impl<C> Copy for Pixel<C> where
C: PixelColor + Copy,
[src]
C: PixelColor + Copy,
impl<C> Debug for Pixel<C> where
C: PixelColor + Debug,
[src]
C: PixelColor + Debug,
impl<C> Default for Pixel<C> where
C: PixelColor + Default,
[src]
C: PixelColor + Default,
impl<C> Drawable<C> for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
fn draw<D>(self, display: &mut D) -> Result<(), <D as DrawTarget<C>>::Error> where
D: DrawTarget<C>,
[src]
D: DrawTarget<C>,
impl<C> Eq for Pixel<C> where
C: PixelColor + Eq,
[src]
C: PixelColor + Eq,
impl<C> Hash for Pixel<C> where
C: PixelColor + Hash,
[src]
C: PixelColor + Hash,
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<C> Ord for Pixel<C> where
C: PixelColor + Ord,
[src]
C: PixelColor + Ord,
fn cmp(&self, other: &Pixel<C>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<C> PartialEq<Pixel<C>> for Pixel<C> where
C: PixelColor + PartialEq<C>,
[src]
C: PixelColor + PartialEq<C>,
impl<C> PartialOrd<Pixel<C>> for Pixel<C> where
C: PixelColor + PartialOrd<C>,
[src]
C: PixelColor + PartialOrd<C>,
fn partial_cmp(&self, other: &Pixel<C>) -> Option<Ordering>
[src]
fn lt(&self, other: &Pixel<C>) -> bool
[src]
fn le(&self, other: &Pixel<C>) -> bool
[src]
fn gt(&self, other: &Pixel<C>) -> bool
[src]
fn ge(&self, other: &Pixel<C>) -> bool
[src]
impl<C> StructuralEq for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C> StructuralPartialEq for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
Auto Trait Implementations
impl<C> RefUnwindSafe for Pixel<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
impl<C> Send for Pixel<C> where
C: Send,
C: Send,
impl<C> Sync for Pixel<C> where
C: Sync,
C: Sync,
impl<C> Unpin for Pixel<C> where
C: Unpin,
C: Unpin,
impl<C> UnwindSafe for Pixel<C> where
C: UnwindSafe,
C: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,