#[repr(C)]pub struct Grey<ComponentType>(pub ComponentType);
Expand description
Grayscale. Use .0
or *
(deref) to access the value.
Tuple Fields§
§0: ComponentType
brightness level
Implementations§
Trait Implementations§
source§impl<T> AddAssign<Gray<T>> for Gray<T>where
T: Add<T, Output = T> + Copy,
impl<T> AddAssign<Gray<T>> for Gray<T>where T: Add<T, Output = T> + Copy,
px + px
source§fn add_assign(&mut self, other: Gray<T>)
fn add_assign(&mut self, other: Gray<T>)
Performs the
+=
operation. Read moresource§impl<T> AddAssign<T> for Gray<T>where
T: Copy + Add<T, Output = T>,
impl<T> AddAssign<T> for Gray<T>where T: Copy + Add<T, Output = 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> AsPixels<Gray<T>> for [T]
impl<T> AsPixels<Gray<T>> for [T]
source§fn 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
source§fn 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
source§impl<T> ComponentSlice<T> for Gray<T>
impl<T> ComponentSlice<T> for Gray<T>
source§impl<T> DivAssign<T> for Gray<T>where
T: Copy + Div<T, Output = T>,
impl<T> DivAssign<T> for Gray<T>where T: Copy + Div<T, Output = 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> MulAssign<Gray<T>> for Gray<T>where
T: Mul<T, Output = T> + Copy,
impl<T> MulAssign<Gray<T>> for Gray<T>where T: Mul<T, Output = T> + Copy,
px * px
source§fn mul_assign(&mut self, other: Gray<T>)
fn mul_assign(&mut self, other: Gray<T>)
Performs the
*=
operation. Read moresource§impl<T> MulAssign<T> for Gray<T>where
T: Copy + Mul<T, Output = T>,
impl<T> MulAssign<T> for Gray<T>where T: Copy + Mul<T, Output = T>,
px * 1
source§fn mul_assign(&mut self, r: T)
fn mul_assign(&mut self, r: T)
Performs the
*=
operation. Read moresource§impl<ComponentType> Ord for Gray<ComponentType>where
ComponentType: Ord,
impl<ComponentType> Ord for Gray<ComponentType>where ComponentType: Ord,
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<ComponentType> PartialEq<Gray<ComponentType>> for Gray<ComponentType>where
ComponentType: PartialEq<ComponentType>,
impl<ComponentType> PartialEq<Gray<ComponentType>> for Gray<ComponentType>where ComponentType: PartialEq<ComponentType>,
source§impl<ComponentType> PartialOrd<Gray<ComponentType>> for Gray<ComponentType>where
ComponentType: PartialOrd<ComponentType>,
impl<ComponentType> PartialOrd<Gray<ComponentType>> for Gray<ComponentType>where ComponentType: PartialOrd<ComponentType>,
1.0.0 · source§fn 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 moresource§impl<T> SubAssign<Gray<T>> for Gray<T>where
T: Sub<T, Output = T> + Copy,
impl<T> SubAssign<Gray<T>> for Gray<T>where T: Sub<T, Output = T> + Copy,
px - px
source§fn sub_assign(&mut self, other: Gray<T>)
fn sub_assign(&mut self, other: Gray<T>)
Performs the
-=
operation. Read moresource§impl<T> SubAssign<T> for Gray<T>where
T: Copy + Sub<T, Output = T>,
impl<T> SubAssign<T> for Gray<T>where T: Copy + Sub<T, Output = T>,
px - 1
source§fn sub_assign(&mut self, r: T)
fn sub_assign(&mut self, r: T)
Performs the
-=
operation. Read moreimpl<ComponentType> Copy for Gray<ComponentType>where ComponentType: Copy,
impl<ComponentType> Eq for Gray<ComponentType>where ComponentType: Eq,
impl<T> Pod for Gray<T>where T: Pod,
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§
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§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
.§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
.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more