glConvolutionParameteriEXT(GL_CONVOLUTION_2D_EXT,
GL_CONVOLUTION_BORDER_MODE_EXT,
GL_REDUCE_EXT /*nothing else supported at present */);
glConvolutionParameterfvEXT(GL_CONVOLUTION_2D_EXT,
GL_CONVOLUTION_FILTER_SCALE_EXT,filterscale);
glConvolutionParameterfvEXT(GL_CONVOLUTION_2D_EXT,
GL_CONVOLUTION_FILTER_BIAS_EXT, filterbias);
Use a 2D array for 2D convolution and a 1D array for 1D convolution. Separable 2D filters consist of two 1D images for the row and the column.
To specify a convolution kernel, call glConvolutionFilter2DEXT(), glConvolutionFilter1DEXT(), or glSeparableFilter2DEXT().
The following example defines a 7 x 7 convolution kernel that is in RGB format and is based on a 7 x 7 RGB pixel array previously defined as rgbBlurImage7x7:
glConvolutionFilter2DEXT(
GL_CONVOLUTION_2D_EXT, /*has to be this value*/
GL_RGB, /*filter kernel internal format*/
7, 7, /*width & height of image pixel array*/
GL_RGB, /*image internal format*/
GL_FLOAT, /*type of image pixel data*/
(const void*)rgbBlurImage7x7 /* image itself*/
)
For more information about the different parameters, see the reference page for the relevant function.
Convolution happens as the pixel operations are executed.