<?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>glCopyColorTable</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="glCopyColorSubTable.3G.xml" title="glCopyColorSubTable"/><link rel="next" href="glCopyConvolutionFilter1D.3G.xml" title="glCopyConvolutionFilter1D"/></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">glCopyColorTable</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glCopyColorSubTable.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glCopyConvolutionFilter1D.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glCopyColorTable.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glCopyColorTable.3G-name"/><h2>Name</h2><p>glCopyColorTable &#8212; copy pixels into a color table</p></div><div class="refsynopsisdiv"><a name="glCopyColorTable.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glCopyColorTable</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>, GLint <i><tt>x</tt></i>, GLint <i><tt>y</tt></i>, GLsizei <i><tt>width</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glCopyColorTable.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glCopyColorTable</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>x</tt></i>, <i><tt>y</tt></i>, <i><tt>width</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glCopyColorTable.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>target</tt></i></span></dt><dd>
						The color table target. Must be <tt>GL_COLOR_TABLE</tt>,
						<tt>GL_POST_CONVOLUTION_COLOR_TABLE</tt>, or
						<tt>GL_POST_COLOR_MATRIX_COLOR_TABLE</tt>.
					</dd><dt><span class="term"><i><tt>internalformat</tt></i></span></dt><dd>
						The internal storage of the texture image. Must be one of the following symbolic constants:
						<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>, <tt>GL_RGBA16</tt>.
					</dd><dt><span class="term"><i><tt>x</tt></i></span></dt><dd>
						The x coordinate of the lower-left corner of the pixel rectangle to be transferred to the color table.
					</dd><dt><span class="term"><i><tt>y</tt></i></span></dt><dd>
						The y coordinate of the lower-left corner of the pixel rectangle to be transferred to the color table.
					</dd><dt><span class="term"><i><tt>width</tt></i></span></dt><dd>
						The width of the pixel rectangle.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glCopyColorTable.3G-description"/><h2>Description</h2><p>
			<tt>glCopyColorTable</tt> loads a color table with pixels from the current
			<tt>GL_READ_BUFFER</tt> (rather than from main memory, as is the case for <a href="glColorTable.3G.xml"><tt>glColorTable</tt></a>).
		</p><p>
			The screen-aligned pixel rectangle with lower-left corner at (<i><tt>x</tt></i>,<i><tt>y</tt></i>) having
			width <i><tt>width</tt></i> and height 1 is loaded into the color table. If any pixels within this region are
			outside the window that is associated with the GL context, the values obtained for those pixels are undefined.
		</p><p>
			The pixels in the rectangle are processed just as if <a href="glReadPixels.3G.xml"><tt>glReadPixels</tt></a> were called,
			with <i><tt>internalformat</tt></i> set to RGBA, but processing stops after the final conversion to RGBA.
		</p><p>
			The four scale parameters and the four bias parameters that are defined for the table are then used to scale and bias
			the R, G, B, and A components of each pixel. The scale and bias parameters are set by calling <tt>glColorTableParameter</tt>.
		</p><p>
			Next, the R, G, B, and A values are clamped to the range [0,1]. 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 align="center"/><col align="center"/><col align="center"/><col align="center"/><col align="center"/><col align="center"/></colgroup><thead><tr><th><span class="bold"><b>Internal Format</b></span></th><th align="center"><span class="bold"><b>Red</b></span></th><th align="center"><span class="bold"><b>Green</b></span></th><th align="center"><span class="bold"><b>Blue</b></span></th><th align="center"><span class="bold"><b>Alpha</b></span></th><th align="center"><span class="bold"><b>Luminance</b></span></th><th align="center"><span class="bold"><b>Intensity</b></span></th></tr></thead><tbody><tr><td><tt>GL_ALPHA</tt></td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center">A</td><td align="center"> </td><td align="center"> </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>
			Finally, the red, green, blue, alpha, luminance, and/or intensity components of the resulting pixels are stored in the
			color table. They form a one-dimensional table with indices in the range <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mfenced separator=",">
						<mml:mn>0</mml:mn>
						<mml:mrow>
							<mml:mi>width</mml:mi>
							<mml:mo>-</mml:mo>
							<mml:mn>1</mml:mn>
						</mml:mrow>
					</mml:mfenced>
				</mml:math>
		</p></div><div class="refsect1" lang="en"><a name="glCopyColorTable.3G-notes"/><h2>Notes</h2><p>
			<tt>glCopyColorTable</tt> is available only if <tt>GL_ARB_imaging</tt> is returned from calling
			<a href="glGetString.3G.xml"><tt>glGetString</tt></a> with an argument of <tt>GL_EXTENSIONS</tt>.
		</p></div><div class="refsect1" lang="en"><a name="glCopyColorTable.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated when <i><tt>target</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.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>internalformat</tt></i> is not one of the allowable
			values.
		</p><p>
			<tt>GL_TABLE_TOO_LARGE</tt> is generated if the requested color table is too large to be supported by the
			implementation.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glCopyColorTable</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></div><div class="refsect1" lang="en"><a name="glCopyColorTable.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<a href="glGetColorTable.3G.xml"><tt>glGetColorTable</tt></a>, <tt>glGetColorTableParameter</tt>
		</p></div><div class="refsect1" lang="en"><a name="glCopyColorTable.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glColorTable.3G.xml">glColorTable</a>, <a href="glColorTableParameter.3G.xml">glColorTableParameter</a>, <a href="glReadPixels.3G.xml">glReadPixels</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="glCopyColorSubTable.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="glCopyConvolutionFilter1D.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glCopyColorSubTable </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glCopyConvolutionFilter1D</td></tr></table></div></body></html>
