Signature
glHistogram(
GLenum (
target
)
,
GLsizei (
width
)
,
GLenum (
internalformat
)
,
GLboolean (
sink
)
)-> void
Parameters
Description
When
GL_HISTOGRAM
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 format 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.)
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
glEnable
and disabled with
glDisable
.
When
target
is
GL_HISTOGRAM
,
glHistogram
redefines the current
histogram table to have
width
entries of the format specified by
internalformat
.
The entries are indexed 0 through
,
and
all entries are initialized to zero.
The values in the previous histogram table, if any, are lost.
If
sink
is
GL_TRUE
, then pixels are discarded after histogramming;
no further processing of the pixels takes place, and no drawing,
texture loading, or pixel readback will result.
When
target
is
GL_PROXY_HISTOGRAM
,
glHistogram
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.
Notes
glHistogram
is present only if
ARB_imaging
is returned when
glGetString
is called with an argument of
GL_EXTENSIONS
.
Errors
GL_INVALID_ENUM
is generated if
target
is not one of the allowable
values.
GL_INVALID_VALUE
is generated if
width
is less than zero or is
not a power of 2.
GL_INVALID_ENUM
is generated if
internalformat
is not one of the
allowable values.
GL_TABLE_TOO_LARGE
is generated if
target
is
GL_HISTOGRAM
and the histogram table specified is too large for the implementation.
GL_INVALID_OPERATION
is generated if
glHistogram
is executed
between the execution of
glBegin
and the corresponding
execution of
glEnd
.
Associated Gets
See Also
Copyright
Copyright
1991-2006
Silicon Graphics, Inc. This document is licensed under the SGI
Free Software B License. For details, see
http://oss.sgi.com/projects/FreeB/
.
Sample Code References
The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.
glHistogram