1Name 2 3 EXT_convolution 4 5Name Strings 6 7 GL_EXT_convolution 8 9Version 10 11 Date: June 27, 2002 Version: 1.32 12 13Number 14 15 12 16 17Dependencies 18 19 EXT_abgr affects the definition of this extension 20 EXT_texture is required 21 EXT_copy_texture affects the definition of this extension 22 23Overview 24 25 This extension defines 1 and 2 dimensional convolution operations 26 at a fixed location in the pixel transfer process. Thus pixel drawing, 27 reading, and copying, as well as texture image definition, are all 28 candidates for convolution. The convolution kernels are themselves 29 treated as 1 and 2 dimensional images, which can be loaded from 30 application memory or from the framebuffer. 31 32 This extension is designed to accommodate 3D convolution, but the 33 API is left for a future extension. 34 35New Procedures and Functions 36 37 void ConvolutionFilter1DEXT(enum target, 38 enum internalformat, 39 sizei width, 40 enum format, 41 enum type, 42 const void* image); 43 44 void ConvolutionFilter2DEXT(enum target, 45 enum internalformat, 46 sizei width, 47 sizei height, 48 enum format, 49 enum type, 50 const void* image); 51 52 void CopyConvolutionFilter1DEXT(enum target, 53 enum internalformat, 54 int x, 55 int y, 56 sizei width); 57 58 void CopyConvolutionFilter2DEXT(enum target, 59 enum internalformat, 60 int x, 61 int y, 62 sizei width, 63 sizei height); 64 65 void GetConvolutionFilterEXT(enum target, 66 enum format, 67 enum type, 68 void* image); 69 70 void SeparableFilter2DEXT(enum target, 71 enum internalformat, 72 sizei width, 73 sizei height, 74 enum format, 75 enum type, 76 const void* row, 77 const void* column); 78 79 void GetSeparableFilterEXT(enum target, 80 enum format, 81 enum type, 82 void* row, 83 void* column, 84 void* span); 85 86 void ConvolutionParameteriEXT(enum target, 87 enum pname, 88 int param); 89 90 void ConvolutionParameterivEXT(enum target, 91 enum pname, 92 const int* params); 93 94 void ConvolutionParameterfEXT(enum target, 95 enum pname, 96 float param); 97 98 void ConvolutionParameterfvEXT(enum target, 99 enum pname, 100 const float* params); 101 102 void GetConvolutionParameterivEXT(enum target, 103 enum pname, 104 int* params); 105 106 void GetConvolutionParameterfvEXT(enum target, 107 enum pname, 108 float* params); 109 110New Tokens 111 112 Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by 113 the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and 114 GetDoublev, and by the <target> parameter of ConvolutionFilter1DEXT, 115 CopyConvolutionFilter1DEXT, GetConvolutionFilterEXT, 116 ConvolutionParameteriEXT, ConvolutionParameterfEXT, 117 ConvolutionParameterivEXT, ConvolutionParameterfvEXT, 118 GetConvolutionParameterivEXT, and GetConvolutionParameterfvEXT: 119 120 CONVOLUTION_1D_EXT 0x8010 121 122 Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by 123 the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and 124 GetDoublev, and by the <target> parameter of ConvolutionFilter2DEXT, 125 CopyConvolutionFilter2DEXT, GetConvolutionFilterEXT, 126 ConvolutionParameteriEXT, ConvolutionParameterfEXT, 127 ConvolutionParameterivEXT, ConvolutionParameterfvEXT, 128 GetConvolutionParameterivEXT, and GetConvolutionParameterfvEXT: 129 130 CONVOLUTION_2D_EXT 0x8011 131 132 Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by 133 the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and 134 GetDoublev, and by the <target> parameter of SeparableFilter2DEXT, 135 SeparableFilter2DEXT, GetSeparableFilterEXT, 136 ConvolutionParameteriEXT, ConvolutionParameterfEXT, 137 ConvolutionParameterivEXT, ConvolutionParameterfvEXT, 138 GetConvolutionParameterivEXT, and GetConvolutionParameterfvEXT: 139 140 SEPARABLE_2D_EXT 0x8012 141 142 Accepted by the <pname> parameter of ConvolutionParameteriEXT, 143 ConvolutionParameterfEXT, ConvolutionParameterivEXT, 144 ConvolutionParameterfvEXT, GetConvolutionParameterivEXT, and 145 GetConvolutionParameterfvEXT: 146 147 CONVOLUTION_BORDER_MODE_EXT 0x8013 148 149 Accepted by the <pname> parameter of ConvolutionParameterivEXT, 150 ConvolutionParameterfvEXT, GetConvolutionParameterivEXT, and 151 GetConvolutionParameterfvEXT: 152 153 CONVOLUTION_FILTER_SCALE_EXT 0x8014 154 CONVOLUTION_FILTER_BIAS_EXT 0x8015 155 156 Accepted by the <param> parameter of ConvolutionParameteriEXT, 157 and ConvolutionParameterfEXT, and by the <params> parameter of 158 ConvolutionParameterivEXT and ConvolutionParameterfvEXT, when the 159 <pname> parameter is CONVOLUTION_BORDER_MODE_EXT: 160 161 REDUCE_EXT 0x8016 162 163 Accepted by the <pname> parameter of GetConvolutionParameterivEXT and 164 GetConvolutionParameterfvEXT: 165 166 CONVOLUTION_FORMAT_EXT 0x8017 167 CONVOLUTION_WIDTH_EXT 0x8018 168 CONVOLUTION_HEIGHT_EXT 0x8019 169 MAX_CONVOLUTION_WIDTH_EXT 0x801A 170 MAX_CONVOLUTION_HEIGHT_EXT 0x801B 171 172 Accepted by the <pname> parameter of PixelTransferi, PixelTransferf, 173 and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, 174 and GetDoublev: 175 176 POST_CONVOLUTION_RED_SCALE_EXT 0x801C 177 POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D 178 POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E 179 POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F 180 POST_CONVOLUTION_RED_BIAS_EXT 0x8020 181 POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 182 POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 183 POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 184 185Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 186 187 None 188 189Additions to Chapter 3 of the 1.0 Specification (Rasterization) 190 191 The specification of convolution operators is added to the GL 192 Specification in section 3.6.2, "Pixel Transfer Modes." A 2-dimensional 193 convolution filter image is specified using the ConvolutionFilter2DEXT 194 command. Its <target> parameter must be CONVOLUTION_2D_EXT. Its 195 <internalformat> parameter specifies the format of image that will be 196 retained; it must be one of ALPHA, LUMINANCE, LUMINANCE_ALPHA, 197 INTENSITY_EXT, RGB, or RGBA. Its <width>, <height>, <format>, <type>, 198 and <image> parameters specify an image in memory with exactly the same 199 semantics of the corresponding parameters to DrawPixels. 200 201 The specified image is extracted from memory and processed just as if 202 DrawPixels were called, stopping after the Final Expansion to RGBA step 203 is completed. The R, G, B, and A components of each pixel are then scaled 204 by the four 2D CONVOLUTION_FILTER_SCALE_EXT parameters, then biased by the 205 four 2D CONVOLUTION_FILTER_BIAS_EXT parameters. These parameters are 206 themselves specified by calling ConvolutionParameterivEXT or 207 ConvolutionParameterfvEXT with <target> CONVOLUTION_2D_EXT, <pname> 208 CONVOLUTION_FILTER_SCALE_EXT or CONVOLUTION_FILTER_BIAS_EXT, and <params> 209 pointing to a vector of four values: red, green, blue, and alpha, in that 210 order. The R, G, B, and A values are not clamped to [0,1] at any time 211 during this process. 212 213 Each pixel is then converted to have the specified internal format. 214 This conversion simply maps the component values of the pixel (R, G, B, 215 and A) to the values included in the internal format (red, green, blue, 216 alpha, luminance, and intensity). The mapping is as follows: 217 218 Internal Format red green blue alpha luminance intensity 219 --------------- --- ----- ---- ----- --------- --------- 220 221 ALPHA A 222 LUMINANCE R 223 LUMINANCE_ALPHA A R 224 INTENSITY_EXT R 225 RGB R G B 226 RGBA R G B A 227 228 229 Pixel Organization 230 231 The red, green, blue, alpha, luminance, and/or intensity components of 232 the pixels are stored in floating point, rather than integer format. 233 They form a 2-dimensional image indexed with coordinates i,j such that i 234 increases from left to right, starting at zero, and j increases from 235 bottom to top, also starting at zero. Image location i,j is specified 236 by the Nth pixel, counting from zero, where N is i+j*width. 237 238 The error INVALID_VALUE is generated if <width> or <height> is greater 239 than the maximum supported value. This value is queried with 240 GetConvolutionParameterivEXT, setting <target> to CONVOLUTION_2D_EXT and 241 <pname> to MAX_CONVOLUTION_WIDTH_EXT or MAX_CONVOLUTION_HEIGHT_EXT, 242 respectively. 243 244 A 1-dimensional convolution filter is defined using ConvolutionFilter1DEXT. 245 Its <target> parameter must be CONVOLUTION_1D_EXT. Its <internalformat>, 246 <format>, and <type> parameters have identical semantics and accept the 247 same values as do their 2D counterparts. <image> must point to a 248 1-dimensional image, however. 249 250 The 1-dimensional image is taken from memory and processed as if 251 ConvolutionFilter2DEXT were called with a height of 1, except that it is 252 scaled and biased by the two 1D vectors, rather than the 2D vectors. 253 (The 1D scale and bias vectors are specified using 254 ConvolutionParameterivEXT with <target> CONVOLUTION_1D_EXT and <pname> 255 CONVOLUTION_FILTER_SCALE_EXT or CONVOLUTION_FILTER_BIAS_EXT.) The 256 1-dimensional image is formed with coordinates i such that i increases 257 from left to right, starting at zero. Image location i is specified by 258 the ith pixel, counting from zero. 259 260 The error INVALID_VALUE is generated if <width> is greater than the 261 maximum supported value, which is queried using 262 GetConvolutionParameterivEXT, setting <target> to CONVOLUTION_1D_EXT 263 and <pname> to MAX_CONVOLUTION_WIDTH_EXT. 264 265 If EXT_copy_texture is supported, one and 2-dimensional filters can also 266 be defined using image data in the framebuffer. Rather than accepting 267 image data from memory, they copy image data from the color buffer 268 specified by the current ReadBuffer mode. CopyConvolutionFilter2DEXT 269 accepts image data from a <width> pixel wide by <height> pixel high 270 color buffer region whose lower-left pixel has window coordinates <x>,<y>. 271 If any pixels within this region are outside the window that is 272 associated with the GL context, the values obtained for those pixels 273 are undefined. 274 275 These pixel values are obtained from the framebuffer exactly as if 276 ReadPixels had been called with <format> set to RGBA, with processing 277 continuing through Conversion of RGBA values. At this point all pixel 278 component values are treated exactly as if ConvolutionFilter2DEXT had 279 been called, beginning with the scaling of the color components by 280 CONVOLUTION_FILTER_SCALE_SGI. Pixel ordering is such that lower X 281 screen coordinates correspond to lower i filter image coordinates, and 282 lower Y screen coordinates correspond to lower j filter image 283 coordinates. The semantics and accepted values of the <target> and 284 <internalformat> parameters are exactly equivalent to their 285 ConvolutionFilter2DEXT counterparts. 286 287 CopyConvolutionFilter1DEXT accepts image data from a <width> pixel wide 288 by 1 pixel high color buffer region whose left-most pixel has window 289 coordinates <x>,<y>. If any pixels within this region are outside the 290 window that is associated with the GL context, the values obtained for 291 those pixels are undefined. 292 293 The pixels are processed just as those of CopyConvolutionFilter2DEXT are, 294 and they define a filter image such that lower X window coordinates 295 correspond to lower i filter image coordinates. The semantics and 296 accepted values of the <target> and <internalformat> parameters are 297 exactly equivalent to their ConvolutionFilter1DEXT counterparts. 298 299 Special facilities are provided for the definition of 2-dimensional 300 separable filters -- filters whose image can be represented as the 301 product of two 1-dimensional images, rather than as full 302 2-dimensional images. A 2-dimensional convolution filter is specified 303 using SeparableFilter2DEXT. Its <target> parameter must be 304 SEPARABLE_2D_EXT. Its <internalformat> parameter specifies the formats 305 of two 1-dimensional images that will be retained; it must be one of 306 ALPHA, LUMINANCE, LUMINANCE_ALPHA, INTENSITY_EXT, RGB, or RGBA. <row> 307 and <column> point to two 1-dimensional images in memory. The <row> 308 image is <width> pixels wide, and is defined by <format> and <type>. 309 The <column> image is <height> pixels wide, and is also defined by 310 <format> and <type>. 311 312 The two images are extracted from memory and processed just as if 313 ConvolutionFilter1DEXT were called separately for each, with the resulting 314 retained images replacing the current 2D separable filter images, except 315 that each image is scaled and biased using the 2D separable scale and bias 316 vectors. (These vectors are specified using ConvolutionParameterivEXT with 317 <target> SEPARABLE_2D_EXT and <pname> CONVOLUTION_FILTER_SCALE_EXT or 318 CONVOLUTION_FILTER_BIAS_EXT.) 319 320 The operations of the convolution filters are added to the GL 321 Specification in section 3.6.3, "Rasterization of Pixel Rectangles, 322 immediately following the subsection "Index Lookup", and immediately 323 prior to the operations described by EXT_histogram. Filters are 324 enabled and disabled by calling Enable and Disable with filter name 325 passed as the <cap> parameter. Convolution is performed only for RGBA 326 groups, though these groups may have been specified as color indexes 327 and converted to RGBA by index table lookup. 328 329 If CONVOLUTION_1D_EXT is enabled, the 1-dimensional convolution filter 330 is applied only to the image passed to TexImage1D, and to 1-dimensional 331 textures queried by GetTexImage. If CONVOLUTION_2D_EXT is enabled, the 332 2-dimensional convolution filter is applied only to the 2D images passed 333 to DrawPixels, CopyPixels, ReadPixels, TexImage2D, TexSubImage2DEXT, 334 CopyTexImage2DEXT, CopyTexSubImage2DEXT, and GetTexImage, and to 335 2-dimensional images queried by GetTexImage. If SEPARABLE_2D_EXT is 336 enabled, and CONVOLUTION_2D_EXT is disabled, the separable 2-dimensional 337 convolution filter is applied only to these same images. 338 339 The convolution operation is a sum of products of source image pixels 340 and convolution filter pixels. Source image pixels always have four 341 components: red, green, blue, and alpha, denoted in the equations below 342 as Rs, Gs, Bs, and As. Filter pixels may be stored in one of five 343 formats, with 1, 2, 3, or 4 components. These components are denoted 344 as Rf, Gf, Bf, Af, Lf, and If in the equations below. The result of the 345 convolution operation is the 4-tuple R,G,B,A. Depending on the internal 346 format of the filter, individual color components of each source image 347 pixel are convolved with one filter component, or are passed unmodified. 348 The rules for this are: 349 350 Filter format 351 ------------- 352 ALPHA R = Rs G = Gs B = Bs A = convolve(As,Af) 353 LUMINANCE R = convolve(Rs,Lf) G = convolve(Gs,Lf) B = convolve(Bs,Lf) A = As 354 LUMINANCE_ALPHA R = convolve(Rs,Lf) G = convolve(Gs,Lf) B = convolve(Bs,Lf) A = convolve(As,Af) 355 INTENSITY R = convolve(Rs,If) G = convolve(Gs,If) B = convolve(Bs,If) A = convolve(As,If) 356 RGB R = convolve(Rs,Rf) G = convolve(Gs,Gf) B = convolve(Bs,Bf) A = As 357 RGBA R = convolve(Rs,Rf) G = convolve(Gs,Gf) B = convolve(Bs,Bf) A = convolve(As,Af) 358 359 The convolution operation is defined differently for each of the three 360 convolution filters. In the following equations the 361 362 SUM{}{}equation 363 364 notation indicate the sum of the equation evaluated for all combinations 365 of conditions indicated within the sets of curly brackets. The 366 variables Wf and Hf refer to the dimensions of the convolution filter. 367 The variables Ws and Hs refer to the dimensions of the source pixel 368 image. The pixel indexing nomenclature is decribed in the Pixel 369 Organization section, above. 370 371 The convolution equations are: 372 373 1-dimensional filter: 374 375 C[i] = SUM{n = 0 through Wf-1} 376 377 Cs[i+n] * Cf[n] 378 379 2-dimensional filter: 380 381 C[i,j] = SUM{n = 0 through Wf-1} 382 {m = 0 through Hf-1} 383 384 Cs[i+n,j+m] * Cf[n,m] 385 386 2-dimensional separable filter: 387 388 C[i,j] = SUM{n = 0 through Wf-1} 389 {m = 0 through Hf-1} 390 391 Cs[i+n,j+m] * Crow[n] * Ccolumn[m] 392 393 If Wf of a 1-dimensional filter is zero, then C[i] is always set to 394 zero. Likewise, if either Wf or Hf of a 2-dimensional filter is zero, 395 then C[i,j] is always set to zero. 396 397 The convolution border mode for a specific convolution filter is 398 specified using ConvolutionParameteriEXT with the <target> parameter 399 set to the name of the filter, the <pname> parameter set to 400 CONVOLUTION_BORDER_MODE_EXT, and <param> set to REDUCE_EXT. (This 401 extension defines only a single border mode.) The width and height of 402 source images convolved with border mode REDUCE_EXT are reduced by 403 Wf-1 and Hf-1, respectively. If this reduction would generate a 404 resulting image with zero or negative width and/or height, the output 405 is simply null, with no error generated. The coordinates of the image 406 that results from a convolution with border mode REDUCE_EXT are zero 407 through Ws-Wf in width, and zero through Hs-Hf in height. In 408 cases where errors can result from the specification of invalid image 409 dimensions, it is these resulting dimensions that are tested, not the 410 dimensions of the source image. (A specific example is TexImage1D and 411 TexImage2D, which specify constraints for image dimensions. Even if 412 TexImage1D or TexImage2D is called with a null pixel pointer, the 413 dimensions of the resulting texture image are those that would result 414 from the convolution of the specified image.) 415 416 If a convolution operation is performed, the resulting image is scaled 417 and biased by parameters specified using the PixelTransfer command. 418 These operations are: 419 420 red = red * POST_CONVOLUTION_RED_SCALE_EXT 421 + POST_CONVOLUTION_RED_BIAS_EXT 422 423 green = green * POST_CONVOLUTION_GREEN_SCALE_EXT 424 + POST_CONVOLUTION_GREEN_BIAS_EXT 425 426 blue = blue * POST_CONVOLUTION_BLUE_SCALE_EXT 427 + POST_CONVOLUTION_BLUE_BIAS_EXT 428 429 alpha = alpha * POST_CONVOLUTION_ALPHA_SCALE_EXT 430 + POST_CONVOLUTION_ALPHA_BIAS_EXT 431 432 If no convolution operation is performed, the scale and bias are not 433 performed either. 434 435Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 436and the Framebuffer) 437 438 The operation of convolution during pixel copy and query operations is 439 identical to the operation during pixel drawing and texture image 440 definition. 441 442Additions to Chapter 5 of the 1.0 Specification (Special Functions) 443 444 Commands GetConvolutionFilterEXT, GetSeparableFilterEXT, 445 GetConvolutionParameterivEXT, and GetConvolutionParameterfvEXT are not 446 included in display lists. They are always executed immediately. 447 448Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 449 450 Integer and floating point query functions GetConvolutionParameterivEXT 451 and GetConvolutionParameterfvEXT are provided. <target> must be 452 CONVOLUTION_1D_EXT, CONVOLUTION_2D_EXT, or SEPARABLE_2D_EXT. <pname> 453 is one of CONVOLUTION_FORMAT_EXT, CONVOLUTION_WIDTH_EXT, 454 CONVOLUTION_HEIGHT_EXT, MAX_CONVOLUTION_WIDTH_EXT, or 455 MAX_CONVOLUTION_HEIGHT_EXT. The value of the specified parameter is 456 returned in <params>. 457 458 The current contents of a convolution filter image are queried using 459 GetConvolutionFilterEXT. <target> must be CONVOLUTION_1D_EXT or 460 CONVOLUTION_2D_EXT. <format> must be one of RED, GREEN, BLUE, ALPHA, RGB, 461 RGBA, ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA. <type> must be 462 UNSIGNED_BYTE, BYTE, UNSIGNED_SHORT, SHORT, UNSIGNED_INT, INT, or FLOAT. 463 The 1-dimensional or 2-dimensional image is returned to <image>. No pixel 464 transfer operations are performed on this image, but pixel storage modes 465 that are applicable to ReadPixels are performed. Color components are 466 converted from the internal floating point representation to <type> 467 according to table 2.4. Prior to the conversion, if <type> is one of 468 UNSIGNED_BYTE, UNSIGNED_SHORT, or UNSIGNED_INT, the color components are 469 clamped to 0..1, if <type> is one of BYTE, SHORT, or INT, the components are 470 clamped to -1..1. No clamping is performed if <type> is FLOAT. Color 471 components that are requested in the specified <format>, but which are not 472 included in the internal format of the filter image, are returned as zero. 473 The assignments of internal color components to the components requested by 474 <format> are 475 476 internal component resulting component 477 ------------------ ------------------- 478 red red 479 green green 480 blue blue 481 alpha alpha 482 luminance red 483 intensity red 484 485 The current contents of a separable filter image are queried using 486 GetSeparableFilterEXT. <target> must be SEPARABLE_2D_EXT. <format> 487 and <type> accept the same values as do the corresponding parameters 488 of GetConvolutionFilterEXT. The row and column images are returned to 489 <row> and <column> respectively. No change is made to any location 490 related to <span>. Pixel processing and component mapping are 491 identical to those of GetConvolutionFilterEXT. 492 493Additions to the GLX Specification 494 495 None 496 497GLX Protocol 498 499 Thirteen new GL commands are added. 500 501 The following six rendering commands are sent to the server as part of 502 a glXRender request: 503 504 CopyConvolutionFilter1DEXT 505 2 24 rendering command length 506 2 4107 rendering command opcode 507 4 ENUM target 508 4 ENUM internalformat 509 4 INT32 x 510 4 INT32 y 511 4 INT32 width 512 513 CopyConvolutionFilter2DEXT 514 2 28 rendering command length 515 2 4108 rendering command opcode 516 4 ENUM target 517 4 ENUM internalformat 518 4 INT32 x 519 4 INT32 y 520 4 INT32 width 521 4 INT32 height 522 523 ConvolutionParameteriEXT 524 2 16 rendering command length 525 2 4105 rendering command opcode 526 4 ENUM target 527 4 ENUM pname 528 0x8013 CONVOLUTION_BORDER_MODE_EXT 529 4 INT32 param 530 531 ConvolutionParameterivEXT 532 2 12+4*n rendering command length 533 2 4106 rendering command opcode 534 4 ENUM target 535 4 ENUM pname 536 0x8013 n=1 CONVOLUTION_BORDER_MODE_EXT 537 0x8014 n=4 CONVOLUTION_FILTER_SCALE_EXT 538 0x8015 n=4 CONVOLUTION_FILTER_BIAS_EXT 539 0x8017 n=1 CONVOLUTION_FORMAT_EXT 540 0x8018 n=1 CONVOLUTION_WIDTH_EXT 541 0x8019 n=1 CONVOLUTION_HEIGHT_EXT 542 0x801A n=1 MAX_CONVOLUTION_WIDTH_EXT 543 0x801B n=1 MAX_CONVOLUTION_HEIGHT_EXT 544 4*n LISTofINT32 params 545 546 ConvolutionParameterfEXT 547 2 16 rendering command length 548 2 4103 rendering command opcode 549 4 ENUM target 550 4 ENUM pname 551 0x8013 CONVOLUTION_BORDER_MODE_EXT 552 4 FLOAT32 param 553 554 ConvolutionParameterfvEXT 555 2 12+4*n rendering command length 556 2 4104 rendering command opcode 557 4 ENUM target 558 4 ENUM pname 559 0x8013 n=1 CONVOLUTION_BORDER_MODE_EXT 560 0x8014 n=4 CONVOLUTION_FILTER_SCALE_EXT 561 0x8015 n=4 CONVOLUTION_FILTER_BIAS_EXT 562 0x8017 n=1 CONVOLUTION_FORMAT_EXT 563 0x8018 n=1 CONVOLUTION_WIDTH_EXT 564 0x8019 n=1 CONVOLUTION_HEIGHT_EXT 565 0x801A n=1 MAX_CONVOLUTION_WIDTH_EXT 566 0x801B n=1 MAX_CONVOLUTION_HEIGHT_EXT 567 4*n LISTofFLOAT32 params 568 569 The following three rendering commands contain pixel data and are thus 570 sent to the server as part of a glXRender request or as part of a 571 glXRenderLarge request: 572 573 ConvolutionFilter1DEXT 574 2 48+n+p rendering command length 575 2 4101 rendering command opcode 576 1 BOOL swap_bytes 577 1 BOOL lsb_first 578 2 unused 579 4 CARD32 row_length 580 4 CARD32 skip_rows 581 4 CARD32 skip_pixels 582 4 CARD32 alignment 583 4 ENUM target 584 4 ENUM internalformat 585 4 INT32 width 586 4 INT32 height 587 4 ENUM format 588 4 ENUM type 589 n LISTofBYTE pixels 590 p unused, p=pad(n) 591 592 If the command is encoded in a glXRenderLarge request, the 593 command opcode and command length fields above are expanded to 594 4 bytes each: 595 4 52+n+p rendering command length 596 4 4101 rendering command opcode 597 598 If <width> < 0, <format> is invalid or <type> is invalid, then the 599 command is erroneous and n=0. The structure of <pixels> is described 600 in Appendix A of the GLX Protocol Specification, "Pixel Data", using 601 the parameters <swap_bytes>, <lsb_first>, <row_length>, <skip_rows>, 602 <skip_pixels>, <alignment>, <width>, <format>, and <type> as given 603 in the request, and a height of 1. 604 605 ConvolutionFilter2DEXT 606 2 48+n+p rendering command length 607 2 4102 rendering command opcode 608 1 BOOL swap_bytes 609 1 BOOL lsb_first 610 2 unused 611 4 CARD32 row_length 612 4 CARD32 skip_rows 613 4 CARD32 skip_pixels 614 4 CARD32 alignment 615 4 ENUM target 616 4 ENUM internalformat 617 4 INT32 width 618 4 INT32 height 619 4 ENUM format 620 4 ENUM type 621 n LISTofBYTE pixels 622 p unused, p=pad(n) 623 624 If the command is encoded in a glXRenderLarge request, the 625 command opcode and command length fields above are expanded to 626 4 bytes each: 627 4 52+n+p rendering command length 628 4 4102 rendering command opcode 629 630 If <width> < 0, <height> < 0, <format> is invalid or <type> is 631 invalid, then the command is erroneous and n=0. The structure of 632 <pixels> is described in Appendix A of the GLX Protocol 633 Specification, "Pixel Data", using the parameters <swap_bytes>, 634 <lsb_first>, <row_length>, <skip_rows>, <skip_pixels>, <alignment>, 635 <width>, <height>, <format>, and <type> as given in the request. 636 637 SeparableFilter2DEXT 638 2 48+n1+p1+n2+p2 rendering command length 639 2 4109 rendering command opcode 640 1 BOOL swap_bytes 641 1 BOOL lsb_first 642 2 unused 643 4 CARD32 row_length 644 4 CARD32 skip_rows 645 4 CARD32 skip_pixels 646 4 CARD32 alignment 647 4 ENUM target 648 4 ENUM internalformat 649 4 INT32 width 650 4 INT32 height 651 4 ENUM format 652 4 ENUM type 653 n1 LISTofBYTE row 654 p1 unused, p=pad(n) 655 n2 LISTofBYTE column 656 p2 unused, p=pad(n) 657 658 If the command is encoded in a glXRenderLarge request, the 659 command opcode and command length fields above are expanded 660 to 4 bytes each: 661 4 52+n+p rendering command length 662 4 4109 rendering command opcode 663 664 If <width> < 0, <height> < 0, <format> is invalid or <type> is 665 invalid, then the command is erroneous and n=0. The structure of 666 <row> is described in Appendix A of the GLX Protocol Specification, 667 "Pixel Data", using the parameters <swap_bytes>, <lsb_first>, 668 <row_length>, <skip_rows>, <skip_pixels>, <alignment>, <width>, 669 <format>, and <type> as given in the request, and and a height of 1. 670 The structure of <column> is the same (it is also a one-dimensional 671 image) except that it is <height> pixels wide, instead of <width> 672 pixels wide. 673 674 The remaining commands are non-rendering commands. These commands are 675 sent separately (i.e., not as part of a glXRender or glXRenderLarge 676 request), using the glXVendorPrivateWithReply request: 677 678 GetConvolutionParameterivEXT 679 1 CARD8 opcode (X assigned) 680 1 17 GLX opcode (glXVendorPrivateWithReply) 681 2 5 request length 682 4 3 vendor specific opcode 683 4 GLX_CONTEXT_TAG context tag 684 4 ENUM target 685 4 ENUM pname 686 => 687 1 1 reply 688 1 unused 689 2 CARD16 sequence number 690 4 m reply length, m = (n==1 ? 0 : n) 691 4 unused 692 4 CARD32 n 693 694 if (n=1) this follows: 695 696 4 INT32 params 697 12 unused 698 699 otherwise this follows: 700 701 16 unused 702 n*4 LISTofINT32 params 703 704 Note that n may be zero, indicating that a GL error occurred. 705 706 707 GetConvolutionParameterfvEXT 708 1 CARD8 opcode (X assigned) 709 1 17 GLX opcode (glXVendorPrivateWithReply) 710 2 5 request length 711 4 2 vendor specific opcode 712 4 GLX_CONTEXT_TAG context tag 713 4 ENUM target 714 4 ENUM pname 715 => 716 1 1 reply 717 1 unused 718 2 CARD16 sequence number 719 4 m reply length, m = (n==1 ? 0 : n) 720 4 unused 721 4 CARD32 n 722 723 if (n=1) this follows: 724 725 4 FLOAT32 params 726 12 unused 727 728 otherwise this follows: 729 730 16 unused 731 n*4 LISTofFLOAT32 params 732 733 Note that n may be zero, indicating that a GL error occurred. 734 735 736 GetConvolutionFilterEXT 737 1 CARD8 opcode (X assigned) 738 1 17 GLX opcode (glXVendorPrivateWithReply) 739 2 7 request length 740 4 1 vendor specific opcode 741 4 GLX_CONTEXT_TAG context tag 742 4 ENUM target 743 4 ENUM format 744 4 ENUM type 745 1 BOOL swap_bytes 746 3 unused 747 => 748 1 1 reply 749 1 unused 750 2 CARD16 sequence number 751 4 n reply length 752 8 unused 753 4 INT32 width 754 4 INT32 height 755 8 unused 756 4*n LISTofBYTE pixels 757 758 Note that n may be zero, indicating that a GL error occurred. 759 760 If <format> or <type> is invalid then the command is erroneous and 761 n=0. The structure of <pixels> is described in Appendix A of the GLX 762 Protocol Specification, "Pixel Data", using the parameters 763 <swap_bytes>, <format>, and <type>. No extra padding is needed after 764 <pixels> because the image format already pads to 32 bits. 765 766 767 GetSeparableFilterEXT 768 1 CARD8 opcode (X assigned) 769 1 17 GLX opcode (glXVendorPrivateWithReply) 770 2 7 request length 771 4 4 vendor specific opcode 772 4 GLX_CONTEXT_TAG context tag 773 4 ENUM target 774 4 ENUM format 775 4 ENUM type 776 1 BOOL swap_bytes 777 3 unused 778 => 779 1 1 reply 780 1 unused 781 2 CARD16 sequence number 782 4 n reply length 783 8 unused 784 4 INT32 width 785 4 INT32 height 786 8 unused 787 4*n LISTofBYTE row followed by column 788 789 Note that n may be zero, indicating that a GL error occurred. 790 791 If <format> or <type> is invalid then the command is erroneous and 792 n=0. The structure of <pixels> is described in Appendix A of the GLX 793 Protocol Specification, "Pixel Data", using the parameters 794 <swap_bytes>, <format>, and <type>. No extra padding is needed after 795 <pixels> because the image format already pads to 32 bits. 796 797Dependencies on EXT_abgr 798 799 If EXT_abgr is supported, the <format> parameters of 800 ConvolutionFilter1DEXT, ConvolutionFilter2DEXT, GetConvolutionFilterEXT, 801 SeparableFilter2DEXT, and GetSeparableFilterEXT accept ABGR_EXT. 802 Otherwise they do not. 803 804Dependencies on EXT_texture 805 806 EXT_texture is required. This extension builds on the notion of 807 internal image format, which is defined by EXT_texture. 808 809Dependencies on EXT_copy_texture 810 811 If EXT_copy_texture is not supported, commands CopyConvolutionFilter1DEXT 812 and CopyConvolutionFilter2DEXT are not supported. 813 814Errors 815 816 INVALID_ENUM is generated if ConvolutionFilter1DEXT parameter <target> 817 is not CONVOLUTION_1D_EXT. 818 819 INVALID_ENUM is generated if ConvolutionFilter2DEXT parameter <target> 820 is not CONVOLUTION_2D_EXT. 821 822 INVALID_ENUM is generated if CopyConvolutionFilter1DEXT parameter 823 <target> is not CONVOLUTION_1D_EXT. 824 825 INVALID_ENUM is generated if CopyConvolutionFilter2DEXT parameter 826 <target> is not CONVOLUTION_2D_EXT. 827 828 INVALID_ENUM is generated if SeparableFilter2DEXT parameter <target> 829 is not SEPARABLE_2D_EXT. 830 831 INVALID_ENUM is generated if GetConvolutionFilterEXT parameter <target> 832 is not CONVOLUTION_1D_EXT or CONVOLUTION_2D_EXT. 833 834 INVALID_ENUM is generated if GetSeparableFilterEXT parameter <target> 835 is not SEPARABLE_2D_EXT. 836 837 INVALID_ENUM is generated if ConvolutionParameteriEXT, 838 ConvolutionParameterfEXT, ConvolutionParameterivEXT, 839 ConvolutionParameterfvEXT, GetConvolutionParameterivEXT, or 840 GetConvolutionParameterfvEXT parameter <target> is not 841 CONVOLUTION_1D_EXT, CONVOLUTION_2D_EXT, or SEPARABLE_2D_EXT. 842 843 INVALID_ENUM is generated if ConvolutionFilter1DEXT, 844 ConvolutionFilter2DEXT, CopyConvolutionFilter1DEXT, 845 CopyConvolutionFilter2DEXT, or SeparableFilter2DEXT parameter 846 <internalformat> is not ALPHA, LUMINANCE, LUMINANCE_ALPHA, INTENSITY, 847 RGB, or RGBA. 848 849 INVALID_VALUE is generated if ConvolutionFilter1DEXT parameter <width> 850 is less than zero, or greater than MAX_CONVOLUTION_WIDTH_EXT as queried 851 using GetConvolutionParameterivEXT with <target> CONVOLUTION_1D_EXT. 852 853 INVALID_VALUE is generated if ConvolutionFilter2DEXT parameter <width> 854 is less than zero, or greater than MAX_CONVOLUTION_WIDTH_EXT as queried 855 using GetConvolutionParameterivEXT with <target> CONVOLUTION_2D_EXT. 856 857 INVALID_VALUE is generated if CopyConvolutionFilter1DEXT parameter 858 <width> is less than zero, or greater than MAX_CONVOLUTION_WIDTH_EXT 859 as queried using GetConvolutionParameterivEXT with <target> 860 CONVOLUTION_1D_EXT. 861 862 INVALID_VALUE is generated if CopyConvolutionFilter2DEXT parameter 863 <width> is less than zero, or greater than MAX_CONVOLUTION_WIDTH_EXT 864 as queried using GetConvolutionParameterivEXT with <target> 865 CONVOLUTION_2D_EXT. 866 867 INVALID_VALUE is generated if SeparableFilter2DEXT parameter <width> 868 is less than zero, or greater than MAX_CONVOLUTION_WIDTH_EXT as queried 869 using GetConvolutionParameterivEXT with <target> SEPARABLE_2D_EXT. 870 871 INVALID_VALUE is generated if ConvolutionFilter2DEXT parameter <height> 872 is less than zero, or greater than MAX_CONVOLUTION_HEIGHT_EXT as queried 873 using GetConvolutionParameterivEXT with <target> CONVOLUTION_2D_EXT. 874 875 INVALID_VALUE is generated if CopyConvolutionFilter2DEXT parameter 876 <height> is less than zero, or greater than MAX_CONVOLUTION_HEIGHT_EXT 877 as queried using GetConvolutionParameterivEXT with <target> 878 CONVOLUTION_2D_EXT. 879 880 INVALID_VALUE is generated if SeparableFilter2DEXT parameter <height> 881 is less than zero, or greater than MAX_CONVOLUTION_HEIGHT_EXT as queried 882 using GetConvolutionParameterivEXT with <target> SEPARABLE_2D_EXT. 883 884 INVALID_ENUM is generated if ConvolutionFilter1DEXT, 885 ConvolutionFilter2DEXT, GetConvolutionFilterEXT, SeparableFilter2DEXT, 886 or GetSeparableFilterEXT parameter <format> is not RED, GREEN, BLUE, 887 ALPHA, RGB, RGBA, ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA. 888 889 INVALID_ENUM is generated if ConvolutionFilter1DEXT, 890 ConvolutionFilter2DEXT, GetConvolutionFilterEXT, SeparableFilter2DEXT, 891 or GetSeparableFilterEXT parameter <type> is not UNSIGNED_BYTE, BYTE, 892 UNSIGNED_SHORT, SHORT, UNSIGNED_INT, INT, or FLOAT. 893 894 INVALID_ENUM is generated if ConvolutionParameterivEXT or 895 ConvolutionParameterfvEXT parameter <pname> is not 896 CONVOLUTION_FILTER_SCALE_EXT, CONVOLUTION_FILTER_BIAS_EXT, 897 or CONVOLUTION_BORDER_MODE_EXT. 898 899 INVALID_ENUM is generated if ConvolutionParameteriEXT or 900 ConvolutionParameterfEXT parameter <pname> is not 901 CONVOLUTION_BORDER_MODE_EXT. 902 903 INVALID_ENUM is generated if ConvolutionParameteriEXT, 904 ConvolutionParameterfEXT, ConvolutionParameterivEXT, or 905 ConvolutionParameterfvEXT parameter <pname> is 906 CONVOLUTION_BORDER_MODE_EXT and parameter <params> is not REDUCE_EXT. 907 908 INVALID_ENUM is generated if GetConvolutionParameterivEXT or 909 GetConvolutionParameterfvEXT parameter <pname> is not 910 CONVOLUTION_FILTER_SCALE_EXT, CONVOLUTION_FILTER_BIAS_EXT, 911 CONVOLUTION_BORDER_MODE_EXT, CONVOLUTION_FORMAT_EXT, 912 CONVOLUTION_WIDTH_EXT, CONVOLUTION_HEIGHT_EXT, MAX_CONVOLUTION_WIDTH_EXT 913 or MAX_CONVOLUTION_HEIGHT_EXT. 914 915 INVALID_ENUM is generated if GetConvolutionParameterivEXT or 916 GetConvolutionParameterfvEXT parameter <target> is CONVOLUTION_1D_EXT 917 and <pname> is CONVOLUTION_HEIGHT_EXT or MAX_CONVOLUTION_HEIGHT_EXT. 918 919 INVALID_OPERATION is generated if ConvolutionFilter1DEXT, 920 ConvolutionFilter2DEXT, CopyConvolutionFilter1DEXT, 921 CopyConvolutionFilter2DEXT, GetConvolutionFilterEXT, SeparableFilter2DEXT, 922 GetSeparableFilterEXT, ConvolutionParameteriEXT, 923 ConvolutionParameterivEXT, ConvolutionParameterfEXT, 924 ConvolutionParameterfvEXT, GetConvolutionParameterivEXT, or 925 GetConvolutionParameterfvEXT is executed between execution of Begin and 926 the corresponding execution of End. 927 928New State 929 930 Get Value Get Command Type Initial Value Attribute 931 --------- ----------- ---- ------------- --------- 932 CONVOLUTION_1D_EXT IsEnabled B False pixel/enable 933 CONVOLUTION_2D_EXT IsEnabled B False pixel/enable 934 SEPARABLE_2D_EXT IsEnabled B False pixel/enable 935 CONVOLUTION_FILTER_SCALE_EXT GetConvolutionParameterivEXT 3 x R4 (1,1,1,1) pixel 936 CONVOLUTION_FILTER_BIAS_EXT GetConvolutionParameterivEXT 3 x R4 (0,0,0,0) pixel 937 CONVOLUTION_BORDER_MODE_EXT GetConvolutionParameterivEXT 3 x Z1 REDUCE_EXT pixel 938 939 CONVOLUTION_xD (x is 1 or 2) GetConvolutionFilterEXT 2 x I empty - 940 SEPARABLE_2D GetSeparableFilterEXT 1 x I empty - 941 CONVOLUTION_FORMAT_EXT GetConvolutionParameterivEXT 3 x Z8 RGBA - 942 CONVOLUTION_WIDTH_EXT GetConvolutionParameterivEXT 3 x Z+ 0 - 943 CONVOLUTION_HEIGHT_EXT GetConvolutionParameterivEXT 2 x Z+ 0 - 944 945 POST_CONVOLUTION_RED_SCALE_EXT GetFloatv R 1 pixel 946 POST_CONVOLUTION_GREEN_SCALE_EXT GetFloatv R 1 pixel 947 POST_CONVOLUTION_BLUE_SCALE_EXT GetFloatv R 1 pixel 948 POST_CONVOLUTION_ALPHA_SCALE_EXT GetFloatv R 1 pixel 949 POST_CONVOLUTION_RED_BIAS_EXT GetFloatv R 0 pixel 950 POST_CONVOLUTION_GREEN_BIAS_EXT GetFloatv R 0 pixel 951 POST_CONVOLUTION_BLUE_BIAS_EXT GetFloatv R 0 pixel 952 POST_CONVOLUTION_ALPHA_BIAS_EXT GetFloatv R 0 pixel 953 954New Implementation Dependent State 955 956 Get Value Get Command Type Minimum Value 957 --------- ----------- ---- ------------- 958 MAX_CONVOLUTION_WIDTH_EXT GetConvolutionParameterivEXT 3 x Z+ 3 959 MAX_CONVOLUTION_HEIGHT_EXT GetConvolutionParameterivEXT 2 x Z+ 3 960 961Revision History 962 963 Version 1.32, 2002/06/27 - fixed targets for GetConvolutionFilter and 964 GetSeparableFilter. 965