Struct Grb

struct Grb<T> { ... }

A Green + Red + Blue pixel.

Examples

use rgb::Grb;

let pixel: Grb<u8> = Grb { g: 0, r: 0, b: 0 };

Fields

g: T

Green Component

r: T

Red Component

b: T

Blue Component

Implementations

impl<T: Clone> Grb<T>

fn iter(self: &Self) -> Cloned<Iter<'_, T>>

Iterate over color components (R, G, and B)

impl<T: Copy> Grb<T>

const fn new_grb(green: T, red: T, blue: T) -> Self

Creates a new Grb pixel type from its components.

Alternatively, you can use struct literal syntax to create the new pixel type:

use rgb::Grb;

let pixel = Grb {g : green, r : red, b : blue};

impl<R, S> From for Grb<S>

fn from(value: (R, R, R)) -> Self

impl<T> Add for Grb<T>

fn add(self: Self, r: T) -> <Self as >::Output

impl<T> AddAssign for Grb<T>

fn add_assign(self: &mut Self, r: T)

impl<T> AddAssign for Grb<T>

fn add_assign(self: &mut Self, other: GRB<T>)

impl<T> Any for Grb<T>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Grb<T>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Grb<T>

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

impl<T> CloneToUninit for Grb<T>

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

impl<T> ComponentSlice for Grb<T>

fn as_slice(self: &Self) -> &[T]
fn as_mut_slice(self: &mut Self) -> &mut [T]

impl<T> Div for Grb<T>

fn div(self: Self, r: T) -> <Self as >::Output

impl<T> DivAssign for Grb<T>

fn div_assign(self: &mut Self, r: T)

impl<T> Freeze for Grb<T>

impl<T> From for Grb<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> From for Grb<T>

fn from(other: RGB<T>) -> Self

impl<T> Mul for Grb<T>

fn mul(self: Self, r: T) -> <Self as >::Output

impl<T> MulAssign for Grb<T>

fn mul_assign(self: &mut Self, r: T)

impl<T> MulAssign for Grb<T>

fn mul_assign(self: &mut Self, other: GRB<T>)

impl<T> RefUnwindSafe for Grb<T>

impl<T> Send for Grb<T>

impl<T> StructuralPartialEq for Grb<T>

impl<T> Sub for Grb<T>

fn sub(self: Self, r: T) -> <Self as >::Output

impl<T> SubAssign for Grb<T>

fn sub_assign(self: &mut Self, r: T)

impl<T> SubAssign for Grb<T>

fn sub_assign(self: &mut Self, other: GRB<T>)

impl<T> Sum for Grb<T>

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

impl<T> Sync for Grb<T>

impl<T> Unpin for Grb<T>

impl<T> UnsafeUnpin for Grb<T>

impl<T> UnwindSafe for Grb<T>

impl<T, U> Into for Grb<T>

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Grb<T>

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

impl<T, U> TryInto for Grb<T>

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

impl<T: $crate::clone::Clone> Clone for Grb<T>

fn clone(self: &Self) -> Grb<T>

impl<T: $crate::cmp::Eq> Eq for Grb<T>

impl<T: $crate::cmp::Ord> Ord for Grb<T>

fn cmp(self: &Self, other: &Grb<T>) -> Ordering

impl<T: $crate::cmp::PartialEq> PartialEq for Grb<T>

fn eq(self: &Self, other: &Grb<T>) -> bool

impl<T: $crate::cmp::PartialOrd> PartialOrd for Grb<T>

fn partial_cmp(self: &Self, other: &Grb<T>) -> Option<Ordering>

impl<T: $crate::default::Default> Default for Grb<T>

fn default() -> Grb<T>

impl<T: $crate::fmt::Debug> Debug for Grb<T>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<T: $crate::hash::Hash> Hash for Grb<T>

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl<T: $crate::marker::Copy> Copy for Grb<T>

impl<T: Add> Add for Grb<T>

fn add(self: Self, other: GRB<T>) -> <Self as >::Output

impl<T: Copy, B> ColorComponentMap for Grb<T>

fn map_colors<F>(self: &Self, f: F) -> GRB<B>
where
    F: FnMut(T) -> B

impl<T: Copy, B> ComponentMap for Grb<T>

fn map<F>(self: &Self, f: F) -> GRB<B>
where
    F: FnMut(T) -> B

impl<T: Mul> Mul for Grb<T>

fn mul(self: Self, other: GRB<T>) -> <Self as >::Output

impl<T: Sub> Sub for Grb<T>

fn sub(self: Self, other: GRB<T>) -> <Self as >::Output