Class DataType

Class Documentation

class DataType

Public Functions

constexpr DataType()

Default constructor. Initializes to a default data type.

explicit constexpr DataType(NVCVDataType type)

Construct from a native data type.

Parameters:

type – The native data type.

inline DataType(DataKind dataKind, Packing packing)

Construct from a data kind and packing.

Parameters:
  • dataKind – The kind of data (e.g., floating point, integer).

  • packing – The packing of the data (e.g., channel ordering).

constexpr operator NVCVDataType() const

Implicit conversion to the native data type.

Returns:

The native data type.

inline Packing packing() const
inline std::array<int32_t, 4> bitsPerChannel() const
inline DataKind dataKind() const
inline int32_t numChannels() const
inline DataType channelType(int32_t channel) const
inline int32_t strideBytes() const
inline int32_t bitsPerPixel() const
inline int32_t alignment() const

Public Static Functions

static constexpr DataType ConstCreate(DataKind dataKind, Packing packing)

Construct a constant data type from a data kind and packing.

Parameters:
  • dataKind – The kind of data.

  • packing – The packing of the data.

Returns:

The constructed data type.