Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> | |
4 | <refentry id="glPixelStore"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>1991-2006</year> | |
9 | <holder>Silicon Graphics, Inc.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glPixelStore</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glPixelStore</refname> | |
17 | <refpurpose>set pixel storage modes</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glPixelStoref</function></funcdef> | |
23 | <paramdef>GLenum <parameter>pname</parameter></paramdef> | |
24 | <paramdef>GLfloat <parameter>param</parameter></paramdef> | |
25 | </funcprototype> | |
26 | </funcsynopsis> | |
27 | <funcsynopsis> | |
28 | <funcprototype> | |
29 | <funcdef>void <function>glPixelStorei</function></funcdef> | |
30 | <paramdef>GLenum <parameter>pname</parameter></paramdef> | |
31 | <paramdef>GLint <parameter>param</parameter></paramdef> | |
32 | </funcprototype> | |
33 | </funcsynopsis> | |
34 | </refsynopsisdiv> | |
35 | <!-- eqn: ignoring delim $$ --> | |
36 | <refsect1 id="parameters"><title>Parameters</title> | |
37 | <variablelist> | |
38 | <varlistentry> | |
39 | <term><parameter>pname</parameter></term> | |
40 | <listitem> | |
41 | <para> | |
42 | Specifies the symbolic name of the parameter to be set. | |
43 | Six values affect the packing of pixel data into memory: | |
44 | <constant>GL_PACK_SWAP_BYTES</constant>, | |
45 | <constant>GL_PACK_LSB_FIRST</constant>, | |
46 | <constant>GL_PACK_ROW_LENGTH</constant>, | |
47 | <constant>GL_PACK_IMAGE_HEIGHT</constant>, | |
48 | <constant>GL_PACK_SKIP_PIXELS</constant>, | |
49 | <constant>GL_PACK_SKIP_ROWS</constant>, | |
50 | <constant>GL_PACK_SKIP_IMAGES</constant>, and | |
51 | <constant>GL_PACK_ALIGNMENT</constant>. | |
52 | Six more affect the unpacking of pixel data <emphasis>from</emphasis> memory: | |
53 | <constant>GL_UNPACK_SWAP_BYTES</constant>, | |
54 | <constant>GL_UNPACK_LSB_FIRST</constant>, | |
55 | <constant>GL_UNPACK_ROW_LENGTH</constant>, | |
56 | <constant>GL_UNPACK_IMAGE_HEIGHT</constant>, | |
57 | <constant>GL_UNPACK_SKIP_PIXELS</constant>, | |
58 | <constant>GL_UNPACK_SKIP_ROWS</constant>, | |
59 | <constant>GL_UNPACK_SKIP_IMAGES</constant>, and | |
60 | <constant>GL_UNPACK_ALIGNMENT</constant>. | |
61 | </para> | |
62 | </listitem> | |
63 | </varlistentry> | |
64 | <varlistentry> | |
65 | <term><parameter>param</parameter></term> | |
66 | <listitem> | |
67 | <para> | |
68 | Specifies the value that <parameter>pname</parameter> is set to. | |
69 | </para> | |
70 | </listitem> | |
71 | </varlistentry> | |
72 | </variablelist> | |
73 | </refsect1> | |
74 | <refsect1 id="description"><title>Description</title> | |
75 | <para> | |
76 | <function>glPixelStore</function> sets pixel storage modes that affect the operation of subsequent | |
77 | <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> as well as the unpacking of | |
78 | texture patterns (see <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>, | |
79 | <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>, | |
80 | <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>), | |
81 | <citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glCompressedTexImage2D</refentrytitle></citerefentry>, | |
82 | <citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>, | |
83 | <citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry> or <citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>. | |
84 | </para> | |
85 | <para> | |
86 | <parameter>pname</parameter> is a symbolic constant indicating the parameter to be set, and | |
87 | <parameter>param</parameter> is the new value. Six of the twelve storage parameters affect | |
88 | how pixel data is returned to client memory. | |
89 | They are as follows: | |
90 | </para> | |
91 | <variablelist> | |
92 | <varlistentry> | |
93 | <term><constant>GL_PACK_SWAP_BYTES</constant></term> | |
94 | <listitem> | |
95 | <para> | |
96 | If true, | |
97 | byte ordering for multibyte color components, | |
98 | depth components, | |
99 | or stencil indices | |
100 | is reversed. | |
101 | That is, | |
102 | if a four-byte component consists of bytes | |
103 | <inlineequation><mml:math> | |
104 | <!-- eqn: b sub 0: --> | |
105 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
106 | <mml:mn>0</mml:mn> | |
107 | </mml:msub> | |
108 | </mml:math></inlineequation>, | |
109 | <inlineequation><mml:math> | |
110 | <!-- eqn: b sub 1: --> | |
111 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
112 | <mml:mn>1</mml:mn> | |
113 | </mml:msub> | |
114 | </mml:math></inlineequation>, | |
115 | <inlineequation><mml:math> | |
116 | <!-- eqn: b sub 2: --> | |
117 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
118 | <mml:mn>2</mml:mn> | |
119 | </mml:msub> | |
120 | </mml:math></inlineequation>, | |
121 | <inlineequation><mml:math> | |
122 | <!-- eqn: b sub 3: --> | |
123 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
124 | <mml:mn>3</mml:mn> | |
125 | </mml:msub> | |
126 | </mml:math></inlineequation>, | |
127 | it is stored in memory as | |
128 | <inlineequation><mml:math> | |
129 | <!-- eqn: b sub 3: --> | |
130 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
131 | <mml:mn>3</mml:mn> | |
132 | </mml:msub> | |
133 | </mml:math></inlineequation>, | |
134 | <inlineequation><mml:math> | |
135 | <!-- eqn: b sub 2: --> | |
136 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
137 | <mml:mn>2</mml:mn> | |
138 | </mml:msub> | |
139 | </mml:math></inlineequation>, | |
140 | <inlineequation><mml:math> | |
141 | <!-- eqn: b sub 1: --> | |
142 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
143 | <mml:mn>1</mml:mn> | |
144 | </mml:msub> | |
145 | </mml:math></inlineequation>, | |
146 | <inlineequation><mml:math> | |
147 | <!-- eqn: b sub 0: --> | |
148 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
149 | <mml:mn>0</mml:mn> | |
150 | </mml:msub> | |
151 | </mml:math></inlineequation> | |
152 | if <constant>GL_PACK_SWAP_BYTES</constant> is true. | |
153 | <constant>GL_PACK_SWAP_BYTES</constant> has no effect on the memory order of components | |
154 | within a pixel, | |
155 | only on the order of bytes within components or indices. | |
156 | For example, | |
157 | the three components of a <constant>GL_RGB</constant> format pixel are always stored with | |
158 | red first, | |
159 | green second, | |
160 | and blue third, | |
161 | regardless of the value of <constant>GL_PACK_SWAP_BYTES</constant>. | |
162 | </para> | |
163 | </listitem> | |
164 | </varlistentry> | |
165 | <varlistentry> | |
166 | <term><constant>GL_PACK_LSB_FIRST</constant></term> | |
167 | <listitem> | |
168 | <para> | |
169 | If true, | |
170 | bits are ordered within a byte from least significant to most significant; | |
171 | otherwise, | |
172 | the first bit in each byte is the most significant one. | |
173 | </para> | |
174 | </listitem> | |
175 | </varlistentry> | |
176 | <varlistentry> | |
177 | <term><constant>GL_PACK_ROW_LENGTH</constant></term> | |
178 | <listitem> | |
179 | <para> | |
180 | If greater than 0, | |
181 | <constant>GL_PACK_ROW_LENGTH</constant> defines the number of pixels in a row. | |
182 | If the first pixel of a row is placed at location | |
183 | <inlineequation><mml:math><mml:mi mathvariant="italic">p</mml:mi></mml:math></inlineequation> | |
184 | in memory, | |
185 | then the location of the first pixel of the next row is obtained by skipping | |
186 | </para> | |
187 | <para> | |
188 | <informalequation><mml:math> | |
189 | <!-- eqn: k = left { lpile { n l above {a over s} left ceiling { s n l } over a right ceiling} lpile {s >= a above s < a }: --> | |
190 | <mml:mrow> | |
191 | <mml:mi mathvariant="italic">k</mml:mi> | |
192 | <mml:mo>=</mml:mo> | |
193 | <mml:mfenced open="{" close=""> | |
194 | <mml:mrow> | |
195 | <mml:mtable> | |
196 | <mml:mtr><mml:mtd> | |
197 | <mml:mrow> | |
198 | <mml:mi mathvariant="italic">n</mml:mi> | |
199 | <mml:mo>⁢</mml:mo> | |
200 | <mml:mi mathvariant="italic">l</mml:mi> | |
201 | </mml:mrow> | |
202 | </mml:mtd></mml:mtr> | |
203 | <mml:mtr><mml:mtd> | |
204 | <mml:mrow> | |
205 | <mml:mfenced open="" close=""> | |
206 | <mml:mfrac> | |
207 | <mml:mi mathvariant="italic">a</mml:mi> | |
208 | <mml:mi mathvariant="italic">s</mml:mi> | |
209 | </mml:mfrac> | |
210 | </mml:mfenced> | |
211 | <mml:mo>⁢</mml:mo> | |
212 | <mml:mfenced open="⌈" close="⌉"> | |
213 | <mml:mfrac> | |
214 | <mml:mfenced open="" close=""> | |
215 | <mml:mrow> | |
216 | <mml:mi mathvariant="italic">s</mml:mi> | |
217 | <mml:mo>⁢</mml:mo> | |
218 | <mml:mi mathvariant="italic">n</mml:mi> | |
219 | <mml:mo>⁢</mml:mo> | |
220 | <mml:mi mathvariant="italic">l</mml:mi> | |
221 | </mml:mrow> | |
222 | </mml:mfenced> | |
223 | <mml:mi mathvariant="italic">a</mml:mi> | |
224 | </mml:mfrac> | |
225 | </mml:mfenced> | |
226 | </mml:mrow> | |
227 | </mml:mtd></mml:mtr> | |
228 | </mml:mtable> | |
229 | <mml:mo>⁢</mml:mo> | |
230 | <mml:mtable> | |
231 | <mml:mtr><mml:mtd> | |
232 | <mml:mrow> | |
233 | <mml:mi mathvariant="italic">s</mml:mi> | |
234 | <mml:mo>>=</mml:mo> | |
235 | <mml:mi mathvariant="italic">a</mml:mi> | |
236 | </mml:mrow> | |
237 | </mml:mtd></mml:mtr> | |
238 | <mml:mtr><mml:mtd> | |
239 | <mml:mrow> | |
240 | <mml:mi mathvariant="italic">s</mml:mi> | |
241 | <mml:mo><</mml:mo> | |
242 | <mml:mi mathvariant="italic">a</mml:mi> | |
243 | </mml:mrow> | |
244 | </mml:mtd></mml:mtr> | |
245 | </mml:mtable> | |
246 | </mml:mrow> | |
247 | </mml:mfenced> | |
248 | </mml:mrow> | |
249 | </mml:math></informalequation> | |
250 | </para> | |
251 | <para> | |
252 | components or indices, | |
253 | where | |
254 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation> | |
255 | is the number of components or indices in a pixel, | |
256 | <inlineequation><mml:math><mml:mi mathvariant="italic">l</mml:mi></mml:math></inlineequation> | |
257 | is the number of pixels in a row | |
258 | (<constant>GL_PACK_ROW_LENGTH</constant> if it is greater than 0, | |
259 | the | |
260 | <inlineequation><mml:math><mml:mi mathvariant="italic">width</mml:mi></mml:math></inlineequation> | |
261 | argument to the pixel routine otherwise), | |
262 | <inlineequation><mml:math><mml:mi mathvariant="italic">a</mml:mi></mml:math></inlineequation> | |
263 | is the value of <constant>GL_PACK_ALIGNMENT</constant>, and | |
264 | <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation> | |
265 | is the size, in bytes, of a single component | |
266 | (if | |
267 | <inlineequation><mml:math> | |
268 | <!-- eqn: a < s: --> | |
269 | <mml:mrow> | |
270 | <mml:mi mathvariant="italic">a</mml:mi> | |
271 | <mml:mo><</mml:mo> | |
272 | <mml:mi mathvariant="italic">s</mml:mi> | |
273 | </mml:mrow> | |
274 | </mml:math></inlineequation>, | |
275 | then it is as if | |
276 | <inlineequation><mml:math> | |
277 | <!-- eqn: a = s: --> | |
278 | <mml:mrow> | |
279 | <mml:mi mathvariant="italic">a</mml:mi> | |
280 | <mml:mo>=</mml:mo> | |
281 | <mml:mi mathvariant="italic">s</mml:mi> | |
282 | </mml:mrow> | |
283 | </mml:math></inlineequation>). | |
284 | In the case of 1-bit values, | |
285 | the location of the next row is obtained by skipping | |
286 | </para> | |
287 | <para> | |
288 | <inlineequation><mml:math> | |
289 | <!-- eqn: k = 8 a left ceiling { n l } over { 8 a } right ceiling: --> | |
290 | <mml:mrow> | |
291 | <mml:mi mathvariant="italic">k</mml:mi> | |
292 | <mml:mo>=</mml:mo> | |
293 | <mml:mrow> | |
294 | <mml:mn>8</mml:mn> | |
295 | <mml:mo>⁢</mml:mo> | |
296 | <mml:mi mathvariant="italic">a</mml:mi> | |
297 | <mml:mo>⁢</mml:mo> | |
298 | <mml:mfenced open="⌈" close="⌉"> | |
299 | <mml:mfrac> | |
300 | <mml:mfenced open="" close=""> | |
301 | <mml:mrow> | |
302 | <mml:mi mathvariant="italic">n</mml:mi> | |
303 | <mml:mo>⁢</mml:mo> | |
304 | <mml:mi mathvariant="italic">l</mml:mi> | |
305 | </mml:mrow> | |
306 | </mml:mfenced> | |
307 | <mml:mfenced open="" close=""> | |
308 | <mml:mrow> | |
309 | <mml:mn>8</mml:mn> | |
310 | <mml:mo>⁢</mml:mo> | |
311 | <mml:mi mathvariant="italic">a</mml:mi> | |
312 | </mml:mrow> | |
313 | </mml:mfenced> | |
314 | </mml:mfrac> | |
315 | </mml:mfenced> | |
316 | </mml:mrow> | |
317 | </mml:mrow> | |
318 | </mml:math></inlineequation> | |
319 | </para> | |
320 | <para> | |
321 | components or indices. | |
322 | </para> | |
323 | <para> | |
324 | The word <emphasis>component</emphasis> in this description refers to the nonindex values | |
325 | red, | |
326 | green, | |
327 | blue, | |
328 | alpha, | |
329 | and depth. | |
330 | Storage format <constant>GL_RGB</constant>, | |
331 | for example, | |
332 | has three components per pixel: | |
333 | first red, | |
334 | then green, | |
335 | and finally blue. | |
336 | </para> | |
337 | </listitem> | |
338 | </varlistentry> | |
339 | <varlistentry> | |
340 | <term><constant>GL_PACK_IMAGE_HEIGHT</constant></term> | |
341 | <listitem> | |
342 | <para> | |
343 | If greater than 0, | |
344 | <constant>GL_PACK_IMAGE_HEIGHT</constant> defines the number of pixels in an image | |
345 | three-dimensional texture volume, where ``image'' is defined by all pixels | |
346 | sharing the same third dimension index. | |
347 | If the first pixel of a row is placed at location | |
348 | <inlineequation><mml:math><mml:mi mathvariant="italic">p</mml:mi></mml:math></inlineequation> | |
349 | in memory, | |
350 | then the location of the first pixel of the next row is obtained by skipping | |
351 | </para> | |
352 | <para> | |
353 | <informalequation><mml:math> | |
354 | <!-- eqn: k = left { lpile { n l h above {a over s} left ceiling { s n l h } over a right ceiling} lpile {s >= a above s < a }: --> | |
355 | <mml:mrow> | |
356 | <mml:mi mathvariant="italic">k</mml:mi> | |
357 | <mml:mo>=</mml:mo> | |
358 | <mml:mfenced open="{" close=""> | |
359 | <mml:mrow> | |
360 | <mml:mtable> | |
361 | <mml:mtr><mml:mtd> | |
362 | <mml:mrow> | |
363 | <mml:mi mathvariant="italic">n</mml:mi> | |
364 | <mml:mo>⁢</mml:mo> | |
365 | <mml:mi mathvariant="italic">l</mml:mi> | |
366 | <mml:mo>⁢</mml:mo> | |
367 | <mml:mi mathvariant="italic">h</mml:mi> | |
368 | </mml:mrow> | |
369 | </mml:mtd></mml:mtr> | |
370 | <mml:mtr><mml:mtd> | |
371 | <mml:mrow> | |
372 | <mml:mfenced open="" close=""> | |
373 | <mml:mfrac> | |
374 | <mml:mi mathvariant="italic">a</mml:mi> | |
375 | <mml:mi mathvariant="italic">s</mml:mi> | |
376 | </mml:mfrac> | |
377 | </mml:mfenced> | |
378 | <mml:mo>⁢</mml:mo> | |
379 | <mml:mfenced open="⌈" close="⌉"> | |
380 | <mml:mfrac> | |
381 | <mml:mfenced open="" close=""> | |
382 | <mml:mrow> | |
383 | <mml:mi mathvariant="italic">s</mml:mi> | |
384 | <mml:mo>⁢</mml:mo> | |
385 | <mml:mi mathvariant="italic">n</mml:mi> | |
386 | <mml:mo>⁢</mml:mo> | |
387 | <mml:mi mathvariant="italic">l</mml:mi> | |
388 | <mml:mo>⁢</mml:mo> | |
389 | <mml:mi mathvariant="italic">h</mml:mi> | |
390 | </mml:mrow> | |
391 | </mml:mfenced> | |
392 | <mml:mi mathvariant="italic">a</mml:mi> | |
393 | </mml:mfrac> | |
394 | </mml:mfenced> | |
395 | </mml:mrow> | |
396 | </mml:mtd></mml:mtr> | |
397 | </mml:mtable> | |
398 | <mml:mo>⁢</mml:mo> | |
399 | <mml:mtable> | |
400 | <mml:mtr><mml:mtd> | |
401 | <mml:mrow> | |
402 | <mml:mi mathvariant="italic">s</mml:mi> | |
403 | <mml:mo>>=</mml:mo> | |
404 | <mml:mi mathvariant="italic">a</mml:mi> | |
405 | </mml:mrow> | |
406 | </mml:mtd></mml:mtr> | |
407 | <mml:mtr><mml:mtd> | |
408 | <mml:mrow> | |
409 | <mml:mi mathvariant="italic">s</mml:mi> | |
410 | <mml:mo><</mml:mo> | |
411 | <mml:mi mathvariant="italic">a</mml:mi> | |
412 | </mml:mrow> | |
413 | </mml:mtd></mml:mtr> | |
414 | </mml:mtable> | |
415 | </mml:mrow> | |
416 | </mml:mfenced> | |
417 | </mml:mrow> | |
418 | </mml:math></informalequation> | |
419 | </para> | |
420 | <para> | |
421 | components or indices, where | |
422 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation> | |
423 | is the number of components or indices | |
424 | in a pixel, | |
425 | <inlineequation><mml:math><mml:mi mathvariant="italic">l</mml:mi></mml:math></inlineequation> | |
426 | is the number of pixels in a row | |
427 | (<constant>GL_PACK_ROW_LENGTH</constant> if it is greater than 0, the | |
428 | <inlineequation><mml:math><mml:mi mathvariant="italic">width</mml:mi></mml:math></inlineequation> | |
429 | argument to <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry> otherwise), | |
430 | <inlineequation><mml:math><mml:mi mathvariant="italic">h</mml:mi></mml:math></inlineequation> | |
431 | is the number of | |
432 | rows in a pixel image (<constant>GL_PACK_IMAGE_HEIGHT</constant> if it is greater than | |
433 | 0, the | |
434 | <inlineequation><mml:math><mml:mi mathvariant="italic">height</mml:mi></mml:math></inlineequation> | |
435 | argument to the <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry> routine otherwise), | |
436 | <inlineequation><mml:math><mml:mi mathvariant="italic">a</mml:mi></mml:math></inlineequation> | |
437 | is the value of | |
438 | <constant>GL_PACK_ALIGNMENT</constant>, and | |
439 | <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation> | |
440 | is the size, in bytes, of a single | |
441 | component (if | |
442 | <inlineequation><mml:math> | |
443 | <!-- eqn: a < s: --> | |
444 | <mml:mrow> | |
445 | <mml:mi mathvariant="italic">a</mml:mi> | |
446 | <mml:mo><</mml:mo> | |
447 | <mml:mi mathvariant="italic">s</mml:mi> | |
448 | </mml:mrow> | |
449 | </mml:math></inlineequation>, | |
450 | then it is as if | |
451 | <inlineequation><mml:math> | |
452 | <!-- eqn: a = s: --> | |
453 | <mml:mrow> | |
454 | <mml:mi mathvariant="italic">a</mml:mi> | |
455 | <mml:mo>=</mml:mo> | |
456 | <mml:mi mathvariant="italic">s</mml:mi> | |
457 | </mml:mrow> | |
458 | </mml:math></inlineequation>). | |
459 | </para> | |
460 | <para> | |
461 | The word <emphasis>component</emphasis> in this description refers to the nonindex values | |
462 | red, | |
463 | green, | |
464 | blue, | |
465 | alpha, | |
466 | and depth. | |
467 | Storage format <constant>GL_RGB</constant>, | |
468 | for example, | |
469 | has three components per pixel: | |
470 | first red, | |
471 | then green, | |
472 | and finally blue. | |
473 | </para> | |
474 | </listitem> | |
475 | </varlistentry> | |
476 | <varlistentry> | |
477 | <term><constant>GL_PACK_SKIP_PIXELS</constant>, <constant>GL_PACK_SKIP_ROWS</constant>, and <constant>GL_PACK_SKIP_IMAGES</constant></term> | |
478 | <listitem> | |
479 | <para> | |
480 | These values are provided as a convenience to the programmer; | |
481 | they provide no functionality that cannot be duplicated simply by | |
482 | incrementing the pointer passed to <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>. | |
483 | Setting <constant>GL_PACK_SKIP_PIXELS</constant> to | |
484 | <inlineequation><mml:math><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation> | |
485 | is equivalent to incrementing | |
486 | the pointer by | |
487 | <inlineequation><mml:math> | |
488 | <!-- eqn: i n: --> | |
489 | <mml:mrow> | |
490 | <mml:mi mathvariant="italic">i</mml:mi> | |
491 | <mml:mo>⁢</mml:mo> | |
492 | <mml:mi mathvariant="italic">n</mml:mi> | |
493 | </mml:mrow> | |
494 | </mml:math></inlineequation> | |
495 | components or indices, | |
496 | where | |
497 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation> | |
498 | is the number of components or indices in each pixel. | |
499 | Setting <constant>GL_PACK_SKIP_ROWS</constant> to | |
500 | <inlineequation><mml:math><mml:mi mathvariant="italic">j</mml:mi></mml:math></inlineequation> | |
501 | is equivalent to incrementing | |
502 | the pointer by | |
503 | <inlineequation><mml:math> | |
504 | <!-- eqn: j m: --> | |
505 | <mml:mrow> | |
506 | <mml:mi mathvariant="italic">j</mml:mi> | |
507 | <mml:mo>⁢</mml:mo> | |
508 | <mml:mi mathvariant="italic">m</mml:mi> | |
509 | </mml:mrow> | |
510 | </mml:math></inlineequation> | |
511 | components or indices, | |
512 | where | |
513 | <inlineequation><mml:math><mml:mi mathvariant="italic">m</mml:mi></mml:math></inlineequation> | |
514 | is the number of components or indices per row, | |
515 | as just computed in the <constant>GL_PACK_ROW_LENGTH</constant> section. | |
516 | Setting <constant>GL_PACK_SKIP_IMAGES</constant> to | |
517 | <inlineequation><mml:math><mml:mi mathvariant="italic">k</mml:mi></mml:math></inlineequation> | |
518 | is equivalent to incrementing | |
519 | the pointer by | |
520 | <inlineequation><mml:math> | |
521 | <!-- eqn: k p: --> | |
522 | <mml:mrow> | |
523 | <mml:mi mathvariant="italic">k</mml:mi> | |
524 | <mml:mo>⁢</mml:mo> | |
525 | <mml:mi mathvariant="italic">p</mml:mi> | |
526 | </mml:mrow> | |
527 | </mml:math></inlineequation>, | |
528 | where | |
529 | <inlineequation><mml:math><mml:mi mathvariant="italic">p</mml:mi></mml:math></inlineequation> | |
530 | is the number of components or indices | |
531 | per image, as computed in the <constant>GL_PACK_IMAGE_HEIGHT</constant> section. | |
532 | </para> | |
533 | </listitem> | |
534 | </varlistentry> | |
535 | <varlistentry> | |
536 | <term><constant>GL_PACK_ALIGNMENT</constant></term> | |
537 | <listitem> | |
538 | <para> | |
539 | Specifies the alignment requirements for the start of each pixel row in memory. | |
540 | The allowable values are | |
541 | 1 (byte-alignment), | |
542 | 2 (rows aligned to even-numbered bytes), | |
543 | 4 (word-alignment), and | |
544 | 8 (rows start on double-word boundaries). | |
545 | </para> | |
546 | </listitem> | |
547 | </varlistentry> | |
548 | </variablelist> | |
549 | <para> | |
550 | The other six of the twelve storage parameters affect how pixel data is | |
551 | read from client memory. | |
552 | These values are significant for | |
553 | <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>, | |
554 | <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>, | |
555 | <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>, | |
556 | <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>, | |
557 | <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>, and | |
558 | <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry> | |
559 | </para> | |
560 | <para> | |
561 | They are as follows: | |
562 | </para> | |
563 | <variablelist> | |
564 | <varlistentry> | |
565 | <term><constant>GL_UNPACK_SWAP_BYTES</constant></term> | |
566 | <listitem> | |
567 | <para> | |
568 | If true, | |
569 | byte ordering for multibyte color components, | |
570 | depth components, | |
571 | or stencil indices | |
572 | is reversed. | |
573 | That is, | |
574 | if a four-byte component consists of bytes | |
575 | <inlineequation><mml:math> | |
576 | <!-- eqn: b sub 0: --> | |
577 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
578 | <mml:mn>0</mml:mn> | |
579 | </mml:msub> | |
580 | </mml:math></inlineequation>, | |
581 | <inlineequation><mml:math> | |
582 | <!-- eqn: b sub 1: --> | |
583 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
584 | <mml:mn>1</mml:mn> | |
585 | </mml:msub> | |
586 | </mml:math></inlineequation>, | |
587 | <inlineequation><mml:math> | |
588 | <!-- eqn: b sub 2: --> | |
589 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
590 | <mml:mn>2</mml:mn> | |
591 | </mml:msub> | |
592 | </mml:math></inlineequation>, | |
593 | <inlineequation><mml:math> | |
594 | <!-- eqn: b sub 3: --> | |
595 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
596 | <mml:mn>3</mml:mn> | |
597 | </mml:msub> | |
598 | </mml:math></inlineequation>, | |
599 | it is taken from memory as | |
600 | <inlineequation><mml:math> | |
601 | <!-- eqn: b sub 3: --> | |
602 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
603 | <mml:mn>3</mml:mn> | |
604 | </mml:msub> | |
605 | </mml:math></inlineequation>, | |
606 | <inlineequation><mml:math> | |
607 | <!-- eqn: b sub 2: --> | |
608 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
609 | <mml:mn>2</mml:mn> | |
610 | </mml:msub> | |
611 | </mml:math></inlineequation>, | |
612 | <inlineequation><mml:math> | |
613 | <!-- eqn: b sub 1: --> | |
614 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
615 | <mml:mn>1</mml:mn> | |
616 | </mml:msub> | |
617 | </mml:math></inlineequation>, | |
618 | <inlineequation><mml:math> | |
619 | <!-- eqn: b sub 0: --> | |
620 | <mml:msub><mml:mi mathvariant="italic">b</mml:mi> | |
621 | <mml:mn>0</mml:mn> | |
622 | </mml:msub> | |
623 | </mml:math></inlineequation> | |
624 | if <constant>GL_UNPACK_SWAP_BYTES</constant> is true. | |
625 | <constant>GL_UNPACK_SWAP_BYTES</constant> has no effect on the memory order of components | |
626 | within a pixel, | |
627 | only on the order of bytes within components or indices. | |
628 | For example, | |
629 | the three components of a <constant>GL_RGB</constant> format pixel are always stored with | |
630 | red first, | |
631 | green second, | |
632 | and blue third, | |
633 | regardless of the value of <constant>GL_UNPACK_SWAP_BYTES</constant>. | |
634 | </para> | |
635 | </listitem> | |
636 | </varlistentry> | |
637 | <varlistentry> | |
638 | <term><constant>GL_UNPACK_LSB_FIRST</constant></term> | |
639 | <listitem> | |
640 | <para> | |
641 | If true, | |
642 | bits are ordered within a byte from least significant to most significant; | |
643 | otherwise, | |
644 | the first bit in each byte is the most significant one. | |
645 | </para> | |
646 | </listitem> | |
647 | </varlistentry> | |
648 | <varlistentry> | |
649 | <term><constant>GL_UNPACK_ROW_LENGTH</constant></term> | |
650 | <listitem> | |
651 | <para> | |
652 | If greater than 0, | |
653 | <constant>GL_UNPACK_ROW_LENGTH</constant> defines the number of pixels in a row. | |
654 | If the first pixel of a row is placed at location | |
655 | <inlineequation><mml:math><mml:mi mathvariant="italic">p</mml:mi></mml:math></inlineequation> | |
656 | in memory, | |
657 | then the location of the first pixel of the next row is obtained by skipping | |
658 | </para> | |
659 | <para> | |
660 | <informalequation><mml:math> | |
661 | <!-- eqn: k = left { lpile { n l above {a over s} left ceiling { s n l } over a right ceiling } lpile { s >= a above s < a }: --> | |
662 | <mml:mrow> | |
663 | <mml:mi mathvariant="italic">k</mml:mi> | |
664 | <mml:mo>=</mml:mo> | |
665 | <mml:mfenced open="{" close=""> | |
666 | <mml:mrow> | |
667 | <mml:mtable> | |
668 | <mml:mtr><mml:mtd> | |
669 | <mml:mrow> | |
670 | <mml:mi mathvariant="italic">n</mml:mi> | |
671 | <mml:mo>⁢</mml:mo> | |
672 | <mml:mi mathvariant="italic">l</mml:mi> | |
673 | </mml:mrow> | |
674 | </mml:mtd></mml:mtr> | |
675 | <mml:mtr><mml:mtd> | |
676 | <mml:mrow> | |
677 | <mml:mfenced open="" close=""> | |
678 | <mml:mfrac> | |
679 | <mml:mi mathvariant="italic">a</mml:mi> | |
680 | <mml:mi mathvariant="italic">s</mml:mi> | |
681 | </mml:mfrac> | |
682 | </mml:mfenced> | |
683 | <mml:mo>⁢</mml:mo> | |
684 | <mml:mfenced open="⌈" close="⌉"> | |
685 | <mml:mfrac> | |
686 | <mml:mfenced open="" close=""> | |
687 | <mml:mrow> | |
688 | <mml:mi mathvariant="italic">s</mml:mi> | |
689 | <mml:mo>⁢</mml:mo> | |
690 | <mml:mi mathvariant="italic">n</mml:mi> | |
691 | <mml:mo>⁢</mml:mo> | |
692 | <mml:mi mathvariant="italic">l</mml:mi> | |
693 | </mml:mrow> | |
694 | </mml:mfenced> | |
695 | <mml:mi mathvariant="italic">a</mml:mi> | |
696 | </mml:mfrac> | |
697 | </mml:mfenced> | |
698 | </mml:mrow> | |
699 | </mml:mtd></mml:mtr> | |
700 | </mml:mtable> | |
701 | <mml:mo>⁢</mml:mo> | |
702 | <mml:mtable> | |
703 | <mml:mtr><mml:mtd> | |
704 | <mml:mrow> | |
705 | <mml:mi mathvariant="italic">s</mml:mi> | |
706 | <mml:mo>>=</mml:mo> | |
707 | <mml:mi mathvariant="italic">a</mml:mi> | |
708 | </mml:mrow> | |
709 | </mml:mtd></mml:mtr> | |
710 | <mml:mtr><mml:mtd> | |
711 | <mml:mrow> | |
712 | <mml:mi mathvariant="italic">s</mml:mi> | |
713 | <mml:mo><</mml:mo> | |
714 | <mml:mi mathvariant="italic">a</mml:mi> | |
715 | </mml:mrow> | |
716 | </mml:mtd></mml:mtr> | |
717 | </mml:mtable> | |
718 | </mml:mrow> | |
719 | </mml:mfenced> | |
720 | </mml:mrow> | |
721 | </mml:math></informalequation> | |
722 | </para> | |
723 | <para> | |
724 | components or indices, | |
725 | where | |
726 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation> | |
727 | is the number of components or indices in a pixel, | |
728 | <inlineequation><mml:math><mml:mi mathvariant="italic">l</mml:mi></mml:math></inlineequation> | |
729 | is the number of pixels in a row | |
730 | (<constant>GL_UNPACK_ROW_LENGTH</constant> if it is greater than 0, | |
731 | the | |
732 | <inlineequation><mml:math><mml:mi mathvariant="italic">width</mml:mi></mml:math></inlineequation> | |
733 | argument to the pixel routine otherwise), | |
734 | <inlineequation><mml:math><mml:mi mathvariant="italic">a</mml:mi></mml:math></inlineequation> | |
735 | is the value of <constant>GL_UNPACK_ALIGNMENT</constant>, and | |
736 | <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation> | |
737 | is the size, in bytes, of a single component | |
738 | (if | |
739 | <inlineequation><mml:math> | |
740 | <!-- eqn: a < s: --> | |
741 | <mml:mrow> | |
742 | <mml:mi mathvariant="italic">a</mml:mi> | |
743 | <mml:mo><</mml:mo> | |
744 | <mml:mi mathvariant="italic">s</mml:mi> | |
745 | </mml:mrow> | |
746 | </mml:math></inlineequation>, | |
747 | then it is as if | |
748 | <inlineequation><mml:math> | |
749 | <!-- eqn: a = s: --> | |
750 | <mml:mrow> | |
751 | <mml:mi mathvariant="italic">a</mml:mi> | |
752 | <mml:mo>=</mml:mo> | |
753 | <mml:mi mathvariant="italic">s</mml:mi> | |
754 | </mml:mrow> | |
755 | </mml:math></inlineequation>). | |
756 | In the case of 1-bit values, | |
757 | the location of the next row is obtained by skipping | |
758 | </para> | |
759 | <para> | |
760 | <inlineequation><mml:math> | |
761 | <!-- eqn: k = 8 a left ceiling { n l } over { 8 a } right ceiling: --> | |
762 | <mml:mrow> | |
763 | <mml:mi mathvariant="italic">k</mml:mi> | |
764 | <mml:mo>=</mml:mo> | |
765 | <mml:mrow> | |
766 | <mml:mn>8</mml:mn> | |
767 | <mml:mo>⁢</mml:mo> | |
768 | <mml:mi mathvariant="italic">a</mml:mi> | |
769 | <mml:mo>⁢</mml:mo> | |
770 | <mml:mfenced open="⌈" close="⌉"> | |
771 | <mml:mfrac> | |
772 | <mml:mfenced open="" close=""> | |
773 | <mml:mrow> | |
774 | <mml:mi mathvariant="italic">n</mml:mi> | |
775 | <mml:mo>⁢</mml:mo> | |
776 | <mml:mi mathvariant="italic">l</mml:mi> | |
777 | </mml:mrow> | |
778 | </mml:mfenced> | |
779 | <mml:mfenced open="" close=""> | |
780 | <mml:mrow> | |
781 | <mml:mn>8</mml:mn> | |
782 | <mml:mo>⁢</mml:mo> | |
783 | <mml:mi mathvariant="italic">a</mml:mi> | |
784 | </mml:mrow> | |
785 | </mml:mfenced> | |
786 | </mml:mfrac> | |
787 | </mml:mfenced> | |
788 | </mml:mrow> | |
789 | </mml:mrow> | |
790 | </mml:math></inlineequation> | |
791 | </para> | |
792 | <para> | |
793 | components or indices. | |
794 | </para> | |
795 | <para> | |
796 | The word <emphasis>component</emphasis> in this description refers to the nonindex values | |
797 | red, | |
798 | green, | |
799 | blue, | |
800 | alpha, | |
801 | and depth. | |
802 | Storage format <constant>GL_RGB</constant>, | |
803 | for example, | |
804 | has three components per pixel: | |
805 | first red, | |
806 | then green, | |
807 | and finally blue. | |
808 | </para> | |
809 | </listitem> | |
810 | </varlistentry> | |
811 | <varlistentry> | |
812 | <term><constant>GL_UNPACK_IMAGE_HEIGHT</constant></term> | |
813 | <listitem> | |
814 | <para> | |
815 | If greater than 0, | |
816 | <constant>GL_UNPACK_IMAGE_HEIGHT</constant> defines the number of pixels in an image of | |
817 | a three-dimensional texture volume. Where ``image'' is defined by all | |
818 | pixel sharing the same third dimension index. | |
819 | If the first pixel of a row is placed at location | |
820 | <inlineequation><mml:math><mml:mi mathvariant="italic">p</mml:mi></mml:math></inlineequation> | |
821 | in memory, | |
822 | then the location of the first pixel of the next row is obtained by skipping | |
823 | </para> | |
824 | <para> | |
825 | <informalequation><mml:math> | |
826 | <!-- eqn: k = left { lpile { n l h above {a over s} left ceiling { s n l h } over a right ceiling } lpile { s >= a above s < a }: --> | |
827 | <mml:mrow> | |
828 | <mml:mi mathvariant="italic">k</mml:mi> | |
829 | <mml:mo>=</mml:mo> | |
830 | <mml:mfenced open="{" close=""> | |
831 | <mml:mrow> | |
832 | <mml:mtable> | |
833 | <mml:mtr><mml:mtd> | |
834 | <mml:mrow> | |
835 | <mml:mi mathvariant="italic">n</mml:mi> | |
836 | <mml:mo>⁢</mml:mo> | |
837 | <mml:mi mathvariant="italic">l</mml:mi> | |
838 | <mml:mo>⁢</mml:mo> | |
839 | <mml:mi mathvariant="italic">h</mml:mi> | |
840 | </mml:mrow> | |
841 | </mml:mtd></mml:mtr> | |
842 | <mml:mtr><mml:mtd> | |
843 | <mml:mrow> | |
844 | <mml:mfenced open="" close=""> | |
845 | <mml:mfrac> | |
846 | <mml:mi mathvariant="italic">a</mml:mi> | |
847 | <mml:mi mathvariant="italic">s</mml:mi> | |
848 | </mml:mfrac> | |
849 | </mml:mfenced> | |
850 | <mml:mo>⁢</mml:mo> | |
851 | <mml:mfenced open="⌈" close="⌉"> | |
852 | <mml:mfrac> | |
853 | <mml:mfenced open="" close=""> | |
854 | <mml:mrow> | |
855 | <mml:mi mathvariant="italic">s</mml:mi> | |
856 | <mml:mo>⁢</mml:mo> | |
857 | <mml:mi mathvariant="italic">n</mml:mi> | |
858 | <mml:mo>⁢</mml:mo> | |
859 | <mml:mi mathvariant="italic">l</mml:mi> | |
860 | <mml:mo>⁢</mml:mo> | |
861 | <mml:mi mathvariant="italic">h</mml:mi> | |
862 | </mml:mrow> | |
863 | </mml:mfenced> | |
864 | <mml:mi mathvariant="italic">a</mml:mi> | |
865 | </mml:mfrac> | |
866 | </mml:mfenced> | |
867 | </mml:mrow> | |
868 | </mml:mtd></mml:mtr> | |
869 | </mml:mtable> | |
870 | <mml:mo>⁢</mml:mo> | |
871 | <mml:mtable> | |
872 | <mml:mtr><mml:mtd> | |
873 | <mml:mrow> | |
874 | <mml:mi mathvariant="italic">s</mml:mi> | |
875 | <mml:mo>>=</mml:mo> | |
876 | <mml:mi mathvariant="italic">a</mml:mi> | |
877 | </mml:mrow> | |
878 | </mml:mtd></mml:mtr> | |
879 | <mml:mtr><mml:mtd> | |
880 | <mml:mrow> | |
881 | <mml:mi mathvariant="italic">s</mml:mi> | |
882 | <mml:mo><</mml:mo> | |
883 | <mml:mi mathvariant="italic">a</mml:mi> | |
884 | </mml:mrow> | |
885 | </mml:mtd></mml:mtr> | |
886 | </mml:mtable> | |
887 | </mml:mrow> | |
888 | </mml:mfenced> | |
889 | </mml:mrow> | |
890 | </mml:math></informalequation> | |
891 | </para> | |
892 | <para> | |
893 | components or indices, | |
894 | where | |
895 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation> | |
896 | is the number of components or indices in a pixel, | |
897 | <inlineequation><mml:math><mml:mi mathvariant="italic">l</mml:mi></mml:math></inlineequation> | |
898 | is the number of pixels in a row | |
899 | (<constant>GL_UNPACK_ROW_LENGTH</constant> if it is greater than 0, | |
900 | the | |
901 | <inlineequation><mml:math><mml:mi mathvariant="italic">width</mml:mi></mml:math></inlineequation> | |
902 | argument to <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry> otherwise), | |
903 | <inlineequation><mml:math><mml:mi mathvariant="italic">h</mml:mi></mml:math></inlineequation> | |
904 | is the number of rows in an image (<constant>GL_UNPACK_IMAGE_HEIGHT</constant> if | |
905 | it is greater than 0, the | |
906 | <inlineequation><mml:math><mml:mi mathvariant="italic">height</mml:mi></mml:math></inlineequation> | |
907 | argument to <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry> otherwise), | |
908 | <inlineequation><mml:math><mml:mi mathvariant="italic">a</mml:mi></mml:math></inlineequation> | |
909 | is the value of <constant>GL_UNPACK_ALIGNMENT</constant>, and | |
910 | <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation> | |
911 | is the size, in bytes, of a single component | |
912 | (if | |
913 | <inlineequation><mml:math> | |
914 | <!-- eqn: a < s: --> | |
915 | <mml:mrow> | |
916 | <mml:mi mathvariant="italic">a</mml:mi> | |
917 | <mml:mo><</mml:mo> | |
918 | <mml:mi mathvariant="italic">s</mml:mi> | |
919 | </mml:mrow> | |
920 | </mml:math></inlineequation>, | |
921 | then it is as if | |
922 | <inlineequation><mml:math> | |
923 | <!-- eqn: a = s: --> | |
924 | <mml:mrow> | |
925 | <mml:mi mathvariant="italic">a</mml:mi> | |
926 | <mml:mo>=</mml:mo> | |
927 | <mml:mi mathvariant="italic">s</mml:mi> | |
928 | </mml:mrow> | |
929 | </mml:math></inlineequation>). | |
930 | </para> | |
931 | <para> | |
932 | The word <emphasis>component</emphasis> in this description refers to the nonindex values | |
933 | red, | |
934 | green, | |
935 | blue, | |
936 | alpha, | |
937 | and depth. | |
938 | Storage format <constant>GL_RGB</constant>, | |
939 | for example, | |
940 | has three components per pixel: | |
941 | first red, | |
942 | then green, | |
943 | and finally blue. | |
944 | </para> | |
945 | </listitem> | |
946 | </varlistentry> | |
947 | <varlistentry> | |
948 | <term><constant>GL_UNPACK_SKIP_PIXELS</constant> and <constant>GL_UNPACK_SKIP_ROWS</constant></term> | |
949 | <listitem> | |
950 | <para> | |
951 | These values are provided as a convenience to the programmer; | |
952 | they provide no functionality that cannot be duplicated by | |
953 | incrementing the pointer passed to | |
954 | <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>, | |
955 | <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>, | |
956 | <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry> or | |
957 | <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>. | |
958 | Setting <constant>GL_UNPACK_SKIP_PIXELS</constant> to | |
959 | <inlineequation><mml:math><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation> | |
960 | is equivalent to incrementing | |
961 | the pointer by | |
962 | <inlineequation><mml:math> | |
963 | <!-- eqn: i n: --> | |
964 | <mml:mrow> | |
965 | <mml:mi mathvariant="italic">i</mml:mi> | |
966 | <mml:mo>⁢</mml:mo> | |
967 | <mml:mi mathvariant="italic">n</mml:mi> | |
968 | </mml:mrow> | |
969 | </mml:math></inlineequation> | |
970 | components or indices, | |
971 | where | |
972 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation> | |
973 | is the number of components or indices in each pixel. | |
974 | Setting <constant>GL_UNPACK_SKIP_ROWS</constant> to | |
975 | <inlineequation><mml:math><mml:mi mathvariant="italic">j</mml:mi></mml:math></inlineequation> | |
976 | is equivalent to incrementing | |
977 | the pointer by | |
978 | <inlineequation><mml:math> | |
979 | <!-- eqn: j k: --> | |
980 | <mml:mrow> | |
981 | <mml:mi mathvariant="italic">j</mml:mi> | |
982 | <mml:mo>⁢</mml:mo> | |
983 | <mml:mi mathvariant="italic">k</mml:mi> | |
984 | </mml:mrow> | |
985 | </mml:math></inlineequation> | |
986 | components or indices, | |
987 | where | |
988 | <inlineequation><mml:math><mml:mi mathvariant="italic">k</mml:mi></mml:math></inlineequation> | |
989 | is the number of components or indices per row, | |
990 | as just computed in the <constant>GL_UNPACK_ROW_LENGTH</constant> section. | |
991 | </para> | |
992 | </listitem> | |
993 | </varlistentry> | |
994 | <varlistentry> | |
995 | <term><constant>GL_UNPACK_ALIGNMENT</constant></term> | |
996 | <listitem> | |
997 | <para> | |
998 | Specifies the alignment requirements for the start of each pixel row in memory. | |
999 | The allowable values are | |
1000 | 1 (byte-alignment), | |
1001 | 2 (rows aligned to even-numbered bytes), | |
1002 | 4 (word-alignment), and | |
1003 | 8 (rows start on double-word boundaries). | |
1004 | </para> | |
1005 | </listitem> | |
1006 | </varlistentry> | |
1007 | </variablelist> | |
1008 | <para> | |
1009 | The following table gives the type, | |
1010 | initial value, | |
1011 | and range of valid values for each storage parameter | |
1012 | that can be set with <function>glPixelStore</function>. | |
1013 | </para> | |
1014 | <para> | |
1015 | </para> | |
1016 | <informaltable frame="topbot"> | |
1017 | <tgroup cols="4" align="left"> | |
1018 | <colspec colwidth="2.5*" /> | |
1019 | <colspec colwidth="1*" align="center"/> | |
1020 | <colspec colwidth="1*" align="center"/> | |
1021 | <colspec colwidth="2*" align="center"/> | |
1022 | <thead> | |
1023 | <row> | |
1024 | <entry rowsep="1" align="left"><emphasis role="bold"> | |
1025 | <parameter>pname</parameter> | |
1026 | </emphasis></entry> | |
1027 | <entry rowsep="1" align="center"><emphasis role="bold"> | |
1028 | Type | |
1029 | </emphasis></entry> | |
1030 | <entry rowsep="1" align="center"><emphasis role="bold"> | |
1031 | Initial Value | |
1032 | </emphasis></entry> | |
1033 | <entry rowsep="1" align="center"><emphasis role="bold"> | |
1034 | Valid Range | |
1035 | </emphasis></entry> | |
1036 | </row> | |
1037 | </thead> | |
1038 | <tbody> | |
1039 | <row> | |
1040 | <entry align="left"> | |
1041 | <constant>GL_PACK_SWAP_BYTES</constant> | |
1042 | </entry> | |
1043 | <entry align="center"> | |
1044 | boolean | |
1045 | </entry> | |
1046 | <entry align="center"> | |
1047 | false | |
1048 | </entry> | |
1049 | <entry align="center"> | |
1050 | true or false | |
1051 | </entry> | |
1052 | </row> | |
1053 | <row> | |
1054 | <entry align="left"> | |
1055 | <constant>GL_PACK_LSB_FIRST</constant> | |
1056 | </entry> | |
1057 | <entry align="center"> | |
1058 | boolean | |
1059 | </entry> | |
1060 | <entry align="center"> | |
1061 | false | |
1062 | </entry> | |
1063 | <entry align="center"> | |
1064 | true or false | |
1065 | </entry> | |
1066 | </row> | |
1067 | <row> | |
1068 | <entry align="left"> | |
1069 | <constant>GL_PACK_ROW_LENGTH</constant> | |
1070 | </entry> | |
1071 | <entry align="center"> | |
1072 | integer | |
1073 | </entry> | |
1074 | <entry align="center"> | |
1075 | 0 | |
1076 | </entry> | |
1077 | <entry align="center"> | |
1078 | <inlineequation><mml:math> | |
1079 | <!-- eqn: left [ 0,\(if right ): --> | |
1080 | <mml:mfenced open="[" close=")"> | |
1081 | <mml:mn>0</mml:mn> | |
1082 | <mml:infinity/> | |
1083 | </mml:mfenced> | |
1084 | </mml:math></inlineequation> | |
1085 | </entry> | |
1086 | </row> | |
1087 | <row> | |
1088 | <entry align="left"> | |
1089 | <constant>GL_PACK_IMAGE_HEIGHT</constant> | |
1090 | </entry> | |
1091 | <entry align="center"> | |
1092 | integer | |
1093 | </entry> | |
1094 | <entry align="center"> | |
1095 | 0 | |
1096 | </entry> | |
1097 | <entry align="center"> | |
1098 | <inlineequation><mml:math> | |
1099 | <!-- eqn: left [ 0, \(if right ): --> | |
1100 | <mml:mfenced open="[" close=")"> | |
1101 | <mml:mn>0</mml:mn> | |
1102 | <mml:infinity/> | |
1103 | </mml:mfenced> | |
1104 | </mml:math></inlineequation> | |
1105 | </entry> | |
1106 | </row> | |
1107 | <row> | |
1108 | <entry align="left"> | |
1109 | <constant>GL_PACK_SKIP_ROWS</constant> | |
1110 | </entry> | |
1111 | <entry align="center"> | |
1112 | integer | |
1113 | </entry> | |
1114 | <entry align="center"> | |
1115 | 0 | |
1116 | </entry> | |
1117 | <entry align="center"> | |
1118 | <inlineequation><mml:math> | |
1119 | <!-- eqn: left [ 0,\(if right ): --> | |
1120 | <mml:mfenced open="[" close=")"> | |
1121 | <mml:mn>0</mml:mn> | |
1122 | <mml:infinity/> | |
1123 | </mml:mfenced> | |
1124 | </mml:math></inlineequation> | |
1125 | </entry> | |
1126 | </row> | |
1127 | <row> | |
1128 | <entry align="left"> | |
1129 | <constant>GL_PACK_SKIP_PIXELS</constant> | |
1130 | </entry> | |
1131 | <entry align="center"> | |
1132 | integer | |
1133 | </entry> | |
1134 | <entry align="center"> | |
1135 | 0 | |
1136 | </entry> | |
1137 | <entry align="center"> | |
1138 | <inlineequation><mml:math> | |
1139 | <!-- eqn: left [ 0,\(if right ): --> | |
1140 | <mml:mfenced open="[" close=")"> | |
1141 | <mml:mn>0</mml:mn> | |
1142 | <mml:infinity/> | |
1143 | </mml:mfenced> | |
1144 | </mml:math></inlineequation> | |
1145 | </entry> | |
1146 | </row> | |
1147 | <row> | |
1148 | <entry align="left"> | |
1149 | <constant>GL_PACK_SKIP_IMAGES</constant> | |
1150 | </entry> | |
1151 | <entry align="center"> | |
1152 | integer | |
1153 | </entry> | |
1154 | <entry align="center"> | |
1155 | 0 | |
1156 | </entry> | |
1157 | <entry align="center"> | |
1158 | <inlineequation><mml:math> | |
1159 | <!-- eqn: left [ 0,\(if right ): --> | |
1160 | <mml:mfenced open="[" close=")"> | |
1161 | <mml:mn>0</mml:mn> | |
1162 | <mml:infinity/> | |
1163 | </mml:mfenced> | |
1164 | </mml:math></inlineequation> | |
1165 | </entry> | |
1166 | </row> | |
1167 | <row> | |
1168 | <entry align="left"> | |
1169 | <constant>GL_PACK_ALIGNMENT</constant> | |
1170 | </entry> | |
1171 | <entry align="center"> | |
1172 | integer | |
1173 | </entry> | |
1174 | <entry align="center"> | |
1175 | 4 | |
1176 | </entry> | |
1177 | <entry align="center"> | |
1178 | 1, 2, 4, or 8 | |
1179 | </entry> | |
1180 | </row> | |
1181 | <row> | |
1182 | <entry align="left"> | |
1183 | <constant>GL_UNPACK_SWAP_BYTES</constant> | |
1184 | </entry> | |
1185 | <entry align="center"> | |
1186 | boolean | |
1187 | </entry> | |
1188 | <entry align="center"> | |
1189 | false | |
1190 | </entry> | |
1191 | <entry align="center"> | |
1192 | true or false | |
1193 | </entry> | |
1194 | </row> | |
1195 | <row> | |
1196 | <entry align="left"> | |
1197 | <constant>GL_UNPACK_LSB_FIRST</constant> | |
1198 | </entry> | |
1199 | <entry align="center"> | |
1200 | boolean | |
1201 | </entry> | |
1202 | <entry align="center"> | |
1203 | false | |
1204 | </entry> | |
1205 | <entry align="center"> | |
1206 | true or false | |
1207 | </entry> | |
1208 | </row> | |
1209 | <row> | |
1210 | <entry align="left"> | |
1211 | <constant>GL_UNPACK_ROW_LENGTH</constant> | |
1212 | </entry> | |
1213 | <entry align="center"> | |
1214 | integer | |
1215 | </entry> | |
1216 | <entry align="center"> | |
1217 | 0 | |
1218 | </entry> | |
1219 | <entry align="center"> | |
1220 | <inlineequation><mml:math> | |
1221 | <!-- eqn: left [ 0,\(if right ): --> | |
1222 | <mml:mfenced open="[" close=")"> | |
1223 | <mml:mn>0</mml:mn> | |
1224 | <mml:infinity/> | |
1225 | </mml:mfenced> | |
1226 | </mml:math></inlineequation> | |
1227 | </entry> | |
1228 | </row> | |
1229 | <row> | |
1230 | <entry align="left"> | |
1231 | <constant>GL_UNPACK_IMAGE_HEIGHT</constant> | |
1232 | </entry> | |
1233 | <entry align="center"> | |
1234 | integer | |
1235 | </entry> | |
1236 | <entry align="center"> | |
1237 | 0 | |
1238 | </entry> | |
1239 | <entry align="center"> | |
1240 | <inlineequation><mml:math> | |
1241 | <!-- eqn: left [ 0,\(if right ): --> | |
1242 | <mml:mfenced open="[" close=")"> | |
1243 | <mml:mn>0</mml:mn> | |
1244 | <mml:infinity/> | |
1245 | </mml:mfenced> | |
1246 | </mml:math></inlineequation> | |
1247 | </entry> | |
1248 | </row> | |
1249 | <row> | |
1250 | <entry align="left"> | |
1251 | <constant>GL_UNPACK_SKIP_ROWS</constant> | |
1252 | </entry> | |
1253 | <entry align="center"> | |
1254 | integer | |
1255 | </entry> | |
1256 | <entry align="center"> | |
1257 | 0 | |
1258 | </entry> | |
1259 | <entry align="center"> | |
1260 | <inlineequation><mml:math> | |
1261 | <!-- eqn: left [ 0,\(if right ): --> | |
1262 | <mml:mfenced open="[" close=")"> | |
1263 | <mml:mn>0</mml:mn> | |
1264 | <mml:infinity/> | |
1265 | </mml:mfenced> | |
1266 | </mml:math></inlineequation> | |
1267 | </entry> | |
1268 | </row> | |
1269 | <row> | |
1270 | <entry align="left"> | |
1271 | <constant>GL_UNPACK_SKIP_PIXELS</constant> | |
1272 | </entry> | |
1273 | <entry align="center"> | |
1274 | integer | |
1275 | </entry> | |
1276 | <entry align="center"> | |
1277 | 0 | |
1278 | </entry> | |
1279 | <entry align="center"> | |
1280 | <inlineequation><mml:math> | |
1281 | <!-- eqn: left [ 0,\(if right ): --> | |
1282 | <mml:mfenced open="[" close=")"> | |
1283 | <mml:mn>0</mml:mn> | |
1284 | <mml:infinity/> | |
1285 | </mml:mfenced> | |
1286 | </mml:math></inlineequation> | |
1287 | </entry> | |
1288 | </row> | |
1289 | <row> | |
1290 | <entry align="left"> | |
1291 | <constant>GL_UNPACK_SKIP_IMAGES</constant> | |
1292 | </entry> | |
1293 | <entry align="center"> | |
1294 | integer | |
1295 | </entry> | |
1296 | <entry align="center"> | |
1297 | 0 | |
1298 | </entry> | |
1299 | <entry align="center"> | |
1300 | <inlineequation><mml:math> | |
1301 | <!-- eqn: left [ 0,\(if right ): --> | |
1302 | <mml:mfenced open="[" close=")"> | |
1303 | <mml:mn>0</mml:mn> | |
1304 | <mml:infinity/> | |
1305 | </mml:mfenced> | |
1306 | </mml:math></inlineequation> | |
1307 | </entry> | |
1308 | </row> | |
1309 | <row> | |
1310 | <entry align="left"> | |
1311 | <constant>GL_UNPACK_ALIGNMENT</constant> | |
1312 | </entry> | |
1313 | <entry align="center"> | |
1314 | integer | |
1315 | </entry> | |
1316 | <entry align="center"> | |
1317 | 4 | |
1318 | </entry> | |
1319 | <entry align="center"> | |
1320 | 1, 2, 4, or 8 | |
1321 | </entry> | |
1322 | </row> | |
1323 | </tbody> | |
1324 | </tgroup> | |
1325 | </informaltable> | |
1326 | <para> | |
1327 | <function>glPixelStoref</function> can be used to set any pixel store parameter. | |
1328 | If the parameter type is boolean, | |
1329 | then if <parameter>param</parameter> is 0, | |
1330 | the parameter is false; | |
1331 | otherwise it is set to true. | |
1332 | If <parameter>pname</parameter> is a integer type parameter, | |
1333 | <parameter>param</parameter> is rounded to the nearest integer. | |
1334 | </para> | |
1335 | <para> | |
1336 | Likewise, <function>glPixelStorei</function> can also be used to set any of the | |
1337 | pixel store parameters. | |
1338 | Boolean parameters are set to false if <parameter>param</parameter> is 0 and true otherwise. | |
1339 | </para> | |
1340 | </refsect1> | |
1341 | <refsect1 id="errors"><title>Errors</title> | |
1342 | <para> | |
1343 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>pname</parameter> is not an accepted value. | |
1344 | </para> | |
1345 | <para> | |
1346 | <constant>GL_INVALID_VALUE</constant> is generated if a negative row length, | |
1347 | pixel skip, | |
1348 | or row skip value is specified, | |
1349 | or if alignment is specified as other than 1, 2, 4, or 8. | |
1350 | </para> | |
1351 | </refsect1> | |
1352 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
1353 | <para> | |
1354 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PACK_SWAP_BYTES</constant> | |
1355 | </para> | |
1356 | <para> | |
1357 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PACK_LSB_FIRST</constant> | |
1358 | </para> | |
1359 | <para> | |
1360 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PACK_ROW_LENGTH</constant> | |
1361 | </para> | |
1362 | <para> | |
1363 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PACK_IMAGE_HEIGHT</constant> | |
1364 | </para> | |
1365 | <para> | |
1366 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PACK_SKIP_ROWS</constant> | |
1367 | </para> | |
1368 | <para> | |
1369 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PACK_SKIP_PIXELS</constant> | |
1370 | </para> | |
1371 | <para> | |
1372 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PACK_SKIP_IMAGES</constant> | |
1373 | </para> | |
1374 | <para> | |
1375 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PACK_ALIGNMENT</constant> | |
1376 | </para> | |
1377 | <para> | |
1378 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_UNPACK_SWAP_BYTES</constant> | |
1379 | </para> | |
1380 | <para> | |
1381 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_UNPACK_LSB_FIRST</constant> | |
1382 | </para> | |
1383 | <para> | |
1384 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_UNPACK_ROW_LENGTH</constant> | |
1385 | </para> | |
1386 | <para> | |
1387 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_UNPACK_IMAGE_HEIGHT</constant> | |
1388 | </para> | |
1389 | <para> | |
1390 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_UNPACK_SKIP_ROWS</constant> | |
1391 | </para> | |
1392 | <para> | |
1393 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_UNPACK_SKIP_PIXELS</constant> | |
1394 | </para> | |
1395 | <para> | |
1396 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_UNPACK_SKIP_IMAGES</constant> | |
1397 | </para> | |
1398 | <para> | |
1399 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_UNPACK_ALIGNMENT</constant> | |
1400 | </para> | |
1401 | </refsect1> | |
1402 | <refsect1 id="seealso"><title>See Also</title> | |
1403 | <para> | |
1404 | <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>, | |
1405 | <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>, | |
1406 | <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>, | |
1407 | <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>, | |
1408 | <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>, | |
1409 | <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>, | |
1410 | <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>, | |
1411 | <citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>, | |
1412 | <citerefentry><refentrytitle>glCompressedTexImage2D</refentrytitle></citerefentry>, | |
1413 | <citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>, | |
1414 | <citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>, | |
1415 | <citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry>, | |
1416 | <citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>. | |
1417 | </para> | |
1418 | </refsect1> | |
1419 | <refsect1 id="Copyright"><title>Copyright</title> | |
1420 | <para> | |
1421 | Copyright <trademark class="copyright"></trademark> 1991-2006 | |
1422 | Silicon Graphics, Inc. <trademark class="copyright"></trademark> 2011 | |
1423 | Khronos Group. This document is licensed under the SGI | |
1424 | Free Software B License. For details, see | |
1425 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. | |
1426 | </para> | |
1427 | </refsect1> | |
1428 | </refentry> |