av_data::frame

Trait FrameBuffer

Source
pub trait FrameBuffer: Send + Sync {
    // Required methods
    fn linesize(&self, idx: usize) -> Result<usize, FrameError>;
    fn count(&self) -> usize;
    fn as_slice_inner(&self, idx: usize) -> Result<&[u8], FrameError>;
    fn as_mut_slice_inner(
        &mut self,
        idx: usize,
    ) -> Result<&mut [u8], FrameError>;
}
Expand description

A series of methods to interact with the planes of frame.

Required Methods§

Source

fn linesize(&self, idx: usize) -> Result<usize, FrameError>

Returns the linesize (stride) of the idx-th frame plane.

Source

fn count(&self) -> usize

Counts the number of frame planes.

Source

fn as_slice_inner(&self, idx: usize) -> Result<&[u8], FrameError>

Returns an immutable buffer with the data associated to the idx-th frame plane.

Source

fn as_mut_slice_inner(&mut self, idx: usize) -> Result<&mut [u8], FrameError>

Returns a mutable buffer with the data associated to the idx-th frame plane.

Trait Implementations§

Source§

impl Debug for dyn FrameBuffer

Source§

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

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

impl FrameBufferConv<f32> for dyn FrameBuffer

Source§

fn as_slice(&self, idx: usize) -> Result<&[T], FrameError>

Returns an immutable slice of datatype T with the data associated to the idx-th frame plane.
Source§

fn as_mut_slice(&mut self, idx: usize) -> Result<&mut [T], FrameError>

Returns a mutable slice of datatype T with the data associated to the idx-th frame plane.
Source§

impl FrameBufferConv<i16> for dyn FrameBuffer

Source§

fn as_slice(&self, idx: usize) -> Result<&[T], FrameError>

Returns an immutable slice of datatype T with the data associated to the idx-th frame plane.
Source§

fn as_mut_slice(&mut self, idx: usize) -> Result<&mut [T], FrameError>

Returns a mutable slice of datatype T with the data associated to the idx-th frame plane.
Source§

impl FrameBufferConv<u8> for dyn FrameBuffer

Source§

fn as_slice(&self, idx: usize) -> Result<&[T], FrameError>

Returns an immutable slice of datatype T with the data associated to the idx-th frame plane.
Source§

fn as_mut_slice(&mut self, idx: usize) -> Result<&mut [T], FrameError>

Returns a mutable slice of datatype T with the data associated to the idx-th frame plane.

Implementors§