<?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>glHistogram</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="glHint.3G.xml" title="glHint"/><link rel="next" href="glIndex.3G.xml" title="glIndex"/></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">glHistogram</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glHint.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glIndex.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glHistogram.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glHistogram.3G-name"/><h2>Name</h2><p>glHistogram &#8212; define histogram table</p></div><div class="refsynopsisdiv"><a name="glHistogram.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glHistogram</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>target</tt></i>, GLsizei <i><tt>width</tt></i>, GLenum <i><tt>internalformat</tt></i>, GLboolean <i><tt>sink</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glHistogram.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glHistogram</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>width</tt></i>, <i><tt>internalformat</tt></i>, <i><tt>sink</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glHistogram.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>target</tt></i></span></dt><dd>
						The histogram whose parameters are to be set. Must be one of <tt>GL_HISTOGRAM</tt> or
						<tt>GL_PROXY_HISTOGRAM</tt>.
					</dd><dt><span class="term"><i><tt>width</tt></i></span></dt><dd>
						The number of entries in the histogram table. Must be a power of 2.
					</dd><dt><span class="term"><i><tt>internalformat</tt></i></span></dt><dd>
						The of entries in the histogram table. Must be one of <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_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>sink</tt></i></span></dt><dd>
						If <tt>GL_TRUE</tt>, pixels will be consumed by the histogramming process and no drawing or
						texture loading will take place. If <tt>GL_FALSE</tt>, pixels will proceed to the minmax
						process after histogramming.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glHistogram.3G-description"/><h2>Description</h2><p>
			When <tt>GL_HISTOGRAM</tt> is enabled, RGBA color components are converted to histogram table indices by
			clamping to the range [0,1], multiplying by the width of the histogram table, and rounding to the nearest integer. The
			table entries selected by the RGBA indices are then incremented. (If the internal of the histogram table includes
			luminance, then the index derived from the R color component determines the luminance table entry to be incremented.)
			If a histogram table entry is incremented beyond its maximum value, then its value becomes undefined. (This is not an
			error.)
		</p><p>
			Histogramming is performed only for RGBA pixels (though these may be specified originally as color indices and
			converted to RGBA by index table lookup). Histogramming is enabled with <a href="glEnable.3G.xml"><tt>glEnable</tt></a> and disabled with <a href="glEnable.3G.xml"><tt>glDisable</tt></a>.
		</p><p>
			When <i><tt>target</tt></i> is <tt>GL_HISTOGRAM</tt>, <tt>glHistogram</tt> redefines the
			current histogram table to have <i><tt>width</tt></i> entries of the specified by
			<i><tt>internalformat</tt></i>. The entries are indexed 0 through <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mi>width</mml:mi>
						<mml:mo>-</mml:mo>
						<mml:mn>1</mml:mn>
					</mml:mrow>
				</mml:math>, and all entries are initialized to zero. The values in the previous histogram table, if any, are
			lost. If <i><tt>sink</tt></i> is <tt>GL_TRUE</tt>, then pixels are discarded after histogramming; no
			further processing of the pixels takes place, and no drawing, texture loading, or pixel readback will result.
		</p><p>
			When <i><tt>target</tt></i> is <tt>GL_PROXY_HISTOGRAM</tt>, <tt>glHistogram</tt>
			computes all state information as if the histogram table were to be redefined, but does not actually define the new
			table. If the requested histogram table is too large to be supported, then the state information will be set to zero.
			This provides a way to determine if a histogram table with the given parameters can be supported.
		</p></div><div class="refsect1" lang="en"><a name="glHistogram.3G-notes"/><h2>Notes</h2><p>
			<tt>glHistogram</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="glHistogram.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <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 or is not a power
			of 2.
		</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_TABLE_TOO_LARGE</tt> is generated if <i><tt>target</tt></i> is
			<tt>GL_HISTOGRAM</tt> and the histogram table specified is too large for the implementation.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glHistogram</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="glHistogram.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<tt>glGetHistogramParameter</tt>
		</p></div><div class="refsect1" lang="en"><a name="glHistogram.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glGetHistogram.3G.xml">glGetHistogram</a>, <a href="glResetHistogram.3G.xml">glResetHistogram</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="glHint.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="glIndex.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glHint </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glIndex</td></tr></table></div></body></html>
