15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_packed_pixels
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_packed_pixels
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciVersion
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    $Date: 1997/09/22 23:23:58 $ $Revision: 1.21 $
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNumber
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    23
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciDependencies
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    EXT_abgr affects the definition of this extension
205bd8deadSopenharmony_ci    EXT_texture3D affects the definition of this extension
215bd8deadSopenharmony_ci    EXT_subtexture affects the definition of this extension
225bd8deadSopenharmony_ci    EXT_histogram affects the definition of this extension
235bd8deadSopenharmony_ci    EXT_convolution affects the definition of this extension
245bd8deadSopenharmony_ci    SGI_color_table affects the definition of this extension
255bd8deadSopenharmony_ci    SGIS_texture4D affects the definition of this extension
265bd8deadSopenharmony_ci    EXT_cmyka affects the definition of this extension
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ciOverview
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    This extension provides support for packed pixels in host memory.  A
315bd8deadSopenharmony_ci    packed pixel is represented entirely by one unsigned byte, one
325bd8deadSopenharmony_ci    unsigned short, or one unsigned integer.  The fields with the packed
335bd8deadSopenharmony_ci    pixel are not proper machine types, but the pixel as a whole is.  Thus
345bd8deadSopenharmony_ci    the pixel storage modes, including PACK_SKIP_PIXELS, PACK_ROW_LENGTH,
355bd8deadSopenharmony_ci    PACK_SKIP_ROWS, PACK_IMAGE_HEIGHT_EXT, PACK_SKIP_IMAGES_EXT,
365bd8deadSopenharmony_ci    PACK_SWAP_BYTES, PACK_ALIGNMENT, and their unpacking counterparts all
375bd8deadSopenharmony_ci    work correctly with packed pixels.
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ciNew Procedures and Functions
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    None
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ciNew Tokens
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    Accepted by the <type> parameter of DrawPixels, ReadPixels, TexImage1D,
465bd8deadSopenharmony_ci    TexImage2D, GetTexImage, TexImage3DEXT, TexSubImage1DEXT,
475bd8deadSopenharmony_ci    TexSubImage2DEXT, TexSubImage3DEXT, GetHistogramEXT, GetMinmaxEXT,
485bd8deadSopenharmony_ci    ConvolutionFilter1DEXT, ConvolutionFilter2DEXT, ConvolutionFilter3DEXT,
495bd8deadSopenharmony_ci    GetConvolutionFilterEXT, SeparableFilter2DEXT, SeparableFilter3DEXT,
505bd8deadSopenharmony_ci    GetSeparableFilterEXT, ColorTableSGI, GetColorTableSGI, TexImage4DSGIS,
515bd8deadSopenharmony_ci    and TexSubImage4DSGIS:
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci        UNSIGNED_BYTE_3_3_2_EXT         0x8032
545bd8deadSopenharmony_ci        UNSIGNED_SHORT_4_4_4_4_EXT      0x8033
555bd8deadSopenharmony_ci        UNSIGNED_SHORT_5_5_5_1_EXT      0x8034
565bd8deadSopenharmony_ci        UNSIGNED_INT_8_8_8_8_EXT        0x8035
575bd8deadSopenharmony_ci        UNSIGNED_INT_10_10_10_2_EXT     0x8036
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    None
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization)
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    The five tokens defined by this extension are added to Table 3.4:
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci        <type> Parameter                Corresponding   Special
685bd8deadSopenharmony_ci        Token Value                     GL Data Type    Interpretation
695bd8deadSopenharmony_ci        ----------------                -------------   --------------
705bd8deadSopenharmony_ci        UNSIGNED_BYTE                   ubyte           No
715bd8deadSopenharmony_ci        BYTE                            byte            No
725bd8deadSopenharmony_ci        UNSIGNED_SHORT                  ushort          No
735bd8deadSopenharmony_ci        SHORT                           short           No
745bd8deadSopenharmony_ci        UNSIGNED_INT                    uint            No
755bd8deadSopenharmony_ci        INT                             int             No
765bd8deadSopenharmony_ci        FLOAT                           float           No
775bd8deadSopenharmony_ci        BITMAP                          ubyte           Yes
785bd8deadSopenharmony_ci        UNSIGNED_BYTE_3_3_2_EXT         ubyte           Yes
795bd8deadSopenharmony_ci        UNSIGNED_SHORT_4_4_4_4_EXT      ushort          Yes
805bd8deadSopenharmony_ci        UNSIGNED_SHORT_5_5_5_1_EXT      ushort          Yes
815bd8deadSopenharmony_ci        UNSIGNED_INT_8_8_8_8_EXT        uint            Yes
825bd8deadSopenharmony_ci        UNSIGNED_INT_10_10_10_2_EXT     uint            Yes
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci        Table 3.4: DrawPixels and ReadPixels <type> parameter values and the
855bd8deadSopenharmony_ci        corresponding GL data types.  Refer to table 2.2 for definitions of
865bd8deadSopenharmony_ci        GL data types.  Special interpretations are described near the end
875bd8deadSopenharmony_ci        of section 3.6.3.
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    [Section 3.6.3 of the GL Specification (Rasterization of Pixel
905bd8deadSopenharmony_ci    Rectangles) is rewritten as follows:]
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci    3.6.3 Rasterization of Pixel Rectangles
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    The process of drawing pixels encoded in host memory is diagrammed in
955bd8deadSopenharmony_ci    Figure 3.7.  We describe the stages of this process in the order in which
965bd8deadSopenharmony_ci    they occur.
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci    Pixels are drawn using
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci        void DrawPixels(sizei width,
1015bd8deadSopenharmony_ci                        sizei height,
1025bd8deadSopenharmony_ci                        enum format,
1035bd8deadSopenharmony_ci                        enum type,
1045bd8deadSopenharmony_ci                        void* data);
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    <format> is a symbolic constant indicating what the values in memory
1075bd8deadSopenharmony_ci    represent.  <width> and <height> are the width and height, respectively,
1085bd8deadSopenharmony_ci    of the pixel rectangle to be drawn.  <data> is a pointer to the data to
1095bd8deadSopenharmony_ci    be drawn.  These data are represented with one of seven GL data types,
1105bd8deadSopenharmony_ci    specified by <type>.  The correspondence between the thirteen <type>
1115bd8deadSopenharmony_ci    token values and the GL data types they indicate is given in Table 3.4.
1125bd8deadSopenharmony_ci    If the GL is in color index mode and <format> is not one of COLOR_INDEX,
1135bd8deadSopenharmony_ci    STENCIL_INDEX, or DEPTH_COMPONENT, then the error INVALID_OPERATION
1145bd8deadSopenharmony_ci    occurs.  Some additional constraints on the combinations of <format>
1155bd8deadSopenharmony_ci    and <type> values that are accepted are discussed below.
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci    Unpacking
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    Data are taken from host memory as a sequence of signed or unsigned bytes
1205bd8deadSopenharmony_ci    (GL data types byte and ubyte), signed or unsigned short integers (GL data
1215bd8deadSopenharmony_ci    types short and ushort), signed or unsigned integers (GL data types int
1225bd8deadSopenharmony_ci    and uint), or floating-point values (GL data type float).  These elements
1235bd8deadSopenharmony_ci    are grouped into sets of one, two, three, four, or five values, depending
1245bd8deadSopenharmony_ci    on the <format>, to form a group.  Table 3.5 summarizes the format of
1255bd8deadSopenharmony_ci    groups obtained from memory.  It also indicates those formats that yield
1265bd8deadSopenharmony_ci    indices and those that yield components.
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci                        Target
1295bd8deadSopenharmony_ci        Format Name     Buffer  Element Meaning and Order
1305bd8deadSopenharmony_ci        -----------     ------  -------------------------
1315bd8deadSopenharmony_ci        COLOR_INDEX     Color   Color index
1325bd8deadSopenharmony_ci        STENCIL_INDEX   Stencil Stencil index
1335bd8deadSopenharmony_ci        DEPTH_COMPONENT Depth   Depth component
1345bd8deadSopenharmony_ci        RED             Color   R component
1355bd8deadSopenharmony_ci        GREEN           Color   G component
1365bd8deadSopenharmony_ci        BLUE            Color   B component
1375bd8deadSopenharmony_ci        ALPHA           Color   A component
1385bd8deadSopenharmony_ci        RGB             Color   R, G, B components
1395bd8deadSopenharmony_ci        RGBA            Color   R, G, B, A components
1405bd8deadSopenharmony_ci        ABGR_EXT        Color   A, B, G, R components
1415bd8deadSopenharmony_ci        CMYK_EXT        Color   Cyan, Magenta, Yellow, Black components
1425bd8deadSopenharmony_ci        CMYKA_EXT       Color   Cyan, Magenta, Yellow, Black, A components
1435bd8deadSopenharmony_ci        LUMINANCE       Color   Luminance component
1445bd8deadSopenharmony_ci        LUMINANCE_ALPHA Color   Luminance, A components
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci        Table 3.5: DrawPixels and ReadPixels formats.  The third column
1475bd8deadSopenharmony_ci        gives a description of and the number and order of elements in a
1485bd8deadSopenharmony_ci        group.
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ci    By default the values of each GL data type are interpreted as they would
1515bd8deadSopenharmony_ci    be specified in the language of the client's GL binding.  If
1525bd8deadSopenharmony_ci    UNPACK_SWAP_BYTES is set to TRUE, however, then the values are
1535bd8deadSopenharmony_ci    interpreted with the bit orderings modified as per the table below.  The
1545bd8deadSopenharmony_ci    modified bit orderings are defined only if the GL data type ubyte has
1555bd8deadSopenharmony_ci    eight bits, and then for each specific GL data type only if that type
1565bd8deadSopenharmony_ci    is represented with 8, 16, or 32 bits.
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci        Element         Default 
1595bd8deadSopenharmony_ci        Size            Bit Ordering    Modified Bit Ordering
1605bd8deadSopenharmony_ci        -------         ------------    ---------------------
1615bd8deadSopenharmony_ci        8-bit           [7..0]          [7..0]
1625bd8deadSopenharmony_ci        16-bit          [15..0]         [7..0] [15..8]
1635bd8deadSopenharmony_ci        32-bit          [31..0]         [7..0] [15..8] [23..16] [31..24]
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci        Table: Bit ordering modification of elements when UNPACK_SWAP_BYTES
1665bd8deadSopenharmony_ci        is TRUE.  These reorderings are defined only when GL data type ubyte
1675bd8deadSopenharmony_ci        has 8 bits, and then only for GL data types with 8, 16, or 32 bits.
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci    The groups in memory are treated as being arranged in a rectangle.  This
1705bd8deadSopenharmony_ci    rectangle consists of a series of rows, with the first element of the
1715bd8deadSopenharmony_ci    first group of the first row pointed to by the pointer passed to
1725bd8deadSopenharmony_ci    DrawPixels.  If the value of UNPACK_ROW_LENGTH is not positive, then the
1735bd8deadSopenharmony_ci    number of groups in a row is <width>; otherwise the number of groups is
1745bd8deadSopenharmony_ci    UNPACK_ROW_LENGTH.  If the first element of the first row is at location
1755bd8deadSopenharmony_ci    p in memory, then the location of the first element of the Nth row is
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci        p + Nk
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci    where N is the row number (counting from zero) and k is defined as
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci             / nl                       s >= a
1825bd8deadSopenharmony_ci        k = <
1835bd8deadSopenharmony_ci             \ a/s * ceiling(snl/a)     s < a
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    where n is the number of elements in a group, l is the number of groups
1865bd8deadSopenharmony_ci    in a row, a is the value of UNPACK_ALIGNMENT, and s is the size,
1875bd8deadSopenharmony_ci    in units of GL ubytes, of an element.  If the number of bits per
1885bd8deadSopenharmony_ci    element is not 1, 2, 4, or 8 times the number of bits in a GL ubyte,
1895bd8deadSopenharmony_ci    then k = nl for all values of a.
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci    There is a mechanism for selecting a sub-rectangle of groups from a
1925bd8deadSopenharmony_ci    larger containing rectangle.  This mechanism relies on three integer
1935bd8deadSopenharmony_ci    parameters: UNPACK_ROW_LENGTH, UNPACK_SKIP_ROWS, and UNPACK_SKIP_PIXELS.
1945bd8deadSopenharmony_ci    Before obtaining the first group from memory, the pointer supplied to
1955bd8deadSopenharmony_ci    DrawPixels is effectively advanced by
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci        UNPACK_SKIP_PIXELS * n + UNPACK_SKIP_ROWS * k
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci    elements.  Then <width> groups are obtained from contiguous elements
2005bd8deadSopenharmony_ci    in memory (without advancing the pointer), after which the pointer is
2015bd8deadSopenharmony_ci    advanced by k elements.  <height> sets of <width> groups of values are
2025bd8deadSopenharmony_ci    obtained this way.  See Figure 3.8.
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci    Calling DrawPixels with a <type> of UNSIGNED_BYTE_3_3_2,
2055bd8deadSopenharmony_ci    UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_5_5_5_1, UNSIGNED_INT_8_8_8_8,
2065bd8deadSopenharmony_ci    or UNSIGNED_INT_10_10_10_2 is a special case in which all the elements
2075bd8deadSopenharmony_ci    of each group are packed into a single unsigned byte, unsigned short,
2085bd8deadSopenharmony_ci    or unsigned int, depending on the type.  The number of elements per
2095bd8deadSopenharmony_ci    packed pixel is fixed by the type, and must match the number of
2105bd8deadSopenharmony_ci    elements per group indicated by the <format> parameter.  (See the table
2115bd8deadSopenharmony_ci    below.)  The error INVALID_OPERATION is generated if a mismatch occurs.
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci                                        GL      Number
2145bd8deadSopenharmony_ci        <type> Parameter                Data    of        Matching
2155bd8deadSopenharmony_ci        Token Name                      Type    Elements  Pixel Formats
2165bd8deadSopenharmony_ci        ----------------                ----    --------  -------------
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci        UNSIGNED_BYTE_3_3_2_EXT         ubyte   3         RGB
2195bd8deadSopenharmony_ci        UNSIGNED_SHORT_4_4_4_4_EXT      ushort  4         RGBA,ABGR_EXT,CMYK_EXT
2205bd8deadSopenharmony_ci        UNSIGNED_SHORT_5_5_5_1_EXT      ushort  4         RGBA,ABGR_EXT,CMYK_EXT
2215bd8deadSopenharmony_ci        UNSIGNED_INT_8_8_8_8_EXT        uint    4         RGBA,ABGR_EXT,CMYK_EXT
2225bd8deadSopenharmony_ci        UNSIGNED_INT_10_10_10_2_EXT     uint    4         RGBA,ABGR_EXT,CMYK_EXT
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    Bitfield locations of the first, second, third, and fourth elements
2255bd8deadSopenharmony_ci    of each packed pixel type are illustrated in the diagrams below.  Each
2265bd8deadSopenharmony_ci    bitfield is interpreted as an unsigned integer value.  If the base GL
2275bd8deadSopenharmony_ci    type is supported with more than the minimum precision (e.g. a 9-bit
2285bd8deadSopenharmony_ci    byte) the packed elements are right-justified in the pixel.
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ci        UNSIGNED_BYTE_3_3_2_EXT:
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci              7   6   5   4   3   2   1   0
2345bd8deadSopenharmony_ci            +-----------+-----------+-------+
2355bd8deadSopenharmony_ci            |           |           |       |
2365bd8deadSopenharmony_ci            +-----------+-----------+-------+
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci               first       second     third
2395bd8deadSopenharmony_ci               element     element    element
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci        UNSIGNED_SHORT_4_4_4_4_EXT:
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci              15  14  13  12  11  10  9   8   7   6   5   4   3   2   1   0
2455bd8deadSopenharmony_ci            +---------------+---------------+---------------+---------------+
2465bd8deadSopenharmony_ci            |               |               |               |               |
2475bd8deadSopenharmony_ci            +---------------+---------------+---------------+---------------+
2485bd8deadSopenharmony_ci
2495bd8deadSopenharmony_ci                first           second          third           fourth
2505bd8deadSopenharmony_ci                element         element         element         element
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci
2535bd8deadSopenharmony_ci        UNSIGNED_SHORT_5_5_5_1_EXT:
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci              15  14  13  12  11  10  9   8   7   6   5   4   3   2   1   0
2565bd8deadSopenharmony_ci            +-------------------+-------------------+-------------------+---+
2575bd8deadSopenharmony_ci            |                   |                   |                   |   |
2585bd8deadSopenharmony_ci            +-------------------+-------------------+-------------------+---+
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci                first                second             third           fourth
2615bd8deadSopenharmony_ci                element              element            element         element
2625bd8deadSopenharmony_ci
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ci        UNSIGNED_INT_8_8_8_8_EXT:
2655bd8deadSopenharmony_ci
2665bd8deadSopenharmony_ci             31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
2675bd8deadSopenharmony_ci            +-----------------------+-----------------------+-----------------------+-----------------------+
2685bd8deadSopenharmony_ci            |                       |                       |                       |                       |
2695bd8deadSopenharmony_ci            +-----------------------+-----------------------+-----------------------+-----------------------+
2705bd8deadSopenharmony_ci
2715bd8deadSopenharmony_ci                     first                   second                  third                   fourth
2725bd8deadSopenharmony_ci                     element                 element                 element                 element
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci        UNSIGNED_INT_10_10_10_2_EXT:
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ci             31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
2785bd8deadSopenharmony_ci            +-----------------------------+-----------------------------+-----------------------------+-----+
2795bd8deadSopenharmony_ci            |                             |                             |                             |     |
2805bd8deadSopenharmony_ci            +-----------------------------+-----------------------------+-----------------------------+-----+
2815bd8deadSopenharmony_ci
2825bd8deadSopenharmony_ci                       first                         second                        third               fourth
2835bd8deadSopenharmony_ci                       element                       element                       element             element
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci
2865bd8deadSopenharmony_ci    The assignment of elements to fields in the packed pixel is as
2875bd8deadSopenharmony_ci    described in the table below:
2885bd8deadSopenharmony_ci
2895bd8deadSopenharmony_ci                        First       Second      Third       Fourth
2905bd8deadSopenharmony_ci        Format          Element     Element     Element     Element
2915bd8deadSopenharmony_ci        ------          -------     -------     -------     -------
2925bd8deadSopenharmony_ci        RGB             red         green       blue
2935bd8deadSopenharmony_ci        RGBA            red         green       blue        alpha
2945bd8deadSopenharmony_ci        ABGR_EXT        alpha       blue        green       red
2955bd8deadSopenharmony_ci        CMYK_EXT        cyan        magenta     yellow      black
2965bd8deadSopenharmony_ci    
2975bd8deadSopenharmony_ci    Byte swapping, if enabled, is performed before the elements are
2985bd8deadSopenharmony_ci    extracted from each pixel.  The above discussions of row length and
2995bd8deadSopenharmony_ci    image extraction are valid for packed pixels, if "group" is substituted
3005bd8deadSopenharmony_ci    for "element" and the number of elements per group is understood to
3015bd8deadSopenharmony_ci    be one.
3025bd8deadSopenharmony_ci
3035bd8deadSopenharmony_ci    Calling DrawPixels with a <type> of BITMAP is a special case in which
3045bd8deadSopenharmony_ci    the data are a series of GL ubyte values.  Each ubyte value specifies
3055bd8deadSopenharmony_ci    8 1-bit elements with its 8 least-significant bits.  The 8 single-bit
3065bd8deadSopenharmony_ci    elements are ordered from most significant to least significant if the
3075bd8deadSopenharmony_ci    value of UNPACK_LSB_FIRST is FALSE; otherwise, the ordering is from
3085bd8deadSopenharmony_ci    least significant to most significant.  The values of bits other than
3095bd8deadSopenharmony_ci    the 8 least significant in each ubyte are not significant.
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ci    The first element of the first row is the first bit (as defined above)
3125bd8deadSopenharmony_ci    of the ubyte pointed to by the pointer passed to DrawPixels.  The first
3135bd8deadSopenharmony_ci    element of the second row is the first bit (again as defined above) of
3145bd8deadSopenharmony_ci    the ubyte at location p+k, where k is computed as
3155bd8deadSopenharmony_ci
3165bd8deadSopenharmony_ci        k = a * ceiling(nl/8a)
3175bd8deadSopenharmony_ci
3185bd8deadSopenharmony_ci    There is a mechanism for selecting a sub-rectangle of elements from
3195bd8deadSopenharmony_ci    a BITMAP image as well.  Before obtaining the first element from memory,
3205bd8deadSopenharmony_ci    the pointer supplied to DrawPixels is effectively advanced by
3215bd8deadSopenharmony_ci
3225bd8deadSopenharmony_ci        UNPACK_SKIP_ROWS * k
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ci    ubytes.  Then UNPACK_SKIP_PIXELS 1-bit elements are ignored, and the
3255bd8deadSopenharmony_ci    subsequent <width> 1-bit elements are obtained, without advancing the
3265bd8deadSopenharmony_ci    ubyte pointer, after which the pointer is advanced by k ubytes.  <height>
3275bd8deadSopenharmony_ci    sets of <width> elements are obtained this way.
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci    Conversion to floating-point
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci    This step applies only to groups of components.  It is not performed on
3325bd8deadSopenharmony_ci    indices.  Each element in a group is converted to a floating-point value
3335bd8deadSopenharmony_ci    according to the appropriate formula in Table 2.4 (section 2.12).
3345bd8deadSopenharmony_ci    Unsigned integer bitfields extracted from packed pixels are interpreted
3355bd8deadSopenharmony_ci    using the formula
3365bd8deadSopenharmony_ci
3375bd8deadSopenharmony_ci        f = c / ((2**N)-1)
3385bd8deadSopenharmony_ci
3395bd8deadSopenharmony_ci    where c is the value of the bitfield (interpreted as an unsigned
3405bd8deadSopenharmony_ci    integer), N is the number of bits in the bitfield, and the division is
3415bd8deadSopenharmony_ci    performed in floating point.
3425bd8deadSopenharmony_ci
3435bd8deadSopenharmony_ci    [End of changes to Section 3.6.3]
3445bd8deadSopenharmony_ci
3455bd8deadSopenharmony_ci    If this extension is supported, all commands that accept pixel data
3465bd8deadSopenharmony_ci    also accept packed pixel data.  These commands are DrawPixels,
3475bd8deadSopenharmony_ci    TexImage1D, TexImage2D, TexImage3DEXT, TexSubImage1DEXT,
3485bd8deadSopenharmony_ci    TexSubImage2DEXT, TexSubImage3DEXT, ConvolutionFilter1DEXT,
3495bd8deadSopenharmony_ci    ConvolutionFilter2DEXT, ConvolutionFilter3DEXT, SeparableFilter2DEXT,
3505bd8deadSopenharmony_ci    SeparableFilter3DEXT, ColorTableSGI, TexImage4DSGIS, and
3515bd8deadSopenharmony_ci    TexSubImage4DSGIS.
3525bd8deadSopenharmony_ci
3535bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
3545bd8deadSopenharmony_ciand the Framebuffer)
3555bd8deadSopenharmony_ci
3565bd8deadSopenharmony_ci    [Make the following changes to Section 4.3.2 (Reading Pixels):]
3575bd8deadSopenharmony_ci
3585bd8deadSopenharmony_ci    Final Conversion
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ci    For an index, if the <type> is not FLOAT, final conversion consists of
3615bd8deadSopenharmony_ci    masking the index with the value given in Table 4.6; if the <type> is
3625bd8deadSopenharmony_ci    FLOAT, then the integer index is converted to a GL float data value.
3635bd8deadSopenharmony_ci    For a component, each component is first clamped to [0,1].  Then,
3645bd8deadSopenharmony_ci    the appropriate conversion formula from Table 4.7 is applied to the
3655bd8deadSopenharmony_ci    component.
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci        <type> Parameter        Index Mask
3685bd8deadSopenharmony_ci        ----------------        ----------
3695bd8deadSopenharmony_ci        UNSIGNED_BYTE           2**8 - 1
3705bd8deadSopenharmony_ci        BITMAP                  1
3715bd8deadSopenharmony_ci        BYTE                    2**7 - 1
3725bd8deadSopenharmony_ci        UNSIGNED_SHORT          2**16 - 1
3735bd8deadSopenharmony_ci        SHORT                   2**15 - 1
3745bd8deadSopenharmony_ci        UNSIGNED_INT            2**32 - 1
3755bd8deadSopenharmony_ci        INT                     2**31 - 1
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci        Table 4.6: Index masks used by ReadPixels.  Floating point data
3785bd8deadSopenharmony_ci        are not masked.
3795bd8deadSopenharmony_ci
3805bd8deadSopenharmony_ci        <type>                          GL Data         Component
3815bd8deadSopenharmony_ci        Parameter                       Type            Conversion Formula
3825bd8deadSopenharmony_ci        ---------                       -------         ------------------
3835bd8deadSopenharmony_ci        UNSIGNED_BYTE                   ubyte           c = ((2**8)-1)*f
3845bd8deadSopenharmony_ci        BYTE                            byte            c = (((2**8)-1)*f-1)/2
3855bd8deadSopenharmony_ci        UNSIGNED_SHORT                  ushort          c = ((2**16)-1)*f
3865bd8deadSopenharmony_ci        SHORT                           short           c = (((2**16)-1)*f-1)/2
3875bd8deadSopenharmony_ci        UNSIGNED_INT                    uint            c = ((2**32)-1)*f
3885bd8deadSopenharmony_ci        INT                             int             c = (((2**32)-1)*f-1)/2
3895bd8deadSopenharmony_ci        FLOAT                           float           c = f
3905bd8deadSopenharmony_ci        UNSIGNED_BYTE_3_3_2_EXT         ubyte           c = ((2**N)-1)*f
3915bd8deadSopenharmony_ci        UNSIGNED_SHORT_4_4_4_4_EXT      ushort          c = ((2**N)-1)*f
3925bd8deadSopenharmony_ci        UNSIGNED_SHORT_5_5_5_1_EXT      ushort          c = ((2**N)-1)*f
3935bd8deadSopenharmony_ci        UNSIGNED_INT_8_8_8_8_EXT        uint            c = ((2**N)-1)*f
3945bd8deadSopenharmony_ci        UNSIGNED_INT_10_10_10_2_EXT     uint            c = ((2**N)-1)*f
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ci        Table 4.7: Reversed component conversions - used when component data
3975bd8deadSopenharmony_ci        are being returned to client memory.  Color, normal, and depth
3985bd8deadSopenharmony_ci        components are converted from the internal floating-point
3995bd8deadSopenharmony_ci        representation (f) to a datum of the specified GL data type (c) using
4005bd8deadSopenharmony_ci        the equations in this table.  All arithmetic is done in the internal
4015bd8deadSopenharmony_ci        floating point format.  These conversions apply to component data
4025bd8deadSopenharmony_ci        returned by GL query commands and to components of pixel data returned
4035bd8deadSopenharmony_ci        to client memory.  The equations remain the same even if the
4045bd8deadSopenharmony_ci        implemented ranges of the GL data types are greater than the minimum
4055bd8deadSopenharmony_ci        required ranges.  (Refer to table 2.2.)  Equations with N as the
4065bd8deadSopenharmony_ci        exponent are performed for each bitfield of the packed data type,
4075bd8deadSopenharmony_ci        with N set to the number of bits in the bitfield.
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci    Placement in Client Memory
4105bd8deadSopenharmony_ci
4115bd8deadSopenharmony_ci    Groups of elements are placed in memory just as they are taken from memory
4125bd8deadSopenharmony_ci    for DrawPixels.  That is, the ith group of the jth row (corresponding to
4135bd8deadSopenharmony_ci    the ith pixel in the jth row) is placed in memory must where the ith group
4145bd8deadSopenharmony_ci    of the jth row would be taken from for DrawPixels.  See Unpacking under
4155bd8deadSopenharmony_ci    section 3.6.3.  The only difference is that the storage mode parameters
4165bd8deadSopenharmony_ci    whose names begin with PACK_ are used instead of those whose names begin
4175bd8deadSopenharmony_ci    with UNPACK_.
4185bd8deadSopenharmony_ci
4195bd8deadSopenharmony_ci    [End of changes to Section 4.3.2]
4205bd8deadSopenharmony_ci
4215bd8deadSopenharmony_ci    If this extension is supported, all commands that return pixel data
4225bd8deadSopenharmony_ci    also return packed pixel data.  These commands are ReadPixels,
4235bd8deadSopenharmony_ci    GetTexImage, GetHistogramEXT, GetMinmaxEXT, GetConvolutionFilterEXT,
4245bd8deadSopenharmony_ci    GetSeparableFilterEXT, and GetColorTableSGI.
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions)
4275bd8deadSopenharmony_ci
4285bd8deadSopenharmony_ci    None
4295bd8deadSopenharmony_ci
4305bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests)
4315bd8deadSopenharmony_ci
4325bd8deadSopenharmony_ci    None
4335bd8deadSopenharmony_ci
4345bd8deadSopenharmony_ciAdditions to the GLX Specification
4355bd8deadSopenharmony_ci
4365bd8deadSopenharmony_ci    None
4375bd8deadSopenharmony_ci
4385bd8deadSopenharmony_ciGLX Protocol
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ci        None
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ciDependencies on EXT_abgr
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci    If EXT_abgr is not implemented, then the references to ABGR_EXT in this
4455bd8deadSopenharmony_ci    file are invalid, and should be ignored.
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ciDependencies on EXT_texture3D
4485bd8deadSopenharmony_ci
4495bd8deadSopenharmony_ci    If EXT_texture3D is not implemented, then the references to
4505bd8deadSopenharmony_ci    TexImage3DEXT in this file are invalid, and should be ignored.
4515bd8deadSopenharmony_ci
4525bd8deadSopenharmony_ciDependencies on EXT_subtexture
4535bd8deadSopenharmony_ci
4545bd8deadSopenharmony_ci    If EXT_subtexture is not implemented, then the references to
4555bd8deadSopenharmony_ci    TexSubImage1DEXT, TexSubImage2DEXT, and TexSubImage3DEXT in this file
4565bd8deadSopenharmony_ci    are invalid, and should be ignored.
4575bd8deadSopenharmony_ci
4585bd8deadSopenharmony_ciDependencies on EXT_histogram
4595bd8deadSopenharmony_ci
4605bd8deadSopenharmony_ci    If EXT_histogram is not implemented, then the references to
4615bd8deadSopenharmony_ci    GetHistogramEXT and GetMinmaxEXT in this file are invalid, and should be
4625bd8deadSopenharmony_ci    ignored.
4635bd8deadSopenharmony_ci
4645bd8deadSopenharmony_ciDependencies on EXT_convolution
4655bd8deadSopenharmony_ci
4665bd8deadSopenharmony_ci    If EXT_convolution is not implemented, then the references to
4675bd8deadSopenharmony_ci    ConvolutionFilter1DEXT, ConvolutionFilter2DEXT, ConvolutionFilter3DEXT,
4685bd8deadSopenharmony_ci    GetConvolutionFilterEXT, SeparableFilter2DEXT, SeparableFilter3DEXT, and
4695bd8deadSopenharmony_ci    GetSeparableFilterEXT in this file are invalid, and should be ignored.
4705bd8deadSopenharmony_ci
4715bd8deadSopenharmony_ciDependencies on SGI_color_table
4725bd8deadSopenharmony_ci
4735bd8deadSopenharmony_ci    If SGI_color_table is not implemented, then the references to
4745bd8deadSopenharmony_ci    ColorTableSGI and GetColorTableSGI in this file are invalid, and should
4755bd8deadSopenharmony_ci    be ignored.
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ciDependencies on SGIS_texture4D
4785bd8deadSopenharmony_ci
4795bd8deadSopenharmony_ci    If SGIS_texture4D is not implemented, then the references to
4805bd8deadSopenharmony_ci    TexImage4DSGIS and TexSubImage4DSGIS in this file are invalid, and should
4815bd8deadSopenharmony_ci    be ignored.
4825bd8deadSopenharmony_ci
4835bd8deadSopenharmony_ciDependencies on EXT_cmyka
4845bd8deadSopenharmony_ci
4855bd8deadSopenharmony_ci    If EXT_cmyka is not implemented, then the references to CMYK_EXT and
4865bd8deadSopenharmony_ci    CMYKA_EXT in this file are invalid, and should be ignored.
4875bd8deadSopenharmony_ci
4885bd8deadSopenharmony_ciErrors
4895bd8deadSopenharmony_ci
4905bd8deadSopenharmony_ci    [For the purpose of this enumeration of errors, GenericPixelFunction
4915bd8deadSopenharmony_ci    represents any OpenGL function that accepts or returns pixel data, using
4925bd8deadSopenharmony_ci    parameters <type> and <format> to define the type and format of that
4935bd8deadSopenharmony_ci    data.  Currently these functions are DrawPixels, ReadPixels, TexImage1D,
4945bd8deadSopenharmony_ci    TexImage2D, GetTexImage, TexImage3DEXT, TexSubImage1DEXT,
4955bd8deadSopenharmony_ci    TexSubImage2DEXT, TexSubImage3DEXT, GetHistogramEXT, GetMinmaxEXT,
4965bd8deadSopenharmony_ci    ConvolutionFilter1DEXT, ConvolutionFilter2DEXT, ConvolutionFilter3DEXT,
4975bd8deadSopenharmony_ci    GetConvolutionFilterEXT, SeparableFilter2DEXT, SeparableFilter3DEXT,
4985bd8deadSopenharmony_ci    GetSeparableFilterEXT, ColorTableSGI, GetColorTableSGI, TexImage4DSGIS,
4995bd8deadSopenharmony_ci    and TexSubImage4DSGIS.]
5005bd8deadSopenharmony_ci
5015bd8deadSopenharmony_ci    INVALID_OPERATION is generated by GenericPixelFunction if its <type>
5025bd8deadSopenharmony_ci    parameter is UNSIGNED_BYTE_3_3_2_EXT and its <format> parameter does not
5035bd8deadSopenharmony_ci    specify three components.  Currently the only 3-component format is RGB.
5045bd8deadSopenharmony_ci
5055bd8deadSopenharmony_ci    INVALID_OPERATION is generated by GenericPixelFunction if its <type>
5065bd8deadSopenharmony_ci    parameter is UNSIGNED_SHORT_4_4_4_4_EXT, UNSIGNED_SHORT_5_5_5_1_EXT,
5075bd8deadSopenharmony_ci    UNSIGNED_INT_8_8_8_8_EXT, or UNSIGNED_INT_10_10_10_2_EXT and its
5085bd8deadSopenharmony_ci    <format> parameter does not specify four components.  Currently the only
5095bd8deadSopenharmony_ci    4-component formats are RGBA, ABGR_EXT, and CMYK_EXT.
5105bd8deadSopenharmony_ci
5115bd8deadSopenharmony_ciNew State
5125bd8deadSopenharmony_ci
5135bd8deadSopenharmony_ci    None
5145bd8deadSopenharmony_ci
5155bd8deadSopenharmony_ciNew Implementation Dependent State
5165bd8deadSopenharmony_ci
5175bd8deadSopenharmony_ci    None
518