Struct openh264::decoder::DecodedYUV

source ·
pub struct DecodedYUV<'a> { /* private fields */ }
Expand description

Frame returned by the Decoder and provides safe data access.

Implementations§

source§

impl<'a> DecodedYUV<'a>

source

pub fn y_with_stride(&self) -> &'a [u8]

Returns the Y (luma) array, including padding.

You can use strides_yuv() to compute unpadded pixel positions.

source

pub fn u_with_stride(&self) -> &'a [u8]

Returns the U (blue projection) array, including padding.

You can use strides_yuv() to compute unpadded pixel positions.

source

pub fn v_with_stride(&self) -> &'a [u8]

Returns the V (red projection) array, including padding.

You can use strides_yuv() to compute unpadded pixel positions.

source

pub fn dimension_rgb(&self) -> (usize, usize)

Returns the unpadded, image size in pixels when using write_rgb8().

source

pub fn dimension_y(&self) -> (usize, usize)

Returns the unpadded Y size.

This may or may not be smaller than the image size.

source

pub fn dimension_u(&self) -> (usize, usize)

Returns the unpadded U size.

This is often smaller (by half) than the image size.

source

pub fn dimension_v(&self) -> (usize, usize)

Returns the unpadded V size.

This is often smaller (by half) than the image size.

source

pub fn strides_yuv(&self) -> (usize, usize, usize)

Returns strides for the (Y,U,V) arrays.

source

pub fn timestamp(&self) -> Timestamp

Timestamp of this frame in milliseconds(?) with respect to the video stream.

source

pub fn write_rgb8(&self, target: &mut [u8])

Writes the image into a byte buffer of size w*h*3.

§Panics

Panics if the target image dimension don’t match the configured format.

source

pub fn write_rgba8(&self, target: &mut [u8])

Writes the image into a byte buffer of size w*h*4.

§Panics

Panics if the target image dimension don’t match the configured format.

Trait Implementations§

source§

impl<'a> Debug for DecodedYUV<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> YUVSource for DecodedYUV<'a>

source§

fn width(&self) -> i32

source§

fn height(&self) -> i32

source§

fn y(&self) -> &[u8]

source§

fn u(&self) -> &[u8]

source§

fn v(&self) -> &[u8]

source§

fn y_stride(&self) -> i32

source§

fn u_stride(&self) -> i32

source§

fn v_stride(&self) -> i32

Auto Trait Implementations§

§

impl<'a> Freeze for DecodedYUV<'a>

§

impl<'a> RefUnwindSafe for DecodedYUV<'a>

§

impl<'a> Send for DecodedYUV<'a>

§

impl<'a> Sync for DecodedYUV<'a>

§

impl<'a> Unpin for DecodedYUV<'a>

§

impl<'a> UnwindSafe for DecodedYUV<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.