Struct Rgb332

Source
pub struct Rgb332(/* private fields */);
Expand description

Color format used by SSD1331 display when in 8-bit color mode.

Implementations§

Source§

impl Rgb332

Source

pub const fn new(r: u8, g: u8, b: u8) -> Self

Trait Implementations§

Source§

impl Clone for Rgb332

Source§

fn clone(&self) -> Rgb332

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl From<Gray8> for Rgb332

Source§

fn from(color: Gray8) -> Self

Converts to this type from the input type.
Source§

impl From<RawU8> for Rgb332

Source§

fn from(data: RawU8) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb332> for RawU8

Source§

fn from(data: Rgb332) -> RawU8

Converts to this type from the input type.
Source§

impl From<Rgb888> for Rgb332

Source§

fn from(c: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Rgb332

Source§

fn eq(&self, other: &Rgb332) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PixelColor for Rgb332

Source§

type Raw = RawU8

Raw data type. Read more
Source§

impl RgbColor for Rgb332

Source§

const MAX_R: u8 = 7u8

The maximum value in the red channel.
Source§

const MAX_G: u8 = 7u8

The maximum value in the green channel.
Source§

const MAX_B: u8 = 3u8

The maximum value in the blue channel.
Source§

const BLACK: Self

Black color (R: 0%, G: 0%, B: 0%)
Source§

const RED: Self

Red color (R: 100%, G: 0%, B: 0%)
Source§

const GREEN: Self

Green color (R: 0%, G: 100%, B: 0%)
Source§

const BLUE: Self

Blue color (R: 0%, G: 0%, B: 100%)
Source§

const YELLOW: Self

Yellow color (R: 100%, G: 100%, B: 0%)
Source§

const MAGENTA: Self

Magenta color (R: 100%, G: 0%, B: 100%)
Source§

const CYAN: Self

Cyan color (R: 0%, G: 100%, B: 100%)
Source§

const WHITE: Self

White color (R: 100%, G: 100%, B: 100%)
Source§

fn r(&self) -> u8

Returns the red channel value.
Source§

fn g(&self) -> u8

Returns the green channel value.
Source§

fn b(&self) -> u8

Returns the blue channel value.
Source§

impl Copy for Rgb332

Source§

impl Eq for Rgb332

Source§

impl StructuralPartialEq for Rgb332

Auto Trait Implementations§

§

impl Freeze for Rgb332

§

impl RefUnwindSafe for Rgb332

§

impl Send for Rgb332

§

impl Sync for Rgb332

§

impl Unpin for Rgb332

§

impl UnwindSafe for Rgb332

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<C> IntoStorage for C
where C: PixelColor, <C as PixelColor>::Raw: From<C>,

Source§

type Storage = <<C as PixelColor>::Raw as RawData>::Storage

The underlying storage type for the pixel color
Source§

fn into_storage(self) -> <C as IntoStorage>::Storage

Convert the PixelColor into its raw storage form
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<C> ToBytes for C
where C: PixelColor + Into<<C as PixelColor>::Raw>,

Source§

type Bytes = <<C as PixelColor>::Raw as ToBytes>::Bytes

Return type of methods in this trait.
Source§

fn to_le_bytes(self) -> <C as ToBytes>::Bytes

Converts a color into a byte array with little endian byte order.
Source§

fn to_be_bytes(self) -> <C as ToBytes>::Bytes

Converts a color into a byte array with big endian byte order.
Source§

fn to_ne_bytes(self) -> <C as ToBytes>::Bytes

Converts a color into a byte array with native byte order.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.