NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
Image Interface

Detailed Description

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.

Data Structures

struct  dwImagePool
 Specifies a pool of images. More...
 
struct  dwImageDataLines
 Container for data lines from the camera. More...
 
struct  dwImageSplineControlPoint
 
struct  dwExposureDuration
 
struct  dwSensorTemperature
 
struct  dwImageSensorStatistics
 Sensor statistics associated with the image. More...
 
struct  dwImageRawProperties
 
struct  dwImageTimestamps
 Image timestamps. More...
 
struct  dwImageMetaData
 Additional meta information stored with each image. More...
 
struct  dwImageProperties
 Defines the properties of the image. More...
 
struct  dwImageCPU
 Defines a CPU-based image. More...
 
struct  dwImageCUDA
 Defines a CUDA image. More...
 
struct  dwImageNvMedia
 Defines an NvMedia image. More...
 

Modules

 Image Extra Interface
 Defines extra methods for image interface.
 

Macros

#define DW_MAX_IMAGE_PLANES   3
 
#define DW_ISP_MAX_COLOR_COMPONENT   (4U)
 
#define DW_MAX_NUM_TEMPERATURES   4
 should be the same as the DEVBLK_CDI_MAX_NUM_TEMPERATURES in NvSIPLCDICommon.h of NvSIPL More...
 
#define DW_IMAGE_NUM_SPLINE_COMPONENTS   18U
 
#define DW_DEVBLK_CDI_MAX_EXPOSURES   4
 
#define DW_LUMINANCE_CALIB_MATRIX_SIZE   4
 Defines the length(M) of a MxM luminance calibration matrix. More...
 

Typedefs

typedef enum dwSyncType dwSyncType
 Enum representing a sync type. More...
 
typedef enum dwImageType dwImageType
 Specifies the image type. More...
 
typedef struct dwImageObject * dwImageHandle_t
 
typedef struct dwImageObject const * dwConstImageHandle_t
 
typedef struct dwImageAllocationAttrList * dwImageAllocationAttrListHandle_t
 dwImage Allocation Attributes List More...
 
typedef struct dwImagePool dwImagePool
 Specifies a pool of images. More...
 
typedef enum dwImageFormat dwImageFormat
 Format of the image represented as DW_IMAGE_FORMAT_COLORSPACE(_PIXELTYPE)(_PIXELORDER) More...
 
typedef struct dwImageDataLines dwImageDataLines
 Container for data lines from the camera. More...
 
typedef struct dwImageSplineControlPoint dwImageSplineControlPoint
 
typedef struct dwExposureDuration dwExposureDuration
 
typedef struct dwSensorTemperature dwSensorTemperature
 
typedef struct dwImageSensorStatistics dwImageSensorStatistics
 Sensor statistics associated with the image. More...
 
typedef struct dwImageRawProperties dwImageRawProperties
 
typedef struct dwImageTimestamps dwImageTimestamps
 Image timestamps. More...
 
typedef struct dwImageMetaData dwImageMetaData
 Additional meta information stored with each image. More...
 
typedef struct dwImageProperties dwImageProperties
 Defines the properties of the image. More...
 
typedef struct dwImageCPU dwImageCPU
 Defines a CPU-based image. More...
 
typedef struct dwImageCUDA dwImageCUDA
 Defines a CUDA image. More...
 
typedef struct dwImageNvMedia dwImageNvMedia
 Defines an NvMedia image. More...
 

Enumerations

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...
 

Functions

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...
 

Macro Definition Documentation

◆ DW_DEVBLK_CDI_MAX_EXPOSURES

#define DW_DEVBLK_CDI_MAX_EXPOSURES   4

Definition at line 264 of file Image.h.

◆ DW_IMAGE_NUM_SPLINE_COMPONENTS

#define DW_IMAGE_NUM_SPLINE_COMPONENTS   18U

Definition at line 76 of file Image.h.

