<?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>glPixelMap</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="glPassThrough.3G.xml" title="glPassThrough"/><link rel="next" href="glPixelStore.3G.xml" title="glPixelStore"/></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">glPixelMap</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glPassThrough.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glPixelStore.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glPixelMap.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glPixelMap.3G-name"/><h2>Name</h2><p>glPixelMapfv, glPixelMapuiv, glPixelMapusv &#8212; set up pixel transfer maps</p></div><div class="refsynopsisdiv"><a name="glPixelMap.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glPixelMapfv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>map</tt></i>, GLint <i><tt>mapsize</tt></i>, const GLfloat *<i><tt>values</tt></i>);</code></td></tr><tr><td valign="top"><code>void <tt>glPixelMapuiv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>map</tt></i>, GLint <i><tt>mapsize</tt></i>, const GLuint *<i><tt>values</tt></i>);</code></td></tr><tr><td valign="top"><code>void <tt>glPixelMapusv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>map</tt></i>, GLint <i><tt>mapsize</tt></i>, const GLushort *<i><tt>values</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glPixelMap.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glPixelMapfv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>map</tt></i>, <i><tt>mapsize</tt></i>, <i><tt>values</tt></i>) &#8594; <tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>glPixelMapuiv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>map</tt></i>, <i><tt>mapsize</tt></i>, <i><tt>values</tt></i>) &#8594; <tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>glPixelMapusv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>map</tt></i>, <i><tt>mapsize</tt></i>, <i><tt>values</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glPixelMap.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>map</tt></i></span></dt><dd>
						Specifies a symbolic map name. Must be one of the following: <tt>GL_PIXEL_MAP_I_TO_I</tt>,
						<tt>GL_PIXEL_MAP_S_TO_S</tt>, <tt>GL_PIXEL_MAP_I_TO_R</tt>,
						<tt>GL_PIXEL_MAP_I_TO_G</tt>, <tt>GL_PIXEL_MAP_I_TO_B</tt>,
						<tt>GL_PIXEL_MAP_I_TO_A</tt>, <tt>GL_PIXEL_MAP_R_TO_R</tt>,
						<tt>GL_PIXEL_MAP_G_TO_G</tt>, <tt>GL_PIXEL_MAP_B_TO_B</tt>, or
						<tt>GL_PIXEL_MAP_A_TO_A</tt>.
					</dd><dt><span class="term"><i><tt>mapsize</tt></i></span></dt><dd>
						Specifies the size of the map being defined.
					</dd><dt><span class="term"><i><tt>values</tt></i></span></dt><dd>
						Specifies an array of <i><tt>mapsize</tt></i> values.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glPixelMap.3G-description"/><h2>Description</h2><p>
			<tt>glPixelMap</tt> sets up translation tables, or <i><tt>maps</tt></i>, used by
			<a href="glCopyPixels.3G.xml"><tt>glCopyPixels</tt></a>, <a href="glCopyTexImage1D.3G.xml"><tt>glCopyTexImage1D</tt></a>,
			<a href="glCopyTexImage2D.3G.xml"><tt>glCopyTexImage2D</tt></a>, <a href="glCopyTexSubImage1D.3G.xml"><tt>glCopyTexSubImage1D</tt></a>, <a href="glCopyTexSubImage2D.3G.xml"><tt>glCopyTexSubImage2D</tt></a>,
			<a href="glCopyTexSubImage3D.3G.xml"><tt>glCopyTexSubImage3D</tt></a>, <a href="glDrawPixels.3G.xml"><tt>glDrawPixels</tt></a>,
			<a href="glReadPixels.3G.xml"><tt>glReadPixels</tt></a>, <a href="glTexImage1D.3G.xml"><tt>glTexImage1D</tt></a>, <a href="glTexImage2D.3G.xml"><tt>glTexImage2D</tt></a>, <a href="glTexImage3D.3G.xml"><tt>glTexImage3D</tt></a>, <a href="glTexSubImage1D.3G.xml"><tt>glTexSubImage1D</tt></a>, <a href="glTexSubImage2D.3G.xml"><tt>glTexSubImage2D</tt></a>, and <a href="glTexSubImage3D.3G.xml"><tt>glTexSubImage3D</tt></a>. Additionally, if the <tt>GL_ARB_imaging</tt> subset is
			supported, the routines <a href="glColorTable.3G.xml"><tt>glColorTable</tt></a>, <a href="glColorSubTable.3G.xml"><tt>glColorSubTable</tt></a>, <a href="glConvolutionFilter1D.3G.xml"><tt>glConvolutionFilter1D</tt></a>,
			<a href="glConvolutionFilter2D.3G.xml"><tt>glConvolutionFilter2D</tt></a>, <a href="glHistogram.3G.xml"><tt>glHistogram</tt></a>,
			<a href="glMinmax.3G.xml"><tt>glMinmax</tt></a>, and <a href="glSeparableFilter2D.3G.xml"><tt>glSeparableFilter2D</tt></a>.
			Use of these maps is described completely in the <tt>glPixelTransfer</tt> reference
			page, and partly in the reference pages for the pixel and texture image commands. Only the specification of the maps is
			described in this reference page.
		</p><p>
			<i><tt>map</tt></i> is a symbolic map name, indicating one of ten maps to set. <i><tt>mapsize</tt></i>
			specifies the number of entries in the map, and <i><tt>values</tt></i> is a pointer to an array of
			<i><tt>mapsize</tt></i> map values.
		</p><p>
			The ten maps are as follows:
		</p><div class="variablelist"><dl><dt><span class="term"><tt>GL_PIXEL_MAP_I_TO_I</tt></span></dt><dd>
						Maps color indices to color indices.
					</dd><dt><span class="term"><tt>GL_PIXEL_MAP_S_TO_S</tt></span></dt><dd>
						Maps stencil indices to stencil indices.
					</dd><dt><span class="term"><tt>GL_PIXEL_MAP_I_TO_R</tt></span></dt><dd>
						Maps color indices to red components.
					</dd><dt><span class="term"><tt>GL_PIXEL_MAP_I_TO_G</tt></span></dt><dd>
						Maps color indices to green components.
					</dd><dt><span class="term"><tt>GL_PIXEL_MAP_I_TO_B</tt></span></dt><dd>
						Maps color indices to blue components.
					</dd><dt><span class="term"><tt>GL_PIXEL_MAP_I_TO_A</tt></span></dt><dd>
						Maps color indices to alpha components.
					</dd><dt><span class="term"><tt>GL_PIXEL_MAP_R_TO_R</tt></span></dt><dd>
						Maps red components to red components.
					</dd><dt><span class="term"><tt>GL_PIXEL_MAP_G_TO_G</tt></span></dt><dd>
						Maps green components to green components.
					</dd><dt><span class="term"><tt>GL_PIXEL_MAP_B_TO_B</tt></span></dt><dd>
						Maps blue components to blue components.
					</dd><dt><span class="term"><tt>GL_PIXEL_MAP_A_TO_A</tt></span></dt><dd>
						Maps alpha components to alpha components.
					</dd></dl></div><p>
			The entries in a map can be specified as single-precision floating-point numbers, unsigned short integers, or unsigned
			long integers. Maps that store color component values (all but <tt>GL_PIXEL_MAP_I_TO_I</tt> and
			<tt>GL_PIXEL_MAP_S_TO_S</tt>) retain their values in floating-point , with unspecified mantissa and
			exponent sizes. Floating-point values specified by <tt>glPixelMapfv</tt> are converted directly to the
			internal floating-point of these maps, then clamped to the range [0,1]. Unsigned integer values specified by
			<tt>glPixelMapusv</tt> and <tt>glPixelMapuiv</tt> are converted linearly such that the largest
			representable integer maps to 1.0, and 0 maps to 0.0.
		</p><p>
			Maps that store indices, <tt>GL_PIXEL_MAP_I_TO_I</tt> and <tt>GL_PIXEL_MAP_S_TO_S</tt>, retain
			their values in fixed-point , with an unspecified number of bits to the right of the binary point. Floating-point
			values specified by <tt>glPixelMapfv</tt> are converted directly to the internal fixed-point of these maps.
			Unsigned integer values specified by <tt>glPixelMapusv</tt> and <tt>glPixelMapuiv</tt> specify
			integer values, with all 0's to the right of the binary point.
		</p><p>
			The following table shows the initial sizes and values for each of the maps. Maps that are indexed by either color or
			stencil indices must have <i><tt>mapsize</tt></i> = <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:msup>
						<mml:mn>2</mml:mn>
						<mml:mi>n</mml:mi>
					</mml:msup>
				</mml:math> for some <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>n</mml:mi>
				</mml:math> or the results are undefined. The maximum allowable size for each map depends on the implementation
			and can be determined by calling <tt>glGet</tt> with argument
			<tt>GL_MAX_PIXEL_MAP_TABLE</tt>. The single maximum applies to all maps; it is at least 32.
		</p><div class="informaltable"><table border="1"><colgroup><col/><col/><col/><col/><col/></colgroup><tbody><tr><td><i><tt>map</tt></i></td><td align="center"><span class="bold"><b>Lookup Index</b></span></td><td align="center"><span class="bold"><b>Lookup Value</b></span></td><td align="center"><span class="bold"><b>Initial Size</b></span></td><td align="center"><span class="bold"><b>Initial Value</b></span></td></tr><tr><td><tt>GL_PIXEL_MAP_I_TO_I</tt></td><td align="center">color index</td><td align="center">color index</td><td align="center">1</td><td align="center">0</td></tr><tr><td><tt>GL_PIXEL_MAP_S_TO_S</tt></td><td align="center">stencil index</td><td align="center">stencil index</td><td align="center">1</td><td align="center">0</td></tr><tr><td><tt>GL_PIXEL_MAP_I_TO_R</tt></td><td align="center">color index</td><td align="center">R</td><td align="center">1</td><td align="center">0</td></tr><tr><td><tt>GL_PIXEL_MAP_I_TO_G</tt></td><td align="center">color index</td><td align="center">G</td><td align="center">1</td><td align="center">0</td></tr><tr><td><tt>GL_PIXEL_MAP_I_TO_B</tt></td><td align="center">color index</td><td align="center">B</td><td align="center">1</td><td align="center">0</td></tr><tr><td><tt>GL_PIXEL_MAP_I_TO_A</tt></td><td align="center">color index</td><td align="center">A</td><td align="center">1</td><td align="center">0</td></tr><tr><td><tt>GL_PIXEL_MAP_R_TO_R</tt></td><td align="center">R</td><td align="center">R</td><td align="center">1</td><td align="center">0</td></tr><tr><td><tt>GL_PIXEL_MAP_G_TO_G</tt></td><td align="center">G</td><td align="center">G</td><td align="center">1</td><td align="center">0</td></tr><tr><td><tt>GL_PIXEL_MAP_B_TO_B</tt></td><td align="center">B</td><td align="center">B</td><td align="center">1</td><td align="center">0</td></tr><tr><td><tt>GL_PIXEL_MAP_A_TO_A</tt></td><td align="center">A</td><td align="center">A</td><td align="center">1</td><td align="center">0</td></tr></tbody></table></div></div><div class="refsect1" lang="en"><a name="glPixelMap.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>map</tt></i> is not an accepted value.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>mapsize</tt></i> is less than one or larger than
			<tt>GL_MAX_PIXEL_MAP_TABLE</tt>.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>map</tt></i> is
			<tt>GL_PIXEL_MAP_I_TO_I</tt>, <tt>GL_PIXEL_MAP_S_TO_S</tt>,
			<tt>GL_PIXEL_MAP_I_TO_R</tt>, <tt>GL_PIXEL_MAP_I_TO_G</tt>,
			<tt>GL_PIXEL_MAP_I_TO_B</tt>, or <tt>GL_PIXEL_MAP_I_TO_A</tt>, and
			<i><tt>mapsize</tt></i> is not a power of two.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glPixelMap</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="glPixelMap.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<tt>glGetPixelMap</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PIXEL_MAP_I_TO_I_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PIXEL_MAP_S_TO_S_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PIXEL_MAP_I_TO_R_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PIXEL_MAP_I_TO_G_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PIXEL_MAP_I_TO_B_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PIXEL_MAP_I_TO_A_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PIXEL_MAP_R_TO_R_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PIXEL_MAP_G_TO_G_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PIXEL_MAP_B_TO_B_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PIXEL_MAP_A_TO_A_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_MAX_PIXEL_MAP_TABLE</tt>
		</p></div><div class="refsect1" lang="en"><a name="glPixelMap.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glColorTable.3G.xml">glColorTable</a>, <a href="glColorSubTable.3G.xml">glColorSubTable</a>, <a href="glConvolutionFilter1D.3G.xml">glConvolutionFilter1D</a>, <a href="glConvolutionFilter2D.3G.xml">glConvolutionFilter2D</a>, <a href="glCopyPixels.3G.xml">glCopyPixels</a>, <a href="glCopyTexImage1D.3G.xml">glCopyTexImage1D</a>, <a href="glCopyTexImage2D.3G.xml">glCopyTexImage2D</a>, <a href="glCopyTexSubImage1D.3G.xml">glCopyTexSubImage1D</a>, <a href="glCopyTexSubImage2D.3G.xml">glCopyTexSubImage2D</a>, <a href="glDrawPixels.3G.xml">glDrawPixels</a>, <a href="glHistogram.3G.xml">glHistogram</a>, <a href="glMinmax.3G.xml">glMinmax</a>, <a href="glPixelStore.3G.xml">glPixelStore</a>, <a href="glPixelTransfer.3G.xml">glPixelTransfer</a>, <a href="glReadPixels.3G.xml">glReadPixels</a>, <a href="glSeparableFilter2D.3G.xml">glSeparableFilter2D</a>, <a href="glTexImage1D.3G.xml">glTexImage1D</a>, <a href="glTexImage2D.3G.xml">glTexImage2D</a>, <a href="glTexImage3D.3G.xml">glTexImage3D</a>, <a href="glTexSubImage1D.3G.xml">glTexSubImage1D</a>, <a href="glTexSubImage2D.3G.xml">glTexSubImage2D</a>, <a href="glTexSubImage3D.3G.xml">glTexSubImage3D</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="glPassThrough.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="glPixelStore.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glPassThrough </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glPixelStore</td></tr></table></div></body></html>