pub type RGBA16 = Rgba<u16>;
Expand description
16-bit RGB in machine’s native endian. 0 = transparent, 65535 = opaque.
Alpha is last.
Aliased Type§
struct RGBA16 {
pub r: u16,
pub g: u16,
pub b: u16,
pub a: u16,
}
Fields§
§r: u16
Red Component
g: u16
Green Component
b: u16
Blue Component
a: u16
Alpha Component
Implementations
Source§impl<T: Copy, A: Clone> Rgba<T, A>
impl<T: Copy, A: Clone> Rgba<T, A>
Sourcepub fn map_rgb<F, U, B>(&self, f: F) -> RGBA<U, B>
👎Deprecated: Renamed to map_colors()
pub fn map_rgb<F, U, B>(&self, f: F) -> RGBA<U, B>
Create new RGBA with the same alpha value, but different RGB values
Sourcepub fn with_alpha(&self, a: A) -> Self
pub fn with_alpha(&self, a: A) -> Self
Create a new RGBA with the new alpha value, but same RGB values
Trait Implementations
Source§impl<T> AddAssign<T> for Rgba<T>
px + 1
impl<T> AddAssign<T> for Rgba<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 Rgba<T, A>
px + px
impl<T, A> AddAssign for Rgba<T, A>
px + px
Source§fn add_assign(&mut self, other: RGBA<T, A>)
fn add_assign(&mut self, other: RGBA<T, A>)
Performs the
+=
operation. Read moreSource§impl<T: Copy, A: Copy, B> ColorComponentMap<Rgba<B, A>, T, B> for Rgba<T, A>
impl<T: Copy, A: Copy, B> ColorComponentMap<Rgba<B, A>, T, B> for Rgba<T, A>
Source§impl<T> ComponentSlice<T> for Rgba<T>
impl<T> ComponentSlice<T> for Rgba<T>
Source§impl<T> DivAssign<T> for Rgba<T>
px * 1
impl<T> DivAssign<T> for Rgba<T>
px * 1
Source§fn div_assign(&mut self, r: T)
fn div_assign(&mut self, r: T)
Performs the
/=
operation. Read moreSource§impl<R, S> From<(R, R, R, R)> for Rgba<S>where
R: Into<S>,
impl<R, S> From<(R, R, R, R)> for Rgba<S>where
R: Into<S>,
Source§fn from(value: (R, R, R, R)) -> Self
fn from(value: (R, R, R, R)) -> Self
Converts to this type from the input type.
Source§impl<T> FromIterator<T> for Rgba<T>
impl<T> FromIterator<T> for Rgba<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(into_iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(into_iter: I) -> Self
Takes exactly 4 elements from the iterator and creates a new instance. Panics if there are fewer elements in the iterator.
Source§impl<T> MulAssign<T> for Rgba<T>
px * 1
impl<T> MulAssign<T> for Rgba<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 Rgba<T, A>
impl<T: Ord, A: Ord> Ord for Rgba<T, A>
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 Rgba<T, A>
impl<T: PartialOrd, A: PartialOrd> PartialOrd for Rgba<T, A>
Source§impl<T> SubAssign<T> for Rgba<T>
px - 1
impl<T> SubAssign<T> for Rgba<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 Rgba<T, A>
px - px
impl<T, A> SubAssign for Rgba<T, A>
px - px
Source§fn sub_assign(&mut self, other: RGBA<T, A>)
fn sub_assign(&mut self, other: RGBA<T, A>)
Performs the
-=
operation. Read moreSource§impl<T, A> Zeroable for Rgba<T, A>
This is unsound. You can disable as-bytes
feature, enable bytemuck
, and use bytemuck::cast_slice()
instead.
impl<T, A> Zeroable for Rgba<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 Rgba<T, A>
impl<T: Eq, A: Eq> Eq for Rgba<T, A>
impl<T, A> Pod for Rgba<T, A>
This is unsound. You can disable as-bytes
feature, enable bytemuck
, and use bytemuck::cast_slice()
instead.