GLGETHISTOGRAM(3G)
π GLGETHISTOGRAM β get histogram table π
okay bestie, welcome to glGetHistogram, a member of the 3G manual squad π this one's all about pulling your histogram table back out so you can look at it. no cap.
β¨ NAME β¨
glGetHistogram β get histogram table π¦
πΈ C SPECIFICATION πΈ
void glGetHistogram( GLenum target,
GLboolean reset,
GLenum format,
GLenum type,
GLvoid *values )
π PARAMETERS π
targetβ must beGL_HISTOGRAM. that's it, that's the whole vibe check. anything else and we have a problem π€resetβ if it'sGL_TRUE, every component counter that actually gets returned is reset to zero. (the other counters? untouched, living their lives, not affected at all π ) if it'sGL_FALSE, literally none of the counters in the histogram table get modified. not one. periodt.formatβ the format of the values that get returned invalues. must be one ofGL_RED,GL_GREEN,GL_BLUE,GL_ALPHA,GL_RGB,GL_BGR,GL_RGBA,GL_BGRA,GL_LUMINANCE, orGL_LUMINANCE_ALPHA. pick one, bestie π«Άtypeβ the type of values that get returned invalues. these are all accepted:GL_UNSIGNED_BYTE,GL_BYTE,GL_BITMAP,GL_UNSIGNED_SHORT,GL_SHORT,GL_UNSIGNED_INT,GL_INT,GL_FLOAT,GL_UNSIGNED_BYTE_3_3_2,GL_UNSIGNED_BYTE_2_3_3_REV,GL_UNSIGNED_SHORT_5_6_5,GL_UNSIGNED_SHORT_5_6_5_REV,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, andGL_UNSIGNED_INT_2_10_10_10_REV. that's a LOT of options and honestly? iconic β¨valuesβ a pointer to storage for the returned histogram table. give it somewhere to live π
π¦ DESCRIPTION π¦
glGetHistogram hands you back the current histogram table as a one-dimensional image, with the same width as the histogram. it's giving flat, it's giving linear, and we love that for it.
no pixel transfer operations get performed on this image, okay? none. but pixel storage modes that apply to 1D images are honored π
now, here's the tea π: color components you request in format that aren't included in the histogram's internal setup come back as zero. so here's the assignment chart, internal component β resulting component:
- Internal
Redβ resultingRed - Internal
Greenβ resultingGreen - Internal
Blueβ resultingBlue - Internal
Alphaβ resultingAlpha - Internal
Luminanceβ resultingRed
π NOTES π
glGetHistogram is only present if GL_ARB_imaging shows up when you call glGetString with an argument of GL_EXTENSIONS. so like, check first, bestie. no GL_ARB_imaging, no function. iykyk π
π ERRORS π
GL_INVALID_ENUMgets generated iftargetis notGL_HISTOGRAM.GL_INVALID_ENUMgets generated ifformatis not one of the allowable values.GL_INVALID_ENUMgets generated iftypeis not one of the allowable values.GL_INVALID_OPERATIONgets generated ifglGetHistogramis executed between the execution ofglBeginand the corresponding execution ofglEnd. do not do this. that's a whole mess πGL_INVALID_OPERATIONgets generated iftypeis one ofGL_UNSIGNED_BYTE_3_3_2,GL_UNSIGNED_BYTE_2_3_3_REV,GL_UNSIGNED_SHORT_5_6_5, orGL_UNSIGNED_SHORT_5_6_5_REVandformatis notGL_RGB.GL_INVALID_OPERATIONgets generated iftypeis one ofGL_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, orGL_UNSIGNED_INT_2_10_10_10_REVandformatis neitherGL_RGBAnorGL_BGRA.
π SEE ALSO π
glHistogram(3G)glResetHistogram(3G)glGetHistogramParameter(3G)
and that's the whole page, bestie!! go forth and read your histogram table π mwah π
xoxo, this was GLGETHISTOGRAM(3G) β that's the source and the version, and it's the whole energy of this page πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: Mesa-libGL-devel 24.1.7-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms