#[repr(C)]pub struct GrayAlpha<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
Grayscale Component
This field has been renamed to .v
1: A
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>
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_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 copy 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<'de, T, A> Deserialize<'de> for GrayAlpha_v08<T, A>where
T: Deserialize<'de>,
A: Deserialize<'de>,
impl<'de, T, A> Deserialize<'de> for GrayAlpha_v08<T, A>where
T: Deserialize<'de>,
A: Deserialize<'de>,
source§fn 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
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<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<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, A> Serialize for GrayAlpha_v08<T, A>
impl<T, A> Serialize for GrayAlpha_v08<T, A>
source§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 moresource§impl<T, A> Zeroable for GrayAlpha<T, A>
Available on crate feature as-bytes
only.
impl<T, A> Zeroable for GrayAlpha<T, A>
Available on crate feature
as-bytes
only.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>
Available on crate feature
as-bytes
only.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
.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)