VPI - Vision Programming Interface

1.2 Release

Image Formats
enum  VPIImageFormat
 Pre-defined image formats. More...
 
enum  VPIPixelType
 Pre-defined pixel types. More...
 

Detailed Description

Enumeration Type Documentation

◆ VPIImageFormat

#include <vpi/ImageFormat.h>

Pre-defined image formats.

An image format defines how image pixels are interpreted. Each image format is defined by the following components:

These pre-defined formats are guaranteed to work with algorithms that explicitly support them. Image formats can also be user-defined using the vpiMakeImageFormat family of functions.

Using user-defined image formats with algorithms can lead to undefined behavior (segfaults, etc), but usually it works as expected. Result of algorithms using these image formats must be checked for correctness, as it's not guaranteed that they will work.

Enumerator
VPI_IMAGE_FORMAT_INVALID 

Denotes an invalid image format.

VPI_IMAGE_FORMAT_U8 

Single plane with one 8-bit unsigned integer channel.

VPI_IMAGE_FORMAT_S8 

Single plane with one 8-bit signed integer channel.

VPI_IMAGE_FORMAT_U16 

Single plane with one 16-bit unsigned integer channel.

VPI_IMAGE_FORMAT_S16 

Single plane with one 16-bit signed integer channel.

VPI_IMAGE_FORMAT_U32 

Single plane with one 32-bit unsigned integer channel.

VPI_IMAGE_FORMAT_S32 

Single plane with one 32-bit signed integer channel.

VPI_IMAGE_FORMAT_2S16 

Single plane with two interleaved 16-bit signed integer channel.

VPI_IMAGE_FORMAT_2S16_BL 

Single plane with two interleaved 16-bit signed integer channel.

VPI_IMAGE_FORMAT_F32 

Single plane with one 32-bit floating point channel.

VPI_IMAGE_FORMAT_F64 

Single plane with one 64-bit floating point channel.

VPI_IMAGE_FORMAT_2F32 

Single plane with two interleaved 32-bit floating point channels.

VPI_IMAGE_FORMAT_Y8 

Single plane with one pitch-linear 8-bit unsigned integer channel with limited-range luma (grayscale) information.

Values range from 16 to 235. Below this range is considered black, above is considered white.

VPI_IMAGE_FORMAT_Y8_ER 

Single plane with one pitch-linear 8-bit unsigned integer channel with full-range luma (grayscale) information.

Values range from 0 to 255.

VPI_IMAGE_FORMAT_Y8_BL 

Single plane with one block-linear 8-bit unsigned integer channel with limited-range luma (grayscale) information.

Values range from 16 to 235. Below this range is considered black, above is considered white.

VPI_IMAGE_FORMAT_Y8_ER_BL 

Single plane with one block-linear 8-bit unsigned integer channel with full-range luma (grayscale) information.

Values range from 0 to 255.

VPI_IMAGE_FORMAT_Y16_ER 

Single plane with one pitch-linear 16-bit unsigned integer channel with full-range luma (grayscale) information.

Values range from 0 to 65535.

VPI_IMAGE_FORMAT_Y16_ER_BL 

Single plane with one block-linear 16-bit unsigned integer channel with full-range luma (grayscale) information.

Values range from 0 to 65535.

VPI_IMAGE_FORMAT_NV12 

YUV420sp 8-bit pitch-linear format with limited range.

