The OpenVX Specification  dba1aa3
Object: Node

Detailed Description

Defines the Node Object interface.

A node is an instance of a kernel that will be paired with a specific set of references (the parameters). Nodes are created from and associated with a single graph only. When a vx_parameter is extracted from a Node, an additional attribute can be accessed:

Typedefs

typedef struct _vx_node * vx_node
 An opaque reference to a kernel node. More...
 

Enumerations

enum  vx_node_attribute_e {
  VX_NODE_STATUS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x0,
  VX_NODE_PERFORMANCE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x1,
  VX_NODE_BORDER = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x2,
  VX_NODE_LOCAL_DATA_SIZE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x3,
  VX_NODE_LOCAL_DATA_PTR = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x4,
  VX_NODE_PARAMETERS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x5,
  VX_NODE_IS_REPLICATED = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x6,
  VX_NODE_REPLICATE_FLAGS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x7,
  VX_NODE_VALID_RECT_RESET = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x8
}
 The node attributes list. More...
 

Functions

vx_status VX_API_CALL vxQueryNode (vx_node node, vx_enum attribute, void *ptr, vx_size size)
 Allows a user to query information out of a node. More...
 
vx_status VX_API_CALL vxReleaseNode (vx_node *node)
 Releases a reference to a Node object. The object may not be garbage collected until its total reference count is zero. More...
 
vx_status VX_API_CALL vxRemoveNode (vx_node *node)
 Removes a Node from its parent Graph and releases it. More...
 
vx_status VX_API_CALL vxReplicateNode (vx_graph graph, vx_node first_node, vx_bool replicate[], vx_uint32 number_of_parameters)
 Creates replicas of the same node first_node to process a set of objects stored in vx_pyramid or vx_object_array. first_node needs to have as parameter levels 0 of a vx_pyramid or the index 0 of a vx_object_array. Replica nodes are not accessible by the application through any means. An application request for removal of first_node from the graph will result in removal of all replicas. Any change of parameter or attribute of first_node will be propagated to the replicas. vxVerifyGraph shall enforce consistency of parameters and attributes in the replicas. More...
 
vx_status VX_API_CALL vxSetNodeAttribute (vx_node node, vx_enum attribute, const void *ptr, vx_size size)
 Allows a user to set attribute of a node before Graph Validation. More...
 
vx_status VX_API_CALL vxSetNodeTarget (vx_node node, vx_enum target_enum, const char *target_string)
 Sets the node target to the provided value. A success invalidates the graph that the node belongs to (vxVerifyGraph must be called before the next execution) More...
 

Typedef Documentation

typedef struct _vx_node* vx_node

An opaque reference to a kernel node.

See also
vxCreateGenericNode

Definition at line 201 of file vx_types.h.

Enumeration Type Documentation

The node attributes list.

Enumerator
VX_NODE_STATUS 

Queries the status of node execution. Read-only. Use a vx_status parameter.

VX_NODE_PERFORMANCE 

Queries the performance of the node execution. The accuracy of timing information is platform dependent and also depends on the graph optimizations. Read-only.

Note
Performance tracking must have been enabled. See vx_directive_e.
VX_NODE_BORDER 

Gets or sets the border mode of the node. Read-write. Use a vx_border_t structure with a default value of VX_BORDER_UNDEFINED.

VX_NODE_LOCAL_DATA_SIZE 

Indicates the size of the kernel local memory area. Read-only. Can be written only at user-node (de)initialization if VX_KERNEL_LOCAL_DATA_SIZE==0. Use a vx_size parameter.

VX_NODE_LOCAL_DATA_PTR 

Indicates the pointer kernel local memory area. Read-Write. Can be written only at user-node (de)initialization if VX_KERNEL_LOCAL_DATA_SIZE==0. Use a void * parameter.

VX_NODE_PARAMETERS 

Indicates the number of node parameters, including optional parameters that are not passed. Read-only. Use a vx_uint32 parameter.

VX_NODE_IS_REPLICATED 

Indicates whether the node is replicated. Read-only. Use a vx_bool parameter.

VX_NODE_REPLICATE_FLAGS 

Indicates the replicated parameters. Read-only. Use a vx_bool* parameter.

