DriveWorks SDK Reference
5.8.83 Release
For Test and Development only

Pyramid Interface

Detailed Description

Defines the image pyramid structure.

Data Structures

struct  dwPyramidImage
 Pyramid image structure. More...
 
struct  dwPyramidImageProperties
 Pyramid image properties structure. More...
 

Macros

#define DW_PYRAMID_LEVEL_MAX_COUNT   12
 

Functions

DW_API_PUBLIC dwStatus dwImageFilter_computePyramid (dwPyramidImage *pyramid, const dwImageCUDA *image, cudaStream_t stream, dwContextHandle_t context)
 Builds the pyramid from level 0 image. More...
 
DW_API_PUBLIC dwStatus dwPyramid_create (dwPyramidImage *pyramid, uint32_t levelCount, uint32_t width, uint32_t height, dwTrivialDataType pxlType, dwContextHandle_t context)
 Creates and initializes an image pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_createFromProperties (dwPyramidImage *pyramid, const dwPyramidImageProperties *props, dwContextHandle_t context)
 Creates and initializes an image pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_destroy (dwPyramidImage pyramid)
 Destroy pyramid images. More...
 
DW_API_PUBLIC dwStatus dwPyramid_fillProperties (dwPyramidImageProperties *props, uint32_t levelCount, uint32_t width, uint32_t height, dwTrivialDataType pxlType)
 Fills the pyramid image properties structure. More...
 
DW_API_PUBLIC dwStatus dwPyramid_getProperties (dwPyramidImageProperties *props, dwPyramidImage *pyramid, dwContextHandle_t context)
 Gets the properties of a pyramid image. More...
 

Data Structure Documentation

◆ dwPyramidImage

struct dwPyramidImage
Data Fields
uint32_t levelCount number of level images in pyramid
dwImageHandle_t levelImages[DW_PYRAMID_LEVEL_MAX_COUNT] level image data levelImages[0] is the level 0 image which has the highest resolution levelImages[N] is the level N image, it is half the size of level N-1 image

◆ dwPyramidImageProperties

struct dwPyramidImageProperties
Data Fields
uint32_t levelCount number of level images in pyramid
dwImageProperties levelProps[DW_PYRAMID_LEVEL_MAX_COUNT] level image properties levelProps[0] refers to the level 0 image which has the highest resolution levelProps[N] refers to the level N image, it is half the size of level N-1 image

Macro Definition Documentation

◆ DW_PYRAMID_LEVEL_MAX_COUNT

#define DW_PYRAMID_LEVEL_MAX_COUNT   12

Definition at line 61 of file Pyramid.h.

Function Documentation

◆ dwImageFilter_computePyramid()

DW_API_PUBLIC dwStatus dwImageFilter_computePyramid ( dwPyramidImage pyramid,
const dwImageCUDA image,
cudaStream_t  stream,
dwContextHandle_t  context 
)

Builds the pyramid from level 0 image.

Parameters
[in,out]pyramidpyramid images that will be built, must be initialized by 'dwPyramid_create' first
[in]imageSpecifies the level 0 image which has the highest resolution
[in]streamSpecifies the CUDA stream to use during pyramid building.
[in]contextSpecifies the handle to the active DW context
Returns
DW_INVALID_ARGUMENT if pyramid, image or context are NULL
DW_INVALID_ARGUMENT if width/height of input 'image' differs from the one in 'dwPyramid_create'
DW_BAD_CAST if level image in pyramid has invalid types
DW_SUCCESS otherwise
Note
Before computing pyramid, 'dwPyramidImage' must be initialized by 'dwPyramid_create', input 'image' must have the same width/height as in 'dwPyramid_create'

◆ dwPyramid_create()

DW_API_PUBLIC dwStatus dwPyramid_create ( dwPyramidImage pyramid,
uint32_t  levelCount,
uint32_t  width,
uint32_t  height,
dwTrivialDataType  pxlType,
dwContextHandle_t  context 
)

Creates and initializes an image pyramid.

Parameters
[out]pyramidA pointer to the pyramid image will be returned here.
[in]levelCountNumber of levels in the pyramid
[in]widthWidth of level 0 image
[in]heightHeight of level 0 image
[in]pxlTypeData Type of pyramid, currently only 'DW_TYPE_UINT8', 'DW_TYPE_UINT16', 'DW_TYPE_FLOAT16' and 'DW_TYPE_FLOAT32' are supported
[in]contextSpecifies the handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT if pyramid or context are NULL
DW_INVALID_ARGUMENT if pxlType is unsupported
DW_INVALID_ARGUMENT if levelCount > DW_PYRAMID_LEVEL_MAX_COUNT
DW_SUCCESS otherwise
Note
Level 0 image has the highest resolution in all pyramid level images, level 0 image size should be the same as input image in 'dwImageFilter_buildPyramid'

◆ dwPyramid_createFromProperties()

DW_API_PUBLIC dwStatus dwPyramid_createFromProperties ( dwPyramidImage pyramid,
const dwPyramidImageProperties props,
dwContextHandle_t  context 
)

Creates and initializes an image pyramid.

Parameters
[out]pyramidA pointer to the pyramid image will be returned here.
[in]propsProperties of the pyramid image
[in]contextSpecifies the handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT if pyramid or context are NULL DW_INVALID_ARGUMENT if pxlType is unsupported DW_INVALID_ARGUMENT if levelCount > DW_PYRAMID_LEVEL_MAX_COUNT DW_SUCCESS otherwise

◆ dwPyramid_destroy()

DW_API_PUBLIC dwStatus dwPyramid_destroy ( dwPyramidImage  pyramid)

Destroy pyramid images.

Parameters
[in]pyramidpyramid image to be destroyed
Returns
DW_INVALID_ARGUMENT if level image in pyramid contains invalid data
DW_SUCCESS otherwise.

◆ dwPyramid_fillProperties()

DW_API_PUBLIC dwStatus dwPyramid_fillProperties ( dwPyramidImageProperties props,
uint32_t  levelCount,
uint32_t  width,
uint32_t  height,
dwTrivialDataType  pxlType 
)

Fills the pyramid image properties structure.

Parameters
[out]propsA pointer to properties structure to be filled.
[in]levelCountNumber of levels in the pyramid
[in]widthWidth of level 0 image
[in]heightHeight of level 0 image
[in]pxlTypeData Type of pyramid, currently only 'DW_TYPE_UINT8', 'DW_TYPE_UINT16', 'DW_TYPE_FLOAT16' and 'DW_TYPE_FLOAT32' are supported
Returns
DW_INVALID_ARGUMENT if props is NULL DW_INVALID_ARGUMENT if pxlType is unsupported DW_INVALID_ARGUMENT if levelCount > DW_PYRAMID_LEVEL_MAX_COUNT DW_SUCCESS otherwise
Note
Level 0 image has the highest resolution in all pyramid level images, level 0 image size should be the same as input image in 'dwImageFilter_buildPyramid'

◆ dwPyramid_getProperties()

DW_API_PUBLIC dwStatus dwPyramid_getProperties ( dwPyramidImageProperties props,
dwPyramidImage pyramid,
dwContextHandle_t  context 
)

Gets the properties of a pyramid image.

Parameters
[out]propsA pointer to properties structure to be filled.
[in]pyramidA pointer to the pyramid image
[in]contextSpecifies the handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT if props or pyramid or context are NULL DW_SUCCESS otherwise
Note
Level 0 image has the highest resolution in all pyramid level images, level 0 image size should be the same as input image in 'dwImageFilter_buildPyramid'