The OpenVX Specification
dba1aa3
|
Defines the Matrix Object Interface.
Typedefs | |
typedef struct _vx_matrix * | vx_matrix |
The Matrix Object. An MxN matrix of some unit type. | |
Enumerations | |
enum | vx_matrix_attribute_e { VX_MATRIX_TYPE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_MATRIX << 8)) + 0x0, VX_MATRIX_ROWS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_MATRIX << 8)) + 0x1, VX_MATRIX_COLUMNS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_MATRIX << 8)) + 0x2, VX_MATRIX_SIZE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_MATRIX << 8)) + 0x3, VX_MATRIX_ORIGIN = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_MATRIX << 8)) + 0x4, VX_MATRIX_PATTERN = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_MATRIX << 8)) + 0x5 } |
The matrix attributes. More... | |
Functions | |
vx_status VX_API_CALL | vxCopyMatrix (vx_matrix matrix, void *user_ptr, vx_enum usage, vx_enum user_mem_type) |
Allows the application to copy from/into a matrix object. More... | |
vx_matrix VX_API_CALL | vxCreateMatrix (vx_context c, vx_enum data_type, vx_size columns, vx_size rows) |
Creates a reference to a matrix object. More... | |
vx_matrix VX_API_CALL | vxCreateMatrixFromPattern (vx_context context, vx_enum pattern, vx_size columns, vx_size rows) |
Creates a reference to a matrix object from a boolean pattern. More... | |
vx_matrix VX_API_CALL | vxCreateMatrixFromPatternAndOrigin (vx_context context, vx_enum pattern, vx_size columns, vx_size rows, vx_size origin_col, vx_size origin_row) |
Creates a reference to a matrix object from a boolean pattern, with a user-specified origin. More... | |
vx_matrix VX_API_CALL | vxCreateVirtualMatrix (vx_graph graph, vx_enum data_type, vx_size columns, vx_size rows) |
Creates an opaque reference to a matrix object without direct user access. More... | |
vx_status VX_API_CALL | vxQueryMatrix (vx_matrix mat, vx_enum attribute, void *ptr, vx_size size) |
Queries an attribute on the matrix object. More... | |
vx_status VX_API_CALL | vxReleaseMatrix (vx_matrix *mat) |
Releases a reference to a matrix object. The object may not be garbage collected until its total reference count is zero. More... | |
The matrix attributes.
Enumerator | |
---|---|
VX_MATRIX_TYPE |
The value type of the matrix. Read-only. Use a |
VX_MATRIX_ROWS |
The M dimension of the matrix. Read-only. Use a |
VX_MATRIX_COLUMNS |
The N dimension of the matrix. Read-only. Use a |
VX_MATRIX_SIZE |
The total size of the matrix in bytes. Read-only. Use a |
VX_MATRIX_ORIGIN |
The origin of the matrix with a default value of [floor(VX_MATRIX_COLUMNS/2), floor(VX_MATRIX_ROWS/2)]. Read-only. Use a |
VX_MATRIX_PATTERN |
The pattern of the matrix. See |
Definition at line 1075 of file vx_types.h.
vx_matrix VX_API_CALL vxCreateMatrix | ( | vx_context | c, |
vx_enum | data_type, | ||
vx_size | columns, | ||
vx_size | rows | ||
) |
Creates a reference to a matrix object.
[in] | c | The reference to the overall context. |
[in] | data_type | The unit format of the matrix. VX_TYPE_UINT8 or VX_TYPE_INT32 or VX_TYPE_FLOAT32 . |
[in] | columns | The first dimensionality. |
[in] | rows | The second dimensionality. |
vx_matrix
. Any possible errors preventing a successful creation should be checked using vxGetStatus
. vx_matrix VX_API_CALL vxCreateVirtualMatrix | ( | vx_graph | graph, |
vx_enum | data_type, | ||
vx_size | columns, | ||
vx_size | rows | ||
) |
Creates an opaque reference to a matrix object without direct user access.
[in] | graph | The reference to the parent graph. |
[in] | data_type | The unit format of the matrix. VX_TYPE_UINT8 or VX_TYPE_INT32 or VX_TYPE_FLOAT32 . |
[in] | columns | The first dimensionality. |
[in] | rows | The second dimensionality. |
vxCreateMatrix
vx_matrix
. Any possible errors preventing a successful creation should be checked using vxGetStatus
. vx_status VX_API_CALL vxReleaseMatrix | ( | vx_matrix * | mat | ) |
Releases a reference to a matrix object. The object may not be garbage collected until its total reference count is zero.
[in] | mat | The matrix reference to release. |
vx_status_e
enumeration. VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | mat is not a valid vx_matrix reference. |
vx_status VX_API_CALL vxQueryMatrix | ( | vx_matrix | mat, |
vx_enum | attribute, | ||
void * | ptr, | ||
vx_size | size | ||
) |
Queries an attribute on the matrix object.
[in] | mat | The matrix object to set. |
[in] | attribute | The attribute to query. Use a vx_matrix_attribute_e enumeration. |
[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 | mat is not a valid vx_matrix reference. |
vx_status VX_API_CALL vxCopyMatrix | ( | vx_matrix | matrix, |
void * | user_ptr, | ||
vx_enum | usage, | ||
vx_enum | user_mem_type | ||
) |
Allows the application to copy from/into a matrix object.
[in] | matrix | The reference to the matrix 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 matrix object if the copy was requested in write mode. In the user memory, the matrix is structured as a row-major 2D array with elements of the type corresponding to VX_MATRIX_TYPE , with a number of rows corresponding to VX_MATRIX_ROWS and a number of columns corresponding to VX_MATRIX_COLUMNS . The accessible memory must be large enough to contain this 2D array: accessible memory in bytes >= sizeof(data_element) * rows * columns. |
[in] | usage | This declares the effect of the copy with regard to the matrix object using the vx_accessor_e enumeration. Only VX_READ_ONLY and VX_WRITE_ONLY are supported:
|
[in] | user_mem_type | A vx_memory_type_e enumeration that specifies the memory type of the memory referenced by the user_addr. |
vx_status_e
enumeration. VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | matrix is not a valid vx_matrix reference. |
VX_ERROR_INVALID_PARAMETERS | An other parameter is incorrect. |
vx_matrix VX_API_CALL vxCreateMatrixFromPattern | ( | vx_context | context, |
vx_enum | pattern, | ||
vx_size | columns, | ||
vx_size | rows | ||
) |
Creates a reference to a matrix object from a boolean pattern.
vxCreateMatrixFromPatternAndOrigin
for a description of the matrix patterns. [in] | context | The reference to the overall context. |
[in] | pattern | The pattern of the matrix. See VX_MATRIX_PATTERN . |
[in] | columns | The first dimensionality. |
[in] | rows | The second dimensionality. |
vx_matrix
of type VX_TYPE_UINT8
. Any possible errors preventing a successful creation should be checked using vxGetStatus
. vx_matrix VX_API_CALL vxCreateMatrixFromPatternAndOrigin | ( | vx_context | context, |
vx_enum | pattern, | ||
vx_size | columns, | ||
vx_size | rows, | ||
vx_size | origin_col, | ||
vx_size | origin_row | ||
) |
Creates a reference to a matrix object from a boolean pattern, with a user-specified origin.
The matrix created by this function is of type VX_TYPE_UINT8
, with the value 0 representing False, and the value 255 representing True. It supports the patterns as described below:
A matrix created from pattern is read-only. The behavior when attempting to modify such a matrix is undefined.
[in] | context | The reference to the overall context. |
[in] | pattern | The pattern of the matrix. See VX_MATRIX_PATTERN . |
[in] | columns | The first dimensionality. |
[in] | rows | The second dimensionality. |
[in] | origin_col | The origin (first dimensionality). |
[in] | origin_row | The origin (second dimensionality). |
vx_matrix
of type VX_TYPE_UINT8
. Any possible errors preventing a successful creation should be checked using vxGetStatus
.