xenocara/doc/gl-docs/GL/gl/convolutionparameter.3gl
2006-11-29 17:00:35 +00:00

174 lines
5.7 KiB
Plaintext

'\" et
'\"! eqn|tbl | mmdoc
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp Jan 14 18:30
.ds Dm 01 convoluti
.ds Xs 40911 7 convolutionparameter.gl
.TH GLCONVOLUTIONPARAMETER 3G
.SH NAME
.B "glConvolutionParameterf, glConvolutionParameteri, glConvolutionParameterfv, glConvolutionParameteriv
\- set convolution parameters
.SH C SPECIFICATION
void \f3glConvolutionParameterf\fP(
GLenum \fItarget\fP,
.nf
.ta \w'\f3void \fPglConvolutionParameterf( 'u
GLenum \fIpname\fP,
GLfloat \fIparams\fP )
.fi
void \f3glConvolutionParameteri\fP(
GLenum \fItarget\fP,
.nf
.ta \w'\f3void \fPglConvolutionParameteri( 'u
GLenum \fIpname\fP,
GLint \fIparams\fP )
.fi
.EQ
delim $$
.EN
.sp -1
.SH PARAMETERS
.TP \w'\f2target\fP\ \ 'u
\f2target\fP
The target for the convolution parameter.
Must be one of
\%\f3GL_CONVOLUTION_1D\fP,
\%\f3GL_CONVOLUTION_2D\fP, or
\%\f3GL_SEPARABLE_2D\fP.
.TP
\f2pname\fP
The parameter to be set.
Must be
\%\f3GL_CONVOLUTION_BORDER_MODE\fP.
.TP
\f2params\fP
The parameter value.
Must be one of
\%\f3GL_REDUCE\fP, \%\f3GL_CONSTANT_BORDER\fP, \%\f3GL_REPLICATE_BORDER\fP.
.sp 2
.SH C SPECIFICATION
void \f3glConvolutionParameterfv\fP(
GLenum \fItarget\fP,
.nf
.ta \w'\f3void \fPglConvolutionParameterfv( 'u
GLenum \fIpname\fP,
const GLfloat \fI*params\fP )
.fi
void \f3glConvolutionParameteriv\fP(
GLenum \fItarget\fP,
.nf
.ta \w'\f3void \fPglConvolutionParameteriv( 'u
GLenum \fIpname\fP,
const GLint \fI*params\fP )
.fi
.sp -1
.SH PARAMETERS
.TP
\f2target\fP
The target for the convolution parameter.
Must be one of
\%\f3GL_CONVOLUTION_1D\fP,
\%\f3GL_CONVOLUTION_2D\fP, or
\%\f3GL_SEPARABLE_2D\fP.
.TP
\f2pname\fP
The parameter to be set.
Must be one of
\%\f3GL_CONVOLUTION_BORDER_MODE\fP,
\%\f3GL_CONVOLUTION_BORDER_COLOR\fP,
\%\f3GL_CONVOLUTION_FILTER_SCALE\fP, or
\%\f3GL_CONVOLUTION_FILTER_BIAS\fP.
.TP
\f2params\fP
The parameter value.
If \f2pname\fP is \%\f3GL_CONVOLUTION_BORDER_MODE\fP, \f2params\fP must be one of
\%\f3GL_REDUCE\fP, \%\f3GL_CONSTANT_BORDER\fP, or \%\f3GL_REPLICATE_BORDER\fP.
Otherwise, must be a vector of four values (for red, green, blue, and alpha,
respectively) to be used for
scaling (when \f2pname\fP is \%\f3GL_CONVOLUTION_FILTER_SCALE\fP), or
biasing (when \f2pname\fP is \%\f3GL_CONVOLUTION_FILTER_BIAS\fP) a convolution
filter kernel or setting the constant border color (when \f2pname\fP is
\%\f3GL_CONVOLUTION_BORDER_COLOR\fP.
.SH DESCRIPTION
\%\f3glConvolutionParameter\fP sets the value of a convolution parameter.
.sp
\f2target\fP selects the convolution filter to be affected:
\%\f3GL_CONVOLUTION_1D\fP,
\%\f3GL_CONVOLUTION_2D\fP, or
\%\f3GL_SEPARABLE_2D\fP
for the 1D, 2D, or separable 2D filter, respectively.
.sp
\f2pname\fP selects the parameter to be changed.
\%\f3GL_CONVOLUTION_FILTER_SCALE\fP and \%\f3GL_CONVOLUTION_FILTER_BIAS\fP
affect the definition of the convolution filter kernel; see
\%\f3glConvolutionFilter1D\fP, \%\f3glConvolutionFilter2D\fP, and
\%\f3glSeparableFilter2D\fP for details.
In these cases, \f2params\fP is an array of four values to be applied to
red, green, blue, and alpha values, respectively. The initial value for
\%\f3GL_CONVOLUTION_FILTER_SCALE\fP is (1, 1, 1, 1), and the initial value
for \%\f3GL_CONVOLUTION_FILTER_BIAS\fP is (0, 0, 0, 0).
.sp
A \f2pname\fP value of \%\f3GL_CONVOLUTION_BORDER_MODE\fP controls the
convolution border mode. The accepted modes are:
.TP
\%\f3GL_REDUCE\fP
The image resulting from convolution is
smaller than the source image.
If the filter width is $Wf$ and height is $Hf$,
and the source image width is $Ws$ and height is $Hs$,
then the convolved image width will be $Ws ~-~ Wf ~+~ 1$ and height
will be $Hs ~-~ Hf ~+~ 1$.
(If this reduction would generate an image with zero or negative width
and/or height, the output is simply null, with no error generated.)
The coordinates of the image resulting from convolution are zero
through $Ws ~-~ Wf$ in width and zero through $Hs ~-~ Hf$ in
height.
.TP
\%\f3GL_CONSTANT_BORDER\fP
The image resulting from convolution is the same size as the source image, and
processed as if the source image were surrounded by pixels with their color
specified by the \%\f3GL_CONVOLUTION_BORDER_COLOR\fP.
.TP
\%\f3GL_REPLICATE_BORDER\fP
The image resulting from convolution is the same size as the source image, and
processed as if the outermost pixel on the border of the source image were
replicated.
.SH NOTES
\%\f3glConvolutionParameter\fP is present only if \%\f3GL_ARB_imaging\fP is returned when \%\f3glGetString\fP
is called with an argument of \%\f3GL_EXTENSIONS\fP.
.P
In cases where errors can result from the specification of invalid
image dimensions, it is the dimensions after convolution that are
tested, not the dimensions of the source image.
For example, \%\f3glTexImage1D\fP requires power-of-two image size.
When \%\f3GL_REDUCE\fP border mode is in effect,
the source image must be larger than the final power-of-two size
by one less than the size of the 1D filter kernel.
.SH ERRORS
\%\f3GL_INVALID_ENUM\fP is generated if \f2target\fP is not one of the allowable
values.
.P
\%\f3GL_INVALID_ENUM\fP is generated if \f2pname\fP is not one of the allowable
values.
.P
\%\f3GL_INVALID_ENUM\fP is generated if \f2pname\fP is
\%\f3GL_CONVOLUTION_BORDER_MODE\fP and \f2params\fP is not one of
\%\f3GL_REDUCE\fP, \%\f3GL_CONSTANT_BORDER\fP, or \%\f3GL_REPLICATE_BORDER\fP.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glConvolutionParameter\fP is executed
between the execution of \%\f3glBegin\fP and the corresponding
execution of \%\f3glEnd\fP.
.SH ASSOCIATED GETS
\%\f3glGetConvolutionParameter\fP
.SH SEE ALSO
\%\f3glConvolutionFilter1D(3G)\fP,
\%\f3glConvolutionFilter2D(3G)\fP,
\%\f3glSeparableFilter2D(3G)\fP,
\%\f3glGetConvolutionParameter(3G)\fP