◆ DW_ISP_MAX_COLOR_COMPONENT

#define DW_ISP_MAX_COLOR_COMPONENT   (4U)

Definition at line 73 of file Image.h.

◆ DW_LUMINANCE_CALIB_MATRIX_SIZE

#define DW_LUMINANCE_CALIB_MATRIX_SIZE   4

Defines the length(M) of a MxM luminance calibration matrix.

Definition at line 288 of file Image.h.

◆ DW_MAX_IMAGE_PLANES

#define DW_MAX_IMAGE_PLANES   3

Definition at line 72 of file Image.h.

◆ DW_MAX_NUM_TEMPERATURES

#define DW_MAX_NUM_TEMPERATURES   4

should be the same as the DEVBLK_CDI_MAX_NUM_TEMPERATURES in NvSIPLCDICommon.h of NvSIPL

Definition at line 75 of file Image.h.

Typedef Documentation

◆ dwConstImageHandle_t

typedef struct dwImageObject const* dwConstImageHandle_t

Definition at line 89 of file Image.h.

◆ dwExposureDuration

◆ dwImageAllocationAttrListHandle_t

typedef struct dwImageAllocationAttrList* dwImageAllocationAttrListHandle_t

dwImage Allocation Attributes List

Definition at line 92 of file Image.h.

◆ dwImageCPU

typedef struct dwImageCPU dwImageCPU

Defines a CPU-based image.

◆ dwImageCUDA

typedef struct dwImageCUDA dwImageCUDA

Defines a CUDA image.

◆ dwImageDataLines

Container for data lines from the camera.

◆ dwImageFormat

Format of the image represented as DW_IMAGE_FORMAT_COLORSPACE(_PIXELTYPE)(_PIXELORDER)

Note
The default memory allocation is via NvSciBuf but certain legacy formats are not compatible as listed below. These formats will continue to use API specific memory allocation based on dwImageType

◆ dwImageHandle_t

typedef struct dwImageObject* dwImageHandle_t

Definition at line 88 of file Image.h.

◆ dwImageMetaData

Additional meta information stored with each image.

◆ dwImageNvMedia

Defines an NvMedia image.

◆ dwImagePool

typedef struct dwImagePool dwImagePool

Specifies a pool of images.

◆ dwImageProperties

Defines the properties of the image.

◆ dwImageRawProperties

◆ dwImageSensorStatistics

Sensor statistics associated with the image.

◆ dwImageSplineControlPoint

◆ dwImageTimestamps

Image timestamps.

◆ dwImageType

typedef enum dwImageType dwImageType

Specifies the image type.

◆ dwSensorTemperature

◆ dwSyncType

typedef enum dwSyncType dwSyncType

Enum representing a sync type.

Currently it represents synchronization methods for NvSci based buffers with HW engines like GPU or Drive platform VIC

Enumeration Type Documentation

◆ dwImageFormat

Format of the image represented as DW_IMAGE_FORMAT_COLORSPACE(_PIXELTYPE)(_PIXELORDER)

Note
The default memory allocation is via NvSciBuf but certain legacy formats are not compatible as listed below. These formats will continue to use API specific memory allocation based on dwImageType
Enumerator
DW_IMAGE_FORMAT_UNKNOWN 

Normal formats.

DW_IMAGE_FORMAT_R_INT16 
DW_IMAGE_FORMAT_R_UINT8 
DW_IMAGE_FORMAT_R_UINT16 
DW_IMAGE_FORMAT_R_UINT32 
DW_IMAGE_FORMAT_R_FLOAT16 
DW_IMAGE_FORMAT_R_FLOAT32 

Not backed by NvSci.

DW_IMAGE_FORMAT_RG_INT16 
DW_IMAGE_FORMAT_RG_UINT8 

Not backed by NvSci.

DW_IMAGE_FORMAT_RG_FLOAT32 

Not backed by NvSci.

