#[repr(C)]pub struct GrayAlpha_v08<T, A = T>(pub T, pub A);Expand description
A pixel for grayscale value + alpha components (rgb crate v0.8)
Through a Deref hack it renames the fields from .0 and .1
to .v (value) and .a (alpha)
Tuple Fields§
§0: T👎Deprecated: Please use the .v field instaed (it’s available through the magic of Deref to GrayA type)
Grayscale Component
This field has been renamed to .v
1: A👎Deprecated: Please use the .a field instead (it’s available through the magic of Deref to GrayA type)
Alpha Component. This field has been renamed to .a.
Implementations§
Source§impl<T: Copy> GrayAlpha_v08<T>
impl<T: Copy> GrayAlpha_v08<T>
Source§impl<T: Copy> GrayAlpha_v08<T>
impl<T: Copy> GrayAlpha_v08<T>
Sourcepub const fn new(value: T, alpha: T) -> Self
pub const fn new(value: T, alpha: T) -> Self
Creates a new GrayAlpha_v08 pixel type from its components.
Alternatively, you can use struct literal syntax to create the new pixel type:
use rgb::GrayAlpha_v08;
let pixel = GrayAlpha_v08 {0 : value, 1 : alpha};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>
px + 1
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>
px + px
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_v08<T>> for [T]
impl<T> AsPixels<GrayAlpha_v08<T>> for [T]
Source§fn as_pixels_mut(&mut self) -> &mut [GrayAlpha<T>]
fn as_pixels_mut(&mut self) -> &mut [GrayAlpha<T>]
Use
::bytemuck::cast_slice_mut() instead. Read moreSource§impl<T: Clone, A: Clone> Clone for GrayAlpha_v08<T, A>
impl<T: Clone, A: Clone> Clone for GrayAlpha_v08<T, A>
Source§fn clone(&self) -> GrayAlpha_v08<T, A>
fn clone(&self) -> GrayAlpha_v08<T, A>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Copy, A: Copy, B> ColorComponentMap<GrayAlpha_v08<B, A>, T, B> for GrayAlpha<T, A>
impl<T: Copy, A: Copy, B> ColorComponentMap<GrayAlpha_v08<B, A>, T, B> for GrayAlpha<T, A>
Source§impl<T: Copy, B> ComponentMap<GrayAlpha_v08<B>, T, B> for GrayAlpha<T>
impl<T: Copy, B> ComponentMap<GrayAlpha_v08<B>, T, B> for GrayAlpha<T>
Source§impl<T> ComponentSlice<T> for GrayAlpha<T>
impl<T> ComponentSlice<T> for GrayAlpha<T>
Source§impl<T: Default, A: Default> Default for GrayAlpha_v08<T, A>
impl<T: Default, A: Default> Default for GrayAlpha_v08<T, A>
Source§fn default() -> GrayAlpha_v08<T, A>
fn default() -> GrayAlpha_v08<T, A>
Returns the “default value” for a type. Read more
Source§impl<T, A> Deref for GrayAlpha_v08<T, A>
impl<T, A> Deref for GrayAlpha_v08<T, A>
Source§impl<T, A> DerefMut for GrayAlpha_v08<T, A>
impl<T, A> DerefMut for GrayAlpha_v08<T, A>
Source§impl<T> DivAssign<T> for GrayAlpha<T>
px * 1
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<T> MulAssign<T> for GrayAlpha<T>
px * 1
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<T: Ord, A: Ord> Ord for GrayAlpha_v08<T, A>
impl<T: Ord, A: Ord> Ord for GrayAlpha_v08<T, A>
Source§fn cmp(&self, other: &GrayAlpha_v08<T, A>) -> Ordering
fn cmp(&self, other: &GrayAlpha_v08<T, A>) -> Ordering
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<T: PartialOrd, A: PartialOrd> PartialOrd for GrayAlpha_v08<T, A>
impl<T: PartialOrd, A: PartialOrd> PartialOrd for GrayAlpha_v08<T, A>
Source§impl<T> SubAssign<T> for GrayAlpha<T>
px - 1
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>
px - px
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 moreSource§impl<T, A> Zeroable for GrayAlpha<T, A>
This is unsound. You can disable as-bytes feature, enable bytemuck, and use bytemuck::cast_slice() instead.
impl<T, A> Zeroable for GrayAlpha<T, A>
This is unsound. You can disable as-bytes feature, enable bytemuck, and use bytemuck::cast_slice() instead.
impl<T: Copy, A: Copy> Copy for GrayAlpha_v08<T, A>
impl<T: Eq, A: Eq> Eq for GrayAlpha_v08<T, A>
impl<T, A> Pod for GrayAlpha<T, A>
This is unsound. You can disable as-bytes feature, enable bytemuck, and use bytemuck::cast_slice() instead.
impl<T, A> StructuralPartialEq for GrayAlpha_v08<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for GrayAlpha_v08<T, A>
impl<T, A> RefUnwindSafe for GrayAlpha_v08<T, A>where
T: RefUnwindSafe,
A: RefUnwindSafe,
impl<T, A> Send for GrayAlpha_v08<T, A>
impl<T, A> Sync for GrayAlpha_v08<T, A>
impl<T, A> Unpin for GrayAlpha_v08<T, A>
impl<T, A> UnwindSafe for GrayAlpha_v08<T, A>where
T: UnwindSafe,
A: 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,
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.