GLUSCALEIMAGE(3G)
β¨ GLUSCALEIMAGE(3G) β¨
okay so bestie, welcome to gluScaleImage β that's the 3G manual page, the GLU utility girlies π
. she takes an image and rescales it to literally whatever size you want. no cap.
π C SPECIFICATION π
GLint gluScaleImage( GLenum format,
GLsizei wIn,
GLsizei hIn,
GLenum typeIn,
const void *dataIn,
GLsizei wOut,
GLsizei hOut,
GLenum typeOut,
GLvoid* dataOut )
πΈ PARAMETERS πΈ
formatβ Specifies the ____ of the pixel data. (ngl the original page literally has a hole here, it's giving typo π β anyway, these are the symbolic values that are valid:GL_COLOR_INDEX,GL_STENCIL_INDEX,GL_DEPTH_COMPONENT,GL_RED,GL_GREEN,GL_BLUE,GL_ALPHA,GL_RGB,GL_RGBA,GL_BGR,GL_BGRA,GL_LUMINANCE, andGL_LUMINANCE_ALPHA.)wIn,hInβ the width and height of the source image, in pixels. that's your starting canvas πΌοΈtypeInβ the data type fordataIn. it must be one ofGL_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. pick one or she's not playing πdataInβ a pointer to the source image. where the pixels live.wOut,hOutβ the width and height of the destination image, in pixels. the glow-up dimensions β¨typeOutβ the data type fordataOut. must be one ofGL_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, orGL_UNSIGNED_INT_2_10_10_10_REV. (spot the difference: that last one is an or, not an and β iconique of the original, we keep it exactly π«Ά)dataOutβ a pointer to the destination image. where the new pixels get written.
π¦ DESCRIPTION π¦
gluScaleImage scales a pixel image. she uses the appropriate pixel store modes to unpack data out of the source image and pack data into the destination image. unpack, repack, serve π
When you're shrinking an image, gluScaleImage uses a box filter to sample the source image and create pixels for the destination image. tiny but make it make sense.
When you're magnifying an image, the pixels from the source image get linearly interpolated to create the destination image. glow up, but math π§
A return value of zero indicates success. anything else means a GLU error code came back β go check gluErrorString for the tea.
Also, see the glReadPixels reference page for a description of the acceptable values for the format, typeIn, and typeOut parameters. she's the source of truth, periodt.
π NOTES π
Formats GL_BGR, and GL_BGRA, and types 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 are only available if the GL version is 1.2 or greater. so if you're on something ancient, these are not for you π
π ERRORS π
GLU_INVALID_VALUEis returned ifwIn,hIn,wOut, orhOutis negative. negative pixels aren't a vibe.GLU_INVALID_ENUMis returned ifformat,typeIn, ortypeOutis not legal. no fake enums in this house.GLU_INVALID_OPERATIONis returned iftypeInortypeOutisGL_UNSIGNED_BYTE_3_3_2orGL_UNSIGNED_BYTE_2_3_3_REVandformatis notGL_RGB.GLU_INVALID_OPERATIONis returned iftypeInortypeOutisGL_UNSIGNED_SHORT_5_6_5orGL_UNSIGNED_SHORT_5_6_5_REVandformatis notGL_RGB.GLU_INVALID_OPERATIONis returned iftypeInortypeOutisGL_UNSIGNED_SHORT_4_4_4_4orGL_UNSIGNED_SHORT_4_4_4_4_REVandformatis neitherGL_RGBAnorGL_BGRA.GLU_INVALID_OPERATIONis returned iftypeInortypeOutisGL_UNSIGNED_SHORT_5_5_5_1orGL_UNSIGNED_SHORT_1_5_5_5_REVandformatis neitherGL_RGBAnorGL_BGRA.GLU_INVALID_OPERATIONis returned iftypeInortypeOutisGL_UNSIGNED_INT_8_8_8_8orGL_UNSIGNED_INT_8_8_8_8_REVandformatis neitherGL_RGBAnorGL_BGRA.GLU_INVALID_OPERATIONis returned iftypeInortypeOutisGL_UNSIGNED_INT_10_10_10_2orGL_UNSIGNED_INT_2_10_10_10_REVandformatis neitherGL_RGBAnorGL_BGRA.
so likeβ¦ pack your types to match your format or she WILL hand you GLU_INVALID_OPERATION, and it will be deserved π₯
π SEE ALSO π
glDrawPixels(3G), glReadPixels(3G), gluBuild1DMipmaps(3G), gluBuild2DMipmaps(3G), gluBuild3DMipmaps(3G), gluErrorString(3G)
and that's the whole page, bestie π this one signs off as GLUSCALEIMAGE(3G) β that's the source and the version tag and the date energy all rolled into one iconic little line at the bottom. go scale something huge, 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