pub struct Formaton {
    pub model: ColorModel,
    pub primaries: ColorPrimaries,
    pub xfer: TransferCharacteristic,
    pub matrix: MatrixCoefficients,
    pub chroma_location: ChromaLocation,
    pub components: u8,
    pub comp_info: [Option<Chromaton>; 5],
    pub elem_size: u8,
    pub be: bool,
    pub alpha: bool,
    pub palette: bool,
}
Expand description

Image colorspace representation.

Includes both definitions for each component and some common definitions.

For example, the format can be paletted, so the components describe the palette storage format, while the actual data is 8-bit palette indices.

Fields

model: ColorModel

Image color model.

primaries: ColorPrimaries

Image color primaries.

xfer: TransferCharacteristic

Image transfer characteristic.

matrix: MatrixCoefficients

Image matrix coefficients.

chroma_location: ChromaLocation

Image chroma location.

components: u8

Actual number of components present.

comp_info: [Option<Chromaton>; 5]

Format definition for each component.

elem_size: u8

Single pixel size for packed formats.

be: bool

Tells if data is stored as big-endian.

alpha: bool

Tells if image has alpha component.

palette: bool

Tells if data is paletted.

Implementations

Constructs a new instance of Formaton.

Returns current color model.

Returns current image primaries.

Returns the total amount of bits needed for components.

Sets current image primaries.

Sets current image primaries from u32.

Returns current image transfer characteristic.

Sets current image transfer characteristic.

Sets current image transfer characteristic from u32.

Returns current image matrix coefficients.

Sets current image matrix coefficients.

Sets current image matrix coefficients from u32.

Returns the number of components.

Returns selected component information.

Reports whether the packing format is big-endian.

Reports whether a colorspace has an alpha component.

Reports whether this is a paletted format.

Returns single packed pixel size.

Returns an iterator over the format definition of each component.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.