Class cv::MediaFrame::View#
Provides access to the MediaFrame's underlying data. View details
#include <opencv2/gapi/media.hpp>Collaboration diagram for cv::MediaFrame::View:
Detailed 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.
Member Typedef Documentation#
Callback#
typedef std::function< void()> cv::MediaFrame::View::Callback
Ptrs#
typedef std::array< void *, MAX_PLANES > cv::MediaFrame::View::Ptrs
Strides#
typedef std::array< std::size_t, MAX_PLANES > cv::MediaFrame::View::Strides
Constructor & Destructor Documentation#
View()#
cv::MediaFrame::View::View(const View &)
View()#
cv::MediaFrame::View::View(
Ptrs && ptrs,
Strides && strs,
Callback && cb = )
View()#
cv::MediaFrame::View::View(View &&)
~View()#
cv::MediaFrame::View::~View()
Member Function Documentation#
operator=()#
View & cv::MediaFrame::View::operator=(const View &)
Member Data Documentation#
MAX_PLANES#
static const size_t cv::MediaFrame::View::MAX_PLANES = 4
ptr#
Ptrs cv::MediaFrame::View::ptr
Array of image plane pointers.
stride#
Strides cv::MediaFrame::View::stride
Array of image plane strides, in bytes.
m_cb#
Callback cv::MediaFrame::View::m_cb
Source file#
The documentation for this class was generated from the following file:
opencv2/gapi/media.hpp