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§
Sourcefn linesize(&self, idx: usize) -> Result<usize, FrameError>
fn linesize(&self, idx: usize) -> Result<usize, FrameError>
Returns the linesize (stride) of the idx-th frame plane.
Sourcefn as_slice_inner(&self, idx: usize) -> Result<&[u8], FrameError>
fn as_slice_inner(&self, idx: usize) -> Result<&[u8], FrameError>
Returns an immutable buffer with the data associated to the idx-th frame plane.
Sourcefn as_mut_slice_inner(&mut self, idx: usize) -> Result<&mut [u8], FrameError>
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
impl Debug for dyn FrameBuffer
Source§impl FrameBufferConv<f32> for dyn FrameBuffer
impl FrameBufferConv<f32> for dyn FrameBuffer
Source§fn as_slice(&self, idx: usize) -> Result<&[T], FrameError>
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>
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
impl FrameBufferConv<i16> for dyn FrameBuffer
Source§fn as_slice(&self, idx: usize) -> Result<&[T], FrameError>
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>
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
impl FrameBufferConv<u8> for dyn FrameBuffer
Source§fn as_slice(&self, idx: usize) -> Result<&[T], FrameError>
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>
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.