#[repr(C)]pub struct RGB<T> {
pub r: T,
pub g: T,
pub b: T,
}Expand description
Generic RGB pixel type (from rgb).
A Red + Green + Blue pixel.
§Examples
use rgb::Rgb;
let pixel: Rgb<u8> = Rgb { r: 0, g: 0, b: 0 };Fields§
§r: TRed Component
g: TGreen Component
b: TBlue Component
Implementations§
Trait Implementations§
Source§impl<T> AddAssign<T> for Rgb<T>
px + 1
impl<T> AddAssign<T> for Rgb<T>
px + 1
Source§fn add_assign(&mut self, r: T)
fn add_assign(&mut self, r: T)
Performs the
+= operation. Read moreSource§impl<T> AddAssign for Rgb<T>
px + px
impl<T> AddAssign for Rgb<T>
px + px
Source§fn add_assign(&mut self, other: Rgb<T>)
fn add_assign(&mut self, other: Rgb<T>)
Performs the
+= operation. Read moreSource§impl<T> AsPixels<Rgb<T>> for [T]
impl<T> AsPixels<Rgb<T>> for [T]
Source§fn as_pixels_mut(&mut self) -> &mut [Rgb<T>]
fn as_pixels_mut(&mut self) -> &mut [Rgb<T>]
Use
::bytemuck::cast_slice_mut() instead. Read moreSource§impl<T, B> ColorComponentMap<Rgb<B>, T, B> for Rgb<T>where
T: Copy,
impl<T, B> ColorComponentMap<Rgb<B>, T, B> for Rgb<T>where
T: Copy,
Source§impl<T> ComponentSlice<T> for Rgb<T>
impl<T> ComponentSlice<T> for Rgb<T>
Source§impl<T> DivAssign<T> for Rgb<T>
px * 1
impl<T> DivAssign<T> for Rgb<T>
px * 1
Source§fn div_assign(&mut self, r: T)
fn div_assign(&mut self, r: T)
Performs the
/= operation. Read moreSource§impl<T> FromIterator<T> for Rgb<T>
impl<T> FromIterator<T> for Rgb<T>
Source§fn from_iter<I>(into_iter: I) -> Rgb<T>where
I: IntoIterator<Item = T>,
fn from_iter<I>(into_iter: I) -> Rgb<T>where
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.
Source§impl<T> MulAssign<T> for Rgb<T>
px * 1
impl<T> MulAssign<T> for Rgb<T>
px * 1
Source§fn mul_assign(&mut self, r: T)
fn mul_assign(&mut self, r: T)
Performs the
*= operation. Read moreSource§impl<T> MulAssign for Rgb<T>
px * px
impl<T> MulAssign for Rgb<T>
px * px
Source§fn mul_assign(&mut self, other: Rgb<T>)
fn mul_assign(&mut self, other: Rgb<T>)
Performs the
*= operation. Read moreSource§impl<T> Ord for Rgb<T>where
T: Ord,
impl<T> Ord for Rgb<T>where
T: Ord,
Source§impl<T> PartialOrd for Rgb<T>where
T: PartialOrd,
impl<T> PartialOrd for Rgb<T>where
T: PartialOrd,
Source§impl<T> SubAssign<T> for Rgb<T>
px - 1
impl<T> SubAssign<T> for Rgb<T>
px - 1
Source§fn sub_assign(&mut self, r: T)
fn sub_assign(&mut self, r: T)
Performs the
-= operation. Read moreSource§impl<T> SubAssign for Rgb<T>
px - px
impl<T> SubAssign for Rgb<T>
px - px
Source§fn sub_assign(&mut self, other: Rgb<T>)
fn sub_assign(&mut self, other: Rgb<T>)
Performs the
-= operation. Read moreimpl<T> Copy for Rgb<T>where
T: Copy,
impl<T> Eq for Rgb<T>where
T: Eq,
impl<T> Pod for Rgb<T>where
T: Pod,
Available on crate feature
as-bytes only.impl<T> StructuralPartialEq for Rgb<T>
Auto Trait Implementations§
impl<T> Freeze for Rgb<T>where
T: Freeze,
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§
Source§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8] ⓘ
Source§impl<T, U> AsMutByteSlice<T> for U
impl<T, U> AsMutByteSlice<T> for U
fn as_mut_byte_slice(&mut self) -> &mut [u8] ⓘ
Source§impl<U> AsMutSliceOf for U
impl<U> AsMutSliceOf for U
fn as_mut_slice_of<T>(&mut self) -> Result<&mut [T], Error>where
T: FromByteSlice,
Source§impl<U> AsSliceOf for U
impl<U> AsSliceOf for U
fn as_slice_of<T>(&self) -> Result<&[T], Error>where
T: FromByteSlice,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more