[][src]Enum icns::PixelFormat

pub enum PixelFormat {
    RGBA,
    RGB,
    GrayAlpha,
    Gray,
    Alpha,
}

Formats for storing pixel data in an image.

This type determines how the raw data array of an Image is to be interpreted.

Regardless of format, pixel data for an image is always stored one complete pixel at a time, in row-major order (that is, the top-left pixel comes first, followed by the rest of the top row from left to right; then comes the second row down, again from left to right, and so on until finally the bottom-right pixel comes last).

Variants

RGBA

32-bit color with alpha channel. Each pixel is four bytes, with red first and alpha last.

RGB

24-bit color with no alpha. Each pixel is three bytes, with red first and blue last.

GrayAlpha

16-bit grayscale-with-alpha. Each pixel is two bytes, with the grayscale value first and alpha second.

Gray

8-bit grayscale with no alpha. Each pixel is one byte (0=black, 255=white).

Alpha

8-bit alpha mask with no color. Each pixel is one byte (0=transparent, 255=opaque).

Implementations

impl PixelFormat[src]

pub fn bits_per_pixel(self) -> u32[src]

Returns the number of bits needed to store a single pixel in this format.

Trait Implementations

impl Clone for PixelFormat[src]

impl Copy for PixelFormat[src]

impl Debug for PixelFormat[src]

impl Eq for PixelFormat[src]

impl Hash for PixelFormat[src]

impl PartialEq<PixelFormat> for PixelFormat[src]

impl StructuralEq for PixelFormat[src]

impl StructuralPartialEq for PixelFormat[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.