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