Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> | |
4 | <refentry id="glHistogram"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>1991-2006</year> | |
9 | <holder>Silicon Graphics, Inc.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glHistogram</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glHistogram</refname> | |
17 | <refpurpose>define histogram table</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glHistogram</function></funcdef> | |
23 | <paramdef>GLenum <parameter>target</parameter></paramdef> | |
24 | <paramdef>GLsizei <parameter>width</parameter></paramdef> | |
25 | <paramdef>GLenum <parameter>internalformat</parameter></paramdef> | |
26 | <paramdef>GLboolean <parameter>sink</parameter></paramdef> | |
27 | </funcprototype> | |
28 | </funcsynopsis> | |
29 | </refsynopsisdiv> | |
30 | <!-- eqn: ignoring delim $$ --> | |
31 | <refsect1 id="parameters"><title>Parameters</title> | |
32 | <variablelist> | |
33 | <varlistentry> | |
34 | <term><parameter>target</parameter></term> | |
35 | <listitem> | |
36 | <para> | |
37 | The histogram whose parameters are to be set. | |
38 | Must be one of | |
39 | <constant>GL_HISTOGRAM</constant> or | |
40 | <constant>GL_PROXY_HISTOGRAM</constant>. | |
41 | </para> | |
42 | </listitem> | |
43 | </varlistentry> | |
44 | <varlistentry> | |
45 | <term><parameter>width</parameter></term> | |
46 | <listitem> | |
47 | <para> | |
48 | The number of entries in the histogram table. Must be a power of 2. | |
49 | </para> | |
50 | </listitem> | |
51 | </varlistentry> | |
52 | <varlistentry> | |
53 | <term><parameter>internalformat</parameter></term> | |
54 | <listitem> | |
55 | <para> | |
56 | The format of entries in the histogram table. | |
57 | Must be one of | |
58 | <constant>GL_ALPHA</constant>, | |
59 | <constant>GL_ALPHA4</constant>, | |
60 | <constant>GL_ALPHA8</constant>, | |
61 | <constant>GL_ALPHA12</constant>, | |
62 | <constant>GL_ALPHA16</constant>, | |
63 | <constant>GL_LUMINANCE</constant>, | |
64 | <constant>GL_LUMINANCE4</constant>, | |
65 | <constant>GL_LUMINANCE8</constant>, | |
66 | <constant>GL_LUMINANCE12</constant>, | |
67 | <constant>GL_LUMINANCE16</constant>, | |
68 | <constant>GL_LUMINANCE_ALPHA</constant>, | |
69 | <constant>GL_LUMINANCE4_ALPHA4</constant>, | |
70 | <constant>GL_LUMINANCE6_ALPHA2</constant>, | |
71 | <constant>GL_LUMINANCE8_ALPHA8</constant>, | |
72 | <constant>GL_LUMINANCE12_ALPHA4</constant>, | |
73 | <constant>GL_LUMINANCE12_ALPHA12</constant>, | |
74 | <constant>GL_LUMINANCE16_ALPHA16</constant>, | |
75 | <constant>GL_R3_G3_B2</constant>, | |
76 | <constant>GL_RGB</constant>, | |
77 | <constant>GL_RGB4</constant>, | |
78 | <constant>GL_RGB5</constant>, | |
79 | <constant>GL_RGB8</constant>, | |
80 | <constant>GL_RGB10</constant>, | |
81 | <constant>GL_RGB12</constant>, | |
82 | <constant>GL_RGB16</constant>, | |
83 | <constant>GL_RGBA</constant>, | |
84 | <constant>GL_RGBA2</constant>, | |
85 | <constant>GL_RGBA4</constant>, | |
86 | <constant>GL_RGB5_A1</constant>, | |
87 | <constant>GL_RGBA8</constant>, | |
88 | <constant>GL_RGB10_A2</constant>, | |
89 | <constant>GL_RGBA12</constant>, or | |
90 | <constant>GL_RGBA16</constant>. | |
91 | </para> | |
92 | </listitem> | |
93 | </varlistentry> | |
94 | <varlistentry> | |
95 | <term><parameter>sink</parameter></term> | |
96 | <listitem> | |
97 | <para> | |
98 | If <constant>GL_TRUE</constant>, pixels will be consumed by the histogramming | |
99 | process and no drawing or texture loading will take place. | |
100 | If <constant>GL_FALSE</constant>, pixels will proceed to the minmax process after | |
101 | histogramming. | |
102 | </para> | |
103 | </listitem> | |
104 | </varlistentry> | |
105 | </variablelist> | |
106 | </refsect1> | |
107 | <refsect1 id="description"><title>Description</title> | |
108 | <para> | |
109 | When <constant>GL_HISTOGRAM</constant> is enabled, RGBA color components are converted to | |
110 | histogram table indices by clamping to the range [0,1], multiplying by | |
111 | the width of the histogram table, and rounding to the nearest integer. | |
112 | The table entries selected by the RGBA indices are then incremented. | |
113 | (If the internal format of the histogram table includes luminance, then | |
114 | the index derived from the R color component determines the luminance | |
115 | table entry to be incremented.) If a histogram table entry is incremented | |
116 | beyond its maximum value, then its value becomes undefined. (This is | |
117 | not an error.) | |
118 | </para> | |
119 | <para> | |
120 | Histogramming is performed only for RGBA pixels (though these may | |
121 | be specified originally as color indices and converted to RGBA by | |
122 | index table lookup). | |
123 | Histogramming is enabled with <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and disabled with <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry>. | |
124 | </para> | |
125 | <para> | |
126 | When <parameter>target</parameter> is <constant>GL_HISTOGRAM</constant>, <function>glHistogram</function> redefines the current | |
127 | histogram table to have <parameter>width</parameter> entries of the format specified by | |
128 | <parameter>internalformat</parameter>. | |
129 | The entries are indexed 0 through | |
130 | <inlineequation><mml:math> | |
131 | <!-- eqn: width - 1:--> | |
132 | <mml:mrow> | |
133 | <mml:mi mathvariant="italic">width</mml:mi> | |
134 | <mml:mo>-</mml:mo> | |
135 | <mml:mn>1</mml:mn> | |
136 | </mml:mrow> | |
137 | </mml:math></inlineequation>, | |
138 | and | |
139 | all entries are initialized to zero. | |
140 | The values in the previous histogram table, if any, are lost. | |
141 | If <parameter>sink</parameter> is <constant>GL_TRUE</constant>, then pixels are discarded after histogramming; | |
142 | no further processing of the pixels takes place, and no drawing, | |
143 | texture loading, or pixel readback will result. | |
144 | </para> | |
145 | <para> | |
146 | When <parameter>target</parameter> is <constant>GL_PROXY_HISTOGRAM</constant>, <function>glHistogram</function> computes all | |
147 | state information as if the histogram table were to be redefined, | |
148 | but does not actually define the new table. | |
149 | If the requested histogram table is too large to be supported, then the | |
150 | state information will be set to zero. | |
151 | This provides a way to determine if a histogram table with the given | |
152 | parameters can be supported. | |
153 | </para> | |
154 | <para> | |
155 | </para> | |
156 | </refsect1> | |
157 | <refsect1 id="notes"><title>Notes</title> | |
158 | <para> | |
159 | <function>glHistogram</function> is present only if <code>ARB_imaging</code> is returned when <citerefentry><refentrytitle>glGetString</refentrytitle></citerefentry> | |
160 | is called with an argument of <constant>GL_EXTENSIONS</constant>. | |
161 | </para> | |
162 | </refsect1> | |
163 | <refsect1 id="errors"><title>Errors</title> | |
164 | <para> | |
165 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not one of the allowable | |
166 | values. | |
167 | </para> | |
168 | <para> | |
169 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>width</parameter> is less than zero or is | |
170 | not a power of 2. | |
171 | </para> | |
172 | <para> | |
173 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is not one of the | |
174 | allowable values. | |
175 | </para> | |
176 | <para> | |
177 | <constant>GL_TABLE_TOO_LARGE</constant> is generated if <parameter>target</parameter> is <constant>GL_HISTOGRAM</constant> | |
178 | and the histogram table specified is too large for the implementation. | |
179 | </para> | |
180 | <para> | |
181 | <constant>GL_INVALID_OPERATION</constant> is generated if <function>glHistogram</function> is executed | |
182 | between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding | |
183 | execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>. | |
184 | </para> | |
185 | </refsect1> | |
186 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
187 | <para> | |
188 | <citerefentry><refentrytitle>glGetHistogramParameter</refentrytitle></citerefentry> | |
189 | </para> | |
190 | </refsect1> | |
191 | <refsect1 id="seealso"><title>See Also</title> | |
192 | <para> | |
193 | <citerefentry><refentrytitle>glGetHistogram</refentrytitle></citerefentry>, | |
194 | <citerefentry><refentrytitle>glResetHistogram</refentrytitle></citerefentry> | |
195 | </para> | |
196 | </refsect1> | |
197 | <refsect1 id="Copyright"><title>Copyright</title> | |
198 | <para> | |
199 | Copyright <trademark class="copyright"></trademark> 1991-2006 | |
200 | Silicon Graphics, Inc. This document is licensed under the SGI | |
201 | Free Software B License. For details, see | |
202 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. | |
203 | </para> | |
204 | </refsect1> | |
205 | </refentry> |