Skip to main content

CvFrame

Struct CvFrame 

Source
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>

Source

pub fn add_bboxes(&mut self, boxes: Vec<CvBbox>, config: &CvBboxesConfig)

Append a bbox overlay batch, drawn after all previous overlays.

Source

pub fn clear_overlays(&mut self)

Drop every overlay.

Source

pub fn render(&self) -> Result<Texture>

Source

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.

Source

pub fn render_with_rgba(&self, base_rgba: &[u8]) -> Result<Texture>

Source

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§

Source§

impl<'a> Default for CvFrame<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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>
where &'a Texture: Unpin, *const u8 is !null: Unpin,

§

impl<'a> UnsafeUnpin for CvFrame<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.