Trait crabgrab::feature::bitmap::VideoFrameBitmap
source · pub trait VideoFrameBitmap {
// Required methods
fn get_bitmap(&self) -> Result<BoxedSliceFrameBitmap, VideoFrameBitmapError>;
fn try_get_pooled_bitmap(
&self,
bitmap_pool: &FrameBitmapPool
) -> Result<Option<PooledFrameBitmap>, VideoFrameBitmapError>;
fn get_pooled_bitmap(
&self,
bitmap_pool: &FrameBitmapPool
) -> Result<PooledFrameBitmap, VideoFrameBitmapError>;
}
Expand description
A video frame which can produce a bitmap
Required Methods§
sourcefn get_bitmap(&self) -> Result<BoxedSliceFrameBitmap, VideoFrameBitmapError>
fn get_bitmap(&self) -> Result<BoxedSliceFrameBitmap, VideoFrameBitmapError>
Create a bitmap image from this frame. This usually involves a memory transfer from VRAM to system RAM, and is an expensive operation.
sourcefn try_get_pooled_bitmap(
&self,
bitmap_pool: &FrameBitmapPool
) -> Result<Option<PooledFrameBitmap>, VideoFrameBitmapError>
fn try_get_pooled_bitmap( &self, bitmap_pool: &FrameBitmapPool ) -> Result<Option<PooledFrameBitmap>, VideoFrameBitmapError>
Try and get a pooled bitmap using the given bitmap pool, and return Ok(None) if there are no pooled bitmaps available
and max
pooled bitmaps exist
sourcefn get_pooled_bitmap(
&self,
bitmap_pool: &FrameBitmapPool
) -> Result<PooledFrameBitmap, VideoFrameBitmapError>
fn get_pooled_bitmap( &self, bitmap_pool: &FrameBitmapPool ) -> Result<PooledFrameBitmap, VideoFrameBitmapError>
Get a pooled bitmap, waiting for one to become available if max
pooled bitmaps are checked out