The OpenVX Specification  dba1aa3

Detailed Description

Defines the Parameter Object interface.

An abstract input, output, or bidirectional data object passed to a computer vision function. This object contains the signature of that parameter's usage from the kernel description. This information includes:

Typedefs

typedef struct _vx_parameter * vx_parameter
 An opaque reference to a single parameter. More...
 

Enumerations

enum  vx_direction_e {
  VX_INPUT = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_DIRECTION << 12)) + 0x0,
  VX_OUTPUT = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_DIRECTION << 12)) + 0x1,
  VX_BIDIRECTIONAL = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_DIRECTION << 12)) + 0x2
}
 An indication of how a kernel will treat the given parameter. More...
 
enum  vx_parameter_attribute_e {
  VX_PARAMETER_INDEX = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_PARAMETER << 8)) + 0x0,
  VX_PARAMETER_DIRECTION = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_PARAMETER << 8)) + 0x1,
  VX_PARAMETER_TYPE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_PARAMETER << 8)) + 0x2,
  VX_PARAMETER_STATE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_PARAMETER << 8)) + 0x3,
  VX_PARAMETER_REF = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_PARAMETER << 8)) + 0x4
}
 The parameter attributes list. More...
 
enum  vx_parameter_state_e {
  VX_PARAMETER_STATE_REQUIRED = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_PARAMETER_STATE << 12)) + 0x0,
  VX_PARAMETER_STATE_OPTIONAL = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_PARAMETER_STATE << 12)) + 0x1
}
 The parameter state type. More...
 

Functions

vx_parameter VX_API_CALL vxGetKernelParameterByIndex (vx_kernel kernel, vx_uint32 index)
 Retrieves a vx_parameter from a vx_kernel. More...
 
vx_parameter VX_API_CALL vxGetParameterByIndex (vx_node node, vx_uint32 index)
 Retrieves a vx_parameter from a vx_node. More...
 
vx_status VX_API_CALL vxQueryParameter (vx_parameter parameter, vx_enum attribute, void *ptr, vx_size size)
 Allows the client to query a parameter to determine its meta-information. More...
 
vx_status VX_API_CALL vxReleaseParameter (vx_parameter *param)
 Releases a reference to a parameter object. The object may not be garbage collected until its total reference count is zero. More...
 
vx_status VX_API_CALL vxSetParameterByIndex (vx_node node, vx_uint32 index, vx_reference value)
 Sets the specified parameter data for a kernel on the node. More...
 
vx_status VX_API_CALL vxSetParameterByReference (vx_parameter parameter, vx_reference value)
 Associates a parameter reference and a data reference with a kernel on a node. More...
 

Typedef Documentation

typedef struct _vx_parameter* vx_parameter

An opaque reference to a single parameter.

See also
vxGetParameterByIndex

Definition at line 194 of file vx_types.h.

Enumeration Type Documentation

An indication of how a kernel will treat the given parameter.

Enumerator
VX_INPUT 

The parameter is an input only.

VX_OUTPUT 

The parameter is an output only.

VX_BIDIRECTIONAL 

The parameter is both an input and output.

Definition at line 611 of file vx_types.h.

The parameter attributes list.

Enumerator
VX_PARAMETER_INDEX 

Queries a parameter for its index value on the kernel with which it is associated. Read-only. Use a vx_uint32 parameter.

VX_PARAMETER_DIRECTION 

Queries a parameter for its direction value on the kernel with which it is associated. Read-only. Use a vx_enum parameter.

VX_PARAMETER_TYPE 

Queries a parameter for its type, vx_type_e is returned. Read-only. The size of the parameter is implied for plain data objects. For opaque data objects like images and arrays a query to their attributes has to be called to determine the size.

VX_PARAMETER_STATE 

Queries a parameter for its state. A value in vx_parameter_state_e is returned. Read-only. Use a vx_enum parameter.

VX_PARAMETER_REF 

Use to extract the reference contained in the parameter. Read-only. Use a vx_reference parameter.

Definition at line 930 of file vx_types.h.

The parameter state type.

Enumerator
VX_PARAMETER_STATE_REQUIRED 

Default. The parameter must be supplied. If not set, during Verify, an error is returned.

VX_PARAMETER_STATE_OPTIONAL 

The parameter may be unspecified. The kernel takes care not to deference optional parameters until it is certain they are valid.

Definition at line 1322 of file vx_types.h.

Function Documentation

vx_parameter VX_API_CALL vxGetKernelParameterByIndex ( vx_kernel  kernel,
vx_uint32  index 
)

Retrieves a vx_parameter from a vx_kernel.

Parameters
[in]kernelThe reference to the kernel.
[in]indexThe index of the parameter.
Returns
A vx_parameter reference. Any possible errors preventing a successful completion of the function should be checked using vxGetStatus.
vx_parameter VX_API_CALL vxGetParameterByIndex ( vx_node  node,
vx_uint32  index 
)

Retrieves a vx_parameter from a vx_node.

Parameters
[in]nodeThe node from which to extract the parameter.
[in]indexThe index of the parameter to which to get a reference.
Returns
A parameter reference vx_parameter. Any possible errors preventing a successful completion of the function should be checked using vxGetStatus.
vx_status VX_API_CALL vxReleaseParameter ( vx_parameter param)

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

Parameters
[in]paramThe pointer to the parameter 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_REFERENCEparam is not a valid vx_parameter reference.
vx_status VX_API_CALL vxSetParameterByIndex ( vx_node  node,
vx_uint32  index,
vx_reference  value 
)

Sets the specified parameter data for a kernel on the node.

Parameters
[in]nodeThe node that contains the kernel.
[in]indexThe index of the parameter desired.
[in]valueThe desired value of the parameter.
Note
A user may not provide a NULL value for a mandatory parameter of this API.
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, or value is not a valid vx_reference reference.
See also
vxSetParameterByReference
vx_status VX_API_CALL vxSetParameterByReference ( vx_parameter  parameter,
vx_reference  value 
)

Associates a parameter reference and a data reference with a kernel on a node.

Parameters
[in]parameterThe reference to the kernel parameter.
[in]valueThe value to associate with the kernel parameter.
Note
A user may not provide a NULL value for a mandatory parameter of this API.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEparameter is not a valid vx_parameter reference, or value is not a valid vx_reference reference..
See also
vxGetParameterByIndex
vx_status VX_API_CALL vxQueryParameter ( vx_parameter  parameter,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Allows the client to query a parameter to determine its meta-information.

Parameters
[in]parameterThe reference to the parameter.
[in]attributeThe attribute to query. Use a vx_parameter_attribute_e.
[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_REFERENCEparameter is not a valid vx_parameter reference.