Expand description
RGB colors
Tuple Fields
0: [T; 3]
Trait Implementations
sourceimpl<T: Primitive + 'static> Pixel for Rgb<T>
impl<T: Primitive + 'static> Pixel for Rgb<T>
type Subpixel = T
type Subpixel = T
The underlying subpixel type.
sourceconst CHANNEL_COUNT: u8
const CHANNEL_COUNT: u8
The number of channels of this pixel type.
sourceconst COLOR_MODEL: &'static str
const COLOR_MODEL: &'static str
sourceconst COLOR_TYPE: ColorType
const COLOR_TYPE: ColorType
ColorType for this pixel format
sourcefn channels(&self) -> &[T]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
fn channels(&self) -> &[T]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Returns the components as a slice.
sourcefn channels_mut(&mut self) -> &mut [T]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
fn channels_mut(&mut self) -> &mut [T]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Returns the components as a mutable slice
sourcefn channels4(&self) -> (T, T, T, T)
fn channels4(&self) -> (T, T, T, T)
Returns the channels of this pixel as a 4 tuple. If the pixel has less than 4 channels the remainder is filled with the maximum value Read more
sourcefn from_channels(a: T, b: T, c: T, d: T) -> Rgb<T>
fn from_channels(a: T, b: T, c: T, d: T) -> Rgb<T>
Construct a pixel from the 4 channels a, b, c and d. If the pixel does not contain 4 channels the extra are ignored. Read more
sourcefn from_slice(slice: &[T]) -> &Rgb<T>
fn from_slice(slice: &[T]) -> &Rgb<T>
Returns a view into a slice. Read more
sourcefn from_slice_mut(slice: &mut [T]) -> &mut Rgb<T>
fn from_slice_mut(slice: &mut [T]) -> &mut Rgb<T>
Returns mutable view into a mutable slice. Read more
sourcefn to_luma_alpha(&self) -> LumaA<T>
fn to_luma_alpha(&self) -> LumaA<T>
Convert this pixel to luma with an alpha channel
sourcefn map<F>(&self, f: F) -> Rgb<T> where
F: FnMut(T) -> T,
fn map<F>(&self, f: F) -> Rgb<T> where
F: FnMut(T) -> T,
Apply the function f
to each channel of this pixel.
sourcefn apply<F>(&mut self, f: F) where
F: FnMut(T) -> T,
fn apply<F>(&mut self, f: F) where
F: FnMut(T) -> T,
Apply the function f
to each channel of this pixel.
sourcefn map_with_alpha<F, G>(&self, f: F, g: G) -> Rgb<T> where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
fn map_with_alpha<F, G>(&self, f: F, g: G) -> Rgb<T> where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
Apply the function f
to each channel except the alpha channel.
Apply the function g
to the alpha channel. Read more
sourcefn apply_with_alpha<F, G>(&mut self, f: F, g: G) where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
fn apply_with_alpha<F, G>(&mut self, f: F, g: G) where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
Apply the function f
to each channel except the alpha channel.
Apply the function g
to the alpha channel. Works in-place. Read more
sourcefn map2<F>(&self, other: &Self, f: F) -> Rgb<T> where
F: FnMut(T, T) -> T,
fn map2<F>(&self, other: &Self, f: F) -> Rgb<T> where
F: FnMut(T, T) -> T,
Apply the function f
to each channel of this pixel and
other
pairwise. Read more
sourcefn apply2<F>(&mut self, other: &Rgb<T>, f: F) where
F: FnMut(T, T) -> T,
fn apply2<F>(&mut self, other: &Rgb<T>, f: F) where
F: FnMut(T, T) -> T,
Apply the function f
to each channel of this pixel and
other
pairwise. Works in-place. Read more
sourcefn blend(&mut self, other: &Rgb<T>)
fn blend(&mut self, other: &Rgb<T>)
Blend the color of a given pixel into ourself, taking into account alpha channels
sourcefn channel_count() -> u8
fn channel_count() -> u8
please use CHANNEL_COUNT associated constant
Returns the number of channels of this pixel type.
sourcefn color_model() -> &'static str
fn color_model() -> &'static str
please use COLOR_MODEL associated constant
sourcefn color_type() -> ColorType
fn color_type() -> ColorType
please use COLOR_TYPE associated constant
Returns the ColorType for this pixel format
sourcefn map_without_alpha<F>(&self, f: F) -> Self where
F: FnMut(Self::Subpixel) -> Self::Subpixel,
fn map_without_alpha<F>(&self, f: F) -> Self where
F: FnMut(Self::Subpixel) -> Self::Subpixel,
Apply the function f
to each channel except the alpha channel.
impl<T: Copy + Primitive> Copy for Rgb<T>
impl<T: Eq + Primitive> Eq for Rgb<T>
impl<T: Primitive> StructuralEq for Rgb<T>
impl<T: Primitive> StructuralPartialEq for Rgb<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Rgb<T> where
T: RefUnwindSafe,
impl<T> Send for Rgb<T> where
T: Send,
impl<T> Sync for Rgb<T> where
T: Sync,
impl<T> Unpin for Rgb<T> where
T: Unpin,
impl<T> UnwindSafe for Rgb<T> where
T: UnwindSafe,
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> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more