Struct tiny_skia::color::PremultipliedColorU8
source · #[repr(transparent)]pub struct PremultipliedColorU8([u8; 4]);
Expand description
A 32-bit premultiplied RGBA color value.
Byteorder: RGBA (relevant for bytemuck casts)
Tuple Fields§
§0: [u8; 4]
Implementations§
source§impl PremultipliedColorU8
impl PremultipliedColorU8
sourcepub const TRANSPARENT: Self = _
pub const TRANSPARENT: Self = _
A transparent color.
sourcepub fn from_rgba(r: u8, g: u8, b: u8, a: u8) -> Option<Self>
pub fn from_rgba(r: u8, g: u8, b: u8, a: u8) -> Option<Self>
Creates a new premultiplied color.
RGB components must be <= alpha.
sourcepub(crate) const fn from_rgba_unchecked(r: u8, g: u8, b: u8, a: u8) -> Self
pub(crate) const fn from_rgba_unchecked(r: u8, g: u8, b: u8, a: u8) -> Self
Creates a new color.
sourcepub fn demultiply(&self) -> ColorU8
pub fn demultiply(&self) -> ColorU8
Returns a demultiplied color.
Trait Implementations§
source§impl Clone for PremultipliedColorU8
impl Clone for PremultipliedColorU8
source§fn clone(&self) -> PremultipliedColorU8
fn clone(&self) -> PremultipliedColorU8
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 Debug for PremultipliedColorU8
impl Debug for PremultipliedColorU8
source§impl PartialEq for PremultipliedColorU8
impl PartialEq for PremultipliedColorU8
impl Copy for PremultipliedColorU8
impl Pod for PremultipliedColorU8
impl StructuralPartialEq for PremultipliedColorU8
Auto Trait Implementations§
impl Freeze for PremultipliedColorU8
impl RefUnwindSafe for PremultipliedColorU8
impl Send for PremultipliedColorU8
impl Sync for PremultipliedColorU8
impl Unpin for PremultipliedColorU8
impl UnwindSafe for PremultipliedColorU8
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
)