Struct embedded_graphics_core::Pixel [−][src]
pub struct Pixel<C>(pub Point, pub C)
where
C: PixelColor;
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> Clone for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
fn clone(&self) -> Pixel<C>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<C: Copy> Copy for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C: Debug> Debug for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C: Default> Default for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C> Drawable for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
type Color = C
The pixel color type.
type Output = ()
The return type of the draw
method. Read more
fn draw<D>(&self, target: &mut D) -> Result<Self::Output, D::Error> where
D: DrawTarget<Color = C>,
[src]
D: DrawTarget<Color = C>,
impl<C: Eq> Eq for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C: Hash> Hash for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<C: Ord> Ord for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
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 max(self, other: Self) -> Self#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
pub fn min(self, other: Self) -> Self#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
#[must_use]
pub fn clamp(self, min: Self, max: Self) -> Selfimpl<C: PartialEq> PartialEq<Pixel<C>> for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C: PartialOrd> PartialOrd<Pixel<C>> for Pixel<C> where
C: PixelColor,
[src]
C: PixelColor,
fn partial_cmp(&self, other: &Pixel<C>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl<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> 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,
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<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: Copy + PartialEq<T> + Debug + Any,
[src]
T: Copy + PartialEq<T> + Debug + Any,
pub fn inlined_clone(&self) -> T
[src]
pub fn is<T>() -> bool where
T: Scalar,
[src]
T: Scalar,
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, 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>,