DW_IMAGE_FORMAT_RGB_UINT8 

Not backed by NvSci.

DW_IMAGE_FORMAT_RGB_UINT16 

Not backed by NvSci.

DW_IMAGE_FORMAT_RGB_FLOAT16 

Not backed by NvSci.

DW_IMAGE_FORMAT_RGB_FLOAT32 

Not backed by NvSci.

DW_IMAGE_FORMAT_RGBA_UINT8 
DW_IMAGE_FORMAT_RGBA_UINT16 
DW_IMAGE_FORMAT_RGBA_FLOAT16 
DW_IMAGE_FORMAT_RGBA_FLOAT32 

Not backed by NvSci.

DW_IMAGE_FORMAT_RGBX_FLOAT16 
DW_IMAGE_FORMAT_VUYX_UINT8 
DW_IMAGE_FORMAT_VUYX_UINT16 
DW_IMAGE_FORMAT_RGB_UINT8_PLANAR 

Not backed by NvSci.

DW_IMAGE_FORMAT_RGB_UINT16_PLANAR 
DW_IMAGE_FORMAT_RGB_FLOAT16_PLANAR 

Not backed by NvSci.

DW_IMAGE_FORMAT_RGB_FLOAT32_PLANAR 

Not backed by NvSci.

DW_IMAGE_FORMAT_RCB_FLOAT16_PLANAR 

Not backed by NvSci.

DW_IMAGE_FORMAT_RCB_FLOAT32_PLANAR 

Not backed by NvSci.

DW_IMAGE_FORMAT_RCC_FLOAT16_PLANAR 

Not backed by NvSci.

DW_IMAGE_FORMAT_RCC_FLOAT32_PLANAR 

Not backed by NvSci.

DW_IMAGE_FORMAT_YUV420_UINT8_PLANAR 

YUV encoding formats from camera.

DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR 
DW_IMAGE_FORMAT_YUV420_UINT16_SEMIPLANAR 
DW_IMAGE_FORMAT_YUV422_UINT8_SEMIPLANAR 
DW_IMAGE_FORMAT_YUV_UINT8_PLANAR 
DW_IMAGE_FORMAT_YUV_UINT16_PLANAR 
DW_IMAGE_FORMAT_YUV422_UINT8_PACKED 
DW_IMAGE_FORMAT_RAW_UINT16 

RAW for images directly from sensory.

DW_IMAGE_FORMAT_RAW_FLOAT16 

for debayered images

Definition at line 105 of file Image.h.

◆ dwImageMemoryType

Specifies memory type layout.

Enumerator
DW_IMAGE_MEMORY_TYPE_DEFAULT 

the default memory layout for a given image type, can be either pitch or block

DW_IMAGE_MEMORY_TYPE_PITCH 

pitch linear memory layout

DW_IMAGE_MEMORY_TYPE_BLOCK 

block memory layout

Definition at line 184 of file Image.h.

◆ dwImageMetaDataFlags

Flags defining the meta information available in an image.

Enumerator
DW_IMAGE_FLAGS_EMBEDDED_LINES 

If an image was extracted from a camera, additional embedded data lines might be provided The data lines are stored before and after the actual image content in memory Note manually setting this flag will influence the image creation by allocating the specified number of datalines in dwImageDatalines.

DW_IMAGE_FLAGS_SENSOR_SETTINGS 

Image contains valid sensor settings information, such as exposure, gain, whitebalance, etc.

DW_IMAGE_FLAGS_FRAME_SEQUENCE_NUMBER 

Image contains valid frame sequence number.

DW_IMAGE_FLAGS_SYSMEM 

By default CUDA images are created in vidmem on DGPU, this flag forces CUDA image to sysmem Note manually setting this flag will influence the image allocation as per description.

DW_IMAGE_FLAGS_HAS_RAW_ORDER_DESCRIPTOR 

Image contains details of raw order descriptor.

