#[repr(C)]pub struct Gray<T>(pub T);
Available on non-crate feature
unstable-experimental
only.Expand description
A Grayscale
pixel (rgb crate v0.8)
Tuple Fields§
§0: T
Grayscale Component. This field will be renamed to v
.
Implementations§
source§impl<T: Copy> Gray_v08<T>
impl<T: Copy> Gray_v08<T>
sourcepub fn value(self) -> T
pub fn value(self) -> T
Reads the .0
field
This function isn’t necessary, but it is forwards-compatible with the next major version of the RGB crate.
sourcepub fn value_mut(&mut self) -> &mut T
pub fn value_mut(&mut self) -> &mut T
Exposes the .0
field for writing
This function isn’t necessary, but it is forwards-compatible with the next major version of the RGB crate.
sourcepub fn with_alpha(self, add_alpha_value: T) -> GrayAlpha_v08<T>
pub fn with_alpha(self, add_alpha_value: T) -> GrayAlpha_v08<T>
Add alpha component to this pixel
Trait Implementations§
source§impl<T> AddAssign<T> for Gray_v08<T>
impl<T> AddAssign<T> for Gray_v08<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> AddAssign for Gray_v08<T>
impl<T> AddAssign for Gray_v08<T>
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> AsPixels<Gray_v08<T>> for [T]
impl<T> AsPixels<Gray_v08<T>> for [T]
source§fn as_pixels_mut(&mut self) -> &mut [Gray<T>]
fn as_pixels_mut(&mut self) -> &mut [Gray<T>]
Use
::bytemuck::cast_slice_mut()
instead. Read moresource§impl<T: Copy, B> ColorComponentMap<Gray_v08<B>, T, B> for Gray<T>
impl<T: Copy, B> ColorComponentMap<Gray_v08<B>, T, B> for Gray<T>
source§impl<T> ComponentSlice<T> for Gray<T>
impl<T> ComponentSlice<T> for Gray<T>
source§impl<'de, T> Deserialize<'de> for Gray_v08<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Gray_v08<T>where
T: 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 Gray_v08<T>
impl<T> DivAssign<T> for Gray_v08<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 Gray_v08<T>
impl<T> MulAssign<T> for Gray_v08<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> MulAssign for Gray_v08<T>
impl<T> MulAssign for Gray_v08<T>
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: Ord> Ord for Gray_v08<T>
impl<T: Ord> Ord for Gray_v08<T>
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> PartialOrd for Gray_v08<T>
impl<T: PartialOrd> PartialOrd for Gray_v08<T>
source§impl<T> SubAssign<T> for Gray_v08<T>
impl<T> SubAssign<T> for Gray_v08<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> SubAssign for Gray_v08<T>
impl<T> SubAssign for Gray_v08<T>
px - px
source§fn sub_assign(&mut self, other: Gray<T>)
fn sub_assign(&mut self, other: Gray<T>)
Performs the
-=
operation. Read moreimpl<T: Copy> Copy for Gray_v08<T>
impl<T: Eq> Eq for Gray_v08<T>
impl<T> Pod for Gray<T>where
T: Pod,
Available on crate feature
as-bytes
only.impl<T> StructuralPartialEq for Gray_v08<T>
Auto Trait Implementations§
impl<T> Freeze for Gray_v08<T>where
T: Freeze,
impl<T> RefUnwindSafe for Gray_v08<T>where
T: RefUnwindSafe,
impl<T> Send for Gray_v08<T>where
T: Send,
impl<T> Sync for Gray_v08<T>where
T: Sync,
impl<T> Unpin for Gray_v08<T>where
T: Unpin,
impl<T> UnwindSafe for Gray_v08<T>where
T: 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
)