The OpenVX Specification  r31169
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Object: Matrix

Detailed Description

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_ATTRIBUTE_TYPE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_MATRIX << 8)) + 0x0,
  VX_MATRIX_ATTRIBUTE_ROWS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_MATRIX << 8)) + 0x1,
  VX_MATRIX_ATTRIBUTE_COLUMNS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_MATRIX << 8)) + 0x2,
  VX_MATRIX_ATTRIBUTE_SIZE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_MATRIX << 8)) + 0x3
}
 The matrix attributes. More...
 

Functions

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_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 vxReadMatrix (vx_matrix mat, void *array)
 Gets the matrix data (copy). 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...
 
vx_status VX_API_CALL vxWriteMatrix (vx_matrix mat, const void *array)
 Sets the matrix data (copy) More...
 

Enumeration Type Documentation

The matrix attributes.

Enumerator
VX_MATRIX_ATTRIBUTE_TYPE 

The value type of the matrix. Use a vx_enum parameter.

VX_MATRIX_ATTRIBUTE_ROWS 

The M dimension of the matrix. Use a vx_size parameter.

VX_MATRIX_ATTRIBUTE_COLUMNS 

The N dimension of the matrix. Use a vx_size parameter.

VX_MATRIX_ATTRIBUTE_SIZE 

The total size of the matrix in bytes. Use a vx_size parameter.

Definition at line 902 of file vx_types.h.

Function Documentation

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.

Parameters
[in]cThe reference to the overall context.
[in]data_typeThe unit format of the matrix. VX_TYPE_INT32 or VX_TYPE_FLOAT32.
[in]columnsThe first dimensionality.
[in]rowsThe second dimensionality.
Returns
An matrix reference 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.

Parameters
[in]matThe matrix reference to release.
Postcondition
After returning from this function the reference is zeroed.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors.
VX_ERROR_INVALID_REFERENCEIf mat is not a vx_matrix.
vx_status VX_API_CALL vxQueryMatrix ( vx_matrix  mat,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Queries an attribute on the matrix object.

Parameters
[in]matThe matrix object to set.
[in]attributeThe attribute to query. Use a vx_matrix_attribute_e enumeration.
[out]ptrThe location at which to store the resulting value.
[in]sizeThe size in bytes of the container to which ptr points.
Returns
A vx_status_e enumeration.
vx_status VX_API_CALL vxReadMatrix ( vx_matrix  mat,
void *  array 
)

Gets the matrix data (copy).

Parameters
[in]matThe reference to the matrix.
[out]arrayThe array in which to place the matrix.
See also
vxQueryMatrix and VX_MATRIX_ATTRIBUTE_COLUMNS and VX_MATRIX_ATTRIBUTE_ROWS to get the needed number of elements of the array.
Returns
A vx_status_e enumeration.
vx_status VX_API_CALL vxWriteMatrix ( vx_matrix  mat,
const void *  array 
)

Sets the matrix data (copy)

Parameters
[in]matThe reference to the matrix.
[in]arrayThe array containing the matrix to be written.
See also
vxQueryMatrix and VX_MATRIX_ATTRIBUTE_COLUMNS and VX_MATRIX_ATTRIBUTE_ROWS to get the needed number of elements of the array.'
Returns
A vx_status_e enumeration.