DriveWorks SDK Reference
5.8.83 Release
For Test and Development only

Image Transformation Interface

Detailed Description

Defines the image transformation module.

Data Structures

struct  dwImageTransformationParameters
 

Typedefs

typedef struct dwImageTransformationObject * dwImageTransformationHandle_t
 

Enumerations

enum  dwImageProcessingBorderMode {
  DW_IMAGEPROCESSING_BORDER_MODE_ZERO = 0 ,
  DW_IMAGEPROCESSING_BORDER_MODE_MIRROR = 1 ,
  DW_IMAGEPROCESSING_BORDER_MODE_REPEAT = 2 ,
  DW_IMAGEPROCESSING_BORDER_MODE_WRAP = 3
}
 border mode (valid for DW_IMAGE_CUDA types) More...
 
enum  dwImageProcessingInterpolation {
  DW_IMAGEPROCESSING_INTERPOLATION_DEFAULT ,
  DW_IMAGEPROCESSING_INTERPOLATION_LINEAR
}
 interpolation mode More...
 

Functions

DW_API_PUBLIC dwStatus dwImageTransformation_appendAllocationAttributes (dwImageProperties *const imgProps, dwImageTransformationHandle_t obj)
 Append the allocation attribute such that the images created of type DW_IMAGE_NVMEDIA can be fed to dwImageTransformation_copyXXX() More...
 
DW_API_PUBLIC dwStatus dwImageTransformation_copy (dwImageHandle_t outputImage, const dwImageHandle_t inputImage, const dwRect *outputROI, const dwRect *inputROI, dwImageTransformationHandle_t obj)
 Resizes the input image subregion and copies the result into the previously allocated output image, in a specified subregion, of the same type (CUDA or NvMedia) and format (any) More...
 
DW_API_PUBLIC dwStatus dwImageTransformation_copyFullImage (dwImageHandle_t const outputImage, dwImageHandle_t const inputImage, dwImageTransformationHandle_t const obj)
 Resizes the input image and copies the result into the previously allocated output image, of the same type (CUDA or NvMedia) and format (any) More...
 
DW_API_PUBLIC dwStatus dwImageTransformation_copySubImage (dwImageHandle_t const outputImage, dwImageHandle_t const inputImage, dwRect const inputROI, dwImageTransformationHandle_t const obj)
 Resizes the input image sub region and copies the result into the previously allocated output image, of the same type (CUDA or NvMedia) and format (any) More...
 
DW_API_PUBLIC dwStatus dwImageTransformation_getCUDAStream (cudaStream_t *stream, dwImageTransformationHandle_t obj)
 Gets the cuda stream used by the APIs of Image Transformation. More...
 
DW_API_PUBLIC dwStatus dwImageTransformation_initialize (dwImageTransformationHandle_t *handle, dwImageTransformationParameters params, dwContextHandle_t context)
 Initializes an Image Transformation Engine. More...
 
DW_API_PUBLIC dwStatus dwImageTransformation_release (dwImageTransformationHandle_t handle)
 Releases an Image Transformation Engine. More...
 
DW_API_PUBLIC dwStatus dwImageTransformation_reset (dwImageTransformationHandle_t obj)
 Resets an Image Transformation Engine. More...
 
DW_API_PUBLIC dwStatus dwImageTransformation_setBorderMode (dwImageProcessingBorderMode mode, dwImageTransformationHandle_t obj)
 Sets the border mode used by the APIs of Image Transformation. More...
 
DW_API_PUBLIC dwStatus dwImageTransformation_setCUDAStream (cudaStream_t stream, dwImageTransformationHandle_t obj)
 Sets the cuda stream used by the APIs of Image Transformation. More...
 
DW_API_PUBLIC dwStatus dwImageTransformation_setInterpolationMode (dwImageProcessingInterpolation mode, dwImageTransformationHandle_t obj)
 Sets the interpolation mode used by the APIs of Image Transformation. More...
 

Data Structure Documentation

◆ dwImageTransformationParameters

