GLGETMINMAX(3G)
π NAME π
glGetMinmax β bestie, this one grabs your minimum and maximum pixel values for you β¨
It lives in the 3G manual, and yes she's iconic for it.
πΈ C SPECIFICATION πΈ
void glGetMinmax( GLenum target,
GLboolean reset,
GLenum format,
GLenum types,
GLvoid *values )
π PARAMETERS π
targetβ has got to beGL_MINMAX. No substitutions, no vibes, justGL_MINMAX.resetβ if you passGL_TRUE, every entry in the minmax table that actually gets returned is reset back to its initial values (the other entries? untouched, she's not touching them π ). If you passGL_FALSE, the minmax table stays completely unaltered.formatβ this is what format the data comes back in, insidevalues. It has to be one of:GL_RED,GL_GREEN,GL_BLUE,GL_ALPHA,GL_RGB,GL_BGR,GL_RGBA,GL_BGRA,GL_LUMINANCE, orGL_LUMINANCE_ALPHA.typesβ the type of the data that comes back invalues. These are the accepted ones: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 the whole guest list πvaluesβ a pointer to storage where the returned values go. You gotta have somewhere to put them, bestie.
π¦ DESCRIPTION π¦
So glGetMinmax hands you back the accumulated minimum and maximum pixel values β and it computes those on a per-component basis, no cap. They come back as a one-dimensional image of width 2. First set of return values? That's the minima. Second set? The maxima. The format of what you get back is decided by format, and the type of what you get back is decided by types.
Real talk though: no pixel transfer operations get performed on the return values. None. But the pixel storage modes that apply to 1-dimensional images do get performed, so don't forget about those.
Here's the little quirk that gets everybody: if you request color components in format that aren't actually included in the internal format of the minmax table, they come back as zero. Zero. Nothing. Empty. π
And the assignment of internal color components to the components you request with format goes like this:
- Red internal β Red resulting
- Green internal β Green resulting
- Blue internal β Blue resulting
- Alpha internal β Alpha resulting
- Luminance internal β Red resulting
If reset is GL_TRUE, the minmax table entries that correspond to the return values get reset to their initial values. And listen β minimum and maximum values that are not returned are not modified, even when reset is GL_TRUE. She only touches what she shows you π«Ά
β NOTES β
glGetMinmax is only present if GL_ARB_imaging shows up when glGetString is called with an argument of GL_EXTENSIONS. So like, vibe check first, okay?
π ERRORS π
GL_INVALID_ENUMgets generated iftargetis notGL_MINMAX.GL_INVALID_ENUMgets generated ifformatis not one of the allowable values.GL_INVALID_ENUMgets generated iftypesis not one of the allowable values.GL_INVALID_OPERATIONgets generated ifglGetMinmaxis executed between the execution ofglBeginand the corresponding execution ofglEnd. Do not do that. Ma'am. πGL_INVALID_OPERATIONgets generated iftypesis 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 iftypesis 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.
Mixing and matching those type/format combos wrong is a whole mood, and that mood is GL_INVALID_OPERATION. Match them up correctly and you ate. π₯
π SEE ALSO π
glMinmax(3G)glResetMinmax(3G)glGetMinmaxParameter(3G)
And that's the whole page, bestie π this was GLGETMINMAX(3G) from the 3G manual β she's a classic, she's serving, and now you know her fr fr. Go get those min and max values πβ¨
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- fedora 43: gl-manpages 1.1-34.20190306.fc43 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- fedora 44: gl-manpages 1.1-35.20190306.fc44 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms