1GLCOPYCONVOLUTIONFILTER2D(3G) GLCOPYCONVOLUTIONFILTER2D(3G)
2
3
4
6 glCopyConvolutionFilter2D - copy pixels into a two-dimensional convolu‐
7 tion filter
8
9
11 void glCopyConvolutionFilter2D( GLenum target,
12 GLenum internalformat,
13 GLint x,
14 GLint y,
15 GLsizei width,
16 GLsizei height )
17
18
20 target Must be GL_CONVOLUTION_2D.
21
22 internalformat The internal of the convolution filter kernel. The
23 allowable values are GL_ALPHA, GL_ALPHA4, GL_ALPHA8,
24 GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4,
25 GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16,
26 GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4,
27 GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8,
28 GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12,
29 GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4,
30 GL_INTENSITY8, GL_INTENSITY12, GL_INTENSITY16,
31 GL_R3_G3_B2, GL_RGB, GL_RGB4, GL_RGB5, GL_RGB8,
32 GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2,
33 GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12,
34 or GL_RGBA16.
35
36 x, y The window space coordinates of the lower-left coordi‐
37 nate of the pixel array to copy.
38
39 width The width of the pixel array to copy.
40
41 height The height of the pixel array to copy.
42
44 glCopyConvolutionFilter2D defines a two-dimensional convolution filter
45 kernel with pixels from the current GL_READ_BUFFER (rather than from
46 main memory, as is the case for glConvolutionFilter2D).
47
48 The screen-aligned pixel rectangle with lower-left corner at (x, y),
49 width width and height height is used to define the convolution filter.
50 If any pixels within this region are outside the window that is associ‐
51 ated with the GL context, the values obtained for those pixels are
52 undefined.
53
54 The pixels in the rectangle are processed exactly as if glReadPixels
55 had been called with format set to RGBA, but the process stops just
56 before final conversion. The R, G, B, and A components of each pixel
57 are next scaled by the four 2D GL_CONVOLUTION_FILTER_SCALE parameters
58 and biased by the four 2D GL_CONVOLUTION_FILTER_BIAS parameters. (The
59 scale and bias parameters are set by glConvolutionParameter using the
60 GL_CONVOLUTION_2D target and the names GL_CONVOLUTION_FILTER_SCALE and
61 GL_CONVOLUTION_FILTER_BIAS. The parameters themselves are vectors of
62 four values that are applied to red, green, blue, and alpha, in that
63 order.) The R, G, B, and A values are not clamped to [0,1] at any time
64 during this process.
65
66 Each pixel is then converted to the internal specified by internalfor‐
67 mat. This conversion simply maps the component values of the pixel (R,
68 G, B, and A) to the values included in the internal (red, green, blue,
69 alpha, luminance, and intensity). The mapping is as follows:
70
71
72 ────────────────────────────────────────────────────────────────────────
73 Internal Format Red Green Blue Alpha Luminance Intensity
74 ────────────────────────────────────────────────────────────────────────
75 GL_ALPHA A
76 GL_LUMINANCE R
77 GL_LUMINANCE_ALPHA A R
78 GL_INTENSITY R
79 GL_RGB R G B
80 GL_RGBA R G B A
81 ────────────────────────────────────────────────────────────────────────
82
83 The red, green, blue, alpha, luminance, and/or intensity components of
84 the resulting pixels are stored in floating-point rather than integer
85
86 Pixel ordering is such that lower x screen coordinates correspond to
87 lower i filter image coordinates, and lower y screen coordinates corre‐
88 spond to lower j filter image coordinates.
89
90 Note that after a convolution is performed, the resulting color compo‐
91 nents are also scaled by their corresponding
92 GL_POST_CONVOLUTION_c_SCALE parameters and biased by their correspond‐
93 ing GL_POST_CONVOLUTION_c_BIAS parameters (where c takes on the values
94 RED, GREEN, BLUE, and ALPHA). These parameters are set by
95 glPixelTransfer.
96
98 glCopyConvolutionFilter2D is present only if GL_ARB_imaging is returned
99 when glGetString is called with an argument of GL_EXTENSIONS.
100
102 GL_INVALID_ENUM is generated if target is not GL_CONVOLUTION_2D.
103
104 GL_INVALID_ENUM is generated if internalformat is not one of the allow‐
105 able values.
106
107 GL_INVALID_VALUE is generated if width is less than zero or greater
108 than the maximum supported value. This value may be queried with
109 glGetConvolutionParameter using target GL_CONVOLUTION_2D and name
110 GL_MAX_CONVOLUTION_WIDTH.
111
112 GL_INVALID_VALUE is generated if height is less than zero or greater
113 than the maximum supported value. This value may be queried with
114 glGetConvolutionParameter using target GL_CONVOLUTION_2D and name
115 GL_MAX_CONVOLUTION_HEIGHT.
116
117 GL_INVALID_OPERATION is generated if glCopyConvolutionFilter2D is exe‐
118 cuted between the execution of glBegin and the corresponding execution
119 of glEnd.
120
122 glGetConvolutionParameter, glGetConvolutionFilter
123
125 glConvolutionFilter2D(3G), glConvolutionParameter(3G),
126 glPixelTransfer(3G)
127
128
129
130 GLCOPYCONVOLUTIONFILTER2D(3G)