Defines the Scalar Object interface.
The scalar attributes list.
Enumerator |
---|
VX_SCALAR_ATTRIBUTE_TYPE |
Queries the type of atomic that is contained in the scalar. Use a vx_enum parameter.
|
Definition at line 786 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
vx_scalar
reference.
- Return values
-
0 | The scalar could not be created. |
* | The scalar was created. Check for further errors with 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 graph is not a vx_graph . |
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.
Gets the scalar value out of a reference.
- Note
- Use this in conjunction with Query APIs that return references which should be converted into values.
- Parameters
-
[in] | ref | The reference from which to get the scalar value. |
[out] | ptr | An appropriate typed pointer that points to a location to which to copy the scalar value. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_ERROR_INVALID_REFERENCE | If the ref is not a valid reference. |
VX_ERROR_INVALID_PARAMETERS | If ptr is NULL. |
VX_ERROR_INVALID_TYPE | If the type does not match the type in the reference or is a bad value. |
Sets the scalar value in a reference.
- Note
- Use this in conjunction with Parameter APIs that return references to parameters that need to be altered.
- Parameters
-
[in] | ref | The reference from which to get the scalar value. |
[in] | ptr | An appropriately typed pointer that points to a location to which to copy the scalar value. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_ERROR_INVALID_REFERENCE | If the ref is not a valid reference. |
VX_ERROR_INVALID_PARAMETERS | If ptr is NULL. |
VX_ERROR_INVALID_TYPE | If the type does not match the type in the reference or is a bad value. |