Utilities and definitions used when working with VPIImageFormat and VPIPixelFormat values. More...
Macros | |
#define | VPI_MAKE_SWIZZLE(x, y, z, w) ((VPISwizzle)VPI_DETAIL_MAKE_SWIZZLE(x, y, z, w)) |
Creates an user-defined swizzle operation. More... | |
#define | VPI_MAKE_IMAGE_FORMAT(colorSpace, chromaSubsamp, memLayout, dataType, swizzle, numPlanes, packing0, packing1, ...) |
Creates an user-defined image format constant using abbreviated parameters. More... | |
#define | VPI_MAKE_PIXEL_FORMAT(memLayout, dataType, packing) |
Creates an user-defined pixel format constant using abbreviated parameters. More... | |
Enumerations | |
enum | VPIFormatPacking |
Defines how channels are packed into an image plane element. More... | |
enum | VPIFormatDataType |
Defines the channel data type. More... | |
enum | VPIMemLayout |
Defines how the 2D plane pixels are laid out in memory. More... | |
enum | VPISwizzleChannel |
Defines the format channel names. More... | |
enum | VPISwizzle |
Defines the supported channel swizzle operations. More... | |
enum | VPIColorModel |
Defines color models. More... | |
enum | VPIColorSpace |
Defines color spaces. More... | |
enum | VPIChromaSubsampling |
Defines how chroma-subsampling is done. More... | |
enum | VPIImageFormat |
Pre-defined image formats. More... | |
enum | VPIPixelFormat |
Pre-defined pixel formats. More... | |
Functions | |
VPISwizzle | vpiMakeSwizzle (VPISwizzleChannel x, VPISwizzleChannel y, VPISwizzleChannel z, VPISwizzleChannel w) |
Creates an user-defined VPISwizzle operation. More... | |
VPIChromaSubsampling | vpiMakeChromaSubsampling (int divHoriz, int divVert, int centerSampleHoriz, int centerSampleVert) |
Creates an user-defined VPIChromaSubsampling definition. More... | |
VPIFormatPacking | vpiMakeFormatPacking (int fixed, int bitsX, int bitsY, int bitsZ, int bitsW) |
Returns a pre-defined VPIFormatPacking given the number of bits in each channel. More... | |
void | vpiFormatPackingGetParams (VPIFormatPacking packing, int *fixed, int *bitsX, int *bitsY, int *bitsZ, int *bitsW) |
Returns channels' information from a format packing. More... | |
int | vpiFormatPackingGetChannelCount (VPIFormatPacking packing) |
Returns the number of channels defined by the given packing. More... | |
int | vpiFormatPackingGetBitsPerPixel (VPIFormatPacking packing) |
Returns the number of bits per pixel of the given packing. More... | |
VPIImageFormat | vpiMakeImageFormat (VPIColorSpace colorSpace, VPIChromaSubsampling chromaSub, VPIMemLayout memLayout, VPIFormatDataType dataType, VPISwizzle swizzle, VPIFormatPacking packing0, VPIFormatPacking packing1, VPIFormatPacking packing2, VPIFormatPacking packing3) |
Creates an user-defined image format. More... | |
VPIFormatPacking | vpiImageFormatGetPlanePacking (VPIImageFormat fmt, int plane) |
Get the packing for a given plane of an image format. More... | |
int | vpiImageFormatGetPlaneBitsPerPixel (VPIImageFormat fmt, int plane) |
Get the image format's plane bits per pixel count. More... | |
VPIImageFormat | vpiImageFormatSetDataType (VPIImageFormat fmt, VPIFormatDataType dataType) |
Set the image format's data type. More... | |
VPIFormatDataType | vpiImageFormatGetDataType (VPIImageFormat fmt) |
Get the image format's data type. More... | |
VPISwizzle | vpiImageFormatGetSwizzle (VPIImageFormat fmt) |
Get the image format's channel swizzle operation. More... | |
VPISwizzle | vpiImageFormatGetPlaneSwizzle (VPIImageFormat fmt, int plane) |
Get the swizzle operation of the given image format's plane. More... | |
VPISwizzleChannel | vpiImageFormatGetSwizzleX (VPIImageFormat fmt) |
Get the color model channel that corresponds to the first component of given image format. More... | |
VPISwizzleChannel | vpiImageFormatGetSwizzleY (VPIImageFormat fmt) |
Get the color model channel that corresponds to the second component of given image format. More... | |
VPISwizzleChannel | vpiImageFormatGetSwizzleZ (VPIImageFormat fmt) |
Get the color model channel that corresponds to the third component of given image format. More... | |
VPISwizzleChannel | vpiImageFormatGetSwizzleW (VPIImageFormat fmt) |
Get the color model channel that corresponds to the fourth component of given image format. More... | |
VPIImageFormat | vpiImageFormatSetMemLayout (VPIImageFormat fmt, VPIMemLayout memLayout) |
Set the image format's memory layout. More... | |
VPIMemLayout | vpiImageFormatGetMemLayout (VPIImageFormat fmt) |
Get the image format's memory layout. More... | |
VPIImageFormat | vpiImageFormatSetColorSpace (VPIImageFormat fmt, VPIColorSpace colorSpace) |
Set the image format's color space. More... | |
VPIColorSpace | vpiImageFormatGetColorSpace (VPIImageFormat fmt) |
Get the image format's color space. More... | |
VPIColorModel | vpiImageFormatGetColorModel (VPIImageFormat fmt) |
Get the image format's color model. More... | |
VPIImageFormat | vpiImageFormatSetChromaSubsampling (VPIImageFormat fmt, VPIChromaSubsampling css) |
Set the image format's chroma subsampling type. More... | |
VPIChromaSubsampling | vpiImageFormatGetChromaSubsampling (VPIImageFormat fmt) |
Get the image format's chroma subsampling type. More... | |
int | vpiImageFormatGetChromaSubsamplingDivHoriz (VPIImageFormat fmt) |
Get the image format's chroma subsampling horizontal downscale factor. More... | |
int | vpiImageFormatGetChromaSubsamplingDivVert (VPIImageFormat fmt) |
Get the image format's chroma subsampling vertical downscale factor. More... | |
int | vpiImageFormatGetChromaSubsamplingCenterHoriz (VPIImageFormat fmt) |
Get the image format's chroma horizontal sample position. More... | |
int | vpiImageFormatGetChromaSubsamplingCenterVert (VPIImageFormat fmt) |
Get the image format's chroma vertical sample position. More... | |
int | vpiImageFormatGetPlaneChannelCount (VPIImageFormat fmt, int plane) |
Get the number of channels in a plane of an image format. More... | |
int | vpiImageFormatGetPlaneCount (VPIImageFormat fmt) |
Get the number of planes of an image format. More... | |
int | vpiImageFormatGetChannelCount (VPIImageFormat fmt) |
Get the total number of channels of an image format. More... | |
VPIPixelFormat | vpiImageFormatGetPlanePixelFormat (VPIImageFormat fmt, int plane) |
Get the pixel format of image format's plane. More... | |
VPIImageFormat | vpiImageFormatGetPlaneFormat (VPIImageFormat fmt, int plane) |
Get the plane format of an image format. More... | |
VPIImageFormat | vpiMakeImageFormatFromPlanes (VPIImageFormat plane0, VPIImageFormat plane1, VPIImageFormat plane2, VPIImageFormat plane3) |
Constructs an image format given the format of each plane. More... | |
VPIPixelFormat | vpiMakePixelFormat (VPIMemLayout memLayout, VPIFormatDataType dataType, VPIFormatPacking packing) |
Creates an user-defined pixel format. More... | |
VPIFormatPacking | vpiPixelFormatGetPacking (VPIPixelFormat fmt) |
Get the packing of a pixel format. More... | |
int | vpiPixelFormatGetBitsPerPixel (VPIPixelFormat fmt) |
Get the number of bits per pixel of a pixel format. More... | |
VPIFormatDataType | vpiPixelFormatGetDataType (VPIPixelFormat fmt) |
Get the data type of a pixel format. More... | |
VPIMemLayout | vpiPixelFormatGetMemLayout (VPIPixelFormat fmt) |
Get the memory layout of a pixel format. More... | |
int | vpiPixelFormatGetChannelCount (VPIPixelFormat fmt) |
Get the number of channels of a pixel format. More... | |
Utilities and definitions used when working with VPIImageFormat and VPIPixelFormat values.
Here the contituent parts of a VPIImageFormat and VPIPixelFormat are defined, along with functions to create and decompose them.
#define VPI_MAKE_IMAGE_FORMAT | ( | colorSpace, | |
chromaSubsamp, | |||
memLayout, | |||
dataType, | |||
swizzle, | |||
numPlanes, | |||
packing0, | |||
packing1, | |||
... | |||
) |
#include <vpi/ImageFormat.h>
Creates an user-defined image format constant using abbreviated parameters.
This macro allows passing abbreviated format parameters (without the parameter type prefix). Example to create a YUV422 ITU-R BT.709 block-linear format.
[in] | colorSpace | VPIColorSpace to be used, without the VPI_COLOR_SPACE_ prefix. |
[in] | chromaSubsamp | VPIChromaSubsampling to be used, without the VPI_CHROMA_SUBSAMPLING_ prefix. |
[in] | memLayout | VPIMemLayout to be used, without the VPI_MEM_LAYOUT_ prefix. |
[in] | dataType | VPIFormatDataType to be used, without the VPI_FORMAT_DATA_TYPE_ prefix. |
[in] | swizzle | VPISwizzle operation to be performed on the channels, without the VPI_SWIZZLE_ prefix. |
[in] | numPlanes | Number of planes this format has. |
[in] | packing0,packing1,... | Format packing of each plane, without the VPI_FORMAT_PACKING_ prefix. |
Definition at line 166 of file ImageFormat.h.
#define VPI_MAKE_PIXEL_FORMAT | ( | memLayout, | |
dataType, | |||
packing | |||
) |
#include <vpi/PixelFormat.h>
Creates an user-defined pixel format 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:
[in] | memLayout | VPIMemLayout to be used, without the VPI_MEM_LAYOUT_ prefix. |
[in] | dataType | VPIFormatDataType to be used, without the VPI_FORMAT_DATA_TYPE_ prefix. |
[in] | packing | Format packing used, which also defines the number of channels, without the VPI_FORMAT_PACKING_ prefix. |
Definition at line 118 of file PixelFormat.h.
#define VPI_MAKE_SWIZZLE | ( | x, | |
y, | |||
z, | |||
w | |||
) | ((VPISwizzle)VPI_DETAIL_MAKE_SWIZZLE(x, y, z, w)) |
#include <vpi/Format.h>
Creates an user-defined swizzle operation.
This macro is used to create an user-defined swizzle operation if it's not predefined xxx. Parameters are specified literally by X, Y, Z, 0, 1. They correpond to VPISwizzleChannel values. Example:
[in] | x | Channel that will correspond to the first component. |
[in] | y | Channel that will correspond to the second component. |
[in] | z | Channel that will correspond to the third component. |
[in] | w | Channel that will correspond to the component component. |
enum VPIChromaSubsampling |
#include <vpi/Format.h>
Defines how chroma-subsampling is done.
This is only applicable to image formats whose color model is YUV. Other image formats must use VPI_CHROMA_SUBSAMPLING_NONE. Chroma subsampling is defined by 4 parameters:
Enumerator | |
---|---|
VPI_CHROMA_SUBSAMPLING_444 | 4:4:4 sub-sampling. Chroma has full horizontal and vertical resolution, meaning no chroma subsampling. |
VPI_CHROMA_SUBSAMPLING_422_BT601 | 4:2:2 BT.601 sub-sampling. Chroma has half horizontal and full vertical resolutions with chroma sample cosited with luma. |
VPI_CHROMA_SUBSAMPLING_422_COSITED | Alias to VPI_CHROMA_SUBSAMPLING_422_BT601. |
VPI_CHROMA_SUBSAMPLING_420_COSITED | 4:2:0 sub-sampling. Chroma has half horizontal and vertical resolutions with chroma sample cosited with luma. |
VPI_CHROMA_SUBSAMPLING_420_MPEG1 | 4:2:0 MPEG1 sub-sampling. Chroma has half horizontal vertical resolutions with chroma sample centered horizontally and vertically. |
VPI_CHROMA_SUBSAMPLING_420_MPEG2 | 4:2:0 MPEG2 sub-sampling. Chroma has half horizontal and vertical resolutions with chroma sample cosited horizontally and centered vertically. |
VPI_CHROMA_SUBSAMPLING_NONE | Used when no chroma subsampling takes place, specially for color spaces without chroma components. |
enum VPIColorModel |
#include <vpi/Format.h>
Defines color models.
A color model gives meaning to each channel of an image format. They are specified in a canonical XYZW ordering that can then be swizzled to the desired ordering.
enum VPIColorSpace |
#include <vpi/Format.h>
Defines color spaces.
Color space specifies how physical colors are organized in a particular representation. Each VPIColorSpace is associated with a VPIColorModel.
enum VPIFormatDataType |
#include <vpi/Format.h>
Defines the channel data type.
enum VPIFormatPacking |
#include <vpi/Format.h>
Defines how channels are packed into an image plane element.
Packing encodes how many channels the plane element has, and how they are arranged in memory.
Up to 4 channels (denoted by X, Y, Z, W) can be packed into an image plane element, each one occupying a specified number of bits.
When two channels are specified one right after the other, they are ordered from most-significant bit to least-significant bit. Words are separated by underscores. For example:
X8Y8Z8W8 = a single 32-bit word containing 4 channels, 8 bits each.
In little-endian architectures:
Address 0 || 1 || 2 || 3 WWWWWWWWZZZZZZZZYYYYYYYYXXXXXXXX
In big-endian architectures:
Address 0 || 1 || 2 || 3 XXXXXXXXYYYYYYYYZZZZZZZZWWWWWWWW
X8_Y8_Z8_W8 = four consecutive 8-bit words, corresponding to 4 channels, 8 bits each.
In little-endian architectures:
Address 0 || 1 || 2 || 3 XXXXXXXXYYYYYYYYZZZZZZZZWWWWWWWW
In big-endian architectures:
Address 0 || 1 || 2 || 3 XXXXXXXXYYYYYYYYZZZZZZZZWWWWWWWW
In cases where a word is less than 8 bits (e.g., X1 1-bit channel), channels are ordered from LSB to MSB within a word.
Some formats allow different packings when pixels' horizontal coordinate is even or odd. For instance, every pixel of YUV422 packed format contains an Y channel, while only even pixels contain the U channel, and odd pixels contain V channel. Such formats use a double-underscore to separate the even pixels from the odd pixels. The packing just described might be referred to X8_Y8__X8_Z8, where X = luma, Y = U chroma, Z = V chroma.
enum 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 algoriths that explicitly support them. Image formats can also be user-defined using vpiMakeImageFormat or vpiMakeImageFormatFromPlanes 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.
Definition at line 93 of file ImageFormat.h.
enum VPIMemLayout |
#include <vpi/Format.h>
Defines how the 2D plane pixels are laid out in memory.
This defines how a pixel are addressed, i.e., given its \((x,y)\) coordinate, what's its memory address. Block-linear formats have a proprietary memory representation and aren't supposed to be addressed by the user directly.
enum VPIPixelFormat |
#include <vpi/PixelFormat.h>
Pre-defined pixel formats.
Pixel formats 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 formats:
Definition at line 79 of file PixelFormat.h.
enum VPISwizzle |
#include <vpi/Format.h>
Defines the supported channel swizzle operations.
The operations map an input vector \((x,y,z,w)\) into an output vector \((x',y',z',w')\). Any output channel can select any of the input channels, or the constants zero or one. For example, the swizzle "X000" selects the first channel, whereas swizzle "ZYXW" swaps the X and Z channels, needed for conversion between RGBA and BGRA image formats.
enum VPISwizzleChannel |
#include <vpi/Format.h>
Defines the format channel names.
The channels are color model-agnostic.
int vpiFormatPackingGetBitsPerPixel | ( | VPIFormatPacking | packing | ) |
#include <vpi/Format.h>
Returns the number of bits per pixel of the given packing.
[in] | packing | The format packing to be queried. |
int vpiFormatPackingGetChannelCount | ( | VPIFormatPacking | packing | ) |
#include <vpi/Format.h>
Returns the number of channels defined by the given packing.
[in] | packing | The format packing to be queried. |
void vpiFormatPackingGetParams | ( | VPIFormatPacking | packing, |
int * | fixed, | ||
int * | bitsX, | ||
int * | bitsY, | ||
int * | bitsZ, | ||
int * | bitsW | ||
) |
#include <vpi/Format.h>
Returns channels' information from a format packing.
[in] | packing | The format packing to be queried. |
[out] | fixed | 1 if each component is assigned to its own word, 0 if all components share the same word. |
[out] | bitsX | Number of bits in the first channel. Value can't be 0. |
[out] | bitsY | Number of bits in the second channel. Can be 0 if channel isn't used. |
[out] | bitsZ | Number of bits in the second channel. Can be 0 if bitsY is 0 and this channel isn't used. |
[out] | bitsW | Number of bits in the second channel. Can be 0 if bitsZ is 0 and this channel isn't used. |
int vpiImageFormatGetChannelCount | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the total number of channels of an image format.
[in] | fmt | Image format to be queried. |
VPIChromaSubsampling vpiImageFormatGetChromaSubsampling | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the image format's chroma subsampling type.
[in] | fmt | Image format to be queried. |
int vpiImageFormatGetChromaSubsamplingCenterHoriz | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the image format's chroma horizontal sample position.
[in] | fmt | Image format to be queried. |
0 | Chroma sample is horizontally aligned with the corresponding luma sample. |
1 | Chroma sample is between the current (x) and the next (x+1) luma sample. |
int vpiImageFormatGetChromaSubsamplingCenterVert | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the image format's chroma vertical sample position.
[in] | fmt | Image format to be queried. |
0 | Chroma sample is vertically aligned with the corresponding luma sample. |
1 | Chroma sample is between the current (y) and the next (y+1) luma sample. |
int vpiImageFormatGetChromaSubsamplingDivHoriz | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the image format's chroma subsampling horizontal downscale factor.
[in] | fmt | Image format to be queried. |
int vpiImageFormatGetChromaSubsamplingDivVert | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the image format's chroma subsampling vertical downscale factor.
[in] | fmt | Image format to be queried. |
VPIColorModel vpiImageFormatGetColorModel | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the image format's color model.
[in] | fmt | Image format to be queried. |
VPIColorSpace vpiImageFormatGetColorSpace | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the image format's color space.
[in] | fmt | Image format to be queried. |
VPIFormatDataType vpiImageFormatGetDataType | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the image format's data type.
[in] | fmt | Image format to be queried. |
VPIMemLayout vpiImageFormatGetMemLayout | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the image format's memory layout.
[in] | fmt | Image format to be queried. |
int vpiImageFormatGetPlaneBitsPerPixel | ( | VPIImageFormat | fmt, |
int | plane | ||
) |
#include <vpi/ImageFormat.h>
Get the image format's plane bits per pixel count.
[in] | fmt | Image format to be queried. |
[in] | plane | Which plane is to be queried. Valid values range from 0 (first plane) to 3 (fourth plane). |
int vpiImageFormatGetPlaneChannelCount | ( | VPIImageFormat | fmt, |
int | plane | ||
) |
#include <vpi/ImageFormat.h>
Get the number of channels in a plane of an image format.
[in] | fmt | Image format to be queried. |
[in] | plane | Plane to be queried. Valid values range from 0 (first) to 3 (fourth and last) plane. |
int vpiImageFormatGetPlaneCount | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the number of planes of an image format.
[in] | fmt | Image format to be queried. |
VPIImageFormat vpiImageFormatGetPlaneFormat | ( | VPIImageFormat | fmt, |
int | plane | ||
) |
#include <vpi/ImageFormat.h>
Get the plane format of an image format.
[in] | fmt | Image format to be queried. |
[in] | plane | Plane to be queried. Valid values range from 0 (first) to 3 (fourth and last) plane. |
VPIFormatPacking vpiImageFormatGetPlanePacking | ( | VPIImageFormat | fmt, |
int | plane | ||
) |
#include <vpi/ImageFormat.h>
Get the packing for a given plane of an image format.
[in] | fmt | Image format to be queried. |
[in] | plane | Which plane whose packing must be returned. Valid values range from 0 (first plane) to 3 (fourth plane). |
VPIPixelFormat vpiImageFormatGetPlanePixelFormat | ( | VPIImageFormat | fmt, |
int | plane | ||
) |
#include <vpi/ImageFormat.h>
Get the pixel format of image format's plane.
[in] | fmt | Image format to be queried. |
[in] | plane | Plane to be queried. Valid values range from 0 (first) to 3 (fourth and last) plane. |
VPISwizzle vpiImageFormatGetPlaneSwizzle | ( | VPIImageFormat | fmt, |
int | plane | ||
) |
#include <vpi/ImageFormat.h>
Get the swizzle operation of the given image format's plane.
[in] | fmt | Image format to be queried. |
[in] | plane | Plane to be queried. Valid values range from 0 (first) to 3 (fourth and last) plane. |
VPISwizzle vpiImageFormatGetSwizzle | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the image format's channel swizzle operation.
[in] | fmt | Image format to be queried. |
VPISwizzleChannel vpiImageFormatGetSwizzleW | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the color model channel that corresponds to the fourth component of given image format.
For example, given format VPI_IMAGE_FORMAT_BGRA8, its fourth component is alpha, which corresponds to the VPI_SWIZZLE_CHANNEL_W (fourth) channel of the color model VPI_COLOR_MODEL_RGBA.
[in] | fmt | Image format to be queried. |
VPISwizzleChannel vpiImageFormatGetSwizzleX | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the color model channel that corresponds to the first component of given image format.
For example, given format VPI_IMAGE_FORMAT_BGRA8, its first component is blue, which corresponds to the VPI_SWIZZLE_CHANNEL_Z (third) channel of the color model VPI_COLOR_MODEL_RGBA.
[in] | fmt | Image format to be queried. |
VPISwizzleChannel vpiImageFormatGetSwizzleY | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the color model channel that corresponds to the second component of given image format.
For example, given format VPI_IMAGE_FORMAT_BGRA8, its second component is green, which corresponds to the VPI_SWIZZLE_CHANNEL_Y (second) channel of the color model VPI_COLOR_MODEL_RGBA.
[in] | fmt | Image format to be queried. |
VPISwizzleChannel vpiImageFormatGetSwizzleZ | ( | VPIImageFormat | fmt | ) |
#include <vpi/ImageFormat.h>
Get the color model channel that corresponds to the third component of given image format.
For example, given format VPI_IMAGE_FORMAT_BGRA8, its third component is red, which corresponds to the VPI_SWIZZLE_CHANNEL_X (first) channel of the color model VPI_COLOR_MODEL_RGBA.
[in] | fmt | Image format to be queried. |
VPIImageFormat vpiImageFormatSetChromaSubsampling | ( | VPIImageFormat | fmt, |
VPIChromaSubsampling | css | ||
) |
#include <vpi/ImageFormat.h>
Set the image format's chroma subsampling type.
[in] | fmt | Image format have its chroma subsampling type replaced. |
[in] | css | The new chroma subsampling type. |
VPIImageFormat vpiImageFormatSetColorSpace | ( | VPIImageFormat | fmt, |
VPIColorSpace | colorSpace | ||
) |
#include <vpi/ImageFormat.h>
Set the image format's color space.
[in] | fmt | Image format have its color space replaced. |
[in] | colorSpace | The new color space. |
VPIImageFormat vpiImageFormatSetDataType | ( | VPIImageFormat | fmt, |
VPIFormatDataType | dataType | ||
) |
#include <vpi/ImageFormat.h>
Set the image format's data type.
[in] | fmt | Image format have its data type replaced. |
[in] | dataType | The new data type. |
VPIImageFormat vpiImageFormatSetMemLayout | ( | VPIImageFormat | fmt, |
VPIMemLayout | memLayout | ||
) |
#include <vpi/ImageFormat.h>
Set the image format's memory layout.
[in] | fmt | Image format have its memory layout replaced. |
[in] | memLayout | The new memory layout. |
VPIChromaSubsampling vpiMakeChromaSubsampling | ( | int | divHoriz, |
int | divVert, | ||
int | centerSampleHoriz, | ||
int | centerSampleVert | ||
) |
#include <vpi/Format.h>
Creates an user-defined VPIChromaSubsampling definition.
[in] | divHoriz | How many horizontal luma samples correspond to each chroma component. Must be 1 or 2. |
[in] | divVert | How many vertical luma samples correspond to each chroma component. Must be 1 or 2. |
[in] | centerSampleHoriz | If 0, chroma sample is aligned horizontally with corresponding luma sample. If 1, it's in the middle horizontally between its corresponding luma sample (x) and the next (x+1). |
[in] | centerSampleVert | If 0, chroma sample is aligned vertically with corresponding luma sample. If 1, it's in the middle vertically between its corresponding luma sample (y) and the next (y+1). |
VPIFormatPacking vpiMakeFormatPacking | ( | int | fixed, |
int | bitsX, | ||
int | bitsY, | ||
int | bitsZ, | ||
int | bitsW | ||
) |
#include <vpi/Format.h>
Returns a pre-defined VPIFormatPacking given the number of bits in each channel.
This function calculates the VPIFormatPacking based on the channel characteristics at run time.
[in] | fixed | 1 if each component is assigned to its own word, 0 if all components share the same word. |
[in] | bitsX | Number of bits in the first channel. Value can't be 0. |
[in] | bitsY | Number of bits in the second channel. Can be 0 if channel isn't used. |
[in] | bitsZ | Number of bits in the second channel. Can be 0 if bitsY is 0 and this channel isn't used. |
[in] | bitsW | Number of bits in the second channel. Can be 0 if bitsZ is 0 and this channel isn't used. |
VPIImageFormat vpiMakeImageFormat | ( | VPIColorSpace | colorSpace, |
VPIChromaSubsampling | chromaSub, | ||
VPIMemLayout | memLayout, | ||
VPIFormatDataType | dataType, | ||
VPISwizzle | swizzle, | ||
VPIFormatPacking | packing0, | ||
VPIFormatPacking | packing1, | ||
VPIFormatPacking | packing2, | ||
VPIFormatPacking | packing3 | ||
) |
#include <vpi/ImageFormat.h>
Creates an user-defined image format.
When the pre-defined image formats aren't enough, user-defined image formats can be created.
[in] | colorSpace | VPIColorSpace to be used. |
[in] | chromaSub | VPIChromaSubsampling to be used. |
[in] | memLayout | VPIMemLayout to be used. |
[in] | dataType | VPIFormatDataType to be used. |
[in] | swizzle | VPISwizzle operation to be performed on the channels. |
[in] | packing0,packing1,packing2,packing3 | Format packing of each plane. When remaining planes aren't needed, pass VPI_FORMAT_PACKING_INVALID for them. |
VPIImageFormat vpiMakeImageFormatFromPlanes | ( | VPIImageFormat | plane0, |
VPIImageFormat | plane1, | ||
VPIImageFormat | plane2, | ||
VPIImageFormat | plane3 | ||
) |
#include <vpi/ImageFormat.h>
Constructs an image format given the format of each plane.
[in] | plane0,plane1,plane2,plane3 | Image format of each plane. When plane doesn't exist, pass VPI_IMAGE_FORMAT_INVALID. |
VPIPixelFormat vpiMakePixelFormat | ( | VPIMemLayout | memLayout, |
VPIFormatDataType | dataType, | ||
VPIFormatPacking | packing | ||
) |
#include <vpi/PixelFormat.h>
Creates an user-defined pixel format.
When the pre-defined pixel formats aren't enough, user-defined formats can be created.
[in] | memLayout | VPIMemLayout to be used. |
[in] | dataType | VPIFormatDataType to be used. |
[in] | packing | Format packing used, which also defines the number of channels. |
VPISwizzle vpiMakeSwizzle | ( | VPISwizzleChannel | x, |
VPISwizzleChannel | y, | ||
VPISwizzleChannel | z, | ||
VPISwizzleChannel | w | ||
) |
#include <vpi/Format.h>
Creates an user-defined VPISwizzle operation.
This is similar to VPI_MAKE_SWIZZLE, but accepts the swizzle channels as runtime variables.
[in] | x | Channel that will correspond to the first component. |
[in] | y | Channel that will correspond to the second component. |
[in] | z | Channel that will correspond to the third component. |
[in] | w | Channel that will correspond to the component component. |
int vpiPixelFormatGetBitsPerPixel | ( | VPIPixelFormat | fmt | ) |
#include <vpi/PixelFormat.h>
Get the number of bits per pixel of a pixel format.
[in] | fmt | Pixel format to be queried. |
int vpiPixelFormatGetChannelCount | ( | VPIPixelFormat | fmt | ) |
#include <vpi/PixelFormat.h>
Get the number of channels of a pixel format.
[in] | fmt | Pixel format to be queried. |
VPIFormatDataType vpiPixelFormatGetDataType | ( | VPIPixelFormat | fmt | ) |
#include <vpi/PixelFormat.h>
Get the data type of a pixel format.
[in] | fmt | Pixel format to be queried. |
VPIMemLayout vpiPixelFormatGetMemLayout | ( | VPIPixelFormat | fmt | ) |
#include <vpi/PixelFormat.h>
Get the memory layout of a pixel format.
[in] | fmt | Pixel format to be queried. |
VPIFormatPacking vpiPixelFormatGetPacking | ( | VPIPixelFormat | fmt | ) |
#include <vpi/PixelFormat.h>
Get the packing of a pixel format.
[in] | fmt | Pixeel format to be queried. |