VPI - Vision Programming Interface

3.2 Release

ImageFormat.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020-2021 NVIDIA Corporation. All rights reserved.
3  *
4  * NOTICE TO LICENSEE:
5  *
6  * This source code and/or documentation ("Licensed Deliverables") are
7  * subject to NVIDIA intellectual property rights under U.S. and
8  * international Copyright laws.
9  *
10  * These Licensed Deliverables contained herein is PROPRIETARY and
11  * CONFIDENTIAL to NVIDIA and is being provided under the terms and
12  * conditions of a form of NVIDIA software license agreement by and
13  * between NVIDIA and Licensee ("License Agreement") or electronically
14  * accepted by Licensee. Notwithstanding any terms or conditions to
15  * the contrary in the License Agreement, reproduction or disclosure
16  * of the Licensed Deliverables to any third party without the express
17  * written consent of NVIDIA is prohibited.
18  *
19  * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
20  * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
21  * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
22  * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
23  * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
24  * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
25  * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
26  * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
27  * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
28  * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
29  * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
31  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
32  * OF THESE LICENSED DELIVERABLES.
33  *
34  * U.S. Government End Users. These Licensed Deliverables are a
35  * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
36  * 1995), consisting of "commercial computer software" and "commercial
37  * computer software documentation" as such terms are used in 48
38  * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
39  * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
40  * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
41  * U.S. Government End Users acquire the Licensed Deliverables with
42  * only those rights set forth herein.
43  *
44  * Any use of the Licensed Deliverables in individual and commercial
45  * software must include, in the user documentation and internal
46  * comments to the code, the above Disclaimer and U.S. Government End
47  * Users Notice.
48  */
49 
56 #ifndef NV_VPI_IMAGE_FORMAT_H
57 #define NV_VPI_IMAGE_FORMAT_H
58 
59 #include "ColorSpec.h"
60 #include "DataLayout.h"
61 #include "PixelType.h"
62 
63 #include <assert.h>
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
94 typedef uint64_t VPIImageFormat;
95 
97 #define VPI_IMAGE_FORMAT_INVALID ((VPIImageFormat)0)
98 
100 #define VPI_IMAGE_FORMAT_U8 VPI_DETAIL_MAKE_NONCOLOR_FMT1(PL, UNSIGNED, X000, X8)
101 
103 #define VPI_IMAGE_FORMAT_U8_BL VPI_DETAIL_MAKE_NONCOLOR_FMT1(BL, UNSIGNED, X000, X8)
104 #define VPI_IMAGE_FORMAT_U8_BL16 VPI_DETAIL_MAKE_NONCOLOR_FMT1(BLOCK16_LINEAR, UNSIGNED, X000, X8)
108 #define VPI_IMAGE_FORMAT_S8 VPI_DETAIL_MAKE_NONCOLOR_FMT1(PL, SIGNED, X000, X8)
109 
111 #define VPI_IMAGE_FORMAT_U16 VPI_DETAIL_MAKE_NONCOLOR_FMT1(PL, UNSIGNED, X000, X16)
112 
114 #define VPI_IMAGE_FORMAT_U32 VPI_DETAIL_MAKE_NONCOLOR_FMT1(PL, UNSIGNED, X000, X32)
115 
117 #define VPI_IMAGE_FORMAT_S32 VPI_DETAIL_MAKE_NONCOLOR_FMT1(PL, SIGNED, X000, X32)
118 
120 #define VPI_IMAGE_FORMAT_S16 VPI_DETAIL_MAKE_NONCOLOR_FMT1(PL, SIGNED, X000, X16)
121 
123 #define VPI_IMAGE_FORMAT_S16_BL VPI_DETAIL_MAKE_NONCOLOR_FMT1(BL, SIGNED, X000, X16)
124 #define VPI_IMAGE_FORMAT_S16_BL16 VPI_DETAIL_MAKE_NONCOLOR_FMT1(BLOCK16_LINEAR, SIGNED, X000, X16)
128 #define VPI_IMAGE_FORMAT_2S16 VPI_DETAIL_MAKE_NONCOLOR_FMT1(PL, SIGNED, XY00, X16_Y16)
129 
131 #define VPI_IMAGE_FORMAT_2S16_BL VPI_DETAIL_MAKE_NONCOLOR_FMT1(BL, SIGNED, XY00, X16_Y16)
132 #define VPI_IMAGE_FORMAT_2S16_BL16 VPI_DETAIL_MAKE_NONCOLOR_FMT1(BLOCK16_LINEAR, SIGNED, XY00, X16_Y16)
136 #define VPI_IMAGE_FORMAT_F32 VPI_DETAIL_MAKE_NONCOLOR_FMT1(PL, FLOAT, X000, X32)
137 
139 #define VPI_IMAGE_FORMAT_F64 VPI_DETAIL_MAKE_NONCOLOR_FMT1(PL, FLOAT, X000, X64)
140 
142 #define VPI_IMAGE_FORMAT_2F32 VPI_DETAIL_MAKE_NONCOLOR_FMT1(PL, FLOAT, XY00, X32_Y32)
143 
147 #define VPI_IMAGE_FORMAT_Y8 VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, NONE, PL, UNSIGNED, X000, X8)
148 
152 #define VPI_IMAGE_FORMAT_Y8_BL VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, NONE, BL, UNSIGNED, X000, X8)
153 #define VPI_IMAGE_FORMAT_Y8_BL16 VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, NONE, BLOCK16_LINEAR, UNSIGNED, X000, X8)
159 #define VPI_IMAGE_FORMAT_Y8_ER VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, NONE, PL, UNSIGNED, X000, X8)
160 
164 #define VPI_IMAGE_FORMAT_Y8_ER_BL VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, NONE, BL, UNSIGNED, X000, X8)
165 #define VPI_IMAGE_FORMAT_Y8_ER_BL16 VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, NONE, BLOCK16_LINEAR, UNSIGNED, X000, X8)
171 #define VPI_IMAGE_FORMAT_Y16 VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, NONE, PL, UNSIGNED, X000, X16)
172 
176 #define VPI_IMAGE_FORMAT_Y16_BL VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, NONE, BL, UNSIGNED, X000, X16)
177 #define VPI_IMAGE_FORMAT_Y16_BL16 VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, NONE, BLOCK16_LINEAR, UNSIGNED, X000, X16)
183 #define VPI_IMAGE_FORMAT_Y16_ER VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, NONE, PL, UNSIGNED, X000, X16)
184 
188 #define VPI_IMAGE_FORMAT_Y16_ER_BL VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, NONE, BL, UNSIGNED, X000, X16)
189 #define VPI_IMAGE_FORMAT_Y16_ER_BL16 VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, NONE, BLOCK16_LINEAR, UNSIGNED, X000, X16)
200 #define VPI_IMAGE_FORMAT_NV12 VPI_DETAIL_MAKE_YCbCr_FMT2(BT601, 420, PL, UNSIGNED, XYZ0, X8, X8_Y8)
201 
210 #define VPI_IMAGE_FORMAT_NV12_BL VPI_DETAIL_MAKE_YCbCr_FMT2(BT601, 420, BL, UNSIGNED, XYZ0, X8, X8_Y8)
211 #define VPI_IMAGE_FORMAT_NV12_BL16 VPI_DETAIL_MAKE_YCbCr_FMT2(BT601, 420, BLOCK16_LINEAR, UNSIGNED, XYZ0, X8, X8_Y8)
222 #define VPI_IMAGE_FORMAT_NV12_ER VPI_DETAIL_MAKE_YCbCr_FMT2(BT601_ER, 420, PL, UNSIGNED, XYZ0, X8, X8_Y8)
223 
232 #define VPI_IMAGE_FORMAT_NV12_ER_BL VPI_DETAIL_MAKE_YCbCr_FMT2(BT601_ER, 420, BL, UNSIGNED, XYZ0, X8, X8_Y8)
233 #define VPI_IMAGE_FORMAT_NV12_ER_BL16 \
234  VPI_DETAIL_MAKE_YCbCr_FMT2(BT601_ER, 420, BLOCK16_LINEAR, UNSIGNED, XYZ0, X8, X8_Y8)
244 #define VPI_IMAGE_FORMAT_NV24 VPI_DETAIL_MAKE_YCbCr_FMT2(BT601, 444, PL, UNSIGNED, XYZ0, X8, X8_Y8)
245 
253 #define VPI_IMAGE_FORMAT_NV24_BL VPI_DETAIL_MAKE_YCbCr_FMT2(BT601, 444, BL, UNSIGNED, XYZ0, X8, X8_Y8)
254 #define VPI_IMAGE_FORMAT_NV24_BL16 VPI_DETAIL_MAKE_YCbCr_FMT2(BT601, 444, BLOCK16_LINEAR, UNSIGNED, XYZ0, X8, X8_Y8)
264 #define VPI_IMAGE_FORMAT_NV24_ER VPI_DETAIL_MAKE_YCbCr_FMT2(BT601_ER, 444, PL, UNSIGNED, XYZ0, X8, X8_Y8)
265 
273 #define VPI_IMAGE_FORMAT_NV24_ER_BL VPI_DETAIL_MAKE_YCbCr_FMT2(BT601_ER, 444, BL, UNSIGNED, XYZ0, X8, X8_Y8)
274 #define VPI_IMAGE_FORMAT_NV24_ER_BL16 \
275  VPI_DETAIL_MAKE_YCbCr_FMT2(BT601_ER, 444, BLOCK16_LINEAR, UNSIGNED, XYZ0, X8, X8_Y8)
279 #define VPI_IMAGE_FORMAT_UYVY VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, 422, PL, UNSIGNED, XYZ1, Y8_X8__Z8_X8)
280 
282 #define VPI_IMAGE_FORMAT_UYVY_BL VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, 422, BL, UNSIGNED, XYZ1, Y8_X8__Z8_X8)
283 #define VPI_IMAGE_FORMAT_UYVY_BL16 VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, 422, BLOCK16_LINEAR, UNSIGNED, XYZ1, Y8_X8__Z8_X8)
287 #define VPI_IMAGE_FORMAT_UYVY_ER VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, 422, PL, UNSIGNED, XYZ1, Y8_X8__Z8_X8)
288 
290 #define VPI_IMAGE_FORMAT_UYVY_ER_BL VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, 422, BL, UNSIGNED, XYZ1, Y8_X8__Z8_X8)
291 #define VPI_IMAGE_FORMAT_UYVY_ER_BL16 \
292  VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, 422, BLOCK16_LINEAR, UNSIGNED, XYZ1, Y8_X8__Z8_X8)
298 #define VPI_IMAGE_FORMAT_YUYV VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, 422, PL, UNSIGNED, XYZ1, X8_Y8__X8_Z8)
299 
303 #define VPI_IMAGE_FORMAT_YUYV_BL VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, 422, BL, UNSIGNED, XYZ1, X8_Y8__X8_Z8)
304 #define VPI_IMAGE_FORMAT_YUYV_BL16 VPI_DETAIL_MAKE_YCbCr_FMT1(BT601, 422, BLOCK16_LINEAR, UNSIGNED, XYZ1, X8_Y8__X8_Z8)
310 #define VPI_IMAGE_FORMAT_YUYV_ER VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, 422, PL, UNSIGNED, XYZ1, X8_Y8__X8_Z8)
311 
315 #define VPI_IMAGE_FORMAT_YUYV_ER_BL VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, 422, BL, UNSIGNED, XYZ1, X8_Y8__X8_Z8)
316 #define VPI_IMAGE_FORMAT_YUYV_ER_BL16 \
317  VPI_DETAIL_MAKE_YCbCr_FMT1(BT601_ER, 422, BLOCK16_LINEAR, UNSIGNED, XYZ1, X8_Y8__X8_Z8)
321 #define VPI_IMAGE_FORMAT_RGB8 VPI_DETAIL_MAKE_COLOR_FMT1(RGB, UNDEFINED, PL, UNSIGNED, XYZ1, X8_Y8_Z8)
322 
324 #define VPI_IMAGE_FORMAT_BGR8 VPI_DETAIL_MAKE_COLOR_FMT1(RGB, UNDEFINED, PL, UNSIGNED, ZYX1, X8_Y8_Z8)
325 
327 #define VPI_IMAGE_FORMAT_RGBA8 VPI_DETAIL_MAKE_COLOR_FMT1(RGB, UNDEFINED, PL, UNSIGNED, XYZW, X8_Y8_Z8_W8)
328 
330 #define VPI_IMAGE_FORMAT_BGRA8 VPI_DETAIL_MAKE_COLOR_FMT1(RGB, UNDEFINED, PL, UNSIGNED, ZYXW, X8_Y8_Z8_W8)
331 
333 #define VPI_IMAGE_FORMAT_RGB8p VPI_DETAIL_MAKE_COLOR_FMT3(RGB, UNDEFINED, PL, UNSIGNED, XYZ1, X8, X8, X8)
334 
336 #define VPI_IMAGE_FORMAT_BGR8p VPI_DETAIL_MAKE_COLOR_FMT3(RGB, UNDEFINED, PL, UNSIGNED, ZYX1, X8, X8, X8)
337 
339 #define VPI_IMAGE_FORMAT_RGBA8p VPI_DETAIL_MAKE_COLOR_FMT4(RGB, UNDEFINED, PL, UNSIGNED, XYZW, X8, X8, X8, X8)
340 
342 #define VPI_IMAGE_FORMAT_BGRA8p VPI_DETAIL_MAKE_COLOR_FMT4(RGB, UNDEFINED, PL, UNSIGNED, ZYXW, X8, X8, X8, X8)
343 
364 #ifdef VPI_DOXYGEN
365 # define VPI_MAKE_YCbCr_IMAGE_FORMAT_ABBREV(colorSpec, chromaSubsamp, memLayout, dataType, swizzle, numPlanes, \
366  packing0, packing1, ...)
367 #else
368 # define VPI_MAKE_YCbCr_IMAGE_FORMAT_ABBREV (VPIImageFormat) VPI_DETAIL_MAKE_YCbCr_FMT
369 #endif
370 
393 #ifdef VPI_DOXYGEN
394 # define VPI_MAKE_YCbCr_IMAGE_FORMAT(colorModel, colorSpec, chromaSubsamp, memLayout, dataType, swizzle, numPlanes, \
395  packing0, packing1, ...)
396 #else
397 # define VPI_MAKE_YCbCr_IMAGE_FORMAT (VPIImageFormat) VPI_DETAIL_MAKE_YCbCr_FORMAT
398 #endif
399 
422 #ifdef VPI_DOXYGEN
423 # define VPI_MAKE_COLOR_IMAGE_FORMAT_ABBREV(colorModel, colorSpec, memLayout, dataType, swizzle, numPlanes, \
424  packing0, packing1, ...)
425 #else
426 # define VPI_MAKE_COLOR_IMAGE_FORMAT_ABBREV (VPIImageFormat) VPI_DETAIL_MAKE_COLOR_FMT
427 #endif
428 
452 #ifdef VPI_DOXYGEN
453 # define VPI_MAKE_COLOR_IMAGE_FORMAT(colorModel, colorSpec, memLayout, dataType, swizzle, numPlanes, packing0, \
454  packing1, ...)
455 #else
456 # define VPI_MAKE_COLOR_IMAGE_FORMAT (VPIImageFormat) VPI_DETAIL_MAKE_COLOR_FORMAT
457 #endif
458 
477 #ifdef VPI_DOXYGEN
478 # define VPI_MAKE_NONCOLOR_IMAGE_FORMAT_ABBREV(memLayout, dataType, swizzle, numPlanes, packing0, packing1, ...)
479 #else
480 # define VPI_MAKE_NONCOLOR_IMAGE_FORMAT_ABBREV (VPIImageFormat) VPI_DETAIL_MAKE_NONCOLOR_FMT
481 #endif
482 
500 #ifdef VPI_DOXYGEN
501 # define VPI_MAKE_NONCOLOR_IMAGE_FORMAT(memLayout, dataType, swizzle, numPlanes, packing0, packing1, ...)
502 #else
503 # define VPI_MAKE_NONCOLOR_IMAGE_FORMAT (VPIImageFormat) VPI_DETAIL_MAKE_NONCOLOR_FORMAT
504 #endif
505 
524 #ifdef VPI_DOXYGEN
525 # define VPI_MAKE_RAW_IMAGE_FORMAT_ABBREV(rawPattern, memLayout, dataType, numPlanes, swizzle, packing)
526 #else
527 # define VPI_MAKE_RAW_IMAGE_FORMAT_ABBREV (VPIImageFormat) VPI_DETAIL_MAKE_RAW_FMT
528 #endif
529 
548 #ifdef VPI_DOXYGEN
549 # define VPI_MAKE_RAW_IMAGE_FORMAT(rawPattern, memLayout, dataType, numPlanes, swizzle, packing)
550 #else
551 # define VPI_MAKE_RAW_IMAGE_FORMAT (VPIImageFormat) VPI_DETAIL_MAKE_RAW_FORMAT
552 #endif
553 
576  VPIMemLayout memLayout, VPIDataType dataType, VPISwizzle swizzle,
577  VPIPacking packing0, VPIPacking packing1, VPIPacking packing2,
578  VPIPacking packing3);
579 
607  VPIMemLayout memLayout, VPIDataType dataType, VPISwizzle swizzle,
608  VPIPacking packing0, VPIPacking packing1, VPIPacking packing2,
609  VPIPacking packing3);
610 
631  VPIPacking packing0, VPIPacking packing1, VPIPacking packing2,
632  VPIPacking packing3);
633 
654 VPI_PUBLIC VPIImageFormat vpiMakeRawImageFormat(VPIRawPattern rawPattern, VPIMemLayout memLayout, VPIDataType dataType,
655  VPISwizzle swizzle, VPIPacking packing0, VPIPacking packing1,
656  VPIPacking packing2, VPIPacking packing3);
657 
670 VPI_PUBLIC VPIImageFormat vpiMakeImageFormatFromFourCC(uint32_t fourcc, VPIColorSpec colorSpec, VPIMemLayout memLayout);
671 
680 VPI_PUBLIC uint32_t vpiImageFormatGetFourCC(VPIImageFormat fmt);
681 
694 
709 VPI_PUBLIC int32_t vpiImageFormatGetPlaneWidth(VPIImageFormat fmt, int32_t imgWidth, int plane);
710 
725 VPI_PUBLIC int32_t vpiImageFormatGetPlaneHeight(VPIImageFormat fmt, int32_t imgHeight, int plane);
726 
749  VPIPacking packing0, VPIPacking packing1,
750  VPIPacking packing2, VPIPacking packing3);
751 
763 VPI_PUBLIC int vpiImageFormatGetPlaneBitsPerPixel(VPIImageFormat fmt, int plane);
764 
776 
786 
796 
810 
822 
832 
848 
859 
869 
884 
894 
903 VPI_PUBLIC int vpiImageFormatGetPlaneChannelCount(VPIImageFormat fmt, int plane);
904 
912 
920 
928 VPI_PUBLIC void vpiImageFormatGetBitsPerChannel(VPIImageFormat fmt, int32_t *bits);
929 
942 
955 
980  VPIImageFormat plane2, VPIImageFormat plane3);
981 
990 VPI_PUBLIC const char *vpiImageFormatGetName(VPIImageFormat fmt);
991 
1002 
1015 
1035 
1038 #ifdef __cplusplus
1039 }
1040 #endif
1041 
1042 #endif /* NV_VPI_IMAGE_FORMAT_H */
Defines types and functions to handle color specs.
Defines types and functions to handle data layouts.
VPIPixelType vpiImageFormatGetPlanePixelType(VPIImageFormat fmt, int plane)
Get the pixel type of image format's plane.
int32_t vpiImageFormatGetPlaneWidth(VPIImageFormat fmt, int32_t imgWidth, int plane)
Get the plane width of an image with the given image format and width.
VPIChromaSubsampling vpiImageFormatGetChromaSubsampling(VPIImageFormat fmt)
Get the image format's chroma subsampling type.
VPIImageFormat vpiImageFormatGetPlaneFormat(VPIImageFormat fmt, int plane)
Get the plane format of an image format.
int vpiImageFormatHasSameDataLayout(VPIImageFormat a, VPIImageFormat b)
Returns whether the image formats have the same data layout.
VPIMemLayout vpiImageFormatGetMemLayout(VPIImageFormat fmt)
Get the image format's memory layout.
VPIPacking vpiImageFormatGetPlanePacking(VPIImageFormat fmt, int plane)
Get the packing for a given plane of an image format.
VPISwizzle vpiImageFormatGetPlaneSwizzle(VPIImageFormat fmt, int plane)
Get the swizzle operation of the given image format's plane.
int32_t vpiImageFormatGetPlaneHeight(VPIImageFormat fmt, int32_t imgHeight, int plane)
Get the plane height of an image with the given image format and height.
VPIImageFormat vpiImageFormatSetMemLayout(VPIImageFormat fmt, VPIMemLayout memLayout)
Set the image format's memory layout.
VPIImageFormat vpiImageFormatSetDataType(VPIImageFormat fmt, VPIDataType dataType)
Set the image format's data type.
VPIImageFormat vpiMakeYCbCrImageFormat(VPIColorSpec colorSpec, VPIChromaSubsampling chromaSub, VPIMemLayout memLayout, VPIDataType dataType, VPISwizzle swizzle, VPIPacking packing0, VPIPacking packing1, VPIPacking packing2, VPIPacking packing3)
Creates a user-defined YCbCr color image format.
VPIColorSpec vpiImageFormatGetColorSpec(VPIImageFormat fmt)
Get the image format's color standard.
int vpiImageFormatGetChannelCount(VPIImageFormat fmt)
Get the total number of channels of an image format.
VPIImageFormat vpiMakeImageFormatFromPlanes(VPIImageFormat plane0, VPIImageFormat plane1, VPIImageFormat plane2, VPIImageFormat plane3)
Constructs an image format given the format of each plane.
VPIImageFormat vpiImageFormatSetRawPattern(VPIImageFormat fmt, VPIRawPattern rawPattern)
Sets the raw color pattern of the image format.
VPIImageFormat vpiMakeImageFormatFromFourCC(uint32_t fourcc, VPIColorSpec colorSpec, VPIMemLayout memLayout)
Creates a image format from a FourCC code.
int vpiImageFormatGetPlaneBitsPerPixel(VPIImageFormat fmt, int plane)
Get the image format's plane bits per pixel count.
VPIDataType vpiImageFormatGetDataType(VPIImageFormat fmt)
Get the image format's data type.
VPIImageFormat vpiImageFormatSetSwizzleAndPacking(VPIImageFormat fmt, VPISwizzle swizzle, VPIPacking packing0, VPIPacking packing1, VPIPacking packing2, VPIPacking packing3)
Replaces the swizzle and packing of an existing image format.
VPIRawPattern vpiImageFormatGetRawPattern(VPIImageFormat fmt)
Returns the raw color pattern of the image format.
VPIImageFormat vpiImageFormatSetColorSpec(VPIImageFormat fmt, VPIColorSpec colorSpec)
Set the image format's color standard.
VPIImageFormat vpiMakeColorImageFormat(VPIColorModel colorModel, VPIColorSpec colorSpec, VPIMemLayout memLayout, VPIDataType dataType, VPISwizzle swizzle, VPIPacking packing0, VPIPacking packing1, VPIPacking packing2, VPIPacking packing3)
Creates a user-defined color image format.
int vpiImageFormatGetPlaneChannelCount(VPIImageFormat fmt, int plane)
Get the number of channels in a plane of an image format.
VPIImageFormat vpiImageFormatSetChromaSubsampling(VPIImageFormat fmt, VPIChromaSubsampling css)
Set the image format's chroma subsampling type.
VPISwizzle vpiImageFormatGetSwizzle(VPIImageFormat fmt)
Get the image format's channel swizzle operation.
VPIImageFormat vpiMakeNonColorImageFormat(VPIMemLayout memLayout, VPIDataType dataType, VPISwizzle swizzle, VPIPacking packing0, VPIPacking packing1, VPIPacking packing2, VPIPacking packing3)
Creates a user-defined non-color image format.
VPIImageFormat vpiMakeRawImageFormat(VPIRawPattern rawPattern, VPIMemLayout memLayout, VPIDataType dataType, VPISwizzle swizzle, VPIPacking packing0, VPIPacking packing1, VPIPacking packing2, VPIPacking packing3)
Creates a user-defined raw image format.
VPIColorModel vpiImageFormatGetColorModel(VPIImageFormat fmt)
Get the image format's color model.
void vpiImageFormatGetBitsPerChannel(VPIImageFormat fmt, int32_t *bits)
Get the image format's bit size for each channel.
const char * vpiImageFormatGetName(VPIImageFormat fmt)
Returns a string representation of the image format.
int vpiImageFormatGetPlaneCount(VPIImageFormat fmt)
Get the number of planes of an image format.
uint32_t vpiImageFormatGetFourCC(VPIImageFormat fmt)
Returns the FourCC code corresponding to an image format.
Defines types and functions to handle pixel types.
VPIColorSpec
Color spec definitions.
Definition: ColorSpec.h:162
VPIRawPattern
Defines Bayer patterns used by RAW color model.
Definition: ColorSpec.h:303
VPIColorModel
Defines color models.
Definition: ColorSpec.h:77
VPIChromaSubsampling
Defines how chroma-subsampling is done.
Definition: ColorSpec.h:400
VPISwizzle
Defines the supported channel swizzle operations.
Definition: DataLayout.h:342
VPIPacking
Defines how channels are packed into an image plane element.
Definition: DataLayout.h:133
VPIMemLayout
Defines how the 2D plane pixels are laid out in memory.
Definition: DataLayout.h:283
VPIDataType
Defines the channel data type.
Definition: DataLayout.h:265
uint64_t VPIPixelType
Pre-defined pixel types.
Definition: PixelType.h:78
uint64_t VPIImageFormat
Pre-defined image formats.
Definition: ImageFormat.h:94