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