[][src]Struct y4m::Decoder

pub struct Decoder<R: Read> { /* fields omitted */ }

YUV4MPEG2 decoder.


impl<R: Read> Decoder<R>[src]

pub fn new(reader: R) -> Result<Decoder<R>, Error>[src]

Create a new decoder instance.

pub fn new_with_limits(reader: R, limits: Limits) -> Result<Decoder<R>, Error>[src]

Create a new decoder instance with custom limits.

pub fn read_frame(&mut self) -> Result<Frame<'_>, Error>[src]

Iterate over frames. End of input is indicated by Error::EOF.

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

Return file width.

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

Return file height.

pub fn get_framerate(&self) -> Ratio[src]

Return file framerate.

pub fn get_pixel_aspect(&self) -> Ratio[src]

Return file pixel aspect.

pub fn get_colorspace(&self) -> Colorspace[src]

Return file colorspace.

NOTE: normally all .y4m should have colorspace param, but there are files encoded without that tag and it's unclear what should we do in that case. Currently C420 is implied by default as per ffmpeg behavior.

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

Return file raw parameters.

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

Return the bit depth per sample

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

Return the number of bytes in a sample

Auto Trait Implementations

impl<R> RefUnwindSafe for Decoder<R> where
    R: RefUnwindSafe

impl<R> Send for Decoder<R> where
    R: Send

impl<R> Sync for Decoder<R> where
    R: Sync

impl<R> Unpin for Decoder<R> where
    R: Unpin

impl<R> UnwindSafe for Decoder<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.