To determine minimum and maximum color values used in an image, follow these steps:
void glMinmaxEXT( GLenum target, GLenum internalformat, GLboolean sink)
The resulting minmax table always has two entries. Entry 0 is the minimum and entry 1 is the maximum.
glEnable(GL_MINMAX_EXT)
Each component of the internal format of the minmax table is compared to the corresponding component of the incoming RGBA pixel (luminance components are compared to red).
void glGetMinMaxEXT ( GLenum target, GLboolean reset, GLenum format,
GLenum type, glvoid *values)