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>
impl<'a> DecodedYUV<'a>
sourcepub fn y_with_stride(&self) -> &'a [u8] ⓘ
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.
sourcepub fn u_with_stride(&self) -> &'a [u8] ⓘ
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.
sourcepub fn v_with_stride(&self) -> &'a [u8] ⓘ
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.
sourcepub fn dimension_rgb(&self) -> (usize, usize)
pub fn dimension_rgb(&self) -> (usize, usize)
Returns the unpadded, image size in pixels when using write_rgb8()
.
sourcepub fn dimension_y(&self) -> (usize, usize)
pub fn dimension_y(&self) -> (usize, usize)
Returns the unpadded Y size.
This may or may not be smaller than the image size.
sourcepub fn dimension_u(&self) -> (usize, usize)
pub fn dimension_u(&self) -> (usize, usize)
Returns the unpadded U size.
This is often smaller (by half) than the image size.
sourcepub fn dimension_v(&self) -> (usize, usize)
pub fn dimension_v(&self) -> (usize, usize)
Returns the unpadded V size.
This is often smaller (by half) than the image size.
sourcepub fn strides_yuv(&self) -> (usize, usize, usize)
pub fn strides_yuv(&self) -> (usize, usize, usize)
Returns strides for the (Y,U,V) arrays.
sourcepub fn timestamp(&self) -> Timestamp
pub fn timestamp(&self) -> Timestamp
Timestamp of this frame in milliseconds(?) with respect to the video stream.
sourcepub fn write_rgb8(&self, target: &mut [u8])
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.
sourcepub fn write_rgba8(&self, target: &mut [u8])
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.