GLMINMAX(3G)

πŸ“¦ version 24.3.3, in opensuse-leap 16.0

πŸ’… 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 be GL_MINMAX. no other options, babe. it's GL_MINMAX or 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, or GL_RGBA16. okay so basically the whole squad is invited. πŸ’–
  • sink β€” if it's GL_TRUE, pixels get consumed by the minmax process and like… nothing else happens. no drawing, no texture loading. they just get eaten. if it's GL_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_ENUM is generated if target is not one of the allowable values.
  • GL_INVALID_ENUM is generated if internalformat is not one of the allowable values.
  • GL_INVALID_OPERATION is generated if glMinmax is executed between the execution of glBegin and the corresponding execution of glEnd. (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