Loading [MathJax]/extensions/tex2jax.js
  • <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>

  • DriveWorks SDK Reference
    5.20.37 Release
    For Test and Development only

    All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    Image Transformation Interface

    Detailed Description

    Defines the image transformation module.

    Data Structures

    struct  dwImageTransformationParameters
     

    Typedefs

    typedef struct dwImageTransformationObject * dwImageTransformationHandle_t
     The image transformation handle. More...
     

    Functions

    DW_API_PUBLIC dwStatus dwImageTransformation_addPrefenceWait (const NvSciSyncFence *syncFence, dwImageTransformationHandle_t handle)
     Add prefence for NvMedia2D to wait. More...
     
    DW_API_PUBLIC dwStatus dwImageTransformation_appendAllocationAttributes (dwImageProperties *const imgProps, dwImageTransformationHandle_t handle)
     Append the allocation attribute such that the images created of type DW_IMAGE_NVMEDIA can be fed to dwImageTransformation_copy,. More...
     
    DW_API_PUBLIC dwStatus dwImageTransformation_copy (dwImageHandle_t outputImage, const dwImageHandle_t inputImage, const dwRect *outputROI, const dwRect *inputROI, dwImageTransformationHandle_t handle)
     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_fillNvSciSyncAttrs (NvSciSyncAttrList syncAttrList, dwSyncType syncType, dwImageTransformationHandle_t handle)
     Fill the sync attributes for the imagetransformation to signal EOF fences. More...
     
    DW_API_PUBLIC dwStatus dwImageTransformation_getCUDAStream (cudaStream_t *stream, dwImageTransformationHandle_t handle)
     Gets the cuda stream used by the APIs of Image Transformation. More...
     
    DW_API_PUBLIC dwStatus dwImageTransformation_getEOFFence (NvSciSyncFence *syncFence, dwImageTransformationHandle_t handle)
     Get EOF fence of the current operation. More...
     
    DW_API_PUBLIC dwStatus dwImageTransformation_initialize (dwImageTransformationHandle_t *handle, dwImageTransformationParameters params, dwContextHandle_t context)
     Initializes an Image Transformation Engine with the given parameters. More...
     
    DW_API_PUBLIC dwStatus dwImageTransformation_registerImages (dwImagePool imagePool, dwImageTransformationHandle_t handle)
     All (both input and output) images that the transformation engine has to work with (NvMedia2D VIC mode only) must be placed in a dwImagePool and registered during initialization phase Note that all the images must have been created with properties with allocation attributes set. More...
     
    DW_API_PUBLIC dwStatus dwImageTransformation_release (dwImageTransformationHandle_t handle)
     Releases the passed Transformation Engine, deallocating all the resources used. More...
     
    DW_API_PUBLIC dwStatus dwImageTransformation_reset (dwImageTransformationHandle_t handle)
     Resets an Image Transformation Engine. More...
     
    DW_API_PUBLIC dwStatus dwImageTransformation_setCUDAStream (cudaStream_t stream, dwImageTransformationHandle_t handle)
     Sets the cuda stream used by the APIs of Image Transformation. More...
     
    DW_API_PUBLIC dwStatus dwImageTransformation_setNvSciSyncObj (NvSciSyncObj syncObj, dwSyncType syncType, dwImageTransformationHandle_t handle)
     Set the sync obj to which the imagetransformation will signal EOF fences. More...
     

    Data Structure Documentation

    ◆ dwImageTransformationParameters

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

    Default is 0.

    uint8_t useNvMedia Boolean indicating whether to use NvMedia (>0) or not (0). Default is 1.

    Typedef Documentation

    ◆ dwImageTransformationHandle_t

    typedef struct dwImageTransformationObject* dwImageTransformationHandle_t

    The image transformation handle.

    Definition at line 68 of file ImageTransformation.h.

    Function Documentation

    ◆ dwImageTransformation_addPrefenceWait()

    DW_API_PUBLIC dwStatus dwImageTransformation_addPrefenceWait ( const NvSciSyncFence *  syncFence,
    dwImageTransformationHandle_t  handle 
    )

    Add prefence for NvMedia2D to wait.

    Parameters
    [out]syncFenceThe sync fence of the frame
    [in]handleHandle to imagetransformation
    Returns
    DW_INVALID_ARGUMENT if syncFence or handle are null
    DW_INVALID_HANDLE if the image transformation handle is not valid
    DW_NVMEDIA_ERROR if the underlying NvMedia operation failed
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

    ◆ dwImageTransformation_appendAllocationAttributes()

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

    Append the allocation attribute such that the images created of type DW_IMAGE_NVMEDIA can be fed to dwImageTransformation_copy,.

    Parameters
    [in,out]imgPropsImage properties
    [in]handledwImageTransformation 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_INVALID_ARGUMENT if imgProps or handle are null
    DW_INTERNAL_ERROR if the underlying NvMedia operation failed
    DW_INVALID_HANDLE if the image transformation handle is not valid
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: No
    • De-Init: No

    ◆ dwImageTransformation_copy()

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

    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 null, 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]handleHandle to the Image Transformation engine
    Returns
    DW_INVALID_ARGUMENT if the outputImage or inputImage are null
    DW_INVALID_HANDLE if image handles or image transformation handle are not valid
    DW_CUDA_ERROR if the underlying cuda operation failed
    DW_NVMEDIA_ERROR if the underlying NvMedia operation failed
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

    ◆ dwImageTransformation_fillNvSciSyncAttrs()

    DW_API_PUBLIC dwStatus dwImageTransformation_fillNvSciSyncAttrs ( NvSciSyncAttrList  syncAttrList,
    dwSyncType  syncType,
    dwImageTransformationHandle_t  handle 
    )

    Fill the sync attributes for the imagetransformation to signal EOF fences.

    Note that multiple calls on the same syncAttrList will append the same attributes.

    Parameters
    [out]syncAttrListThe sync attributes list to be filled
    [in]syncTypeThe sync type
    [in]handleThe imagetransformation handle
    Returns
    DW_INVALID_ARGUMENT if syncAttrList or handle are null
    DW_INVALID_HANDLE if the image transformation handle is not valid
    DW_NVMEDIA_ERROR if the underlying NvMedia operation failed
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: No
    • De-Init: No

    ◆ dwImageTransformation_getCUDAStream()

    DW_API_PUBLIC dwStatus dwImageTransformation_getCUDAStream ( cudaStream_t *  stream,
    dwImageTransformationHandle_t  handle 
    )

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

    Parameters
    [out]streamCUDA stream
    [in]handleHandle to the Image Transformation engine
    Returns
    DW_INVALID_ARGUMENT if the handle or stream are null
    DW_INVALID_HANDLE if the image transformation handle is not valid
    DW_CUDA_ERROR if the underlying cuda operation failed
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

    ◆ dwImageTransformation_getEOFFence()

    DW_API_PUBLIC dwStatus dwImageTransformation_getEOFFence ( NvSciSyncFence *  syncFence,
    dwImageTransformationHandle_t  handle 
    )

    Get EOF fence of the current operation.

    Parameters
    [out]syncFenceThe sync fence of the frame
    [in]handleHandle to imagetransformation
    Returns
    DW_INVALID_ARGUMENT if syncFence or handle are null
    DW_INVALID_HANDLE if the image transformation handle is not valid
    DW_NVMEDIA_ERROR if the underlying NvMedia operation failed
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

    ◆ dwImageTransformation_initialize()

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

    Initializes an Image Transformation Engine with the given parameters.

    Parameters
    [out]handlePointer to the Image Transformation Engine
    [in]paramsparameters of image transformation.
    [in]contextHandle to Driveworks
    Returns
    DW_INVALID_ARGUMENT if the handle or context are null
    DW_INVALID_HANDLE if the image transformation handle is not valid
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: No
    • De-Init: No

    ◆ dwImageTransformation_registerImages()

    DW_API_PUBLIC dwStatus dwImageTransformation_registerImages ( dwImagePool  imagePool,
    dwImageTransformationHandle_t  handle 
    )

    All (both input and output) images that the transformation engine has to work with (NvMedia2D VIC mode only) must be placed in a dwImagePool and registered during initialization phase Note that all the images must have been created with properties with allocation attributes set.

    Parameters
    [in]imagePoolHandle to the dwImagePool, ownership remains of the creator of the pool
    [in]handledwImageTransformation handle
    Returns
    DW_NVMEDIA_ERROR - if underlying VIC engine had an NvMedia error.
    DW_INVALID_HANDLE - if given handle is not valid.
    DW_SUCCESS - if call is successful.
    API Group
    • Init: Yes
    • Runtime: No
    • De-Init: No

    ◆ dwImageTransformation_release()

    DW_API_PUBLIC dwStatus dwImageTransformation_release ( dwImageTransformationHandle_t  handle)

    Releases the passed Transformation Engine, deallocating all the resources used.

    Parameters
    [in]handlePointer to the Image Transformation Engine.
    Returns
    DW_INVALID_ARGUMENT if the handle is null
    DW_INVALID_HANDLE if the image transformation handle is not valid
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: No
    • De-Init: Yes

    ◆ dwImageTransformation_reset()

    DW_API_PUBLIC dwStatus dwImageTransformation_reset ( dwImageTransformationHandle_t  handle)

    Resets an Image Transformation Engine.

    Parameters
    [in]handlePointer to the Image Transformation Engine.
    Returns
    DW_INVALID_ARGUMENT if the handle is null
    DW_INVALID_HANDLE if the image transformation handle is not valid
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

    ◆ dwImageTransformation_setCUDAStream()

    DW_API_PUBLIC dwStatus dwImageTransformation_setCUDAStream ( cudaStream_t  stream,
    dwImageTransformationHandle_t  handle 
    )

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

    Parameters
    [in]streamCUDA stream
    [in]handleHandle to the Image Transformation engine
    Returns
    DW_INVALID_ARGUMENT if the handle or stream are null
    DW_INVALID_HANDLE if the image transformation handle is not valid
    DW_CUDA_ERROR if the underlying cuda operation failed
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

    ◆ dwImageTransformation_setNvSciSyncObj()

    DW_API_PUBLIC dwStatus dwImageTransformation_setNvSciSyncObj ( NvSciSyncObj  syncObj,
    dwSyncType  syncType,
    dwImageTransformationHandle_t  handle 
    )

    Set the sync obj to which the imagetransformation will signal EOF fences.

    The sync object is not reference counted.

    Parameters
    [in]syncObjThe sync object
    [in]syncTypeThe sync type
    [in]handleThe imagetransformation handle
    Returns
    DW_INVALID_ARGUMENT if syncObj or handle are null
    DW_INVALID_HANDLE if the image transformation handle is not valid
    DW_NVMEDIA_ERROR if the underlying NvMedia operation failed
    DW_SUCCESS if the operation is successful
    API Group
    • Init: Yes
    • Runtime: No
    • De-Init: No
    人人超碰97caoporen国产