fglPixelTransfer(3G)
fglPixelTransferf, fglPixelTransferi - set pixel transfer modes
As shipped in IRIX 6.5.7. Unchanged since IRIX 6.5.
NAME fglPixelTransferf, fglPixelTransferi - set pixel transfer modes FORTRAN SPECIFICATION SUBROUTINE fglPixelTransferf( INTEGER*4 pname, REAL*4 param ) SUBROUTINE fglPixelTransferi( INTEGER*4 pname, INTEGER*4 param ) PARAMETERS pname Specifies the symbolic name of the pixel transfer parameter to be set. Must be one of the following: GL_MAP_COLOR, GL_MAP_STENCIL, GL_INDEX_SHIFT, GL_INDEX_OFFSET, GL_RED_SCALE, GL_RED_BIAS, GL_GREEN_SCALE, GL_GREEN_BIAS, GL_BLUE_SCALE, GL_BLUE_BIAS, GL_ALPHA_SCALE, GL_ALPHA_BIAS, GL_DEPTH_SCALE, GL_DEPTH_BIAS, GL_POST_COLOR_MATRIX_RED_SCALE_SGI, GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI, GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI, GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI, GL_POST_COLOR_MATRIX_RED_BIAS_SGI, GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI, GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI, GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI, GL_POST_CONVOLUTION_RED_SCALE_EXT, GL_POST_CONVOLUTION_GREEN_SCALE_EXT, GL_POST_CONVOLUTION_BLUE_SCALE_EXT, GL_POST_CONVOLUTION_ALPHA_SCALE_EXT, GL_POST_CONVOLUTION_RED_BIAS_EXT, GL_POST_CONVOLUTION_GREEN_BIAS_EXT, GL_POST_CONVOLUTION_BLUE_BIAS_EXT, or GL_POST_CONVOLUTION_ALPHA_BIAS_EXT. param Specifies the value to be assigned to pname. DESCRIPTION fglPixelTransfer sets pixel transfer modes that affect the operation of subsequent fglDrawPixels, fglReadPixels, fglCopyPixels, fglTexImage1D, fglTexImage2D, fglTexImage3DEXT, fglTexSubImage1D (or fglTexSubImage1DEXT), fglTexSubImage2D (or fglTexSubImage2DEXT), fglTexSubImage3DEXT, fglCopyTexImage1D (or fglCopyTexImage1DEXT), fglCopyTexImage2D(or fglCopyTexImage2DEXT), fglCopyTexImage3DEXT, fglCopyTexSubImage1D (or fglCopyTexSubImage1DEXT), fglCopyTexSubImage2D (or fglCopyTexSubImage2DEXT), and fglCopyTexSubImage3DEXT commands. The algorithms that are specified by pixel transfer modes operate on pixels after they are read from the frame buffer (for fglReadPixels, fglCopyPixels, and the fglCopyTex* commands) or unpacked from client memory (for fglDrawPixels, the fglTexImage* commands, and the fglTexSubImage* commands). 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 (see fglPixelStore) control the unpacking of pixels being read from client memory, and the packing of pixels being written back into client memory. 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 represents zero intensity and 1 represents full intensity. Color indices 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: Color Each of the four color components is multiplied by a scale factor, then added to a bias factor. That is, the red component is multiplied by GL_RED_SCALE, then added to GL_RED_BIAS; the green component is multiplied by GL_GREEN_SCALE, then added to GL_GREEN_BIAS; the blue component is multiplied by GL_BLUE_SCALE, then added to GL_BLUE_BIAS; and the alpha component is multiplied by GL_ALPHA_SCALE, then added to GL_ALPHA_BIAS. After all four color components are scaled and biased, each is clamped to the range [0,1]. All color, scale, and bias values are specified with fglPixelTransfer. If GL_MAP_COLOR is true, each color component is scaled by the size of the corresponding color-to-color map, then replaced by the contents of that map indexed by the scaled component. That is, the red component is scaled by GL_PIXEL_MAP_R_TO_R_SIZE, then replaced by the contents of GL_PIXEL_MAP_R_TO_R indexed by itself. The green component is scaled by GL_PIXEL_MAP_G_TO_G_SIZE, then replaced by the contents of GL_PIXEL_MAP_G_TO_G indexed by itself. The blue component is scaled by GL_PIXEL_MAP_B_TO_B_SIZE, then replaced by the contents of GL_PIXEL_MAP_B_TO_B indexed by itself. And the alpha component is scaled by GL_PIXEL_MAP_A_TO_A_SIZE, then replaced by the contents of GL_PIXEL_MAP_A_TO_A indexed by itself. All components taken from the maps are then clamped to the range [0,1]. GL_MAP_COLOR is specified with fglPixelTransfer. The contents of the various maps are specified with fglPixelMap. If the SGI_color_table extension is supported, GL_COLOR_TABLE_SGI is enabled, and the width of the color table is non-zero, then its contents are used to replace a subset of the components of each RGBA pixel group, based on the internal format of the table. All the color table lookups introduced by the SGI_color_table extension behave identically: The color components are first rescaled to the size of the color lookup table to form an index. Then a subset of the components based on the internal format of the table are replaced by the table entry selected by that index. (See fglColorTableSGI for more information.) If the EXT_convolution extension is supported, and GL_CONVOLUTION_1D_EXT, GL_CONVOLUTION_2D_EXT, or GL_SEPARABLE_2D_EXT is enabled, the pixels are convolved with a filter kernel, then scaled and biased. (See fglConvolutionFilter1DEXT, fglConvolutionFilter2DEXT, fglSeparableFilter2DEXT, and fglEnable.) The scale and bias parameters are specified by executing fglPixelTransfer with pname equal to GL_POST_CONVOLUTION_RED_SCALE_EXT, GL_POST_CONVOLUTION_GREEN_SCALE_EXT, GL_POST_CONVOLUTION_BLUE_SCALE_EXT, GL_POST_CONVOLUTION_ALPHA_SCALE_EXT, GL_POST_CONVOLUTION_RED_BIAS_EXT, GL_POST_CONVOLUTION_GREEN_BIAS_EXT, GL_POST_CONVOLUTION_BLUE_BIAS_EXT, and GL_POST_CONVOLUTION_ALPHA_BIAS_EXT. A color lookup is then performed if the SGI_color_table extension is supported and GL_POST_CONVOLUTION_COLOR_TABLE_SGI is enabled. If the SGI_color_matrix extension is supported, then the color components of each pixel are modified by multiplying them with the matrix at the top of the color matrix stack, scaling them by specified values, and then biasing (offsetting) them by specified values. That is, if the original color components are (R, G, B, A), and the matrix at the top of the color matrix stack is represented by m1, m2, ..., m16, then the modified color components (R', G', B', A') are given by: R' = ((m1*R) + (m5*G) + (m9*B) + (m13*A))*Rscale + Rbias G' = ((m2*R) + (m6*G) + (m10*B) + (m14*A))*Gscale + Gbias B' = ((m3*R) + (m7*G) + (m11*B) + (m15*A))*Bscale + Bbias A' = ((m4*R) + (m8*G) + (m12*B) + (m16*A))*Ascale + Abias The color matrix is specified using any of the OpenGL matrix commands when the matrix mode (see fglMatrixMode) is GL_COLOR. The scale and bias terms are specified by executing fglPixelTransfer with pname equal to GL_POST_COLOR_MATRIX_RED_SCALE_SGI, GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI, GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI, GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI, GL_POST_COLOR_MATRIX_RED_BIAS_SGI, GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI, GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI, or GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI and param equal to the desired value. A color lookup is also performed after the color matrix operation if the SGI_color_matrix extension is supported, and GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI is enabled. If the EXT_histogram extension is supported, and GL_HISTOGRAM_EXT is enabled, the pixels are histogrammed. See fglHistogramEXT for more information. If the EXT_histogram extension is supported, and GL_MINMAX_EXT is enabled, the minimum and maximum pixel values are recorded. See fglMinMaxEXT for more information. Color index Each color index is shifted left by GL_INDEX_SHIFT bits; any bits beyond the number of fraction bits carried by the fixed-point index are filled with zeros. If GL_INDEX_SHIFT is negative, the shift is to the right, again zero filled. Then GL_INDEX_OFFSET is added to the index. GL_INDEX_SHIFT and GL_INDEX_OFFSET are specified with fglPixelTransfer. From this point, operation diverges depending on the required format of the resulting pixels. If the resulting pixels are to be written to a color index buffer, or if they are being read back to client memory in GL_COLOR_INDEX format, the pixels continue to be treated as indices. If GL_MAP_COLOR is n true, each index is masked by 2 - 1, where n is GL_PIXEL_MAP_I_TO_I_SIZE, then replaced by the contents of GL_PIXEL_MAP_I_TO_I indexed by the masked value. GL_MAP_COLOR is specified with fglPixelTransfer. The contents of the index map are specified with fglPixelMap. If the resulting pixels are to be written to an RGBA color buffer, or if they are being read back to client memory in a format other than GL_COLOR_INDEX, the pixels are converted from indices to colors by referencing the four maps GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A. Before being n dereferenced, the index is masked by 2 - 1, where n is GL_PIXEL_MAP_I_TO_R_SIZE for the red map, GL_PIXEL_MAP_I_TO_G_SIZE for the green map, GL_PIXEL_MAP_I_TO_B_SIZE for the blue map, and GL_PIXEL_MAP_I_TO_A_SIZE for the alpha map. All components taken from the maps are then clamped to the range [0,1]. The contents of the four maps are specified with fglPixelMap. The remaining pixel transfer operations described above are then applied to the resulting RGBA components. Depth Each depth value is multiplied by GL_DEPTH_SCALE, added to GL_DEPTH_BIAS, then clamped to the range [0,1]. Stencil Each index is shifted GL_INDEX_SHIFT bits just as a color index is, then added to GL_INDEX_OFFSET. If GL_MAP_STENCIL n is true, each index is masked by 2 - 1, where n is GL_PIXEL_MAP_S_TO_S_SIZE, then replaced by the contents of GL_PIXEL_MAP_S_TO_S indexed by the masked value. The following table gives the type, initial value, and range of valid values for each of the pixel transfer parameters that are set with fglPixelTransfer. pname type initial value valid range ____________________________________________________________________________ GL_MAP_COLOR boolean false true/false GL_MAP_STENCIL boolean false true/false GL_INDEX_SHIFT integer 0 (-oo,oo) GL_INDEX_OFFSET integer 0 (-oo,oo) GL_RED_SCALE float 1.0 (-oo,oo) GL_GREEN_SCALE float 1.0 (-oo,oo) GL_BLUE_SCALE float 1.0 (-oo,oo) GL_ALPHA_SCALE float 1.0 (-oo,oo) GL_DEPTH_SCALE float 1.0 (-oo,oo) GL_RED_BIAS float 0.0 (-oo,oo) GL_GREEN_BIAS float 0.0 (-oo,oo) GL_BLUE_BIAS float 0.0 (-oo,oo) GL_ALPHA_BIAS float 0.0 (-oo,oo) GL_DEPTH_BIAS float 0.0 (-oo,oo) GL_POST_COLOR_MATRIX_RED_SCALE_SGI float 1.0 (-oo,oo) GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI float 1.0 (-oo,oo) GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI float 1.0 (-oo,oo) GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI float 1.0 (-oo,oo) GL_POST_COLOR_MATRIX_RED_BIAS_SGI float 0.0 (-oo,oo) GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI float 0.0 (-oo,oo) GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI float 0.0 (-oo,oo) GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI float 0.0 (-oo,oo) GL_POST_CONVOLUTION_RED_SCALE_EXT float 1.0 (-oo,oo) GL_POST_CONVOLUTION_GREEN_SCALE_EXT float 1.0 (-oo,oo) GL_POST_CONVOLUTION_BLUE_SCALE_EXT float 1.0 (-oo,oo) GL_POST_CONVOLUTION_ALPHA_SCALE_EXT float 1.0 (-oo,oo) GL_POST_CONVOLUTION_RED_BIAS_EXT float 0.0 (-oo,oo) GL_POST_CONVOLUTION_GREEN_BIAS_EXT float 0.0 (-oo,oo) GL_POST_CONVOLUTION_BLUE_BIAS_EXT float 0.0 (-oo,oo) GL_POST_CONVOLUTION_ALPHA_BIAS_EXT float 0.0 (-oo,oo) fglPixelTransferf 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, param is rounded to the nearest integer. Likewise, fglPixelTransferi can also be used to set any of the pixel transfer parameters. Boolean parameters are set to false if param is 0 and true otherwise. param is converted to floating point before being assigned to real-valued parameters. NOTES If a fglDrawPixels, fglReadPixels, fglCopyPixels, fglTexImage1D, fglTexImage2D, fglTexImage3DEXT, fglTexSubImage1D (or fglTexSubImage1DEXT), fglTexSubImage2D (or fglTexSubImage2DEXT), fglTexSubImage3DEXT, fglCopyTexImage1D (or fglCopyTexImage1DEXT), fglCopyTexImage2D(or fglCopyTexImage2DEXT), fglCopyTexImage3DEXT, fglCopyTexSubImage1D (or fglCopyTexSubImage1DEXT), fglCopyTexSubImage2D (or fglCopyTexSubImage2DEXT), or fglCopyTexSubImage3DEXT command is placed in a display list (see fglNewList and fglCallList), 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. The color matrix may be used for simple linear color-space conversions. However, it is also useful for ``swizzling'' (reordering or duplicating) color components. This is helpful when processing image data that is not in one of the native OpenGL formats, or when ``packing'' up to four independent channels of luminance data into an RGBA drawable. fglTexSubImage1D, fglTexSubImage2D, fglCopyTexImage1D, fglCopyTexImage2D, fglCopyTexSubImage1D, and fglCopyTexSubImage2D are available only of the GL version is 1.1 or greater. ERRORS GL_INVALID_ENUM is generated if pname is not an accepted value. GL_INVALID_OPERATION is generated if fglPixelTransfer is executed between the execution of fglBegin and the corresponding execution of fglEnd. ASSOCIATED GETS fglGet with argument GL_MAP_COLOR fglGet with argument GL_MAP_STENCIL fglGet with argument GL_INDEX_SHIFT fglGet with argument GL_INDEX_OFFSET fglGet with argument GL_RED_SCALE fglGet with argument GL_RED_BIAS fglGet with argument GL_GREEN_SCALE fglGet with argument GL_GREEN_BIAS fglGet with argument GL_BLUE_SCALE fglGet with argument GL_BLUE_BIAS fglGet with argument GL_ALPHA_SCALE fglGet with argument GL_ALPHA_BIAS fglGet with argument GL_DEPTH_SCALE fglGet with argument GL_DEPTH_BIAS fglGet with argument GL_POST_COLOR_MATRIX_RED_SCALE_SGI fglGet with argument GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI fglGet with argument GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI fglGet with argument GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI fglGet with argument GL_POST_COLOR_MATRIX_RED_BIAS_SGI fglGet with argument GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI fglGet with argument GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI fglGet with argument GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI fglGet with argument GL_POST_CONVOLUTION_RED_SCALE_EXT fglGet with argument GL_POST_CONVOLUTION_GREEN_SCALE_EXT fglGet with argument GL_POST_CONVOLUTION_BLUE_SCALE_EXT fglGet with argument GL_POST_CONVOLUTION_ALPHA_SCALE_EXT fglGet with argument GL_POST_CONVOLUTION_RED_BIAS_EXT fglGet with argument GL_POST_CONVOLUTION_GREEN_BIAS_EXT fglGet with argument GL_POST_CONVOLUTION_BLUE_BIAS_EXT fglGet with argument GL_POST_CONVOLUTION_ALPHA_BIAS_EXT SEE ALSO fglCallList, fglCopyPixels, fglCopyTexImage1D, fglCopyTexImage1DEXT, fglCopyTexImage2D, fglCopyTexImage2DEXT, fglCopyTexImage3DEXT, fglCopyTexSubImage1D, fglCopyTexSubImage1DEXT, fglCopyTexSubImage2D, fglCopyTexSubImage2DEXT, fglCopyTexSubImage3DEXT, fglDrawPixels, fglNewList, fglPixelMap, fglPixelStore, fglPixelZoom, fglReadPixels, fglTexImage1D, fglTexImage1DEXT, fglTexImage2D, fglTexImage2DEXT, fglTexSubImage1D, fglTexSubImage1DEXT, fglTexSubImage2D, fglTexSubImage2DEXT