GLCOLORSUBTABLE(3G)

πŸ“¦ version 1.1, in centos-stream 9, fedora 43, fedora 44

πŸ’… 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 of GL_COLOR_TABLE, GL_POST_CONVOLUTION_COLOR_TABLE, or GL_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 in data. the allowable values are GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_BGR, GL_RGBA, and GL_BGRA. (yes, the BGR ones are there too. they're valid. we don't judge. πŸ’–)
  • type β€” the type of the pixel data in data. the allowable values are GL_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, and GL_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_ENUM is generated if target is not one of the allowable values. (pick from the list, babe)
  • GL_INVALID_VALUE is generated if $"start"~+~"count"~>~width$. you went past the edge. rude. 🚫
  • GL_INVALID_ENUM is generated if format is not one of the allowable values.
  • GL_INVALID_ENUM is generated if type is not one of the allowable values.
  • GL_INVALID_OPERATION is generated if glColorSubTable is executed between the execution of glBegin and the corresponding execution of glEnd. do not do this. between glBegin and glEnd you stay in your box, periodt. πŸ‘‘

⭐ ASSOCIATED GETS ⭐

  • glGetColorTable
  • glGetColorTableParameter

πŸ‘‘ 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