Enum repng::ColorFormat [] [src]

#[repr(u8)]
pub enum ColorFormat { Gray, RGB, Palette, GrayA, RGBA, }

A color format, which specifies how the bytes represent the pixels.

Variants

A format encoding only the luminosity of each pixel.

Valid bit depths are 1, 2, 4, 8 and 16 bits.

A format encoding the red, green, then blue components of each pixel.

Valid bit depths are 8 and 16 bits.

A single-channel format encoding the index of each pixel in a palette.

If you use this format, you probably want to also use meta::palette or meta::palette_alpha before writing any image data, because otherwise, the decoder probably won't know what each index represents.

Valid bit depths are 1, 2, 4 and 8 bits.

The same as Gray, but with an alpha channel added to the end.

Valid bit depths are 8 and 16 bits.

The same as RGB, but with an alpha channel added to the end.

Valid bit depths are 8 and 16 bits.

Methods

impl ColorFormat
[src]

[src]

The number of components in each pixel.

Trait Implementations

impl Clone for ColorFormat
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for ColorFormat
[src]

impl Eq for ColorFormat
[src]

impl PartialEq for ColorFormat
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Hash for ColorFormat
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for ColorFormat
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for ColorFormat

impl Sync for ColorFormat