The OpenVX Specification  a73e458
Object: Convolution

Detailed Description

Defines the Image Convolution Object interface.

Modules

 The convolution attributes.
 The convolution attributes.
 

Typedefs

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

Functions

vx_status VX_API_CALL vxCopyConvolutionCoefficients (vx_convolution conv, void *user_ptr, vx_enum usage, vx_enum user_mem_type)
 Copy coefficients from/into a convolution object [R01114]. More...
 
vx_convolution VX_API_CALL vxCreateConvolution (vx_context context, vx_size columns, vx_size rows)
 Creates a reference to a convolution matrix object [R01090]. 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 [R01102]. More...
 
vx_status VX_API_CALL vxReleaseConvolution (vx_convolution *conv)
 Releases the reference to a convolution matrix [R01098]. 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 [R01108]. More...
 

Function Documentation

◆ vxCreateConvolution()

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

Creates a reference to a convolution matrix object [R01090].

Parameters
[in]contextThe reference to the overall context [R01091].
[in]columnsThe columns dimension of the convolution [R01092]. Must be odd and greater than or equal to 3 and less than the value returned from VX_CONTEXT_CONVOLUTION_MAX_DIMENSION [R01093].
[in]rowsThe rows dimension of the convolution [R01094]. Must be odd and greater than or equal to 3 and less than the value returned from VX_CONTEXT_CONVOLUTION_MAX_DIMENSION [R01095].
Returns
A convolution reference vx_convolution [R01096]. Any possible errors preventing a successful creation should be checked using vxGetStatus [R01097].

◆ vxReleaseConvolution()

vx_status VX_API_CALL vxReleaseConvolution ( vx_convolution conv)

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

Parameters
[in]convThe pointer to the convolution matrix to release [R01099].
Postcondition
After returning from this function the reference is zeroed [R01100].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R01101].
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.

◆ vxQueryConvolution()

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 [R01102].

Parameters
[in]convThe convolution matrix object to set [R01103].
[in]attributeThe attribute to query. Use a The convolution attributes. value [R01104].
[out]ptrThe location at which to store the resulting value [R01105].
[in]sizeThe size in bytes of the container to which ptr points [R01106].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R01107].
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.

◆ vxSetConvolutionAttribute()

vx_status VX_API_CALL vxSetConvolutionAttribute ( vx_convolution  conv,
vx_enum  attribute,
const void *  ptr,
vx_size  size 
)

Sets attributes on the convolution object [R01108].

Parameters
[in]convThe coordinates object to set [R01109].
[in]attributeThe attribute to modify. Use a The convolution attributes. value [R01110].
[in]ptrThe pointer to the value to which to set the attribute [R01111].
[in]sizeThe size in bytes of the data pointed to by ptr [R01112].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R01113].
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.

◆ vxCopyConvolutionCoefficients()

vx_status VX_API_CALL vxCopyConvolutionCoefficients ( vx_convolution  conv,
void *  user_ptr,
vx_enum  usage,
vx_enum  user_mem_type 
)

Copy coefficients from/into a convolution object [R01114].

Parameters
[in]convThe reference to the convolution object that is the source or the destination of the copy [R01115].
[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 [R01116]. 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 [R01117]. The accessible memory must be large enough to contain this 2D array: accessible memory in bytes >= sizeof(data_element) * rows * columns [R01118].
[in]usageThis declares the effect of the copy with regard to the convolution object. Only VX_READ_ONLY and VX_WRITE_ONLY are supported [R01119]:
  • 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 Memory import type constants. value that specifies the memory type of the memory referenced by the user_addr [R01120].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R01121].
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.