CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
Extension: OpenVX Helper

The helper is an non-standardized set of convenience constructs for OpenVX. More...

Classes

struct  _vx_param_description_t
 Contains everything needed to abstractly describe a parameter to a kernel. This is used to declare kernel parameters at compile time. More...
 
struct  _vx_kernel_description_t
 Contains everything needed to abstractly describe a kernel. This is used to declare kernels at compile time. More...
 
struct  _vx_log_entry_t
 A log entry contains the graph reference, a status and a message. More...
 
struct  _vx_log_t
 The log of a graph. More...
 

Macros

#define VX_TAU   6.28318530717958647692
 A definition for TAU, or 2*PI.
 
#define VX_MAX_LOG_NUM_ENTRIES   (1024)
 Maximum number of supported entries.
 
#define dimof(x)
 A helper macro to determine the number of elements in an array.
 

Typedefs

typedef struct _vx_param_description_t vx_param_description_t
 Contains everything needed to abstractly describe a parameter to a kernel. This is used to declare kernel parameters at compile time.
 
typedef struct _vx_kernel_description_t vx_kernel_description_t
 Contains everything needed to abstractly describe a kernel. This is used to declare kernels at compile time.
 
typedef struct _vx_log_entry_t vx_log_entry_t
 A log entry contains the graph reference, a status and a message.
 
typedef struct _vx_log_t vx_log_t
 The log of a graph.
 

Functions

vx_status vxGetLogEntry (vx_reference ref, char message[VX_MAX_LOG_MESSAGE_LEN])
 Returns the previous entry of the log. When called consecutively it will return the entire log. The log will be cleared by reading it.
 
void vxRegisterHelperAsLogReader (vx_context context)
 This enables the helper library logging feature to take over the error log callback and keep a database of previous log entries.
 
vx_node vxCreateNodeByStructure (vx_graph graph, vx_enum kernelenum, vx_reference params[], vx_uint32 num)
 A method to construct a node via arbitrary parameters and an enum.
 
void vxClearLog (vx_reference ref)
 A method to clear out the log for a particular reference, such as a graph.
 
vx_status vxLinkParametersByReference (vx_parameter a, vx_parameter b)
 This is used to connect one node parameter to another node parameter when the original handles to the data objects are already lost. The context determines if a buffer is necessary or can be optimized out.
 
vx_status vxLinkParametersByIndex (vx_node node_a, vx_uint32 index_a, vx_node node_b, vx_uint32 index_b)
 This is used to connect one parameter to another parameter by explicity indexing when the handles to the data objects are lost.
 
vx_status vxSetAffineRotationMatrix (vx_matrix matrix, vx_float32 angle, vx_float32 scale, vx_float32 center_x, vx_float32 center_y)
 This helper is used to easily set the affine matrix to a rotation and scale.
 
vx_status vxAlterRectangle (vx_rectangle_t *rect, vx_int32 dsx, vx_int32 dsy, vx_int32 dex, vx_int32 dey)
 [Helper] This function changes the points of a rectangle by some delta value per coordinate.
 
vx_status vxAddParameterToGraphByIndex (vx_graph g, vx_node n, vx_uint32 index)
 Adds a parameter to a graph by indicating the source node, and the index of the parameter on the node.
 
vx_bool vxFindOverlapRectangle (vx_rectangle_t *rect_a, vx_rectangle_t *rect_b, vx_rectangle_t *rect_res)
 Find the overlapping rectange between two rectangles.
 
void vxReadRectangle (const void *base, const vx_imagepatch_addressing_t *addr, const vx_border_t *borders, vx_df_image type, vx_uint32 center_x, vx_uint32 center_y, vx_uint32 radius_x, vx_uint32 radius_y, void *destination, vx_uint32 border_x_start)
 Read a rectangle-shaped section of an image into a 2D array.
 
vx_int64 vxDivFloor (vx_int64 x, vx_int64 y)
 Integer division with rounding towards minus infinity.
 

Detailed Description

The helper is an non-standardized set of convenience constructs for OpenVX.

These functions use only the OpenVX API in order to implement their functionality. As such structures, objects, defines, typedefs and functions defined herein are not part of the OpenVX standard, and are included as EXAMPLE code only.

Macro Definition Documentation

◆ dimof

#define dimof ( x)

#include <vx_helper.h>

Value:
(sizeof(x)/sizeof(x[0]))

A helper macro to determine the number of elements in an array.

◆ VX_MAX_LOG_NUM_ENTRIES

#define VX_MAX_LOG_NUM_ENTRIES   (1024)

#include <vx_helper.h>

Maximum number of supported entries.

◆ VX_TAU

#define VX_TAU   6.28318530717958647692

#include <vx_helper.h>

A definition for TAU, or 2*PI.

Typedef Documentation

◆ vx_kernel_description_t

#include <vx_helper.h>

Contains everything needed to abstractly describe a kernel. This is used to declare kernels at compile time.

◆ vx_log_entry_t

#include <vx_helper.h>

A log entry contains the graph reference, a status and a message.

◆ vx_log_t

typedef struct _vx_log_t vx_log_t

#include <vx_helper.h>

The log of a graph.

◆ vx_param_description_t

#include <vx_helper.h>

Contains everything needed to abstractly describe a parameter to a kernel. This is used to declare kernel parameters at compile time.

