The OpenVX Specification  a73e458
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:

Modules

 The Node Attribute Constants
 The node attributes list.
 

Typedefs

typedef struct _vx_node * vx_node
 An opaque reference to a kernel node. 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 [R00795]. 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 [R00796]. An application request for removal of first_node from the graph will result in removal of all replicas [R00797]. Any change of parameter or attribute of first_node will be propagated to the replicas [R00798]. vxVerifyGraph shall enforce consistency of parameters and attributes in the replicas [R00799]. 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) [R00790]. More...
 

Typedef Documentation

◆ vx_node

typedef struct _vx_node* vx_node

An opaque reference to a kernel node.

See also
vxCreateGenericNode

Definition at line 212 of file vx_types.h.

Function Documentation

◆ vxQueryNode()

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 [R00765].
[in]attributeUse The Node Attribute Constants value to query for information [R00766].
[out]ptrThe location at which to store the resulting value [R00767].
[in]sizeThe size in bytesin bytes of the container to which ptr points [R00768].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00769].
VX_ERROR_INVALID_REFERENCEnode is not a valid vx_node reference.
VX_ERROR_INVALID_PARAMETERSThe type or size is incorrect.

◆ vxSetNodeAttribute()

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 [R00770].
[in]attributeUse The Node Attribute Constants value to set the desired attribute [R00771].
[in]ptrThe pointer to the desired value of the attribute [R00772].
[in]sizeThe size in bytes of the objects to which ptr points [R00773].
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 [R00774].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSThe attribute was set; any other value indicates failure [R00775].
VX_ERROR_INVALID_REFERENCEnode is not a valid vx_node reference.
VX_ERROR_INVALID_PARAMETERSsize is not correct for the type needed.

◆ vxReleaseNode()

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,out]nodeThe pointer to the reference of the node to release [R00776].
Postcondition
After returning from this function the reference is zeroed [R00777].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00778].
VX_ERROR_INVALID_REFERENCEnode is not a valid vx_node reference.

◆ vxRemoveNode()

vx_status VX_API_CALL vxRemoveNode ( vx_node node)

Removes a Node from its parent Graph and releases it.

Parameters
[in,out]nodeThe pointer to the node to remove and release [R00779].
Postcondition
After returning from this function the reference is zeroed [R00780].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00781].
VX_ERROR_INVALID_REFERENCEnode is not a valid vx_node reference.

◆ vxSetNodeTarget()

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) [R00790].

Parameters
[in]nodeThe reference to the vx_node object [R00791].
[in]target_enumThe target enum to be set to the vx_node object [R00792]. Use a The Target Enumeration Constants. value.
[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 [R00793].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNode target set; any other value indicates failure [R00794].
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.

◆ vxReplicateNode()

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 [R00795]. 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 [R00796]. An application request for removal of first_node from the graph will result in removal of all replicas [R00797]. Any change of parameter or attribute of first_node will be propagated to the replicas [R00798]. vxVerifyGraph shall enforce consistency of parameters and attributes in the replicas [R00799].

Parameters
[in]graphThe reference to the graph [R00800].
[in]first_nodeThe reference to the node in the graph that will be replicated [R00801].
[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 [R00802]. Should be vx_true_e for all output and bidirectional parameters [R00803].
[in]number_of_parametersnumber of elements in the replicate array
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00804].
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.