CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
User Facing Pyramid API

The Public Pyramid API. More...

Macros

#define VX_SCALE_PYRAMID_HALF   (0.5f)
 Use to indicate a half-scale pyramid.
 
#define VX_SCALE_PYRAMID_ORB   ((vx_float32)0.8408964f)
 Use to indicate a ORB scaled pyramid whose scaling factor is \( \frac{1}{\root 4 \of {2}} \).
 

Typedefs

typedef struct Pyramid * vx_pyramid
 The Image Pyramid object. A set of scaled images.
 

Enumerations

enum  vx_pyramid_attribute_e {
  VX_PYRAMID_LEVELS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PYRAMID) + 0x0 ,
  VX_PYRAMID_SCALE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PYRAMID) + 0x1 ,
  VX_PYRAMID_WIDTH = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PYRAMID) + 0x2 ,
  VX_PYRAMID_HEIGHT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PYRAMID) + 0x3 ,
  VX_PYRAMID_FORMAT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PYRAMID) + 0x4
}
 The pyramid object attributes. More...
 

Functions

VX_API_ENTRY vx_pyramid VX_API_CALL vxCreatePyramid (vx_context context, vx_size levels, vx_float32 scale, vx_uint32 width, vx_uint32 height, vx_df_image format)
 Creates a reference to a pyramid object of the supplied number of levels.
 
VX_API_ENTRY vx_pyramid VX_API_CALL vxCreateVirtualPyramid (vx_graph graph, vx_size levels, vx_float32 scale, vx_uint32 width, vx_uint32 height, vx_df_image format)
 Creates a reference to a virtual pyramid object of the supplied number of levels.
 
VX_API_ENTRY vx_status VX_API_CALL vxReleasePyramid (vx_pyramid *pyr)
 Releases a reference to a pyramid object. The object may not be garbage collected until its total reference count is zero.
 
VX_API_ENTRY vx_status VX_API_CALL vxQueryPyramid (vx_pyramid pyr, vx_enum attribute, void *ptr, vx_size size)
 Queries an attribute from an image pyramid.
 
VX_API_ENTRY vx_image VX_API_CALL vxGetPyramidLevel (vx_pyramid pyr, vx_uint32 index)
 Retrieves a level of the pyramid as a vx_image, which can be used elsewhere in OpenVX. A call to vxReleaseImage is necessary to release an image for each call of vxGetPyramidLevel.
 

Detailed Description

The Public Pyramid API.

Macro Definition Documentation

◆ VX_SCALE_PYRAMID_HALF

#define VX_SCALE_PYRAMID_HALF   (0.5f)

#include <vx_types.h>

Use to indicate a half-scale pyramid.

◆ VX_SCALE_PYRAMID_ORB

#define VX_SCALE_PYRAMID_ORB   ((vx_float32)0.8408964f)

#include <vx_types.h>

Use to indicate a ORB scaled pyramid whose scaling factor is \( \frac{1}{\root 4 \of {2}} \).

Typedef Documentation

◆ vx_pyramid

typedef struct Pyramid* vx_pyramid

#include <vx_types.h>

The Image Pyramid object. A set of scaled images.

Enumeration Type Documentation

◆ vx_pyramid_attribute_e

#include <vx_types.h>

The pyramid object attributes.

Enumerator
VX_PYRAMID_LEVELS 

The number of levels of the pyramid. Read-only. Use a vx_size parameter.

VX_PYRAMID_SCALE 

The scale factor between each level of the pyramid. Read-only. Use a vx_float32 parameter.

VX_PYRAMID_WIDTH 

The width of the 0th image in pixels. Read-only. Use a vx_uint32 parameter.

VX_PYRAMID_HEIGHT 

The height of the 0th image in pixels. Read-only. Use a vx_uint32 parameter.

VX_PYRAMID_FORMAT 

The vx_df_image_e format of the image. Read-only. Use a vx_df_image parameter.

Function Documentation

◆ vxCreatePyramid()

VX_API_ENTRY vx_pyramid VX_API_CALL vxCreatePyramid ( vx_context context,
vx_size levels,
vx_float32 scale,
vx_uint32 width,
vx_uint32 height,
vx_df_image format )

#include <vx_api.h>

Creates a reference to a pyramid object of the supplied number of levels.

Parameters
[in]contextThe reference to the overall context.
[in]levelsThe number of levels desired. This is required to be a non-zero value.
[in]scaleUsed to indicate the scale between pyramid levels. This is required to be a non-zero positive value. VX_SCALE_PYRAMID_HALF and VX_SCALE_PYRAMID_ORB must be supported.
[in]widthThe width of the 0th level image in pixels.
[in]heightThe height of the 0th level image in pixels.
[in]formatThe format of all images in the pyramid. NV12, NV21, IYUV, UYVY and YUYV formats are not supported.
Returns
A pyramid reference vx_pyramid containing the sub-images. Any possible errors preventing a successful creation should be checked using vxGetStatus.
Examples
optical_flow.cpp.

