rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / xhtml / gluBuild1DMipmapLevels.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>gluBuild1DMipmapLevels</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="gluBuild1DMipmapLevels"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>gluBuild1DMipmapLevels — builds a subset of one-dimensional mipmap levels</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">GLint <b class="fsfunc">gluBuild1DMipmapLevels</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">internalFormat</var>, </td></tr><tr><td> </td><td>GLsizei  </td><td><var class="pdparam">width</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">format</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">type</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">level</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">base</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">max</var>, </td></tr><tr><td> </td><td>const void *  </td><td><var class="pdparam">data</var><code>)</code>;</td></tr></table></div></div><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>
4 Specifies the target texture. Must be <code class="constant">GLU_TEXTURE_1D</code>.
5 </p></dd><dt><span class="term"><em class="parameter"><code>internalFormat</code></em></span></dt><dd><p>
6 Requests the internal storage format of the texture image. The most
7 current version of the SGI implementation of GLU does not check this
8 value for validity before passing it on to the underlying OpenGL
9 implementation. A value that is not accepted by the OpenGL
10 implementation will lead to an OpenGL error. The benefit of not
11 checking this value at the GLU level is that OpenGL extensions can add
12 new internal texture formats without requiring a revision of the GLU
13 implementation. Older implementations of GLU check this value and
14 raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
15 symbolic constants:
16 <code class="constant">GLU_ALPHA</code>,
17 <code class="constant">GLU_ALPHA4</code>,
18 <code class="constant">GLU_ALPHA8</code>,
19 <code class="constant">GLU_ALPHA12</code>,
20 <code class="constant">GLU_ALPHA16</code>,
21 <code class="constant">GLU_LUMINANCE</code>,
22 <code class="constant">GLU_LUMINANCE4</code>,
23 <code class="constant">GLU_LUMINANCE8</code>,
24 <code class="constant">GLU_LUMINANCE12</code>,
25 <code class="constant">GLU_LUMINANCE16</code>,
26 <code class="constant">GLU_LUMINANCE_ALPHA</code>,
27 <code class="constant">GLU_LUMINANCE4_ALPHA4</code>,
28 <code class="constant">GLU_LUMINANCE6_ALPHA2</code>,
29 <code class="constant">GLU_LUMINANCE8_ALPHA8</code>,
30 <code class="constant">GLU_LUMINANCE12_ALPHA4</code>,
31 <code class="constant">GLU_LUMINANCE12_ALPHA12</code>,
32 <code class="constant">GLU_LUMINANCE16_ALPHA16</code>,
33 <code class="constant">GLU_INTENSITY</code>,
34 <code class="constant">GLU_INTENSITY4</code>,
35 <code class="constant">GLU_INTENSITY8</code>,
36 <code class="constant">GLU_INTENSITY12</code>,
37 <code class="constant">GLU_INTENSITY16</code>,
38 <code class="constant">GLU_RGB</code>,
39 <code class="constant">GLU_R3_G3_B2</code>,
40 <code class="constant">GLU_RGB4</code>,
41 <code class="constant">GLU_RGB5</code>,
42 <code class="constant">GLU_RGB8</code>,
43 <code class="constant">GLU_RGB10</code>,
44 <code class="constant">GLU_RGB12</code>,
45 <code class="constant">GLU_RGB16</code>,
46 <code class="constant">GLU_RGBA</code>,
47 <code class="constant">GLU_RGBA2</code>,
48 <code class="constant">GLU_RGBA4</code>,
49 <code class="constant">GLU_RGB5_A1</code>,
50 <code class="constant">GLU_RGBA8</code>,
51 <code class="constant">GLU_RGB10_A2</code>,
52 <code class="constant">GLU_RGBA12</code>, or
53 <code class="constant">GLU_RGBA16</code>.
54 </p></dd><dt><span class="term"><em class="parameter"><code>width</code></em></span></dt><dd><p>
55 Specifies the width in pixels of the texture image.
56 This should be a power of 2.
57 </p></dd><dt><span class="term"><em class="parameter"><code>format</code></em></span></dt><dd><p>
58 Specifies the format of the pixel data.
59 Must be one of:
60 <code class="constant">GLU_COLOR_INDEX</code>,
61 <code class="constant">GLU_DEPTH_COMPONENT</code>,
62 <code class="constant">GLU_RED</code>,
63 <code class="constant">GLU_GREEN</code>,
64 <code class="constant">GLU_BLUE</code>,
65 <code class="constant">GLU_ALPHA</code>,
66 <code class="constant">GLU_RGB</code>,
67 <code class="constant">GLU_RGBA</code>,
68 <code class="constant">GLU_BGR</code>,
69 <code class="constant">GLU_BGRA</code>,
70 <code class="constant">GLU_LUMINANCE</code>, or
71 <code class="constant">GLU_LUMINANCE_ALPHA</code>.
72 </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p>
73 Specifies the data type for <em class="parameter"><code>data</code></em>.
74 Must be one of: <code class="constant">GLU_UNSIGNED_BYTE</code>,
75 <code class="constant">GLU_BYTE</code>,
76 <code class="constant">GLU_BITMAP</code>,
77 <code class="constant">GLU_UNSIGNED_SHORT</code>,
78 <code class="constant">GLU_SHORT</code>,
79 <code class="constant">GLU_UNSIGNED_INT</code>,
80 <code class="constant">GLU_INT</code>,
81 <code class="constant">GLU_FLOAT</code>,
82 <code class="constant">GLU_UNSIGNED_BYTE_3_3_2</code>,
83 <code class="constant">GLU_UNSIGNED_BYTE_2_3_3_REV</code>,
84 <code class="constant">GLU_UNSIGNED_SHORT_5_6_5</code>,
85 <code class="constant">GLU_UNSIGNED_SHORT_5_6_5_REV</code>,
86 <code class="constant">GLU_UNSIGNED_SHORT_4_4_4_4</code>,
87 <code class="constant">GLU_UNSIGNED_SHORT_4_4_4_4_REV</code>,
88 <code class="constant">GLU_UNSIGNED_SHORT_5_5_5_1</code>,
89 <code class="constant">GLU_UNSIGNED_SHORT_1_5_5_5_REV</code>,
90 <code class="constant">GLU_UNSIGNED_INT_8_8_8_8</code>,
91 <code class="constant">GLU_UNSIGNED_INT_8_8_8_8_REV</code>,
92 <code class="constant">GLU_UNSIGNED_INT_10_10_10_2</code>, or
93 <code class="constant">GLU_UNSIGNED_INT_2_10_10_10_REV</code>.
94 </p></dd><dt><span class="term"><em class="parameter"><code>level</code></em></span></dt><dd><p>
95 Specifies the mipmap level of the image data.
96 </p></dd><dt><span class="term"><em class="parameter"><code>base</code></em></span></dt><dd><p>
97 Specifies the minimum mipmap level to pass to <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>.
98 </p></dd><dt><span class="term"><em class="parameter"><code>max</code></em></span></dt><dd><p>
99 Specifies the maximum mipmap level to pass to <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>.
100 </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p>
101 Specifies a pointer to the image data in memory.
102 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
103 <code class="function">gluBuild1DMipmapLevels</code> builds a subset of prefiltered one-dimensional texture maps of decreasing
104 resolutions called a mipmap. This is used for the antialiasing of
105 texture mapped primitives.
106 </p><p>
107 A return value of zero indicates success, otherwise a GLU error code is
108 returned (see <a class="citerefentry" href="gluErrorString.xml"><span class="citerefentry"><span class="refentrytitle">gluErrorString</span></span></a>).
109 </p><p>
110 A series of mipmap levels from <em class="parameter"><code>base</code></em> to <em class="parameter"><code>max</code></em> is built by decimating
111 <em class="parameter"><code>data</code></em> in half
112 until size
113 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
114
115 <mml:mrow>
116 <mml:mn>1</mml:mn>
117 <mml:mo>×</mml:mo>
118 <mml:mn>1</mml:mn>
119 </mml:mrow>
120 </mml:math>
121 is reached. At each level, each texel in the
122 halved mipmap level is an average of the corresponding two texels in the larger
123 mipmap level.
124 <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a> is called to load these mipmap levels from <em class="parameter"><code>base</code></em>
125 to <em class="parameter"><code>max</code></em>. If <em class="parameter"><code>max</code></em> is larger than the highest mipmap level for the
126 texture of the specified size, then a GLU error code is returned (see
127 <a class="citerefentry" href="gluErrorString.xml"><span class="citerefentry"><span class="refentrytitle">gluErrorString</span></span></a>) and nothing is loaded.
128 </p><p>
129 For example, if <em class="parameter"><code>level</code></em> is 2 and <em class="parameter"><code>width</code></em> is 16, the
130 following levels are possible:
131 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
132
133 <mml:mrow>
134 <mml:mn>16</mml:mn>
135 <mml:mo>×</mml:mo>
136 <mml:mn>1</mml:mn>
137 </mml:mrow>
138 </mml:math>,
139 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
140
141 <mml:mrow>
142 <mml:mn>8</mml:mn>
143 <mml:mo>×</mml:mo>
144 <mml:mn>1</mml:mn>
145 </mml:mrow>
146 </mml:math>,
147 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
148
149 <mml:mrow>
150 <mml:mn>4</mml:mn>
151 <mml:mo>×</mml:mo>
152 <mml:mn>1</mml:mn>
153 </mml:mrow>
154 </mml:math>,
155 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
156
157 <mml:mrow>
158 <mml:mn>2</mml:mn>
159 <mml:mo>×</mml:mo>
160 <mml:mn>1</mml:mn>
161 </mml:mrow>
162 </mml:math>,
163 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
164
165 <mml:mrow>
166 <mml:mn>1</mml:mn>
167 <mml:mo>×</mml:mo>
168 <mml:mn>1</mml:mn>
169 </mml:mrow>
170 </mml:math>.
171 These correspond
172 to levels 2 through 6 respectively.
173 If <em class="parameter"><code>base</code></em> is 3 and <em class="parameter"><code>max</code></em> is 5, then only mipmap levels
174 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
175
176 <mml:mrow>
177 <mml:mn>8</mml:mn>
178 <mml:mo>×</mml:mo>
179 <mml:mn>1</mml:mn>
180 </mml:mrow>
181 </mml:math>,
182 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
183
184 <mml:mrow>
185 <mml:mn>4</mml:mn>
186 <mml:mo>×</mml:mo>
187 <mml:mn>1</mml:mn>
188 </mml:mrow>
189 </mml:math>
190 and
191 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
192
193 <mml:mrow>
194 <mml:mn>2</mml:mn>
195 <mml:mo>×</mml:mo>
196 <mml:mn>1</mml:mn>
197 </mml:mrow>
198 </mml:math>
199 are
200 loaded. However, if <em class="parameter"><code>max</code></em> is 7, then an error is returned and nothing is
201 loaded since <em class="parameter"><code>max</code></em> is larger than the highest mipmap level which is, in
202 this case, 6.
203 </p><p>
204 The highest mipmap level can be derived from the formula
205 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
206
207 <mml:mrow>
208 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
209 <mml:mn>2</mml:mn>
210 </mml:msub>
211 <mml:mo>⁡</mml:mo>
212 <mml:mfenced open="(" close=")">
213 <mml:mrow>
214 <mml:mi mathvariant="italic">width</mml:mi>
215 <mml:mo>×</mml:mo>
216 <mml:msup><mml:mn>2</mml:mn>
217 <mml:mi mathvariant="italic">level</mml:mi>
218 </mml:msup>
219 </mml:mrow>
220 </mml:mfenced>
221 </mml:mrow>
222 </mml:math>.
223 </p><p>
224 See the <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a> reference page for a description of the
225 acceptable values for <em class="parameter"><code>type</code></em> parameter. See the <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>
226 reference page for a description of the acceptable values
227 for <em class="parameter"><code>level</code></em> parameter.
228 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
229 <code class="function">gluBuild1DMipmapLevels</code> is only available if the GLU version is 1.3 or greater.
230 </p><p>
231 Formats <code class="constant">GLU_BGR</code>, and <code class="constant">GLU_BGRA</code>, and types
232 <code class="constant">GLU_UNSIGNED_BYTE_3_3_2</code>,
233 <code class="constant">GLU_UNSIGNED_BYTE_2_3_3_REV</code>,
234 <code class="constant">GLU_UNSIGNED_SHORT_5_6_5</code>,
235 <code class="constant">GLU_UNSIGNED_SHORT_5_6_5_REV</code>,
236 <code class="constant">GLU_UNSIGNED_SHORT_4_4_4_4</code>,
237 <code class="constant">GLU_UNSIGNED_SHORT_4_4_4_4_REV</code>,
238 <code class="constant">GLU_UNSIGNED_SHORT_5_5_5_1</code>,
239 <code class="constant">GLU_UNSIGNED_SHORT_1_5_5_5_REV</code>,
240 <code class="constant">GLU_UNSIGNED_INT_8_8_8_8</code>,
241 <code class="constant">GLU_UNSIGNED_INT_8_8_8_8_REV</code>,
242 <code class="constant">GLU_UNSIGNED_INT_10_10_10_2</code>, and
243 <code class="constant">GLU_UNSIGNED_INT_2_10_10_10_REV</code> are only available if the GL version
244 is 1.2 or greater.
245 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
246 <code class="constant">GLU_INVALID_VALUE</code> is returned if <em class="parameter"><code>level</code></em> &gt; <em class="parameter"><code>base</code></em>, <em class="parameter"><code>base</code></em> &lt; 0,
247 <em class="parameter"><code>max</code></em> &lt; <em class="parameter"><code>base</code></em> or <em class="parameter"><code>max</code></em> is &gt; the highest mipmap level for <em class="parameter"><code>data</code></em>.
248 </p><p>
249 <code class="constant">GLU_INVALID_VALUE</code> is returned if <em class="parameter"><code>width</code></em> is &lt; 1.
250 </p><p>
251 <code class="constant">GLU_INVALID_ENUM</code> is returned if <em class="parameter"><code>internalFormat</code></em>, <em class="parameter"><code>format</code></em>, or <em class="parameter"><code>type</code></em> are not
252 legal.
253 </p><p>
254 <code class="constant">GLU_INVALID_OPERATION</code> is returned if <em class="parameter"><code>type</code></em> is <code class="constant">GLU_UNSIGNED_BYTE_3_3_2</code> or <code class="constant">GLU_UNSIGNED_BYTE_2_3_3_REV</code>
255 and <em class="parameter"><code>format</code></em> is not <code class="constant">GLU_RGB</code>.
256 </p><p>
257 <code class="constant">GLU_INVALID_OPERATION</code> is returned if <em class="parameter"><code>type</code></em> is <code class="constant">GLU_UNSIGNED_SHORT_5_6_5</code> or <code class="constant">GLU_UNSIGNED_SHORT_5_6_5_REV</code>
258 and <em class="parameter"><code>format</code></em> is not <code class="constant">GLU_RGB</code>.
259 </p><p>
260 <code class="constant">GLU_INVALID_OPERATION</code> is returned if <em class="parameter"><code>type</code></em> is <code class="constant">GLU_UNSIGNED_SHORT_4_4_4_4</code> or <code class="constant">GLU_UNSIGNED_SHORT_4_4_4_4_REV</code>
261 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GLU_RGBA</code> nor <code class="constant">GLU_BGRA</code>.
262 </p><p>
263 <code class="constant">GLU_INVALID_OPERATION</code> is returned if <em class="parameter"><code>type</code></em> is <code class="constant">GLU_UNSIGNED_SHORT_5_5_5_1</code> or <code class="constant">GLU_UNSIGNED_SHORT_1_5_5_5_REV</code>
264 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GLU_RGBA</code> nor <code class="constant">GLU_BGRA</code>.
265 </p><p>
266 <code class="constant">GLU_INVALID_OPERATION</code> is returned if <em class="parameter"><code>type</code></em> is <code class="constant">GLU_UNSIGNED_INT_8_8_8_8</code> or <code class="constant">GLU_UNSIGNED_INT_8_8_8_8_REV</code>
267 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GLU_RGBA</code> nor <code class="constant">GLU_BGRA</code>.
268 </p><p>
269 <code class="constant">GLU_INVALID_OPERATION</code> is returned if <em class="parameter"><code>type</code></em> is <code class="constant">GLU_UNSIGNED_INT_10_10_10_2</code> or <code class="constant">GLU_UNSIGNED_INT_2_10_10_10_REV</code>
270 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GLU_RGBA</code> nor <code class="constant">GLU_BGRA</code>.
271 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
272 <a class="citerefentry" href="gluBuild1DMipmaps.xml"><span class="citerefentry"><span class="refentrytitle">gluBuild1DMipmaps</span></span></a>,
273 <a class="citerefentry" href="gluBuild2DMipmapLevels.xml"><span class="citerefentry"><span class="refentrytitle">gluBuild2DMipmapLevels</span></span></a>,
274 <a class="citerefentry" href="gluBuild2DMipmaps.xml"><span class="citerefentry"><span class="refentrytitle">gluBuild2DMipmaps</span></span></a>,
275 <a class="citerefentry" href="gluBuild3DMipmapLevels.xml"><span class="citerefentry"><span class="refentrytitle">gluBuild3DMipmapLevels</span></span></a>,
276 <a class="citerefentry" href="gluBuild3DMipmaps.xml"><span class="citerefentry"><span class="refentrytitle">gluBuild3DMipmaps</span></span></a>,
277 <a class="citerefentry" href="gluErrorString.xml"><span class="citerefentry"><span class="refentrytitle">gluErrorString</span></span></a>,
278 <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>,
279 <a class="citerefentry" href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a>,
280 <a class="citerefentry" href="glGetTexLevelParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexLevelParameter</span></span></a>,
281 <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>,
282 <a class="citerefentry" href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
283 <a class="citerefentry" href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>
284 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
285 Copyright <span class="trademark"></span>© 1991-2006
286 Silicon Graphics, Inc. This document is licensed under the SGI
287 Free Software B License. For details, see
288 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
289 </p></div></div></body></html>