Defines the Scalar Object interface.
The scalar attributes list.
Enumerator |
---|
VX_SCALAR_TYPE |
Queries the type of atomic that is contained in the scalar. Read-only. Use a vx_enum parameter.
|
Definition at line 937 of file vx_types.h.
Creates a reference to a scalar object. Also see Node Parameters.
- Parameters
-
[in] | context | The reference to the system context. |
[in] | data_type | The vx_type_e of the scalar. Must be greater than VX_TYPE_INVALID and less than VX_TYPE_SCALAR_MAX . |
[in] | ptr | The pointer to the initial value of the scalar. |
- Returns
- A scalar reference
vx_scalar
. Any possible errors preventing a successful creation should be checked using vxGetStatus
.
Releases a reference to a scalar object. The object may not be garbage collected until its total reference count is zero.
- Parameters
-
[in] | scalar | The pointer to the scalar to release. |
- Postcondition
- After returning from this function the reference is zeroed.
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | No errors. |
VX_ERROR_INVALID_REFERENCE | If scalar is not a vx_scalar . |
Queries attributes from a scalar.
- Parameters
-
[in] | scalar | The scalar object. |
[in] | attribute | The enumeration to query. Use a vx_scalar_attribute_e enumeration. |
[out] | ptr | The location at which to store the resulting value. |
[in] | size | The size of the container to which ptr points. |
- Returns
- A
vx_status_e
enumeration.
Allows the application to copy from/into a scalar object.
- Parameters
-
[in] | scalar | The reference to the scalar object that is the source or the destination of the copy. |
[in] | user_ptr | The address of the memory location where to store the requested data if the copy was requested in read mode, or from where to get the data to store into the scalar object if the copy was requested in write mode. In the user memory, the scalar is a variable of the type corresponding to VX_SCALAR_TYPE . The accessible memory must be large enough to contain this variable. |
[in] | usage | This declares the effect of the copy with regard to the scalar object using the vx_accessor_e enumeration. Only VX_READ_ONLY and VX_WRITE_ONLY are supported:
VX_READ_ONLY means that data are copied from the scalar object into the user memory.
VX_WRITE_ONLY means that data are copied into the scalar object from the user memory.
|
[in] | user_mem_type | A vx_memory_type_e enumeration that specifies the memory type of the memory referenced by the user_addr. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_ERROR_INVALID_REFERENCE | The scalar reference is not actually a scalar reference. |
VX_ERROR_INVALID_PARAMETERS | An other parameter is incorrect. |