1GLSEPARABLEFILTER2D(3G) OpenGL Manual GLSEPARABLEFILTER2D(3G)
2
3
4
6 glSeparableFilter2D - define a separable two-dimensional convolution
7 filter
8
10 void glSeparableFilter2D(GLenum target, GLenum internalformat,
11 GLsizei width, GLsizei height, GLenum format,
12 GLenum type, const GLvoid * row,
13 const GLvoid * column);
14
16 target
17 Must be GL_SEPARABLE_2D.
18
19 internalformat
20 The internal format of the convolution filter kernel. The allowable
21 values are GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16,
22 GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12,
23 GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4,
24 GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4,
25 GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, GL_INTENSITY,
26 GL_INTENSITY4, GL_INTENSITY8, GL_INTENSITY12, GL_INTENSITY16,
27 GL_R3_G3_B2, GL_RGB, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12,
28 GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1, GL_RGBA8,
29 GL_RGB10_A2, GL_RGBA12, or GL_RGBA16.
30
31 width
32 The number of elements in the pixel array referenced by row. (This
33 is the width of the separable filter kernel.)
34
35 height
36 The number of elements in the pixel array referenced by column.
37 (This is the height of the separable filter kernel.)
38
39 format
40 The format of the pixel data in row and column. The allowable
41 values are GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_BGR,
42 GL_RGBA, GL_BGRA, GL_INTENSITY, GL_LUMINANCE, and
43 GL_LUMINANCE_ALPHA.
44
45 type
46 The type of the pixel data in row and column. Symbolic constants
47 GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT,
48 GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2,
49 GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5,
50 GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4,
51 GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1,
52 GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8,
53 GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and
54 GL_UNSIGNED_INT_2_10_10_10_REV are accepted.
55
56 row
57 Pointer to a one-dimensional array of pixel data that is processed
58 to build the row filter kernel.
59
60 column
61 Pointer to a one-dimensional array of pixel data that is processed
62 to build the column filter kernel.
63
65 glSeparableFilter2D builds a two-dimensional separable convolution
66 filter kernel from two arrays of pixels.
67
68 The pixel arrays specified by (width, format, type, row) and (height,
69 format, type, column) are processed just as if they had been passed to
70 glDrawPixels(), but processing stops after the final expansion to RGBA
71 is completed.
72
73 If a non-zero named buffer object is bound to the
74 GL_PIXEL_UNPACK_BUFFER target (see glBindBuffer()) while a convolution
75 filter is specified, row and column are treated as byte offsets into
76 the buffer object's data store.
77
78 Next, the R, G, B, and A components of all pixels in both arrays are
79 scaled by the four separable 2D GL_CONVOLUTION_FILTER_SCALE parameters
80 and biased by the four separable 2D GL_CONVOLUTION_FILTER_BIAS
81 parameters. (The scale and bias parameters are set by
82 glConvolutionParameter() using the GL_SEPARABLE_2D target and the names
83 GL_CONVOLUTION_FILTER_SCALE and GL_CONVOLUTION_FILTER_BIAS. The
84 parameters themselves are vectors of four values that are applied to
85 red, green, blue, and alpha, in that order.) The R, G, B, and A values
86 are not clamped to [0,1] at any time during this process.
87
88 Each pixel is then converted to the internal format specified by
89 internalformat. This conversion simply maps the component values of the
90 pixel (R, G, B, and A) to the values included in the internal format
91 (red, green, blue, alpha, luminance, and intensity). The mapping is as
92 follows:
93
94 ┌─────────────────────────────────┬─────────────────────────────┬───────────────────────────────┬──────────────────────────────┬───────────────────────────────┬───────────────────────────────────┬───────────────────────────────────┐
95 │ │ │ │ │ │ │ │
96 │ Internal │ Red │ Green │ Blue │ Alpha │ Luminance │ Intensity │
97 │Format │ │ │ │ │ │ │
98 │ │ │ │ │ │ │ │
99 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
100 │GL_LUMINANCE │ │ │ │ │ R │ │
101 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
102 │GL_LUMINANCE_ALPHA │ │ │ │ A │ R │ │
103 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
104 │GL_INTENSITY │ │ │ │ │ │ R │
105 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
106 │GL_RGB │ R │ G │ B │ │ │ │
107 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
108 │GL_RGBA │ R │ G │ B │ A │ │ │
109 └─────────────────────────────────┴─────────────────────────────┴───────────────────────────────┴──────────────────────────────┴───────────────────────────────┴───────────────────────────────────┴───────────────────────────────────┘
110
111 The red, green, blue, alpha, luminance, and/or intensity components of
112 the resulting pixels are stored in floating-point rather than integer
113 format. They form two one-dimensional filter kernel images. The row
114 image is indexed by coordinate i starting at zero and increasing from
115 left to right. Each location in the row image is derived from element i
116 of row. The column image is indexed by coordinate j starting at zero
117 and increasing from bottom to top. Each location in the column image is
118 derived from element j of column.
119
120 Note that after a convolution is performed, the resulting color
121 components are also scaled by their corresponding
122 GL_POST_CONVOLUTION_c_SCALE parameters and biased by their
123 corresponding GL_POST_CONVOLUTION_c_BIAS parameters (where c takes on
124 the values RED, GREEN, BLUE, and ALPHA). These parameters are set by
125 glPixelTransfer().
126
128 glSeparableFilter2D is present only if ARB_imaging is returned when
129 glGetString() is called with an argument of GL_EXTENSIONS.
130
132 GL_INVALID_ENUM is generated if target is not GL_SEPARABLE_2D.
133
134 GL_INVALID_ENUM is generated if internalformat is not one of the
135 allowable values.
136
137 GL_INVALID_ENUM is generated if format is not one of the allowable
138 values.
139
140 GL_INVALID_ENUM is generated if type is not one of the allowable
141 values.
142
143 GL_INVALID_VALUE is generated if width is less than zero or greater
144 than the maximum supported value. This value may be queried with
145 glGetConvolutionParameter() using target GL_SEPARABLE_2D and name
146 GL_MAX_CONVOLUTION_WIDTH.
147
148 GL_INVALID_VALUE is generated if height is less than zero or greater
149 than the maximum supported value. This value may be queried with
150 glGetConvolutionParameter() using target GL_SEPARABLE_2D and name
151 GL_MAX_CONVOLUTION_HEIGHT.
152
153 GL_INVALID_OPERATION is generated if height is one of
154 GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
155 GL_UNSIGNED_SHORT_5_6_5, or GL_UNSIGNED_SHORT_5_6_5_REV and format is
156 not GL_RGB.
157
158 GL_INVALID_OPERATION is generated if height is one of
159 GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
160 GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
161 GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV,
162 GL_UNSIGNED_INT_10_10_10_2, or GL_UNSIGNED_INT_2_10_10_10_REV and
163 format is neither GL_RGBA nor GL_BGRA.
164
165 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
166 bound to the GL_PIXEL_UNPACK_BUFFER target and the buffer object's data
167 store is currently mapped.
168
169 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
170 bound to the GL_PIXEL_UNPACK_BUFFER target and the data would be
171 unpacked from the buffer object such that the memory reads required
172 would exceed the data store size.
173
174 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
175 bound to the GL_PIXEL_UNPACK_BUFFER target and row or column is not
176 evenly divisible into the number of bytes needed to store in memory a
177 datum indicated by type.
178
179 GL_INVALID_OPERATION is generated if glSeparableFilter2D is executed
180 between the execution of glBegin() and the corresponding execution of
181 glEnd().
182
184 glGetConvolutionParameter(), glGetSeparableFilter()
185
186 glGet() with argument GL_PIXEL_UNPACK_BUFFER_BINDING
187
189 glConvolutionFilter1D(), glConvolutionFilter2D(),
190 glConvolutionParameter(), glPixelTransfer()
191
193 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
194 under the SGI Free Software B License. For details, see
195 http://oss.sgi.com/projects/FreeB/.
196
198 opengl.org
199
200
201
202opengl.org 07/13/2018 GLSEPARABLEFILTER2D(3G)