Data types

group NVCV_CPP_CORE_DATATYPE

Defines types and functions to handle data types.

This class represents the data type of an element in a tensor or array. This includes the kind of data (e.g., floating point, integer), the packing of multiple channels (e.g., RGB), and additional meta-information.

Functions

inline std::ostream &operator<<(std::ostream &out, DataType type)
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).

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.

constexpr operator NVCVDataType() const

Implicit conversion to the native data type.

Returns:

The native data type.

inline Packing packing() const
inline int32_t bitsPerPixel() 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 alignment() const
class DataType
#include <DataType.hpp>