This is valid only if the image has format DW_IMAGE_FORMAT_RAW_X. Note manually setting this flag will influence the image creation, selecting the raw order described for a DW_IMAGE_FORMAT_RAW

DW_IMAGE_FLAGS_CONTROLINFO 

Holds a flag to determine whether or not the control info is valid. If no ISP processing occurs this value is false.

DW_IMAGE_FLAGS_LUMINANCE_CALIBRATED 

Holds a flag to indicating if the luminance is calibrated.

DW_IMAGE_FLAGS_TOTAL_WHITE_BALANCE_GAIN 

Holds the total white balance gains, which includes both sensor channel and ISP gains.

DW_IMAGE_FLAGS_GTM_SPLINE_INFO 

Image contains valid global tone map block.

DW_IMAGE_FLAGS_SENSOR_TEMPERATURE 

Image contains valid sensor temperature info.

DW_IMAGE_FLAGS_NVSCI_SURF_ATTR 

Image contains NvSci surface based attributes.

DW_IMAGE_FLAGS_MAPS_CUPVA 

Image maps pointer to CUPVA.

Definition at line 210 of file Image.h.

◆ dwImageType

Specifies the image type.

Enumerator
DW_IMAGE_CPU 
DW_IMAGE_CUDA 
DW_IMAGE_NVMEDIA 
DW_IMAGE_GL 

This type is provided here for completeness only.

It will not function on any image API as provided by this SDK. For DW_IMAGE_GL images to function properly APIs from dwgl library are required.

Definition at line 79 of file Image.h.

◆ dwSyncType

enum dwSyncType

Enum representing a sync type.

Currently it represents synchronization methods for NvSci based buffers with HW engines like GPU or Drive platform VIC

Enumerator
DW_SYNC_TYPE_WAITER 
DW_SYNC_TYPE_SIGNALER 

Definition at line 67 of file Image.h.

Function Documentation

◆ dwImage_copyConvert()

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.

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]outputA pointer to the output image.
[in]inputA pointer to the input image.
[in]contextThe 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

◆ dwImage_copyConvertAsync()

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.

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]outputA pointer to the output image.
[in]inputA pointer to the input image.
[in]streamThe CUDA stream for executing the conversion kernel. Note this is ignored in case of NvMedia
[in]contextThe 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

◆ dwImage_create()

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.

Parameters
[out]imageA handle to the image
[in]propertiesThe image properties.
[in]ctxThe DriveWorks context.
Returns
DW_SUCCESS if the image was created successfully
DW_INVALID_ARGUMENT if the given image types are invalid or the streamer pointer is null
DW_INVALID_HANDLE if the given context handle is invalid, i.e null or of wrong type
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: No

◆ dwImage_createAndBindBuffer()

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.

Valid only for types of DW_IMAGE_CPU and DW_IMAGE_CUDA with DW_IMAGE_LAYOUT_PITCH (or DEFAULT) layout.

Parameters
[out]imageA handle to the image
[in]propertiesThe image properties.
[in]buffersInAn array of pointers to individual buffers.
[in]pitchesAn array of pitches for each buffer.
[in]bufferCountThe number of buffers (maximum is DW_MAX_IMAGE_PLANES).
[in]ctxThe DriveWorks context.
Returns
DW_SUCCESS if the image was created successfully
DW_INVALID_ARGUMENT if the given image properties are invalid or the image pointer is null or the buffer count is not equal to plane count
DW_INVALID_HANDLE if the given context handle is invalid, i.e null or of wrong type
DW_NOT_SUPPORTED if given image type is not supported (expecting only DW_IMAGE_CPU an DW_IMAGE_CUDA)
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: No

◆ dwImage_createAndBindCUDAArray()

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.

Valid only for types of DW_IMAGE_CUDA with DW_IMAGE_LAYOUT_BLOCK layout

