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.