VPI - Vision Programming Interface

1.2 Release

PixelType.h File Reference

Defines types and functions to handle pixel types. More...

#include "DataLayout.h"
#include "detail/FormatUtils.h"
+ Include dependency graph for PixelType.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define VPI_MAKE_PIXEL_TYPE_ABBREV(memLayout, dataType, packing)
 Creates a user-defined pixel type constant using abbreviated parameters. More...
 
#define VPI_MAKE_PIXEL_TYPE(memLayout, dataType, packing)
 Creates a user-defined pixel type constant. More...
 
enum  VPIPixelType
 Pre-defined pixel types. More...
 
VPIPixelType vpiMakePixelType (VPIMemLayout memLayout, VPIDataType dataType, VPIPacking packing)
 Creates a user-defined pixel type. More...
 
VPIPacking vpiPixelTypeGetPacking (VPIPixelType type)
 Get the packing of a pixel type. More...
 
int vpiPixelTypeGetBitsPerPixel (VPIPixelType type)
 Get the number of bits per pixel of a pixel type. More...
 
void vpiPixelTypeGetBitsPerChannel (VPIPixelType type, int32_t *bits)
 Get the number of bits per channel of a pixel type. More...
 
VPIDataType vpiPixelTypeGetDataType (VPIPixelType type)
 Get the data type of a pixel type. More...
 
VPIMemLayout vpiPixelTypeGetMemLayout (VPIPixelType type)
 Get the memory layout of a pixel type. More...
 
int vpiPixelTypeGetChannelCount (VPIPixelType type)
 Get the number of channels of a pixel type. More...
 
const char * vpiPixelTypeGetName (VPIPixelType type)
 Returns a string representation of the pixel type. More...
 

Detailed Description

Defines types and functions to handle pixel types.

Definition in file PixelType.h.

Macro Definition Documentation

◆ VPI_MAKE_PIXEL_TYPE

#define VPI_MAKE_PIXEL_TYPE (   memLayout,
  dataType,
  packing 
)

Creates a user-defined pixel type constant.

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

#define VPI_MAKE_PIXEL_TYPE(memLayout, dataType, packing)
Creates a user-defined pixel type constant.
Definition: PixelType.h:221
@ VPI_PACKING_X32_Y32
Two 32-bit channels in two 32-bit words.
Definition: DataLayout.h:189
@ VPI_MEM_LAYOUT_BL
Definition: DataLayout.h:256
@ VPI_DATA_TYPE_FLOAT
Channel are floating point values.
Definition: DataLayout.h:214
VPIPixelType
Pre-defined pixel types.
Definition: PixelType.h:84
Parameters
[in]memLayoutVPIMemLayout to be used.
[in]dataTypeVPIDataType to be used.
[in]packingFormat packing used, which also defines the number of channels.
Returns
The user-defined pixel type.

Definition at line 221 of file PixelType.h.

◆ VPI_MAKE_PIXEL_TYPE_ABBREV

#define VPI_MAKE_PIXEL_TYPE_ABBREV (   memLayout,
  dataType,
  packing 
)

Creates a user-defined pixel type constant using abbreviated parameters.

This macro allows passing abbreviated format parameters (without the parameter type prefix). Example to create a block-linear format two interleaved 32-bit floating point channels:

VPIPixelType type = VPI_MAKE_PIXEL_TYPE_ABBREV(BL, FLOAT, X32_Y32);
#define VPI_MAKE_PIXEL_TYPE_ABBREV(memLayout, dataType, packing)
Creates a user-defined pixel type constant using abbreviated parameters.
Definition: PixelType.h:203
Parameters
[in]memLayoutVPIMemLayout to be used, without the VPI_MEM_LAYOUT_ prefix.
[in]dataTypeVPIDataType to be used, without the VPI_DATA_TYPE_ prefix.
[in]packingFormat packing used, which also defines the number of channels, without the VPI_PACKING_ prefix.
Returns
The user-defined pixel type.

Definition at line 203 of file PixelType.h.

Function Documentation

◆ vpiMakePixelType()

VPIPixelType vpiMakePixelType ( VPIMemLayout  memLayout,
VPIDataType  dataType,
VPIPacking  packing 
)

Creates a user-defined pixel type.

When the pre-defined pixel types aren't enough, user-defined formats can be created.

Parameters
[in]memLayoutVPIMemLayout to be used.
[in]dataTypeVPIDataType to be used.
[in]packingFormat packing used, which also defines the number of channels.
Returns
The user-defined pixel type.

◆ vpiPixelTypeGetBitsPerChannel()

void vpiPixelTypeGetBitsPerChannel ( VPIPixelType  type,
int32_t *  bits 
)

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

Parameters
[in]typePixel type to be queried.
[out]bitsPointer to an int32_t array with 4 elements where output will be stored. If it's NULL, the function is a no-op.

◆ vpiPixelTypeGetBitsPerPixel()

int vpiPixelTypeGetBitsPerPixel ( VPIPixelType  type)

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

Parameters
[in]typePixel type to be queried.
Returns
The number of bits per pixel.

◆ vpiPixelTypeGetChannelCount()

int vpiPixelTypeGetChannelCount ( VPIPixelType  type)

Get the number of channels of a pixel type.

Parameters
[in]typePixel type to be queried.
Returns
The number of channels of the pixel type.

◆ vpiPixelTypeGetDataType()

VPIDataType vpiPixelTypeGetDataType ( VPIPixelType  type)

Get the data type of a pixel type.

Parameters
[in]typePixel type to be queried.
Returns
The data type of the pixel type.

◆ vpiPixelTypeGetMemLayout()

VPIMemLayout vpiPixelTypeGetMemLayout ( VPIPixelType  type)

Get the memory layout of a pixel type.

Parameters
[in]typePixel type to be queried.
Returns
The memory layout of the pixel type.

◆ vpiPixelTypeGetName()

const char* vpiPixelTypeGetName ( VPIPixelType  type)

Returns a string representation of the pixel type.

Parameters
[in]typePixel type to be returned.
Returns
The string representation of the pixel type. Returned string is valid until next call of this function from the same calling thread.

◆ vpiPixelTypeGetPacking()

VPIPacking vpiPixelTypeGetPacking ( VPIPixelType  type)

Get the packing of a pixel type.

Parameters
[in]typePixel type to be queried.
Returns
The format's packing.