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§

source

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.

source

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

source

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

Implementors§