GLCOLORSUBTABLE(3G)
π glColorSubTable β bestie, it's 3G and we're rewriting color tables
okay so bestie, welcome to glColorSubTable, from the 3G corner of the manual universe π¦. Short version: it respecifies a portion of a color table. Not the whole thing. Just a slice. A lil snack. π
β¨ C SPECIFICATION β¨
void glColorSubTable( GLenum target,
GLsizei start,
GLsizei count,
GLenum format,
GLenum type,
const GLvoid *data )
no cap, that's the whole signature. six args. count 'em. π
π PARAMETERS π
targetβ has to be one ofGL_COLOR_TABLE,GL_POST_CONVOLUTION_COLOR_TABLE, orGL_POST_COLOR_MATRIX_COLOR_TABLE. pick one, bestie, there's no "all of the above" option πstartβ the starting index of the chunk of the color table you're replacing. like where the scissors go βοΈcountβ how many table entries you're swapping out. the size of the slice.formatβ the format of the pixel data indata. the allowable values areGL_RED,GL_GREEN,GL_BLUE,GL_ALPHA,GL_LUMINANCE,GL_LUMINANCE_ALPHA,GL_RGB,GL_BGR,GL_RGBA, andGL_BGRA. (yes, the BGR ones are there too. they're valid. we don't judge. π)typeβ the type of the pixel data indata. the allowable values areGL_UNSIGNED_BYTE,GL_BYTE,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 packing options and honestly? iconic of them. πdataβ pointer to a one-dimensional array of pixel data that gets processed to replace the specified region of the color table. it's giving "here's my contribution to the group project" π«Ά
πΈ DESCRIPTION πΈ
so glColorSubTable respecifies a contiguous portion of a color table that you already defined earlier with glColorTable. like, you already built the whole cake, and now you're just swapping out a few slices. π
the pixels that data points at replace the portion of the existing table running from indices $"start"~+~"count"~-~1$, inclusive. so it starts at start, and it runs through start plus count minus one. math! β¨
β οΈ heads up bestie: this region may not include any entries outside the range of the color table as it was originally specified. stay in your lane. the lane is the original table. π
and here's a fun one β it is not an error to specify a subtexture with width of 0, but such a specification has no effect. so you can do it. it just does literally nothing. zero thoughts, head empty, no effect. π
π¦ NOTES π¦
glColorSubTable is present only if GL_ARB_imaging is returned when glGetString is called with an argument of GL_EXTENSIONS. so vibe check that first or you're gonna be out here calling a function that isn't even there π
π ERRORS π
GL_INVALID_ENUMis generated iftargetis not one of the allowable values. (pick from the list, babe)GL_INVALID_VALUEis generated if$"start"~+~"count"~>~width$. you went past the edge. rude. π«GL_INVALID_ENUMis generated ifformatis not one of the allowable values.GL_INVALID_ENUMis generated iftypeis not one of the allowable values.GL_INVALID_OPERATIONis generated ifglColorSubTableis executed between the execution ofglBeginand the corresponding execution ofglEnd. do not do this. betweenglBeginandglEndyou stay in your box, periodt. π
β ASSOCIATED GETS β
glGetColorTableglGetColorTableParameter
π SEE ALSO π
glColorSubTable(3G)glColorTableParameter(3G)glCopyColorTable(3G)glCopyColorSubTable(3G)glGetColorTable(3G)
okay that's the whole page, bestie, we ate and left no crumbs πβ¨. this little love letter comes to you straight from the GLCOLORSUBTABLE(3G) page β yep, the manpage name and its manual section are both right there in the title, and the footer says the exact same thing, so it's GLCOLORSUBTABLE(3G) top and GLCOLORSUBTABLE(3G) bottom, matching bookends, cute right? π no date on this one, just the name and section, so that's the whole sign-off. mwah. π
π«Ά
π¦ 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