set convolution parameters
glConvolutionParameterfv( GLenum ( target ) , GLenum ( pname ) , const GLfloat * ( params ) )-> void
The target for the convolution parameter. Must be one of GL_CONVOLUTION_1D , GL_CONVOLUTION_2D , or GL_SEPARABLE_2D .
The parameter to be set. Must be one of GL_CONVOLUTION_BORDER_MODE , GL_CONVOLUTION_BORDER_COLOR , GL_CONVOLUTION_FILTER_SCALE , or GL_CONVOLUTION_FILTER_BIAS .
The parameter value. If pname v is GL_CONVOLUTION_BORDER_MODE , params v must be one of GL_REDUCE , GL_CONSTANT_BORDER , or GL_REPLICATE_BORDER . Otherwise, must be a vector of four values (for red, green, blue, and alpha, respectively) to be used for scaling (when pname v is GL_CONVOLUTION_FILTER_SCALE ), or biasing (when pname v is GL_CONVOLUTION_FILTER_BIAS ) a convolution filter kernel or setting the constant border color (when pname v is GL_CONVOLUTION_BORDER_COLOR .
glConvolutionParameter sets the value of a convolution parameter.
target selects the convolution filter to be affected: GL_CONVOLUTION_1D , GL_CONVOLUTION_2D , or GL_SEPARABLE_2D for the 1D, 2D, or separable 2D filter, respectively.
pname selects the parameter to be changed. GL_CONVOLUTION_FILTER_SCALE and GL_CONVOLUTION_FILTER_BIAS affect the definition of the convolution filter kernel; see glConvolutionFilter1D , glConvolutionFilter2D , and glSeparableFilter2D for details. In these cases, params v is an array of four values to be applied to red, green, blue, and alpha values, respectively. The initial value for GL_CONVOLUTION_FILTER_SCALE is (1, 1, 1, 1), and the initial value for GL_CONVOLUTION_FILTER_BIAS is (0, 0, 0, 0).
A pname value of GL_CONVOLUTION_BORDER_MODE controls the convolution border mode. The accepted modes are:
The image resulting from convolution is smaller than the source image. If the filter width is and height is , and the source image width is and height is , then the convolved image width will be and height will be . (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 zero through in width and zero through in height.
The image resulting from convolution is the same size as the source image, and processed as if the source image were surrounded by pixels with their color specified by the GL_CONVOLUTION_BORDER_COLOR .
The image resulting from convolution is the same size as the source image, and processed as if the outermost pixel on the border of the source image were replicated.
glConvolutionParameter is present only if
ARB_imagingis returned when glGetString is called with an argument of GL_EXTENSIONS .
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 GL_REDUCE 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.
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 and params is not one of GL_REDUCE , GL_CONSTANT_BORDER , or GL_REPLICATE_BORDER .
Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/ .
Sample Code References
The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.
OpenGLContext tests/nehe6_convolve.py Lines: 106