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

Detailed Description

Defines the Threshold Object Interface.

Typedefs

typedef struct _vx_threshold * vx_threshold
 The Threshold Object. A thresholding object contains the types and limit values of the thresholding required.
 

Enumerations

enum  vx_threshold_attribute_e {
  VX_THRESHOLD_ATTRIBUTE_TYPE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_THRESHOLD << 8)) + 0x0,
  VX_THRESHOLD_ATTRIBUTE_THRESHOLD_VALUE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_THRESHOLD << 8)) + 0x1,
  VX_THRESHOLD_ATTRIBUTE_THRESHOLD_LOWER = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_THRESHOLD << 8)) + 0x2,
  VX_THRESHOLD_ATTRIBUTE_THRESHOLD_UPPER = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_THRESHOLD << 8)) + 0x3,
  VX_THRESHOLD_ATTRIBUTE_TRUE_VALUE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_THRESHOLD << 8)) + 0x4,
  VX_THRESHOLD_ATTRIBUTE_FALSE_VALUE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_THRESHOLD << 8)) + 0x5,
  VX_THRESHOLD_ATTRIBUTE_DATA_TYPE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_THRESHOLD << 8)) + 0x6
}
 The threshold attributes. More...
 
enum  vx_threshold_type_e {
  VX_THRESHOLD_TYPE_BINARY = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_THRESHOLD_TYPE << 12)) + 0x0,
  VX_THRESHOLD_TYPE_RANGE = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_THRESHOLD_TYPE << 12)) + 0x1
}
 The Threshold types. More...
 

Functions

vx_threshold VX_API_CALL vxCreateThreshold (vx_context c, vx_enum thresh_type, vx_enum data_type)
 Creates a reference to a threshold object of a given type. More...
 
vx_status VX_API_CALL vxQueryThreshold (vx_threshold thresh, vx_enum attribute, void *ptr, vx_size size)
 Queries an attribute on the threshold object. More...
 
vx_status VX_API_CALL vxReleaseThreshold (vx_threshold *thresh)
 Releases a reference to a threshold object. The object may not be garbage collected until its total reference count is zero. More...
 
vx_status VX_API_CALL vxSetThresholdAttribute (vx_threshold thresh, vx_enum attribute, const void *ptr, vx_size size)
 Sets attributes on the threshold object. More...
 

Enumeration Type Documentation

The Threshold types.

Enumerator
VX_THRESHOLD_TYPE_BINARY 

A threshold with only 1 value.

VX_THRESHOLD_TYPE_RANGE 

A threshold with 2 values (upper/lower). Use with Canny Edge Detection.

Definition at line 872 of file vx_types.h.

The threshold attributes.

Enumerator
VX_THRESHOLD_ATTRIBUTE_TYPE 

The value type of the threshold. Use a vx_enum parameter. Will contain a vx_threshold_type_e.

VX_THRESHOLD_ATTRIBUTE_THRESHOLD_VALUE 

The value of the single threshold. Use a vx_int32 parameter.

VX_THRESHOLD_ATTRIBUTE_THRESHOLD_LOWER 

The value of the lower threshold. Use a vx_int32 parameter.

VX_THRESHOLD_ATTRIBUTE_THRESHOLD_UPPER 

The value of the higher threshold. Use a vx_int32 parameter.

VX_THRESHOLD_ATTRIBUTE_TRUE_VALUE 

The value of the TRUE threshold. Use a vx_int32 parameter.

VX_THRESHOLD_ATTRIBUTE_FALSE_VALUE 

The value of the FALSE threshold. Use a vx_int32 parameter.

VX_THRESHOLD_ATTRIBUTE_DATA_TYPE 

The data type of the threshold's value. Use a vx_enum parameter. Will contain a vx_type_e.

Definition at line 882 of file vx_types.h.

Function Documentation

vx_threshold VX_API_CALL vxCreateThreshold ( vx_context  c,
vx_enum  thresh_type,
vx_enum  data_type 
)

Creates a reference to a threshold object of a given type.

Parameters
[in]cThe reference to the overall context.
[in]thresh_typeThe type of threshold to create.
[in]data_typeThe data type of the threshold's value(s).
Note
For OpenVX 1.0, data_type can only be VX_TYPE_UINT8.
Returns
An threshold reference vx_threshold. Any possible errors preventing a successful creation should be checked using vxGetStatus.
vx_status VX_API_CALL vxReleaseThreshold ( vx_threshold thresh)

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

Parameters
[in]threshThe pointer to the threshold 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 thresh is not a vx_threshold.
vx_status VX_API_CALL vxSetThresholdAttribute ( vx_threshold  thresh,
vx_enum  attribute,
const void *  ptr,
vx_size  size 
)

Sets attributes on the threshold object.

Parameters
[in]threshThe threshold object to set.
[in]attributeThe attribute to modify. Use a vx_threshold_attribute_e enumeration.
[in]ptrThe pointer to the value to which to set the attribute.
[in]sizeThe size of the data pointed to by ptr.
Returns
A vx_status_e enumeration.
vx_status VX_API_CALL vxQueryThreshold ( vx_threshold  thresh,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Queries an attribute on the threshold object.

Parameters
[in]threshThe threshold object to set.
[in]attributeThe attribute to query. Use a vx_threshold_attribute_e enumeration.
[out]ptrThe location at which to store the resulting value.
[in]sizeThe size of the container to which ptr points.
Returns
A vx_status_e enumeration.