1XXX - Not complete. 2 3Name 4 5 SGIX_slim 6 7Name Strings 8 9 GL_SGIX_slim 10 11Version 12 13 $Date: 1998/08/03 19:03:02 $ $Revision: 1.11 $ 14 15Number 16 17 ??? 18 19Dependencies 20 21 This extension depends on the ycrcbformat, and subsample extensions. 22 23Overview 24 25 This extension defines a mechanism to draw and read SLIM (Rice) 26 compressed images. SLIM is a lossless compression technique 27 derived from a scheme developed by Robert F. Rice, Pen-Shu Yeh, 28 and Warner Miller. The scheme works well on data (images) 29 composed of relatively small integers, 8-12 bits. The specifics 30 of the algorithm used in OpenGL are not included in this spec. 31 If the extension were made public we would have to include such 32 a specification. SLIM supports 8, 10, and 12 bit components, 33 one to four components per pixel, and two alternative component 34 samplings beyond uniform (422 and 4224). NOTE: that for 35 compatibility reasons the older Rice format images will also be 36 supported. 37 The specification of color space and component subsampling is 38 accomplished through the subsample and ycrcbformat extensions. 39 SLIM compression is specified through the <type> parameter to 40 DrawPixels, ReadPixels. Six data types are supported, 41 corresponding to unsigned 8 and 10 bit components, and signed 42 12 bit components (SLIM8U_SGIX, SLIM10U_SGIX, SLIM12S_SGIX, and 43 RICE8U_SGIX, RICE10U_SGIX, RICE12S_SGIX). PixelStore 44 parameters are used to specify and query compressed image 45 size. 46 47Issues 48 49 - The SLIM/RICE compression/decompression algorithm is not 50 defined/described in this extension. 51 52 - Rice now shows up explicitly as an input <type> is that a 53 problem? This is a person (Robert Rice). 54 55 - Do we really need a header to store the image size? Could 56 this be passed as a separate parameter? 57 58 A: We looked into passing the sizes as pixel storage 59 parameters, but ran into problems with the async extension. 60 If the size is GL state, it's difficult to come up with an 61 implementation-friendly spec for when the state is updated. 62 Also it's difficult to allow more than one asynchronous read 63 outstanding in this case. Putting the data in a header has 64 the advantage that it keeps the length associated with 65 the image data automatically. 66 67New Procedures and 68Functions 69 70 None. 71 72New Tokens 73 74 Accepted by the <pname> parameter of PixelStoref, PixelStorei, 75 GetBooleanv, GetIntegerv, GetFloatv and GetDoublev: 76 77 PACK_MAX_COMPRESSED_SIZE_SGIX 0x831B 78 79 Accepted by the <type> parameter of all routines which take 80 one or two dimensional color pixel data from client memory or 81 write it to client memory including DrawPixels, ReadPixels, 82 TexImage2D, GetTexImage2D, GetHistogramEXT, GetMinmaxEXT, 83 ConvolutionFilter2DEXT, and ColorTableSGI: 84 85 SLIM8U_SGIX 0x831D 86 SLIM10U_SGIX 0x831E 87 SLIM12S_SGIX 0x831F 88 RICE8U_SGIX 89 RICE10U_SGIX 90 RICE12S_SGIX 91 92Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation) 93 94 None. 95 96Additions to Chapter 3 of the 1.1 Specification (Rasterization) 97 98 3.6.3 Rasterization of Pixel Rectangles 99 100 The SLIM/RICE <type>s are added to Table 3.4: 101 102 <type> Parameter Corresponding Special 103 Token Value GL Data Type Interpretation 104 ---------------- ------------- -------------- 105 UNSIGNED_BYTE ubyte No 106 BYTE byte No 107 UNSIGNED_SHORT ushort No 108 SHORT short No 109 UNSIGNED_INT uint No 110 INT int No 111 FLOAT float No 112 BITMAP ubyte Yes 113 UNSIGNED_BYTE_3_3_2_EXT ubyte Yes 114 UNSIGNED_SHORT_4_4_4_4_EXT ushort Yes 115 UNSIGNED_SHORT_5_5_5_1_EXT ushort Yes 116 UNSIGNED_INT_8_8_8_8_EXT uint Yes 117 UNSIGNED_INT_10_10_10_2_EXT uint Yes 118 SLIM8U_SGIX float Yes 119 SLIM10U_SGIX float Yes 120 SLIM12S_SGIX float Yes 121 RICE8U_SGIX float Yes 122 RICE10U_SGIX float Yes 123 RICE12S_SGIX float Yes 124 125 <Before the Unpacking section> 126 127 Decompression 128 129 This step only applies if the <type> parameter to DrawPixels 130 is set to one of SLIM8U_SGIX, SLIM10U_SGIX, SLIM12S_SGIX, 131 RICE8U_SGIX, RICE10U_SGIX, or RICE12S_SGIX. These types 132 indicate that the image is compressed using SLIM or Rice 133 compression, respectively. The images are stored as a header 134 containing a GLsizei value giving the length of compressed 135 image in bytes followed by the compressed image data. For 136 correct operation, the data pointer passed to DrawPixels must 137 obey any alignment restrictions imposed by the host 138 architecture on the GLsizei data type. If the data is not 139 correctly aligned, the results are undefined. (This 140 restriction is analogous to the restriction tacitly placed on 141 the image pointer passed to DrawPixels when the type is INT. 142 The GL implementation must be able to dereference the pointer 143 as a GLint value without getting a bus error.) If the width 144 or height argument is zero, the data pointer is not 145 dereferenced and so a NULL pointer may be passed in. 146 147 The compressed byte stream is passed to the GL and interpreted 148 as defined by the <type>, and <format> parameters to 149 DrawPixels, and the UNPACK_SAMPLING_SGIX parameter to 150 PixelStore. The width of the image represented by the byte 151 stream is determined by UNPACK_ROW_LENGTH, if it is positive, 152 and the <width> parameter to DrawPixels, otherwise. The 153 height of the image represented by the byte stream is 154 determined by UNPACK_IMAGE_HEIGHT_EXT, if it is positive, and 155 the <height> parameter to DrawPixels, otherwise. 156 157 ?? since we don't support subimage should the UNPACK parameters 158 be ignored?? 159 160 161 If the PixelStore parameters UNPACK_ROW_LENGTH, 162 UNPACK_SKIP_ROWS, and UNPACK_SKIP_PIXELS, and the DrawPixel 163 parameters <width> and <height> indicate that a sub-image is to 164 be drawn an error INVALID_OPERATION is issued. 165 166 The output of the decompression algorithm is a sequence of 167 unsigned bytes or signed shorts corresponding to an 168 uncompressed image. The downstream GL mechanisms should proceed 169 as if the PixelStore parameters UNPACK_ROW_LENGTH, 170 UNPACK_SKIP_ROWS, and UNPACK_SKIP_PIXELS are all equal to zero. 171 The components of a SLIM/RICE image are mapped to GL <types> that do 172 not have special interpretation, FLOAT. 173 174 The pixel storage parameters UNPACK_SWAP_BYTES, 175 UNPACK_LSB_FIRST, and UNPACK_ALIGNMENT are ignored for 176 compressed images. 177 178Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations 179and the Frame Buffer) 180 181 4.3.2 Reading Pixels 182 183 The following entries are added to Table 4.5: 184 185 Parameter Name Type Initial Value Valid Range 186 -------------- ---- ------------- ----------- 187 PACK_MAX_COMPRESSED_SIZE_SGIX integer 0 [0,inf) 188 189 The following needs to be added to the end of the "Final 190 Conversion" subsection: If the <type> parameter to ReadPixels 191 is one of SLIM8U_SGIX, SLIM10U_SGIX, SLIM12S_SGIX, RICE8U_SGIX, 192 RICE10U_SGIX, or RICE12S_SGIX the components are converted to 193 UNSIGNED_BYTE and SIGNED_SHORT as appropriate. 194 195 ??? 196 197 <Before the section "Placement in Client Memory"> 198 199 Compression 200 201 This step only applies if the <type> parameter to ReadPixels is 202 set to one of SLIM8U_SGIX, SLIM10U_SGIX, SLIM12S_SGIX, 203 RICE8U_SGIX, RICE10U_SGIX, or RICE12S_SGIX. The pixel stream 204 being read is compressed as defined by the <type> and <format> 205 parameters to ReadPixels, and the PACK_SAMPLING_SGIX parameter 206 to PixelStore. The output of this step is a byte stream of 207 compressed image data. 208 209 Placement in Client Memory, Uncompressed Images 210 211 If the <type> parameter to ReadPixels is not one of SLIM/RICE* then 212 the pixels of the image are transferred to host memory as 213 described in this section. etc... 214 215 Placement in Client Memory, Compressed Images 216 217 This step only applies if the <type> parameter to ReadPixels 218 is set to one of SLIM8U_SGIX, SLIM10U_SGIX, SLIM12S_SGIX, 219 RICE8U_SGIX, RICE10U_SGIX, or RICE12S_SGIX. The compressor 220 places a header containing the size in bytes of the compressed 221 image stored as a GLsizei value at the location *data in host 222 memory. As in the DrawPixels case, the data pointer must obey 223 system requirements for the alignment of GLsizei values. The 224 byte stream of compressed image data is placed in host memory 225 starting immediately after the header. Up to 226 PACK_MAX_COMPRESSED_SIZE_SGIX bytes are written. If the value 227 of PACK_MAX_COMPRESSED_SIZE_SGIX is greater than zero and the 228 compressed size is greater than the value of 229 PACK_MAX_COMPRESSED_SIZE_SGIX, the error INVALID_OPERATION is 230 generated. If this occurs, the contents of the first 231 PACK_MAX_COMPRESSED_SIZE_SGIX bytes after the <data> pointer 232 are undefined, but bytes outside this range are guaranteed to 233 be left unchanged. 234 235 The pixel pack parameters PACK_SWAP_BYTES, PACK_LSB_FIRST, 236 PACK_ROW_LENGTH, PACK_SKIP_ROWS, PACK_SKIP_PIXELS, and 237 PACK_ALIGNMENT are not considered when reading back compressed 238 images. 239 240Additions to Chapter 5 of the 1.1 Specification (Special Functions) 241 242 None. 243 244Additions to Chapter 6 of the 1.1 Specification (State and State Requests) 245 246 XXX 247 248Additions to the GLX Specification 249 250 251Errors 252 253 INVALID_VALUE is generated if the pname argument to 254 PixelStorei or PixelStoref is PACK_MAX_COMPRESSED_SIZE_SGIX 255 and the value of pname is less than zero. 256 257 INVALID_OPERATION is generated if the compressed data 258 requested by a ReadPixels or GetTexImage will occupy more than 259 PACK_MAX_COMPRESSED_SIZE_SGIX bytes. 260 261 INVALID_ENUM is generated if the type argument for a pixel 262 command specifies a slim type but the format argument 263 specifies color index, stencil index, or depth values. 264 265 INVALID_ENUM is generated if the type argument for a pixel 266 command which deals with images of greater than two dimensions 267 specifies a slim type. 268 269New State 270 271 Get Value Get Command Type Initial Value Attribute 272 --------- ----------- ---- ------------- --------- 273 PACK_MAX_COMPRESSED_SIZE_SGIX GetIntegerv Z+ 0 client 274 275New Implementation Dependent State 276 277 None. 278