Struct tiny_skia::PremultipliedColorU8
source · [−]#[repr(transparent)]pub struct PremultipliedColorU8(_);
Expand description
A 32-bit premultiplied RGBA color value.
Byteorder: ABGR
Implementations
sourceimpl PremultipliedColorU8
impl PremultipliedColorU8
sourcepub const TRANSPARENT: Self = PremultipliedColorU8::from_rgba_unchecked(0, 0, 0, 0)
pub const TRANSPARENT: Self = PremultipliedColorU8::from_rgba_unchecked(0, 0, 0, 0)
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 fn demultiply(&self) -> ColorU8
pub fn demultiply(&self) -> ColorU8
Returns a demultiplied color.
Trait Implementations
sourceimpl Clone for PremultipliedColorU8
impl Clone for PremultipliedColorU8
sourcefn clone(&self) -> PremultipliedColorU8
fn clone(&self) -> PremultipliedColorU8
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PremultipliedColorU8
impl Debug for PremultipliedColorU8
sourceimpl PartialEq<PremultipliedColorU8> for PremultipliedColorU8
impl PartialEq<PremultipliedColorU8> for PremultipliedColorU8
sourcefn eq(&self, other: &PremultipliedColorU8) -> bool
fn eq(&self, other: &PremultipliedColorU8) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &PremultipliedColorU8) -> bool
fn ne(&self, other: &PremultipliedColorU8) -> bool
This method tests for !=
.
impl Copy for PremultipliedColorU8
impl Pod for PremultipliedColorU8
impl StructuralPartialEq for PremultipliedColorU8
Auto Trait Implementations
impl RefUnwindSafe for PremultipliedColorU8
impl Send for PremultipliedColorU8
impl Sync for PremultipliedColorU8
impl Unpin for PremultipliedColorU8
impl UnwindSafe for PremultipliedColorU8
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedBitPattern for T where
T: AnyBitPattern,
impl<T> CheckedBitPattern for T where
T: AnyBitPattern,
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
. Read more
sourcefn 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
.