Struct lodepng::RGB
[−]
[src]
#[repr(C)]pub struct RGB<ComponentType> { pub r: ComponentType, pub g: ComponentType, pub b: ComponentType, }
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> RGB<T> where
T: Clone,
[src]
T: Clone,
fn new(r: T, g: T, b: T) -> RGB<T>
[src]
Convenience function for creating a new pixel
fn iter(&self) -> Cloned<Iter<T>>
[src]
Iterate over color components (R, G, and B)
fn alpha(&self, a: T) -> RGBA<T, T>
[src]
fn new_alpha<A>(&self, a: A) -> RGBA<T, A>
[src]
Trait Implementations
impl<T> ComponentSlice<T> for RGB<T>
[src]
impl<ComponentType> Ord for RGB<ComponentType> where
ComponentType: Ord,
[src]
ComponentType: Ord,
impl<ComponentType> Hash for RGB<ComponentType> where
ComponentType: Hash,
[src]
ComponentType: Hash,
fn hash<__HComponentType>(&self, __arg_0: &mut __HComponentType) where
__HComponentType: Hasher,
[src]
__HComponentType: Hasher,
impl<ComponentType> Copy for RGB<ComponentType> where
ComponentType: Copy,
[src]
ComponentType: Copy,
impl<ComponentType> Clone for RGB<ComponentType> where
ComponentType: Clone,
[src]
ComponentType: Clone,
fn clone(&self) -> RGB<ComponentType>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<ComponentType> Eq for RGB<ComponentType> where
ComponentType: Eq,
[src]
ComponentType: Eq,
impl From<RGB<i16>> for RGB<f64>
[src]
impl From<RGB<u8>> for RGB<i16>
[src]
impl From<RGB<f32>> for RGB<f64>
[src]
impl From<RGB<u16>> for RGB<i32>
[src]
impl From<RGB<i16>> for RGB<f32>
[src]
impl From<RGB<u16>> for RGB<f32>
[src]
impl From<RGB<u8>> for RGB<f64>
[src]
impl From<RGB<u8>> for RGB<f32>
[src]
impl From<RGB<i32>> for RGB<f64>
[src]
impl From<RGB<u16>> for RGB<f64>
[src]
impl<T> From<BGR<T>> for RGB<T>
[src]
impl<ComponentType> PartialEq<RGB<ComponentType>> for RGB<ComponentType> where
ComponentType: PartialEq<ComponentType>,
[src]
ComponentType: PartialEq<ComponentType>,
fn eq(&self, __arg_0: &RGB<ComponentType>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &RGB<ComponentType>) -> bool
[src]
This method tests for !=
.
impl<T> Add<T> for RGB<T> where
T: Copy + Add<T, Output = T> + Clone + Add<T>,
[src]
T: Copy + Add<T, Output = T> + Clone + Add<T>,
impl<T> Add<RGB<T>> for RGB<T> where
T: Add<T>,
[src]
T: Add<T>,
type Output = RGB<<T as Add<T>>::Output>
fn add(self, other: RGB<T>) -> <RGB<T> as Add<RGB<T>>>::Output
[src]
impl<ComponentType> Debug for RGB<ComponentType> where
ComponentType: Debug,
[src]
ComponentType: Debug,
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl<T> Mul<T> for RGB<T> where
T: Copy + Mul<T, Output = T> + Clone + Mul<T>,
[src]
T: Copy + Mul<T, Output = T> + Clone + Mul<T>,
impl<T> FromIterator<T> for RGB<T>
[src]
fn from_iter<I>(into_iter: I) -> RGB<T> where
I: IntoIterator<Item = T>,
[src]
I: IntoIterator<Item = T>,
Takes exactly 3 elements from the iterator and creates a new instance. Panics if there are fewer elements in the iterator.
impl<T> Display for RGB<T> where
T: Display,
[src]
T: Display,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<T> Sub<RGB<T>> for RGB<T> where
T: Sub<T>,
[src]
T: Sub<T>,
type Output = RGB<<T as Sub<T>>::Output>
fn sub(self, other: RGB<T>) -> <RGB<T> as Sub<RGB<T>>>::Output
[src]
impl<ComponentType> Default for RGB<ComponentType> where
ComponentType: Default,
[src]
ComponentType: Default,
impl<T, B> ComponentMap<RGB<B>, T, B> for RGB<T> where
T: Copy,
[src]
T: Copy,
impl<ComponentType> PartialOrd<RGB<ComponentType>> for RGB<ComponentType> where
ComponentType: PartialOrd<ComponentType>,
[src]
ComponentType: PartialOrd<ComponentType>,