pub struct BufferPool { /* private fields */ }Expand description
Pool of reusable frame buffers.
Implementations§
Source§impl BufferPool
impl BufferPool
Sourcepub fn new(
width: u32,
height: u32,
bit_depth: u8,
subsampling: ChromaSubsampling,
max_size: usize,
) -> Self
pub fn new( width: u32, height: u32, bit_depth: u8, subsampling: ChromaSubsampling, max_size: usize, ) -> Self
Create a new buffer pool.
Sourcepub fn acquire(&mut self) -> ReconstructResult<FrameBuffer>
pub fn acquire(&mut self) -> ReconstructResult<FrameBuffer>
Acquire a buffer from the pool.
Returns a buffer from the pool if available, otherwise allocates a new one.
§Errors
Returns error if allocation fails.
Sourcepub fn release(&mut self, buffer: FrameBuffer)
pub fn release(&mut self, buffer: FrameBuffer)
Release a buffer back to the pool.
Sourcepub fn available_count(&self) -> usize
pub fn available_count(&self) -> usize
Get the number of available buffers.
Sourcepub fn reconfigure(
&mut self,
width: u32,
height: u32,
bit_depth: u8,
subsampling: ChromaSubsampling,
)
pub fn reconfigure( &mut self, width: u32, height: u32, bit_depth: u8, subsampling: ChromaSubsampling, )
Reconfigure the pool for new dimensions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BufferPool
impl RefUnwindSafe for BufferPool
impl Send for BufferPool
impl Sync for BufferPool
impl Unpin for BufferPool
impl UnsafeUnpin for BufferPool
impl UnwindSafe for BufferPool
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> 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