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