pub struct MediaFrame_View { /* private fields */ }
Expand description

Provides access to the MediaFrame’s underlying data.

This object contains the necessary information to access the pixel data of the associated MediaFrame: arrays of pointers and strides (distance between every plane row, in bytes) for every image plane, as defined in cv::MediaFormat. There may be up to four image planes in MediaFrame.

Depending on the MediaFrame::Access flag passed in MediaFrame::access(), a MediaFrame::View may be read- or write-only.

Depending on the MediaFrame::IAdapter implementation associated with the parent MediaFrame, writing to memory with MediaFrame::Access::R flag may have no effect or lead to undefined behavior. Same applies to reading the memory with MediaFrame::Access::W flag – again, depending on the IAdapter implementation, the host-side buffer the view provides access to may have no current data stored in (so in-place editing of the buffer contents may not be possible).

MediaFrame::View objects must be handled carefully, as an external resource associated with MediaFrame may be locked for the time the MediaFrame::View object exists. Obtaining MediaFrame::View should be seen as “map” and destroying it as “unmap” in the “map/unmap” idiom (applicable to OpenCL, device memory, remote memory).

When a MediaFrame buffer is accessed for writing, and the memory under MediaFrame::View::Ptrs is altered, the data synchronization of a host-side and device/remote buffer is not guaranteed until the MediaFrame::View is destroyed. In other words, the real data on the device or in a remote target may be updated at the MediaFrame::View destruction only – but it depends on the associated MediaFrame::IAdapter implementation.

Implementations§

Trait Implementations§

source§

impl Boxed for MediaFrame_View

source§

unsafe fn from_raw(ptr: *mut c_void) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> *mut c_void

Return an the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> *const c_void

Return the underlying raw pointer. Read more
source§

fn as_raw_mut(&mut self) -> *mut c_void

Return the underlying mutable raw pointer Read more
source§

impl Debug for MediaFrame_View

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for MediaFrame_View

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl MediaFrame_ViewTrait for MediaFrame_View

source§

impl MediaFrame_ViewTraitConst for MediaFrame_View

source§

impl Send for MediaFrame_View

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.