1
_C_ License Applicability. Except to the extent portions of this file are
2
_C_ made subject to an alternative license as permitted in the SGI Free
3
_C_ Software License B, Version 1.1 (the "License"), the contents of this
4
_C_ file are subject only to the provisions of the License. You may not use
5
_C_ this file except in compliance with the License. You may obtain a copy
6
_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
7
_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
9
_C_ http://oss.sgi.com/projects/FreeB
11
_C_ Note that, as provided in the License, the Software is distributed on an
12
_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
13
_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
14
_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
15
_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
17
_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
18
_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
19
_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
20
_C_ Copyright in any portions created by third parties is as indicated
21
_C_ elsewhere herein. All Rights Reserved.
23
_C_ Additional Notice Provisions: The application programming interfaces
24
_C_ established by SGI in conjunction with the Original Code are The
25
_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
26
_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
27
_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
28
_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
29
_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
30
_C_ published by SGI, but has not been independently verified as being
31
_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
34
_C_ The first character in this file must be an '_'!
35
_C_ Anything on a line after _C_ is ignored
36
_define(_filters,eqn)_C_
37
_C_ eqn is automatically replaced with neqn for nroff
38
_header(Build1DMipmaps, builds a one-dimensional mipmap)
39
_names(Build1DMipmaps)
45
Specifies the target texture. Must be _const(TEXTURE_1D).
47
Requests the internal storage format of the texture image. The most
48
current version of the SGI implementation of GLU does not check this
49
value for validity before passing it on to the underlying OpenGL
50
implementation. A value that is not accepted by the OpenGL
51
implementation will lead to an OpenGL error. The benefit of not
52
checking this value at the GLU level is that OpenGL extensions can add
53
new internal texture formats without requiring a revision of the GLU
54
implementation. Older implementations of GLU check this value and
55
raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
67
_const(LUMINANCE_ALPHA),
68
_const(LUMINANCE4_ALPHA4),
69
_const(LUMINANCE6_ALPHA2),
70
_const(LUMINANCE8_ALPHA8),
71
_const(LUMINANCE12_ALPHA4),
72
_const(LUMINANCE12_ALPHA12),
73
_const(LUMINANCE16_ALPHA16),
96
Specifies the width, in pixels, of the texture image.
98
Specifies the format of the pixel data.
101
_const(DEPTH_COMPONENT),
111
_const(LUMINANCE_ALPHA).
113
Specifies the data type for _param6.
115
_const(UNSIGNED_BYTE),
118
_const(UNSIGNED_SHORT),
120
_const(UNSIGNED_INT),
123
_const(UNSIGNED_BYTE_3_3_2),
124
_const(UNSIGNED_BYTE_2_3_3_REV),
125
_const(UNSIGNED_SHORT_5_6_5),
126
_const(UNSIGNED_SHORT_5_6_5_REV),
127
_const(UNSIGNED_SHORT_4_4_4_4),
128
_const(UNSIGNED_SHORT_4_4_4_4_REV),
129
_const(UNSIGNED_SHORT_5_5_5_1),
130
_const(UNSIGNED_SHORT_1_5_5_5_REV),
131
_const(UNSIGNED_INT_8_8_8_8),
132
_const(UNSIGNED_INT_8_8_8_8_REV),
133
_const(UNSIGNED_INT_10_10_10_2), or
134
_const(UNSIGNED_INT_2_10_10_10_REV).
136
Specifies a pointer to the image data in memory.
138
_cmnd builds a series of prefiltered one-dimensional texture maps of decreasing
139
resolutions called a mipmap. This is used for the antialiasing of
140
texture mapped primitives.
142
A return value of zero indicates success, otherwise a GLU error code is
143
returned (see _cmnd(ErrorString)).
145
Initially, the _param3 of _param6 is checked to see if it is
146
a power of 2. If not, a copy of _param6 is scaled up or down to the
147
nearest power of 2. (If _param3 is exactly between powers of 2, then
148
the copy of _param6 will scale upwards.) This copy will be used for
149
subsequent mipmapping operations described below.
150
For example, if _param3 is 57 then a copy of _param6
151
will scale up to 64 before mipmapping
154
Then, proxy textures (see _glcmnd(TexImage1D)) are used to determine if
155
the implementation can fit the requested texture. If not, _param3 is
156
continually halved until it fits.
158
Next, a series of mipmap levels is built by decimating a copy of
160
until size $1 ~times~ 1$ is reached. At each level, each texel in the
161
halved mipmap level is an average of the corresponding two texels in the larger
164
_glcmnd(TexImage1D) is called to load each of these mipmap levels.
165
Level 0 is a copy of _param6.
166
The highest level is ${log sub 2}(_param3)$.
167
For example, if _param3 is 64 and the implementation can store a texture of
168
this size, the following mipmap levels are
169
built: $64 ~times~ 1$, $32 ~times~ 1$, $16 ~times~ 1$, $8 ~times~ 1$,
170
$4 ~times~ 1$, $2 ~times~ 1$ and $1 ~times~ 1$. These correspond to
171
levels 0 through 6, respectively.
173
See the _glcmnd(TexImage1D) reference page for a description of the
174
acceptable values for the _param5 parameter. See the _glcmnd(DrawPixels)
175
reference page for a description of the acceptable values
176
for the _param6 parameter.
178
Note that there is no direct way of querying the maximum level. This can
179
be derived indirectly via _glcmnd(GetTexLevelParameter). First, query
181
width actually used at level 0.
182
(The width may not be equal to _param3 since
183
proxy textures might have scaled it to fit the implementation.)
185
level can be derived from the formula ${log sub 2}(_param3)$.
187
Formats _const(BGR), and _const(BGRA), and types
188
_const(UNSIGNED_BYTE_3_3_2),
189
_const(UNSIGNED_BYTE_2_3_3_REV),
190
_const(UNSIGNED_SHORT_5_6_5),
191
_const(UNSIGNED_SHORT_5_6_5_REV),
192
_const(UNSIGNED_SHORT_4_4_4_4),
193
_const(UNSIGNED_SHORT_4_4_4_4_REV),
194
_const(UNSIGNED_SHORT_5_5_5_1),
195
_const(UNSIGNED_SHORT_1_5_5_5_REV),
196
_const(UNSIGNED_INT_8_8_8_8),
197
_const(UNSIGNED_INT_8_8_8_8_REV),
198
_const(UNSIGNED_INT_10_10_10_2), and
199
_const(UNSIGNED_INT_2_10_10_10_REV) are only available if the GL version
200
is 1.2 or greater, and if the GLU version is 1.3 or greater.
202
_gluconst(INVALID_VALUE) is returned if _param3 is < 1.
204
_gluconst(INVALID_ENUM) is returned if _param4 or _param5 are not legal.
206
_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_BYTE_3_3_2) or _const(UNSIGNED_BYTE_2_3_3_REV)
207
and _param4 is not _const(RGB).
209
_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_SHORT_5_6_5) or _const(UNSIGNED_SHORT_5_6_5_REV)
210
and _param4 is not _const(RGB).
212
_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_SHORT_4_4_4_4) or _const(UNSIGNED_SHORT_4_4_4_4_REV)
213
and _param4 is neither _const(RGBA) nor _const(BGRA).
215
_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_SHORT_5_5_5_1) or _const(UNSIGNED_SHORT_1_5_5_5_REV)
216
and _param4 is neither _const(RGBA) nor _const(BGRA).
218
_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_INT_8_8_8_8) or _const(UNSIGNED_INT_8_8_8_8_REV)
219
and _param4 is neither _const(RGBA) nor _const(BGRA).
221
_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_INT_10_10_10_2) or _const(UNSIGNED_INT_2_10_10_10_REV)
222
and _param4 is neither _const(RGBA) nor _const(BGRA).
228
_cmnd(Build2DMipmaps),
229
_cmnd(Build3DMipmaps),
231
_glcmnd(GetTexImage),
232
_glcmnd(GetTexLevelParameter),
233
_cmnd(Build1DMipmapLevels),
234
_cmnd(Build2DMipmapLevels),
235
_cmnd(Build3DMipmapLevels)