Class Image

Inheritance Relationships

Base Type

Class Documentation

class Image : public nvcv::CoreResource<NVCVImageHandle, Image>

Represents an image resource managed by NVCV.

This class wraps the NVCVImageHandle and provides a high-level interface to manage images, including their allocation, deallocation, and querying of various properties like size and format.

Public Types

using HandleType = NVCVImageHandle
using Base = CoreResource<NVCVImageHandle, Image>
using Requirements = NVCVImageRequirements

Public Functions

inline Image(const Image &other)
inline Image(Image &&other)
inline Image &operator=(const Image &other)
inline Image &operator=(Image &&other)
inline explicit Image(const Requirements &reqs, const Allocator &alloc = nullptr)

Construct an Image with specific requirements.

Parameters:
  • reqs – The requirements for the image.

  • alloc – The allocator to use (optional).

inline explicit Image(const Size2D &size, ImageFormat fmt, const Allocator &alloc = nullptr, const MemAlignment &bufAlign = {})

Construct an Image with specified size, format, and alignment.

Parameters:
  • size – The size of the image.

  • fmt – The image format.

  • alloc – The allocator to use (optional).

  • bufAlign – The memory alignment (optional).

inline Size2D size() const

Get the size of the image.

Returns:

The size of the image.

inline ImageFormat format() const

Get the format of the image.

Returns:

The image format.

inline ImageData exportData() const

Export the underlying data of the image.

Returns:

The image data.

template<typename DATA>
inline Optional<DATA> exportData() const

Export the underlying data of the image with a specific type.

Template Parameters:

DATA – The type to cast the data to.

Returns:

The image data casted to the specified type.

inline void setUserPointer(void *ptr)

Set a user-defined pointer to the image.

Parameters:

ptr – The pointer to set.

inline void *userPointer() const

Retrieve the user-defined pointer associated with the image.

Returns:

The user pointer.

Public Static Functions

static inline Requirements CalcRequirements(const Size2D &size, ImageFormat fmt, const MemAlignment &bufAlign = {})

Calculate the requirements for image allocation.

Parameters:
  • size – The size of the image.

  • fmt – The image format.

  • bufAlign – The memory alignment (optional).

Returns:

The requirements for the image.