DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Image Interface

Detailed Description

Defines image abstractions, and streamer and format conversion APIs.

Note
SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Data Structures

struct  dwImageCPU
 Defines a CPU-based image. More...
 
struct  dwImageCUDA
 Defines a CUDA image. More...
 
struct  dwImageDataLines
 Container for data lines from the camera. More...
 
struct  dwImageNvMedia
 Defines an NvMedia image. More...
 
struct  dwImageProperties
 Defines the properties of the image. More...
 

Modules

 Image Streamer
 Defines the image streamer function, enabling streaming images between different APIs.
 

Macros

#define DW_MAX_IMAGE_PLANES   3
 

Typedefs

typedef struct dwImageObject const * dwConstImageHandle_t
 
typedef struct dwImageObject * dwImageHandle_t
 
typedef uint32_t GLenum
 
typedef uint32_t GLuint
 

Enumerations

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_YUV_UINT8_PLANAR,
  DW_IMAGE_FORMAT_YUV_UINT16_PLANAR,
  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)
}
 Flags defining the meta information available in an image. More...
 
enum  dwImageType {
  DW_IMAGE_CPU = 0,
  DW_IMAGE_CUDA = 2,
  DW_IMAGE_NVMEDIA = 3,
  DW_IMAGE_GL = 0xFF
}
 Specifies the image type. More...
 

Functions

DW_API_PUBLIC dwStatus dwImage_copyConvert (dwImageHandle_t output, dwConstImageHandle_t input, dwContextHandle_t 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 output, dwConstImageHandle_t input, cudaStream_t stream, dwContextHandle_t 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_create (dwImageHandle_t *image, dwImageProperties properties, dwContextHandle_t 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 *image, dwImageProperties properties, void *buffersIn[DW_MAX_IMAGE_PLANES], size_t pitches[DW_MAX_IMAGE_PLANES], size_t bufferCount, dwContextHandle_t 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 *image, dwImageProperties properties, cudaArray_t buffers[], size_t bufferCount, dwContextHandle_t ctx)
 Creates a dwImageHandle_t based on the properties passed and binds a cudaArray_t to it. More...
 
DW_API_PUBLIC dwStatus dwImage_createAndBindNvMedia (dwImageHandle_t *image, NvMediaImage *nvmImage)
 Creates a dwImageHandle_t based on an nvmedia image. More...
 
DW_API_PUBLIC dwStatus dwImage_destroy (dwImageHandle_t image)
 Destroys the image handle and frees any memory created by dwImage_create(). More...
 
DW_API_PUBLIC dwStatus dwImage_getCPU (dwImageCPU **imageCPU, dwImageHandle_t image)
 Retrieves the dwImageCPU of a dwImageHandle_t. More...
 
DW_API_PUBLIC dwStatus dwImage_getCUDA (dwImageCUDA **imageCUDA, dwImageHandle_t image)
 Retrieves the dwImageCUDA of a dwImageHandle_t. More...
 
DW_API_PUBLIC dwStatus dwImage_getDataLayout (size_t *elementSize, size_t *planeCount, uint32_t planeChannelCount[DW_MAX_IMAGE_PLANES], dwVector2ui planeSize[DW_MAX_IMAGE_PLANES], const dwImageProperties *prop)
 Returns the expected data layout of an image given its properties. More...
 
DW_API_PUBLIC dwStatus dwImage_getMetaData (dwImageMetaData *metaData, dwConstImageHandle_t image)
 Retrieves the metadata 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 *type, const dwImageFormat format)
 Retrieves dwTrivialDataType associated with a specific format. More...
 
DW_API_PUBLIC dwStatus dwImage_getPlaneCount (size_t *planeCount, const dwImageFormat format)
 Retrieves number of planes of the image format. More...
 
DW_API_PUBLIC dwStatus dwImage_getProperties (dwImageProperties *properties, dwConstImageHandle_t image)
 Retrieves the properties of a dwImageHandle_t. More...
 
