Defines image abstractions, and streamer and format conversion APIs.
Unless explicitly specified, all errors returned by DW APIs are non recoverable and the user application should transition to fail safe mode. In addition, any error code not described in this documentation should be consider as fatal and the user application should also transition to fail safe mode.
|
enum | dwSyncType {
DW_SYNC_TYPE_WAITER,
DW_SYNC_TYPE_SIGNALER
} |
| Enum representing a sync type. More...
|
|
enum | dwImageType {
DW_IMAGE_CPU = 0,
DW_IMAGE_CUDA = 2,
DW_IMAGE_NVMEDIA = 3,
DW_IMAGE_GL = 0xFF
} |
| Specifies the image type. More...
|
|
enum | dwImageFormat {
DW_IMAGE_FORMAT_UNKNOWN = 0,
DW_IMAGE_FORMAT_R_INT16 = 900,
DW_IMAGE_FORMAT_R_UINT8 = 1000,
DW_IMAGE_FORMAT_R_UINT16,
DW_IMAGE_FORMAT_R_UINT32,
DW_IMAGE_FORMAT_R_FLOAT16,
DW_IMAGE_FORMAT_R_FLOAT32,
DW_IMAGE_FORMAT_RG_INT16,
DW_IMAGE_FORMAT_RG_UINT8,
DW_IMAGE_FORMAT_RG_FLOAT32,
DW_IMAGE_FORMAT_RGB_UINT8,
DW_IMAGE_FORMAT_RGB_UINT16,
DW_IMAGE_FORMAT_RGB_FLOAT16,
DW_IMAGE_FORMAT_RGB_FLOAT32,
DW_IMAGE_FORMAT_RGBA_UINT8,
DW_IMAGE_FORMAT_RGBA_UINT16,
DW_IMAGE_FORMAT_RGBA_FLOAT16,
DW_IMAGE_FORMAT_RGBA_FLOAT32,
DW_IMAGE_FORMAT_RGBX_FLOAT16 = 1200,
DW_IMAGE_FORMAT_VUYX_UINT8,
DW_IMAGE_FORMAT_VUYX_UINT16,
DW_IMAGE_FORMAT_RGB_UINT8_PLANAR = 2000,
DW_IMAGE_FORMAT_RGB_UINT16_PLANAR,
DW_IMAGE_FORMAT_RGB_FLOAT16_PLANAR,
DW_IMAGE_FORMAT_RGB_FLOAT32_PLANAR,
DW_IMAGE_FORMAT_RCB_FLOAT16_PLANAR,
DW_IMAGE_FORMAT_RCB_FLOAT32_PLANAR,
DW_IMAGE_FORMAT_RCC_FLOAT16_PLANAR,
DW_IMAGE_FORMAT_RCC_FLOAT32_PLANAR,
DW_IMAGE_FORMAT_YUV420_UINT8_PLANAR = 3000,
DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR,
DW_IMAGE_FORMAT_YUV420_UINT16_SEMIPLANAR,
DW_IMAGE_FORMAT_YUV422_UINT8_SEMIPLANAR = 3100,
DW_IMAGE_FORMAT_YUV_UINT8_PLANAR,
DW_IMAGE_FORMAT_YUV_UINT16_PLANAR,
DW_IMAGE_FORMAT_YUV422_UINT8_PACKED = 3200,
DW_IMAGE_FORMAT_RAW_UINT16 = 4000,
DW_IMAGE_FORMAT_RAW_FLOAT16
} |
| Format of the image represented as DW_IMAGE_FORMAT_COLORSPACE(_PIXELTYPE)(_PIXELORDER) More...
|
|
enum | dwImageMemoryType {
DW_IMAGE_MEMORY_TYPE_DEFAULT = 0,
DW_IMAGE_MEMORY_TYPE_PITCH = 1,
DW_IMAGE_MEMORY_TYPE_BLOCK = 2
} |
| Specifies memory type layout. More...
|
|
enum | dwImageMetaDataFlags {
DW_IMAGE_FLAGS_EMBEDDED_LINES = (1 << 2),
DW_IMAGE_FLAGS_SENSOR_SETTINGS = (1 << 3),
DW_IMAGE_FLAGS_FRAME_SEQUENCE_NUMBER = (1 << 4),
DW_IMAGE_FLAGS_SYSMEM = (1 << 5),
DW_IMAGE_FLAGS_HAS_RAW_ORDER_DESCRIPTOR = (1 << 6),
DW_IMAGE_FLAGS_CONTROLINFO = (1 << 7),
DW_IMAGE_FLAGS_LUMINANCE_CALIBRATED = (1 << 8),
DW_IMAGE_FLAGS_TOTAL_WHITE_BALANCE_GAIN = (1 << 9),
DW_IMAGE_FLAGS_GTM_SPLINE_INFO = (1 << 10),
DW_IMAGE_FLAGS_SENSOR_TEMPERATURE = (1 << 11),
DW_IMAGE_FLAGS_NVSCI_SURF_ATTR = (1 << 12),
DW_IMAGE_FLAGS_MAPS_CUPVA = (1 << 13)
} |
| Flags defining the meta information available in an image. More...
|
|
|
DW_API_PUBLIC dwStatus | dwImage_create (dwImageHandle_t *const image, dwImageProperties properties, dwContextHandle_t const ctx) |
| Creates and allocates resources for a dwImageHandle_t based on the properties passed as input. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_createAndBindBuffer (dwImageHandle_t *const image, dwImageProperties properties, void *const buffersIn[DW_MAX_IMAGE_PLANES], size_t const pitches[DW_MAX_IMAGE_PLANES], size_t const bufferCount, dwContextHandle_t const ctx) |
| Creates a dwImageHandle_t based on the properties passed and binds a memory buffer provided by the application. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_createAndBindCUDAArray (dwImageHandle_t *const image, dwImageProperties properties, cudaArray_t const buffers[DW_MAX_IMAGE_PLANES], size_t const bufferCount, dwContextHandle_t const ctx) |
| Creates a dwImageHandle_t based on the properties passed and binds a cudaArray_t to it. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_destroy (dwImageHandle_t const image) |
| Destroys the image handle and frees any memory created by dwImage_create(). More...
|
|
DW_API_PUBLIC dwStatus | dwImage_getProperties (dwImageProperties *const properties, dwConstImageHandle_t const image) |
| Retrieves the properties of a dwImageHandle_t. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_getTimestamp (dwTime_t *const timestamp, dwConstImageHandle_t const image) |
| Retrieves the timestamp of acquisition of a dwImageHandle_t. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_setTimestamp (dwTime_t const timestamp, dwImageHandle_t const image) |
| Sets the timestamp of a dwImageHandle_t. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_getMetaData (dwImageMetaData *const metaData, dwConstImageHandle_t const image) |
| Retrieves the metadata of a dwImageHandle_t. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_setMetaData (dwImageMetaData const *const metaData, dwImageHandle_t const image) |
| Sets the metadata of a dwImageHandle_t. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_getCPU (dwImageCPU **const imageCPU, dwImageHandle_t const image) |
| Retrieves the dwImageCPU of a dwImageHandle_t. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_getCUDA (dwImageCUDA **const imageCUDA, dwImageHandle_t const image) |
| Retrieves the dwImageCUDA of a dwImageHandle_t. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_getNvMedia (dwImageNvMedia **imageNvMedia, dwImageHandle_t image) |
| Retrieves the dwImageNvMedia of a dwImageHandle_t. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_getPixelType (dwTrivialDataType *const type, dwImageFormat const format) |
| Retrieves dwTrivialDataType associated with a specific format. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_getPlaneCount (size_t *const planeCount, dwImageFormat const format) |
| Retrieves number of planes of the image format. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_copyConvert (dwImageHandle_t const output, dwConstImageHandle_t const input, dwContextHandle_t const context) |
| Converts CUDA or NvMedia images by copying into an output image, following the properties in the output image. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_copyConvertAsync (dwImageHandle_t const output, dwConstImageHandle_t const input, cudaStream_t const stream, dwContextHandle_t const context) |
| Converts CUDA or NvMedia images by copying into an output image, following the properties in the output image. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_getDataLayout (size_t *const elementSize, size_t *const planeCount, uint32_t planeChannelCount[DW_MAX_IMAGE_PLANES], dwVector2ui planeSize[DW_MAX_IMAGE_PLANES], dwImageProperties const *const prop) |
| Returns the expected data layout of an image given its properties. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_createAndBindNvSciBuf (dwImageHandle_t *const image, dwImageProperties const *properties, NvSciBufObj nvscibufObj, dwContextHandle_t const ctx) |
| Creates a dwImageHandle_t based on the properties passed and binds a memory buffer provided by the application. More...
|
|
DW_API_PUBLIC dwStatus | dwImage_getNvSciBuf (NvSciBufObj *nvSciBufObj, dwImageHandle_t image) |
| Retrieve the NvSciBufObj backing the image allocation. More...
|
|
Converts CUDA or NvMedia images by copying into an output image, following the properties in the output image.
The output image must have been memory allocated (see 'dwImage_create'). Note that both images must be of the same type. If the properties and memory layout of both images are the same, an identical copy of the input image onto the output image is performed. The sizes must match (for conversion with resize, see dwImageTransformation under dw/imageprocessing/geometry). The conversion is performed, for both image types using DW's GPU kernel implementations. For use of the VIC engine via NvMedia2D, refer to dwImageTransformation.
- Parameters
-
[out] | output | A pointer to the output image. |
[in] | input | A pointer to the input image. |
[in] | context | The sdk context. |
- Returns
- DW_INVALID_ARGUMENT if the provided pointers are null, or the provided images cannot be used.
DW_BAD_CAST if the image is not a cuda/nvmedia image
DW_CUDA_ERROR if the CUDA conversion fails, it is possible to recover this situation by switching to DW_IMAGE_NVMEDIA as input images
or DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
Converts CUDA or NvMedia images by copying into an output image, following the properties in the output image.
The output image must have been memory allocated (see 'dwImage_create'). Note that both images must be of the same type. If the properties and memory layout of both images are the same, an identical copy of the input image onto the output image is performed. The sizes must match (for conversion with resize, see dwImageTransformation under dw/imageprocessing/geometry). The conversion is performed, for both image types using DW's GPU kernel implementations. For use of the VIC engine via NvMedia2D, refer to dwImageTransformation.
- Parameters
-
[out] | output | A pointer to the output image. |
[in] | input | A pointer to the input image. |
[in] | stream | The CUDA stream for executing the conversion kernel. Note this is ignored in case of NvMedia |
[in] | context | The sdk context. |
- Returns
- DW_INVALID_ARGUMENT if the provided pointers are null,
DW_BAD_CAST if the image is not a cuda/nvmedia image
DW_CUDA_ERROR if the CUDA conversion fails,
or DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes