The OpenVX Specification  r31169
 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 VX_API_CALL vxAccessDistribution (vx_distribution distribution, void **ptr, vx_enum usage)
 Grants access to a distribution object and increments the object reference count in case of success. More...
 
vx_status VX_API_CALL vxCommitDistribution (vx_distribution distribution, const void *ptr)
 Commits the distribution objec> and decrements the object reference count in case of success. The memory must be a vx_uint32 array of a value at least as big as the value returned via VX_DISTRIBUTION_ATTRIBUTE_BINS. More...
 
vx_distribution VX_API_CALL vxCreateDistribution (vx_context context, vx_size numBins, vx_int32 offset, vx_uint32 range)
 Creates a reference to a 1D Distribution of a consecutive interval [offset, offset + range - 1] defined by a start offset and valid range, divided equally into numBins parts. More...
 
vx_status VX_API_CALL vxQueryDistribution (vx_distribution distribution, vx_enum attribute, void *ptr, vx_size size)
 Queries a Distribution object. More...
 
vx_status VX_API_CALL 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_int32 parameter.

VX_DISTRIBUTION_ATTRIBUTE_RANGE 

Indicates end value to use as the range. Use a vx_uint32 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 854 of file vx_types.h.

Function Documentation

vx_distribution VX_API_CALL vxCreateDistribution ( vx_context  context,
vx_size  numBins,
vx_int32  offset,
vx_uint32  range 
)

Creates a reference to a 1D Distribution of a consecutive interval [offset, offset + range - 1] defined by a start offset and valid range, divided equally into numBins parts.

Parameters
[in]contextThe reference to the overall context.
[in]numBinsThe number of bins in the distribution.
[in]offsetThe start offset into the range value that marks the begining of the 1D Distribution.
[in]rangeThe total number of the values.
Returns
A distribution reference vx_distribution. Any possible errors preventing a successful creation should be checked using vxGetStatus.
vx_status VX_API_CALL 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 distribution is not a vx_distribution.
vx_status VX_API_CALL 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 in bytes of the container to which ptr points.
Returns
A vx_status_e enumeration.
vx_status VX_API_CALL vxAccessDistribution ( vx_distribution  distribution,
void **  ptr,
vx_enum  usage 
)

Grants access to a distribution object and increments the object reference count in case of success.

Parameters
[in]distributionThe reference to the distribution to access.
[in,out]ptrThe user-supplied address to a pointer, via which the requested contents are returned.
  • If ptr is NULL, an error occurs.
  • If ptr is not NULL and (*ptr) is NULL, (*ptr) will be set to the address of a memory area managed by the OpenVX framework containing the requested data.
  • If both ptr and (*ptr) are not NULL, requested data will be copied to (*ptr) (optionally in case of write-only access).
[in]usageThe vx_accessor_e value to describe the access of the object.
Returns
A vx_status_e enumeration.
Postcondition
vxCommitDistribution
vx_status VX_API_CALL vxCommitDistribution ( vx_distribution  distribution,
const void *  ptr 
)

Commits the distribution objec> and decrements the object reference count in case of success. The memory must be a vx_uint32 array of a value at least as big as the value returned via VX_DISTRIBUTION_ATTRIBUTE_BINS.

Parameters
[in]distributionThe Distribution to modify.
[in]ptrThe pointer provided or returned by vxAccessDistribution. The ptr cannot be NULL.
Returns
A vx_status_e enumeration.
Precondition
vxAccessDistribution.