struct dwImageTransformationParameters
Data Fields
bool ignoreAspectRatio Boolean indicating whether the aspect ratio of the input image should be kept (false) or the image should be stretched to the roi specified (true).

Default false

Typedef Documentation

◆ dwImageTransformationHandle_t

typedef struct dwImageTransformationObject* dwImageTransformationHandle_t

Definition at line 58 of file ImageTransformation.h.

Enumeration Type Documentation

◆ dwImageProcessingBorderMode

border mode (valid for DW_IMAGE_CUDA types)

Enumerator
DW_IMAGEPROCESSING_BORDER_MODE_ZERO 
DW_IMAGEPROCESSING_BORDER_MODE_MIRROR 
DW_IMAGEPROCESSING_BORDER_MODE_REPEAT 
DW_IMAGEPROCESSING_BORDER_MODE_WRAP 

Definition at line 61 of file ImageProcessingCommon.h.

◆ dwImageProcessingInterpolation

interpolation mode

Enumerator
DW_IMAGEPROCESSING_INTERPOLATION_DEFAULT 

simplest form of interpolation

DW_IMAGEPROCESSING_INTERPOLATION_LINEAR 

bilinear interpolation

Definition at line 53 of file ImageProcessingCommon.h.

Function Documentation

◆ dwImageTransformation_appendAllocationAttributes()

DW_API_PUBLIC dwStatus dwImageTransformation_appendAllocationAttributes ( dwImageProperties *const  imgProps,
dwImageTransformationHandle_t  obj 
)

Append the allocation attribute such that the images created of type DW_IMAGE_NVMEDIA can be fed to dwImageTransformation_copyXXX()

Parameters
[in,out]imgPropsImage properties
[in]objdwImageTransformation handle
Note
The imgProps are read and used to generate the allocation attributes needed by the driver. The allocation attributes are stored back into imgProps.meta.allocAttrs. Applications do not need to free or alter the imgProps.meta.allocAttrs in any way. The imgProps.meta.allocAttrs are only used by DriveWorks as needed when the given imgProps are used to allocate dwImages. If the application alters the imgProps after calling this API, the imgProps.meta.allocAttrs may no longer be applicable to the imgProps and calls related to allocating images will fail.
if imgProps.meta.allocAttrs does not have allocated Memory, this would be allocated by DW and will be owned by DW context until context is destroyed and should be used wisely as it the space is limited.
Returns
DW_NVMEDIA_ERROR - if underlying camera driver had an NvMedia error.
DW_INVALID_HANDLE - if given handle is not valid.
DW_SUCCESS

◆ dwImageTransformation_copy()

DW_API_PUBLIC dwStatus dwImageTransformation_copy ( dwImageHandle_t  outputImage,
const dwImageHandle_t  inputImage,
const dwRect outputROI,
const dwRect inputROI,
dwImageTransformationHandle_t  obj 
)

Resizes the input image subregion and copies the result into the previously allocated output image, in a specified subregion, of the same type (CUDA or NvMedia) and format (any)

Parameters
[out]outputImagePointer to the output image.
[in]inputImagePointer to the input image.
[in]outputROIPointer to a ROI on the output image where to copy the result. If false, defaults to the full image
[in]inputROIPointer to a ROI on the input image, where the source pixels are located. If null, defaults to the full image
[in]objHandle to the Image Transformation engine
Returns
DW_INVALID_ARGUMENT if the images are invalid
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed
DW_NVMEDIA_ERROR if the underlying NvMedia operation failed

◆ dwImageTransformation_copyFullImage()

DW_API_PUBLIC dwStatus dwImageTransformation_copyFullImage ( dwImageHandle_t const  outputImage,
dwImageHandle_t const  inputImage,
dwImageTransformationHandle_t const  obj 
)

Resizes the input image and copies the result into the previously allocated output image, of the same type (CUDA or NvMedia) and format (any)

