The OpenVX Specification  dba1aa3
Object: Convolution

Detailed Description

Defines the Image Convolution Object interface.

Typedefs

typedef struct _vx_convolution * vx_convolution
 The Convolution Object. A user-defined convolution kernel of MxM elements.
 

Enumerations

enum  vx_convolution_attribute_e {
  VX_CONVOLUTION_ROWS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_CONVOLUTION << 8)) + 0x0,
  VX_CONVOLUTION_COLUMNS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_CONVOLUTION << 8)) + 0x1,
  VX_CONVOLUTION_SCALE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_CONVOLUTION << 8)) + 0x2,
  VX_CONVOLUTION_SIZE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_CONVOLUTION << 8)) + 0x3
}
 The convolution attributes. More...
 

Functions

vx_status VX_API_CALL vxCopyConvolutionCoefficients (vx_convolution conv, void *user_ptr, vx_enum usage, vx_enum user_mem_type)
 Allows the application to copy coefficients from/into a convolution object. More...
 
vx_convolution VX_API_CALL vxCreateConvolution (vx_context context, vx_size columns, vx_size rows)
 Creates a reference to a convolution matrix object. More...
 
vx_convolution VX_API_CALL vxCreateVirtualConvolution (vx_graph graph, vx_size columns, vx_size rows)
 Creates an opaque reference to a convolution matrix object without direct user access. More...
 
vx_status VX_API_CALL vxQueryConvolution (vx_convolution conv, vx_enum attribute, void *ptr, vx_size size)
 Queries an attribute on the convolution matrix object. More...
 
vx_status VX_API_CALL vxReleaseConvolution (vx_convolution *conv)
 Releases the reference to a convolution matrix. The object may not be garbage collected until its total reference count is zero. More...
 
vx_status VX_API_CALL vxSetConvolutionAttribute (vx_convolution conv, vx_enum attribute, const void *ptr, vx_size size)
 Sets attributes on the convolution object. More...
 

Enumeration Type Documentation

The convolution attributes.

Enumerator
VX_CONVOLUTION_ROWS 

The number of rows of the convolution matrix. Read-only. Use a vx_size parameter.

VX_CONVOLUTION_COLUMNS 

The number of columns of the convolution matrix. Read-only. Use a vx_size parameter.

VX_CONVOLUTION_SCALE 

The scale of the convolution matrix. Read-write. Use a vx_uint32 parameter.

Note
For 1.0, only powers of 2 are supported up to 2^31.
VX_CONVOLUTION_SIZE 

The total size of the convolution matrix in bytes. Read-only. Use a vx_size parameter.

Definition at line 1097 of file vx_types.h.

Function Documentation

vx_convolution VX_API_CALL vxCreateConvolution ( vx_context  context,
vx_size  columns,
vx_size  rows 
)

Creates a reference to a convolution matrix object.

Parameters
[in]contextThe reference to the overall context.
[in]columnsThe columns dimension of the convolution. Must be odd and greater than or equal to 3 and less than the value returned from VX_CONTEXT_CONVOLUTION_MAX_DIMENSION.
[in]rowsThe rows dimension of the convolution. Must be odd and greater than or equal to 3 and less than the value returned from VX_CONTEXT_CONVOLUTION_MAX_DIMENSION.
Returns
A convolution reference vx_convolution. Any possible errors preventing a successful creation should be checked using vxGetStatus.
vx_convolution VX_API_CALL vxCreateVirtualConvolution ( vx_graph  graph,
vx_size  columns,
vx_size  rows 
)

Creates an opaque reference to a convolution matrix object without direct user access.

Parameters
[in]graphThe reference to the parent graph.
[in]columnsThe columns dimension of the convolution. Must be odd and greater than or equal to 3 and less than the value returned from VX_CONTEXT_CONVOLUTION_MAX_DIMENSION.
[in]rowsThe rows dimension of the convolution. Must be odd and greater than or equal to 3 and less than the value returned from VX_CONTEXT_CONVOLUTION_MAX_DIMENSION.
See also
vxCreateConvolution
Returns
A convolution reference vx_convolution. Any possible errors preventing a successful creation should be checked using vxGetStatus.
vx_status VX_API_CALL vxReleaseConvolution ( vx_convolution conv)

Releases the reference to a convolution matrix. The object may not be garbage collected until its total reference count is zero.

Parameters
[in]convThe pointer to the convolution matrix to release.
Postcondition
After returning from this function the reference is zeroed.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.
vx_status VX_API_CALL vxQueryConvolution ( vx_convolution  conv,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Queries an attribute on the convolution matrix object.

Parameters
[in]convThe convolution matrix object to set.
[in]attributeThe attribute to query. Use a vx_convolution_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.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.
vx_status VX_API_CALL vxSetConvolutionAttribute ( vx_convolution  conv,
vx_enum  attribute,
const void *  ptr,
vx_size  size 
)

Sets attributes on the convolution object.

Parameters
[in]convThe coordinates object to set.
[in]attributeThe attribute to modify. Use a vx_convolution_attribute_e enumeration.
[in]ptrThe pointer to the value to which to set the attribute.
[in]sizeThe size in bytes of the data pointed to by ptr.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.
vx_status VX_API_CALL vxCopyConvolutionCoefficients ( vx_convolution  conv,
void *  user_ptr,
vx_enum  usage,
vx_enum  user_mem_type 
)

Allows the application to copy coefficients from/into a convolution object.

Parameters
[in]convThe reference to the convolution object that is the source or the destination of the copy.
[in]user_ptrThe address of the memory location where to store the requested coefficient data if the copy was requested in read mode, or from where to get the coefficient data to store into the convolution object if the copy was requested in write mode. In the user memory, the convolution coefficient data is structured as a row-major 2D array with elements of the type corresponding to VX_TYPE_CONVOLUTION, with a number of rows corresponding to VX_CONVOLUTION_ROWS and a number of columns corresponding to VX_CONVOLUTION_COLUMNS. The accessible memory must be large enough to contain this 2D array: accessible memory in bytes >= sizeof(data_element) * rows * columns.
[in]usageThis declares the effect of the copy with regard to the convolution 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 convolution object into the user memory.
  • VX_WRITE_ONLY means that data are copied into the convolution object from the user memory.
[in]user_mem_typeA 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_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.