MirOS Manual: glPixelStore(3), glPixelStoref(3), glPixelStorei(3)


GLPIXELSTORE(3G)    UNIX Programmer's Manual     GLPIXELSTORE(3G)

NAME

     glPixelStoref, glPixelStorei - set pixel storage modes

C SPECIFICATION

     void glPixelStoref( GLenum pname,
                         GLfloat param )
     void glPixelStorei( GLenum pname,
                         GLint param )

PARAMETERS

     pname  Specifies the symbolic name of the parameter to be
            set. Six values affect the packing of pixel data into
            memory: GL_PACK_SWAP_BYTES, GL_PACK_LSB_FIRST,
            GL_PACK_ROW_LENGTH, GL_PACK_IMAGE_HEIGHT,
            GL_PACK_SKIP_PIXELS, GL_PACK_SKIP_ROWS,
            GL_PACK_SKIP_IMAGES, and GL_PACK_ALIGNMENT. Six more
            affect the unpacking of pixel data from memory:
            GL_UNPACK_SWAP_BYTES, GL_UNPACK_LSB_FIRST,
            GL_UNPACK_ROW_LENGTH, GL_UNPACK_IMAGE_HEIGHT,
            GL_UNPACK_SKIP_PIXELS, GL_UNPACK_SKIP_ROWS,
            GL_UNPACK_SKIP_IMAGES, and GL_UNPACK_ALIGNMENT.

     param  Specifies the value that pname is set to.

