Get histogram table
C Specification
void glGetHistogram(GLenum target,
GLboolean reset,
GLenum format,
GLenum type,
GLvoid * values);
Parameters
glGetHistogram
returns the current histogram table as a one-dimensional image with the same width as the histogram. No pixel transfer operations are performed on this image, but pixel storage modes that are applicable to 1D images are honored.
If a nonzero named buffer object is bound to the GL_PIXEL_PACK_BUFFER
target (see glBindBuffer
) while a histogram table is requested, value
s is treated as a byte offset into the buffer object’s data store.
Color components that are requested in the specified format
, but which are not included in the internal format of the histogram, are returned as zero. The assignments of internal color components to the components requested by format
are:
Notes
glGetHistogram
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 GL_HISTOGRAM
.
GL_INVALID_ENUM
is generated if format
is not one of the allowable values.
GL_INVALID_ENUM
is generated if type
is not one of the allowable values.
GL_INVALID_OPERATION
is generated if type
is one of GL_UNSIGNED_BYTE_3_3_2
, GL_UNSIGNED_BYTE_2_3_3_REV
, GL_UNSIGNED_SHORT_5_6_5
, or GL_UNSIGNED_SHORT_5_6_5_REV
and format
is not GL_RGB
.
GL_INVALID_OPERATION
is generated if type
is one of GL_UNSIGNED_SHORT_4_4_4_4
, GL_UNSIGNED_SHORT_4_4_4_4_REV
, GL_UNSIGNED_SHORT_5_5_5_1
, GL_UNSIGNED_SHORT_1_5_5_5_REV
, GL_UNSIGNED_INT_8_8_8_8
, GL_UNSIGNED_INT_8_8_8_8_REV
, GL_UNSIGNED_INT_10_10_10_2
, or GL_UNSIGNED_INT_2_10_10_10_REV
and format
is neither GL_RGBA
nor GL_BGRA
.
GL_INVALID_OPERATION
is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER
target and the buffer object’s data store is currently mapped.
GL_INVALID_OPERATION
is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER
target and the data would be packed to the buffer object such that the memory writes required would exceed the data store size.
GL_INVALID_OPERATION
is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER
target and value
s is not evenly divisible into the number of bytes needed to store in memory a datum indicated by type
.
GL_INVALID_OPERATION
is generated if glGetHistogram
is executed between the execution of glBegin
and the corresponding execution of glEnd
.
Associated Gets
glGetHistogramParameter
glGet
with argument GL_PIXEL_PACK_BUFFER_BINDING
See Also
glHistogram
, glResetHistogram
,
C Specification
void glGetHistogramParameterfv(GLenum target,
GLenum pname,
GLfloat * params);
void glGetHistogramParameteriv(GLenum target,
GLenum pname,
GLint * params);
Parameters
Description
glGetHistogramParameter
is used to query parameter values for the current histogram or for a proxy. The histogram state information may be queried by calling glGetHistogramParameter
with a target
of GL_HISTOGRAM
(to obtain information for the current histogram table) or GL_PROXY_HISTOGRAM
(to obtain information from the most recent proxy request) and one of the following values for the pname
argument:
Notes
glGetHistogramParameter
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_ENUM
is generated if pname
is not one of the allowable values.
GL_INVALID_OP
ERATION is generated if glGetHistogramParameter
is executed between the execution of glBegin
and the corresponding execution of glEnd
.
See Also
glGetHistogram
, glHistogram
Return light source parameter values
C Specification
void glGetLightfv(GLenum light,
GLenum pname,
GLfloat * params);
void glGetLightiv(GLenum light,
GLenum pname,
GLint * params);
Parameters
Description
glGetLight
returns in params
the value or values of a light source parameter. light
names the light and is a symbolic name of the form GL_LIGHT
i
where i
ranges from 0 to the value of GL_MAX_LIGHTS
- 1. GL_MAX_LIGHTS
is an implementation dependent constant that is greater than or equal to eight. pname
specifies one of ten light source parameters, again by symbolic name.
The following parameters are defined:
GL_AMBIENT
params
returns four integer or floating-point values representing the ambient intensity of the light source. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined. The initial value is (0, 0, 0, 1).
GL_DIFFUSE
params
returns four integer or floating-point values representing the diffuse intensity of the light source. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined. The initial value for GL_LIGHT0
is (1, 1, 1, 1); for other lights, the initial value is (0, 0, 0, 0).
GL_SPECULAR
params
returns four integer or floating-point values representing the specular intensity of the light source. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined. The initial value for GL_LIGHT0
is (1, 1, 1, 1); for other lights, the initial value is (0, 0, 0, 0).
GL_POSITION