Parameters
[out]imageA handle to the image
[in]propertiesThe image properties.
[in]buffersAn array of pointers to cudaArray_t.
[in]bufferCountThe number of buffers (maximum is DW_MAX_IMAGE_PLANES).
[in]ctxThe DriveWorks context.
Returns
DW_SUCCESS if the image was created successfully
DW_INVALID_ARGUMENT if the given image types are invalid or the buffer is null
DW_INVALID_HANDLE if the given context handle is invalid, i.e null or of wrong type
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: No

◆ dwImage_createAndBindNvSciBuf()

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.

The given NvSciBufObj must have been allocated with attributes compatible with the given image properties.

Note
The memory buffer lifetime is still controlled by the application. The application must take care that the buffer is not freed until the returned dwImageHandle_t is freed.
Parameters
[out]imageA handle to the image
[in]propertiesThe image properties.
[in]nvscibufObjThe NvSciBufObj to bind to.
[in]ctxThe DriveWorks context.
Returns
DW_SUCCESS if the image was created,
DW_NOT_SUPPORTED if the platform does not support this API
DW_INVALID_ARGUMENT if the given image types are invalid or the image pointer is null.
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: No

◆ dwImage_destroy()

DW_API_PUBLIC dwStatus dwImage_destroy ( dwImageHandle_t const  image)

Destroys the image handle and frees any memory created by dwImage_create().

If the image was created with createAndBindX, it will unbind the memory and delete the handle without freeing the buffers

Parameters
[in]imageA handle to the image
Returns
DW_SUCCESS if the image was destroyed
DW_INVALID_HANDLE if the given image handle is invalid, i.e null or of wrong type
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: Yes

◆ dwImage_getCPU()

DW_API_PUBLIC dwStatus dwImage_getCPU ( dwImageCPU **const  imageCPU,
dwImageHandle_t const  image 
)

Retrieves the dwImageCPU of a dwImageHandle_t.

The image must have been created as a DW_IMAGE_CPU type.

Parameters
[out]imageCPUA pointer to the dwImageCPU pointer
[in]imageA handle to the image
Returns
DW_SUCCESS if the dwImageCPU is successfully retrieved,
DW_INVALID_ARGUMENT if the given image pointer is null,
DW_INVALID_HANDLE if the given image handle is invalid, i.e null or of wrong type
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_getCUDA()

DW_API_PUBLIC dwStatus dwImage_getCUDA ( dwImageCUDA **const  imageCUDA,
dwImageHandle_t const  image 
)

Retrieves the dwImageCUDA of a dwImageHandle_t.

The image must have been created as a DW_IMAGE_CUDA type.

Parameters
[out]imageCUDAA pointer to the dwImageCUDA pointer
[in]imageA handle to the image
Returns
DW_SUCCESS if the dwImageCUDA is successfully retrieved,
DW_INVALID_ARGUMENT if the given image pointer or image handle is null
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_getDataLayout()

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.

The byte size for plane i's row is:

elementSize*planeChannelCount[i]*planeWidth[i]
Parameters
[out]elementSizeSize in bytes of the pixel type
[out]planeCountNumber of planes
[out]planeChannelCountNumber of channels within each plane
[out]planeSizeSize of each plane
[in]propA pointer to the image properties to compute data layout from.
Returns
DW_INVALID_ARGUMENT - if channel count or plane size or properties are invalid or NULL
DW_SUCCESS - if operation completed successfully
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_getMetaData()

DW_API_PUBLIC dwStatus dwImage_getMetaData ( dwImageMetaData *const  metaData,
dwConstImageHandle_t const  image 
)

Retrieves the metadata of a dwImageHandle_t.

Parameters
[out]metaDataA pointer to the metadata
[in]imageA handle to the image
Returns
DW_SUCCESS if operation completed successfully
DW_INVALID_ARGUMENT if the given metadaa pointer is null,
DW_INVALID_HANDLE if the given image handle is invalid,i.e null or of wrong type
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_getNvMedia()

