Struct embedded_graphics::pixelcolor::Gray4
source · [−]pub struct Gray4(_);
Expand description
4 bit grayscale color.
Implementations
Trait Implementations
sourceimpl ColorMapping for Gray4
impl ColorMapping for Gray4
sourceconst NONE_COLOR: Rgb888
const NONE_COLOR: Rgb888
Color used to display None
values when EG_FANCY_PANIC
is enabled. Read more
sourcefn char_to_color(c: char) -> Self
fn char_to_color(c: char) -> Self
Converts a char into a color of type C
.
sourcefn color_to_char(color: Self) -> char
fn color_to_char(color: Self) -> char
Converts a color of type C
into a char.
sourceimpl From<BinaryColor> for Gray4
impl From<BinaryColor> for Gray4
sourcepub fn from(color: BinaryColor) -> Gray4
pub fn from(color: BinaryColor) -> Gray4
Performs the conversion.
sourceimpl From<Gray4> for BinaryColor
impl From<Gray4> for BinaryColor
sourcepub fn from(color: Gray4) -> BinaryColor
pub fn from(color: Gray4) -> BinaryColor
Performs the conversion.
sourceimpl Ord for Gray4
impl Ord for Gray4
sourceimpl PartialOrd<Gray4> for Gray4
impl PartialOrd<Gray4> for Gray4
sourcepub fn partial_cmp(&self, other: &Gray4) -> Option<Ordering>
pub fn partial_cmp(&self, other: &Gray4) -> 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 Copy for Gray4
impl Eq for Gray4
impl StructuralEq for Gray4
impl StructuralPartialEq for Gray4
Auto Trait Implementations
impl RefUnwindSafe for Gray4
impl Send for Gray4
impl Sync for Gray4
impl Unpin for Gray4
impl UnwindSafe for Gray4
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
sourceimpl<T> CheckedAs for T
impl<T> CheckedAs for T
sourcepub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> CheckedCastFrom<Src> for Dst where
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dst where
Src: CheckedCast<Dst>,
sourcepub fn checked_cast_from(src: Src) -> Option<Dst>
pub fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
sourceimpl<T> OverflowingAs for T
impl<T> OverflowingAs for T
sourcepub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> OverflowingCastFrom<Src> for Dst where
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dst where
Src: OverflowingCast<Dst>,
sourcepub fn overflowing_cast_from(src: Src) -> (Dst, bool)
pub fn overflowing_cast_from(src: Src) -> (Dst, bool)
OverflowingCasts the value.
sourceimpl<T> SaturatingAs for T
impl<T> SaturatingAs for T
sourcepub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> SaturatingCastFrom<Src> for Dst where
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dst where
Src: SaturatingCast<Dst>,
sourcepub fn saturating_cast_from(src: Src) -> Dst
pub fn saturating_cast_from(src: Src) -> Dst
Casts the value.
sourceimpl<C> ToBytes for C where
C: PixelColor + Into<<C as PixelColor>::Raw>,
impl<C> ToBytes for C where
C: PixelColor + Into<<C as PixelColor>::Raw>,
type Bytes = <<C as PixelColor>::Raw as ToBytes>::Bytes
type Bytes = <<C as PixelColor>::Raw as ToBytes>::Bytes
Return type of methods in this trait.
sourcepub fn to_le_bytes(self) -> <C as ToBytes>::Bytes
pub fn to_le_bytes(self) -> <C as ToBytes>::Bytes
Converts a color into a byte array with little endian byte order.
sourcepub fn to_be_bytes(self) -> <C as ToBytes>::Bytes
pub fn to_be_bytes(self) -> <C as ToBytes>::Bytes
Converts a color into a byte array with big endian byte order.
sourcepub fn to_ne_bytes(self) -> <C as ToBytes>::Bytes
pub fn to_ne_bytes(self) -> <C as ToBytes>::Bytes
Converts a color into a byte array with native byte order.
sourceimpl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
sourcepub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> UnwrappedCastFrom<Src> for Dst where
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dst where
Src: UnwrappedCast<Dst>,
sourcepub fn unwrapped_cast_from(src: Src) -> Dst
pub fn unwrapped_cast_from(src: Src) -> Dst
UnwrappedCasts the value.
sourceimpl<T> WrappingAs for T
impl<T> WrappingAs for T
sourcepub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> WrappingCastFrom<Src> for Dst where
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dst where
Src: WrappingCast<Dst>,
sourcepub fn wrapping_cast_from(src: Src) -> Dst
pub fn wrapping_cast_from(src: Src) -> Dst
WrappingCasts the value.