[][src]Struct tiny_skia::PremultipliedColorU8

#[repr(transparent)]pub struct PremultipliedColorU8(_);

A 32-bit premultiplied RGBA color value.

Byteorder: ABGR

Implementations

impl PremultipliedColorU8[src]

pub const TRANSPARENT: Self[src]

A transparent color.

pub fn from_rgba(r: u8, g: u8, b: u8, a: u8) -> Option<Self>[src]

Creates a new premultiplied color.

RGB components must be <= alpha.

pub const fn red(self) -> u8[src]

Returns color's red component.

The value is <= alpha.

pub const fn green(self) -> u8[src]

Returns color's green component.

The value is <= alpha.

pub const fn blue(self) -> u8[src]

Returns color's blue component.

The value is <= alpha.

pub const fn alpha(self) -> u8[src]

Returns color's alpha component.

pub fn is_opaque(&self) -> bool[src]

Check that color is opaque.

Alpha == 255

pub const fn get(self) -> u32[src]

Returns the value as a primitive type.

pub fn demultiply(&self) -> ColorU8[src]

Returns a demultiplied color.

Trait Implementations

impl Clone for PremultipliedColorU8[src]

impl Copy for PremultipliedColorU8[src]

impl Debug for PremultipliedColorU8[src]

impl PartialEq<PremultipliedColorU8> for PremultipliedColorU8[src]

impl Pod for PremultipliedColorU8[src]

impl StructuralPartialEq for PremultipliedColorU8[src]

impl Zeroable for PremultipliedColorU8[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.