Defines the Context Object Interface.
The OpenVX context is the object domain for all OpenVX objects. All data objects live in the context as well as all framework objects. The OpenVX context keeps reference counts on all objects and must do garbage collection during its deconstruction to free lost references. While multiple clients may connect to the OpenVX context, all data are private in that the references referring to data objects are given only to the creating party.
|
#define | VX_MAX_IMPLEMENTATION_NAME (64) |
| Defines the length of the implementation name string, including the trailing zero [R01651].
|
|
|
typedef struct _vx_context * | vx_context |
| An opaque reference to the implementation context. More...
|
|
◆ vx_context
◆ vxCreateContext()
Creates a vx_context
.
This creates a top-level object context for OpenVX [R00444].
- Note
- This is required to do anything else.
- Returns
- The reference to the implementation context
vx_context
[R00445]. Any possible errors preventing a successful creation should be checked using vxGetStatus
[R00446].
- Postcondition
vxReleaseContext
◆ vxReleaseContext()
Releases the OpenVX object context.
All reference counted objects are garbage-collected by the return of this call. No calls are possible using the parameter context after the context has been released until a new reference from vxCreateContext
is returned [R00447]. All outstanding references to OpenVX objects from this context are invalid after this call.
- Parameters
-
[in] | context | The pointer to the reference to the context [R00448]. |
- Postcondition
- After returning from this function the reference is zeroed [R00449].
- Returns
- A
The vx_status Constants
value.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure [R00450]. |
VX_ERROR_INVALID_REFERENCE | context is not a valid vx_context reference. |
- Precondition
vxCreateContext
◆ vxGetContext()
Retrieves the context from any reference from within a context.
- Parameters
-
[in] | reference | The reference from which to extract the context [R00451]. |
- Returns
- The overall context that created the particular reference [R00452]. Any possible errors preventing a successful completion of this function should be checked using
vxGetStatus
[R00453].
◆ vxQueryContext()
Queries the context for some specific information.
- Parameters
-
[in] | context | The reference to the context [R00454]. |
[in] | attribute | The attribute to query. Use a Context Attribute Constants [R00455]. |
[out] | ptr | The location at which to store the resulting value [R00456]. |
[in] | size | The size in bytes of the container to which ptr points [R00457]. |
- Returns
- A
The vx_status Constants
value.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure [R00458]. |
VX_ERROR_INVALID_REFERENCE | context is not a valid vx_context reference. |
VX_ERROR_INVALID_PARAMETERS | If any of the other parameters are incorrect. |
VX_ERROR_NOT_SUPPORTED | If the attribute is not supported on this implementation. |
◆ vxSetContextAttribute()
Sets an attribute on the context.
- Parameters
-
[in] | context | The handle to the overall context [R00459]. |
[in] | attribute | The attribute to set from Context Attribute Constants [R00460]. |
[in] | ptr | The pointer to the data to which to set the attribute [R00461]. |
[in] | size | The size in bytes of the data to which ptr points [R00462]. |
- Returns
- A
The vx_status Constants
value.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure [R00463]. |
VX_ERROR_INVALID_REFERENCE | context is not a valid vx_context reference. |
VX_ERROR_INVALID_PARAMETERS | If any of the other parameters are incorrect. |
VX_ERROR_NOT_SUPPORTED | If the attribute is not settable. |