15bd8deadSopenharmony_ciXXX - Not complete. 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ciName 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ci SGIX_slim 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ciName Strings 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ci GL_SGIX_slim 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ciVersion 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ci $Date: 1998/08/03 19:03:02 $ $Revision: 1.11 $ 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ciNumber 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ci ??? 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ciDependencies 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ci This extension depends on the ycrcbformat, and subsample extensions. 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciOverview 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci This extension defines a mechanism to draw and read SLIM (Rice) 265bd8deadSopenharmony_ci compressed images. SLIM is a lossless compression technique 275bd8deadSopenharmony_ci derived from a scheme developed by Robert F. Rice, Pen-Shu Yeh, 285bd8deadSopenharmony_ci and Warner Miller. The scheme works well on data (images) 295bd8deadSopenharmony_ci composed of relatively small integers, 8-12 bits. The specifics 305bd8deadSopenharmony_ci of the algorithm used in OpenGL are not included in this spec. 315bd8deadSopenharmony_ci If the extension were made public we would have to include such 325bd8deadSopenharmony_ci a specification. SLIM supports 8, 10, and 12 bit components, 335bd8deadSopenharmony_ci one to four components per pixel, and two alternative component 345bd8deadSopenharmony_ci samplings beyond uniform (422 and 4224). NOTE: that for 355bd8deadSopenharmony_ci compatibility reasons the older Rice format images will also be 365bd8deadSopenharmony_ci supported. 375bd8deadSopenharmony_ci The specification of color space and component subsampling is 385bd8deadSopenharmony_ci accomplished through the subsample and ycrcbformat extensions. 395bd8deadSopenharmony_ci SLIM compression is specified through the <type> parameter to 405bd8deadSopenharmony_ci DrawPixels, ReadPixels. Six data types are supported, 415bd8deadSopenharmony_ci corresponding to unsigned 8 and 10 bit components, and signed 425bd8deadSopenharmony_ci 12 bit components (SLIM8U_SGIX, SLIM10U_SGIX, SLIM12S_SGIX, and 435bd8deadSopenharmony_ci RICE8U_SGIX, RICE10U_SGIX, RICE12S_SGIX). PixelStore 445bd8deadSopenharmony_ci parameters are used to specify and query compressed image 455bd8deadSopenharmony_ci size. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ciIssues 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci - The SLIM/RICE compression/decompression algorithm is not 505bd8deadSopenharmony_ci defined/described in this extension. 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci - Rice now shows up explicitly as an input <type> is that a 535bd8deadSopenharmony_ci problem? This is a person (Robert Rice). 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci - Do we really need a header to store the image size? Could 565bd8deadSopenharmony_ci this be passed as a separate parameter? 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci A: We looked into passing the sizes as pixel storage 595bd8deadSopenharmony_ci parameters, but ran into problems with the async extension. 605bd8deadSopenharmony_ci If the size is GL state, it's difficult to come up with an 615bd8deadSopenharmony_ci implementation-friendly spec for when the state is updated. 625bd8deadSopenharmony_ci Also it's difficult to allow more than one asynchronous read 635bd8deadSopenharmony_ci outstanding in this case. Putting the data in a header has 645bd8deadSopenharmony_ci the advantage that it keeps the length associated with 655bd8deadSopenharmony_ci the image data automatically. 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ciNew Procedures and 685bd8deadSopenharmony_ciFunctions 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ci None. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ciNew Tokens 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci Accepted by the <pname> parameter of PixelStoref, PixelStorei, 755bd8deadSopenharmony_ci GetBooleanv, GetIntegerv, GetFloatv and GetDoublev: 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci PACK_MAX_COMPRESSED_SIZE_SGIX 0x831B 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci Accepted by the <type> parameter of all routines which take 805bd8deadSopenharmony_ci one or two dimensional color pixel data from client memory or 815bd8deadSopenharmony_ci write it to client memory including DrawPixels, ReadPixels, 825bd8deadSopenharmony_ci TexImage2D, GetTexImage2D, GetHistogramEXT, GetMinmaxEXT, 835bd8deadSopenharmony_ci ConvolutionFilter2DEXT, and ColorTableSGI: 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci SLIM8U_SGIX 0x831D 865bd8deadSopenharmony_ci SLIM10U_SGIX 0x831E 875bd8deadSopenharmony_ci SLIM12S_SGIX 0x831F 885bd8deadSopenharmony_ci RICE8U_SGIX 895bd8deadSopenharmony_ci RICE10U_SGIX 905bd8deadSopenharmony_ci RICE12S_SGIX 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.1 Specification (OpenGL Operation) 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci None. 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.1 Specification (Rasterization) 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci 3.6.3 Rasterization of Pixel Rectangles 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci The SLIM/RICE <type>s are added to Table 3.4: 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci <type> Parameter Corresponding Special 1035bd8deadSopenharmony_ci Token Value GL Data Type Interpretation 1045bd8deadSopenharmony_ci ---------------- ------------- -------------- 1055bd8deadSopenharmony_ci UNSIGNED_BYTE ubyte No 1065bd8deadSopenharmony_ci BYTE byte No 1075bd8deadSopenharmony_ci UNSIGNED_SHORT ushort No 1085bd8deadSopenharmony_ci SHORT short No 1095bd8deadSopenharmony_ci UNSIGNED_INT uint No 1105bd8deadSopenharmony_ci INT int No 1115bd8deadSopenharmony_ci FLOAT float No 1125bd8deadSopenharmony_ci BITMAP ubyte Yes 1135bd8deadSopenharmony_ci UNSIGNED_BYTE_3_3_2_EXT ubyte Yes 1145bd8deadSopenharmony_ci UNSIGNED_SHORT_4_4_4_4_EXT ushort Yes 1155bd8deadSopenharmony_ci UNSIGNED_SHORT_5_5_5_1_EXT ushort Yes 1165bd8deadSopenharmony_ci UNSIGNED_INT_8_8_8_8_EXT uint Yes 1175bd8deadSopenharmony_ci UNSIGNED_INT_10_10_10_2_EXT uint Yes 1185bd8deadSopenharmony_ci SLIM8U_SGIX float Yes 1195bd8deadSopenharmony_ci SLIM10U_SGIX float Yes 1205bd8deadSopenharmony_ci SLIM12S_SGIX float Yes 1215bd8deadSopenharmony_ci RICE8U_SGIX float Yes 1225bd8deadSopenharmony_ci RICE10U_SGIX float Yes 1235bd8deadSopenharmony_ci RICE12S_SGIX float Yes 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci <Before the Unpacking section> 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci Decompression 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci This step only applies if the <type> parameter to DrawPixels 1305bd8deadSopenharmony_ci is set to one of SLIM8U_SGIX, SLIM10U_SGIX, SLIM12S_SGIX, 1315bd8deadSopenharmony_ci RICE8U_SGIX, RICE10U_SGIX, or RICE12S_SGIX. These types 1325bd8deadSopenharmony_ci indicate that the image is compressed using SLIM or Rice 1335bd8deadSopenharmony_ci compression, respectively. The images are stored as a header 1345bd8deadSopenharmony_ci containing a GLsizei value giving the length of compressed 1355bd8deadSopenharmony_ci image in bytes followed by the compressed image data. For 1365bd8deadSopenharmony_ci correct operation, the data pointer passed to DrawPixels must 1375bd8deadSopenharmony_ci obey any alignment restrictions imposed by the host 1385bd8deadSopenharmony_ci architecture on the GLsizei data type. If the data is not 1395bd8deadSopenharmony_ci correctly aligned, the results are undefined. (This 1405bd8deadSopenharmony_ci restriction is analogous to the restriction tacitly placed on 1415bd8deadSopenharmony_ci the image pointer passed to DrawPixels when the type is INT. 1425bd8deadSopenharmony_ci The GL implementation must be able to dereference the pointer 1435bd8deadSopenharmony_ci as a GLint value without getting a bus error.) If the width 1445bd8deadSopenharmony_ci or height argument is zero, the data pointer is not 1455bd8deadSopenharmony_ci dereferenced and so a NULL pointer may be passed in. 1465bd8deadSopenharmony_ci 1475bd8deadSopenharmony_ci The compressed byte stream is passed to the GL and interpreted 1485bd8deadSopenharmony_ci as defined by the <type>, and <format> parameters to 1495bd8deadSopenharmony_ci DrawPixels, and the UNPACK_SAMPLING_SGIX parameter to 1505bd8deadSopenharmony_ci PixelStore. The width of the image represented by the byte 1515bd8deadSopenharmony_ci stream is determined by UNPACK_ROW_LENGTH, if it is positive, 1525bd8deadSopenharmony_ci and the <width> parameter to DrawPixels, otherwise. The 1535bd8deadSopenharmony_ci height of the image represented by the byte stream is 1545bd8deadSopenharmony_ci determined by UNPACK_IMAGE_HEIGHT_EXT, if it is positive, and 1555bd8deadSopenharmony_ci the <height> parameter to DrawPixels, otherwise. 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci ?? since we don't support subimage should the UNPACK parameters 1585bd8deadSopenharmony_ci be ignored?? 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci If the PixelStore parameters UNPACK_ROW_LENGTH, 1625bd8deadSopenharmony_ci UNPACK_SKIP_ROWS, and UNPACK_SKIP_PIXELS, and the DrawPixel 1635bd8deadSopenharmony_ci parameters <width> and <height> indicate that a sub-image is to 1645bd8deadSopenharmony_ci be drawn an error INVALID_OPERATION is issued. 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci The output of the decompression algorithm is a sequence of 1675bd8deadSopenharmony_ci unsigned bytes or signed shorts corresponding to an 1685bd8deadSopenharmony_ci uncompressed image. The downstream GL mechanisms should proceed 1695bd8deadSopenharmony_ci as if the PixelStore parameters UNPACK_ROW_LENGTH, 1705bd8deadSopenharmony_ci UNPACK_SKIP_ROWS, and UNPACK_SKIP_PIXELS are all equal to zero. 1715bd8deadSopenharmony_ci The components of a SLIM/RICE image are mapped to GL <types> that do 1725bd8deadSopenharmony_ci not have special interpretation, FLOAT. 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci The pixel storage parameters UNPACK_SWAP_BYTES, 1755bd8deadSopenharmony_ci UNPACK_LSB_FIRST, and UNPACK_ALIGNMENT are ignored for 1765bd8deadSopenharmony_ci compressed images. 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations 1795bd8deadSopenharmony_ciand the Frame Buffer) 1805bd8deadSopenharmony_ci 1815bd8deadSopenharmony_ci 4.3.2 Reading Pixels 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ci The following entries are added to Table 4.5: 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ci Parameter Name Type Initial Value Valid Range 1865bd8deadSopenharmony_ci -------------- ---- ------------- ----------- 1875bd8deadSopenharmony_ci PACK_MAX_COMPRESSED_SIZE_SGIX integer 0 [0,inf) 1885bd8deadSopenharmony_ci 1895bd8deadSopenharmony_ci The following needs to be added to the end of the "Final 1905bd8deadSopenharmony_ci Conversion" subsection: If the <type> parameter to ReadPixels 1915bd8deadSopenharmony_ci is one of SLIM8U_SGIX, SLIM10U_SGIX, SLIM12S_SGIX, RICE8U_SGIX, 1925bd8deadSopenharmony_ci RICE10U_SGIX, or RICE12S_SGIX the components are converted to 1935bd8deadSopenharmony_ci UNSIGNED_BYTE and SIGNED_SHORT as appropriate. 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci ??? 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ci <Before the section "Placement in Client Memory"> 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ci Compression 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ci This step only applies if the <type> parameter to ReadPixels is 2025bd8deadSopenharmony_ci set to one of SLIM8U_SGIX, SLIM10U_SGIX, SLIM12S_SGIX, 2035bd8deadSopenharmony_ci RICE8U_SGIX, RICE10U_SGIX, or RICE12S_SGIX. The pixel stream 2045bd8deadSopenharmony_ci being read is compressed as defined by the <type> and <format> 2055bd8deadSopenharmony_ci parameters to ReadPixels, and the PACK_SAMPLING_SGIX parameter 2065bd8deadSopenharmony_ci to PixelStore. The output of this step is a byte stream of 2075bd8deadSopenharmony_ci compressed image data. 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ci Placement in Client Memory, Uncompressed Images 2105bd8deadSopenharmony_ci 2115bd8deadSopenharmony_ci If the <type> parameter to ReadPixels is not one of SLIM/RICE* then 2125bd8deadSopenharmony_ci the pixels of the image are transferred to host memory as 2135bd8deadSopenharmony_ci described in this section. etc... 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ci Placement in Client Memory, Compressed Images 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci This step only applies if the <type> parameter to ReadPixels 2185bd8deadSopenharmony_ci is set to one of SLIM8U_SGIX, SLIM10U_SGIX, SLIM12S_SGIX, 2195bd8deadSopenharmony_ci RICE8U_SGIX, RICE10U_SGIX, or RICE12S_SGIX. The compressor 2205bd8deadSopenharmony_ci places a header containing the size in bytes of the compressed 2215bd8deadSopenharmony_ci image stored as a GLsizei value at the location *data in host 2225bd8deadSopenharmony_ci memory. As in the DrawPixels case, the data pointer must obey 2235bd8deadSopenharmony_ci system requirements for the alignment of GLsizei values. The 2245bd8deadSopenharmony_ci byte stream of compressed image data is placed in host memory 2255bd8deadSopenharmony_ci starting immediately after the header. Up to 2265bd8deadSopenharmony_ci PACK_MAX_COMPRESSED_SIZE_SGIX bytes are written. If the value 2275bd8deadSopenharmony_ci of PACK_MAX_COMPRESSED_SIZE_SGIX is greater than zero and the 2285bd8deadSopenharmony_ci compressed size is greater than the value of 2295bd8deadSopenharmony_ci PACK_MAX_COMPRESSED_SIZE_SGIX, the error INVALID_OPERATION is 2305bd8deadSopenharmony_ci generated. If this occurs, the contents of the first 2315bd8deadSopenharmony_ci PACK_MAX_COMPRESSED_SIZE_SGIX bytes after the <data> pointer 2325bd8deadSopenharmony_ci are undefined, but bytes outside this range are guaranteed to 2335bd8deadSopenharmony_ci be left unchanged. 2345bd8deadSopenharmony_ci 2355bd8deadSopenharmony_ci The pixel pack parameters PACK_SWAP_BYTES, PACK_LSB_FIRST, 2365bd8deadSopenharmony_ci PACK_ROW_LENGTH, PACK_SKIP_ROWS, PACK_SKIP_PIXELS, and 2375bd8deadSopenharmony_ci PACK_ALIGNMENT are not considered when reading back compressed 2385bd8deadSopenharmony_ci images. 2395bd8deadSopenharmony_ci 2405bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.1 Specification (Special Functions) 2415bd8deadSopenharmony_ci 2425bd8deadSopenharmony_ci None. 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.1 Specification (State and State Requests) 2455bd8deadSopenharmony_ci 2465bd8deadSopenharmony_ci XXX 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ciAdditions to the GLX Specification 2495bd8deadSopenharmony_ci 2505bd8deadSopenharmony_ci 2515bd8deadSopenharmony_ciErrors 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ci INVALID_VALUE is generated if the pname argument to 2545bd8deadSopenharmony_ci PixelStorei or PixelStoref is PACK_MAX_COMPRESSED_SIZE_SGIX 2555bd8deadSopenharmony_ci and the value of pname is less than zero. 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ci INVALID_OPERATION is generated if the compressed data 2585bd8deadSopenharmony_ci requested by a ReadPixels or GetTexImage will occupy more than 2595bd8deadSopenharmony_ci PACK_MAX_COMPRESSED_SIZE_SGIX bytes. 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ci INVALID_ENUM is generated if the type argument for a pixel 2625bd8deadSopenharmony_ci command specifies a slim type but the format argument 2635bd8deadSopenharmony_ci specifies color index, stencil index, or depth values. 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ci INVALID_ENUM is generated if the type argument for a pixel 2665bd8deadSopenharmony_ci command which deals with images of greater than two dimensions 2675bd8deadSopenharmony_ci specifies a slim type. 2685bd8deadSopenharmony_ci 2695bd8deadSopenharmony_ciNew State 2705bd8deadSopenharmony_ci 2715bd8deadSopenharmony_ci Get Value Get Command Type Initial Value Attribute 2725bd8deadSopenharmony_ci --------- ----------- ---- ------------- --------- 2735bd8deadSopenharmony_ci PACK_MAX_COMPRESSED_SIZE_SGIX GetIntegerv Z+ 0 client 2745bd8deadSopenharmony_ci 2755bd8deadSopenharmony_ciNew Implementation Dependent State 2765bd8deadSopenharmony_ci 2775bd8deadSopenharmony_ci None. 278