DESCRIPTION

     glPixelStore sets pixel storage modes that affect the opera-
     tion of subsequent glDrawPixels and glReadPixels as well as
     the unpacking of polygon stipple patterns (see
     glPolygonStipple), bitmaps (see glBitmap), texture patterns
     (see glTexImage1D, glTexImage2D, glTexImage3D,
     glTexSubImage1D, glTexSubImage2D, glTexSubImage3D). Addi-
     tionally, if the GL_ARB_imaging extension is supported,
     pixle storage modes affect convlution filters (see
     glConvolutionFilter1D, glConvolutionFilter2D, and
     glSeparableFilter2D, color table (see glColorTable, and
     glColorSubTable, and unpacking histogram (See glHistogram),
     and minmax (See glMinmax) data.

     pname is a symbolic constant indicating the parameter to be
     set, and param is the new value.  Six of the twelve storage
     parameters affect how pixel data is returned to client
     memory. They are as follows:

     GL_PACK_SWAP_BYTES
               If true, byte ordering for multibyte color com-
               ponents, depth components, color indices, or sten-
               cil indices is reversed. That is, if a four-byte
               component consists of bytes b0, b1, b2, b3, it is
               stored in memory as b3, b2, b1, b0 if
               GL_PACK_SWAP_BYTES is true. GL_PACK_SWAP_BYTES has

MirOS BSD #10-current   Printed 20.2.2012                       1

GLPIXELSTORE(3G)    UNIX Programmer's Manual     GLPIXELSTORE(3G)

               no effect on the memory order of components within
               a pixel, only on the order of bytes within com-
               ponents or indices. For example, the three com-
               ponents of a GL_RGB  pixel are always stored with
               red first, green second, and blue third, regard-
               less of the value of GL_PACK_SWAP_BYTES.

     GL_PACK_LSB_FIRST
               If true, bits are ordered within a byte from least
               significant to most significant; otherwise, the
               first bit in each byte is the most significant
               one. This parameter is significant for bitmap data
               only.

     GL_PACK_ROW_LENGTH
               If greater than 0, GL_PACK_ROW_LENGTH defines the
               number of pixels in a row. If the first pixel of a
               row is placed at location p in memory, then the
               location of the first pixel of the next row is
               obtained by skipping
                                   |
                                   |nl      s ≥ a
                              k =  |_|_n__|  s < a
                                   |s| a |
                                   |
               components or indices, where n is the number of
               components or indices in a pixel, l is the number
               of pixels in a row (GL_PACK_ROW_LENGTH if it is
               greater than 0, the width argument to the pixel
               routine otherwise), a is the value of
               GL_PACK_ALIGNMENT, and s is the size, in bytes, of
               a single component (if a<s, then it is as if
               a = s). In the case of 1-bit values, the location
               of the next row is obtained by skipping

                                   k = 8a|_l_|
                                         |8a|
               components or indices.

               The word component in this description refers to
               the nonindex values red, green, blue, alpha, and
               depth. Storage  GL_RGB, for example, has three
               components per pixel: first red, then green, and
               finally blue.

     GL_PACK_IMAGE_HEIGHT
               If greater than 0, GL_PACK_IMAGE_HEIGHT defines
               the number of pixels in an image three-dimensional
               texture volume. Where ``image'' is defined by all
               pixels sharing the same third dimension index. If
               the first pixel of a row is placed at location p
               in memory, then the location of the first pixel of

MirOS BSD #10-current   Printed 20.2.2012                       2

GLPIXELSTORE(3G)    UNIX Programmer's Manual     GLPIXELSTORE(3G)

               the next row is obtained by skipping
                                  |
                                  | nlh      s ≥ a
                             k =  | _|_n__h_|  s < a
                                  | s| a  |
                                  |
               components or indices, where n is the number of
               components or indices in a pixel, l is the number
               of pixels in a row (GL_PACK_ROW_LENGTH if it is
               greater than 0,  the width argument to
               glTexImage3d otherwise), h is the number of rows
               in a pixel image (GL_PACK_IMAGE_HEIGHT if it is
               greater than 0, the height argument to the
               glTexImage3D routine otherwise), a is the value of
               GL_PACK_ALIGNMENT, and s is the size, in bytes, of
               a single component (if a<s, then it is as if a=s).

               The word component in this description refers to
               the nonindex values red, green, blue, alpha, and
               depth. Storage  GL_RGB, for example, has three
               components per pixel: first red, then green, and
               finally blue.

     GL_PACK_SKIP_PIXELS, GL_PACK_SKIP_ROWS, and GL_PACK_SKIP_IMAGES
               These values are provided as a convenience to the
               programmer; they provide no functionality that
               cannot be duplicated simply by incrementing the
               pointer passed to glReadPixels. Setting
               GL_PACK_SKIP_PIXELS to i is equivalent to incre-
               menting the pointer by in components or indices,
               where n is the number of components or indices in
               each pixel. Setting GL_PACK_SKIP_ROWS to j is
               equivalent to incrementing the pointer by jm com-
               ponents or indices, where m is the number of com-
               ponents or indices per row, as just computed in
               the GL_PACK_ROW_LENGTH section. Setting
               GL_PACK_SKIP_IMAGES to k is equivalent to incre-
               menting the pointer by kp, where p is the number
               of components or indices per image, as computed in
               the GL_PACK_IMAGE_HEIGHT section.

     GL_PACK_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 other six of the twelve storage parameters affect how
     pixel data is read from client memory. These values are sig-
     nificant for glDrawPixels, glTexImage1D, glTexImage2D,
     glTexImage3D, glTexSubImage1D, glTexSubImage2D,

MirOS BSD #10-current   Printed 20.2.2012                       3

GLPIXELSTORE(3G)    UNIX Programmer's Manual     GLPIXELSTORE(3G)

     glTexSubImage3D, glBitmap, and glPolygonStipple.

     Additionally, if the GL_ARB_imaging extension is supported,
     glColorTable, glColorSubTable, glConvolutionFilter1D,
     glConvolutionFilter2D, and glSeparableFilter2D. They are as
     follows:

     GL_UNPACK_SWAP_BYTES
          If true, byte ordering for multibyte color components,
          depth components, color indices, or stencil indices is
          reversed. That is, if a four-byte component consists of
          bytes b0, b1, b2, b3, it is taken from memory as b3,
          b2, b1, b0 if GL_UNPACK_SWAP_BYTES is true.
          GL_UNPACK_SWAP_BYTES has no effect on the memory order
          of components within a pixel, only on the order of
          bytes within components or indices. For example, the
          three components of a GL_RGB  pixel are always stored
          with red first, green second, and blue third, regard-
          less of the value of GL_UNPACK_SWAP_BYTES.

     GL_UNPACK_LSB_FIRST
          If true, bits are ordered within a byte from least sig-
          nificant to most significant; otherwise, the first bit
          in each byte is the most significant one. This is
          relevant only for bitmap data.

     GL_UNPACK_ROW_LENGTH
          If greater than 0, GL_UNPACK_ROW_LENGTH defines the
          number of pixels in a row. If the first pixel of a row
          is placed at location p in memory, then the location of
          the first pixel of the next row is obtained by skipping
                                |
                                | nl      s ≥ a
                           k =  | _|_n__|  s < a
                                | s| a |
                                |
          components or indices, where n is the number of com-
          ponents or indices in a pixel, l is the number of pix-
          els in a row (GL_UNPACK_ROW_LENGTH if it is greater
          than 0, the width argument to the pixel routine other-
          wise), a is the value of GL_UNPACK_ALIGNMENT, and s is
          the size, in bytes, of a single component (if a<s, then
          it is as if a=s). In the case of 1-bit values, the
          location of the next row is obtained by skipping

                                k = 8a|_l_|
                                      |8a|
          components or indices.

          The word component in this description refers to the
          nonindex values red, green, blue, alpha, and depth.
          Storage  GL_RGB, for example, has three components per

MirOS BSD #10-current   Printed 20.2.2012                       4

GLPIXELSTORE(3G)    UNIX Programmer's Manual     GLPIXELSTORE(3G)

          pixel: first red, then green, and finally blue.

     GL_UNPACK_IMAGE_HEIGHT
          If greater than 0, GL_UNPACK_IMAGE_HEIGHT defines the
          number of pixels in an image of a three-dimensional
          texture volume.  Where ``image'' is defined by all
          pixel sharing the same third dimension index. If the
          first pixel of a row is placed at location p in memory,
          then the location of the first pixel of the next row is
          obtained by skipping
                                |
                                | nlh      s ≥ a
                           k =  | _|_n__h_|  s < a
                                | s| a  |
                                |
          components or indices, where n is the number of com-
          ponents or indices in a pixel, l is the number of pix-
          els in a row (GL_UNPACK_ROW_LENGTH if it is greater
          than 0, the width argument to glTexImage3D otherwise),
          h is the number of rows in an image (-
          GL_UNPACK_IMAGE_HEIGHT if it is greater than 0, the
          height argument to glTexImage3D otherwise), a is the
          value of GL_UNPACK_ALIGNMENT, and s is the size, in
          bytes, of a single component (if a<s, then it is as if
          a = s).

          The word component in this description refers to the
          nonindex values red, green, blue, alpha, and depth.
          Storage  GL_RGB, for example, has three components per
          pixel: first red, then green, and finally blue.

     GL_UNPACK_SKIP_PIXELS and GL_UNPACK_SKIP_ROWS
          These values are provided as a convenience to the pro-
          grammer; they provide no functionality that cannot be
          duplicated by incrementing the pointer passed to
          glDrawPixels, glTexImage1D, glTexImage2D,
          glTexSubImage1D, glTexSubImage2D, glBitmap, or
          glPolygonStipple. Setting GL_UNPACK_SKIP_PIXELS to i is
          equivalent to incrementing the pointer by in components
          or indices, where n is the number of components or
          indices in each pixel. Setting GL_UNPACK_SKIP_ROWS to j
          is equivalent to incrementing the pointer by jk com-
          ponents 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).

MirOS BSD #10-current   Printed 20.2.2012                       5

GLPIXELSTORE(3G)    UNIX Programmer's Manual     GLPIXELSTORE(3G)

     The following table gives the type, initial value, and range
     of valid values for each storage parameter that can be set
     with glPixelStore.

MirOS BSD #10-current   Printed 20.2.2012                       6

Generated on 2012-02-20 02:47:02 by $MirOS: src/scripts/roff2htm,v 1.70 2011/12/03 18:21:12 tg Exp $

These manual pages and other documentation are copyrighted by their respective writers; their source is available at our CVSweb, AnonCVS, and other mirrors. The rest is Copyright © 2002‒2011 The MirOS Project, Germany.
This product includes material provided by Thorsten Glaser.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.