Parameters
[out]outputImagePointer to the output image.
[in]inputImagePointer to the input image.
[in]objHandle to the Image Transformation engine
Returns
DW_INVALID_ARGUMENT if the images are invalid
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed
DW_NVMEDIA_ERROR if the underlying NvMedia operation failed

◆ dwImageTransformation_copySubImage()

DW_API_PUBLIC dwStatus dwImageTransformation_copySubImage ( dwImageHandle_t const  outputImage,
dwImageHandle_t const  inputImage,
dwRect const  inputROI,
dwImageTransformationHandle_t const  obj 
)

Resizes the input image sub region and copies the result into the previously allocated output image, of the same type (CUDA or NvMedia) and format (any)

Parameters
[out]outputImagePointer to the output image.
[in]inputImagePointer to the input image.
[in]inputROIPointer to a ROI on the input image, where the source pixels are located.
[in]objHandle to the Image Transformation engine
Returns
DW_INVALID_ARGUMENT if the images are invalid
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed
DW_NVMEDIA_ERROR if the underlying NvMedia operation failed

◆ dwImageTransformation_getCUDAStream()

DW_API_PUBLIC dwStatus dwImageTransformation_getCUDAStream ( cudaStream_t *  stream,
dwImageTransformationHandle_t  obj 
)

Gets the cuda stream used by the APIs of Image Transformation.

Parameters
[out]streamCUDA stream
[in]objHandle to the Image Transformation engine
Returns
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed

◆ dwImageTransformation_initialize()

DW_API_PUBLIC dwStatus dwImageTransformation_initialize ( dwImageTransformationHandle_t handle,
dwImageTransformationParameters  params,
dwContextHandle_t  context 
)

Initializes an Image Transformation Engine.

Parameters
[out]handlePointer to the Image Transformation Engine.
[in]paramsparameters of image transformation.
[in]contextHandle to Driveworks
Returns
DW_INVALID_ARGUMENT if the images are invalid
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed

◆ dwImageTransformation_release()

DW_API_PUBLIC dwStatus dwImageTransformation_release ( dwImageTransformationHandle_t  handle)

Releases an Image Transformation Engine.

Parameters
[in]handlePointer to the Image Transformation Engine.
Returns
DW_INVALID_ARGUMENT if the images are invalid
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed

◆ dwImageTransformation_reset()

DW_API_PUBLIC dwStatus dwImageTransformation_reset ( dwImageTransformationHandle_t  obj)

Resets an Image Transformation Engine.

Parameters
[in]objPointer to the Image Transformation Engine.
Returns
DW_INVALID_ARGUMENT if the images are invalid
DW_SUCCESS if the operation is successful

◆ dwImageTransformation_setBorderMode()

DW_API_PUBLIC dwStatus dwImageTransformation_setBorderMode ( dwImageProcessingBorderMode  mode,
dwImageTransformationHandle_t  obj 
)

Sets the border mode used by the APIs of Image Transformation.

Parameters
[in]modeBorder mode
[in]objHandle to the Image Transformation engine
Returns
DW_INVALID_ARGUMENT if the images are invalid
DW_SUCCESS if the operation is successful

◆ dwImageTransformation_setCUDAStream()

DW_API_PUBLIC dwStatus dwImageTransformation_setCUDAStream ( cudaStream_t  stream,
dwImageTransformationHandle_t  obj 
)

Sets the cuda stream used by the APIs of Image Transformation.

Parameters
[in]streamCUDA stream
[in]objHandle to the Image Transformation engine
Returns
DW_INVALID_ARGUMENT if the images are invalid
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed

◆ dwImageTransformation_setInterpolationMode()

DW_API_PUBLIC dwStatus dwImageTransformation_setInterpolationMode ( dwImageProcessingInterpolation  mode,
dwImageTransformationHandle_t  obj 
)

Sets the interpolation mode used by the APIs of Image Transformation.

Parameters
[in]modeInterpolation mode
[in]objHandle to the Image Transformation engine
Returns
DW_INVALID_ARGUMENT if the images are invalid
DW_SUCCESS if the operation is successful