5
.ds Dt 24 September 1999
9
.ds Xs 37578 9 convolutionfilter2d.gl
10
.TH GLCONVOLUTIONFILTER2D 3G
12
.B "glConvolutionFilter2D
13
\- define a two-dimensional convolution filter
16
void \f3glConvolutionFilter2D\fP(
19
.ta \w'\f3void \fPglConvolutionFilter2D( 'u
20
GLenum \fIinternalformat\fP,
25
const GLvoid \fI*image\fP )
29
.TP \w'\fIinternalformat\fP\ \ 'u
31
Must be \%\f3GL_CONVOLUTION_2D\fP.
34
The internal of the convolution filter kernel.
35
The allowable values are
42
\%\f3GL_LUMINANCE4\fP,
43
\%\f3GL_LUMINANCE8\fP,
44
\%\f3GL_LUMINANCE12\fP,
45
\%\f3GL_LUMINANCE16\fP,
46
\%\f3GL_LUMINANCE_ALPHA\fP,
47
\%\f3GL_LUMINANCE4_ALPHA4\fP,
48
\%\f3GL_LUMINANCE6_ALPHA2\fP,
49
\%\f3GL_LUMINANCE8_ALPHA8\fP,
50
\%\f3GL_LUMINANCE12_ALPHA4\fP,
51
\%\f3GL_LUMINANCE12_ALPHA12\fP,
52
\%\f3GL_LUMINANCE16_ALPHA16\fP,
54
\%\f3GL_INTENSITY4\fP,
55
\%\f3GL_INTENSITY8\fP,
56
\%\f3GL_INTENSITY12\fP,
57
\%\f3GL_INTENSITY16\fP,
76
The width of the pixel array referenced by \f2image\fP.
79
The height of the pixel array referenced by \f2image\fP.
82
The of the pixel data in \f2image\fP.
83
The allowable values are
92
\%\f3GL_LUMINANCE\fP, and
93
\%\f3GL_LUMINANCE_ALPHA\fP.
96
The type of the pixel data in \f2image\fP.
98
\%\f3GL_UNSIGNED_BYTE\fP,
101
\%\f3GL_UNSIGNED_SHORT\fP,
103
\%\f3GL_UNSIGNED_INT\fP,
106
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
107
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
108
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
109
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
110
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
111
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
112
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
113
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
114
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
115
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
116
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, and
117
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP
121
Pointer to a two-dimensional array of pixel data that is processed to
122
build the convolution filter kernel.
124
\%\f3glConvolutionFilter2D\fP builds a two-dimensional convolution filter kernel from an array of
127
The pixel array specified by \f2width\fP, \f2height\fP, \f2format\fP, \f2type\fP, and
128
\f2image\fP is extracted from memory and processed just as if
129
\%\f3glDrawPixels\fP were called, but processing stops after the final
130
expansion to RGBA is completed.
132
The R, G, B, and A components of each pixel are next scaled by the four
133
2D \%\f3GL_CONVOLUTION_FILTER_SCALE\fP parameters and biased by the
134
four 2D \%\f3GL_CONVOLUTION_FILTER_BIAS\fP parameters.
135
(The scale and bias parameters are set by \%\f3glConvolutionParameter\fP
136
using the \%\f3GL_CONVOLUTION_2D\fP target and the names
137
\%\f3GL_CONVOLUTION_FILTER_SCALE\fP and \%\f3GL_CONVOLUTION_FILTER_BIAS\fP.
138
The parameters themselves are vectors of four values that are applied to red,
139
green, blue, and alpha, in that order.)
140
The R, G, B, and A values are not clamped to [0,1] at any time during this
143
Each pixel is then converted to the internal specified by
144
\f2internalformat\fP.
145
This conversion simply maps the component values of the pixel (R, G, B,
146
and A) to the values included in the internal (red, green, blue,
147
alpha, luminance, and intensity). The mapping is as follows:
154
Internal Format Red Green Blue Alpha Luminance Intensity
157
\%\f3GL_LUMINANCE\fP R
158
\%\f3GL_LUMINANCE_ALPHA\fP A R
159
\%\f3GL_INTENSITY\fP R
161
\%\f3GL_RGBA\fP R G B A
165
The red, green, blue, alpha, luminance, and/or intensity components of
166
the resulting pixels are stored in floating-point rather than integer
168
They form a two-dimensional filter kernel image indexed with coordinates
169
\f2i\fP and \f2j\fP such that \f2i\fP starts at zero and increases from left
170
to right, and \f2j\fP starts at zero and increases from bottom to top.
171
Kernel location \f2i,j\fP is derived from the \f2N\fPth pixel,
172
where \f2N\fP is \f2i\fP+\f2j\fP*\f2width\fP.
174
Note that after a convolution is performed, the resulting color
175
components are also scaled by their corresponding
176
\%\f3GL_POST_CONVOLUTION_c_SCALE\fP parameters and biased by their
177
corresponding \%\f3GL_POST_CONVOLUTION_c_BIAS\fP parameters (where
178
\f2c\fP takes on the values \f3RED\fP, \f3GREEN\fP, \f3BLUE\fP, and
180
These parameters are set by \%\f3glPixelTransfer\fP.
182
\%\f3glConvolutionFilter2D\fP is present only if \%\f3GL_ARB_imaging\fP is returned when \%\f3glGetString\fP
183
is called with an argument of \%\f3GL_EXTENSIONS\fP.
185
\%\f3GL_INVALID_ENUM\fP is generated if \f2target\fP is not
186
\%\f3GL_CONVOLUTION_2D\fP.
188
\%\f3GL_INVALID_ENUM\fP is generated if \f2internalformat\fP is not one of the
191
\%\f3GL_INVALID_VALUE\fP is generated if \f2width\fP is less than zero or greater
192
than the maximum supported value.
193
This value may be queried with \%\f3glGetConvolutionParameter\fP
194
using target \%\f3GL_CONVOLUTION_2D\fP and name
195
\%\f3GL_MAX_CONVOLUTION_WIDTH\fP.
197
\%\f3GL_INVALID_VALUE\fP is generated if \f2height\fP is less than zero or greater
198
than the maximum supported value.
199
This value may be queried with \%\f3glGetConvolutionParameter\fP
200
using target \%\f3GL_CONVOLUTION_2D\fP and name
201
\%\f3GL_MAX_CONVOLUTION_HEIGHT\fP.
203
\%\f3GL_INVALID_ENUM\fP is generated if \f2format\fP is not one of the allowable
206
\%\f3GL_INVALID_ENUM\fP is generated if \f2type\fP is not one of the allowable
209
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glConvolutionFilter2D\fP is executed
210
between the execution of \%\f3glBegin\fP and the corresponding
211
execution of \%\f3glEnd\fP.
213
\%\f3GL_INVALID_OPERATION\fP is generated if \f2height\fP is one of
214
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
215
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
216
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP, or
217
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP
218
and \f2format\fP is not \%\f3GL_RGB\fP.
220
\%\f3GL_INVALID_OPERATION\fP is generated if \f2height\fP is one of
221
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
222
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
223
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
224
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
225
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
226
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
227
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, or
228
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP
229
and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
231
\%\f3glGetConvolutionParameter\fP, \%\f3glGetConvolutionFilter\fP
233
\%\f3glConvolutionFilter1D(3G)\fP,
234
\%\f3glSeparableFilter2D(3G)\fP,
235
\%\f3glConvolutionParameter(3G)\fP,
236
\%\f3glPixelTransfer(3G)\fP