#[repr(C)]pub struct GrayAlpha<ComponentType, AlphaComponentType = ComponentType>(pub ComponentType, pub AlphaComponentType);
Expand description
Grayscale with alpha. Use .0
/.1
to access.
Tuple Fields§
§0: ComponentType
brightness level
1: AlphaComponentType
alpha
Implementations§
source§impl<T: Copy, A: Clone> GrayAlpha<T, A>
impl<T: Copy, A: Clone> GrayAlpha<T, A>
Trait Implementations§
source§impl<T> AddAssign<T> for GrayAlpha<T>
impl<T> AddAssign<T> for GrayAlpha<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, A> AddAssign for GrayAlpha<T, A>
impl<T, A> AddAssign for GrayAlpha<T, A>
px + px
source§fn add_assign(&mut self, other: GrayAlpha<T, A>)
fn add_assign(&mut self, other: GrayAlpha<T, A>)
Performs the
+=
operation. Read moresource§impl<T> AsPixels<GrayAlpha<T>> for [T]
impl<T> AsPixels<GrayAlpha<T>> for [T]
source§fn as_pixels(&self) -> &[GrayAlpha<T>]
fn as_pixels(&self) -> &[GrayAlpha<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 [GrayAlpha<T>]
fn as_pixels_mut(&mut self) -> &mut [GrayAlpha<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<ComponentType: Clone, AlphaComponentType: Clone> Clone for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType: Clone, AlphaComponentType: Clone> Clone for GrayAlpha<ComponentType, AlphaComponentType>
source§impl<T> ComponentSlice<T> for GrayAlpha<T>
impl<T> ComponentSlice<T> for GrayAlpha<T>
source§impl<ComponentType: Debug, AlphaComponentType: Debug> Debug for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType: Debug, AlphaComponentType: Debug> Debug for GrayAlpha<ComponentType, AlphaComponentType>
source§impl<ComponentType: Default, AlphaComponentType: Default> Default for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType: Default, AlphaComponentType: Default> Default for GrayAlpha<ComponentType, AlphaComponentType>
source§impl<T> DivAssign<T> for GrayAlpha<T>
impl<T> DivAssign<T> for GrayAlpha<T>
px * 1
source§fn div_assign(&mut self, r: T)
fn div_assign(&mut self, r: T)
Performs the
/=
operation. Read moresource§impl<ComponentType: Hash, AlphaComponentType: Hash> Hash for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType: Hash, AlphaComponentType: Hash> Hash for GrayAlpha<ComponentType, AlphaComponentType>
source§impl<T> MulAssign<T> for GrayAlpha<T>
impl<T> MulAssign<T> for GrayAlpha<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, AlphaComponentType: Ord> Ord for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType: Ord, AlphaComponentType: Ord> Ord for GrayAlpha<ComponentType, AlphaComponentType>
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, AlphaComponentType: PartialEq> PartialEq for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType: PartialEq, AlphaComponentType: PartialEq> PartialEq for GrayAlpha<ComponentType, AlphaComponentType>
source§impl<ComponentType: PartialOrd, AlphaComponentType: PartialOrd> PartialOrd for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType: PartialOrd, AlphaComponentType: PartialOrd> PartialOrd for GrayAlpha<ComponentType, AlphaComponentType>
source§fn partial_cmp(
&self,
other: &GrayAlpha<ComponentType, AlphaComponentType>
) -> Option<Ordering>
fn partial_cmp( &self, other: &GrayAlpha<ComponentType, AlphaComponentType> ) -> Option<Ordering>
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<T> for GrayAlpha<T>
impl<T> SubAssign<T> for GrayAlpha<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, A> SubAssign for GrayAlpha<T, A>
impl<T, A> SubAssign for GrayAlpha<T, A>
px - px
source§fn sub_assign(&mut self, other: GrayAlpha<T, A>)
fn sub_assign(&mut self, other: GrayAlpha<T, A>)
Performs the
-=
operation. Read moreimpl<ComponentType: Copy, AlphaComponentType: Copy> Copy for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType: Eq, AlphaComponentType: Eq> Eq for GrayAlpha<ComponentType, AlphaComponentType>
impl<T, A> Pod for GrayAlpha<T, A>
impl<ComponentType, AlphaComponentType> StructuralPartialEq for GrayAlpha<ComponentType, AlphaComponentType>
Auto Trait Implementations§
impl<ComponentType, AlphaComponentType> Freeze for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType, AlphaComponentType> RefUnwindSafe for GrayAlpha<ComponentType, AlphaComponentType>where
ComponentType: RefUnwindSafe,
AlphaComponentType: RefUnwindSafe,
impl<ComponentType, AlphaComponentType> Send for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType, AlphaComponentType> Sync for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType, AlphaComponentType> Unpin for GrayAlpha<ComponentType, AlphaComponentType>
impl<ComponentType, AlphaComponentType> UnwindSafe for GrayAlpha<ComponentType, AlphaComponentType>where
ComponentType: UnwindSafe,
AlphaComponentType: 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
source§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
.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
.