[−][src]Struct av_data::pixel::Formaton
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: ColorModelImage color model.
primaries: ColorPrimariesImage color primaries.
xfer: TransferCharacteristicImage transfer characteristic.
matrix: MatrixCoefficientsImage matrix coefficients.
chroma_location: ChromaLocationImage chroma location.
components: u8Actual number of components present.
comp_info: [Option<Chromaton>; 5]Format definition for each component.
elem_size: u8Single pixel size for packed formats.
be: boolTells if data is stored as big-endian.
alpha: boolTells if image has alpha component.
palette: boolTells 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]
model: ColorModel,
components: &[Chromaton],
elem_size: u8,
be: bool,
alpha: bool,
palette: bool
) -> Self
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]
mut self: Self,
tc: u32
) -> Option<TransferCharacteristic>
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]
mut self: Self,
mc: u32
) -> Option<MatrixCoefficients>
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.
pub fn index(&self, index: usize) -> &Self::Output[src]
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?
pub fn into_iter(self) -> Self::IntoIter[src]
impl PartialEq<Formaton> for Formaton[src]
impl StructuralPartialEq for Formaton[src]
Auto Trait Implementations
impl RefUnwindSafe for Formaton[src]
impl Send for Formaton[src]
impl Sync for Formaton[src]
impl Unpin for Formaton[src]
impl UnwindSafe for Formaton[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,