GLMINMAX(3G)
π
GLMINMAX(3G) β the glMinmax page, bestie edition β¨
okay so you opened GLMINMAX(3G) from the 3G manual section, and you're about to learn how to define a minmax table. yes, the minmax table. the one that's literally keeping track of the smallest and biggest pixel components it's ever seen. it's giving data-hoarding but make it graphics. π
πΈ NAME πΈ
glMinmax β define minmax table
β¨ C SPECIFICATION β¨
void glMinmax( GLenum target,
GLenum internalformat,
GLboolean sink )
like, that's the whole signature. three args. you got this. π«Ά
π¦ PARAMETERS π¦
targetβ the minmax table whose parameters are gonna get set. it must beGL_MINMAX. no other options, babe. it'sGL_MINMAXor it's nothing.internalformatβ the format of entries in the minmax table. must be one of these, and there are a lot of them:GL_ALPHA,GL_ALPHA4,GL_ALPHA8,GL_ALPHA12,GL_ALPHA16,GL_LUMINANCE,GL_LUMINANCE4,GL_LUMINANCE8,GL_LUMINANCE12,GL_LUMINANCE16,GL_LUMINANCE_ALPHA,GL_LUMINANCE4_ALPHA4,GL_LUMINANCE6_ALPHA2,GL_LUMINANCE8_ALPHA8,GL_LUMINANCE12_ALPHA4,GL_LUMINANCE12_ALPHA12,GL_LUMINANCE16_ALPHA16,GL_R3_G3_B2,GL_RGB,GL_RGB4,GL_RGB5,GL_RGB8,GL_RGB10,GL_RGB12,GL_RGB16,GL_RGBA,GL_RGBA2,GL_RGBA4,GL_RGB5_A1,GL_RGBA8,GL_RGB10_A2,GL_RGBA12, orGL_RGBA16. okay so basically the whole squad is invited. πsinkβ if it'sGL_TRUE, pixels get consumed by the minmax process and likeβ¦ nothing else happens. no drawing, no texture loading. they just get eaten. if it'sGL_FALSE, the pixels keep going and proceed to the final conversion process after minmax. bestie they get to continue their journey. π
π DESCRIPTION π
so when GL_MINMAX is enabled, the RGBA components of incoming pixels get compared to the minimum and maximum values for each component, and those live in the 2-element minmax table. (first element = the minima, second element = the maxima. iconic arrangement, honestly.)
if a pixel component is greater than the corresponding component in the maximum element, then the maximum element gets updated with that pixel component value. if a pixel component is less than the corresponding component in the minimum element, then the minimum element gets updated with that pixel component value. (in both cases, if the internal format of the minmax table includes luminance, then the R color component of incoming pixels is what's used for the comparison. iykyk.)
the contents of the minmax table can be retrieved later by calling glGetMinmax. and the whole minmax operation gets enabled or disabled by calling glEnable or glDisable, respectively, with an argument of GL_MINMAX. so you're in control, periodt. π
glMinmax redefines the current minmax table to have entries of the format specified by internalformat. the maximum element gets initialized with the smallest possible component values, and the minimum element gets initialized with the largest possible component values. yes it's backwards from what you'd expect and yes it's correct β that's how the first comparison always lands.
β οΈ the values in the previous minmax table, if any, are lost. gone. not coming back. no cap.
if sink is GL_TRUE, then pixels are discarded after minmax. no further processing of the pixels takes place, and no drawing, texture loading, or pixel readback will result. they simply cease to be. π
π NOTES π
glMinmax is present only if GL_ARB_imaging is returned when glGetString is called with an argument of GL_EXTENSIONS. so like, check first, bestie. don't just assume. π
π₯ ERRORS π₯
GL_INVALID_ENUMis generated iftargetis not one of the allowable values.GL_INVALID_ENUMis generated ifinternalformatis not one of the allowable values.GL_INVALID_OPERATIONis generated ifglMinmaxis executed between the execution ofglBeginand the corresponding execution ofglEnd. (do not do this. the GL police will find you. π¨)
β ASSOCIATED GETS β
glGetMinmaxParameter
π SEE ALSO π
glGetMinmax(3G), glResetMinmax(3G)
k byeeee bestie, go define that table, you're literally the main character of pixel processing π§ββοΈβ¨
xoxo, the GLMINMAX(3G) page β 3G manual, same title on the way in and on the way out π
π¦ 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