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§
Source§impl MediaFrame_View
impl MediaFrame_View
pub const MAX_PLANES: u32 = 4u32
Sourcepub fn copy_mut(unnamed: MediaFrame_View) -> MediaFrame_View
pub fn copy_mut(unnamed: MediaFrame_View) -> MediaFrame_View
@private
Trait Implementations§
Source§impl Boxed for MediaFrame_View
impl Boxed for MediaFrame_View
Source§unsafe fn from_raw(
ptr: <MediaFrame_View as OpenCVFromExtern>::ExternReceive,
) -> Self
unsafe fn from_raw( ptr: <MediaFrame_View as OpenCVFromExtern>::ExternReceive, ) -> Self
Source§fn into_raw(
self,
) -> <MediaFrame_View as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw( self, ) -> <MediaFrame_View as OpenCVTypeExternContainer>::ExternSendMut
Source§fn as_raw(&self) -> <MediaFrame_View as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <MediaFrame_View as OpenCVTypeExternContainer>::ExternSend
Source§fn as_raw_mut(
&mut self,
) -> <MediaFrame_View as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self, ) -> <MediaFrame_View as OpenCVTypeExternContainer>::ExternSendMut
Source§impl Debug for MediaFrame_View
impl Debug for MediaFrame_View
Source§impl Drop for MediaFrame_View
impl Drop for MediaFrame_View
Source§impl MediaFrame_ViewTrait for MediaFrame_View
impl MediaFrame_ViewTrait for MediaFrame_View
fn as_raw_mut_MediaFrame_View(&mut self) -> *mut c_void
Source§impl MediaFrame_ViewTraitConst for MediaFrame_View
impl MediaFrame_ViewTraitConst for MediaFrame_View
fn as_raw_MediaFrame_View(&self) -> *const c_void
impl Send for MediaFrame_View
Auto Trait Implementations§
impl Freeze for MediaFrame_View
impl RefUnwindSafe for MediaFrame_View
impl !Sync for MediaFrame_View
impl Unpin for MediaFrame_View
impl UnwindSafe for MediaFrame_View
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
Source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
Source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
modification is imgproc::threshold
. Read more