DW_API_PUBLIC dwStatus dwImage_getNvMedia ( dwImageNvMedia **  imageNvMedia,
dwImageHandle_t  image 
)

Retrieves the dwImageNvMedia of a dwImageHandle_t.

The image must have been created as a DW_IMAGE_NVEMDIA type.

Parameters
[out]imageNvMediaA pointer to the dwImageNvMedia pointer
[in]imageA handle to the image
Returns
DW_SUCCESS if the dwImageNvMedia is successfully retrieved,
DW_INVALID_ARGUMENT if the given image pointer is null,
DW_INVALID_HANDLE if the given image handle is invalid,null or of wrong type
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_getNvSciBuf()

DW_API_PUBLIC dwStatus dwImage_getNvSciBuf ( NvSciBufObj nvSciBufObj,
dwImageHandle_t  image 
)

Retrieve the NvSciBufObj backing the image allocation.

Parameters
[out]nvSciBufObjpointer to output NvSciBufObj.
[in]imageA handle to the image.
Returns
DW_SUCCESS if operation succeeded. DW_INVALID_ARGUMENT if nvSciBufObj or image is null. DW_NOT_AVAILABLE if image is not backed by NvSciBufObj.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_getPixelType()

DW_API_PUBLIC dwStatus dwImage_getPixelType ( dwTrivialDataType *const  type,
dwImageFormat const  format 
)

Retrieves dwTrivialDataType associated with a specific format.

Parameters
[out]typeThe datatype
[in]formatThe format
Returns
DW_SUCCESS if operation completed successfully
DW_INVALID_ARGUMENT if the given pointer is null
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_getPlaneCount()

DW_API_PUBLIC dwStatus dwImage_getPlaneCount ( size_t *const  planeCount,
dwImageFormat const  format 
)

Retrieves number of planes of the image format.

Parameters
[out]planeCountThe plane count
[in]formatThe format
Returns
DW_SUCCESS if operation completed successfully
DW_INVALID_ARGUMENT if the given pointer is null
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_getProperties()

DW_API_PUBLIC dwStatus dwImage_getProperties ( dwImageProperties *const  properties,
dwConstImageHandle_t const  image 
)

Retrieves the properties of a dwImageHandle_t.

Parameters
[out]propertiesA pointer to the properties
[in]imageA handle to the image
Returns
DW_SUCCESS if operation completed successfully
DW_INVALID_HANDLE if the given image handle is invalid, i.e null or of wrong type
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_getTimestamp()

DW_API_PUBLIC dwStatus dwImage_getTimestamp ( dwTime_t *const  timestamp,
dwConstImageHandle_t const  image 
)

Retrieves the timestamp of acquisition of a dwImageHandle_t.

Parameters
[out]timestampA pointer to the timestamp
[in]imageA handle to the image
Returns
DW_SUCCESS if operation completed successfully
DW_INVALID_HANDLE if the given image handle is invalid,i.e null or of wrong type
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_setMetaData()

DW_API_PUBLIC dwStatus dwImage_setMetaData ( dwImageMetaData const *const  metaData,
dwImageHandle_t const  image 
)

Sets the metadata of a dwImageHandle_t.

Parameters
[in]metaDataA pointer to the metadata
[in]imageA handle to the image
Returns
DW_SUCCESS if operation completed successfully
DW_INVALID_HANDLE if the given image handle is invalid, i.e null or of wrong type
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwImage_setTimestamp()

DW_API_PUBLIC dwStatus dwImage_setTimestamp ( dwTime_t const  timestamp,
dwImageHandle_t const  image 
)

Sets the timestamp of a dwImageHandle_t.

Parameters
[out]timestampTimestamp to be set
[in]imageA handle to the image
Returns
DW_SUCCESS if operation completed successfully
DW_INVALID_HANDLE if the given image handle is invalid,i.e null or of wrong type
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes