glHistogram

glHistogram: man2/glHistogram.xml

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 width - 1, 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.

glHistogram is present only if ARB_imaging is returned when glGetString is called with an argument of GL_EXTENSIONS.

@OpenGL_Version(OGLIntroducedIn.Unknown)
@OpenGL_Extension("GL_ARB_imaging")
fn_glHistogram glHistogram;

See Also

glGetHistogram, glResetHistogram

Meta