[][src]Enum image::ColorType

pub enum ColorType {
    L8,
    La8,
    Rgb8,
    Rgba8,
    L16,
    La16,
    Rgb16,
    Rgba16,
    Bgr8,
    Bgra8,
    // some variants omitted
}

An enumeration over supported color types and bit depths

Variants

L8

Pixel is 8-bit luminance

La8

Pixel is 8-bit luminance with an alpha channel

Rgb8

Pixel contains 8-bit R, G and B channels

Rgba8

Pixel is 8-bit RGB with an alpha channel

L16

Pixel is 16-bit luminance

La16

Pixel is 16-bit luminance with an alpha channel

Rgb16

Pixel is 16-bit RGB

Rgba16

Pixel is 16-bit RGBA

Bgr8

Pixel contains 8-bit B, G and R channels

Bgra8

Pixel is 8-bit BGR with an alpha channel

Methods

impl ColorType[src]

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

Returns the number of bytes contained in a pixel of ColorType c

pub fn has_alpha(self) -> bool[src]

Returns if there is an alpha channel.

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

Returns the number of bits contained in a pixel of ColorType c (which will always be a multiple of 8).

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

Returns the number of color channels that make up this pixel

Trait Implementations

impl Clone for ColorType[src]

impl Copy for ColorType[src]

impl Debug for ColorType[src]

impl Eq for ColorType[src]

impl From<ColorType> for ExtendedColorType[src]

impl Hash for ColorType[src]

impl PartialEq<ColorType> for ColorType[src]

impl StructuralEq for ColorType[src]

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