NAME
glConvolutionFilter2D
- define a two-dimensional convolution filter
C SPECIFICATION
void ggllCCoonnvvoolluuttiioonnFFiilltteerr22DD(
GLenum _t_a_r_g_e_t,
GLenum _i_n_t_e_r_n_a_l_f_o_r_m_a_t,
GLsizei _w_i_d_t_h,
GLsizei _h_e_i_g_h_t,
GLenum _f_o_r_m_a_t,
GLenum _t_y_p_e,
const GLvoid _*_i_m_a_g_e )
PARAMETERS
-
_t_a_r_g_e_t
-
Must be GGLL__CCOONNVVOOLLUUTTIIOONN__22DD.
-
_i_n_t_e_r_n_a_l_f_o_r_m_a_t
-
The internal of the convolution filter kernel.
The allowable values are
GGLL__AALLPPHHAA,
GGLL__AALLPPHHAA44,
GGLL__AALLPPHHAA88,
GGLL__AALLPPHHAA1122,
GGLL__AALLPPHHAA1166,
GGLL__LLUUMMIINNAANNCCEE,
GGLL__LLUUMMIINNAANNCCEE44,
GGLL__LLUUMMIINNAANNCCEE88,
GGLL__LLUUMMIINNAANNCCEE1122,
GGLL__LLUUMMIINNAANNCCEE1166,
GGLL__LLUUMMIINNAANNCCEE__AALLPPHHAA,
GGLL__LLUUMMIINNAANNCCEE44__AALLPPHHAA44,
GGLL__LLUUMMIINNAANNCCEE66__AALLPPHHAA22,
GGLL__LLUUMMIINNAANNCCEE88__AALLPPHHAA88,
GGLL__LLUUMMIINNAANNCCEE1122__AALLPPHHAA44,
GGLL__LLUUMMIINNAANNCCEE1122__AALLPPHHAA1122,
GGLL__LLUUMMIINNAANNCCEE1166__AALLPPHHAA1166,
GGLL__IINNTTEENNSSIITTYY,
GGLL__IINNTTEENNSSIITTYY44,
GGLL__IINNTTEENNSSIITTYY88,
GGLL__IINNTTEENNSSIITTYY1122,
GGLL__IINNTTEENNSSIITTYY1166,
GGLL__RR33__GG33__BB22,
GGLL__RRGGBB,
GGLL__RRGGBB44,
GGLL__RRGGBB55,
GGLL__RRGGBB88,
GGLL__RRGGBB1100,
GGLL__RRGGBB1122,
GGLL__RRGGBB1166,
GGLL__RRGGBBAA,
GGLL__RRGGBBAA22,
GGLL__RRGGBBAA44,
GGLL__RRGGBB55__AA11,
GGLL__RRGGBBAA88,
GGLL__RRGGBB1100__AA22,
GGLL__RRGGBBAA1122, or
GGLL__RRGGBBAA1166.
-
_w_i_d_t_h
-
The width of the pixel array referenced by _i_m_a_g_e.
-
_h_e_i_g_h_t
-
The height of the pixel array referenced by _i_m_a_g_e.
-
_f_o_r_m_a_t
-
The of the pixel data in _i_m_a_g_e.
The allowable values are
GGLL__RREEDD,
GGLL__GGRREEEENN,
GGLL__BBLLUUEE,
GGLL__AALLPPHHAA,
GGLL__RRGGBB,
GGLL__BBGGRR,
GGLL__RRGGBBAA,
GGLL__BBGGRRAA,
GGLL__LLUUMMIINNAANNCCEE, and
GGLL__LLUUMMIINNAANNCCEE__AALLPPHHAA.
-
_t_y_p_e
-
The type of the pixel data in _i_m_a_g_e.
Symbolic constants
GGLL__UUNNSSIIGGNNEEDD__BBYYTTEE,
GGLL__BBYYTTEE,
GGLL__BBIITTMMAAPP,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT,
GGLL__SSHHOORRTT,
GGLL__UUNNSSIIGGNNEEDD__IINNTT,
GGLL__IINNTT,
GGLL__FFLLOOAATT,
GGLL__UUNNSSIIGGNNEEDD__BBYYTTEE__33__33__22,
GGLL__UUNNSSIIGGNNEEDD__BBYYTTEE__22__33__33__RREEVV,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__55__66__55,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__55__66__55__RREEVV,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__44__44__44__44,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__44__44__44__44__RREEVV,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__55__55__55__11,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__11__55__55__55__RREEVV,
GGLL__UUNNSSIIGGNNEEDD__IINNTT__88__88__88__88,
GGLL__UUNNSSIIGGNNEEDD__IINNTT__88__88__88__88__RREEVV,
GGLL__UUNNSSIIGGNNEEDD__IINNTT__1100__1100__1100__22, and
GGLL__UUNNSSIIGGNNEEDD__IINNTT__22__1100__1100__1100__RREEVV
are accepted.
-
_i_m_a_g_e
-
Pointer to a two-dimensional array of pixel data that is processed to
build the convolution filter kernel.
DESCRIPTION
ggllCCoonnvvoolluuttiioonnFFiilltteerr22DD builds a two-dimensional convolution filter kernel from an array of
pixels.
The pixel array specified by _w_i_d_t_h, _h_e_i_g_h_t, _f_o_r_m_a_t, _t_y_p_e, and
_i_m_a_g_e is extracted from memory and processed just as if
ggllDDrraawwPPiixxeellss were called, but processing stops after the final
expansion to RGBA is completed.
The R, G, B, and A components of each pixel are next scaled by the four
2D GGLL__CCOONNVVOOLLUUTTIIOONN__FFIILLTTEERR__SSCCAALLEE parameters and biased by the
four 2D GGLL__CCOONNVVOOLLUUTTIIOONN__FFIILLTTEERR__BBIIAASS parameters.
(The scale and bias parameters are set by ggllCCoonnvvoolluuttiioonnPPaarraammeetteerr
using the GGLL__CCOONNVVOOLLUUTTIIOONN__22DD target and the names
GGLL__CCOONNVVOOLLUUTTIIOONN__FFIILLTTEERR__SSCCAALLEE and GGLL__CCOONNVVOOLLUUTTIIOONN__FFIILLTTEERR__BBIIAASS.
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.
Each pixel is then converted to the internal specified by
_i_n_t_e_r_n_a_l_f_o_r_m_a_t.
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:
center;
lb cb cb cb cb cb cb
l c c c c c c.
_
Internal Format RedGreenBlueAlphaLuminanceIntensity
_
GGLL__AALLPPHHAA A
GGLL__LLUUMMIINNAANNCCEE R
GGLL__LLUUMMIINNAANNCCEE__AALLPPHHAA AR
GGLL__IINNTTEENNSSIITTYY R
GGLL__RRGGBB RGB
GGLL__RRGGBBAA RGBA
_
The red, green, blue, alpha, luminance, and/or intensity components of
the resulting pixels are stored in floating-point rather than integer
They form a two-dimensional filter kernel image indexed with coordinates
_i and _j such that _i starts at zero and increases from left
to right, and _j starts at zero and increases from bottom to top.
Kernel location _i_,_j is derived from the _Nth pixel,
where _N is _i+_j*_w_i_d_t_h.
Note that after a convolution is performed, the resulting color
components are also scaled by their corresponding
GGLL__PPOOSSTT__CCOONNVVOOLLUUTTIIOONN__cc__SSCCAALLEE parameters and biased by their
corresponding GGLL__PPOOSSTT__CCOONNVVOOLLUUTTIIOONN__cc__BBIIAASS parameters (where
_c takes on the values RREEDD, GGRREEEENN, BBLLUUEE, and
AALLPPHHAA).
These parameters are set by ggllPPiixxeellTTrraannssffeerr.
NOTES
ggllCCoonnvvoolluuttiioonnFFiilltteerr22DD is present only if GGLL__AARRBB__iimmaaggiinngg is returned when ggllGGeettSSttrriinngg
is called with an argument of GGLL__EEXXTTEENNSSIIOONNSS.
ERRORS
GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _t_a_r_g_e_t is not
GGLL__CCOONNVVOOLLUUTTIIOONN__22DD.
GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _i_n_t_e_r_n_a_l_f_o_r_m_a_t is not one of the
allowable values.
GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _w_i_d_t_h is less than zero or greater
than the maximum supported value.
This value may be queried with ggllGGeettCCoonnvvoolluuttiioonnPPaarraammeetteerr
using target GGLL__CCOONNVVOOLLUUTTIIOONN__22DD and name
GGLL__MMAAXX__CCOONNVVOOLLUUTTIIOONN__WWIIDDTTHH.
GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _h_e_i_g_h_t is less than zero or greater
than the maximum supported value.
This value may be queried with ggllGGeettCCoonnvvoolluuttiioonnPPaarraammeetteerr
using target GGLL__CCOONNVVOOLLUUTTIIOONN__22DD and name
GGLL__MMAAXX__CCOONNVVOOLLUUTTIIOONN__HHEEIIGGHHTT.
GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _f_o_r_m_a_t is not one of the allowable
values.
GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _t_y_p_e is not one of the allowable
values.
GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllCCoonnvvoolluuttiioonnFFiilltteerr22DD is executed
between the execution of ggllBBeeggiinn and the corresponding
execution of ggllEEnndd.
GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if _h_e_i_g_h_t is one of
GGLL__UUNNSSIIGGNNEEDD__BBYYTTEE__33__33__22,
GGLL__UUNNSSIIGGNNEEDD__BBYYTTEE__22__33__33__RREEVV,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__55__66__55, or
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__55__66__55__RREEVV
and _f_o_r_m_a_t is not GGLL__RRGGBB.
GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if _h_e_i_g_h_t is one of
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__44__44__44__44,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__44__44__44__44__RREEVV,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__55__55__55__11,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT__11__55__55__55__RREEVV,
GGLL__UUNNSSIIGGNNEEDD__IINNTT__88__88__88__88,
GGLL__UUNNSSIIGGNNEEDD__IINNTT__88__88__88__88__RREEVV,
GGLL__UUNNSSIIGGNNEEDD__IINNTT__1100__1100__1100__22, or
GGLL__UUNNSSIIGGNNEEDD__IINNTT__22__1100__1100__1100__RREEVV
and _f_o_r_m_a_t is neither GGLL__RRGGBBAA nor GGLL__BBGGRRAA.
ASSOCIATED GETS
ggllGGeettCCoonnvvoolluuttiioonnPPaarraammeetteerr, ggllGGeettCCoonnvvoolluuttiioonnFFiilltteerr
SEE ALSO
ggllCCoonnvvoolluuttiioonnFFiilltteerr11DD((33GG)),
ggllSSeeppaarraabblleeFFiilltteerr22DD((33GG)),
ggllCCoonnvvoolluuttiioonnPPaarraammeetteerr((33GG)),
ggllPPiixxeellTTrraannssffeerr((33GG))