pub struct FrameBuffer { /* private fields */ }
Expand description
Frame buffer representing a decoded image.
Implementations§
Source§impl FrameBuffer
impl FrameBuffer
Sourcepub fn new(width: usize, height: usize, channels: usize) -> Self
pub fn new(width: usize, height: usize, channels: usize) -> Self
Creates a new framebuffer with given dimension.
Note that framebuffer allocations are not tracked.
Sourcepub fn buf(&self) -> &[f32]
pub fn buf(&self) -> &[f32]
Returns the contents of frame buffer.
The buffer has length of width * height * channels
, where n * channels + c
-th sample
belongs to the c
-th channel.
Sourcepub fn buf_mut(&mut self) -> &mut [f32]
pub fn buf_mut(&mut self) -> &mut [f32]
Returns the mutable reference to frame buffer.
The buffer has length of width * height * channels
, where n * channels + c
-th sample
belongs to the c
-th channel.
Sourcepub fn buf_grouped<const N: usize>(&self) -> &[[f32; N]]
pub fn buf_grouped<const N: usize>(&self) -> &[[f32; N]]
Trait Implementations§
Source§impl Clone for FrameBuffer
impl Clone for FrameBuffer
Source§fn clone(&self) -> FrameBuffer
fn clone(&self) -> FrameBuffer
Returns a copy 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 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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