rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / xhtml / glConvolutionParameter.xml
CommitLineData
7faf1d71
AW
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
2<!-- saved from url=(0013)about:internet -->
3<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glConvolutionParameter</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glConvolutionParameter"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glConvolutionParameter — set convolution parameters</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glConvolutionParameterf</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLfloat  </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glConvolutionParameteri</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div></div><p>
4 </p><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>target</code></em></span></dt><dd><p>
5 The target for the convolution parameter.
6 Must be one of
7 <code class="constant">GL_CONVOLUTION_1D</code>,
8 <code class="constant">GL_CONVOLUTION_2D</code>, or
9 <code class="constant">GL_SEPARABLE_2D</code>.
10 </p></dd><dt><span class="term"><em class="parameter"><code>pname</code></em></span></dt><dd><p>
11 The parameter to be set.
12 Must be
13 <code class="constant">GL_CONVOLUTION_BORDER_MODE</code>.
14 </p></dd><dt><span class="term"><em class="parameter"><code>params</code></em></span></dt><dd><p>
15 The parameter value.
16 Must be one of
17 <code class="constant">GL_REDUCE</code>, <code class="constant">GL_CONSTANT_BORDER</code>, <code class="constant">GL_REPLICATE_BORDER</code>.
18 </p><p>
19 </p></dd></dl></div></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glConvolutionParameterfv</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>const GLfloat *  </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glConvolutionParameteriv</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>const GLint *  </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div></div><p>
20 </p><div class="refsect1" lang="en" xml:lang="en"><a id="parameters2"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>target</code></em></span></dt><dd><p>
21 The target for the convolution parameter.
22 Must be one of
23 <code class="constant">GL_CONVOLUTION_1D</code>,
24 <code class="constant">GL_CONVOLUTION_2D</code>, or
25 <code class="constant">GL_SEPARABLE_2D</code>.
26 </p></dd><dt><span class="term"><em class="parameter"><code>pname</code></em></span></dt><dd><p>
27 The parameter to be set.
28 Must be one of
29 <code class="constant">GL_CONVOLUTION_BORDER_MODE</code>,
30 <code class="constant">GL_CONVOLUTION_BORDER_COLOR</code>,
31 <code class="constant">GL_CONVOLUTION_FILTER_SCALE</code>, or
32 <code class="constant">GL_CONVOLUTION_FILTER_BIAS</code>.
33 </p></dd><dt><span class="term"><em class="parameter"><code>params</code></em></span></dt><dd><p>
34 The parameter value.
35 If <em class="parameter"><code>pname</code></em>v is <code class="constant">GL_CONVOLUTION_BORDER_MODE</code>, <em class="parameter"><code>params</code></em>v must be one of
36 <code class="constant">GL_REDUCE</code>, <code class="constant">GL_CONSTANT_BORDER</code>, or <code class="constant">GL_REPLICATE_BORDER</code>.
37 Otherwise, must be a vector of four values (for red, green, blue, and alpha,
38 respectively) to be used for
39 scaling (when <em class="parameter"><code>pname</code></em>v is <code class="constant">GL_CONVOLUTION_FILTER_SCALE</code>), or
40 biasing (when <em class="parameter"><code>pname</code></em>v is <code class="constant">GL_CONVOLUTION_FILTER_BIAS</code>) a convolution
41 filter kernel or setting the constant border color (when <em class="parameter"><code>pname</code></em>v is
42 <code class="constant">GL_CONVOLUTION_BORDER_COLOR</code>.
43 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
44 <code class="function">glConvolutionParameter</code> sets the value of a convolution parameter.
45 </p><p>
46 <em class="parameter"><code>target</code></em> selects the convolution filter to be affected:
47 <code class="constant">GL_CONVOLUTION_1D</code>,
48 <code class="constant">GL_CONVOLUTION_2D</code>, or
49 <code class="constant">GL_SEPARABLE_2D</code>
50 for the 1D, 2D, or separable 2D filter, respectively.
51 </p><p>
52 <em class="parameter"><code>pname</code></em> selects the parameter to be changed.
53 <code class="constant">GL_CONVOLUTION_FILTER_SCALE</code> and <code class="constant">GL_CONVOLUTION_FILTER_BIAS</code>
54 affect the definition of the convolution filter kernel; see
55 <a class="citerefentry" href="glConvolutionFilter1D.xml"><span class="citerefentry"><span class="refentrytitle">glConvolutionFilter1D</span></span></a>, <a class="citerefentry" href="glConvolutionFilter2D.xml"><span class="citerefentry"><span class="refentrytitle">glConvolutionFilter2D</span></span></a>, and
56 <a class="citerefentry" href="glSeparableFilter2D.xml"><span class="citerefentry"><span class="refentrytitle">glSeparableFilter2D</span></span></a> for details.
57 In these cases, <em class="parameter"><code>params</code></em>v is an array of four values to be applied to
58 red, green, blue, and alpha values, respectively. The initial value for
59 <code class="constant">GL_CONVOLUTION_FILTER_SCALE</code> is (1, 1, 1, 1), and the initial value
60 for <code class="constant">GL_CONVOLUTION_FILTER_BIAS</code> is (0, 0, 0, 0).
61 </p><p>
62 A <em class="parameter"><code>pname</code></em> value of <code class="constant">GL_CONVOLUTION_BORDER_MODE</code> controls the
63 convolution border mode. The accepted modes are:
64 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_REDUCE</code></span></dt><dd><p>
65 The image resulting from convolution is
66 smaller than the source image.
67 If the filter width is
68 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">Wf</mml:mi></mml:math>
69 and height is
70 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">Hf</mml:mi></mml:math>,
71 and the source image width is
72 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">Ws</mml:mi></mml:math>
73 and height is
74 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">Hs</mml:mi></mml:math>,
75 then the convolved image width will be
76 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
77
78 <mml:mrow>
79 <mml:mi mathvariant="italic">Ws</mml:mi>
80 <mml:mo>-</mml:mo>
81 <mml:mi mathvariant="italic">Wf</mml:mi>
82 <mml:mo>+</mml:mo>
83 <mml:mn>1</mml:mn>
84 </mml:mrow>
85 </mml:math>
86 and height
87 will be
88 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
89
90 <mml:mrow>
91 <mml:mi mathvariant="italic">Hs</mml:mi>
92 <mml:mo>-</mml:mo>
93 <mml:mi mathvariant="italic">Hf</mml:mi>
94 <mml:mo>+</mml:mo>
95 <mml:mn>1</mml:mn>
96 </mml:mrow>
97 </mml:math>.
98 (If this reduction would generate an image with zero or negative width
99 and/or height, the output is simply null, with no error generated.)
100 The coordinates of the image resulting from convolution are zero
101 through
102 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
103
104 <mml:mrow>
105 <mml:mi mathvariant="italic">Ws</mml:mi>
106 <mml:mo>-</mml:mo>
107 <mml:mi mathvariant="italic">Wf</mml:mi>
108 </mml:mrow>
109 </mml:math>
110 in width and zero through
111 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
112
113 <mml:mrow>
114 <mml:mi mathvariant="italic">Hs</mml:mi>
115 <mml:mo>-</mml:mo>
116 <mml:mi mathvariant="italic">Hf</mml:mi>
117 </mml:mrow>
118 </mml:math>
119 in
120 height.
121 </p></dd><dt><span class="term"><code class="constant">GL_CONSTANT_BORDER</code></span></dt><dd><p>
122 The image resulting from convolution is the same size as the source image, and
123 processed as if the source image were surrounded by pixels with their color
124 specified by the <code class="constant">GL_CONVOLUTION_BORDER_COLOR</code>.
125 </p></dd><dt><span class="term"><code class="constant">GL_REPLICATE_BORDER</code></span></dt><dd><p>
126 The image resulting from convolution is the same size as the source image, and
127 processed as if the outermost pixel on the border of the source image were
128 replicated.
129 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
130 <code class="function">glConvolutionParameter</code> is present only if <code class="code">ARB_imaging</code> is returned when <a class="citerefentry" href="glGetString.xml"><span class="citerefentry"><span class="refentrytitle">glGetString</span></span></a>
131 is called with an argument of <code class="constant">GL_EXTENSIONS</code>.
132 </p><p>
133 In cases where errors can result from the specification of invalid
134 image dimensions, it is the dimensions after convolution that are
135 tested, not the dimensions of the source image.
136 For example, <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a> requires power-of-two image size.
137 When <code class="constant">GL_REDUCE</code> border mode is in effect,
138 the source image must be larger than the final power-of-two size
139 by one less than the size of the 1D filter kernel.
140 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
141 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not one of the allowable
142 values.
143 </p><p>
144 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>pname</code></em> is not one of the allowable
145 values.
146 </p><p>
147 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>pname</code></em> is
148 <code class="constant">GL_CONVOLUTION_BORDER_MODE</code> and <em class="parameter"><code>params</code></em> is not one of
149 <code class="constant">GL_REDUCE</code>, <code class="constant">GL_CONSTANT_BORDER</code>, or <code class="constant">GL_REPLICATE_BORDER</code>.
150 </p><p>
151 <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glConvolutionParameter</code> is executed
152 between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> and the corresponding
153 execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
154 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
155 <a class="citerefentry" href="glGetConvolutionParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetConvolutionParameter</span></span></a>
156 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
157 <a class="citerefentry" href="glConvolutionFilter1D.xml"><span class="citerefentry"><span class="refentrytitle">glConvolutionFilter1D</span></span></a>,
158 <a class="citerefentry" href="glConvolutionFilter2D.xml"><span class="citerefentry"><span class="refentrytitle">glConvolutionFilter2D</span></span></a>,
159 <a class="citerefentry" href="glSeparableFilter2D.xml"><span class="citerefentry"><span class="refentrytitle">glSeparableFilter2D</span></span></a>,
160 <a class="citerefentry" href="glGetConvolutionParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetConvolutionParameter</span></span></a>
161 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
162 Copyright <span class="trademark"></span>© 1991-2006
163 Silicon Graphics, Inc. This document is licensed under the SGI
164 Free Software B License. For details, see
165 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
166 </p></div></div></body></html>