The OpenVX Specification  r28647
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Object: Distribution

Detailed Description

Defines the Distribution Object Interface.

Typedefs

typedef struct _vx_distribution * vx_distribution
 The Distribution object. This has a user-defined number of bins over a user-defined range (within a uint32_t range).
 

Enumerations

enum  vx_distribution_attribute_e {
  VX_DISTRIBUTION_ATTRIBUTE_DIMENSIONS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_DISTRIBUTION << 8)) + 0x0,
  VX_DISTRIBUTION_ATTRIBUTE_OFFSET = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_DISTRIBUTION << 8)) + 0x1,
  VX_DISTRIBUTION_ATTRIBUTE_RANGE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_DISTRIBUTION << 8)) + 0x2,
  VX_DISTRIBUTION_ATTRIBUTE_BINS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_DISTRIBUTION << 8)) + 0x3,
  VX_DISTRIBUTION_ATTRIBUTE_WINDOW = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_DISTRIBUTION << 8)) + 0x4,
  VX_DISTRIBUTION_ATTRIBUTE_SIZE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_DISTRIBUTION << 8)) + 0x5
}
 The distribution attribute list. More...
 

Functions

vx_status vxAccessDistribution (vx_distribution distribution, void **ptr, vx_enum usage)
 Gets direct access to a Distribution in memory. More...
 
vx_status vxCommitDistribution (vx_distribution distribution, void *ptr)
 Sets the Distribution back to the memory. The memory must be a vx_uint32 array of a value at least as big as the value returned via VX_DISTRIBUTION_ATTRIBUTE_RANGE. More...
 
vx_distribution vxCreateDistribution (vx_context context, vx_size numBins, vx_size offset, vx_size range)
 Creates a reference to a 1D Distribution with a start offset, valid range, and number of equally weighted bins. More...
 
vx_status vxQueryDistribution (vx_distribution distribution, vx_enum attribute, void *ptr, vx_size size)
 Queries a Distribution object. More...
 
vx_status vxReleaseDistribution (vx_distribution *distribution)
 Releases a reference to a distribution object. The object may not be garbage collected until its total reference count is zero. More...
 

Enumeration Type Documentation

The distribution attribute list.

Enumerator
VX_DISTRIBUTION_ATTRIBUTE_DIMENSIONS 

Indicates the number of dimensions in the distribution. Use a vx_size parameter.

VX_DISTRIBUTION_ATTRIBUTE_OFFSET 

Indicates the start of the values to use (inclusive). Use a vx_size parameter.

VX_DISTRIBUTION_ATTRIBUTE_RANGE 

Indicates end value to use as the range (exclusive). Use a vx_size parameter.

VX_DISTRIBUTION_ATTRIBUTE_BINS 

Indicates the number of bins. Use a vx_size parameter.

VX_DISTRIBUTION_ATTRIBUTE_WINDOW 

Indicates the range of a bin. Use a vx_uint32 parameter.

VX_DISTRIBUTION_ATTRIBUTE_SIZE 

Indicates the total size of the distribution in bytes. Use a vx_size parameter.

Definition at line 820 of file vx_types.h.

Function Documentation

vx_distribution vxCreateDistribution ( vx_context  context,
vx_size  numBins,
vx_size  offset,
vx_size  range 
)

Creates a reference to a 1D Distribution with a start offset, valid range, and number of equally weighted bins.

Parameters
[in]contextThe reference to the overall context.
[in]numBinsThe number of bins in the distribution.
[in]offsetThe offset into the range value.
[in]rangeThe total range of the values.
Returns
vx_distribution
vx_status vxReleaseDistribution ( vx_distribution distribution)

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

Parameters
[in]distributionThe reference to the distribution 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 graph is not a vx_graph.
vx_status vxQueryDistribution ( vx_distribution  distribution,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Queries a Distribution object.

Parameters
[in]distributionThe reference to the distribution to query.
[in]attributeThe attribute to query. Use a vx_distribution_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.
vx_status vxAccessDistribution ( vx_distribution  distribution,
void **  ptr,
vx_enum  usage 
)

Gets direct access to a Distribution in memory.

Parameters
[in]distributionThe reference to the distribution to access.
[out]ptrThe address of the location to store the pointer to the Distribution memory.
  • If (*ptr) is not NULL, the Distribution will be copied to that address.
  • If (*ptr) is NULL, the pointer will be allocated, mapped, or use internal memory.
In any case, vxCommitDistribution must be called with (*ptr).
[in]usageThe vx_accessor_e value to describe the access of the object.
Returns
A vx_status_e enumeration.
Postcondition
vxCommitDistribution
vx_status vxCommitDistribution ( vx_distribution  distribution,
void *  ptr 
)

Sets the Distribution back to the memory. The memory must be a vx_uint32 array of a value at least as big as the value returned via VX_DISTRIBUTION_ATTRIBUTE_RANGE.

Parameters
[in]distributionThe Distribution to modify.
[in]ptrThe pointer returned from (or not modified by) vxAccessDistribution.
Returns
A vx_status_e enumeration.
Precondition
vxAccessDistribution.