File: getteximage.3gl

package info (click to toggle)
vnc4 4.1.1%2BX4.3.0-37
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 171,636 kB
  • ctags: 288,245
  • sloc: ansic: 2,205,268; cpp: 56,345; sh: 38,092; pascal: 13,773; asm: 12,656; tcl: 9,182; lisp: 7,831; perl: 3,364; makefile: 2,957; yacc: 2,902; objc: 2,698; xml: 2,614; python: 2,383; lex: 1,477; awk: 901; csh: 58; sed: 50
file content (209 lines) | stat: -rw-r--r-- 7,005 bytes parent folder | download | duplicates (6)
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
'\" e
'\"! eqn | mmdoc
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp Jan 14 18:30
.ds Dm 01 gettexima
.ds Xs 2939 8 getteximage.gl
.TH GLGETTEXIMAGE 3G
.SH NAME
.B "glGetTexImage
\- return a texture image

.SH C SPECIFICATION
void \f3glGetTexImage\fP(
GLenum \fItarget\fP,
.nf
.ta \w'\f3void \fPglGetTexImage( 'u
	GLint \fIlevel\fP,
	GLenum \fIformat\fP,
	GLenum \fItype\fP,
	GLvoid \fI*pixels\fP )
.fi

.EQ
delim $$
.EN
.SH PARAMETERS
.TP \w'\f2target\fP\ \ 'u 
\f2target\fP
Specifies which texture is to be obtained.
\%\f3GL_TEXTURE_1D\fP, \%\f3GL_TEXTURE_2D\fP, and \%\f3GL_TEXTURE_3D\fP  are accepted.
.TP
\f2level\fP
Specifies the level-of-detail number of the desired image.
Level 0 is the base image level.
Level $n$ is the $n$th mipmap reduction image.
.TP
\f2format\fP
Specifies a pixel  for the returned data.
The supported formats are
\%\f3GL_RED\fP,
\%\f3GL_GREEN\fP,
\%\f3GL_BLUE\fP,
\%\f3GL_ALPHA\fP,
\%\f3GL_RGB\fP,
\%\f3GL_BGR\fP,
\%\f3GL_RGBA\fP,
\%\f3GL_BGRA\fP,
\%\f3GL_LUMINANCE\fP, and
\%\f3GL_LUMINANCE_ALPHA\fP.
.TP
\f2type\fP
Specifies a pixel type for the returned data.
The supported types are
\%\f3GL_UNSIGNED_BYTE\fP,
\%\f3GL_BYTE\fP,
\%\f3GL_UNSIGNED_SHORT\fP,
\%\f3GL_SHORT\fP,
\%\f3GL_UNSIGNED_INT\fP,
\%\f3GL_INT\fP,
\%\f3GL_FLOAT\fP,
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, and
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP.
.TP
\f2pixels\fP
Returns the texture image.
Should be a pointer to an array of the type specified by \f2type\fP.
.SH DESCRIPTION
\%\f3glGetTexImage\fP returns a texture image into \f2pixels\fP.
\f2target\fP specifies whether the desired texture image is one specified by
\%\f3glTexImage1D\fP (\%\f3GL_TEXTURE_1D\fP),
\%\f3glTexImage2D\fP (\%\f3GL_TEXTURE_2D\fP), or
\%\f3glTexImage3D\fP (\%\f3GL_TEXTURE_3D\fP).
\f2level\fP specifies the level-of-detail number of the desired image.
\f2format\fP and \f2type\fP specify the  and type of the desired image array.
See the reference pages \%\f3glTexImage1D\fP and \%\f3glDrawPixels\fP
for a description of the acceptable values for the \f2format\fP and \f2type\fP
parameters, respectively.
.P
To understand the operation of \%\f3glGetTexImage\fP, consider the selected internal
four-component texture image to be an RGBA color buffer the size of the image.
The semantics of \%\f3glGetTexImage\fP are then identical to those of \%\f3glReadPixels\fP,
with the exception that no pixel transfer operations are performed,
when called with the same \f2format\fP and \f2type\fP,
with \f2x\fP and \f2y\fP set to 0,
\f2width\fP set to the width of the texture image
(including border if one was specified),
and \f2height\fP set to 1 for 1D images,
or to the height of the texture image
(including border if one was specified)
for 2D images.
.BP
Because the internal texture image is an RGBA image,
pixel formats \%\f3GL_COLOR_INDEX\fP,
\%\f3GL_STENCIL_INDEX\fP,
and \%\f3GL_DEPTH_COMPONENT\fP are not accepted,
and pixel type \%\f3GL_BITMAP\fP is not accepted.
.P
If the selected texture image does not contain four components,
the following mappings are applied.
Single-component textures are treated as RGBA buffers with red set
to the single-component value,
green set to 0,  blue set to 0, and alpha set to 1.
Two-component textures are treated as RGBA buffers with red set to
the value of component zero,
alpha set to the value of component one,
and green and blue set to 0.
Finally,
three-component textures are treated as RGBA buffers with red set to
component zero,
green set to component one,
blue set to component two,
and alpha set to 1.
.P
To determine the required size of \f2pixels\fP,
use \%\f3glGetTexLevelParameter\fP to determine the dimensions of the
internal texture image,
then scale the required number of pixels by the storage required for
each pixel,
based on \f2format\fP and \f2type\fP.
Be sure to take the pixel storage parameters into account,
especially \%\f3GL_PACK_ALIGNMENT\fP.
.SH NOTES
If an error is generated,
no change is made to the contents of \f2pixels\fP.
.P
When the \%\f3GL_ARB_multitexture\fP extension is supported, \%\f3glGetTexImage\fP returns
the texture image for the active texture unit.
.P
The types \%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, 
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP, 
and the formats
\%\f3GL_BGR\fP, and \%\f3GL_BGRA\fP are available only if the GL version is
1.2 or greater.
.SH ERRORS
\%\f3GL_INVALID_ENUM\fP is generated if \f2target\fP, \f2format\fP, or \f2type\fP is not
an accepted value.
.P
\%\f3GL_INVALID_VALUE\fP is generated if \f2level\fP is less than 0.
.P 
\%\f3GL_INVALID_VALUE\fP may be generated if \f2level\fP is greater
than $log sub 2 max$,
where $max$ is the returned value of \%\f3GL_MAX_TEXTURE_SIZE\fP.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glGetTexImage\fP
is executed between the execution of \%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.P
\%\f3GL_INVALID_OPERATION\fP is returned if \f2type\fP is one of
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP, or
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP and \f2format\fP is not \%\f3GL_RGB\fP.
.P
\%\f3GL_INVALID_OPERATION\fP is returned if \f2type\fP is one of
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, or
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP, and \f2format\fP is neither \%\f3GL_RGBA\fP 
or \%\f3GL_BGRA\fP.
.SH ASSOCIATED GETS
\%\f3glGetTexLevelParameter\fP with argument \%\f3GL_TEXTURE_WIDTH\fP
.br
\%\f3glGetTexLevelParameter\fP with argument \%\f3GL_TEXTURE_HEIGHT\fP
.br
\%\f3glGetTexLevelParameter\fP with argument \%\f3GL_TEXTURE_BORDER\fP
.br
\%\f3glGetTexLevelParameter\fP with argument \%\f3GL_TEXTURE_INTERNALFORMAT\fP
.br
\%\f3glGet\fP with arguments \%\f3GL_PACK_ALIGNMENT\fP and others
.SH SEE ALSO
\%\f3glActiveTextureARB(3G)\fP,
\%\f3glDrawPixels(3G)\fP,
\%\f3glReadPixels(3G)\fP,
\%\f3glTexEnv(3G)\fP,
\%\f3glTexGen(3G)\fP,
\%\f3glTexImage1D(3G)\fP,
\%\f3glTexImage2D(3G)\fP,
\%\f3glTexImage3D(3G)\fP,
\%\f3glTexSubImage1D(3G)\fP,
\%\f3glTexSubImage2D(3G)\fP,
\%\f3glTexSubImage3D(3G)\fP,
\%\f3glTexParameter(3G)\fP