GLGETHISTOGRAM(3G)

πŸ“¦ version 1.1, in centos-stream 9, fedora 43, fedora 44

πŸ’– 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 be GL_HISTOGRAM. that's it, that's the whole vibe check. anything else and we have a problem 😀
  • reset β€” if it's GL_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's GL_FALSE, literally none of the counters in the histogram table get modified. not one. periodt.
  • format β€” the format of the values that get returned in values. must be one of GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_BGR, GL_RGBA, GL_BGRA, GL_LUMINANCE, or GL_LUMINANCE_ALPHA. pick one, bestie 🫢
  • type β€” the type of values that get returned in values. 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, and GL_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 β†’ resulting Red
  • Internal Green β†’ resulting Green
  • Internal Blue β†’ resulting Blue
  • Internal Alpha β†’ resulting Alpha
  • Internal Luminance β†’ resulting Red

πŸŽ€ 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_ENUM gets generated if target is not GL_HISTOGRAM.
  • GL_INVALID_ENUM gets generated if format is not one of the allowable values.
  • GL_INVALID_ENUM gets generated if type is not one of the allowable values.
  • GL_INVALID_OPERATION gets generated if glGetHistogram is executed between the execution of glBegin and the corresponding execution of glEnd. do not do this. that's a whole mess 😭
  • GL_INVALID_OPERATION gets 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 gets 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.

🌈 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