GLGETCOLORTABLEPARAMETER(3G)
π NAME π
glGetColorTableParameterfv, glGetColorTableParameteriv β bestie, these two are how you get your color lookup table parameters. That's the whole job. Pulling the tea out of a color table. π«β¨
This one lives in the 3G manual, so you know it's GL business.
β¨ C SPECIFICATION β¨
void glGetColorTableParameterfv( GLenum target,
GLenum pname,
GLfloat *params )
void glGetColorTableParameteriv( GLenum target,
GLenum pname,
GLint *params )
Notice the vibe: one takes GLfloat *, one takes GLint *. Same energy, different pointer. Pick your fighter. π
π PARAMETERS π
targetβ which color table we're snooping on, queen. It must be one of:GL_COLOR_TABLE,GL_POST_CONVOLUTION_COLOR_TABLE,GL_POST_COLOR_MATRIX_COLOR_TABLE,GL_PROXY_COLOR_TABLE,GL_PROXY_POST_CONVOLUTION_COLOR_TABLE,GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE. That's it, that's the list, no substitutes. π ββοΈpnameβ the symbolic name of a color lookup table parameter, like the label on the lil container. It must be one of:GL_COLOR_TABLE_BIAS,GL_COLOR_TABLE_SCALE,GL_COLOR_TABLE_FORMAT,GL_COLOR_TABLE_WIDTH,GL_COLOR_TABLE_RED_SIZE,GL_COLOR_TABLE_GREEN_SIZE,GL_COLOR_TABLE_BLUE_SIZE,GL_COLOR_TABLE_ALPHA_SIZE,GL_COLOR_TABLE_LUMINANCE_SIZE, orGL_COLOR_TABLE_INTENSITY_SIZE.paramsβ a pointer to an array where the values of the parameter get stored. Like, you hand it an empty lil box and it fills the box. π¦
πΈ DESCRIPTION πΈ
Returns parameters specific to target (a color table). Simple as that, fr fr.
When pname is set to GL_COLOR_TABLE_SCALE or GL_COLOR_TABLE_BIAS, glGetColorTableParameter returns the color table scale or bias parameters for the table specified by target. For these queries, target must be set to GL_COLOR_TABLE, GL_POST_CONVOLUTION_COLOR_TABLE, or GL_POST_COLOR_MATRIX_COLOR_TABLE, and params points to an array of four elements, which receive the scale or bias factors for red, green, blue, and alpha β in that order. Order matters bestie, don't scramble the alphabet of colors. π
glGetColorTableParameter can also be used to retrieve the (there is literally a gap in the original text here, no cap β a word got lost in the source, so I'm leaving the gap right where it is) and size parameters for a color table. For these queries, set target to either the color table target or the proxy color table target. The and size parameters are set by glColorTable.
The following table lists the and size parameters that may be queried. For each symbolic constant listed below for pname, params must point to an array of the given length, and receive the values indicated. π
GL_COLOR_TABLE_FORMATβ N =1β Internal (e.g.GL_RGBA)GL_COLOR_TABLE_WIDTHβ N =1β Number of elements in tableGL_COLOR_TABLE_RED_SIZEβ N =1β Size of red component, in bitsGL_COLOR_TABLE_GREEN_SIZEβ N =1β Size of green componentGL_COLOR_TABLE_BLUE_SIZEβ N =1β Size of blue componentGL_COLOR_TABLE_ALPHA_SIZEβ N =1β Size of alpha componentGL_COLOR_TABLE_LUMINANCE_SIZEβ N =1β Size of luminance componentGL_COLOR_TABLE_INTENSITY_SIZEβ N =1β Size of intensity component
(Yes, every single one of them is N = 1. Eight constants, eight lonely lil 1s. Consistent queen behavior. π
)
π NOTES π
glGetColorTableParameter is present only if GL_ARB_imaging shows up when glGetString is called with an argument of GL_EXTENSIONS. So like, vibe check your extensions first or this whole thing is just a rumor. π
π¨ ERRORS π¨
GL_INVALID_ENUMis generated iftargetorpnameis not an acceptable value. Wrong name, no game. πGL_INVALID_OPERATIONis generated ifglGetColorTableParameteris executed between the execution ofglBeginand the corresponding execution ofglEnd. Do not try this inside aglBegin/glEndsandwich, it will not slay, it will just error at you. π
π SEE ALSO π
glColorTable(3G), glTexParameter(3G), glColorTableParameter(3G)
Okay that's the whole page bestie, go forth and query your color tables responsibly. π¦
Signing off from the GLGETCOLORTABLEPARAMETER(3G) page β that's the 3G manual name up top and down at the bottom, no date and no version number in sight, just the title doing its lil cameo twice. Iconic, honestly. πβ¨
π¦ 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