◆ vxCreateVirtualPyramid()

VX_API_ENTRY vx_pyramid VX_API_CALL vxCreateVirtualPyramid ( vx_graph graph,
vx_size levels,
vx_float32 scale,
vx_uint32 width,
vx_uint32 height,
vx_df_image format )

#include <vx_api.h>

Creates a reference to a virtual pyramid object of the supplied number of levels.

Virtual Pyramids can be used to connect Nodes together when the contents of the pyramids will not be accessed by the user of the API. All of the following constructions are valid:

vx_graph graph = vxCreateGraph(context);
vx_pyramid virt[] = {
vxCreateVirtualPyramid(graph, 4, VX_SCALE_PYRAMID_HALF, 0, 0, VX_DF_IMAGE_VIRT), // no dimension and format specified for level 0
vxCreateVirtualPyramid(graph, 4, VX_SCALE_PYRAMID_HALF, 640, 480, VX_DF_IMAGE_VIRT), // no format specified.
vxCreateVirtualPyramid(graph, 4, VX_SCALE_PYRAMID_HALF, 640, 480, VX_DF_IMAGE_U8), // no access
};
@ VX_DF_IMAGE_VIRT
A virtual image of no defined type.
Definition vx_types.h:812
@ VX_DF_IMAGE_U8
A single plane of unsigned 8-bit data. The range of data is not specified, as it may be extracted fro...
Definition vx_types.h:855
struct Context * vx_context
An opaque reference to the implementation context.
Definition vx_types.h:274
VX_API_ENTRY vx_context VX_API_CALL vxCreateContext(void)
Creates a vx_context.
VX_API_ENTRY vx_graph VX_API_CALL vxCreateGraph(vx_context context)
Creates an empty graph.
struct Graph * vx_graph
An opaque reference to a graph.
Definition vx_types.h:263
#define VX_SCALE_PYRAMID_HALF
Use to indicate a half-scale pyramid.
Definition vx_types.h:1747
struct Pyramid * vx_pyramid
The Image Pyramid object. A set of scaled images.
Definition vx_types.h:327
VX_API_ENTRY vx_pyramid VX_API_CALL vxCreateVirtualPyramid(vx_graph graph, vx_size levels, vx_float32 scale, vx_uint32 width, vx_uint32 height, vx_df_image format)
Creates a reference to a virtual pyramid object of the supplied number of levels.
Parameters
[in]graphThe reference to the parent graph.
[in]levelsThe number of levels desired. This is required to be a non-zero value.
[in]scaleUsed to indicate the scale between pyramid levels. This is required to be a non-zero positive value. VX_SCALE_PYRAMID_HALF and VX_SCALE_PYRAMID_ORB must be supported.
[in]widthThe width of the 0th level image in pixels. This may be set to zero to indicate to the interface that the value is unspecified.
[in]heightThe height of the 0th level image in pixels. This may be set to zero to indicate to the interface that the value is unspecified.
[in]formatThe format of all images in the pyramid. This may be set to VX_DF_IMAGE_VIRT to indicate that the format is unspecified.
Returns
A pyramid reference vx_pyramid. Any possible errors preventing a successful creation should be checked using vxGetStatus.
Note
Images extracted with vxGetPyramidLevel behave as Virtual Images and cause vxMapImagePatch to return errors.

◆ vxGetPyramidLevel()

VX_API_ENTRY vx_image VX_API_CALL vxGetPyramidLevel ( vx_pyramid pyr,
vx_uint32 index )

#include <vx_api.h>

Retrieves a level of the pyramid as a vx_image, which can be used elsewhere in OpenVX. A call to vxReleaseImage is necessary to release an image for each call of vxGetPyramidLevel.

Parameters
[in]pyrThe pyramid object.
[in]indexThe index of the level, such that index is less than levels.
Returns
A vx_image reference. Any possible errors preventing a successful function completion should be checked using vxGetStatus.

◆ vxQueryPyramid()

VX_API_ENTRY vx_status VX_API_CALL vxQueryPyramid ( vx_pyramid pyr,
vx_enum attribute,
void * ptr,
vx_size size )

#include <vx_api.h>

Queries an attribute from an image pyramid.

Parameters
[in]pyrThe pyramid to query.
[in]attributeThe attribute for which to query. Use a vx_pyramid_attribute_e enumeration.
[out]ptrThe location at which to store the resulting value.
[in]sizeThe size in bytes of the container to which ptr points.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEpyr is not a valid vx_pyramid reference.

◆ vxReleasePyramid()

VX_API_ENTRY vx_status VX_API_CALL vxReleasePyramid ( vx_pyramid * pyr)

#include <vx_api.h>

Releases a reference to a pyramid object. The object may not be garbage collected until its total reference count is zero.

Parameters
[in]pyrThe pointer to the pyramid to release.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEpyr is not a valid vx_pyramid reference.
Postcondition
After returning from this function the reference is zeroed.
Examples
optical_flow.cpp.