glConvolutionParameterEXT

NAME

glConvolutionParameterfEXT, glConvolutionParameteriEXT, glConvolutionParameterfvEXT, glConvolutionParameterivEXT - set convolution parameters

C SPECIFICATION

void glConvolutionParameterfEXT(GLenum target,
                                GLenum pname,
                                GLfloat params)
void glConvolutionParameteriEXT(GLenum target,
                                GLenum pname,
                                GLint params)

PARAMETERS

target The target for the convolution parameter. Must be one of GL_CONVOLUTION_1D_EXT, GL_CONVOLUTION_2D_EXT, or GL_SEPARABLE_2D_EXT.
pname Specifies a single-valued parameter. Must be GL_CONVOLUTION_BORDER_MODE_EXT.
params Specifies the value for the parameter pname for the target convolution filter specified by target.

C SPECIFICATION

void glConvolutionParameterfvEXT(GLenum target,
                                 GLenum pname,
                                 const GLfloat *params)
void glConvolutionParameterivEXT(GLenum target,
                                 GLenum pname,
                                 const GLint *params)

PARAMETERS

target The target for the convolution parameter. Must be one of GL_CONVOLUTION_1D_EXT, GL_CONVOLUTION_2D_EXT, or GL_SEPARABLE_2D_EXT.
pname Specifies a convolution parameter for the convolution filter specified by target. Must be one of GL_CONVOLUTION_BORDER_MODE_EXT, GL_CONVOLUTION_BORDER_COLOR_EXT, GL_CONVOLUTION_FILTER_SCALE_EXT, or GL_CONVOLUTION_FILTER_BIAS_EXT.
params Specifies a pointer to the value or values for the parameter pname for the target convolution filter specified by target.

DESCRIPTION

glConvolutionParameterEXT sets the value of a convolution parameter. The target parameter selects the convolution filter to be affected: GL_CONVOLUTION_1D_EXT, GL_CONVOLUTION_2D_EXT, or GL_SEPARABLE_2D_EXT for the 1D, 2D, or separable 2D filter, respectively. The pname parameter selects the parameter to be changed. The convolution parameters are as follows:
GL_CONVOLUTION_FILTER_SCALE_EXT
params contains four integer or floating-point values to be applied to the red, green, blue, and alpha values of the convolution filter. See glConvolutionFilter1DEXT, glConvolutionFilter2DEXT, and glSeparableFilter2DEXT for details. The initial convolution filter scale is (1,1,1,1).

GL_CONVOLUTION_FILTER_BIAS_EXT
params contains four integer or floating-point values to be applied to the red, green, blue, and alpha values of the convolution filter. See glConvolutionFilter1DEXT, glConvolutionFilter2DEXT, and glSeparableFilter2DEXT for details. The initial convolution filter bias is (0,0,0,0).

GL_CONVOLUTION_BORDER_COLOR_EXT
params contains four integer or floating-point values that specify the RGBA convolution border color. The initial convolution border color is (0,0,0,0).

GL_CONVOLUTION_BORDER_MODE_EXT
params is a single integer or floating-point value that specifies the convolution border mode. The initial border mode is GL_REDUCE_EXT. For the following modes, Wf is the filter width, Hf is the filter height, Ws is the source width, and Hs is the source height.

GL_REDUCE_EXT
The image resulting from convolution is smaller than the source image. The convolved image width will be Ws - Wf + 1 and the convolved image height will be Hs - Hf + 1. (If this reduction would generate an image with zero or negative width and/or height, the output is simply null, with no error generated.) The coordinates of the image resulting from convolution are 0 through Ws - Wf in width and 0 through Hs - Hf in height.

GL_CONSTANT_BORDER_EXT
The output image has the same dimensions as the source image. The convolution filter is moved around the source image so that its center passes over every pixel in the source image. At each location, the sum of products is computed and the result is written in the destination image at the location that corresponds to the pixel location where the convolution filter is centered. Whenever the convolution filter extends beyond one of the edges of the source image, the constant-color border pixels are used as input to the filter.

GL_REPLICATE_BORDER_EXT
The output image has the same dimensions as the source image. The convolution filter is moved around the source image so that its center passes over every pixel in the source image. At each location, the sum of products is computed and the result is written in the destination image at the location that corresponds to the pixel location where the convolution filter is centered. Whenever the filter extends beyond the image, it is as if the outermost one-pixel border of the source image was replicated.

NOTES

In cases where errors can result from the specification of invalid image dimensions, it is the dimensions after convolution that are tested, not the dimensions of the source image. For example, glTexImage1D requires power-of-two image size. When REDUCE_EXT border mode is in effect, the source image must be larger than the final power-of-two size by one less than the size of the 1D filter kernel.

EXTENSIONS

Some routines and constants for this function are part of an extension, not part of the core GL command set. The following extension names must be present in the string returned by glGetString when called with argument GL_EXTENSIONS to use these routines and constants.
glConvolutionParameterEXT, GL_CONVOLUTION_1D_EXT, GL_CONVOLUTION_2D_EXT, GL_SEPARABLE_2D_EXT, GL_CONSTANT_BORDER_EXT, GL_REPLICATE_BORDER_EXT, GL_CONVOLUTION_BORDER_COLOR_EXT, GL_CONVOLUTION_BORDER_MODE_EXT, GL_CONVOLUTION_FILTER_SCALE_EXT, GL_CONVOLUTION_FILTER_BIAS_EXT, and GL_REDUCE_EXT are part of the EXT_convolution extension.

ERRORS

GL_INVALID_ENUM is generated if target is not one of the allowable values.

GL_INVALID_ENUM is generated if pname is not one of the allowable values.

GL_INVALID_ENUM is generated if pname is GL_CONVOLUTION_BORDER_MODE_EXT and params is not GL_REDUCE_EXT.

GL_INVALID_OPERATION is generated if glConvolutionParameterEXT is executed between the execution of glBegin and the corresponding execution of glEnd.

ASSOCIATED GETS

glGetConvolutionParameterEXT

SEE ALSO

glConvolutionFilter1DEXT, glConvolutionFilter2DEXT, glSeparableFilter2DEXT, glGetConvolutionParameterEXT