[−][src]Struct rgb::RGB
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
Methods
impl<T: Clone> RGB<T>
[src]
impl<T: Clone> RGB<T>
pub fn new(r: T, g: T, b: T) -> Self | [src] |
Convenience function for creating a new pixel
pub fn iter(&self) -> Cloned<Iter<T>> | [src] |
Iterate over color components (R, G, and B)
pub fn alpha(&self, a: T) -> RGBA<T> | [src] |
pub fn new_alpha<A>(&self, a: A) -> RGBA<T, A> | [src] |
Trait Implementations
impl<T> ComponentSlice<T> for RGB<T>
[src]
impl<T> ComponentSlice<T> for RGB<T>
fn as_slice(&self) -> &[T] | [src] |
fn as_mut_slice(&mut self) -> &mut [T] | [src] |
impl<T: Copy, B> ComponentMap<RGB<B>, T, B> for RGB<T>
[src]
impl<T: Copy, B> ComponentMap<RGB<B>, T, B> for RGB<T>
impl<T> AsPixels<RGB<T>> for [T]
[src]
impl<T> AsPixels<RGB<T>> for [T]
impl<ComponentType: Clone> Clone for RGB<ComponentType>
[src]
impl<ComponentType: Clone> Clone for RGB<ComponentType>
fn clone(&self) -> RGB<ComponentType> | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl<ComponentType: Copy> Copy for RGB<ComponentType>
[src]
impl<ComponentType: Copy> Copy for RGB<ComponentType>
impl<ComponentType: Debug> Debug for RGB<ComponentType>
[src]
impl<ComponentType: Debug> Debug for RGB<ComponentType>
impl<T: Display> Display for RGB<T>
[src]
impl<T: Display> Display for RGB<T>
impl<ComponentType: PartialEq> PartialEq<RGB<ComponentType>> for RGB<ComponentType>
[src]
impl<ComponentType: PartialEq> PartialEq<RGB<ComponentType>> for RGB<ComponentType>
fn eq(&self, other: &RGB<ComponentType>) -> bool | [src] |
fn ne(&self, other: &RGB<ComponentType>) -> bool | [src] |
impl<ComponentType: Eq> Eq for RGB<ComponentType>
[src]
impl<ComponentType: Eq> Eq for RGB<ComponentType>
impl<ComponentType: Ord> Ord for RGB<ComponentType>
[src]
impl<ComponentType: Ord> Ord for RGB<ComponentType>
fn cmp(&self, other: &RGB<ComponentType>) -> Ordering | [src] |
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
impl<ComponentType: PartialOrd> PartialOrd<RGB<ComponentType>> for RGB<ComponentType>
[src]
impl<ComponentType: PartialOrd> PartialOrd<RGB<ComponentType>> for RGB<ComponentType>
fn partial_cmp(&self, other: &RGB<ComponentType>) -> Option<Ordering> | [src] |
fn lt(&self, other: &RGB<ComponentType>) -> bool | [src] |
fn le(&self, other: &RGB<ComponentType>) -> bool | [src] |
fn gt(&self, other: &RGB<ComponentType>) -> bool | [src] |
fn ge(&self, other: &RGB<ComponentType>) -> bool | [src] |
impl<T: Copy> From<RGB<T>> for RGBA<T, u8>
[src]
impl<T: Copy> From<RGB<T>> for RGBA<T, u8>
Assumes 255 is opaque
impl<T: Copy> From<RGB<T>> for BGRA<T, u8>
[src]
impl<T: Copy> From<RGB<T>> for BGRA<T, u8>
Assumes 255 is opaque
impl<T: Copy> From<RGB<T>> for RGBA<T, u16>
[src]
impl<T: Copy> From<RGB<T>> for RGBA<T, u16>
Assumes 65535 is opaque
impl<T: Copy> From<RGB<T>> for BGRA<T, u16>
[src]
impl<T: Copy> From<RGB<T>> for BGRA<T, u16>
Assumes 255 is opaque
impl<T: Copy> From<[T; 3]> for RGB<T>
[src]
impl<T: Copy> From<[T; 3]> for RGB<T>
impl<T> From<(T, T, T)> for RGB<T>
[src]
impl<T> From<(T, T, T)> for RGB<T>
impl From<RGB<u8>> for RGB<i16>
[src]
impl From<RGB<u8>> for RGB<i16>
impl From<RGB<u16>> for RGB<i32>
[src]
impl From<RGB<u16>> for RGB<i32>
impl From<RGB<u8>> for RGB<f32>
[src]
impl From<RGB<u8>> for RGB<f32>
impl From<RGB<u8>> for RGB<f64>
[src]
impl From<RGB<u8>> for RGB<f64>
impl From<RGB<u16>> for RGB<f32>
[src]
impl From<RGB<u16>> for RGB<f32>
impl From<RGB<u16>> for RGB<f64>
[src]
impl From<RGB<u16>> for RGB<f64>
impl From<RGB<i16>> for RGB<f32>
[src]
impl From<RGB<i16>> for RGB<f32>
impl From<RGB<i16>> for RGB<f64>
[src]
impl From<RGB<i16>> for RGB<f64>
impl From<RGB<i32>> for RGB<f64>
[src]
impl From<RGB<i32>> for RGB<f64>
impl From<RGB<f32>> for RGB<f64>
[src]
impl From<RGB<f32>> for RGB<f64>
impl<T: Clone> From<Gray<T>> for RGB<T>
[src]
impl<T: Clone> From<Gray<T>> for RGB<T>
impl<T> From<RGB<T>> for BGR<T>
[src]
impl<T> From<RGB<T>> for BGR<T>
impl<T> From<BGR<T>> for RGB<T>
[src]
impl<T> From<BGR<T>> for RGB<T>
impl<ComponentType: Hash> Hash for RGB<ComponentType>
[src]
impl<ComponentType: Hash> Hash for RGB<ComponentType>
fn hash<__HComponentType: Hasher>(&self, state: &mut __HComponentType) | [src] |
fn hash_slice<H>(data: &[Self], state: &mut H) where | 1.3.0 [src] |
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: Add> Add<RGB<T>> for RGB<T>
[src]
impl<T: Add> Add<RGB<T>> for RGB<T>
px + px
type Output = RGB<<T as Add>::Output>
The resulting type after applying the +
operator.
fn add(self, other: RGB<T>) -> Self::Output | [src] |
impl<T: Clone + Copy + Add> Add<T> for RGB<T> where
T: Add<Output = T>,
[src]
impl<T: Clone + Copy + Add> Add<T> for RGB<T> where
T: Add<Output = T>,
px + 1
type Output = RGB<T>
The resulting type after applying the +
operator.
fn add(self, r: T) -> Self::Output | [src] |
impl<T: Sub> Sub<RGB<T>> for RGB<T>
[src]
impl<T: Sub> Sub<RGB<T>> for RGB<T>
px - px
type Output = RGB<<T as Sub>::Output>
The resulting type after applying the -
operator.
fn sub(self, other: RGB<T>) -> Self::Output | [src] |
impl<T: Clone + Copy + Mul> Mul<T> for RGB<T> where
T: Mul<Output = T>,
[src]
impl<T: Clone + Copy + Mul> Mul<T> for RGB<T> where
T: Mul<Output = T>,
px * 1
type Output = RGB<T>
The resulting type after applying the *
operator.
fn mul(self, r: T) -> Self::Output | [src] |
impl<T> FromIterator<T> for RGB<T>
[src]
impl<T> FromIterator<T> for RGB<T>
fn from_iter<I: IntoIterator<Item = T>>(into_iter: I) -> Self | [src] |
Takes exactly 3 elements from the iterator and creates a new instance. Panics if there are fewer elements in the iterator.
impl<T> AsRef<[T]> for RGB<T>
[src]
impl<T> AsRef<[T]> for RGB<T>
impl<T> AsMut<[T]> for RGB<T>
[src]
impl<T> AsMut<[T]> for RGB<T>
impl<T> Into<[T; 3]> for RGB<T>
[src]
impl<T> Into<[T; 3]> for RGB<T>
impl<T> Into<(T, T, T)> for RGB<T>
[src]
impl<T> Into<(T, T, T)> for RGB<T>
impl<ComponentType: Default> Default for RGB<ComponentType>
[src]
impl<ComponentType: Default> Default for RGB<ComponentType>
Auto Trait Implementations
impl<ComponentType> Send for RGB<ComponentType> where
ComponentType: Send,
impl<ComponentType> Send for RGB<ComponentType> where
ComponentType: Send,
impl<ComponentType> Sync for RGB<ComponentType> where
ComponentType: Sync,
impl<ComponentType> Sync for RGB<ComponentType> where
ComponentType: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |