GLPIXELSTOREI(3G)

    .SH "NAME" glPixelStorei - set pixel storage modes
    .SH "C SPECIFICATION"

            .HP u void glPixelStorei(GLenum pname, GLint param);

    .SH "PARAMETERS"

        .PP pname

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

            .RE
            .PP param

                        Specifies the value that pname is set to.

                .RE

            .SH "DESCRIPTION"
                .PP glPixelStorei sets pixel storage modes that affect the operation of subsequent glReadPixels() as well as the unpacking of texture patterns (see glTexImage2D(), glTexImage3D(), glTexSubImage2D(), glTexSubImage3D()).
                .PP pname is a symbolic constant indicating the parameter to be set, and param is the new value. Four of the ten storage parameters affect how pixel data is returned to client memory. They are as follows:

                    .PP 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

                                k = n ⁢ l a s ⁢ s ⁢ n ⁢ l a ⁢ 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 = 8 ⁢ a ⁢ n ⁢ l 8 ⁢ a

                                components or indices.

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

                        .RE
                        .PP GL_PACK_SKIP_PIXELS and GL_PACK_SKIP_ROWS

                                    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 incrementing the pointer by i ⁢ n 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 j ⁢ m components or indices, where m is the number of components or indices per row, as just computed in the GL_PACK_ROW_LENGTH section.

                            .RE
                            .PP 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).

                                .RE

                            .PP The other six of the ten storage parameters affect how pixel data is read from client memory. These values are significant for glTexImage2D(), glTexImage3D(), glTexSubImage2D(), and glTexSubImage3D()
                            .PP They are as follows:

                                .PP 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

                                            k = n ⁢ l a s ⁢ s ⁢ n ⁢ l a ⁢ 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_UNPACK_ROW_LENGTH if it is greater than 0, the width argument to the pixel routine 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). In the case of 1-bit values, the location of the next row is obtained by skipping

                                            k = 8 ⁢ a ⁢ n ⁢ l 8 ⁢ a

                                            components or indices.

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

                                    .RE
                                    .PP 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

                                                k = n ⁢ l ⁢ h a s ⁢ s ⁢ n ⁢ l ⁢ h a ⁢ 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_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 format GL_RGB, for example, has three components per pixel: first red, then green, and finally blue.

                                        .RE
                                        .PP GL_UNPACK_SKIP_PIXELS, GL_UNPACK_SKIP_ROWS and GL_UNPACK_SKIP_IMAGES

                                                    These values are provided as a convenience to the programmer; they provide no functionality that cannot be duplicated by incrementing the pointer passed to glTexImage1D(), glTexImage2D(), glTexSubImage1D() or glTexSubImage2D(). Setting GL_UNPACK_SKIP_PIXELS to i is equivalent to incrementing the pointer by i ⁢ n 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 j ⁢ k components or indices, where k is the number of components or indices per row, as just computed in the GL_UNPACK_ROW_LENGTH section. Setting GL_UNPACK_SKIP_IMAGES to k is equivalent to incrementing the pointer by k ⁢ p, where p is the number of components or indices per image, as computed in the GL_UNPACK_IMAGE_HEIGHT section.

                                            .RE
                                            .PP 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).

                                                .RE

                                            .PP The following table gives the type, initial value, and range of valid values for each storage parameter that can be set with glPixelStorei.
                                            .PP
                                            .TS allbox tab(:); lB cB cB cB l. T{ pname T}:T{ Type T}:T{ Initial Value T}:T{ Valid Range T}:T{ T} l c c c l l c c c l l c c c l l c c c l l c c c l l c c c l l c c c l l c c c l l c c c l l c c c l. T{ GL_PACK_ROW_LENGTH T}:T{ integer T}:T{ 0 T}:T{ 0 T}:T{ T} T{ GL_PACK_SKIP_ROWS T}:T{ integer T}:T{ 0 T}:T{ 0 T}:T{ T} T{ GL_PACK_SKIP_PIXELS T}:T{ integer T}:T{ 0 T}:T{ 0 T}:T{ T} T{ GL_PACK_ALIGNMENT T}:T{ integer T}:T{ 4 T}:T{ 1, 2, 4, or 8 T}:T{ T} T{ GL_UNPACK_ROW_LENGTH T}:T{ integer T}:T{ 0 T}:T{ 0 T}:T{ T} T{ GL_UNPACK_IMAGE_HEIGHT T}:T{ integer T}:T{ 0 T}:T{ 0 T}:T{ T} T{ GL_UNPACK_SKIP_ROWS T}:T{ integer T}:T{ 0 T}:T{ 0 T}:T{ T} T{ GL_UNPACK_SKIP_PIXELS T}:T{ integer T}:T{ 0 T}:T{ 0 T}:T{ T} T{ GL_UNPACK_SKIP_IMAGES T}:T{ integer T}:T{ 0 T}:T{ 0 T}:T{ T} T{ GL_UNPACK_ALIGNMENT T}:T{ integer T}:T{ 4 T}:T{ 1, 2, 4, or 8 T}:T{ T}

                                        .SH "ERRORS"
                                            .PP GL_INVALID_ENUM is generated if pname is not an accepted value.
                                            .PP GL_INVALID_VALUE is generated if a negative row length, pixel skip, or row skip value is specified, or if alignment is specified as other than 1, 2, 4, or 8.

                                        .SH "ASSOCIATED GETS"
                                            .PP glGet() with argument GL_PACK_ROW_LENGTH
                                            .PP glGet() with argument GL_PACK_SKIP_ROWS
                                            .PP glGet() with argument GL_PACK_SKIP_PIXELS
                                            .PP glGet() with argument GL_PACK_ALIGNMENT
                                            .PP glGet() with argument GL_UNPACK_ROW_LENGTH
                                            .PP glGet() with argument GL_UNPACK_IMAGE_HEIGHT
                                            .PP glGet() with argument GL_UNPACK_SKIP_ROWS
                                            .PP glGet() with argument GL_UNPACK_SKIP_PIXELS
                                            .PP glGet() with argument GL_UNPACK_SKIP_IMAGES
                                            .PP glGet() with argument GL_UNPACK_ALIGNMENT

                                        .SH "API VERSION SUPPORT"

                                            .TS allbox tab(:); l l l l l. T{ glPixelStorei T}:T{ T}:T{ T}:T{ T}:T{ T}

                                        .SH "SEE ALSO"
                                            .PP glReadPixels(), glTexImage2D(), glTexImage3D(), glTexSubImage2D(), glTexSubImage3D()

                                        .SH "COPYRIGHT"
                                            .PP Copyright © 1991-2006 Silicon Graphics, Inc. Copyright © 2010-2016 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.

COPYRIGHT
Copyright © 1991-2006 Silicon Graphics, Inc.
Copyright © 2010-2016 Khronos Group