Struct resize::px::RGB [−][src]
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: ComponentTypeRed
g: ComponentTypeGreen
b: ComponentTypeBlue
Implementations
impl<T> RGB<T>[src]
pub const fn new(r: T, g: T, b: T) -> RGB<T>[src]
Convenience function for creating a new pixel The order of arguments is R,G,B
impl<T> RGB<T> where
T: Clone, [src]
T: Clone,
pub fn iter(&self) -> Cloned<Iter<'_, T>>[src]
Iterate over color components (R, G, and B)
pub fn alpha(&self, a: T) -> RGBA<T, T>[src]
Convenience function for converting to RGBA
pub fn new_alpha<A>(&self, a: A) -> RGBA<T, A>[src]
Convenience function for converting to RGBA with alpha channel of a different type than type of the pixels
Trait Implementations
impl<T> Add<RGB<T>> for RGB<T> where
T: Add<T>, [src]
T: Add<T>,
px + px
type Output = RGB<<T as Add<T>>::Output>
The resulting type after applying the + operator.
pub fn add(self, other: RGB<T>) -> <RGB<T> as Add<RGB<T>>>::Output[src]
impl<T> Add<T> for RGB<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
px + 1
type Output = RGB<T>
The resulting type after applying the + operator.
pub fn add(self, r: T) -> <RGB<T> as Add<T>>::Output[src]
impl<T> AddAssign<RGB<T>> for RGB<T> where
T: Add<T, Output = T> + Copy, [src]
T: Add<T, Output = T> + Copy,
px + px
pub fn add_assign(&mut self, other: RGB<T>)[src]
impl<T> AddAssign<T> for RGB<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
px + 1
pub fn add_assign(&mut self, r: T)[src]
impl<T> AsMut<[T]> for RGB<T>[src]
impl<T> AsRef<[T]> for RGB<T>[src]
impl<ComponentType> Clone for RGB<ComponentType> where
ComponentType: Clone, [src]
ComponentType: Clone,
impl<T, B> ComponentMap<RGB<B>, T, B> for RGB<T> where
T: Copy, [src]
T: Copy,
impl<T> ComponentSlice<T> for RGB<T>[src]
impl<ComponentType> Copy for RGB<ComponentType> where
ComponentType: Copy, [src]
ComponentType: Copy,
impl<ComponentType> Debug for RGB<ComponentType> where
ComponentType: Debug, [src]
ComponentType: Debug,
impl<ComponentType> Default for RGB<ComponentType> where
ComponentType: Default, [src]
ComponentType: Default,
impl<T> Display for RGB<T> where
T: Display, [src]
T: Display,
impl<T> Div<T> for RGB<T> where
T: Copy + Div<T, Output = T>, [src]
T: Copy + Div<T, Output = T>,
px / 1
type Output = RGB<T>
The resulting type after applying the / operator.
pub fn div(self, r: T) -> <RGB<T> as Div<T>>::Output[src]
impl<T> DivAssign<T> for RGB<T> where
T: Copy + Div<T, Output = T>, [src]
T: Copy + Div<T, Output = T>,
px * 1
pub fn div_assign(&mut self, r: T)[src]
impl<ComponentType> Eq for RGB<ComponentType> where
ComponentType: Eq, [src]
ComponentType: Eq,
impl<T> From<[T; 3]> for RGB<T> where
T: Copy, [src]
T: Copy,
impl<T> From<(T, T, T)> for RGB<T>[src]
impl<T> From<BGR<T>> for RGB<T>[src]
impl<T> From<Gray<T>> for RGB<T> where
T: Clone, [src]
T: Clone,
impl<T> From<RGB<T>> for RGBA<T, u16> where
T: Copy, [src]
T: Copy,
Assumes 65535 is opaque
impl<T> From<RGB<T>> for RGBA<T, u8> where
T: Copy, [src]
T: Copy,
Assumes 255 is opaque
impl From<RGB<f32>> for RGB<f64>[src]
impl From<RGB<i16>> for RGB<f64>[src]
impl From<RGB<i16>> for RGB<f32>[src]
impl From<RGB<i32>> for RGB<f64>[src]
impl From<RGB<u16>> for RGB<f32>[src]
impl From<RGB<u16>> for RGB<f64>[src]
impl From<RGB<u16>> for RGB<i32>[src]
impl From<RGB<u8>> for RGB<f32>[src]
impl From<RGB<u8>> for RGB<f64>[src]
impl From<RGB<u8>> for RGB<i16>[src]
impl<T> FromIterator<T> for RGB<T>[src]
pub 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<ComponentType> Hash for RGB<ComponentType> where
ComponentType: Hash, [src]
ComponentType: Hash,
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher, [src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<T> Into<[T; 3]> for RGB<T>[src]
impl<T> Into<(T, T, T)> for RGB<T>[src]
impl<T> LowerHex for RGB<T> where
T: LowerHex, [src]
T: LowerHex,
impl<T> Mul<T> for RGB<T> where
T: Copy + Mul<T, Output = T>, [src]
T: Copy + Mul<T, Output = T>,
px * 1
type Output = RGB<T>
The resulting type after applying the * operator.
pub fn mul(self, r: T) -> <RGB<T> as Mul<T>>::Output[src]
impl<T> MulAssign<T> for RGB<T> where
T: Copy + Mul<T, Output = T>, [src]
T: Copy + Mul<T, Output = T>,
px * 1
pub fn mul_assign(&mut self, r: T)[src]
impl<ComponentType> Ord for RGB<ComponentType> where
ComponentType: Ord, [src]
ComponentType: Ord,
pub fn cmp(&self, other: &RGB<ComponentType>) -> Ordering[src]
#[must_use]pub fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self1.50.0[src]
impl<ComponentType> PartialEq<RGB<ComponentType>> for RGB<ComponentType> where
ComponentType: PartialEq<ComponentType>, [src]
ComponentType: PartialEq<ComponentType>,
pub fn eq(&self, other: &RGB<ComponentType>) -> bool[src]
pub fn ne(&self, other: &RGB<ComponentType>) -> bool[src]
impl<ComponentType> PartialOrd<RGB<ComponentType>> for RGB<ComponentType> where
ComponentType: PartialOrd<ComponentType>, [src]
ComponentType: PartialOrd<ComponentType>,
pub fn partial_cmp(&self, other: &RGB<ComponentType>) -> Option<Ordering>[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<T> Pod for RGB<T> where
T: Pod, [src]
T: Pod,
impl<ComponentType> StructuralEq for RGB<ComponentType>[src]
impl<ComponentType> StructuralPartialEq for RGB<ComponentType>[src]
impl<T> Sub<RGB<T>> for RGB<T> where
T: Sub<T>, [src]
T: Sub<T>,
px - px
type Output = RGB<<T as Sub<T>>::Output>
The resulting type after applying the - operator.
pub fn sub(self, other: RGB<T>) -> <RGB<T> as Sub<RGB<T>>>::Output[src]
impl<T> Sub<T> for RGB<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
px - 1
type Output = RGB<<T as Sub<T>>::Output>
The resulting type after applying the - operator.
pub fn sub(self, r: T) -> <RGB<T> as Sub<T>>::Output[src]
impl<T> SubAssign<RGB<T>> for RGB<T> where
T: Sub<T, Output = T> + Copy, [src]
T: Sub<T, Output = T> + Copy,
px - px
pub fn sub_assign(&mut self, other: RGB<T>)[src]
impl<T> SubAssign<T> for RGB<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
px - 1
pub fn sub_assign(&mut self, r: T)[src]
impl<T> Sum<RGB<T>> for RGB<T> where
T: Default + Add<T, Output = T>, [src]
T: Default + Add<T, Output = T>,
impl<T> UpperHex for RGB<T> where
T: UpperHex, [src]
T: UpperHex,
impl<T> Zeroable for RGB<T> where
T: Zeroable, [src]
T: Zeroable,
Auto Trait Implementations
impl<ComponentType> RefUnwindSafe for RGB<ComponentType> where
ComponentType: RefUnwindSafe,
ComponentType: RefUnwindSafe,
impl<ComponentType> Send for RGB<ComponentType> where
ComponentType: Send,
ComponentType: Send,
impl<ComponentType> Sync for RGB<ComponentType> where
ComponentType: Sync,
ComponentType: Sync,
impl<ComponentType> Unpin for RGB<ComponentType> where
ComponentType: Unpin,
ComponentType: Unpin,
impl<ComponentType> UnwindSafe for RGB<ComponentType> where
ComponentType: UnwindSafe,
ComponentType: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> CallHasher for T where
T: Hash, [src]
T: Hash,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,