1XXX - Not complete. 2 3Name 4 5 SGIX_resample 6 7Name Strings 8 9 GL_SGIX_resample 10 11Version 12 13 Last Modified Date: January 27, 2015 14 Revision: 2 15 16Number 17 18 212 19 20Dependencies 21 22 SGIX_subsample affects the definition of this extension 23 EXT_texture3D affects the definition of this extension 24 EXT_subtexture affects the definition of this extension 25 EXT_histogram affects the definition of this extension 26 EXT_convolution affects the definition of this extension 27 SGI_color_table affects the definition of this extension 28 29Overview 30 31 This extension enhances the unpacking resampling capabilities 32 of the SGIX_subsample extension. 33 34 When pixel data is received from the client and an unpacking 35 upsampling mode other than PIXEL_SUBSAMPLE_RATE_4444_SGIX is 36 specified, the upsampling is performed via one of two methods: 37 RESAMPLE_REPLICATE_SGIX, RESAMPLE_ZERO_FILL_SGIX. 38 Replicate and zero fill are provided to 39 give the application greatest performance and control over the 40 filtering process. 41 42 However, when pixel data is read back to the client and a 43 packing downsampling mode other than PIXEL_SUBSAMPLE_RATE_4444_SGIX 44 is specified, downsampling is 45 performed via simple component decimation (point sampling). That is, 46 only the RESAMPLE_DECIMATE_SGIX is valid. 47 48 49Issues 50 51 * this spec omits the packing downsampling mode. But I think 52 we will have to address it at some point, so I'm adding the 53 RESAMPLE_DECIMATE_SGIX as another tag to complement the unpacking 54 resample modes. 55 56 * In the public Khronos spec files and headers, these values 57 used to be used for some of the tokens: 58 59 #define GL_PACK_RESAMPLE_SGIX 0x842C 60 #define GL_UNPACK_RESAMPLE_SGIX 0x842D 61 #define GL_RESAMPLE_REPLICATE_SGIX 0x842E 62 #define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F 63 #define GL_RESAMPLE_DECIMATE_SGIX 0x8430 64 65 These values corresponded to the internal SGI spec files and 66 (probably) to what was shipped on SGI IRIX systems supporting this 67 extension, but the spec was always inconsistent with these values. 68 Since SGI is long out of the graphics business, in order to reduce 69 incompatibility between tools pulling from the Khronos spec file 70 and tools pulling from the extension spec, the spec file has been 71 changed to match the extension. 72 73New Procedures and Functions 74 75 None. 76 77New Tokens 78 79 Accepted by the <pname> parameter of PixelStoref, PixelStorei, 80 GetBooleanv, GetIntegerv, GetFloatv and GetDoublev: 81 82 PACK_RESAMPLE_SGIX 0x842E 83 UNPACK_RESAMPLE_SGIX 0x842F 84 85 86 Accepted by the <param> parameter of PixelStoref and 87 PixelStorei when the <pname> parameter is UNPACK_RESAMPLE_SGIX: 88 89 RESAMPLE_REPLICATE_SGIX 0x8433 90 RESAMPLE_ZERO_FILL_SGIX 0x8434 91 92 Accepted by the <param> parameter of PixelStoref and 93 PixelStorei when the <pname> parameter is PACK_RESAMPLE_SGIX: 94 95 RESAMPLE_DECIMATE_SGIX 0x8430 96 97 98Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation) 99 100 None. 101 102Additions to Chapter 3 of the 1.1 Specification (Rasterization) 103 104 3.6.1 Pixel Storage Modes 105 106 The following is added to Table 3.1: 107 108 Parameter Name Type Initial Value Valid Range 109 -------------- ---- ------------- ----------- 110 UNPACK_RESAMPLE_SGIX integer RESAMPLE_REPLICATE_SGIX RESAMPLE_REPLICATE_SGIX 111 RESAMPLE_ZERO_FILL_SGIX 112 113 PACK_RESAMPLE_SGIX integer RESAMPLE_DECIMATE_SGIX RESAMPLE_DECIMATE_SGIX 114 115 116 3.6.3 Rasterization of Pixel Rectangles 117 118 119 <In the new section which is inserted before "Conversion to RGB", append> 120 121 Conversion to Uniform Sampling 122 ------------------------------ 123 124 This step is applied only if the PixelStore parameter 125 UNPACK_SUBSAMPLE_RATE_SGIX is set to something other than 126 PIXEL_SUBSAMPLE_RATE_4444_SGIX. If UNPACK_SUBSAMPLE_RATE_SGIX is set to 127 PIXEL_SUBSAMPLE_RATE_2424_SGIX or PIXEL_SUBSAMPLE_RATE_4242_SGIX then 128 the number of components per pixel is increased from two to three. 129 After upsampling, the data is treated as though it were RGB. When 130 this step is carried out the operation is controlled by the value 131 of the PixelStore parameter UNPACK_RESAMPLE_SGIX. 132 133 If UNPACK_RESAMPLE_SGIX is set to RESAMPLE_REPLICATE_SGIX then the first 134 component of the ith resulting pixel in a row is taken from the 135 first component of input pixel 2*floor(i/2). The second 136 component is taken from ith pixel. The third component is taken 137 from the first component of input pixel 2*floor(i/2)+1. In the 138 4224 case, the fourth component is taken from the third 139 component of each input pixel. This process is fully described 140 in the SGIX_subsample spec. 141 142 If the PixelStore parameter UNPACK_RESAMPLE_SGIX is set to 143 RESAMPLE_ZERO_FILL_SGIX then derived components are zeroed. Note that 144 subsampled components are co-sited with even numbered pixels, 145 and the odd numbered pixels produced have the zeroed components: 146 147 2424: 148 149 <L0,A0> <L1,A1> <L2,A2> <L3,A3> 150 <Cb0,Y0> <Cr0,Y1> <Cb2,Y2> <Cr2, Y3> 151 | | | | | | | | 152 | | o-----o | | | o-----o | 153 | | | | | | | | 154 | | | 0.0 | 0.0 | | | 0.0 | 0.0 155 | | | | | | | | | | | | 156 V V V V V V V V V V V V 157 <Cb0,Y0,Cr0> <Cb0,Y1,Cr0> <Cb2,Y2,Cr2> <Cb2,Y3,Cr2> 158 < R0,G0,B1 > < R0,G1,B1 > < R2,G2,B3 > < R2,G3,B3 > 159 160 4242: 161 < A0,L0> <A1,L1 > <A2,L2 > < A3,L3 > 162 <Y0,Cb0> <Y1,Cr0> <Y2,Cb2> <Y3,Cr2> 163 | | | | | | | | 164 \ / __\__/ \ / __\__/ 165 X ___/ \ X ___/ \ 166 / \ / 0.0 \ 0.0 / \ / 0.0 \ 0.0 167 | | | | | | | | | | | | 168 V V V V V V V V V V V V 169 <Cb0,Y0,Cr0> <Cb0,Y1,Cr0> <Cb2,Y2,Cr2> <Cb2,Y3,Cr2> 170 < R0,G0,B1 > < R0,G1,B1 > < R2,G2,B3 > < R2,G3,B3 > 171 172 173 Note that the <width> parameter to DrawPixels should be even, 174 as should the value of UNPACK_SKIP_PIXELS, and 175 UNPACK_ROW_LENGTH. If any of these are odd then the error 176 INVALID_OPERATION is issued. 177 178 179Additions to Chapter 4 of the 1.1 Specification (Per-Fragment 180Operations and the Frame Buffer) 181 182 None. 183 184Additions to Chapter 5 of the 1.1 Specification (Special Functions) 185 186 None. 187 188Additions to Chapter 6 of the 1.1 Specification (State and State Requests) 189 190 XXX 191 192Additions to the GLX Specification 193 194 195Errors 196 197 XXX 198 199 200New State 201 202 Get Value Get Command Type Initial Value Attribute 203 --------- ----------- ---- ------------- --------- 204 UNPACK_RESAMPLE_SGIX GetIntegerv Z4 RESAMPLE_REPLICATE_SGIX client 205 PACK_RESAMPLE_SGIX GetIntegerv Z4 RESAMPLE_REPLICATE_SGIX client 206 207New Implementation Dependent State 208 209 None. 210 211Revision History 212 213 Revision 1, July 27, 1999 - SGI internal revision #4. 214 215 Revision 2, January 27, 2015 - note that Khronos spec file values from 216 enums have been changed to match the extension spec (Khronos internal 217 bug 12653). 218