<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glSeparableFilter2D</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glSelectBuffer.3G.xml" title="glSelectBuffer"/><link rel="next" href="glShadeModel.3G.xml" title="glShadeModel"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glSeparableFilter2D</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glSelectBuffer.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glShadeModel.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glSeparableFilter2D.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glSeparableFilter2D.3G-name"/><h2>Name</h2><p>glSeparableFilter2D &#8212; define a separable two-dimensional convolution filter</p></div><div class="refsynopsisdiv"><a name="glSeparableFilter2D.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glSeparableFilter2D</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>target</tt></i>, GLenum <i><tt>internalformat</tt></i>, GLsizei <i><tt>width</tt></i>, GLsizei <i><tt>height</tt></i>, GLenum <i><tt>format</tt></i>, GLenum <i><tt>type</tt></i>, const GLvoid *<i><tt>row</tt></i>, const GLvoid *<i><tt>column</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glSeparableFilter2D.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glSeparableFilter2D</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>internalformat</tt></i>, <i><tt>width</tt></i>, <i><tt>height</tt></i>, <i><tt>format</tt></i>, <i><tt>type</tt></i>, <i><tt>row</tt></i>, <i><tt>column</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glSeparableFilter2D.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>target</tt></i></span></dt><dd>
						Must be <tt>GL_SEPARABLE_2D</tt>.
					</dd><dt><span class="term"><i><tt>internalformat</tt></i></span></dt><dd>
						The internal of the convolution filter kernel. The allowable values are <tt>GL_ALPHA</tt>,
						<tt>GL_ALPHA4</tt>, <tt>GL_ALPHA8</tt>, <tt>GL_ALPHA12</tt>,
						<tt>GL_ALPHA16</tt>, <tt>GL_LUMINANCE</tt>, <tt>GL_LUMINANCE4</tt>,
						<tt>GL_LUMINANCE8</tt>, <tt>GL_LUMINANCE12</tt>,
						<tt>GL_LUMINANCE16</tt>, <tt>GL_LUMINANCE_ALPHA</tt>,
						<tt>GL_LUMINANCE4_ALPHA4</tt>, <tt>GL_LUMINANCE6_ALPHA2</tt>,
						<tt>GL_LUMINANCE8_ALPHA8</tt>, <tt>GL_LUMINANCE12_ALPHA4</tt>,
						<tt>GL_LUMINANCE12_ALPHA12</tt>, <tt>GL_LUMINANCE16_ALPHA16</tt>,
						<tt>GL_INTENSITY</tt>, <tt>GL_INTENSITY4</tt>, <tt>GL_INTENSITY8</tt>,
						<tt>GL_INTENSITY12</tt>, <tt>GL_INTENSITY16</tt>, <tt>GL_R3_G3_B2</tt>,
						<tt>GL_RGB</tt>, <tt>GL_RGB4</tt>, <tt>GL_RGB5</tt>,
						<tt>GL_RGB8</tt>, <tt>GL_RGB10</tt>, <tt>GL_RGB12</tt>,
						<tt>GL_RGB16</tt>, <tt>GL_RGBA</tt>, <tt>GL_RGBA2</tt>,
						<tt>GL_RGBA4</tt>, <tt>GL_RGB5_A1</tt>, <tt>GL_RGBA8</tt>,
						<tt>GL_RGB10_A2</tt>, <tt>GL_RGBA12</tt>, or <tt>GL_RGBA16</tt>.
					</dd><dt><span class="term"><i><tt>width</tt></i></span></dt><dd>
						The number of elements in the pixel array referenced by <i><tt>row</tt></i>. (This is the width of
						the separable filter kernel.)
					</dd><dt><span class="term"><i><tt>height</tt></i></span></dt><dd>
						The number of elements in the pixel array referenced by <i><tt>column</tt></i>. (This is the height
						of the separable filter kernel.)
					</dd><dt><span class="term"><i><tt>format</tt></i></span></dt><dd>
						The of the pixel data in <i><tt>row</tt></i> and <i><tt>column</tt></i>. The allowable values
						are <tt>GL_RED</tt>, <tt>GL_GREEN</tt>, <tt>GL_BLUE</tt>,
						<tt>GL_ALPHA</tt>, <tt>GL_RGB</tt>, <tt>GL_BGR</tt>,
						<tt>GL_RGBA</tt>, <tt>GL_BGRA</tt>, <tt>GL_INTENSITY</tt>,
						<tt>GL_LUMINANCE</tt>, and <tt>GL_LUMINANCE_ALPHA</tt>.
					</dd><dt><span class="term"><i><tt>type</tt></i></span></dt><dd>
						The type of the pixel data in <i><tt>row</tt></i> and <i><tt>column</tt></i>. Symbolic
						constants <tt>GL_UNSIGNED_BYTE</tt>, <tt>GL_BYTE</tt>,
						<tt>GL_BITMAP</tt>, <tt>GL_UNSIGNED_SHORT</tt>, <tt>GL_SHORT</tt>,
						<tt>GL_UNSIGNED_INT</tt>, <tt>GL_INT</tt>, <tt>GL_FLOAT</tt>,
						<tt>GL_UNSIGNED_BYTE_3_3_2</tt>, <tt>GL_UNSIGNED_BYTE_2_3_3_REV</tt>,
						<tt>GL_UNSIGNED_SHORT_5_6_5</tt>, <tt>GL_UNSIGNED_SHORT_5_6_5_REV</tt>,
						<tt>GL_UNSIGNED_SHORT_4_4_4_4</tt>, <tt>GL_UNSIGNED_SHORT_4_4_4_4_REV</tt>,
						<tt>GL_UNSIGNED_SHORT_5_5_5_1</tt>, <tt>GL_UNSIGNED_SHORT_1_5_5_5_REV</tt>,
						<tt>GL_UNSIGNED_INT_8_8_8_8</tt>, <tt>GL_UNSIGNED_INT_8_8_8_8_REV</tt>,
						<tt>GL_UNSIGNED_INT_10_10_10_2</tt>, and <tt>GL_UNSIGNED_INT_2_10_10_10_REV</tt>
						are accepted.
					</dd><dt><span class="term"><i><tt>row</tt></i></span></dt><dd>
						Pointer to a one-dimensional array of pixel data that is processed to build the row filter kernel.
					</dd><dt><span class="term"><i><tt>column</tt></i></span></dt><dd>
						Pointer to a one-dimensional array of pixel data that is processed to build the column filter kernel.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glSeparableFilter2D.3G-description"/><h2>Description</h2><p>
			<tt>glSeparableFilter2D</tt> builds a two-dimensional separable convolution filter kernel from two arrays
			of pixels. The pixel arrays specified by (<i><tt>width</tt></i>, <i><tt>format</tt></i>,
			<i><tt>type</tt></i>, <i><tt>row</tt></i>) and (<i><tt>height</tt></i>,
			<i><tt>format</tt></i>, <i><tt>type</tt></i>, <i><tt>column</tt></i>) are processed just as if
			they had been passed to <a href="glDrawPixels.3G.xml"><tt>glDrawPixels</tt></a>, but processing stops after the final
			expansion to RGBA is completed. Next, the R, G, B, and A components of all pixels in both arrays are scaled by the four
			separable 2D <tt>GL_CONVOLUTION_FILTER_SCALE</tt> parameters and biased by the four separable 2D
			<tt>GL_CONVOLUTION_FILTER_BIAS</tt> parameters. (The scale and bias parameters are set by <tt>glConvolutionParameter</tt> using the <tt>GL_SEPARABLE_2D</tt> target and the
			names <tt>GL_CONVOLUTION_FILTER_SCALE</tt> and <tt>GL_CONVOLUTION_FILTER_BIAS</tt>. 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><tt>internalformat</tt></i>. 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:
		</p><div class="informaltable"><table border="1"><colgroup><col/><col/><col/><col/><col/><col/><col/></colgroup><tbody><tr><td>Internal Format</td><td align="center">Red</td><td align="center">Green</td><td align="center">Blue</td><td align="center">Alpha</td><td align="center">Luminance</td><td align="center">Intensity</td></tr><tr><td><tt>GL_LUMINANCE</tt></td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center">R</td><td align="center"> </td></tr><tr><td><tt>GL_LUMINANCE_ALPHA</tt></td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center">A</td><td align="center">R</td><td align="center"> </td></tr><tr><td><tt>GL_INTENSITY</tt></td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center">R</td></tr><tr><td><tt>GL_RGB</tt></td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td><tt>GL_RGBA</tt></td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td><td align="center"> </td><td align="center"> </td></tr></tbody></table></div><p>
			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 <i><tt>i</tt></i> starting at zero and increasing from left to right. Each location in the row image
			is derived from element <i><tt>i</tt></i> of <i><tt>row</tt></i>. The column image is indexed by
			coordinate <i><tt>j</tt></i> starting at zero and increasing from bottom to top. Each location in the column
			image is derived from element <i><tt>j</tt></i> of <i><tt>column</tt></i>.
		</p><p>
			Note that after a convolution is performed, the resulting color components are also scaled by their corresponding
			<tt>GL_POST_CONVOLUTION_c_SCALE</tt> parameters and biased by their corresponding
			<tt>GL_POST_CONVOLUTION_c_BIAS</tt> parameters (where <i><tt>c</tt></i> takes on the values
			<span class="bold"><b>RED</b></span>, <span class="bold"><b>GREEN</b></span>, <span class="bold"><b>BLUE</b></span>,
			and <span class="bold"><b>ALPHA</b></span>). These parameters are set by <tt>glPixelTransfer</tt>.
		</p></div><div class="refsect1" lang="en"><a name="glSeparableFilter2D.3G-notes"/><h2>Notes</h2><p>
			<tt>glSeparableFilter2D</tt> is present only if <tt>GL_ARB_imaging</tt> is returned when
			<a href="glGetString.3G.xml"><tt>glGetString</tt></a> is called with an argument of <tt>GL_EXTENSIONS</tt>.
		</p></div><div class="refsect1" lang="en"><a name="glSeparableFilter2D.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>target</tt></i> is not
			<tt>GL_SEPARABLE_2D</tt>.
		</p><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>internalformat</tt></i> is not one of the allowable
			values.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>width</tt></i> is less than zero or greater than
			the maximum supported value. This value may be queried with <tt>glGetConvolutionParameter</tt> using target <tt>GL_SEPARABLE_2D</tt> and name
			<tt>GL_MAX_CONVOLUTION_WIDTH</tt>.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>height</tt></i> is less than zero or greater than
			the maximum supported value. This value may be queried with <tt>glGetConvolutionParameter</tt> using target <tt>GL_SEPARABLE_2D</tt> and name
			<tt>GL_MAX_CONVOLUTION_HEIGHT</tt>.
		</p><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>format</tt></i> is not one of the allowable values.
		</p><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>type</tt></i> is not one of the allowable values.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glSeparableFilter2D</tt> is executed between
			the execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of <a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <i><tt>height</tt></i> is one of
			<tt>GL_UNSIGNED_BYTE_3_3_2</tt>, <tt>GL_UNSIGNED_BYTE_2_3_3_REV</tt>,
			<tt>GL_UNSIGNED_SHORT_5_6_5</tt>, or <tt>GL_UNSIGNED_SHORT_5_6_5_REV</tt> and
			<i><tt>format</tt></i> is not <tt>GL_RGB</tt>.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <i><tt>height</tt></i> is one of
			<tt>GL_UNSIGNED_SHORT_4_4_4_4</tt>, <tt>GL_UNSIGNED_SHORT_4_4_4_4_REV</tt>,
			<tt>GL_UNSIGNED_SHORT_5_5_5_1</tt>, <tt>GL_UNSIGNED_SHORT_1_5_5_5_REV</tt>,
			<tt>GL_UNSIGNED_INT_8_8_8_8</tt>, <tt>GL_UNSIGNED_INT_8_8_8_8_REV</tt>,
			<tt>GL_UNSIGNED_INT_10_10_10_2</tt>, or <tt>GL_UNSIGNED_INT_2_10_10_10_REV</tt> and
			<i><tt>format</tt></i> is neither <tt>GL_RGBA</tt> nor <tt>GL_BGRA</tt>.
		</p></div><div class="refsect1" lang="en"><a name="glSeparableFilter2D.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<tt>glGetConvolutionParameter</tt>, <a href="glGetSeparableFilter.3G.xml"><tt>glGetSeparableFilter</tt></a>
		</p></div><div class="refsect1" lang="en"><a name="glSeparableFilter2D.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glConvolutionFilter1D.3G.xml">glConvolutionFilter1D</a>, <a href="glConvolutionFilter2D.3G.xml">glConvolutionFilter2D</a>, <a href="glConvolutionParameter.3G.xml">glConvolutionParameter</a>, <a href="glPixelTransfer.3G.xml">glPixelTransfer</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glSelectBuffer.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glShadeModel.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glSelectBuffer </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glShadeModel</td></tr></table></div></body></html>