Format is composed of two planes:

  1. One 8-bit channel with luma (Y'). Values range from 16 to 235.
  2. Two interleaved 8-bit channels with chroma (Cb,Cr). Values range from 16 to 240. Resolution is half of luma plane, both horizontally and vertically. For a given pixel, Cb channel has lower memory address than Cr.
VPI_IMAGE_FORMAT_NV12_BL 

YUV420sp 8-bit block-linear format with limited range.

Format is composed of two planes:

  1. One 8-bit channel with luma (Y'). Values range from 16 to 235.
  2. Two interleaved 8-bit channels with chroma (Cb,Cr). Values range from 0 to 255. Resolution is half of luma plane, both horizontally and vertically. For a given pixel, Cb channel has lower memory address than Cr.
VPI_IMAGE_FORMAT_NV12_ER 

YUV420sp 8-bit pitch-linear format with full range.

Format is composed of two planes:

  1. One 8-bit channel with luma (Y'). Values range from 0 to 255.
  2. Two interleaved 8-bit channels with chroma (Cb,Cr). Values range from 0 to 255. Resolution is half of luma plane, both horizontally and vertically. For a given pixel, Cb channel has lower memory address than Cr.
VPI_IMAGE_FORMAT_NV12_ER_BL 

YUV420sp 8-bit block-linear format with full range.

Format is composed of two planes:

  1. One 8-bit channel with luma (Y'). Values range from 0 to 255.
  2. Two interleaved 8-bit channels with chroma (Cb,Cr). Values range from 0 to 255. Resolution is half of luma plane, both horizontally and vertically. For a given pixel, Cb channel has lower memory address than Cr.
VPI_IMAGE_FORMAT_NV24 

YUV444sp 8-bit pitch-linear format with limited range.

Format is composed of two planes:

  1. One 8-bit channel with luma (Y'). Values range from 16 to 235.
  2. Two interleaved 8-bit channels with chroma (Cb,Cr). Values range from 16 to 240. It has the same resolution as luma plane. For a given pixel, Cb channel has lower memory address than Cr.
VPI_IMAGE_FORMAT_NV24_BL 

YUV444sp 8-bit block-linear format with limited range.

Format is composed of two planes:

  1. One 8-bit channel with luma (Y'). Values range from 16 to 235.
  2. Two interleaved 8-bit channels with chroma (Cb,Cr). Values range from 0 to 255. It has the same resolution as luma plane. For a given pixel, Cb channel has lower memory address than Cr.
VPI_IMAGE_FORMAT_NV24_ER 

YUV444sp 8-bit pitch-linear format with full range.

Format is composed of two planes:

  1. One 8-bit channel with luma (Y'). Values range from 0 to 255.
  2. Two interleaved 8-bit channels with chroma (Cb,Cr). Values range from 0 to 255. It has the same resolution as luma plane. For a given pixel, Cb channel has lower memory address than Cr.
VPI_IMAGE_FORMAT_NV24_ER_BL 

YUV444sp 8-bit block-linear format with full range.

Format is composed of two planes:

  1. One 8-bit channel with luma (Y'). Values range from 0 to 255.
  2. Two interleaved 8-bit channels with chroma (Cb,Cr). Values range from 0 to 255. It has the same resolution as luma plane. For a given pixel, Cb channel has lower memory address than Cr.
VPI_IMAGE_FORMAT_UYVY 

YUV422 8-bit pitch-linear format in one plane with UYVY ordering and limited range.

VPI_IMAGE_FORMAT_UYVY_BL 

YUV422 8-bit block-linear format in one plane with UYVY ordering and limited range.

VPI_IMAGE_FORMAT_UYVY_ER 

YUV422 8-bit pitch-linear format in one plane with UYVY ordering and full range.

VPI_IMAGE_FORMAT_UYVY_ER_BL 

YUV422 8-bit block-linear format in one plane with UYVY ordering and full range.

VPI_IMAGE_FORMAT_YUYV 

YUV422 8-bit pitch-linear format in one plane with YUVY ordering and mitedrange.

Also known as YUY2 format.

VPI_IMAGE_FORMAT_YUYV_BL 

YUV422 8-bit block-linear format in one plane with YUVY ordering and limited range.

Also known as YUY2 format.

VPI_IMAGE_FORMAT_YUYV_ER 

YUV422 8-bit pitch-linear format in one plane with YUVY ordering and full range.

Also known as YUY2 format.

VPI_IMAGE_FORMAT_YUYV_ER_BL 

YUV422 8-bit block-linear format in one plane with YUVY ordering and full range.

Also known as YUY2 format.

VPI_IMAGE_FORMAT_RGB8 

Single plane with interleaved RGB 8-bit channel.

VPI_IMAGE_FORMAT_BGR8 

Single plane with interleaved BGR 8-bit channel.

VPI_IMAGE_FORMAT_RGBA8 

Single plane with interleaved RGBA 8-bit channel.

VPI_IMAGE_FORMAT_BGRA8 

Single plane with interleaved BGRA 8-bit channel.

Definition at line 98 of file ImageFormat.h.

◆ VPIPixelType

#include <vpi/PixelType.h>

Pre-defined pixel types.

Pixel types defines the geometry of pixels in a image plane without taking into account what the value represents. For example, a VPI_IMAGE_FORMAT_NV12 is composed of 2 planes, each one with the following pixel types:

  1. VPI_PIXEL_TYPE_U8 representing pixels as 8-bit unsigned values.
  2. VPI_PIXEL_TYPE_2U8 representing pixels as two interleaved 32-bit floating-point values.
Enumerator
VPI_PIXEL_TYPE_DEFAULT 

Used to signal that the pixel type must be inferred from image format.

VPI_PIXEL_TYPE_INVALID 

Signal format conversion errors.

VPI_PIXEL_TYPE_U8 

One channel of unsigned 8-bit value.

VPI_PIXEL_TYPE_2U8 

Two interleaved channels of unsigned 8-bit values.

VPI_PIXEL_TYPE_3U8 

Three interleaved channels of unsigned 8-bit values.

VPI_PIXEL_TYPE_4U8 

Four interleaved channels of unsigned 8-bit values.

VPI_PIXEL_TYPE_S8 

One channel of signed 8-bit value.

VPI_PIXEL_TYPE_2S8 

Two interleaved channels of signed 8-bit values.

VPI_PIXEL_TYPE_3S8 

Three interleaved channels of signed 8-bit values.

VPI_PIXEL_TYPE_4S8 

Four interleaved channels of signed 8-bit values.

VPI_PIXEL_TYPE_U16 

One channel of unsigned 16-bit value.

VPI_PIXEL_TYPE_2U16 

Two interleaved channels of unsigned 16-bit values.

VPI_PIXEL_TYPE_3U16 

Three interleaved channels of unsigned 16-bit values.

VPI_PIXEL_TYPE_4U16 

Four interleaved channels of unsigned 16-bit values.

VPI_PIXEL_TYPE_S16 

One channel of signed 16-bit value.

VPI_PIXEL_TYPE_2S16 

Two interleaved channels of signed 16-bit values.

VPI_PIXEL_TYPE_3S16 

Three interleaved channels of signed 16-bit values.

VPI_PIXEL_TYPE_4S16 

Four interleaved channels of signed 16-bit values.

VPI_PIXEL_TYPE_U32 

One channel of unsigned 32-bit value.

VPI_PIXEL_TYPE_2U32 

Two interleaved channels of unsigned 32-bit values.

VPI_PIXEL_TYPE_3U32 

Three interleaved channels of unsigned 32-bit values.

VPI_PIXEL_TYPE_4U32 

Four interleaved channels of unsigned 32-bit values.

VPI_PIXEL_TYPE_S32 

One channel of signed 32-bit value.

VPI_PIXEL_TYPE_2S32 

Two interleaved channels of signed 32-bit values.

VPI_PIXEL_TYPE_3S32 

Three interleaved channels of signed 32-bit values.

VPI_PIXEL_TYPE_4S32 

Four interleaved channels of signed 32-bit values.

VPI_PIXEL_TYPE_F32 

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

VPI_PIXEL_TYPE_2F32 

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

VPI_PIXEL_TYPE_3F32 

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

VPI_PIXEL_TYPE_4F32 

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

VPI_PIXEL_TYPE_U64 

One channel of unsigned 64-bit value.

VPI_PIXEL_TYPE_2U64 

Two interleaved channels of unsigned 64-bit values.

VPI_PIXEL_TYPE_3U64 

Three interleaved channels of unsigned 64-bit values.

VPI_PIXEL_TYPE_4U64 

Four interleaved channels of unsigned 64-bit values.

VPI_PIXEL_TYPE_S64 

One channel of signed 64-bit value.

VPI_PIXEL_TYPE_2S64 

Two interleaved channels of signed 64-bit values.

VPI_PIXEL_TYPE_3S64 

Three interleaved channels of signed 64-bit values.

VPI_PIXEL_TYPE_4S64 

Four interleaved channels of signed 64-bit values.

VPI_PIXEL_TYPE_F64 

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

VPI_PIXEL_TYPE_2F64 

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

VPI_PIXEL_TYPE_3F64 

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

VPI_PIXEL_TYPE_4F64 

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

Definition at line 83 of file PixelType.h.