~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/extras/ogl-sample/main/doc/man/manglu/standard/build1dmipmaps.gl

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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:
 
8
_C_ 
 
9
_C_ http://oss.sgi.com/projects/FreeB
 
10
_C_ 
 
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.
 
16
_C_ 
 
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.
 
22
_C_ 
 
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.
 
32
_C_
 
33
_C_ $Date$ $Revision$
 
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)
 
40
.EQ
 
41
delim $$
 
42
.EN
 
43
.SH PARAMETERS
 
44
_phead(_param1)
 
45
Specifies the target texture.  Must be _const(TEXTURE_1D).
 
46
_phead(_param2)
 
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
 
56
symbolic constants:
 
57
_const(ALPHA),
 
58
_const(ALPHA4),
 
59
_const(ALPHA8),
 
60
_const(ALPHA12),
 
61
_const(ALPHA16),
 
62
_const(LUMINANCE),
 
63
_const(LUMINANCE4),
 
64
_const(LUMINANCE8),
 
65
_const(LUMINANCE12),
 
66
_const(LUMINANCE16),
 
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),
 
74
_const(INTENSITY),
 
75
_const(INTENSITY4),
 
76
_const(INTENSITY8),
 
77
_const(INTENSITY12),
 
78
_const(INTENSITY16),
 
79
_const(RGB),
 
80
_const(R3_G3_B2),
 
81
_const(RGB4),
 
82
_const(RGB5),
 
83
_const(RGB8),
 
84
_const(RGB10),
 
85
_const(RGB12),
 
86
_const(RGB16),
 
87
_const(RGBA),
 
88
_const(RGBA2),
 
89
_const(RGBA4),
 
90
_const(RGB5_A1),
 
91
_const(RGBA8),
 
92
_const(RGB10_A2),
 
93
_const(RGBA12), or
 
94
_const(RGBA16).
 
95
_phead(_param3)
 
96
Specifies the width, in pixels, of the texture image. 
 
97
_phead(_param4)
 
98
Specifies the format of the pixel data.
 
99
Must be one of
 
100
_const(COLOR_INDEX),
 
101
_const(DEPTH_COMPONENT),
 
102
_const(RED),
 
103
_const(GREEN),
 
104
_const(BLUE),
 
105
_const(ALPHA),
 
106
_const(RGB),
 
107
_const(RGBA),
 
108
_const(BGR),
 
109
_const(BGRA),
 
110
_const(LUMINANCE), 
 
111
_const(LUMINANCE_ALPHA).
 
112
_phead(_param5)
 
113
Specifies the data type for _param6.
 
114
Must be one of
 
115
_const(UNSIGNED_BYTE),
 
116
_const(BYTE),
 
117
_const(BITMAP),
 
118
_const(UNSIGNED_SHORT),
 
119
_const(SHORT),
 
120
_const(UNSIGNED_INT),
 
121
_const(INT), 
 
122
_const(FLOAT), 
 
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).
 
135
_phead(_param6)
 
136
Specifies a pointer to the image data in memory.
 
137
.SH DESCRIPTION
 
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.
 
141
.P
 
142
A return value of zero indicates success, otherwise a GLU error code is
 
143
returned (see _cmnd(ErrorString)).
 
144
.P
 
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
 
152
takes place.
 
153
.P
 
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.
 
157
.P
 
158
Next, a series of mipmap levels is built by decimating a copy of
 
159
_param6 in half
 
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
 
162
mipmap level.
 
163
.P
 
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.
 
172
.P
 
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.
 
177
.SH NOTES
 
178
Note that there is no direct way of querying the maximum level. This can
 
179
be derived indirectly via _glcmnd(GetTexLevelParameter). First, query
 
180
for the
 
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.)
 
184
Then the maximum
 
185
level can be derived from the formula ${log sub 2}(_param3)$.
 
186
.P
 
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.
 
201
.SH ERRORS
 
202
_gluconst(INVALID_VALUE) is returned if _param3 is < 1.
 
203
.P
 
204
_gluconst(INVALID_ENUM) is returned if _param4 or _param5 are not legal.
 
205
.P
 
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).
 
208
.P
 
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).
 
211
.P
 
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).
 
214
.P
 
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).
 
217
.P
 
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).
 
220
.P
 
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).
 
223
.SH SEE ALSO
 
224
_glcmnd(DrawPixels),
 
225
_glcmnd(TexImage1D),
 
226
_glcmnd(TexImage2D), 
 
227
_glcmnd(TexImage3D),
 
228
_cmnd(Build2DMipmaps),
 
229
_cmnd(Build3DMipmaps),
 
230
_cmnd(ErrorString), 
 
231
_glcmnd(GetTexImage),
 
232
_glcmnd(GetTexLevelParameter), 
 
233
_cmnd(Build1DMipmapLevels),
 
234
_cmnd(Build2DMipmapLevels), 
 
235
_cmnd(Build3DMipmapLevels)