The OpenVX Specification
dba1aa3
|
Defines the Reference Object interface.
All objects in OpenVX are derived (in the object-oriented sense) from vx_reference
. All objects shall be able to be cast back to this type safely.
Macros | |
#define | VX_MAX_REFERENCE_NAME (64) |
Defines the length of the reference name string, including the trailing zero. More... | |
Typedefs | |
typedef struct _vx_reference * | vx_reference |
A generic opaque reference to any object within OpenVX. More... | |
Enumerations | |
enum | vx_reference_attribute_e { VX_REFERENCE_COUNT = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_REFERENCE << 8)) + 0x0, VX_REFERENCE_TYPE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_REFERENCE << 8)) + 0x1, VX_REFERENCE_NAME = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_REFERENCE << 8)) + 0x2 } |
The reference attributes list. More... | |
Functions | |
vx_status VX_API_CALL | vxQueryReference (vx_reference ref, vx_enum attribute, void *ptr, vx_size size) |
Queries any reference type for some basic information like count or type. More... | |
vx_status VX_API_CALL | vxReleaseReference (vx_reference *ref_ptr) |
Releases a reference. The reference may potentially refer to multiple OpenVX objects of different types. This function can be used instead of calling a specific release function for each individual object type (e.g. vxRelease<object>). The object will not be destroyed until its total reference count is zero. More... | |
vx_status VX_API_CALL | vxRetainReference (vx_reference ref) |
Increments the reference counter of an object This function is used to express the fact that the OpenVX object is referenced multiple times by an application. Each time this function is called for an object, the application will need to release the object one additional time before it can be destructed. More... | |
vx_status VX_API_CALL | vxSetReferenceName (vx_reference ref, const vx_char *name) |
Name a referenceThis function is used to associate a name to a referenced object. This name can be used by the OpenVX implementation in log messages and any other reporting mechanisms. More... | |
#define VX_MAX_REFERENCE_NAME (64) |
Defines the length of the reference name string, including the trailing zero.
typedef struct _vx_reference* vx_reference |
A generic opaque reference to any object within OpenVX.
A user of OpenVX should not assume that this can be cast directly to anything; however, any object in OpenVX can be cast back to this for the purposes of querying attributes of the object or for passing the object as a parameter to functions that take a vx_reference
type. If the API does not take that specific type but may take others, an error may be returned from the API.
Definition at line 142 of file vx_types.h.
The reference attributes list.
Enumerator | |
---|---|
VX_REFERENCE_COUNT |
Returns the reference count of the object. Read-only. Use a |
VX_REFERENCE_TYPE |
Returns the |
VX_REFERENCE_NAME |
Used to query the reference for its name. Read-write. Use a * |
Definition at line 785 of file vx_types.h.
vx_status VX_API_CALL vxQueryReference | ( | vx_reference | ref, |
vx_enum | attribute, | ||
void * | ptr, | ||
vx_size | size | ||
) |
Queries any reference type for some basic information like count or type.
[in] | ref | The reference to query. |
[in] | attribute | The value for which to query. Use vx_reference_attribute_e . |
[out] | ptr | The location at which to store the resulting value. |
[in] | size | The size in bytes of the container to which ptr points. |
vx_status_e
enumeration. VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | ref is not a valid vx_reference reference. |
vx_status VX_API_CALL vxReleaseReference | ( | vx_reference * | ref_ptr | ) |
Releases a reference. The reference may potentially refer to multiple OpenVX objects of different types. This function can be used instead of calling a specific release function for each individual object type (e.g. vxRelease<object>). The object will not be destroyed until its total reference count is zero.
[in] | ref_ptr | The pointer to the reference of the object to release. |
vx_status_e
enumeration. VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | ref_ptr is not a valid vx_reference reference. |
vx_status VX_API_CALL vxRetainReference | ( | vx_reference | ref | ) |
Increments the reference counter of an object This function is used to express the fact that the OpenVX object is referenced multiple times by an application. Each time this function is called for an object, the application will need to release the object one additional time before it can be destructed.
[in] | ref | The reference to retain. |
vx_status_e
enumeration. VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | ref is not a valid vx_reference reference. |
vx_status VX_API_CALL vxSetReferenceName | ( | vx_reference | ref, |
const vx_char * | name | ||
) |
Name a referenceThis function is used to associate a name to a referenced object. This name can be used by the OpenVX implementation in log messages and any other reporting mechanisms.
The OpenVX implementation will not check if the name is unique in the reference scope (context or graph). Several references can then have the same name.
[in] | ref | The reference to the object to be named. |
[in] | name | Pointer to the '\0' terminated string that identifies the referenced object. The string is copied by the function so that it stays the property of the caller. NULL means that the reference is not named. The length of the string shall be lower than VX_MAX_REFERENCE_NAME bytes. |
vx_status_e
enumeration. VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | ref is not a valid vx_reference reference. |