DW_API_PUBLIC dwStatus dwImage_getTimestamp (dwTime_t *timestamp, dwConstImageHandle_t image)
 Retrieves the timestamp of acquisition of a dwImageHandle_t. More...
 
DW_API_PUBLIC dwStatus dwImage_setTimestamp (dwTime_t timestamp, dwImageHandle_t image)
 Sets the timestamp of a dwImageHandle_t. More...
 
DW_API_PUBLIC dwStatus dwImageCUDA_getPlaneAsImage (dwImageCUDA *planeImage, const dwImageCUDA *srcImage, uint32_t planeIdx)
 Returns a specific plane of a CUDA image as its own single-plane CUDA image. More...
 
DW_API_PUBLIC dwStatus dwImageCUDA_mapToROI (dwImageCUDA *dstImg, const dwImageCUDA *srcImg, dwRect roi)
 Returns a dwImageCUDA that is mapped to a region of interest in the data of the srcImg. More...
 

Data Structure Documentation

◆ dwImageCPU

struct dwImageCPU
Data Fields
uint8_t * data[DW_MAX_IMAGE_PLANES] Specifies the raw image data.
size_t pitch[DW_MAX_IMAGE_PLANES] Specifies the pitch of the image in bytes.
dwImageProperties prop Specifies the properites of the image.
dwTime_t timestamp_us Specifies the time, in microseconds, when the image was acquired.

◆ dwImageCUDA

struct dwImageCUDA
Data Fields
cudaArray_t array[DW_MAX_IMAGE_PLANES] Holds the CUDA image plane data.
void * dptr[DW_MAX_IMAGE_PLANES] Holds the pointer to the image planes.
size_t pitch[DW_MAX_IMAGE_PLANES] Defines the pitch of each plane in bytes.
dwImageProperties prop Defines the properties of the image.
dwTime_t timestamp_us Specifies the time, in microseconds, when the image was acquired.

◆ dwImageDataLines

struct dwImageDataLines
Data Fields
uint8_t * bottomLineData
uint32_t bytesPerLine
dwVector2ui embeddedDataSize this defines the number of rows before and after the image
uint8_t * topLineData pointer to the beginning of top and bottom lines

◆ dwImageMetaData

struct dwImageMetaData
Data Fields
float32_t analogGain Specifies the analog Gain.
float32_t conversionGain Specifies the conversion Gain.
dwImageDataLines dataLines embedded data lines.

This is where the meta data defined above are parsed from A RAW image coming from a sensor often contains this information arranged as extra lines before and after the image. The full image is stored in a buffer structured as [TOP DATA][IMAGE][BOTTOM DATA] (top * W) + (H * W) + (bott * W)

float32_t digitalGain Specifies the digital Gain.
float32_t exposureTime Specifies the exposure time (microsecond)
int32_t flags combination of multiple flags 'dwImageMetaDataFlags' defining which of the meta fields are valid
uint32_t frameSequenceNumber Holds a frame sequence number, that is, a monotonically increasing frame counter.
uint32_t msbPosition Specifies the msb of the pixel data.
float32_t wbGain[4] Specifies the sensor white balance gains : R(0) G1(1) G2(2) B(3)

◆ dwImageNvMedia

struct dwImageNvMedia
Data Fields
NvMediaImage * img Holds the pointer to the NvMedia image.
dwImageProperties prop Holds image properties.
dwTime_t timestamp_us Specifies the time, in microseconds, when the image was acquired.

◆ dwImageProperties

struct dwImageProperties
Data Fields
dwImageFormat format Specifies the format of the image.
uint32_t height Specifies the height of the image in pixels.
dwImageMemoryType memoryLayout Memory layout type.
dwImageMetaData meta additional meta information stored with the image. Not all images might provide it
dwImageType type Specifies the type of image.
uint32_t width Specifies the width of the image in pixels.

Macro Definition Documentation

◆ DW_MAX_IMAGE_PLANES

#define DW_MAX_IMAGE_PLANES   3

Definition at line 84 of file Image.h.

Typedef Documentation

◆ dwConstImageHandle_t

