aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/extras/ogl-sample/main/doc/man/manglu/standard/build2dmipmaplevels.gl
blob: 6c083a454a817b4d2fe47b4077ba2744293caf48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
_C_ License Applicability. Except to the extent portions of this file are
_C_ made subject to an alternative license as permitted in the SGI Free
_C_ Software License B, Version 1.1 (the "License"), the contents of this
_C_ file are subject only to the provisions of the License. You may not use
_C_ this file except in compliance with the License. You may obtain a copy
_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
_C_ 
_C_ http://oss.sgi.com/projects/FreeB
_C_ 
_C_ Note that, as provided in the License, the Software is distributed on an
_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
_C_ 
_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
_C_ Copyright in any portions created by third parties is as indicated
_C_ elsewhere herein. All Rights Reserved.
_C_ 
_C_ Additional Notice Provisions: The application programming interfaces
_C_ established by SGI in conjunction with the Original Code are The
_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
_C_ published by SGI, but has not been independently verified as being
_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
_C_
_C_ $Date: 2004/03/14 08:29:09 $ $Revision: 1.1.1.4 $
_C_ The first character in this file must be an '_'!
_C_ Anything on a line after _C_ is ignored
_define(_filters,eqn)_C_
_C_      eqn is automatically replaced with neqn for nroff
_header(Build2DMipmapLevels, builds a subset of two-dimensional mipmap levels)
_names(Build2DMipmapLevels)
.EQ
delim $$
.EN
.SH PARAMETERS
_phead(_param1)
Specifies the target texture.  Must be _const(TEXTURE_2D).
_phead(_param2)
Requests the internal storage format of the texture image.  The most
current version of the SGI implementation of GLU does not check this
value for validity before passing it on to the underlying OpenGL
implementation.  A value that is not accepted by the OpenGL
implementation will lead to an OpenGL error.  The benefit of not
checking this value at the GLU level is that OpenGL extensions can add
new internal texture formats without requiring a revision of the GLU
implementation.  Older implementations of GLU check this value and
raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
symbolic constants:
_const(ALPHA),
_const(ALPHA4),
_const(ALPHA8),
_const(ALPHA12),
_const(ALPHA16),
_const(LUMINANCE),
_const(LUMINANCE4),
_const(LUMINANCE8),
_const(LUMINANCE12),
_const(LUMINANCE16),
_const(LUMINANCE_ALPHA),
_const(LUMINANCE4_ALPHA4),
_const(LUMINANCE6_ALPHA2),
_const(LUMINANCE8_ALPHA8),
_const(LUMINANCE12_ALPHA4),
_const(LUMINANCE12_ALPHA12),
_const(LUMINANCE16_ALPHA16),
_const(INTENSITY),
_const(INTENSITY4),
_const(INTENSITY8),
_const(INTENSITY12),
_const(INTENSITY16),
_const(RGB),
_const(R3_G3_B2),
_const(RGB4),
_const(RGB5),
_const(RGB8),
_const(RGB10),
_const(RGB12),
_const(RGB16),
_const(RGBA),
_const(RGBA2),
_const(RGBA4),
_const(RGB5_A1),
_const(RGBA8),
_const(RGB10_A2),
_const(RGBA12) or
_const(RGBA16).
_phead(_param3 _param4)
Specifies the width and height, respectively, in pixels of the texture image. 
These should be a power of 2.
_phead(_param5)
Specifies the format of the pixel data.
Must be one of
_const(COLOR_INDEX),
_const(DEPTH_COMPONENT),
_const(RED),
_const(GREEN),
_const(BLUE),
_const(ALPHA),
_const(RGB),
_const(RGBA),
_const(BGR),
_const(BGRA),
_const(LUMINANCE), or
_const(LUMINANCE_ALPHA).
_phead(_param6)
Specifies the data type for _param10.
Must be one of
_const(UNSIGNED_BYTE),
_const(BYTE),
_const(BITMAP),
_const(UNSIGNED_SHORT),
_const(SHORT),
_const(UNSIGNED_INT),
_const(INT), 
_const(FLOAT), 
_const(UNSIGNED_BYTE_3_3_2),
_const(UNSIGNED_BYTE_2_3_3_REV),
_const(UNSIGNED_SHORT_5_6_5),
_const(UNSIGNED_SHORT_5_6_5_REV),
_const(UNSIGNED_SHORT_4_4_4_4),
_const(UNSIGNED_SHORT_4_4_4_4_REV),
_const(UNSIGNED_SHORT_5_5_5_1),
_const(UNSIGNED_SHORT_1_5_5_5_REV),
_const(UNSIGNED_INT_8_8_8_8),
_const(UNSIGNED_INT_8_8_8_8_REV),
_const(UNSIGNED_INT_10_10_10_2) or
_const(UNSIGNED_INT_2_10_10_10_REV).
_phead(_param7)
Specifies the mipmap level of the image data.
_phead(_param8)
Specifies the minimum mipmap level to pass to _glcmnd(TexImage2D).
_phead(_param9)
Specifies the maximum mipmap level to pass to _glcmnd(TexImage2D).
_phead(_param10)
Specifies a pointer to the image data in memory.
.SH DESCRIPTION
_cmnd builds a subset of prefiltered two-dimensional texture maps of decreasing
resolutions called a mipmap. This is used for the antialiasing of
texture mapped primitives.
.P
A return value of zero indicates success, otherwise a GLU error code is
returned (see _cmnd(ErrorString)).
.P
A series of mipmap levels from _param8 to _param9 is built by decimating 
_param10 in half along
both dimensions until size $1 ~times~ 1$ is reached. At each level, each texel in the
halved mipmap level is an average of the corresponding four texels in the larger
mipmap level. (In the case of rectangular images, the decimation will ultimately 
reach an $N ~times~ 1$ or $1 ~times~ N$ configuration. Here, two texels are
averaged instead.)
_glcmnd(TexImage2D) is called to load these mipmap levels from _param8
to _param9. If _param9 is larger than the highest mipmap level for the
texture of the specified size, then a GLU error code is returned (see
_cmnd(ErrorString)) and nothing is loaded.
.P
For example, if _param7 is 2 and _param3 is 16 and _param4 is 8, the
following levels are possible: $16 ~times~ 8$, $8 ~times~ 4$, $4 ~times~ 2$,
$2 ~times~ 1$, $1 ~times~ 1$. These correspond to levels 2 through 6
respectively.  If _param8 is 3 and _param9 is 5, then only mipmap levels
$8 ~times~ 4$, $4 ~times~ 2$ and $2 ~times~ 1$ are loaded. However, if _param9
is 7 then an error is returned and nothing is loaded since _param9 is
larger than the highest mipmap level which is, in this case, 6.
.P
The highest mipmap level can be derived from the formula
log2(max(_param3,_param4)*(2^_param7)).
.P
See the _glcmnd(TexImage1D) reference page for a description of the
acceptable values for _param5 parameter. See the _glcmnd(DrawPixels) 
reference page for a description of the acceptable values 
for _param6 parameter.
.SH NOTES
_cmnd is only available if the GLU version is 1.3 or greater.
.P
Formats _const(BGR), and _const(BGRA), and types 
_const(UNSIGNED_BYTE_3_3_2),
_const(UNSIGNED_BYTE_2_3_3_REV),
_const(UNSIGNED_SHORT_5_6_5),
_const(UNSIGNED_SHORT_5_6_5_REV),
_const(UNSIGNED_SHORT_4_4_4_4),
_const(UNSIGNED_SHORT_4_4_4_4_REV),
_const(UNSIGNED_SHORT_5_5_5_1),
_const(UNSIGNED_SHORT_1_5_5_5_REV),
_const(UNSIGNED_INT_8_8_8_8),
_const(UNSIGNED_INT_8_8_8_8_REV),
_const(UNSIGNED_INT_10_10_10_2), and
_const(UNSIGNED_INT_2_10_10_10_REV) are only available if the GL version 
is 1.2 or greater.
.SH ERRORS
_gluconst(INVALID_VALUE) is returned if _param7 > _param8, _param8 < 0,
_param9 < _param8 or _param9 is > the highest mipmap level for _param10.
.P
_gluconst(INVALID_VALUE) is returned if _param3 or _param4 is < 1.
.P
_gluconst(INVALID_ENUM) is returned if _param2, _param5, or _param6 is not 
legal.
.P
_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_BYTE_3_3_2) or _const(UNSIGNED_BYTE_2_3_3_REV)
and _param5 is not _const(RGB).
.P
_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_SHORT_5_6_5) or _const(UNSIGNED_SHORT_5_6_5_REV)
and _param5 is not _const(RGB).
.P
_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_SHORT_4_4_4_4) or _const(UNSIGNED_SHORT_4_4_4_4_REV)
and _param5 is neither _const(RGBA) nor _const(BGRA).
.P
_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_SHORT_5_5_5_1) or _const(UNSIGNED_SHORT_1_5_5_5_REV)
and _param5 is neither _const(RGBA) nor _const(BGRA).
.P
_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_INT_8_8_8_8) or _const(UNSIGNED_INT_8_8_8_8_REV)
and _param5 is neither _const(RGBA) nor _const(BGRA).
.P
_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_INT_10_10_10_2) or _const(UNSIGNED_INT_2_10_10_10_REV)
and _param5 is neither _const(RGBA) nor _const(BGRA).
.SH SEE ALSO
_glcmnd(DrawPixels),
_glcmnd(TexImage1D),
_glcmnd(TexImage2D), 
_glcmnd(TexImage3D),
_cmnd(Build1DMipmaps),
_cmnd(Build2DMipmaps),
_cmnd(Build3DMipmaps), 
_cmnd(ErrorString), 
_glcmnd(GetTexImage),
_glcmnd(GetTexLevelParameter),
_cmnd(Build1DMipmapLevels),
_cmnd(Build3DMipmapLevels)