glSeparableFilter2D.3   [plain text]


'\" t  
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp May 22 14:46
.ds Dm 9 May 22 14:
.ds Xs 28833     9
.TH GLSEPARABLEFILTER2D 3G
.SH NAME
.B "glSeparableFilter2D
\- define a separable two-dimensional convolution filter

.SH C SPECIFICATION
void \f3glSeparableFilter2D\fP(
GLenum \fItarget\fP,
.nf
.ta \w'\f3void \fPglSeparableFilter2D( 'u
	GLenum \fIinternalformat\fP,
	GLsizei \fIwidth\fP,
	GLsizei \fIheight\fP,
	GLenum \fIformat\fP,
	GLenum \fItype\fP,
	const GLvoid \fI*row\fP,
	const GLvoid \fI*column\fP )
.fi

.SH PARAMETERS
.TP \w'\fIinternalformat\fP\ \ 'u 
\f2target\fP
Must be \%\f3GL_SEPARABLE_2D\fP.
.TP
\f2internalformat\fP
The internal  of the convolution filter kernel.
The allowable values are
\%\f3GL_ALPHA\fP,
\%\f3GL_ALPHA4\fP,
\%\f3GL_ALPHA8\fP,
\%\f3GL_ALPHA12\fP,
\%\f3GL_ALPHA16\fP,
\%\f3GL_LUMINANCE\fP,
\%\f3GL_LUMINANCE4\fP,
\%\f3GL_LUMINANCE8\fP,
\%\f3GL_LUMINANCE12\fP,
\%\f3GL_LUMINANCE16\fP,
\%\f3GL_LUMINANCE_ALPHA\fP,
\%\f3GL_LUMINANCE4_ALPHA4\fP,
\%\f3GL_LUMINANCE6_ALPHA2\fP,
\%\f3GL_LUMINANCE8_ALPHA8\fP,
\%\f3GL_LUMINANCE12_ALPHA4\fP,
\%\f3GL_LUMINANCE12_ALPHA12\fP,
\%\f3GL_LUMINANCE16_ALPHA16\fP,
\%\f3GL_INTENSITY\fP,
\%\f3GL_INTENSITY4\fP,
\%\f3GL_INTENSITY8\fP,
\%\f3GL_INTENSITY12\fP,
\%\f3GL_INTENSITY16\fP,
\%\f3GL_R3_G3_B2\fP,
\%\f3GL_RGB\fP,
\%\f3GL_RGB4\fP,
\%\f3GL_RGB5\fP,
\%\f3GL_RGB8\fP,
\%\f3GL_RGB10\fP,
\%\f3GL_RGB12\fP,
\%\f3GL_RGB16\fP,
\%\f3GL_RGBA\fP,
\%\f3GL_RGBA2\fP,
\%\f3GL_RGBA4\fP,
\%\f3GL_RGB5_A1\fP,
\%\f3GL_RGBA8\fP,
\%\f3GL_RGB10_A2\fP,
\%\f3GL_RGBA12\fP, or
\%\f3GL_RGBA16\fP.
.TP
\f2width\fP
The number of elements in the pixel array referenced by \f2row\fP.
(This is the width of the separable filter kernel.)
.TP
\f2height\fP
The number of elements in the pixel array referenced by \f2column\fP.
(This is the height of the separable filter kernel.)
.TP
\f2format\fP
The  of the pixel data in \f2row\fP and \f2column\fP.
The allowable values are
\%\f3GL_RED\fP,
\%\f3GL_GREEN\fP,
\%\f3GL_BLUE\fP,
\%\f3GL_ALPHA\fP,
\%\f3GL_RGB\fP,
\%\f3GL_BGR\fP,
\%\f3GL_RGBA\fP,
\%\f3GL_BGRA\fP,
\%\f3GL_INTENSITY\fP,
\%\f3GL_LUMINANCE\fP, and
\%\f3GL_LUMINANCE_ALPHA\fP.
.TP
\f2type\fP
The type of the pixel data in \f2row\fP and \f2column\fP.
Symbolic constants
\%\f3GL_UNSIGNED_BYTE\fP,
\%\f3GL_BYTE\fP,
\%\f3GL_BITMAP\fP,
\%\f3GL_UNSIGNED_SHORT\fP,
\%\f3GL_SHORT\fP,
\%\f3GL_UNSIGNED_INT\fP,
\%\f3GL_INT\fP,
\%\f3GL_FLOAT\fP,
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, and
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP
are accepted.
.TP
\f2row\fP
Pointer to a one-dimensional array of pixel data that is processed to
build the row filter kernel.
.TP
\f2column\fP
Pointer to a one-dimensional array of pixel data that is processed to
build the column filter kernel.
.SH DESCRIPTION
\%\f3glSeparableFilter2D\fP builds a two-dimensional separable convolution filter kernel from
two arrays of pixels.
.sp
The pixel arrays specified by (\f2width\fP, \f2format\fP, \f2type\fP, \f2row\fP)
and (\f2height\fP, \f2format\fP, \f2type\fP, \f2column\fP) are processed just as if
they had been passed to \%\f3glDrawPixels\fP,
but processing stops after the final expansion to RGBA is completed.
.sp
Next, the R, G, B, and A components of all pixels in both arrays are scaled
by the four separable 2D \%\f3GL_CONVOLUTION_FILTER_SCALE\fP parameters and
biased by the four separable 2D \%\f3GL_CONVOLUTION_FILTER_BIAS\fP parameters.
(The scale and bias parameters are set by \%\f3glConvolutionParameter\fP
using the \%\f3GL_SEPARABLE_2D\fP target and the names
\%\f3GL_CONVOLUTION_FILTER_SCALE\fP and \%\f3GL_CONVOLUTION_FILTER_BIAS\fP.
The parameters themselves are vectors of four values that are applied to red,
green, blue, and alpha, in that order.)
The R, G, B, and A values are not clamped to [0,1] at any time during this
process.
.sp
Each pixel is then converted to the internal  specified by
\f2internalformat\fP.
This conversion simply maps the component values of the pixel (R, G, B,
and A) to the values included in the internal  (red, green, blue,
alpha, luminance, and intensity).  The mapping is as follows:
.bp
.TS
center;
l c c c c c c.
_
Internal Format	Red	Green	Blue	Alpha	Luminance	Intensity
_
\%\f3GL_LUMINANCE\fP					R
\%\f3GL_LUMINANCE_ALPHA\fP				A	R
\%\f3GL_INTENSITY\fP						R
\%\f3GL_RGB\fP	R	G	B
\%\f3GL_RGBA\fP	R	G	B	A
_
.TE

