pub struct FrameBuffer { /* private fields */ }Expand description
Buffer for a complete video frame (all planes).
Implementations§
Source§impl FrameBuffer
impl FrameBuffer
Sourcepub fn new(
width: u32,
height: u32,
bit_depth: u8,
subsampling: ChromaSubsampling,
) -> Self
pub fn new( width: u32, height: u32, bit_depth: u8, subsampling: ChromaSubsampling, ) -> Self
Create a new frame buffer.
Sourcepub const fn subsampling(&self) -> ChromaSubsampling
pub const fn subsampling(&self) -> ChromaSubsampling
Get the chroma subsampling.
Sourcepub fn set_timestamp(&mut self, timestamp: i64)
pub fn set_timestamp(&mut self, timestamp: i64)
Set the timestamp.
Sourcepub const fn is_keyframe(&self) -> bool
pub const fn is_keyframe(&self) -> bool
Check if this is a keyframe.
Sourcepub fn set_keyframe(&mut self, is_keyframe: bool)
pub fn set_keyframe(&mut self, is_keyframe: bool)
Set keyframe flag.
Sourcepub fn y_plane(&self) -> &PlaneBuffer
pub fn y_plane(&self) -> &PlaneBuffer
Get the Y plane.
Sourcepub fn y_plane_mut(&mut self) -> &mut PlaneBuffer
pub fn y_plane_mut(&mut self) -> &mut PlaneBuffer
Get the Y plane mutably.
Sourcepub fn u_plane(&self) -> Option<&PlaneBuffer>
pub fn u_plane(&self) -> Option<&PlaneBuffer>
Get the U plane.
Sourcepub fn u_plane_mut(&mut self) -> Option<&mut PlaneBuffer>
pub fn u_plane_mut(&mut self) -> Option<&mut PlaneBuffer>
Get the U plane mutably.
Sourcepub fn v_plane(&self) -> Option<&PlaneBuffer>
pub fn v_plane(&self) -> Option<&PlaneBuffer>
Get the V plane.
Sourcepub fn v_plane_mut(&mut self) -> Option<&mut PlaneBuffer>
pub fn v_plane_mut(&mut self) -> Option<&mut PlaneBuffer>
Get the V plane mutably.
Sourcepub fn plane(&self, plane_type: PlaneType) -> Option<&PlaneBuffer>
pub fn plane(&self, plane_type: PlaneType) -> Option<&PlaneBuffer>
Get a plane by type.
Sourcepub fn plane_mut(&mut self, plane_type: PlaneType) -> Option<&mut PlaneBuffer>
pub fn plane_mut(&mut self, plane_type: PlaneType) -> Option<&mut PlaneBuffer>
Get a plane mutably by type.
Sourcepub const fn num_planes(&self) -> usize
pub const fn num_planes(&self) -> usize
Get the number of planes.
Sourcepub fn copy_from(&mut self, other: &FrameBuffer) -> ReconstructResult<()>
pub fn copy_from(&mut self, other: &FrameBuffer) -> ReconstructResult<()>
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Calculate total buffer size in bytes.
Trait Implementations§
Source§impl Clone for FrameBuffer
impl Clone for FrameBuffer
Source§fn clone(&self) -> FrameBuffer
fn clone(&self) -> FrameBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FrameBuffer
impl RefUnwindSafe for FrameBuffer
impl Send for FrameBuffer
impl Sync for FrameBuffer
impl Unpin for FrameBuffer
impl UnsafeUnpin for FrameBuffer
impl UnwindSafe for FrameBuffer
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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