typedef struct dwImageObject const* dwConstImageHandle_t

Definition at line 100 of file Image.h.

◆ dwImageHandle_t

typedef struct dwImageObject* dwImageHandle_t

Definition at line 99 of file Image.h.

◆ GLenum

typedef uint32_t GLenum

Definition at line 61 of file Image.h.

◆ GLuint

typedef uint32_t GLuint

Definition at line 62 of file Image.h.

Enumeration Type Documentation

◆ dwImageFormat

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

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 
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 
DW_IMAGE_FORMAT_VUYX_UINT8 
DW_IMAGE_FORMAT_VUYX_UINT16 
DW_IMAGE_FORMAT_RGB_UINT8_PLANAR 
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 

YUV encoding formats from camera.

DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR 
DW_IMAGE_FORMAT_YUV420_UINT16_SEMIPLANAR 
DW_IMAGE_FORMAT_YUV_UINT8_PLANAR 
DW_IMAGE_FORMAT_YUV_UINT16_PLANAR 
DW_IMAGE_FORMAT_RAW_UINT16 

RAW for images directly from sensory.

DW_IMAGE_FORMAT_RAW_FLOAT16 

for debayered images

Definition at line 103 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 166 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.

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.

Definition at line 189 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 87 of file Image.h.

Function Documentation

◆ dwImage_copyConvert()

DW_API_PUBLIC dwStatus dwImage_copyConvert ( dwImageHandle_t  output,
dwConstImageHandle_t  input,
dwContextHandle_t  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)

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,
DW_BAD_CAST if the image is not a cuda/nvmedia image
DW_CUDA_ERROR if the CUDA conversion fails,
DW_NVMEDIA_ERROR if the NvMedia conversion fails,
or DW_SUCCESS otherwise.

◆ dwImage_copyConvertAsync()

DW_API_PUBLIC dwStatus dwImage_copyConvertAsync ( dwImageHandle_t  output,
dwConstImageHandle_t  input,
cudaStream_t  stream,
dwContextHandle_t  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)

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,
DW_NVMEDIA_ERROR if the NvMedia conversion fails,
or DW_SUCCESS otherwise.

◆ dwImage_create()

