OpenGL C bindings library: libGL.a
void glPixelTransferf(GLenum pName, GLfloat Parameter)
void glPixelTransferi(GLenum pName, GLint Parameter)
pName | Specifies the symbolic name of the pixel transfer parameter to be set. Must be one of the following: |
Parameter | Specifies the value to which pName is set. |
The glPixelTransfer subroutine sets pixel transfer modes that affect the operation of subsequent glDrawPixels, glReadPixels, glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D, glCopyTexSubImage2D, glCopyTexSubImage3DEXT, glTexImage1D, glTexImage2D, glTexImage3DEXT, glTexSubImage1D, glTexSubImage2D, and glTexSubImage3DEXT subroutines. The algorithms that are specified by pixel transfer modes operate on pixels after they are read from the frame buffer (glReadPixels and glCopyPixels) or unpacked from client memory (glDrawPixels, glReadPixels, glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D, glCopyTexSubImage2D, glCopyTexSubImage3DEXT, glTexImage1D, glTexImage2D, glTexImage3DEXT, glTexSubImage1D, glTexSubImage2D, and glTexSubImage3DEXT subroutines). Pixel transfer operations happen in the same order, and in the same manner, regardless of the command that resulted in the pixel operation. Pixel storage modes control the unpacking of pixels being read from client memory and the packing of pixels being written back into client memory. (See the glPixelStore subroutine for information on setting pixel storage modes.)
Pixel transfer operations handle four fundamental pixel types: color, color index, depth, and stencil. Color pixels are made up of four floating-point values with unspecified mantissa and exponent sizes, scaled such that 0.0 represents 0 (zero) intensity and 1.0 represents full intensity. Color indexes comprise a single fixed-point value, with unspecified precision to the right of the binary point. Depth pixels comprise a single floating-point value, with unspecified mantissa and exponent sizes, scaled such that 0.0 represents the minimum depth buffer value and 1.0 represents the maximum depth buffer value. Finally, stencil pixels comprise a single fixed-point value, with unspecified precision to the right of the binary point.
The pixel transfer operations performed on the four basic pixel types are as follows:
The following table gives the type, initial value, and range of valid values for each of the pixel transfer parameters that are set with glPixelTransfer.
pName | Type | Initial Value | Valid Range |
GL_MAP_COLOR | Boolean | False | True or False |
GL_MAP_STENCIL | Boolean | False | True or False |
GL_INDEX_SHIFT | integer | 0 | (-infinity,+infinity) |
GL_INDEX_OFFSET | integer | 0 | (-infinity,+infinity) |
GL_RED_SCALE | float | 1.0 | (-infinity,+infinity) |
GL_GREEN_SCALE | float | 1.0 | (-infinity,+infinity) |
GL_BLUE_SCALE | float | 1.0 | (-infinity,+infinity) |
GL_ALPHA_SCALE | float | 1.0 | (-infinity,+infinity) |
GL_DEPTH_SCALE | float | 1.0 | (-infinity,+infinity) |
GL_RED_BIAS | float | 0.0 | (-infinity,+infinity) |
GL_GREEN_BIAS | float | 0.0 | (-infinity,+infinity) |
GL_BLUE_BIAS | float | 0.0 | (-infinity,+infinity) |
GL_ALPHA_BIAS | float | 0.0 | (-infinity,+infinity) |
GL_DEPTH_BIAS | float | 0.0 | (-infinity,+infinity) |
The glPixelTransferf subroutine can be used to set any pixel transfer parameter. If the parameter type is Boolean, 0.0 implies False and any other value implies True. If pName is an integer parameter, Parameter is rounded to the nearest integer.
Likewise, glPixelTransferi can be used to set any of the pixel transfer parameters. Boolean parameters are set to False if Parameter is 0 and True otherwise. Parameter is converted to floating-point format before being assigned to real-valued parameters.
If a glDrawPixels, glReadPixels, glCopyPixels, glTexImage1D, or glTexImage2D subroutine is placed in a display list (see the glNewList subroutine and the glCallList subroutine for information about display lists), the pixel transfer mode settings in effect when the display list is executed are the ones that are used. They may be different from the settings when the command was compiled into the display list.
GL_INVALID_ENUM | pName is not an accepted value. |
GL_INVALID_OPERATION | The glPixelTransfer subroutine is called between a call to glBegin and the corresponding call to glEnd. |
Associated gets for the glPixelTransfer subroutine are as follows. (See the glGet subroutine for more information.)
glGet with argument GL_MAP_COLOR
glGet with argument GL_MAP_STENCIL
glGet with argument GL_INDEX_SHIFT
glGet with argument GL_INDEX_OFFSET
glGet with argument GL_RED_SCALE
glGet with argument GL_RED_BIAS
glGet with argument GL_GREEN_SCALE
glGet with argument GL_GREEN_BIAS
glGet with argument GL_BLUE_SCALE
glGet with argument GL_BLUE_BIAS
glGet with argument GL_ALPHA_SCALE
glGet with argument GL_ALPHA_BIAS
glGet with argument GL_DEPTH_SCALE
glGet with argument GL_DEPTH_BIAS.
/usr/include/GL/gl.h | Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. |
The glBegin or glEnd subroutine, glCallList subroutine, glCopyPixels subroutine, glCopyTexImage1D subroutine, glCopyTexImage2D subroutine, glCopyTexSubImage1D subroutine, glCopyTexSubImage2D subroutine, glCopyTexSubImage3DEXT subroutine, glDrawPixels subroutine, glNewList subroutine, glPixelMap subroutine, glPixelStore subroutine, glPixelZoom subroutine, glReadPixels subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexSubImage1D subroutine, glTexSubImage2D subroutine, glTexSubImage3DEXT subroutine, .