[][src]Struct av_data::pixel::Formaton

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,
}

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

impl Formaton[src]

pub fn new(
    model: ColorModel,
    components: &[Chromaton],
    elem_size: u8,
    be: bool,
    alpha: bool,
    palette: bool
) -> Self
[src]

Constructs a new instance of Formaton.

pub fn get_model(&self) -> ColorModel[src]

Returns current color model.

pub fn get_primaries(&self) -> ColorPrimaries[src]

Returns current image primaries.

pub fn get_total_depth(&self) -> u8[src]

Returns the total amount of bits needed for components.

pub fn set_primaries(mut self: Self, pc: ColorPrimaries)[src]

Sets current image primaries.

pub fn set_primaries_from_u32(mut self: Self, pc: u32) -> Option<ColorPrimaries>[src]

Sets current image primaries from u32.

pub fn get_xfer(&self) -> TransferCharacteristic[src]

Returns current image transfer characteristic.

pub fn set_xfer(mut self: Self, pc: TransferCharacteristic)[src]

Sets current image transfer characteristic.

pub fn set_xfer_from_u32(
    mut self: Self,
    tc: u32
) -> Option<TransferCharacteristic>
[src]

Sets current image transfer characteristic from u32.

pub fn get_matrix(&self) -> MatrixCoefficients[src]

Returns current image matrix coefficients.

pub fn set_matrix(mut self: Self, mc: MatrixCoefficients)[src]

Sets current image matrix coefficients.

pub fn set_matrix_from_u32(
    mut self: Self,
    mc: u32
) -> Option<MatrixCoefficients>
[src]

Sets current image matrix coefficients from u32.

pub fn get_num_comp(&self) -> usize[src]

Returns the number of components.

pub fn get_chromaton(&self, idx: usize) -> Option<Chromaton>[src]

Returns selected component information.

pub fn is_be(&self) -> bool[src]

Reports whether the packing format is big-endian.

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

Reports whether a colorspace has an alpha component.

pub fn is_paletted(&self) -> bool[src]

Reports whether this is a paletted format.

pub fn get_elem_size(&self) -> u8[src]

Returns single packed pixel size.

pub fn iter(&self) -> Iter<'_, Option<Chromaton>>[src]

Returns an iterator over the format definition of each component.

Trait Implementations

impl Clone for Formaton[src]

impl Copy for Formaton[src]

impl Debug for Formaton[src]

impl Display for Formaton[src]

impl<'a> Index<usize> for &'a Formaton[src]

type Output = Option<Chromaton>

The returned type after indexing.

impl<'a> IntoIterator for &'a Formaton[src]

type Item = &'a Option<Chromaton>

The type of the elements being iterated over.

type IntoIter = Iter<'a, Option<Chromaton>>

Which kind of iterator are we turning this into?

impl PartialEq<Formaton> for Formaton[src]

impl StructuralPartialEq for Formaton[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> ToString for T where
    T: Display + ?Sized
[src]

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.