DW_API_PUBLIC dwStatus dwImage_create ( dwImageHandle_t image,
dwImageProperties  properties,
dwContextHandle_t  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,
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

◆ dwImage_createAndBindBuffer()

DW_API_PUBLIC dwStatus dwImage_createAndBindBuffer ( dwImageHandle_t image,
dwImageProperties  properties,
void *  buffersIn[DW_MAX_IMAGE_PLANES],
size_t  pitches[DW_MAX_IMAGE_PLANES],
size_t  bufferCount,
dwContextHandle_t  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,
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)

◆ dwImage_createAndBindCUDAArray()

DW_API_PUBLIC dwStatus dwImage_createAndBindCUDAArray ( dwImageHandle_t image,
dwImageProperties  properties,
cudaArray_t  buffers[],
size_t  bufferCount,
dwContextHandle_t  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,
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

◆ dwImage_createAndBindNvMedia()

DW_API_PUBLIC dwStatus dwImage_createAndBindNvMedia ( dwImageHandle_t image,
NvMediaImage *  nvmImage 
)

Creates a dwImageHandle_t based on an nvmedia image.

Parameters
[out]imageA handle to the image
[in]nvmImageThe pointer to an NvMediaImage.
Returns
DW_SUCCESS if the image was created,
DW_INVALID_ARGUMENT if the given image types are invalid or the image pointer is null,

◆ dwImage_destroy()

DW_API_PUBLIC dwStatus dwImage_destroy ( dwImageHandle_t  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

◆ dwImage_getCPU()

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

Retrieves the dwImageCPU of a dwImageHandle_t.

The image must have been created as a DW_IMAGE_CPU type Note that any modification to the image retrieved will modify the content of the original handle

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

◆ dwImage_getCUDA()

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

Retrieves the dwImageCUDA of a dwImageHandle_t.

The image must have been created as a DW_IMAGE_CUDA type. Note that any modification to the image retrieved will modify the content of the original handle

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,

◆ dwImage_getDataLayout()

DW_API_PUBLIC dwStatus dwImage_getDataLayout ( size_t *  elementSize,
size_t *  planeCount,
uint32_t  planeChannelCount[DW_MAX_IMAGE_PLANES],
dwVector2ui  planeSize[DW_MAX_IMAGE_PLANES],
const dwImageProperties 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

◆ dwImage_getMetaData()

DW_API_PUBLIC dwStatus dwImage_getMetaData ( dwImageMetaData metaData,
dwConstImageHandle_t  image 
)

Retrieves the metadata of a dwImageHandle_t.

Parameters
[out]metaDataA pointer to the metadata
[in]imageA handle to the image
Returns
DW_SUCCESS,
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

◆ 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 Note that any modification to the image retrieved will modify the content of the original handle

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

◆ dwImage_getPixelType()

DW_API_PUBLIC dwStatus dwImage_getPixelType ( dwTrivialDataType type,
const dwImageFormat  format 
)

Retrieves dwTrivialDataType associated with a specific format.

Parameters
[out]typeThe datatype
[in]formatThe format
Returns
DW_SUCCESS
DW_INVALID_ARGUMENT if the given pointer is null,

◆ dwImage_getPlaneCount()

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

Retrieves number of planes of the image format.

Parameters
[out]planeCountThe plane count
[in]formatThe format
Returns
DW_SUCCESS
DW_INVALID_ARGUMENT if the given pointer is null,

◆ dwImage_getProperties()

DW_API_PUBLIC dwStatus dwImage_getProperties ( dwImageProperties properties,
dwConstImageHandle_t  image 
)

Retrieves the properties of a dwImageHandle_t.

Parameters
[out]propertiesA pointer to the properties
[in]imageA handle to the image
Returns
DW_SUCCESS,
DW_INVALID_HANDLE if the given image handle is invalid, i.e null or of wrong type

◆ dwImage_getTimestamp()

DW_API_PUBLIC dwStatus dwImage_getTimestamp ( dwTime_t timestamp,
dwConstImageHandle_t  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,
DW_INVALID_HANDLE if the given image handle is invalid,i.e null or of wrong type

◆ dwImage_setTimestamp()

DW_API_PUBLIC dwStatus dwImage_setTimestamp ( dwTime_t  timestamp,
dwImageHandle_t  image 
)

Sets the timestamp of a dwImageHandle_t.

Parameters
[out]timestampTimestamp to be set
[in]imageA handle to the image
Returns
DW_SUCCESS,
DW_INVALID_HANDLE if the given image handle is invalid,i.e null or of wrong type

◆ dwImageCUDA_getPlaneAsImage()

DW_API_PUBLIC dwStatus dwImageCUDA_getPlaneAsImage ( dwImageCUDA planeImage,
const dwImageCUDA srcImage,
uint32_t  planeIdx 
)

Returns a specific plane of a CUDA image as its own single-plane CUDA image.

No data is copied, only the pointers are duplicated.

Parameters
[out]planeImage'dwImageCUDA' to be filled with a single plane from 'srcImage'
[in]srcImageSource image to extract plane from
[in]planeIdxIndex of the plane to extract
Returns
DW_INVALID_ARGUMENT - if planeImage or srcImage are NULL, or if planeIdx is invalid
DW_SUCCESS

◆ dwImageCUDA_mapToROI()

DW_API_PUBLIC dwStatus dwImageCUDA_mapToROI ( dwImageCUDA dstImg,
const dwImageCUDA srcImg,
dwRect  roi 
)

Returns a dwImageCUDA that is mapped to a region of interest in the data of the srcImg.

NOTE: only single plane images are supported.

Parameters
[out]dstImgA pointer to the dwImageCUDA containing the roi. NOTE: the properties will reflect the size of the roi. (NOTE: this is not a copy)
[in]srcImgA pointer to the source dwImageCUDA.
[in]roiA dwRect specifying the coordinates of the region of interest.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT