#[repr(C)]pub struct Gray<ComponentType>(pub ComponentType);
Expand description
Grayscale. Use .0
or *
(deref) to access the value.
Tuple Fields
0: ComponentType
brightness level
Implementations
Trait Implementations
sourceimpl<T> AddAssign<Gray<T>> for Gray<T>where
T: Add<Output = T> + Copy,
impl<T> AddAssign<Gray<T>> for Gray<T>where
T: Add<Output = T> + Copy,
px + px
sourcefn add_assign(&mut self, other: Gray<T>)
fn add_assign(&mut self, other: Gray<T>)
Performs the
+=
operation. Read moresourceimpl<T> AddAssign<T> for Gray<T>where
T: Copy + Add<Output = T>,
impl<T> AddAssign<T> for Gray<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 moresourceimpl<T> AsPixels<Gray<T>> for [T]
impl<T> AsPixels<Gray<T>> for [T]
sourcefn as_pixels(&self) -> &[Gray<T>]
fn as_pixels(&self) -> &[Gray<T>]
Reinterpret the slice as a read-only/shared slice of pixels.
Multiple consecutive elements in the slice are intepreted as a single pixel
(depending on format, e.g. 3 for RGB, 4 for RGBA). Read more
sourcefn as_pixels_mut(&mut self) -> &mut [Gray<T>]
fn as_pixels_mut(&mut self) -> &mut [Gray<T>]
Reinterpret the slice as a mutable/exclusive slice of pixels.
Multiple consecutive elements in the slice are intepreted as a single pixel
(depending on format, e.g. 3 for RGB, 4 for RGBA). Read more
sourceimpl<T: Copy, B> ColorComponentMap<Gray<B>, T, B> for Gray<T>
impl<T: Copy, B> ColorComponentMap<Gray<B>, T, B> for Gray<T>
sourceimpl<T: Copy, B> ComponentMap<Gray<B>, T, B> for Gray<T>
impl<T: Copy, B> ComponentMap<Gray<B>, T, B> for Gray<T>
sourceimpl<T> ComponentSlice<T> for Gray<T>
impl<T> ComponentSlice<T> for Gray<T>
sourceimpl<'de, ComponentType> Deserialize<'de> for Gray<ComponentType>where
ComponentType: Deserialize<'de>,
impl<'de, ComponentType> Deserialize<'de> for Gray<ComponentType>where
ComponentType: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T> DivAssign<T> for Gray<T>where
T: Copy + Div<Output = T>,
impl<T> DivAssign<T> for Gray<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 moresourceimpl<T> MulAssign<Gray<T>> for Gray<T>where
T: Mul<Output = T> + Copy,
impl<T> MulAssign<Gray<T>> for Gray<T>where
T: Mul<Output = T> + Copy,
px * px
sourcefn mul_assign(&mut self, other: Gray<T>)
fn mul_assign(&mut self, other: Gray<T>)
Performs the
*=
operation. Read moresourceimpl<T> MulAssign<T> for Gray<T>where
T: Copy + Mul<Output = T>,
impl<T> MulAssign<T> for Gray<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 moresourceimpl<ComponentType: Ord> Ord for Gray<ComponentType>
impl<ComponentType: Ord> Ord for Gray<ComponentType>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<ComponentType: PartialEq> PartialEq<Gray<ComponentType>> for Gray<ComponentType>
impl<ComponentType: PartialEq> PartialEq<Gray<ComponentType>> for Gray<ComponentType>
sourceimpl<ComponentType: PartialOrd> PartialOrd<Gray<ComponentType>> for Gray<ComponentType>
impl<ComponentType: PartialOrd> PartialOrd<Gray<ComponentType>> for Gray<ComponentType>
sourcefn partial_cmp(&self, other: &Gray<ComponentType>) -> Option<Ordering>
fn partial_cmp(&self, other: &Gray<ComponentType>) -> Option<Ordering>
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 moresourceimpl<T> SubAssign<Gray<T>> for Gray<T>where
T: Sub<Output = T> + Copy,
impl<T> SubAssign<Gray<T>> for Gray<T>where
T: Sub<Output = T> + Copy,
px - px
sourcefn sub_assign(&mut self, other: Gray<T>)
fn sub_assign(&mut self, other: Gray<T>)
Performs the
-=
operation. Read moresourceimpl<T> SubAssign<T> for Gray<T>where
T: Copy + Sub<Output = T>,
impl<T> SubAssign<T> for Gray<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 moreimpl<ComponentType: Copy> Copy for Gray<ComponentType>
impl<ComponentType: Eq> Eq for Gray<ComponentType>
impl<ComponentType> StructuralEq for Gray<ComponentType>
impl<ComponentType> StructuralPartialEq for Gray<ComponentType>
Auto Trait Implementations
impl<ComponentType> RefUnwindSafe for Gray<ComponentType>where
ComponentType: RefUnwindSafe,
impl<ComponentType> Send for Gray<ComponentType>where
ComponentType: Send,
impl<ComponentType> Sync for Gray<ComponentType>where
ComponentType: Sync,
impl<ComponentType> Unpin for Gray<ComponentType>where
ComponentType: Unpin,
impl<ComponentType> UnwindSafe for Gray<ComponentType>where
ComponentType: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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