VX_NODE_VALID_RECT_RESET 

Indicates the behavior with respect to the valid rectangle. Read-only. Use a vx_bool parameter.

Definition at line 886 of file vx_types.h.

Function Documentation

vx_status VX_API_CALL vxQueryNode ( vx_node  node,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Allows a user to query information out of a node.

Parameters
[in]nodeThe reference to the node to query.
[in]attributeUse vx_node_attribute_e value to query for information.
[out]ptrThe location at which to store the resulting value.
[in]sizeThe size in bytesin 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_REFERENCEnode is not a valid vx_node reference.
VX_ERROR_INVALID_PARAMETERSThe type or size is incorrect.
vx_status VX_API_CALL vxSetNodeAttribute ( vx_node  node,
vx_enum  attribute,
const void *  ptr,
vx_size  size 
)

Allows a user to set attribute of a node before Graph Validation.

Parameters
[in]nodeThe reference to the node to set.
[in]attributeUse vx_node_attribute_e value to set the desired attribute.
[in]ptrThe pointer to the desired value of the attribute.
[in]sizeThe size in bytes of the objects to which ptr points.
Note
Some attributes are inherited from the vx_kernel, which was used to create the node. Some of these can be overridden using this API, notably VX_NODE_LOCAL_DATA_SIZE and VX_NODE_LOCAL_DATA_PTR.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSThe attribute was set; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEnode is not a valid vx_node reference.
VX_ERROR_INVALID_PARAMETERSsize is not correct for the type needed.
vx_status VX_API_CALL vxReleaseNode ( vx_node node)

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

Parameters
[in]nodeThe pointer to the reference of the node to release.
Postcondition
After returning from this function the reference is zeroed.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEnode is not a valid vx_node reference.
vx_status VX_API_CALL vxRemoveNode ( vx_node node)

Removes a Node from its parent Graph and releases it.

Parameters
[in]nodeThe pointer to the node to remove and release.
Postcondition
After returning from this function the reference is zeroed.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEnode is not a valid vx_node reference.
vx_status VX_API_CALL vxSetNodeTarget ( vx_node  node,
vx_enum  target_enum,
const char *  target_string 
)

Sets the node target to the provided value. A success invalidates the graph that the node belongs to (vxVerifyGraph must be called before the next execution)

Parameters
[in]nodeThe reference to the vx_node object.
[in]target_enumThe target enum to be set to the vx_node object. Use a vx_target_e.
[in]target_stringThe target name ASCII string. This contains a valid value when target_enum is set to VX_TARGET_STRING, otherwise it is ignored.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNode target set; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEnode is not a valid vx_node reference.
VX_ERROR_NOT_SUPPORTEDIf the node kernel is not supported by the specified target.
vx_status VX_API_CALL vxReplicateNode ( vx_graph  graph,
vx_node  first_node,
vx_bool  replicate[],
vx_uint32  number_of_parameters 
)

Creates replicas of the same node first_node to process a set of objects stored in vx_pyramid or vx_object_array. first_node needs to have as parameter levels 0 of a vx_pyramid or the index 0 of a vx_object_array. Replica nodes are not accessible by the application through any means. An application request for removal of first_node from the graph will result in removal of all replicas. Any change of parameter or attribute of first_node will be propagated to the replicas. vxVerifyGraph shall enforce consistency of parameters and attributes in the replicas.

Parameters
[in]graphThe reference to the graph.
[in]first_nodeThe reference to the node in the graph that will be replicated.
[in]replicatean array of size equal to the number of node parameters, vx_true_e for the parameters that should be iterated over (should be a reference to a vx_pyramid or a vx_object_array), vx_false_e for the parameters that should be the same across replicated nodes and for optional parameters that are not used. Should be vx_true_e for all output and bidirectional parameters.
[in]number_of_parametersnumber of elements in the replicate array
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEgraph is not a valid vx_graph reference, or first_node is not a valid vx_node reference.
VX_ERROR_NOT_COMPATIBLEAt least one of replicated parameters is not of level 0 of a pyramid or at index 0 of an object array.
VX_FAILUREIf the node does not belong to the graph, or the number of objects in the parent objects of inputs and output are not the same.