Function Documentation

◆ vxAddParameterToGraphByIndex()

vx_status vxAddParameterToGraphByIndex ( vx_graph g,
vx_node n,
vx_uint32 index )

#include <vx_helper.h>

Adds a parameter to a graph by indicating the source node, and the index of the parameter on the node.

Parameters
[in]gThe graph handle.
[in]nThe node handle.
[in]indexThe index of the parameter on the node.
Returns
Returns a vx_status_e enumeration.

◆ vxAlterRectangle()

vx_status vxAlterRectangle ( vx_rectangle_t * rect,
vx_int32 dsx,
vx_int32 dsy,
vx_int32 dex,
vx_int32 dey )

#include <vx_helper.h>

[Helper] This function changes the points of a rectangle by some delta value per coordinate.

Parameters
[in]rectThe rectangle to modify.
[in]dsxThe start x delta.
[in]dsyThe start y delta.
[in]dexThe end x delta.
[in]deyThe end y delta.
Returns
vx_status
Return values
VX_SUCCESSModified rectangle.
VX_ERROR_INVALID_REFERENCENot a valid rectangle.

◆ vxClearLog()

void vxClearLog ( vx_reference ref)

#include <vx_helper.h>

A method to clear out the log for a particular reference, such as a graph.

Parameters
[in]refThe reference to remove from the log.

◆ vxCreateNodeByStructure()

vx_node vxCreateNodeByStructure ( vx_graph graph,
vx_enum kernelenum,
vx_reference params[],
vx_uint32 num )

#include <vx_helper.h>

A method to construct a node via arbitrary parameters and an enum.

Parameters
[in]graphThe handle to desired graph to add the node to.
[in]kernelenumThe vx_kernel_e enum value used to create a node.
[in]paramsThe array of parameter information.
[in]numThe number of elements in params.
Returns
vx_node
Return values
0Indicates a failure.

◆ vxDivFloor()

vx_int64 vxDivFloor ( vx_int64 x,
vx_int64 y )

#include <vx_helper.h>

Integer division with rounding towards minus infinity.

◆ vxFindOverlapRectangle()

vx_bool vxFindOverlapRectangle ( vx_rectangle_t * rect_a,
vx_rectangle_t * rect_b,
vx_rectangle_t * rect_res )

#include <vx_helper.h>

Find the overlapping rectange between two rectangles.

◆ vxGetLogEntry()

vx_status vxGetLogEntry ( vx_reference ref,
char message[VX_MAX_LOG_MESSAGE_LEN] )

#include <vx_helper.h>

Returns the previous entry of the log. When called consecutively it will return the entire log. The log will be cleared by reading it.

Parameters
[in]refThe reference to filter the log entries against. If the context is given, the next entry will be returned.
[out]messageA predefined location to store a copy of the log's message value. This must point to at least VX_MAX_LOG_MESSAGE_LEN bytes of characters.
Returns
Returns the status of the log entry from vx_status_e.
Note
The API returns errors oldest to newest order. When VX_SUCCESS is returned, the log reading is complete.

◆ vxLinkParametersByIndex()

vx_status vxLinkParametersByIndex ( vx_node node_a,
vx_uint32 index_a,
vx_node node_b,
vx_uint32 index_b )

#include <vx_helper.h>

This is used to connect one parameter to another parameter by explicity indexing when the handles to the data objects are lost.

Parameters
[in]node_aThe source node to link from.
[in]index_aThe index of the vx_parameter to link from.
[in]node_bThe sink node to link to.
[in]index_bThe index of the vx_parameter to link to.
Returns
Returns a status code.

◆ vxLinkParametersByReference()

vx_status vxLinkParametersByReference ( vx_parameter a,
vx_parameter b )

#include <vx_helper.h>

This is used to connect one node parameter to another node parameter when the original handles to the data objects are already lost. The context determines if a buffer is necessary or can be optimized out.

Parameters
[in]aThe first parameter
[in]bThe second parameter
Note
a or b must be an output parameter and other other an input.
Returns
Returns a status code.

◆ vxReadRectangle()

void vxReadRectangle ( const void * base,
const vx_imagepatch_addressing_t * addr,
const vx_border_t * borders,
vx_df_image type,
vx_uint32 center_x,
vx_uint32 center_y,
vx_uint32 radius_x,
vx_uint32 radius_y,
void * destination,
vx_uint32 border_x_start )

#include <vx_helper.h>

Read a rectangle-shaped section of an image into a 2D array.

◆ vxRegisterHelperAsLogReader()

void vxRegisterHelperAsLogReader ( vx_context context)

#include <vx_helper.h>

This enables the helper library logging feature to take over the error log callback and keep a database of previous log entries.

◆ vxSetAffineRotationMatrix()

vx_status vxSetAffineRotationMatrix ( vx_matrix matrix,
vx_float32 angle,
vx_float32 scale,
vx_float32 center_x,
vx_float32 center_y )

#include <vx_helper.h>

This helper is used to easily set the affine matrix to a rotation and scale.

Parameters
[in]matrixThe handle to the matrix.
[in]angleThe rotation angle in degrees.
[in]scaleThe scaling value. Values less than one are enlarging.
[in]center_xThe center pixel in the x direction.
[in]center_yThe center pixel in the y direction.
Returns
Returns a vx_status_e enumeration.