[−][src]Struct embedded_graphics::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..32) .map(|i| Pixel(Point::new(i, i * 2), BinaryColor::On)) .draw(&mut display)?;
Trait Implementations
impl<C> Clone for Pixel<C> where
C: Clone + PixelColor,
[src]
C: Clone + PixelColor,
impl<C> Copy for Pixel<C> where
C: Copy + PixelColor,
[src]
C: Copy + PixelColor,
impl<C> Debug for Pixel<C> where
C: Debug + PixelColor,
[src]
C: Debug + PixelColor,
impl<C> Default for Pixel<C> where
C: Default + PixelColor,
[src]
C: Default + PixelColor,
impl<C> Drawable for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
type Color = C
The pixel color type.
pub fn draw<D>(&self, display: &mut D) -> Result<(), <D as DrawTarget>::Error> where
D: DrawTarget<Color = C>,
[src]
D: DrawTarget<Color = C>,
impl<C> Eq for Pixel<C> where
C: Eq + PixelColor,
[src]
C: Eq + PixelColor,
impl<C> Hash for Pixel<C> where
C: Hash + PixelColor,
[src]
C: Hash + PixelColor,
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub 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: Ord + PixelColor,
[src]
C: Ord + PixelColor,
pub fn cmp(&self, other: &Pixel<C>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<C> PartialEq<Pixel<C>> for Pixel<C> where
C: PartialEq<C> + PixelColor,
[src]
C: PartialEq<C> + PixelColor,
impl<C> PartialOrd<Pixel<C>> for Pixel<C> where
C: PartialOrd<C> + PixelColor,
[src]
C: PartialOrd<C> + PixelColor,
pub fn partial_cmp(&self, other: &Pixel<C>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Pixel<C>) -> bool
[src]
pub fn le(&self, other: &Pixel<C>) -> bool
[src]
pub fn gt(&self, other: &Pixel<C>) -> bool
[src]
pub 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,
pub 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<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
Dst: LosslessTryFrom<Src>,
pub fn lossless_try_into(self) -> Option<Dst>
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
Dst: LossyFrom<Src>,
pub fn lossy_into(self) -> Dst
[src]
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: PartialEq<T> + Copy + Any + Debug,
[src]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,