1 2Name 3 4 HP_convolution_border_modes 5 6Name Strings 7 8 GL_HP_convolution_border_modes 9 10Version 11 12 $Date: 1997/06/12 01:51:36 $ $Revision: 1.3 $ 13 14Number 15 16 67 17 18Dependencies 19 20 EXT_convolution is required 21 22Overview 23 24 This extension provides some additional border modes for the 25 EXT_convolution extension. 26 27New Procedures and Functions 28 29 None 30 31New Tokens 32 33 Accepted by the <param> parameter of ConvolutionParameteriEXT, 34 and ConvolutionParameterfEXT, and by the <params> parameter of 35 ConvolutionParameterivEXT and ConvolutionParameterfvEXT, when the 36 <pname> parameter is CONVOLUTION_BORDER_MODE_EXT: 37 38 IGNORE_BORDER_HP 39 CONSTANT_BORDER_HP 40 REPLICATE_BORDER_HP 41 42 Accepted by the <pname> parameter of ConvolutionParameterivEXT, 43 ConvolutionParameterfvEXT, GetConvolutionParameterivEXT, and 44 GetConvolutionParameterfvEXT: 45 46 CONVOLUTION_BORDER_COLOR_HP 47 48Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 49 50 None 51 52Additions to Chapter 3 of the 1.0 Specification (Rasterization) 53 54 The description of the convolution border mode is replaced with 55 the following: 56 57 The convolution border mode for a specific convolution filter is 58 specified using ConvolutionParameteriEXT with the <target> 59 parameter set to the name of the filter, the <pname> parameter 60 set to CONVOLUTION_BORDER_MODE_EXT, and <param> set to one of 61 REDUCE_EXT, IGNORE_BORDER_HP, CONSTANT_BORDER_HP, 62 or REPLICATE_BORDER_HP. 63 64 The width and height of source images convolved with border mode 65 REDUCE_EXT are reduced by Wf-1 and Hf-1, respectively. If this 66 reduction would generate a resulting image with zero or negative 67 width and/or height, the output is simply null, with no error 68 generated. The coordinates of the image that results from a 69 convolution with border mode REDUCE_EXT are zero through Ws-Wf 70 in width, and zero through Hs-Hf in height. In cases where 71 errors can result from the specification of invalid image 72 dimensions, it is these resulting dimensions that are tested, 73 not the dimensions of the source image. (A specific example is 74 TexImage1D and TexImage2D, which specify constraints for image 75 dimensions. Even if TexImage1D or TexImage2D is called with a 76 null pixel pointer, the dimensions of the resulting texture image 77 are those that would result from the convolution of the specified 78 image.) 79 80 For the remaining border modes, we define Cw = floor(Wf / 2) 81 and Ch = floor(Hf / 2). The coordinates (Cw, Ch) define the 82 center of the convolution filter. 83 84 If the convolution border mode is IGNORE_BORDER_HP, the output 85 image has the same dimensions as the source image. The convolution 86 filter is moved around the source image so that its center passes 87 over every pixel in the source image. At each location, the sum of 88 products is computed and the result is written in the destination 89 image at the location that corresponds to the pixel location where 90 the convolution filter is centered. However, the sum of products 91 is not computed for any pixel where the convolution filter extends 92 beyond one of the edges of the source image. Instead, for these 93 locations, the pixel value from the source image is copied to 94 the destination image. 95 96 If the convolution border mode is CONSTANT_BORDER_HP then 97 convolution does not change the size of the source image. The 98 result of the convolution is the same as if the source image were 99 surrounded by pixels with the same color as the current convolution 100 border color. Whenever the convolution filter extends beyond one 101 of the edges of the source image, the constant-color border pixels 102 are used as input to the filter. The current convolution border 103 color is set by calling ConvolutionParameterivEXT or 104 ConvolutionParameterfvEXT with <pname> set to 105 CONVOLUTION_BORDER_COLOR_HP and <params> containing 106 four values that comprise the RGBA color to be used as the image 107 border. Integer color components are interpreted linearly such that 108 the most positive integer maps to 1.0, and the most negative integer 109 maps to -1.0. Floating point color components are clamped to the 110 range [0,1] when they are specified. 111 112 The convolution border mode REPLICATE_BORDER_HP also produces an 113 output image with the same dimensions as the source image. The 114 behavior of this mode is identical to that of the IGNORE_BORDER_HP 115 mode except for the treatment of pixel locations where the 116 convolution filter extends beyond the edge of the source image. 117 For these locations, it is as if the outermost one-pixel border 118 of the source image was replicated. Conceptually, each pixel 119 in the leftmost one-pixel column of the source image is replicated 120 Cw times to provide additional image data along the left edge, 121 each pixel in the rightmost one-pixel column is replicated Cw times 122 to provide additional image data along the right edge, and each 123 pixel value in the top and bottom one-pixel rows is replicated to 124 create Ch rows of image data along the top and bottom edges. 125 The pixel value at each corner is also replicated in order to 126 provide data for the convolution operation at each corner of 127 the source image. 128 129Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 130and the Frame buffer) 131 132 None 133 134Additions to Chapter 5 of the 1.0 Specification (Special Functions) 135 136 None 137 138Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 139 140 None 141 142Dependencies on EXT_convolution 143 144 EXT_convolution is required. This extension adds capability to 145 the convolution operations defined in that extension. 146 147Errors 148 149 INVALID_ENUM is generated if ConvolutionParameterivEXT or 150 ConvolutionParameterfvEXT parameter <pname> is not 151 CONVOLUTION_FILTER_SCALE_EXT, CONVOLUTION_FILTER_BIAS_EXT, 152 CONVOLUTION_BORDER_MODE_EXT, or CONVOLUTION_BORDER_COLOR_HP. 153 154 INVALID_ENUM is generated if ConvolutionParameteriEXT, 155 ConvolutionParameterfEXT, ConvolutionParameterivEXT, or 156 ConvolutionParameterfvEXT parameter <pname> is 157 CONVOLUTION_BORDER_MODE_EXT and parameter <params> is 158 not one of REDUCE_EXT, IGNORE_BORDER_HP, CONSTANT_BORDER_HP, 159 or REPLICATE_BORDER_HP. 160 161 INVALID_ENUM is generated if GetConvolutionParameterivEXT or 162 GetConvolutionParameterfvEXT parameter <pname> is not 163 CONVOLUTION_FILTER_SCALE_EXT, CONVOLUTION_FILTER_BIAS_EXT, 164 CONVOLUTION_BORDER_MODE_EXT, CONVOLUTION_FORMAT_EXT, 165 CONVOLUTION_WIDTH_EXT, CONVOLUTION_HEIGHT_EXT, 166 MAX_CONVOLUTION_WIDTH_EXT, MAX_CONVOLUTION_HEIGHT_EXT, 167 or CONVOLUTION_BORDER_COLOR_HP. 168 169New State 170 Initial 171 Get Value Get Command Type Value Attrib 172 --------- ----------- ---- ------- ------ 173 CONVOLUTION_BORDER_COLOR_HP GetConvolutionParameterfvHP C (0,0,0,0) pixel 174 175New Implementation Dependent State 176 177 None 178