P
glPixelStore
Chapter 14
331
equivalent to incrementing the pointer by jk components or indices, where k is the
number of components or indices per row, as just computed in the
GL_UNPACK_ROW_LENGTH section.
GL_UNPACK_ALIGNMENT
Specifies the alignment requirements for the start of each pixel row in memory. The
allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4
(word-alignment), and 8 (rows start on double-word boundaries).
The following table gives the type, initial value, and range of valid values for each
storage parameter that can be set with glPixelStore.
glPixelStoref can be used to set any pixel store parameter. If the parameter type is
boolean, then if param is 0, the parameter is false; otherwise it is set to true. If pname is
a integer type parameter, param is rounded to the nearest integer.
Likewise, glPixelStorei can also be used to set any of the pixel store parameters. Boolean
parameters are set to false if param is 0 and true otherwise.
Notes
The pixel storage modes in effect when glDrawPixels, glReadPixels, glTexImage1D,
glTexImage2D, glTexSubImage1D, glTexSubImage2D, glBitmap, or glPolygonStipple is
placed in a display list control the interpretation of memory data. The pixel storage
modes in effect when a display list is executed are not significant.
Pixel storage modes are client state and must be pushed and restored using
glPushClientAttrib and glPopClientAttrib.
pname Type
Initial
Value
Valid
Range
GL_PACK_SWAP_BYTES boolean false true or false
GL_PACK_LSB_FIRST boolean false true or false
GL_PACK_ROW_LENGTH integer 0
[0, ∞]
GL_PACK_SKIP_ROWS integer 0
[0, ∞]
GL_PACK_SKIP_PIXELS integer 0
[0, ∞]
GL_PACK_ALIGNMENT integer 4 1, 2, 4 or 8
GL_UNPACK_SWAP_BYTES boolean false true or false
GL_UNPACK_LSB_FIRST boolean false true or false
GL_UNPACK_ROW_LENGTH integer 0
[0, ∞]
GL_UNPACK_SKIP_ROWS integer 0
[0, ∞]
GL_UNPACK_SKIP_PIXELS integer 0
[0, ∞]
GL_UNPACK_ALIGNMENT integer 4 1, 2, 4 or 8