56 #ifndef NV_VPI_OPENCV_INTEROP_HPP
57 #define NV_VPI_OPENCV_INTEROP_HPP
59 #include "detail/OpenCVUtils.hpp"
63 #include <opencv2/core/core.hpp>
121 VPIStatus status = ::nv::vpi::detail::FillImageData(mat, fmt, &imgData);
169 VPIStatus status = ::nv::vpi::detail::FillImageData(mat, &imgData);
217 status = ::nv::vpi::detail::FillImageData(mat, fmt, &imgData);
267 VPIStatus status = ::nv::vpi::detail::FillImageData(matPlanes, fmt, &imgData);
314 status = ::nv::vpi::detail::FillImageData(matPlanes, fmt, &imgData);
353 return ::nv::vpi::detail::ExportOpenCVMat(imgData, *mat);
377 if (matPlanes == NULL)
382 return ::nv::vpi::detail::ExportOpenCVMatPlanes(imgData, *matPlanes);
412 return ::nv::vpi::detail::FillImageData(mat, imgData);
447 return ::nv::vpi::detail::FillImageData(mat, fmt, imgData);
488 return ::nv::vpi::detail::FillImageData(matPlanes, fmt, imgData);
Functions and structures for dealing with VPI images.
struct VPIImageImpl * VPIImage
A handle to an image.
VPIStatus vpiImageCreateWrapper(const VPIImageData *data, const VPIImageWrapperParams *params, uint64_t flags, VPIImage *img)
Create an image object by wrapping an existing memory block.
VPIStatus vpiImageSetWrapper(VPIImage img, const VPIImageData *data)
Redefines the wrapped memory in an existing VPIImage wrapper.
VPIStatus vpiImageGetFormat(VPIImage img, VPIImageFormat *format)
Get the image format.
Stores information about image characteristics and content.
VPIStatus vpiImageCreateWrapperOpenCVMatPlanes(const std::vector< cv::Mat > &matPlanes, VPIImageFormat fmt, uint64_t flags, VPIImage *img)
Wraps a vector of cv::Mats in a VPIImage, each cv::Mat representing one image plane.
VPIStatus vpiImageCreateWrapperOpenCVMat(const cv::Mat &mat, VPIImageFormat fmt, uint64_t flags, VPIImage *img)
Wraps a cv::Mat in an VPIImage with the given image format.
VPIStatus vpiImageDataExportOpenCVMat(const VPIImageData &imgData, cv::Mat *mat)
Fills an existing cv::Mat with data from VPIImageData coming from a locked VPIImage.
VPIStatus vpiImageSetWrappedOpenCVMat(VPIImage img, const cv::Mat &mat)
Redefines the wrapped cv::Mat of an existing VPIImage wrapper.
VPIStatus vpiImageSetWrappedOpenCVMatPlanes(VPIImage img, const std::vector< cv::Mat > &matPlanes)
Replaces the wrapped cv::Mat planes with new ones.
VPIStatus vpiImageDataExportOpenCVMatPlanes(const VPIImageData &imgData, std::vector< cv::Mat > *matPlanes)
Fills a vector of cv::Mat with all planes from VPIImageData.
VPIStatus vpiImageDataImportOpenCVMat(const cv::Mat &mat, VPIImageData *imgData)
Fills an existing VPIImageData with data from given cv::Mat.
VPIStatus vpiImageDataImportOpenCVMatPlanes(const std::vector< cv::Mat > &matPlanes, VPIImageFormat fmt, VPIImageData *imgData)
Fills a vector of cv::Mat describing all planes from given VPIImageData forcing the given image forma...
@ VPI_SUCCESS
Operation completed successfully.
@ VPI_ERROR_INVALID_ARGUMENT
Invalid argument, either wrong range or value not accepted.