Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> | |
3 | <!-- saved from url=(0013)about:internet --> | |
4 | <?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" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glPixelStore - OpenGL 4 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glPixelStore"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glPixelStore — set pixel storage modes</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">void <b class="fsfunc">glPixelStoref</b>(</code></td><td>GLenum </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLfloat </td><td><var class="pdparam">param</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glPixelStorei</b>(</code></td><td>GLenum </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">param</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>pname</code></em></span></dt><dd><p> | |
5 | Specifies the symbolic name of the parameter to be set. | |
6 | Six values affect the packing of pixel data into memory: | |
7 | <code class="constant">GL_PACK_SWAP_BYTES</code>, | |
8 | <code class="constant">GL_PACK_LSB_FIRST</code>, | |
9 | <code class="constant">GL_PACK_ROW_LENGTH</code>, | |
10 | <code class="constant">GL_PACK_IMAGE_HEIGHT</code>, | |
11 | <code class="constant">GL_PACK_SKIP_PIXELS</code>, | |
12 | <code class="constant">GL_PACK_SKIP_ROWS</code>, | |
13 | <code class="constant">GL_PACK_SKIP_IMAGES</code>, and | |
14 | <code class="constant">GL_PACK_ALIGNMENT</code>. | |
15 | Six more affect the unpacking of pixel data <span class="emphasis"><em>from</em></span> memory: | |
16 | <code class="constant">GL_UNPACK_SWAP_BYTES</code>, | |
17 | <code class="constant">GL_UNPACK_LSB_FIRST</code>, | |
18 | <code class="constant">GL_UNPACK_ROW_LENGTH</code>, | |
19 | <code class="constant">GL_UNPACK_IMAGE_HEIGHT</code>, | |
20 | <code class="constant">GL_UNPACK_SKIP_PIXELS</code>, | |
21 | <code class="constant">GL_UNPACK_SKIP_ROWS</code>, | |
22 | <code class="constant">GL_UNPACK_SKIP_IMAGES</code>, and | |
23 | <code class="constant">GL_UNPACK_ALIGNMENT</code>. | |
24 | </p></dd><dt><span class="term"><em class="parameter"><code>param</code></em></span></dt><dd><p> | |
25 | Specifies the value that <em class="parameter"><code>pname</code></em> is set to. | |
26 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
27 | <code class="function">glPixelStore</code> sets pixel storage modes that affect the operation of subsequent | |
28 | <a href="glReadPixels.xml"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a> as well as the unpacking of | |
29 | texture patterns (see <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
30 | <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>, <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>, | |
31 | <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>, <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>), | |
32 | <a href="glCompressedTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage1D</span></span></a>, <a href="glCompressedTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage2D</span></span></a>, | |
33 | <a href="glCompressedTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage3D</span></span></a>, <a href="glCompressedTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage1D</span></span></a>, | |
34 | <a href="glCompressedTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage2D</span></span></a> or <a href="glCompressedTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage1D</span></span></a>. | |
35 | </p><p> | |
36 | <em class="parameter"><code>pname</code></em> is a symbolic constant indicating the parameter to be set, and | |
37 | <em class="parameter"><code>param</code></em> is the new value. Six of the twelve storage parameters affect | |
38 | how pixel data is returned to client memory. | |
39 | They are as follows: | |
40 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_PACK_SWAP_BYTES</code></span></dt><dd><p> | |
41 | If true, | |
42 | byte ordering for multibyte color components, | |
43 | depth components, | |
44 | or stencil indices | |
45 | is reversed. | |
46 | That is, | |
47 | if a four-byte component consists of bytes | |
48 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
49 | ||
50 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
51 | <mml:mn>0</mml:mn> | |
52 | </mml:msub> | |
53 | </mml:math>, | |
54 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
55 | ||
56 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
57 | <mml:mn>1</mml:mn> | |
58 | </mml:msub> | |
59 | </mml:math>, | |
60 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
61 | ||
62 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
63 | <mml:mn>2</mml:mn> | |
64 | </mml:msub> | |
65 | </mml:math>, | |
66 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
67 | ||
68 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
69 | <mml:mn>3</mml:mn> | |
70 | </mml:msub> | |
71 | </mml:math>, | |
72 | it is stored in memory as | |
73 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
74 | ||
75 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
76 | <mml:mn>3</mml:mn> | |
77 | </mml:msub> | |
78 | </mml:math>, | |
79 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
80 | ||
81 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
82 | <mml:mn>2</mml:mn> | |
83 | </mml:msub> | |
84 | </mml:math>, | |
85 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
86 | ||
87 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
88 | <mml:mn>1</mml:mn> | |
89 | </mml:msub> | |
90 | </mml:math>, | |
91 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
92 | ||
93 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
94 | <mml:mn>0</mml:mn> | |
95 | </mml:msub> | |
96 | </mml:math> | |
97 | if <code class="constant">GL_PACK_SWAP_BYTES</code> is true. | |
98 | <code class="constant">GL_PACK_SWAP_BYTES</code> has no effect on the memory order of components | |
99 | within a pixel, | |
100 | only on the order of bytes within components or indices. | |
101 | For example, | |
102 | the three components of a <code class="constant">GL_RGB</code> format pixel are always stored with | |
103 | red first, | |
104 | green second, | |
105 | and blue third, | |
106 | regardless of the value of <code class="constant">GL_PACK_SWAP_BYTES</code>. | |
107 | </p></dd><dt><span class="term"><code class="constant">GL_PACK_LSB_FIRST</code></span></dt><dd><p> | |
108 | If true, | |
109 | bits are ordered within a byte from least significant to most significant; | |
110 | otherwise, | |
111 | the first bit in each byte is the most significant one. | |
112 | </p></dd><dt><span class="term"><code class="constant">GL_PACK_ROW_LENGTH</code></span></dt><dd><p> | |
113 | If greater than 0, | |
114 | <code class="constant">GL_PACK_ROW_LENGTH</code> defines the number of pixels in a row. | |
115 | If the first pixel of a row is placed at location | |
116 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">p</mml:mi></mml:math> | |
117 | in memory, | |
118 | then the location of the first pixel of the next row is obtained by skipping | |
119 | </p><p> | |
120 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
121 | ||
122 | <mml:mrow> | |
123 | <mml:mi mathvariant="italic">k</mml:mi> | |
124 | <mml:mo>=</mml:mo> | |
125 | <mml:mfenced open="{" close=""> | |
126 | <mml:mrow> | |
127 | <mml:mtable> | |
128 | <mml:mtr><mml:mtd> | |
129 | <mml:mrow> | |
130 | <mml:mi mathvariant="italic">n</mml:mi> | |
131 | <mml:mo></mml:mo> | |
132 | <mml:mi mathvariant="italic">l</mml:mi> | |
133 | </mml:mrow> | |
134 | </mml:mtd></mml:mtr> | |
135 | <mml:mtr><mml:mtd> | |
136 | <mml:mrow> | |
137 | <mml:mfenced open="" close=""> | |
138 | <mml:mfrac> | |
139 | <mml:mi mathvariant="italic">a</mml:mi> | |
140 | <mml:mi mathvariant="italic">s</mml:mi> | |
141 | </mml:mfrac> | |
142 | </mml:mfenced> | |
143 | <mml:mo></mml:mo> | |
144 | <mml:mfenced open="⌈" close="⌉"> | |
145 | <mml:mfrac> | |
146 | <mml:mfenced open="" close=""> | |
147 | <mml:mrow> | |
148 | <mml:mi mathvariant="italic">s</mml:mi> | |
149 | <mml:mo></mml:mo> | |
150 | <mml:mi mathvariant="italic">n</mml:mi> | |
151 | <mml:mo></mml:mo> | |
152 | <mml:mi mathvariant="italic">l</mml:mi> | |
153 | </mml:mrow> | |
154 | </mml:mfenced> | |
155 | <mml:mi mathvariant="italic">a</mml:mi> | |
156 | </mml:mfrac> | |
157 | </mml:mfenced> | |
158 | </mml:mrow> | |
159 | </mml:mtd></mml:mtr> | |
160 | </mml:mtable> | |
161 | <mml:mo></mml:mo> | |
162 | <mml:mtable> | |
163 | <mml:mtr><mml:mtd> | |
164 | <mml:mrow> | |
165 | <mml:mi mathvariant="italic">s</mml:mi> | |
166 | <mml:mo>>=</mml:mo> | |
167 | <mml:mi mathvariant="italic">a</mml:mi> | |
168 | </mml:mrow> | |
169 | </mml:mtd></mml:mtr> | |
170 | <mml:mtr><mml:mtd> | |
171 | <mml:mrow> | |
172 | <mml:mi mathvariant="italic">s</mml:mi> | |
173 | <mml:mo><</mml:mo> | |
174 | <mml:mi mathvariant="italic">a</mml:mi> | |
175 | </mml:mrow> | |
176 | </mml:mtd></mml:mtr> | |
177 | </mml:mtable> | |
178 | </mml:mrow> | |
179 | </mml:mfenced> | |
180 | </mml:mrow> | |
181 | </mml:math></div><p> | |
182 | </p><p> | |
183 | components or indices, | |
184 | where | |
185 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
186 | is the number of components or indices in a pixel, | |
187 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">l</mml:mi></mml:math> | |
188 | is the number of pixels in a row | |
189 | (<code class="constant">GL_PACK_ROW_LENGTH</code> if it is greater than 0, | |
190 | the | |
191 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">width</mml:mi></mml:math> | |
192 | argument to the pixel routine otherwise), | |
193 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">a</mml:mi></mml:math> | |
194 | is the value of <code class="constant">GL_PACK_ALIGNMENT</code>, and | |
195 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math> | |
196 | is the size, in bytes, of a single component | |
197 | (if | |
198 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
199 | ||
200 | <mml:mrow> | |
201 | <mml:mi mathvariant="italic">a</mml:mi> | |
202 | <mml:mo><</mml:mo> | |
203 | <mml:mi mathvariant="italic">s</mml:mi> | |
204 | </mml:mrow> | |
205 | </mml:math>, | |
206 | then it is as if | |
207 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
208 | ||
209 | <mml:mrow> | |
210 | <mml:mi mathvariant="italic">a</mml:mi> | |
211 | <mml:mo>=</mml:mo> | |
212 | <mml:mi mathvariant="italic">s</mml:mi> | |
213 | </mml:mrow> | |
214 | </mml:math>). | |
215 | In the case of 1-bit values, | |
216 | the location of the next row is obtained by skipping | |
217 | </p><p> | |
218 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
219 | ||
220 | <mml:mrow> | |
221 | <mml:mi mathvariant="italic">k</mml:mi> | |
222 | <mml:mo>=</mml:mo> | |
223 | <mml:mrow> | |
224 | <mml:mn>8</mml:mn> | |
225 | <mml:mo></mml:mo> | |
226 | <mml:mi mathvariant="italic">a</mml:mi> | |
227 | <mml:mo></mml:mo> | |
228 | <mml:mfenced open="⌈" close="⌉"> | |
229 | <mml:mfrac> | |
230 | <mml:mfenced open="" close=""> | |
231 | <mml:mrow> | |
232 | <mml:mi mathvariant="italic">n</mml:mi> | |
233 | <mml:mo></mml:mo> | |
234 | <mml:mi mathvariant="italic">l</mml:mi> | |
235 | </mml:mrow> | |
236 | </mml:mfenced> | |
237 | <mml:mfenced open="" close=""> | |
238 | <mml:mrow> | |
239 | <mml:mn>8</mml:mn> | |
240 | <mml:mo></mml:mo> | |
241 | <mml:mi mathvariant="italic">a</mml:mi> | |
242 | </mml:mrow> | |
243 | </mml:mfenced> | |
244 | </mml:mfrac> | |
245 | </mml:mfenced> | |
246 | </mml:mrow> | |
247 | </mml:mrow> | |
248 | </mml:math> | |
249 | </p><p> | |
250 | components or indices. | |
251 | </p><p> | |
252 | The word <span class="emphasis"><em>component</em></span> in this description refers to the nonindex values | |
253 | red, | |
254 | green, | |
255 | blue, | |
256 | alpha, | |
257 | and depth. | |
258 | Storage format <code class="constant">GL_RGB</code>, | |
259 | for example, | |
260 | has three components per pixel: | |
261 | first red, | |
262 | then green, | |
263 | and finally blue. | |
264 | </p></dd><dt><span class="term"><code class="constant">GL_PACK_IMAGE_HEIGHT</code></span></dt><dd><p> | |
265 | If greater than 0, | |
266 | <code class="constant">GL_PACK_IMAGE_HEIGHT</code> defines the number of pixels in an image | |
267 | three-dimensional texture volume, where ``image'' is defined by all pixels | |
268 | sharing the same third dimension index. | |
269 | If the first pixel of a row is placed at location | |
270 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">p</mml:mi></mml:math> | |
271 | in memory, | |
272 | then the location of the first pixel of the next row is obtained by skipping | |
273 | </p><p> | |
274 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
275 | ||
276 | <mml:mrow> | |
277 | <mml:mi mathvariant="italic">k</mml:mi> | |
278 | <mml:mo>=</mml:mo> | |
279 | <mml:mfenced open="{" close=""> | |
280 | <mml:mrow> | |
281 | <mml:mtable> | |
282 | <mml:mtr><mml:mtd> | |
283 | <mml:mrow> | |
284 | <mml:mi mathvariant="italic">n</mml:mi> | |
285 | <mml:mo></mml:mo> | |
286 | <mml:mi mathvariant="italic">l</mml:mi> | |
287 | <mml:mo></mml:mo> | |
288 | <mml:mi mathvariant="italic">h</mml:mi> | |
289 | </mml:mrow> | |
290 | </mml:mtd></mml:mtr> | |
291 | <mml:mtr><mml:mtd> | |
292 | <mml:mrow> | |
293 | <mml:mfenced open="" close=""> | |
294 | <mml:mfrac> | |
295 | <mml:mi mathvariant="italic">a</mml:mi> | |
296 | <mml:mi mathvariant="italic">s</mml:mi> | |
297 | </mml:mfrac> | |
298 | </mml:mfenced> | |
299 | <mml:mo></mml:mo> | |
300 | <mml:mfenced open="⌈" close="⌉"> | |
301 | <mml:mfrac> | |
302 | <mml:mfenced open="" close=""> | |
303 | <mml:mrow> | |
304 | <mml:mi mathvariant="italic">s</mml:mi> | |
305 | <mml:mo></mml:mo> | |
306 | <mml:mi mathvariant="italic">n</mml:mi> | |
307 | <mml:mo></mml:mo> | |
308 | <mml:mi mathvariant="italic">l</mml:mi> | |
309 | <mml:mo></mml:mo> | |
310 | <mml:mi mathvariant="italic">h</mml:mi> | |
311 | </mml:mrow> | |
312 | </mml:mfenced> | |
313 | <mml:mi mathvariant="italic">a</mml:mi> | |
314 | </mml:mfrac> | |
315 | </mml:mfenced> | |
316 | </mml:mrow> | |
317 | </mml:mtd></mml:mtr> | |
318 | </mml:mtable> | |
319 | <mml:mo></mml:mo> | |
320 | <mml:mtable> | |
321 | <mml:mtr><mml:mtd> | |
322 | <mml:mrow> | |
323 | <mml:mi mathvariant="italic">s</mml:mi> | |
324 | <mml:mo>>=</mml:mo> | |
325 | <mml:mi mathvariant="italic">a</mml:mi> | |
326 | </mml:mrow> | |
327 | </mml:mtd></mml:mtr> | |
328 | <mml:mtr><mml:mtd> | |
329 | <mml:mrow> | |
330 | <mml:mi mathvariant="italic">s</mml:mi> | |
331 | <mml:mo><</mml:mo> | |
332 | <mml:mi mathvariant="italic">a</mml:mi> | |
333 | </mml:mrow> | |
334 | </mml:mtd></mml:mtr> | |
335 | </mml:mtable> | |
336 | </mml:mrow> | |
337 | </mml:mfenced> | |
338 | </mml:mrow> | |
339 | </mml:math></div><p> | |
340 | </p><p> | |
341 | components or indices, where | |
342 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
343 | is the number of components or indices | |
344 | in a pixel, | |
345 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">l</mml:mi></mml:math> | |
346 | is the number of pixels in a row | |
347 | (<code class="constant">GL_PACK_ROW_LENGTH</code> if it is greater than 0, the | |
348 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">width</mml:mi></mml:math> | |
349 | argument to <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a> otherwise), | |
350 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">h</mml:mi></mml:math> | |
351 | is the number of | |
352 | rows in a pixel image (<code class="constant">GL_PACK_IMAGE_HEIGHT</code> if it is greater than | |
353 | 0, the | |
354 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">height</mml:mi></mml:math> | |
355 | argument to the <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a> routine otherwise), | |
356 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">a</mml:mi></mml:math> | |
357 | is the value of | |
358 | <code class="constant">GL_PACK_ALIGNMENT</code>, and | |
359 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math> | |
360 | is the size, in bytes, of a single | |
361 | component (if | |
362 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
363 | ||
364 | <mml:mrow> | |
365 | <mml:mi mathvariant="italic">a</mml:mi> | |
366 | <mml:mo><</mml:mo> | |
367 | <mml:mi mathvariant="italic">s</mml:mi> | |
368 | </mml:mrow> | |
369 | </mml:math>, | |
370 | then it is as if | |
371 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
372 | ||
373 | <mml:mrow> | |
374 | <mml:mi mathvariant="italic">a</mml:mi> | |
375 | <mml:mo>=</mml:mo> | |
376 | <mml:mi mathvariant="italic">s</mml:mi> | |
377 | </mml:mrow> | |
378 | </mml:math>). | |
379 | </p><p> | |
380 | The word <span class="emphasis"><em>component</em></span> in this description refers to the nonindex values | |
381 | red, | |
382 | green, | |
383 | blue, | |
384 | alpha, | |
385 | and depth. | |
386 | Storage format <code class="constant">GL_RGB</code>, | |
387 | for example, | |
388 | has three components per pixel: | |
389 | first red, | |
390 | then green, | |
391 | and finally blue. | |
392 | </p></dd><dt><span class="term"><code class="constant">GL_PACK_SKIP_PIXELS</code>, <code class="constant">GL_PACK_SKIP_ROWS</code>, and <code class="constant">GL_PACK_SKIP_IMAGES</code></span></dt><dd><p> | |
393 | These values are provided as a convenience to the programmer; | |
394 | they provide no functionality that cannot be duplicated simply by | |
395 | incrementing the pointer passed to <a href="glReadPixels.xml"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a>. | |
396 | Setting <code class="constant">GL_PACK_SKIP_PIXELS</code> to | |
397 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">i</mml:mi></mml:math> | |
398 | is equivalent to incrementing | |
399 | the pointer by | |
400 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
401 | ||
402 | <mml:mrow> | |
403 | <mml:mi mathvariant="italic">i</mml:mi> | |
404 | <mml:mo></mml:mo> | |
405 | <mml:mi mathvariant="italic">n</mml:mi> | |
406 | </mml:mrow> | |
407 | </mml:math> | |
408 | components or indices, | |
409 | where | |
410 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
411 | is the number of components or indices in each pixel. | |
412 | Setting <code class="constant">GL_PACK_SKIP_ROWS</code> to | |
413 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">j</mml:mi></mml:math> | |
414 | is equivalent to incrementing | |
415 | the pointer by | |
416 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
417 | ||
418 | <mml:mrow> | |
419 | <mml:mi mathvariant="italic">j</mml:mi> | |
420 | <mml:mo></mml:mo> | |
421 | <mml:mi mathvariant="italic">m</mml:mi> | |
422 | </mml:mrow> | |
423 | </mml:math> | |
424 | components or indices, | |
425 | where | |
426 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">m</mml:mi></mml:math> | |
427 | is the number of components or indices per row, | |
428 | as just computed in the <code class="constant">GL_PACK_ROW_LENGTH</code> section. | |
429 | Setting <code class="constant">GL_PACK_SKIP_IMAGES</code> to | |
430 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">k</mml:mi></mml:math> | |
431 | is equivalent to incrementing | |
432 | the pointer by | |
433 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
434 | ||
435 | <mml:mrow> | |
436 | <mml:mi mathvariant="italic">k</mml:mi> | |
437 | <mml:mo></mml:mo> | |
438 | <mml:mi mathvariant="italic">p</mml:mi> | |
439 | </mml:mrow> | |
440 | </mml:math>, | |
441 | where | |
442 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">p</mml:mi></mml:math> | |
443 | is the number of components or indices | |
444 | per image, as computed in the <code class="constant">GL_PACK_IMAGE_HEIGHT</code> section. | |
445 | </p></dd><dt><span class="term"><code class="constant">GL_PACK_ALIGNMENT</code></span></dt><dd><p> | |
446 | Specifies the alignment requirements for the start of each pixel row in memory. | |
447 | The allowable values are | |
448 | 1 (byte-alignment), | |
449 | 2 (rows aligned to even-numbered bytes), | |
450 | 4 (word-alignment), and | |
451 | 8 (rows start on double-word boundaries). | |
452 | </p></dd></dl></div><p> | |
453 | The other six of the twelve storage parameters affect how pixel data is | |
454 | read from client memory. | |
455 | These values are significant for | |
456 | <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
457 | <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, | |
458 | <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>, | |
459 | <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>, | |
460 | <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>, and | |
461 | <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a> | |
462 | </p><p> | |
463 | They are as follows: | |
464 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_UNPACK_SWAP_BYTES</code></span></dt><dd><p> | |
465 | If true, | |
466 | byte ordering for multibyte color components, | |
467 | depth components, | |
468 | or stencil indices | |
469 | is reversed. | |
470 | That is, | |
471 | if a four-byte component consists of bytes | |
472 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
473 | ||
474 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
475 | <mml:mn>0</mml:mn> | |
476 | </mml:msub> | |
477 | </mml:math>, | |
478 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
479 | ||
480 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
481 | <mml:mn>1</mml:mn> | |
482 | </mml:msub> | |
483 | </mml:math>, | |
484 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
485 | ||
486 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
487 | <mml:mn>2</mml:mn> | |
488 | </mml:msub> | |
489 | </mml:math>, | |
490 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
491 | ||
492 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
493 | <mml:mn>3</mml:mn> | |
494 | </mml:msub> | |
495 | </mml:math>, | |
496 | it is taken from memory as | |
497 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
498 | ||
499 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
500 | <mml:mn>3</mml:mn> | |
501 | </mml:msub> | |
502 | </mml:math>, | |
503 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
504 | ||
505 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
506 | <mml:mn>2</mml:mn> | |
507 | </mml:msub> | |
508 | </mml:math>, | |
509 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
510 | ||
511 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
512 | <mml:mn>1</mml:mn> | |
513 | </mml:msub> | |
514 | </mml:math>, | |
515 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
516 | ||
517 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
518 | <mml:mn>0</mml:mn> | |
519 | </mml:msub> | |
520 | </mml:math> | |
521 | if <code class="constant">GL_UNPACK_SWAP_BYTES</code> is true. | |
522 | <code class="constant">GL_UNPACK_SWAP_BYTES</code> has no effect on the memory order of components | |
523 | within a pixel, | |
524 | only on the order of bytes within components or indices. | |
525 | For example, | |
526 | the three components of a <code class="constant">GL_RGB</code> format pixel are always stored with | |
527 | red first, | |
528 | green second, | |
529 | and blue third, | |
530 | regardless of the value of <code class="constant">GL_UNPACK_SWAP_BYTES</code>. | |
531 | </p></dd><dt><span class="term"><code class="constant">GL_UNPACK_LSB_FIRST</code></span></dt><dd><p> | |
532 | If true, | |
533 | bits are ordered within a byte from least significant to most significant; | |
534 | otherwise, | |
535 | the first bit in each byte is the most significant one. | |
536 | </p></dd><dt><span class="term"><code class="constant">GL_UNPACK_ROW_LENGTH</code></span></dt><dd><p> | |
537 | If greater than 0, | |
538 | <code class="constant">GL_UNPACK_ROW_LENGTH</code> defines the number of pixels in a row. | |
539 | If the first pixel of a row is placed at location | |
540 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">p</mml:mi></mml:math> | |
541 | in memory, | |
542 | then the location of the first pixel of the next row is obtained by skipping | |
543 | </p><p> | |
544 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
545 | ||
546 | <mml:mrow> | |
547 | <mml:mi mathvariant="italic">k</mml:mi> | |
548 | <mml:mo>=</mml:mo> | |
549 | <mml:mfenced open="{" close=""> | |
550 | <mml:mrow> | |
551 | <mml:mtable> | |
552 | <mml:mtr><mml:mtd> | |
553 | <mml:mrow> | |
554 | <mml:mi mathvariant="italic">n</mml:mi> | |
555 | <mml:mo></mml:mo> | |
556 | <mml:mi mathvariant="italic">l</mml:mi> | |
557 | </mml:mrow> | |
558 | </mml:mtd></mml:mtr> | |
559 | <mml:mtr><mml:mtd> | |
560 | <mml:mrow> | |
561 | <mml:mfenced open="" close=""> | |
562 | <mml:mfrac> | |
563 | <mml:mi mathvariant="italic">a</mml:mi> | |
564 | <mml:mi mathvariant="italic">s</mml:mi> | |
565 | </mml:mfrac> | |
566 | </mml:mfenced> | |
567 | <mml:mo></mml:mo> | |
568 | <mml:mfenced open="⌈" close="⌉"> | |
569 | <mml:mfrac> | |
570 | <mml:mfenced open="" close=""> | |
571 | <mml:mrow> | |
572 | <mml:mi mathvariant="italic">s</mml:mi> | |
573 | <mml:mo></mml:mo> | |
574 | <mml:mi mathvariant="italic">n</mml:mi> | |
575 | <mml:mo></mml:mo> | |
576 | <mml:mi mathvariant="italic">l</mml:mi> | |
577 | </mml:mrow> | |
578 | </mml:mfenced> | |
579 | <mml:mi mathvariant="italic">a</mml:mi> | |
580 | </mml:mfrac> | |
581 | </mml:mfenced> | |
582 | </mml:mrow> | |
583 | </mml:mtd></mml:mtr> | |
584 | </mml:mtable> | |
585 | <mml:mo></mml:mo> | |
586 | <mml:mtable> | |
587 | <mml:mtr><mml:mtd> | |
588 | <mml:mrow> | |
589 | <mml:mi mathvariant="italic">s</mml:mi> | |
590 | <mml:mo>>=</mml:mo> | |
591 | <mml:mi mathvariant="italic">a</mml:mi> | |
592 | </mml:mrow> | |
593 | </mml:mtd></mml:mtr> | |
594 | <mml:mtr><mml:mtd> | |
595 | <mml:mrow> | |
596 | <mml:mi mathvariant="italic">s</mml:mi> | |
597 | <mml:mo><</mml:mo> | |
598 | <mml:mi mathvariant="italic">a</mml:mi> | |
599 | </mml:mrow> | |
600 | </mml:mtd></mml:mtr> | |
601 | </mml:mtable> | |
602 | </mml:mrow> | |
603 | </mml:mfenced> | |
604 | </mml:mrow> | |
605 | </mml:math></div><p> | |
606 | </p><p> | |
607 | components or indices, | |
608 | where | |
609 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
610 | is the number of components or indices in a pixel, | |
611 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">l</mml:mi></mml:math> | |
612 | is the number of pixels in a row | |
613 | (<code class="constant">GL_UNPACK_ROW_LENGTH</code> if it is greater than 0, | |
614 | the | |
615 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">width</mml:mi></mml:math> | |
616 | argument to the pixel routine otherwise), | |
617 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">a</mml:mi></mml:math> | |
618 | is the value of <code class="constant">GL_UNPACK_ALIGNMENT</code>, and | |
619 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math> | |
620 | is the size, in bytes, of a single component | |
621 | (if | |
622 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
623 | ||
624 | <mml:mrow> | |
625 | <mml:mi mathvariant="italic">a</mml:mi> | |
626 | <mml:mo><</mml:mo> | |
627 | <mml:mi mathvariant="italic">s</mml:mi> | |
628 | </mml:mrow> | |
629 | </mml:math>, | |
630 | then it is as if | |
631 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
632 | ||
633 | <mml:mrow> | |
634 | <mml:mi mathvariant="italic">a</mml:mi> | |
635 | <mml:mo>=</mml:mo> | |
636 | <mml:mi mathvariant="italic">s</mml:mi> | |
637 | </mml:mrow> | |
638 | </mml:math>). | |
639 | In the case of 1-bit values, | |
640 | the location of the next row is obtained by skipping | |
641 | </p><p> | |
642 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
643 | ||
644 | <mml:mrow> | |
645 | <mml:mi mathvariant="italic">k</mml:mi> | |
646 | <mml:mo>=</mml:mo> | |
647 | <mml:mrow> | |
648 | <mml:mn>8</mml:mn> | |
649 | <mml:mo></mml:mo> | |
650 | <mml:mi mathvariant="italic">a</mml:mi> | |
651 | <mml:mo></mml:mo> | |
652 | <mml:mfenced open="⌈" close="⌉"> | |
653 | <mml:mfrac> | |
654 | <mml:mfenced open="" close=""> | |
655 | <mml:mrow> | |
656 | <mml:mi mathvariant="italic">n</mml:mi> | |
657 | <mml:mo></mml:mo> | |
658 | <mml:mi mathvariant="italic">l</mml:mi> | |
659 | </mml:mrow> | |
660 | </mml:mfenced> | |
661 | <mml:mfenced open="" close=""> | |
662 | <mml:mrow> | |
663 | <mml:mn>8</mml:mn> | |
664 | <mml:mo></mml:mo> | |
665 | <mml:mi mathvariant="italic">a</mml:mi> | |
666 | </mml:mrow> | |
667 | </mml:mfenced> | |
668 | </mml:mfrac> | |
669 | </mml:mfenced> | |
670 | </mml:mrow> | |
671 | </mml:mrow> | |
672 | </mml:math> | |
673 | </p><p> | |
674 | components or indices. | |
675 | </p><p> | |
676 | The word <span class="emphasis"><em>component</em></span> in this description refers to the nonindex values | |
677 | red, | |
678 | green, | |
679 | blue, | |
680 | alpha, | |
681 | and depth. | |
682 | Storage format <code class="constant">GL_RGB</code>, | |
683 | for example, | |
684 | has three components per pixel: | |
685 | first red, | |
686 | then green, | |
687 | and finally blue. | |
688 | </p></dd><dt><span class="term"><code class="constant">GL_UNPACK_IMAGE_HEIGHT</code></span></dt><dd><p> | |
689 | If greater than 0, | |
690 | <code class="constant">GL_UNPACK_IMAGE_HEIGHT</code> defines the number of pixels in an image of | |
691 | a three-dimensional texture volume. Where ``image'' is defined by all | |
692 | pixel sharing the same third dimension index. | |
693 | If the first pixel of a row is placed at location | |
694 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">p</mml:mi></mml:math> | |
695 | in memory, | |
696 | then the location of the first pixel of the next row is obtained by skipping | |
697 | </p><p> | |
698 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
699 | ||
700 | <mml:mrow> | |
701 | <mml:mi mathvariant="italic">k</mml:mi> | |
702 | <mml:mo>=</mml:mo> | |
703 | <mml:mfenced open="{" close=""> | |
704 | <mml:mrow> | |
705 | <mml:mtable> | |
706 | <mml:mtr><mml:mtd> | |
707 | <mml:mrow> | |
708 | <mml:mi mathvariant="italic">n</mml:mi> | |
709 | <mml:mo></mml:mo> | |
710 | <mml:mi mathvariant="italic">l</mml:mi> | |
711 | <mml:mo></mml:mo> | |
712 | <mml:mi mathvariant="italic">h</mml:mi> | |
713 | </mml:mrow> | |
714 | </mml:mtd></mml:mtr> | |
715 | <mml:mtr><mml:mtd> | |
716 | <mml:mrow> | |
717 | <mml:mfenced open="" close=""> | |
718 | <mml:mfrac> | |
719 | <mml:mi mathvariant="italic">a</mml:mi> | |
720 | <mml:mi mathvariant="italic">s</mml:mi> | |
721 | </mml:mfrac> | |
722 | </mml:mfenced> | |
723 | <mml:mo></mml:mo> | |
724 | <mml:mfenced open="⌈" close="⌉"> | |
725 | <mml:mfrac> | |
726 | <mml:mfenced open="" close=""> | |
727 | <mml:mrow> | |
728 | <mml:mi mathvariant="italic">s</mml:mi> | |
729 | <mml:mo></mml:mo> | |
730 | <mml:mi mathvariant="italic">n</mml:mi> | |
731 | <mml:mo></mml:mo> | |
732 | <mml:mi mathvariant="italic">l</mml:mi> | |
733 | <mml:mo></mml:mo> | |
734 | <mml:mi mathvariant="italic">h</mml:mi> | |
735 | </mml:mrow> | |
736 | </mml:mfenced> | |
737 | <mml:mi mathvariant="italic">a</mml:mi> | |
738 | </mml:mfrac> | |
739 | </mml:mfenced> | |
740 | </mml:mrow> | |
741 | </mml:mtd></mml:mtr> | |
742 | </mml:mtable> | |
743 | <mml:mo></mml:mo> | |
744 | <mml:mtable> | |
745 | <mml:mtr><mml:mtd> | |
746 | <mml:mrow> | |
747 | <mml:mi mathvariant="italic">s</mml:mi> | |
748 | <mml:mo>>=</mml:mo> | |
749 | <mml:mi mathvariant="italic">a</mml:mi> | |
750 | </mml:mrow> | |
751 | </mml:mtd></mml:mtr> | |
752 | <mml:mtr><mml:mtd> | |
753 | <mml:mrow> | |
754 | <mml:mi mathvariant="italic">s</mml:mi> | |
755 | <mml:mo><</mml:mo> | |
756 | <mml:mi mathvariant="italic">a</mml:mi> | |
757 | </mml:mrow> | |
758 | </mml:mtd></mml:mtr> | |
759 | </mml:mtable> | |
760 | </mml:mrow> | |
761 | </mml:mfenced> | |
762 | </mml:mrow> | |
763 | </mml:math></div><p> | |
764 | </p><p> | |
765 | components or indices, | |
766 | where | |
767 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
768 | is the number of components or indices in a pixel, | |
769 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">l</mml:mi></mml:math> | |
770 | is the number of pixels in a row | |
771 | (<code class="constant">GL_UNPACK_ROW_LENGTH</code> if it is greater than 0, | |
772 | the | |
773 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">width</mml:mi></mml:math> | |
774 | argument to <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a> otherwise), | |
775 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">h</mml:mi></mml:math> | |
776 | is the number of rows in an image (<code class="constant">GL_UNPACK_IMAGE_HEIGHT</code> if | |
777 | it is greater than 0, the | |
778 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">height</mml:mi></mml:math> | |
779 | argument to <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a> otherwise), | |
780 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">a</mml:mi></mml:math> | |
781 | is the value of <code class="constant">GL_UNPACK_ALIGNMENT</code>, and | |
782 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math> | |
783 | is the size, in bytes, of a single component | |
784 | (if | |
785 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
786 | ||
787 | <mml:mrow> | |
788 | <mml:mi mathvariant="italic">a</mml:mi> | |
789 | <mml:mo><</mml:mo> | |
790 | <mml:mi mathvariant="italic">s</mml:mi> | |
791 | </mml:mrow> | |
792 | </mml:math>, | |
793 | then it is as if | |
794 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
795 | ||
796 | <mml:mrow> | |
797 | <mml:mi mathvariant="italic">a</mml:mi> | |
798 | <mml:mo>=</mml:mo> | |
799 | <mml:mi mathvariant="italic">s</mml:mi> | |
800 | </mml:mrow> | |
801 | </mml:math>). | |
802 | </p><p> | |
803 | The word <span class="emphasis"><em>component</em></span> in this description refers to the nonindex values | |
804 | red, | |
805 | green, | |
806 | blue, | |
807 | alpha, | |
808 | and depth. | |
809 | Storage format <code class="constant">GL_RGB</code>, | |
810 | for example, | |
811 | has three components per pixel: | |
812 | first red, | |
813 | then green, | |
814 | and finally blue. | |
815 | </p></dd><dt><span class="term"><code class="constant">GL_UNPACK_SKIP_PIXELS</code> and <code class="constant">GL_UNPACK_SKIP_ROWS</code></span></dt><dd><p> | |
816 | These values are provided as a convenience to the programmer; | |
817 | they provide no functionality that cannot be duplicated by | |
818 | incrementing the pointer passed to | |
819 | <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
820 | <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, | |
821 | <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a> or | |
822 | <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>. | |
823 | Setting <code class="constant">GL_UNPACK_SKIP_PIXELS</code> to | |
824 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">i</mml:mi></mml:math> | |
825 | is equivalent to incrementing | |
826 | the pointer by | |
827 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
828 | ||
829 | <mml:mrow> | |
830 | <mml:mi mathvariant="italic">i</mml:mi> | |
831 | <mml:mo></mml:mo> | |
832 | <mml:mi mathvariant="italic">n</mml:mi> | |
833 | </mml:mrow> | |
834 | </mml:math> | |
835 | components or indices, | |
836 | where | |
837 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
838 | is the number of components or indices in each pixel. | |
839 | Setting <code class="constant">GL_UNPACK_SKIP_ROWS</code> to | |
840 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">j</mml:mi></mml:math> | |
841 | is equivalent to incrementing | |
842 | the pointer by | |
843 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
844 | ||
845 | <mml:mrow> | |
846 | <mml:mi mathvariant="italic">j</mml:mi> | |
847 | <mml:mo></mml:mo> | |
848 | <mml:mi mathvariant="italic">k</mml:mi> | |
849 | </mml:mrow> | |
850 | </mml:math> | |
851 | components or indices, | |
852 | where | |
853 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">k</mml:mi></mml:math> | |
854 | is the number of components or indices per row, | |
855 | as just computed in the <code class="constant">GL_UNPACK_ROW_LENGTH</code> section. | |
856 | </p></dd><dt><span class="term"><code class="constant">GL_UNPACK_ALIGNMENT</code></span></dt><dd><p> | |
857 | Specifies the alignment requirements for the start of each pixel row in memory. | |
858 | The allowable values are | |
859 | 1 (byte-alignment), | |
860 | 2 (rows aligned to even-numbered bytes), | |
861 | 4 (word-alignment), and | |
862 | 8 (rows start on double-word boundaries). | |
863 | </p></dd></dl></div><p> | |
864 | The following table gives the type, | |
865 | initial value, | |
866 | and range of valid values for each storage parameter | |
867 | that can be set with <code class="function">glPixelStore</code>. | |
868 | </p><p> | |
869 | </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="center" /><col align="center" /><col align="center" /></colgroup><thead><tr><th align="left"><span class="bold"><strong> | |
870 | <em class="parameter"><code>pname</code></em> | |
871 | </strong></span></th><th align="center"><span class="bold"><strong> | |
872 | Type | |
873 | </strong></span></th><th align="center"><span class="bold"><strong> | |
874 | Initial Value | |
875 | </strong></span></th><th align="center"><span class="bold"><strong> | |
876 | Valid Range | |
877 | </strong></span></th></tr></thead><tbody><tr><td align="left"> | |
878 | <code class="constant">GL_PACK_SWAP_BYTES</code> | |
879 | </td><td align="center"> | |
880 | boolean | |
881 | </td><td align="center"> | |
882 | false | |
883 | </td><td align="center"> | |
884 | true or false | |
885 | </td></tr><tr><td align="left"> | |
886 | <code class="constant">GL_PACK_LSB_FIRST</code> | |
887 | </td><td align="center"> | |
888 | boolean | |
889 | </td><td align="center"> | |
890 | false | |
891 | </td><td align="center"> | |
892 | true or false | |
893 | </td></tr><tr><td align="left"> | |
894 | <code class="constant">GL_PACK_ROW_LENGTH</code> | |
895 | </td><td align="center"> | |
896 | integer | |
897 | </td><td align="center"> | |
898 | 0 | |
899 | </td><td align="center"> | |
900 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
901 | ||
902 | <mml:mfenced open="[" close=")"> | |
903 | <mml:mn>0</mml:mn> | |
904 | <mml:infinity definitionURL="" encoding=""></mml:infinity> | |
905 | </mml:mfenced> | |
906 | </mml:math> | |
907 | </td></tr><tr><td align="left"> | |
908 | <code class="constant">GL_PACK_IMAGE_HEIGHT</code> | |
909 | </td><td align="center"> | |
910 | integer | |
911 | </td><td align="center"> | |
912 | 0 | |
913 | </td><td align="center"> | |
914 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
915 | ||
916 | <mml:mfenced open="[" close=")"> | |
917 | <mml:mn>0</mml:mn> | |
918 | <mml:infinity definitionURL="" encoding=""></mml:infinity> | |
919 | </mml:mfenced> | |
920 | </mml:math> | |
921 | </td></tr><tr><td align="left"> | |
922 | <code class="constant">GL_PACK_SKIP_ROWS</code> | |
923 | </td><td align="center"> | |
924 | integer | |
925 | </td><td align="center"> | |
926 | 0 | |
927 | </td><td align="center"> | |
928 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
929 | ||
930 | <mml:mfenced open="[" close=")"> | |
931 | <mml:mn>0</mml:mn> | |
932 | <mml:infinity definitionURL="" encoding=""></mml:infinity> | |
933 | </mml:mfenced> | |
934 | </mml:math> | |
935 | </td></tr><tr><td align="left"> | |
936 | <code class="constant">GL_PACK_SKIP_PIXELS</code> | |
937 | </td><td align="center"> | |
938 | integer | |
939 | </td><td align="center"> | |
940 | 0 | |
941 | </td><td align="center"> | |
942 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
943 | ||
944 | <mml:mfenced open="[" close=")"> | |
945 | <mml:mn>0</mml:mn> | |
946 | <mml:infinity definitionURL="" encoding=""></mml:infinity> | |
947 | </mml:mfenced> | |
948 | </mml:math> | |
949 | </td></tr><tr><td align="left"> | |
950 | <code class="constant">GL_PACK_SKIP_IMAGES</code> | |
951 | </td><td align="center"> | |
952 | integer | |
953 | </td><td align="center"> | |
954 | 0 | |
955 | </td><td align="center"> | |
956 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
957 | ||
958 | <mml:mfenced open="[" close=")"> | |
959 | <mml:mn>0</mml:mn> | |
960 | <mml:infinity definitionURL="" encoding=""></mml:infinity> | |
961 | </mml:mfenced> | |
962 | </mml:math> | |
963 | </td></tr><tr><td align="left"> | |
964 | <code class="constant">GL_PACK_ALIGNMENT</code> | |
965 | </td><td align="center"> | |
966 | integer | |
967 | </td><td align="center"> | |
968 | 4 | |
969 | </td><td align="center"> | |
970 | 1, 2, 4, or 8 | |
971 | </td></tr><tr><td align="left"> | |
972 | <code class="constant">GL_UNPACK_SWAP_BYTES</code> | |
973 | </td><td align="center"> | |
974 | boolean | |
975 | </td><td align="center"> | |
976 | false | |
977 | </td><td align="center"> | |
978 | true or false | |
979 | </td></tr><tr><td align="left"> | |
980 | <code class="constant">GL_UNPACK_LSB_FIRST</code> | |
981 | </td><td align="center"> | |
982 | boolean | |
983 | </td><td align="center"> | |
984 | false | |
985 | </td><td align="center"> | |
986 | true or false | |
987 | </td></tr><tr><td align="left"> | |
988 | <code class="constant">GL_UNPACK_ROW_LENGTH</code> | |
989 | </td><td align="center"> | |
990 | integer | |
991 | </td><td align="center"> | |
992 | 0 | |
993 | </td><td align="center"> | |
994 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
995 | ||
996 | <mml:mfenced open="[" close=")"> | |
997 | <mml:mn>0</mml:mn> | |
998 | <mml:infinity definitionURL="" encoding=""></mml:infinity> | |
999 | </mml:mfenced> | |
1000 | </mml:math> | |
1001 | </td></tr><tr><td align="left"> | |
1002 | <code class="constant">GL_UNPACK_IMAGE_HEIGHT</code> | |
1003 | </td><td align="center"> | |
1004 | integer | |
1005 | </td><td align="center"> | |
1006 | 0 | |
1007 | </td><td align="center"> | |
1008 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
1009 | ||
1010 | <mml:mfenced open="[" close=")"> | |
1011 | <mml:mn>0</mml:mn> | |
1012 | <mml:infinity definitionURL="" encoding=""></mml:infinity> | |
1013 | </mml:mfenced> | |
1014 | </mml:math> | |
1015 | </td></tr><tr><td align="left"> | |
1016 | <code class="constant">GL_UNPACK_SKIP_ROWS</code> | |
1017 | </td><td align="center"> | |
1018 | integer | |
1019 | </td><td align="center"> | |
1020 | 0 | |
1021 | </td><td align="center"> | |
1022 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
1023 | ||
1024 | <mml:mfenced open="[" close=")"> | |
1025 | <mml:mn>0</mml:mn> | |
1026 | <mml:infinity definitionURL="" encoding=""></mml:infinity> | |
1027 | </mml:mfenced> | |
1028 | </mml:math> | |
1029 | </td></tr><tr><td align="left"> | |
1030 | <code class="constant">GL_UNPACK_SKIP_PIXELS</code> | |
1031 | </td><td align="center"> | |
1032 | integer | |
1033 | </td><td align="center"> | |
1034 | 0 | |
1035 | </td><td align="center"> | |
1036 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
1037 | ||
1038 | <mml:mfenced open="[" close=")"> | |
1039 | <mml:mn>0</mml:mn> | |
1040 | <mml:infinity definitionURL="" encoding=""></mml:infinity> | |
1041 | </mml:mfenced> | |
1042 | </mml:math> | |
1043 | </td></tr><tr><td align="left"> | |
1044 | <code class="constant">GL_UNPACK_SKIP_IMAGES</code> | |
1045 | </td><td align="center"> | |
1046 | integer | |
1047 | </td><td align="center"> | |
1048 | 0 | |
1049 | </td><td align="center"> | |
1050 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
1051 | ||
1052 | <mml:mfenced open="[" close=")"> | |
1053 | <mml:mn>0</mml:mn> | |
1054 | <mml:infinity definitionURL="" encoding=""></mml:infinity> | |
1055 | </mml:mfenced> | |
1056 | </mml:math> | |
1057 | </td></tr><tr><td align="left"> | |
1058 | <code class="constant">GL_UNPACK_ALIGNMENT</code> | |
1059 | </td><td align="center"> | |
1060 | integer | |
1061 | </td><td align="center"> | |
1062 | 4 | |
1063 | </td><td align="center"> | |
1064 | 1, 2, 4, or 8 | |
1065 | </td></tr></tbody></table></div><p> | |
1066 | <code class="function">glPixelStoref</code> can be used to set any pixel store parameter. | |
1067 | If the parameter type is boolean, | |
1068 | then if <em class="parameter"><code>param</code></em> is 0, | |
1069 | the parameter is false; | |
1070 | otherwise it is set to true. | |
1071 | If <em class="parameter"><code>pname</code></em> is a integer type parameter, | |
1072 | <em class="parameter"><code>param</code></em> is rounded to the nearest integer. | |
1073 | </p><p> | |
1074 | Likewise, <code class="function">glPixelStorei</code> can also be used to set any of the | |
1075 | pixel store parameters. | |
1076 | Boolean parameters are set to false if <em class="parameter"><code>param</code></em> is 0 and true otherwise. | |
1077 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
1078 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>pname</code></em> is not an accepted value. | |
1079 | </p><p> | |
1080 | <code class="constant">GL_INVALID_VALUE</code> is generated if a negative row length, | |
1081 | pixel skip, | |
1082 | or row skip value is specified, | |
1083 | or if alignment is specified as other than 1, 2, 4, or 8. | |
1084 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
1085 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PACK_SWAP_BYTES</code> | |
1086 | </p><p> | |
1087 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PACK_LSB_FIRST</code> | |
1088 | </p><p> | |
1089 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PACK_ROW_LENGTH</code> | |
1090 | </p><p> | |
1091 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PACK_IMAGE_HEIGHT</code> | |
1092 | </p><p> | |
1093 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PACK_SKIP_ROWS</code> | |
1094 | </p><p> | |
1095 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PACK_SKIP_PIXELS</code> | |
1096 | </p><p> | |
1097 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PACK_SKIP_IMAGES</code> | |
1098 | </p><p> | |
1099 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PACK_ALIGNMENT</code> | |
1100 | </p><p> | |
1101 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_UNPACK_SWAP_BYTES</code> | |
1102 | </p><p> | |
1103 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_UNPACK_LSB_FIRST</code> | |
1104 | </p><p> | |
1105 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_UNPACK_ROW_LENGTH</code> | |
1106 | </p><p> | |
1107 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_UNPACK_IMAGE_HEIGHT</code> | |
1108 | </p><p> | |
1109 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_UNPACK_SKIP_ROWS</code> | |
1110 | </p><p> | |
1111 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_UNPACK_SKIP_PIXELS</code> | |
1112 | </p><p> | |
1113 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_UNPACK_SKIP_IMAGES</code> | |
1114 | </p><p> | |
1115 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_UNPACK_ALIGNMENT</code> | |
1116 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
1117 | <a href="glReadPixels.xml"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a>, | |
1118 | <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
1119 | <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, | |
1120 | <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>, | |
1121 | <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>, | |
1122 | <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>, | |
1123 | <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>, | |
1124 | <a href="glCompressedTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage1D</span></span></a>, | |
1125 | <a href="glCompressedTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage2D</span></span></a>, | |
1126 | <a href="glCompressedTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage3D</span></span></a>, | |
1127 | <a href="glCompressedTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage1D</span></span></a>, | |
1128 | <a href="glCompressedTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage2D</span></span></a>, | |
1129 | <a href="glCompressedTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage1D</span></span></a>. | |
1130 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
1131 | Copyright <span class="trademark"></span>© 1991-2006 | |
1132 | Silicon Graphics, Inc. <span class="trademark"></span>© 2011 | |
1133 | Khronos Group. This document is licensed under the SGI | |
1134 | Free Software B License. For details, see | |
1135 | <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
1136 | </p></div></div></body></html> |