The OpenVX Specification  dba1aa3
Object: ObjectArray

Detailed Description

An opaque array object that could be an array of any data-object (not data-type) of OpenVX except Delay and ObjectArray objects.

ObjectArray is a strongly-typed container of OpenVX data-objects. ObjectArray refers to the collection of similar data-objects as a single entity that can be created or assigned as inputs/outputs and as a single entity. In addition, a single object from the collection can be accessed individually by getting its reference. The single object remains as part of the ObjectArray through its entire life cycle.

Typedefs

typedef struct _vx_object_array * vx_object_array
 The ObjectArray Object. ObjectArray is a strongly-typed container of OpenVX data-objects.
 

Enumerations

enum  vx_object_array_attribute_e {
  VX_OBJECT_ARRAY_ITEMTYPE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_OBJECT_ARRAY << 8)) + 0x0,
  VX_OBJECT_ARRAY_NUMITEMS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_OBJECT_ARRAY << 8)) + 0x1
}
 The ObjectArray object attributes. More...
 

Functions

vx_object_array VX_API_CALL vxCreateObjectArray (vx_context context, vx_reference exemplar, vx_size count)
 Creates a reference to an ObjectArray of count objects. More...
 
vx_object_array VX_API_CALL vxCreateVirtualObjectArray (vx_graph graph, vx_reference exemplar, vx_size count)
 Creates an opaque reference to a virtual ObjectArray with no direct user access. More...
 
vx_reference VX_API_CALL vxGetObjectArrayItem (vx_object_array arr, vx_uint32 index)
 Retrieves the reference to the OpenVX Object in location index of the ObjectArray. More...
 
vx_status VX_API_CALL vxQueryObjectArray (vx_object_array arr, vx_enum attribute, void *ptr, vx_size size)
 Queries an atribute from the ObjectArray. More...
 
vx_status VX_API_CALL vxReleaseObjectArray (vx_object_array *arr)
 Releases a reference of an ObjectArray object. More...
 

Enumeration Type Documentation

The ObjectArray object attributes.

Enumerator
VX_OBJECT_ARRAY_ITEMTYPE 

The type of the ObjectArray items. Read-only. Use a vx_enum parameter.

VX_OBJECT_ARRAY_NUMITEMS 

The number of items in the ObjectArray. Read-only. Use a vx_size parameter.

Definition at line 1159 of file vx_types.h.

Function Documentation

vx_object_array VX_API_CALL vxCreateObjectArray ( vx_context  context,
vx_reference  exemplar,
vx_size  count 
)

Creates a reference to an ObjectArray of count objects.

It uses the metadata of the exemplar to determine the object attributes, ignoring the object data. It does not alter the exemplar or keep or release the reference to the exemplar. For the definition of supported attributes see vxSetMetaFormatAttribute. In case the exemplar is a virtual object it must be of immutable metadata, thus it is not allowed to be dimensionless or formatless.

Parameters
[in]contextThe reference to the overall Context.
[in]exemplarThe exemplar object that defines the metadata of the created objects in the ObjectArray.
[in]countNumber of Objects to create in the ObjectArray. This value must be greater than zero.
Returns
An ObjectArray reference vx_object_array. Any possible errors preventing a successful creation should be checked using vxGetStatus. Data objects are not initialized by this function.
vx_object_array VX_API_CALL vxCreateVirtualObjectArray ( vx_graph  graph,
vx_reference  exemplar,
vx_size  count 
)

Creates an opaque reference to a virtual ObjectArray with no direct user access.

This function creates an ObjectArray of count objects with similar behavior as vxCreateObjectArray. The only difference is that the objects that are created are virtual in the given graph.

Parameters
[in]graphReference to the graph where to create the virtual ObjectArray.
[in]exemplarThe exemplar object that defines the type of object in the ObjectArray. Only exemplar type of vx_image, vx_array and vx_pyramid are allowed.
[in]countNumber of Objects to create in the ObjectArray.
Returns
A ObjectArray reference vx_object_array. Any possible errors preventing a successful creation should be checked using vxGetStatus.
vx_reference VX_API_CALL vxGetObjectArrayItem ( vx_object_array  arr,
vx_uint32  index 
)

Retrieves the reference to the OpenVX Object in location index of the ObjectArray.

This is a vx_reference, which can be used elsewhere in OpenVX. A call to vxRelease<Object> or vxReleaseReference is necessary to release the Object for each call to this function.

Parameters
[in]arrThe ObjectArray.
[in]indexThe index of the object in the ObjectArray.
Returns
A reference to an OpenVX data object. Any possible errors preventing a successful completion of the function should be checked using vxGetStatus.
vx_status VX_API_CALL vxReleaseObjectArray ( vx_object_array arr)

Releases a reference of an ObjectArray object.

The object may not be garbage collected until its total reference and its contained objects count is zero. After returning from this function the reference is zeroed/cleared.

Parameters
[in]arrThe pointer to the ObjectArray to release.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEarr is not a valid vx_object_array reference.
vx_status VX_API_CALL vxQueryObjectArray ( vx_object_array  arr,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Queries an atribute from the ObjectArray.

Parameters
[in]arrThe reference to the ObjectArray.
[in]attributeThe attribute to query. Use a vx_object_array_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_REFERENCEarr is not a valid vx_object_array reference.
VX_ERROR_NOT_SUPPORTEDIf the attribute is not a value supported on this implementation.
VX_ERROR_INVALID_PARAMETERSIf any of the other parameters are incorrect.