#[repr(C)]pub struct RGB<ComponentType> {
pub r: ComponentType,
pub g: ComponentType,
pub b: ComponentType,
}
Expand description
The RGB pixel
The component type can be u8
(aliased as RGB8
), u16
(aliased as RGB16
),
or any other type (but simple copyable types are recommended.)
Fields
r: ComponentType
Red
g: ComponentType
Green
b: ComponentType
Blue
Implementations
Trait Implementations
sourceimpl<T> AddAssign<RGB<T>> for RGB<T> where
T: Add<Output = T> + Copy,
impl<T> AddAssign<RGB<T>> for RGB<T> where
T: Add<Output = T> + Copy,
px + px
sourcefn add_assign(&mut self, other: RGB<T>)
fn add_assign(&mut self, other: RGB<T>)
Performs the +=
operation. Read more
sourceimpl<T> AddAssign<T> for RGB<T> where
T: Copy + Add<Output = T>,
impl<T> AddAssign<T> for RGB<T> where
T: Copy + Add<Output = T>,
px + 1
sourcefn add_assign(&mut self, r: T)
fn add_assign(&mut self, r: T)
Performs the +=
operation. Read more
sourceimpl<T> AsPixels<RGB<T>> for [T]
impl<T> AsPixels<RGB<T>> for [T]
sourceimpl<T: Copy, B> ColorComponentMap<RGB<B>, T, B> for RGB<T>
impl<T: Copy, B> ColorComponentMap<RGB<B>, T, B> for RGB<T>
sourceimpl<T: Copy, B> ComponentMap<RGB<B>, T, B> for RGB<T>
impl<T: Copy, B> ComponentMap<RGB<B>, T, B> for RGB<T>
sourceimpl<T> ComponentSlice<T> for RGB<T>
impl<T> ComponentSlice<T> for RGB<T>
sourceimpl<T> DivAssign<T> for RGB<T> where
T: Copy + Div<Output = T>,
impl<T> DivAssign<T> for RGB<T> where
T: Copy + Div<Output = T>,
px * 1
sourcefn div_assign(&mut self, r: T)
fn div_assign(&mut self, r: T)
Performs the /=
operation. Read more
sourceimpl<T> FromIterator<T> for RGB<T>
impl<T> FromIterator<T> for RGB<T>
sourcefn from_iter<I: IntoIterator<Item = T>>(into_iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(into_iter: I) -> Self
Takes exactly 3 elements from the iterator and creates a new instance. Panics if there are fewer elements in the iterator.
sourceimpl<T> MulAssign<RGB<T>> for RGB<T> where
T: Mul<Output = T> + Copy,
impl<T> MulAssign<RGB<T>> for RGB<T> where
T: Mul<Output = T> + Copy,
px * px
sourcefn mul_assign(&mut self, other: RGB<T>)
fn mul_assign(&mut self, other: RGB<T>)
Performs the *=
operation. Read more
sourceimpl<T> MulAssign<T> for RGB<T> where
T: Copy + Mul<Output = T>,
impl<T> MulAssign<T> for RGB<T> where
T: Copy + Mul<Output = T>,
px * 1
sourcefn mul_assign(&mut self, r: T)
fn mul_assign(&mut self, r: T)
Performs the *=
operation. Read more
sourceimpl<ComponentType: Ord> Ord for RGB<ComponentType>
impl<ComponentType: Ord> Ord for RGB<ComponentType>
sourceimpl<ComponentType: PartialOrd> PartialOrd<RGB<ComponentType>> for RGB<ComponentType>
impl<ComponentType: PartialOrd> PartialOrd<RGB<ComponentType>> for RGB<ComponentType>
sourcefn partial_cmp(&self, other: &RGB<ComponentType>) -> Option<Ordering>
fn partial_cmp(&self, other: &RGB<ComponentType>) -> 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
sourceimpl<T> SubAssign<RGB<T>> for RGB<T> where
T: Sub<Output = T> + Copy,
impl<T> SubAssign<RGB<T>> for RGB<T> where
T: Sub<Output = T> + Copy,
px - px
sourcefn sub_assign(&mut self, other: RGB<T>)
fn sub_assign(&mut self, other: RGB<T>)
Performs the -=
operation. Read more
sourceimpl<T> SubAssign<T> for RGB<T> where
T: Copy + Sub<Output = T>,
impl<T> SubAssign<T> for RGB<T> where
T: Copy + Sub<Output = T>,
px - 1
sourcefn sub_assign(&mut self, r: T)
fn sub_assign(&mut self, r: T)
Performs the -=
operation. Read more
impl<ComponentType: Copy> Copy for RGB<ComponentType>
impl<ComponentType: Eq> Eq for RGB<ComponentType>
impl<ComponentType> StructuralEq for RGB<ComponentType>
impl<ComponentType> StructuralPartialEq for RGB<ComponentType>
Auto Trait Implementations
impl<ComponentType> RefUnwindSafe for RGB<ComponentType> where
ComponentType: RefUnwindSafe,
impl<ComponentType> Send for RGB<ComponentType> where
ComponentType: Send,
impl<ComponentType> Sync for RGB<ComponentType> where
ComponentType: Sync,
impl<ComponentType> Unpin for RGB<ComponentType> where
ComponentType: Unpin,
impl<ComponentType> UnwindSafe for RGB<ComponentType> where
ComponentType: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more