GLGETCOLORTABLE(3G)
π glGetColorTable β it's in the 3G manual bestie, and it's giving color lookup table energy
β¨ NAME β¨
glGetColorTable β grab the entire contents of a color lookup table and yeet them into your buffer π
πΈ C SPECIFICATION πΈ
void glGetColorTable( GLenum target,
GLenum format,
GLenum type,
GLvoid *table )
π¦ PARAMETERS π¦
targetβ okay so this has to be one of exactly three things:GL_COLOR_TABLE,GL_POST_CONVOLUTION_COLOR_TABLE, orGL_POST_COLOR_MATRIX_COLOR_TABLE. That's it. Those are the vibes allowed πformatβ the format of the pixel data intable. The possible values areGL_RED,GL_GREEN,GL_BLUE,GL_ALPHA,GL_LUMINANCE,GL_LUMINANCE_ALPHA,GL_RGB,GL_BGR,GL_RGBA, andGL_BGRA. Pick one, queen πtypeβ the type of the pixel data intable. These symbolic constants 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, andGL_UNSIGNED_INT_2_10_10_10_REV. That's a lot of options and honestly? slay πtableβ a pointer to a one-dimensional array of pixel data that's gonna hold the contents of the color table. This is where the goodies land π
π DESCRIPTION π
So glGetColorTable returns, in table, the contents of the color table that target is pointing at. No pixel transfer operations get performed, okay? None. But the pixel storage modes that apply to glReadPixels do get performed. iykyk β¨
Here's the tea: color components you ask for in the specified format, but which aren't actually included in the internal format of the color lookup table, come back as zero. Sorry bestie, that's just how it is π
And here's how the internal color components map onto the components requested by format:
- internal
redβ resultingred - internal
greenβ resultinggreen - internal
blueβ resultingblue - internal
alphaβ resultingalpha - internal
luminanceβ resultingred - internal
intensityβ resultingred
Like, luminance and intensity both just slide into the red slot. main character behavior fr fr π
π NOTES π
glGetColorTable only exists if GL_ARB_imaging shows up when you call glGetString with an argument of GL_EXTENSIONS. No GL_ARB_imaging, no function. Vibe check failed, sorry π«Ά
π₯ ERRORS π₯
GL_INVALID_ENUMgets generated iftargetisn't one of the allowable values. Rude, but valid π«GL_INVALID_ENUMgets generated ifformatisn't one of the allowable values.GL_INVALID_ENUMgets generated iftypeisn't one of the allowable values.GL_INVALID_OPERATIONgets generated iftypeis 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. Those types areGL_RGB-only, periodt πGL_INVALID_OPERATIONgets generated iftypeis 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. So it's RGBA or BGRA or nothing, no in-between πGL_INVALID_OPERATIONgets generated ifglGetColorTablegets executed between the execution ofglBeginand the corresponding execution ofglEnd. Do not do that. Not the moment, not the vibe π«
π SEE ALSO π
glColorTable(3G)glColorTableParameter(3G)glGetColorTableParameter(3G)
okay that's the whole page bestie, you ate it, go forth and fetch those color tables πβ¨
This little legend lives in the 3G manual under the very iconic name GLGETCOLORTABLE(3G) β that's the source/version and the date wrapped up together, so consider this your cute sign-off. byeeee π¦ππ
π¦ 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