Data types

group NVCV_C_CORE_DATATYPE

Pre-defined data types. Data types defines the geometry of value elements, i.e., pixels in a image plane without taking into account what the value represents. For example, a NVCV_IMAGE_FORMAT_NV12 is composed of 2 planes, each one with the following data types:

Defines

NVCV_DATA_TYPE_NONE

Denotes a special image format that doesn’t represent any particular type (like void).

NVCV_DATA_TYPE_U8

One channel of unsigned 8-bit value.

NVCV_DATA_TYPE_2U8

Two interleaved channels of unsigned 8-bit values.

NVCV_DATA_TYPE_3U8

Three interleaved channels of unsigned 8-bit values.

NVCV_DATA_TYPE_4U8

Four interleaved channels of unsigned 8-bit values.

NVCV_DATA_TYPE_S8

One channel of signed 8-bit value.

NVCV_DATA_TYPE_2S8

Two interleaved channels of signed 8-bit values.

NVCV_DATA_TYPE_3S8

Three interleaved channels of signed 8-bit values.

NVCV_DATA_TYPE_4S8

Four interleaved channels of signed 8-bit values.

NVCV_DATA_TYPE_U16

One channel of unsigned 16-bit value.

NVCV_DATA_TYPE_2U16

Two interleaved channels of unsigned 16-bit values.

NVCV_DATA_TYPE_3U16

Three interleaved channels of unsigned 16-bit values.

NVCV_DATA_TYPE_4U16

Four interleaved channels of unsigned 16-bit values.

NVCV_DATA_TYPE_S16

One channel of signed 16-bit value.

NVCV_DATA_TYPE_2S16

Two interleaved channels of signed 16-bit values.

NVCV_DATA_TYPE_3S16

Three interleaved channels of signed 16-bit values.

NVCV_DATA_TYPE_4S16

Four interleaved channels of signed 16-bit values.

NVCV_DATA_TYPE_U32

One channel of unsigned 32-bit value.

NVCV_DATA_TYPE_2U32

Two interleaved channels of unsigned 32-bit values.

NVCV_DATA_TYPE_3U32

Three interleaved channels of unsigned 32-bit values.

NVCV_DATA_TYPE_4U32

Four interleaved channels of unsigned 32-bit values.

NVCV_DATA_TYPE_S32

One channel of signed 32-bit value.

NVCV_DATA_TYPE_2S32

Two interleaved channels of signed 32-bit values.

NVCV_DATA_TYPE_3S32

Three interleaved channels of signed 32-bit values.

NVCV_DATA_TYPE_4S32

Four interleaved channels of signed 32-bit values.

NVCV_DATA_TYPE_F16

One channel of 16-bit IEEE 754 floating-point value.

NVCV_DATA_TYPE_2F16

Two interleaved channels of 16-bit IEEE 754 floating-point values.

NVCV_DATA_TYPE_3F16

Three interleaved channels of 16-bit IEEE 754 floating-point values.

NVCV_DATA_TYPE_4F16

Four interleaved channels of 16-bit IEEE 754 floating-point values.

NVCV_DATA_TYPE_F32

One channel of 32-bit IEEE 754 floating-point value.

NVCV_DATA_TYPE_2F32

Two interleaved channels of 32-bit IEEE 754 floating-point values.

NVCV_DATA_TYPE_3F32

Three interleaved channels of 32-bit IEEE 754 floating-point values.

NVCV_DATA_TYPE_4F32

Four interleaved channels of 32-bit IEEE 754 floating-point values.

NVCV_DATA_TYPE_U64

One channel of unsigned 64-bit value.

NVCV_DATA_TYPE_2U64

Two interleaved channels of unsigned 64-bit values.

NVCV_DATA_TYPE_3U64

Three interleaved channels of unsigned 64-bit values.

NVCV_DATA_TYPE_4U64

Four interleaved channels of unsigned 64-bit values.

NVCV_DATA_TYPE_S64

One channel of signed 64-bit value.

NVCV_DATA_TYPE_2S64

Two interleaved channels of signed 64-bit values.

NVCV_DATA_TYPE_3S64

Three interleaved channels of signed 64-bit values.

NVCV_DATA_TYPE_4S64

Four interleaved channels of signed 64-bit values.

NVCV_DATA_TYPE_F64

One channel of 64-bit IEEE 754 floating-point value.

NVCV_DATA_TYPE_2F64

Two interleaved channels of 64-bit IEEE 754 floating-point values.

NVCV_DATA_TYPE_3F64

Three interleaved channels of 64-bit IEEE 754 floating-point values.

NVCV_DATA_TYPE_4F64

Four interleaved channels of 64-bit IEEE 754 floating-point values.

NVCV_DATA_TYPE_C64

One channel of 64-bit IEEE 754 complex floating-point value (2 32-bit floats).

NVCV_DATA_TYPE_2C64

Two interleaved channels of 64-bit IEEE 754 complex floating-point values (4 32-bit floats).

NVCV_DATA_TYPE_3C64

Three interleaved channels of 64-bit IEEE 754 complex floating-point values (6 32-bit floats).

NVCV_DATA_TYPE_4C64

Four interleaved channels of 64-bit IEEE 754 complex floating-point values (8 32-bit floats).

NVCV_DATA_TYPE_C128

