The OpenVX Specification  r31169
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Object: Parameter

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_ATTRIBUTE_INDEX = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_PARAMETER << 8)) + 0x0,
  VX_PARAMETER_ATTRIBUTE_DIRECTION = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_PARAMETER << 8)) + 0x1,
  VX_PARAMETER_ATTRIBUTE_TYPE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_PARAMETER << 8)) + 0x2,
  VX_PARAMETER_ATTRIBUTE_STATE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_PARAMETER << 8)) + 0x3,
  VX_PARAMETER_ATTRIBUTE_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 param, 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 181 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 558 of file vx_types.h.

The parameter attributes list.

Enumerator
VX_PARAMETER_ATTRIBUTE_INDEX 

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

VX_PARAMETER_ATTRIBUTE_DIRECTION 

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

VX_PARAMETER_ATTRIBUTE_TYPE 

Queries a parameter for its type, vx_type_e is returned. 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_ATTRIBUTE_STATE 

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

VX_PARAMETER_ATTRIBUTE_REF 

Use to extract the reference contained in the parameter. Use a vx_reference parameter.

Definition at line 784 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 1090 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.
Return values
0Either the kernel or index is invalid.
*The parameter reference.
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
vx_parameter
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.
VX_ERROR_INVALID_REFERENCEIf param is not a vx_parameter.
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 reference to the parameter.
Returns
A vx_status_e enumeration.
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.
Returns
A vx_status_e enumeration.
See also
vxGetParameterByIndex
vx_status VX_API_CALL vxQueryParameter ( vx_parameter  param,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

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

Parameters
[in]paramThe 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.