[][src]Struct av_data::pixel::Chromaton

pub struct Chromaton {
    pub h_ss: u8,
    pub v_ss: u8,
    pub packed: bool,
    pub depth: u8,
    pub shift: u8,
    pub comp_offs: u8,
    pub next_elem: u8,
}

Single colorspace component definition.

Defines how the components of a colorspace are subsampled and where and how they are stored.

Fields

h_ss: u8

Horizontal subsampling in power of two (e.g. 0 = no subsampling, 1 = only every second value is stored).

v_ss: u8

Vertial subsampling in power of two (e.g. 0 = no subsampling, 1 = only every second value is stored).

packed: bool

Tells if a component is packed.

depth: u8

Bit depth of a component.

shift: u8

Shift for packed components.

comp_offs: u8

Component offset for byte-packed components.

next_elem: u8

The distance to the next packed element in bytes.

Implementations

impl Chromaton[src]

pub const fn new(
    h_ss: u8,
    v_ss: u8,
    packed: bool,
    depth: u8,
    shift: u8,
    comp_offs: u8,
    next_elem: u8
) -> Self
[src]

Constructs a new Chromaton instance.

pub const fn yuv8(h_ss: u8, v_ss: u8, comp_offs: u8) -> Chromaton[src]

Constructs a specific Chromaton instance for yuv8.

pub const fn yuvhb(h_ss: u8, v_ss: u8, depth: u8, comp_offs: u8) -> Chromaton[src]

Constructs a specific Chromaton instance for yuvhb.

pub const fn packrgb(
    depth: u8,
    shift: u8,
    comp_offs: u8,
    next_elem: u8
) -> Chromaton
[src]

Constructs a specific Chromaton instance for packrgb.

pub const fn pal8(comp_offs: u8) -> Chromaton[src]

Constructs a specific Chromaton instance for pal8.

pub fn get_subsampling(self) -> (u8, u8)[src]

Returns the subsampling of a component.

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

Tells whether a component is packed.

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

Returns the bit depth of a component.

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

Returns the bit shift of a packed component.

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

Returns the byte offset of a packed component.

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

Returns the byte offset to the next element of a packed component.

pub fn get_width(self, width: usize) -> usize[src]

Calculates the width for a component from general image width.

pub fn get_height(self, height: usize) -> usize[src]

Calculates the height for a component from general image height.

pub fn get_linesize(self, width: usize, alignment: usize) -> usize[src]

Calculates the minimal stride for a component from general image width.

pub fn get_data_size(self, width: usize, height: usize, align: usize) -> usize[src]

Calculates the required image size in pixels for a component from general image width.

Trait Implementations

impl Clone for Chromaton[src]

impl Copy for Chromaton[src]

impl Debug for Chromaton[src]

impl Display for Chromaton[src]

impl PartialEq<Chromaton> for Chromaton[src]

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