The OpenVX Specification  2b213f9
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_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 1027 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] context The reference to the overall context. [in] columns The 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] rows The 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_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] conv The 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_SUCCESS No errors. VX_ERROR_INVALID_REFERENCE If conv is not a vx_convolution.
 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] conv The convolution matrix object to set. [in] attribute The attribute to query. Use a vx_convolution_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.
Returns
A vx_status_e enumeration.
 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] conv The coordinates object to set. [in] attribute The attribute to modify. Use a vx_convolution_attribute_e enumeration. [in] ptr The pointer to the value to which to set the attribute. [in] size The size in bytes of the data pointed to by ptr.
Returns
A vx_status_e enumeration.
 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] conv The reference to the convolution 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 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] usage This 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_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 convolution reference is not actually a convolution reference. VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.