GLCOLORTABLEPARAMETER(3G)

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

πŸ’– glColorTableParameteriv / glColorTableParameterfv β€” set color lookup table parameters πŸ’–

okay bestie, welcome to the GLCOLORTABLEPARAMETER page, section 3G, she's an OpenGL girly and she's here to help you set color lookup table parameters ✨ no cap, this one's short and sweet, let's go πŸ¦‹


✨ C SPECIFICATION ✨

void glColorTableParameteriv( GLenum target,
                              GLenum pname,
                              const GLint *params )
void glColorTableParameterfv( GLenum target,
                              GLenum pname,
                              const GLfloat *params )

two functions, same energy, one takes GLint and one takes GLfloat, and honestly? iconic of them πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • target β€” the target color table, queen. must be GL_COLOR_TABLE, GL_POST_CONVOLUTION_COLOR_TABLE, or GL_POST_COLOR_MATRIX_COLOR_TABLE. that's the vibe check, no substitutions πŸ”₯
  • pname β€” the symbolic name of a texture color lookup table parameter. must be one of GL_COLOR_TABLE_SCALE or GL_COLOR_TABLE_BIAS. pick one, bestie 🫢
  • params β€” a pointer to an array where the values of the parameters are stored. yes it's a pointer. yes you have to keep it alive. we don't make the rules 😭

🌸 DESCRIPTION 🌸

so glColorTableParameter is the function that lets you specify the scale factors and the bias terms that get applied to color components when they're loaded into a color table. like, before the color even lands in the table, it gets scaled and biased. glow-up in transit, fr fr ✨

target tells you which color table those scale and bias terms apply to. it must be set to GL_COLOR_TABLE, GL_POST_CONVOLUTION_COLOR_TABLE, or GL_POST_COLOR_MATRIX_COLOR_TABLE. one of those three, periodt.

pname must be GL_COLOR_TABLE_SCALE if you're setting the scale factors. in that case, params points to an array of four values, and those four values are the scale factors for red, green, blue, and alpha, in that order. in that exact order. don't get cute with the order, bestie πŸ™ˆ

pname must be GL_COLOR_TABLE_BIAS if you're setting the bias terms. in this case, params points to an array of four values, which are the bias terms for red, green, blue, and alpha, in that order. same deal, same order, same four-value situation πŸ’–

and the color tables themselves? those are specified by calling glColorTable. so this function is like, the seasoning, and glColorTable is the actual meal πŸ“


πŸ‘‘ NOTES πŸ‘‘

glColorTableParameter is available only if GL_ARB_imaging is returned from calling glGetString with an argument of GL_EXTENSIONS.

so like, check for GL_ARB_imaging first, or you're gonna have a bad time πŸ’€ this is a conditional availability situation, not a "just trust me" situation.

πŸ”₯ ERRORS πŸ”₯

  • GL_INVALID_ENUM is generated if target or pname is not an acceptable value. so if you passed something unhinged, the universe will let you know 😭
  • GL_INVALID_OPERATION is generated if glColorTableParameter is executed between the execution of glBegin and the corresponding execution of glEnd.
literally do not call this in between glBegin and glEnd. that's the forbidden window. that's the "not me doing this" moment. don't be that girl πŸ™ˆ

⭐ ASSOCIATED GETS ⭐

glGetColorTableParameter

the way that you can just go ask her what she's got set πŸ’… iykyk


🌈 SEE ALSO 🌈

glColorTable(3G), glPixelTransfer(3G)


that's the whole page bestie, you ate it, you understood it, main character energy all around πŸ«ΆπŸ’œ

later babes β€” this was GLCOLORTABLEPARAMETER(3G), living in section 3G of the manual, signed off at the bottom like every good page is πŸŽ€βœ¨ bye!! πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from