---
name: "glConvolutionParameter"
section: "3x"
platform: "linux"
package: "xlibmesa-gl-dev"
version: "4.3.0.dfsg.1-14sarge7"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/glConvolutionParameter"
---

# glConvolutionParameter(3x)

set convolution parameters

## NAME

**glConvolutionParameterf, glConvolutionParameteri, glConvolutionParameterfv, glConvolutionParameteriv** - set convolution parameters

## C SPECIFICATION

void **glConvolutionParameterf**( GLenum *target*,

```
	GLenum pname,
	GLfloat params )
```

void **glConvolutionParameteri**( GLenum *target*,

```
	GLenum pname,
	GLint params )
```

delim $$

## PARAMETERS

- *target*

  The target for the convolution parameter. Must be one of **GL\_CONVOLUTION\_1D**, **GL\_CONVOLUTION\_2D**, or **GL\_SEPARABLE\_2D**.

- *pname*

  The parameter to be set. Must be **GL\_CONVOLUTION\_BORDER\_MODE**.

- *params*

  The parameter value. Must be one of **GL\_REDUCE**, **GL\_CONSTANT\_BORDER**, **GL\_REPLICATE\_BORDER**.

## C SPECIFICATION

void **glConvolutionParameterfv**( GLenum *target*,

```
	GLenum pname,
	const GLfloat *params )
```

void **glConvolutionParameteriv**( GLenum *target*,

```
	GLenum pname,
	const GLint *params )
```

## PARAMETERS

- *target*

  The target for the convolution parameter. Must be one of **GL\_CONVOLUTION\_1D**, **GL\_CONVOLUTION\_2D**, or **GL\_SEPARABLE\_2D**.

- *pname*

  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**.

- *params*

  The parameter value. If *pname* is **GL\_CONVOLUTION\_BORDER\_MODE**, *params* 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* is **GL\_CONVOLUTION\_FILTER\_SCALE**), or biasing (when *pname* is **GL\_CONVOLUTION\_FILTER\_BIAS**) a convolution filter kernel or setting the constant border color (when *pname* is **GL\_CONVOLUTION\_BORDER\_COLOR**.

## DESCRIPTION

**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* 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:

- **GL\_REDUCE**

  The image resulting from convolution is smaller than the source image. If the filter width is $Wf$ and height is $Hf$, and the source image width is $Ws$ and height is $Hs$, then the convolved image width will be $Ws ~-~ Wf ~+~ 1$ and 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 zero through $Ws ~-~ Wf$ in width and zero through $Hs ~-~ Hf$ in height.

- **GL\_CONSTANT\_BORDER**

  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**.

- **GL\_REPLICATE\_BORDER**

  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.

## NOTES

**glConvolutionParameter** is present only if **GL\_ARB\_imaging** is 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.

## 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** and *params* is not one of **GL\_REDUCE**, **GL\_CONSTANT\_BORDER**, or **GL\_REPLICATE\_BORDER**.

**GL\_INVALID\_OPERATION** is generated if **glConvolutionParameter** is executed between the execution of **glBegin** and the corresponding execution of **glEnd**.

## ASSOCIATED GETS

**glGetConvolutionParameter**

## SEE ALSO

**glConvolutionFilter1D(3G)**, **glConvolutionFilter2D(3G)**, **glSeparableFilter2D(3G)**, **glGetConvolutionParameter(3G)**
