pub struct DecodedFrame {
pub width: u32,
pub height: u32,
pub bit_depth: u8,
pub chroma: ChromaFormat,
pub y: Vec<u16>,
pub u: Vec<u16>,
pub v: Vec<u16>,
pub color: ColorInfo,
}Expand description
A decoded picture, cropped to its display size.
Fields§
§width: u32Display width in pixels.
height: u32Display height in pixels.
bit_depth: u8Bits per sample, 8 to 12.
chroma: ChromaFormatChroma subsampling.
y: Vec<u16>Luma, width * height, tightly packed.
u: Vec<u16>Chroma planes, chroma_size each. Empty for
monochrome.
v: Vec<u16>Cr, laid out like u.
color: ColorInfoWhat the stream says about its colour.
Implementations§
Source§impl DecodedFrame
impl DecodedFrame
Sourcepub fn chroma_size(&self) -> (u32, u32)
pub fn chroma_size(&self) -> (u32, u32)
Size of each chroma plane.
Sourcepub fn to_raw_yuv(&self) -> Vec<u8> ⓘ
pub fn to_raw_yuv(&self) -> Vec<u8> ⓘ
The planes as ffmpeg’s rawvideo writes them for the stream’s native
pixel format: one byte a sample at 8 bits, two (little-endian) above.
Sourcepub fn to_bgra(&self) -> Vec<u8> ⓘ
pub fn to_bgra(&self) -> Vec<u8> ⓘ
Convert to tightly packed 8-bit BGRA, alpha 255, with the stream’s
matrix and range (ColorInfo) and bilinear chroma upsampling.
Large pictures are converted on several threads with parallel.
Sourcepub fn to_rgba_into(&self, out: &mut Vec<u8>)
pub fn to_rgba_into(&self, out: &mut Vec<u8>)
to_rgba into out, replacing what it holds. Reusing
one buffer across frames saves allocating and clearing a whole picture
each time.
Trait Implementations§
Source§impl Clone for DecodedFrame
impl Clone for DecodedFrame
Auto Trait Implementations§
impl Forget for DecodedFrame
impl Freeze for DecodedFrame
impl RefUnwindSafe for DecodedFrame
impl Send for DecodedFrame
impl Sync for DecodedFrame
impl Unpin for DecodedFrame
impl UnsafeUnpin for DecodedFrame
impl UnwindSafe for DecodedFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more