.sp
The red, green, blue, alpha, luminance, and/or intensity components of
the resulting pixels are stored in floating-point rather than integer
.
They form two one-dimensional filter kernel images.
The row image is indexed by coordinate \f2i\fP starting at zero and
increasing from left to right.
Each location in the row image is derived from element \f2i\fP of \f2row\fP.
The column image is indexed by coordinate \f2j\fP starting at zero
and increasing from bottom to top.
Each location in the column image is derived from element \f2j\fP of \f2column\fP.
.PP
Note that after a convolution is performed, the resulting color
components are also scaled by their corresponding
\%\f3GL_POST_CONVOLUTION_c_SCALE\fP parameters and biased by their
corresponding \%\f3GL_POST_CONVOLUTION_c_BIAS\fP parameters (where
\f2c\fP takes on the values \f3RED\fP, \f3GREEN\fP, \f3BLUE\fP, and
\f3ALPHA\fP).
These parameters are set by \%\f3glPixelTransfer\fP.
.SH NOTES
\%\f3glSeparableFilter2D\fP is present only if \%\f3GL_ARB_imaging\fP is returned when \%\f3glGetString\fP
is called with an argument of \%\f3GL_EXTENSIONS\fP.
.SH ERRORS
\%\f3GL_INVALID_ENUM\fP is generated if \f2target\fP is not
\%\f3GL_SEPARABLE_2D\fP.
.P
\%\f3GL_INVALID_ENUM\fP is generated if \f2internalformat\fP is not one of the
allowable values.
.P
\%\f3GL_INVALID_VALUE\fP is generated if \f2width\fP is less than zero or greater
than the maximum supported value.
This value may be queried with \%\f3glGetConvolutionParameter\fP
using target \%\f3GL_SEPARABLE_2D\fP and name
\%\f3GL_MAX_CONVOLUTION_WIDTH\fP.
.P
\%\f3GL_INVALID_VALUE\fP is generated if \f2height\fP is less than zero or greater
than the maximum supported value.
This value may be queried with \%\f3glGetConvolutionParameter\fP
using target \%\f3GL_SEPARABLE_2D\fP and name
\%\f3GL_MAX_CONVOLUTION_HEIGHT\fP.
.P
\%\f3GL_INVALID_ENUM\fP is generated if \f2format\fP is not one of the allowable
values.
.P
\%\f3GL_INVALID_ENUM\fP is generated if \f2type\fP is not one of the allowable
values.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glSeparableFilter2D\fP is executed
between the execution of \%\f3glBegin\fP and the corresponding
execution of \%\f3glEnd\fP.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \f2height\fP is one of
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP, or
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP
and \f2format\fP is not \%\f3GL_RGB\fP.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \f2height\fP is one of
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, or
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP
and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
.SH ASSOCIATED GETS
\%\f3glGetConvolutionParameter\fP, \%\f3glGetSeparableFilter\fP
.SH SEE ALSO
\%\f3glConvolutionFilter1D\fP,
\%\f3glConvolutionFilter2D\fP,
\%\f3glConvolutionParameter\fP,
\%\f3glPixelTransfer\fP