One channel of 128-bit IEEE 754 complex floating-point value (2 64-bit floats).

NVCV_DATA_TYPE_2C128

Two interleaved channels of 128-bit IEEE 754 complex floating-point values (4 64-bit floats).

NVCV_MAKE_DATA_TYPE(dataKind, packing)

Creates a user-defined data type constant.

Example to create a block-linear format two interleaved 32-bit floating point channels:

NVCVDataType type = NVCV_MAKE_DATA_TYPE(NVCV_DATA_KIND_FLOAT, NVCV_PACKING_X32_Y32);

Parameters:
  • dataKind[in] NVCVDataKind to be used.

  • packing[in] Format packing used, which also defines the number of channels.

Returns:

The user-defined data type.

Typedefs

typedef uint64_t NVCVDataType

Functions

NVCV_PUBLIC NVCVStatus nvcvMakeDataType (NVCVDataType *outPixType, NVCVDataKind dataKind, NVCVPacking packing)

Creates a user-defined data type. When the pre-defined data types aren’t enough, user-defined formats can be created.

Parameters:
  • outPixType[out] The user-defined data type.

    • Cannot be NULL.

  • dataKind[in] NVCVDataKind to be used.

  • packing[in] Format packing used, which also defines the number of channels.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some argument is outside its valid range.

  • NVCV_SUCCESS – Operation executed successfully.

NVCV_PUBLIC NVCVStatus nvcvDataTypeGetPacking (NVCVDataType type, NVCVPacking *outPacking)

Get the packing of a data type.

Parameters:
  • type[in] Data type to be queried.

  • outPacking[out] The format’s packing.

    • Cannot be NULL.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some argument is outside its valid range.

  • NVCV_SUCCESS – Operation executed successfully.

NVCV_PUBLIC NVCVStatus nvcvDataTypeGetBitsPerPixel (NVCVDataType type, int32_t *outBPP)

Get the number of bits per pixel of a data type.

Parameters:
  • type[in] Data type to be queried.

  • outBPP[out] The number of bits per pixel.

    • Cannot be NULL.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some argument is outside its valid range.

  • NVCV_SUCCESS – Operation executed successfully.

NVCV_PUBLIC NVCVStatus nvcvDataTypeGetBitsPerChannel (NVCVDataType type, int32_t *outBits)

Get the number of bits per channel of a data type.

Parameters:
  • type[in] Data type to be queried.

  • outBits[out] Pointer to an int32_t array with 4 elements where output will be stored.

    • Cannot be NULL.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some argument is outside its valid range.

  • NVCV_SUCCESS – Operation executed successfully.

NVCV_PUBLIC NVCVStatus nvcvDataTypeGetAlignment (NVCVDataType type, int32_t *outAlignment)

Get the required address alignment for each data element.

The returned alignment is guaranteed to be a power-of-two.

Parameters:
  • type[in] Data type to be queried.

  • outAlignment[out] Pointer to an int32_t where the required alignment is to be stored.

    • Cannot be NULL.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some argument is outside its valid range.

  • NVCV_SUCCESS – Operation executed successfully.

NVCV_PUBLIC NVCVStatus nvcvDataTypeGetDataKind (NVCVDataType type, NVCVDataKind *outDataKind)

Get the data type of a data type.

Parameters:
  • type[in] Data type to be queried.

  • outDataKind[out] The data type of the data type.

    • Cannot be NULL.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some argument is outside its valid range.

  • NVCV_SUCCESS – Operation executed successfully.

NVCV_PUBLIC NVCVStatus nvcvDataTypeGetNumChannels (NVCVDataType type, int32_t *outNumChannels)

Get the number of channels of a data type.

Parameters:
  • type[in] Data type to be queried.

  • outNumChannels[out] The number of channels of the data type.

    • Must not be NULL.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some argument is outside its valid range.

  • NVCV_SUCCESS – Operation executed successfully.

NVCV_PUBLIC const char * nvcvDataTypeGetName (NVCVDataType type)

Returns a string representation of the data type.

Parameters:

type[in] Data type to be returned.

Returns:

The string representation of the data type. Returned string is valid until next call of this function from the same calling thread. Returned pointer must not be freed.

NVCV_PUBLIC NVCVStatus nvcvDataTypeGetChannelType (NVCVDataType type, int32_t channel, NVCVDataType *outChannelTpe)

Get the data type for a given channel index.

It returns a single-channel data type that corresponds to the given channel of the input data type.

For instance: The channel #2 of NVCV_DATA_TYPE_3U8 is NVCV_DATA_TYPE_U8.

Parameters:
  • type[in] Data type to be queried.

  • channel[in] Channel whose data type is to be returned.

    • Must be between 0 and the maximum number of channels in type.

  • outChannelType[out] The data type of the given channel. The memory layout and data type are the same as type.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some argument is outside its valid range.

  • NVCV_SUCCESS – Operation executed successfully.

NVCV_PUBLIC NVCVStatus nvcvDataTypeGetStrideBytes (NVCVDataType type, int32_t *pixStrideBytes)

Returns the stride/size in bytes of the pixel in memory.

Parameters:
  • type[in] Data type to be queried.

  • pixStrideBytes[out] The size in bytes of the pixel

    • Must not be NULL.