[][src]Struct footile::Rgba8

#[repr(C)]
pub struct Rgba8 { /* fields omitted */ }

8-bit per channel RGBA pixel format.

This format has four 8-bit channels: red, green, blue and alpha.

Methods

impl Rgba8[src]

pub fn new(red: u8, green: u8, blue: u8, alpha: u8) -> Self[src]

Build a color by specifying red, green, blue and alpha values.

pub fn rgb(red: u8, green: u8, blue: u8) -> Self[src]

Build an opaque color by specifying red, green and blue values.

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

Get the red component value.

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

Get the green component value.

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

Get the blue component value.

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

Get the alpha component value.

Trait Implementations

impl PixFmt for Rgba8[src]

fn color_type() -> ColorType[src]

Get the PNG color type.

fn over(pix: &mut [Self], mask: &[u8], clr: Self)[src]

Blend pixels with an alpha mask.

  • pix Slice of pixels.
  • mask Alpha mask for compositing.
  • src Source color.

fn divide_alpha(pix: &mut [Self])[src]

Divide alpha (remove premultiplied alpha)

fn as_u8_slice(pix: &[Self]) -> &[u8][src]

Convert a pixel slice into a u8 slice. Read more

fn as_u8_slice_mut(pix: &mut [Self]) -> &mut [u8][src]

Convert a pixel slice into a mutable u8 slice. Read more

fn as_slice(pix: &[u8]) -> &[Self][src]

Convert a u8 slice into a pixel slice. Read more

fn as_slice_mut(pix: &mut [u8]) -> &mut [Self][src]

Convert a u8 slice into a mutable pixel slice. Read more

impl Clone for Rgba8[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Rgba8[src]

impl From<Rgba8> for i32[src]

fn from(c: Rgba8) -> i32[src]

Get an i32 from a Rgba8 (alpha in high byte)

impl Default for Rgba8[src]

impl Debug for Rgba8[src]

Auto Trait Implementations

impl Send for Rgba8

impl Sync for Rgba8

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.