1Name 2 3 SGIX_packed_6bytes 4 5Name Strings 6 7 GL_SGIX_packed_6bytes 8 9Version 10 11 $Date: 1999/04/03 08:41:01 $ $Revision: 1.3 $ 12 13Number 14 15 162 16 17Dependencies 18 19 EXT_abgr affects the definition of this extension 20 Histogram affects the definition of this extension 21 Convolution affects the definition of this extension 22 Color_table affects the definition of this extension 23 SGIS_texture4D affects the definition of this extension 24 25Overview 26 27 This extension provides support for packing four component pixels 28 into a 6-byte field, where each component is represented by 12 bits. 29 Since the pixel is represented by 6 unsigned bytes it is inferred 30 that the fields or components of the pixel are not proper machine 31 types. However, since the pixel as a whole can be resepresented 32 as an integral number of bytes, the pixel storage modes, including 33 PACK_SKIP_PIXELS, PACK_ROW_LENGTH, PACK_SKIP_ROWS, PACK_IMAGE_HEIGHT_EXT, 34 PACK_SKIP_IMAGES_EXT, PACK_SWAP_BYTES, PACK_ALIGNMENT, and their unpacking 35 counterparts all work correctly. 36 37New Procedures and Functions 38 39 None 40 41New Tokens 42 43 Accepted by the <type> parameter of DrawPixels, ReadPixels, TexImage1D, 44 TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, 45 TexSubImage2D, TexSubImage3D, GetHistogram, GetMinmax, 46 ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D, 47 GetConvolutionFilter, SeparableFilter2D, SeparableFilter3D, 48 GetSeparableFilter, ColorTable, GetColorTable, TexImage4DSGIS, 49 and TexSubImage4DSGIS: 50 51 6BYTES_12_12_12_12_SGIX 0x???? 52 53Additions to Chapter 2 of the 1.2 Specification (OpenGL Operation) 54 55 None 56 57Additions to Chapter 3 of the 1.2 Specification (Rasterization) 58 59 The token defined by this extension is added to Table 3.5: 60 61 <type> Parameter Corresponding Special 62 Token Value GL Data Type Interpretation 63 ---------------- ------------- -------------- 64 UNSIGNED_BYTE ubyte No 65 BITMAP ubyte Yes 66 BYTE byte No 67 UNSIGNED_SHORT ushort No 68 SHORT short No 69 UNSIGNED_INT uint No 70 INT int No 71 FLOAT float No 72 BITMAP ubyte Yes 73 UNSIGNED_BYTE_3_3_2 ubyte Yes 74 UNSIGNED_BYTE_3_3_2_REV ubyte Yes 75 UNSIGNED_SHORT_5_6_5 ushort Yes 76 UNSIGNED_SHORT_5_6_5_REV ushort Yes 77 UNSIGNED_SHORT_4_4_4_4 ushort Yes 78 UNSIGNED_SHORT_4_4_4_4_REV ushort Yes 79 UNSIGNED_SHORT_5_5_5_1 ushort Yes 80 UNSIGNED_SHORT_5_5_5_1_REV ushort Yes 81 UNSIGNED_INT_8_8_8_8 uint Yes 82 UNSIGNED_INT_8_8_8_8_REV uint Yes 83 UNSIGNED_INT_10_10_10_2 uint Yes 84 UNSIGNED_INT_10_10_10_2_REV uint Yes 85 UNSIGNED_6BYTES_12_12_12_12_SGIX 6*ubyte Yes 86 87 Table 3.5: DrawPixels and ReadPixels <type> parameter values and the 88 corresponding GL data types. Refer to table 2.2 for definitions of 89 GL data types. Special interpretations are described near the end 90 of section 3.6.4. 91 92 [Additions to Section 3.6.4 of the GL Specification (Rasterization of Pixel 93 Rectangles) is made as follows:] 94 95 3.6.4 Rasterization of Pixel Rectangles 96 97 Unpacking 98 --------- 99 [Modify fourth paragraph to read:] 100 101 Calling DrawPixels with a <type> of UNSIGNED_BYTE_3_3_2, UNSIGNED_BYTE_3_3_2_REV, 102 UNSIGNED_SHORT_5_6_5, UNSIGNED_SHORT_5_6_5_REV, UNSIGNED_SHORT_4_4_4_4, 103 UNSIGNED_SHORT_4_4_4_4_REV, UNSIGNED_SHORT_5_5_5_1, UNSIGNED_SHORT_5_5_5_1_REV, 104 UNSIGNED_INT_8_8_8_8, UNSIGNED_INT_8_8_8_8_REV, UNSIGNED_INT_10_10_10_2, or 105 UNSIGNED_INT_10_10_10_2_REV is a special case in which all the components of 106 each group are packed into a single unsigned byte, unsigned short, or unsigned int, 107 depending on the type. Additionally, calling DrawPixels with a <type> of 108 UNSIGNED_6BYTES_12_12_12_12_SGIX is a special case in which all the components of 109 each group are is packed into 6 bytes. The number of components per packed pixel 110 is fixed by the <type>, and must match the number of components per group as 111 indicated by the <format> parameter, as listed in table 3.8. The error 112 INVALID_OPERATION is generated if a mismatch occurs. This constraint also holds 113 for all other functions that accept or return pixel data using <type> and <format> 114 parameters to define the type and format of that data. 115 116 A new table is added to demonstrate bitfield locations <type> 117 UNSIGNED_6BYTES_12_12_12_12_SGIX. The bitfield locations for the first, second, 118 third and fourth component for this pixel type is shown in Table 3.12. 119 120 121 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 122 +--------------------------------+--------------------------------------+ 123 | | | 124 +--------------------------------+--------------------------------------+ 125 first second 126 element element 127 128 129 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 130 +--------------------------------+--------------------------------------+ 131 | | | 132 +--------------------------------+--------------------------------------+ 133 134 third fourth 135 element element 136 137 Table 3.12 UNSIGNED_6BYTES_12_12_12_SGIX format 138 139 [Add to the paragraph describing byte swapping:] 140 141 If byte swapping is enabled with UNSIGNED_6BYTES_12_12_12_SGIX as the <type>, 142 the byte swapping is performed as follows: 143 144 given the 6byte ordering as 145 146 b5 b4 b3 b2 b1 b0 147 148 where b# represents the byte index or order, then byte swapping yields 149 150 b4 b5 b2 b3 b0 b1 151 152 153 154 155Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 156and the Framebuffer) 157 158 [Make the following addition to Table 4.7] 159 160 <type> GL Data Component 161 Parameter Type Conversion Formula 162 --------- ------- ------------------ 163 UNSIGNED_INT_10_10_10_2_EXT uint c = ((2**N)-1)*f 164 165 Table 4.7: Reversed component conversions - used when component data 166 are being returned to client memory. Color, normal, and depth 167 components are converted from the internal floating-point 168 representation (f) to a datum of the specified GL data type (c) using 169 the equations in this table. All arithmetic is done in the internal 170 floating point format. These conversions apply to component data 171 returned by GL query commands and to components of pixel data returned 172 to client memory. The equations remain the same even if the 173 implemented ranges of the GL data types are greater than the minimum 174 required ranges. (Refer to table 2.2.) Equations with N as the 175 exponent are performed for each bitfield of the packed data type, 176 with N set to the number of bits in the bitfield. 177 178Additions to Chapter 5 of the 1.0 Specification (Special Functions) 179 180 None 181 182Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 183 184 None 185 186Additions to the GLX Specification 187 188 None 189 190GLX Protocol 191 192 None 193 194Dependencies on EXT_abgr 195 196 If EXT_abgr is not implemented, then the references to ABGR_EXT in this 197 file are invalid, and should be ignored. 198 199Dependencies on Histogram 200 201 If EXT_histogram is not implemented, then the references to 202 GetHistogramEXT and GetMinmaxEXT in this file are invalid, and should be 203 ignored. 204 205Dependencies on Convolution 206 207 If EXT_convolution is not implemented, then the references to 208 ConvolutionFilter1DEXT, ConvolutionFilter2DEXT, ConvolutionFilter3DEXT, 209 GetConvolutionFilterEXT, SeparableFilter2DEXT, SeparableFilter3DEXT, and 210 GetSeparableFilterEXT in this file are invalid, and should be ignored. 211 212Dependencies on Color_table 213 214 If Color_table is not implemented, then the references to 215 ColorTableSGI and GetColorTableSGI in this file are invalid, and should 216 be ignored. 217 218Dependencies on SGIS_texture4D 219 220 If SGIS_texture4D is not implemented, then the references to 221 TexImage4DSGIS and TexSubImage4DSGIS in this file are invalid, and should 222 be ignored. 223 224 225Errors 226 227 INVALID_OPERATION is generated by GenericPixelFunction if its <type> 228 parameter is UNSIGNED_6BYTES_12_12_12_SGIX and its 229 <format> parameter does not specify four components. 230 231New State 232 233 None 234 235New Implementation Dependent State 236 237 None 238