pub struct CvFrame<'a> {
pub base: Option<&'a Texture>,
pub w: i32,
pub h: i32,
pub overlays: Vec<CvOverlay>,
}Expand description
Diagnostic frame: borrowed base pixels plus ordered CPU overlays.
base borrows a packed RGBA8 texture; render reads it back before
compositing. A None base composites over a black canvas.
Donor: oa::CvFrame.
Fields§
§base: Option<&'a Texture>Borrowed RGBA8 device image read back during Self::render.
w: i32§h: i32§overlays: Vec<CvOverlay>Implementations§
Source§impl<'a> CvFrame<'a>
impl<'a> CvFrame<'a>
Sourcepub fn add_bboxes(&mut self, boxes: Vec<CvBbox>, config: &CvBboxesConfig)
pub fn add_bboxes(&mut self, boxes: Vec<CvBbox>, config: &CvBboxesConfig)
Append a bbox overlay batch, drawn after all previous overlays.
Sourcepub fn clear_overlays(&mut self)
pub fn clear_overlays(&mut self)
Drop every overlay.
pub fn render(&self) -> Result<Texture>
Sourcepub fn render_on(&self, runtime: &Runtime) -> Result<Texture>
pub fn render_on(&self, runtime: &Runtime) -> Result<Texture>
Composite overlays over the borrowed base and upload the result.
§Errors
Returns an error for a non-positive extent, an undersized or unreadable base, or an invalid overlay config or box.
pub fn render_with_rgba(&self, base_rgba: &[u8]) -> Result<Texture>
Sourcepub fn render_with_rgba_on(
&self,
runtime: &Runtime,
base_rgba: &[u8],
) -> Result<Texture>
pub fn render_with_rgba_on( &self, runtime: &Runtime, base_rgba: &[u8], ) -> Result<Texture>
Composite overlays over explicit host RGBA8 pixels (or the borrowed
device base when base_rgba is empty).
§Errors
Returns an error for a non-positive extent, an undersized base, or an invalid overlay config or box.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CvFrame<'a>
impl<'a> !Send for CvFrame<'a>
impl<'a> !Sync for CvFrame<'a>
impl<'a> !UnwindSafe for CvFrame<'a>
impl<'a> Forget for CvFrame<'a>
impl<'a> Freeze for CvFrame<'a>
impl<'a> Move for CvFrame<'a>
impl<'a> Unpin for CvFrame<'a>
impl<'a> UnsafeUnpin for CvFrame<'a>where
&'a Texture: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<CvOverlay>: UnsafeUnpin,
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