IMG_ReadXPM...rayToRGB888(3)
π IMG_ReadXPMFromArrayToRGB888 β bestie's guide to loading XPM vibes π
okay so this page lives in the SDL_image3 FUNCTIONS manual, and the header abbreviates it as IMG_ReadXPM...rayToRGB888(3) because apparently the full name was too iconic to fit. anyway. let's get into it π«Ά
πΈ NAME πΈ
IMG_ReadXPMFromArrayToRGB888 β loads an XPM image straight out of a memory array. no files, no drama, just vibes π
β¨ SYNOPSIS β¨
#include <SDL3_image/SDL_image.h>
SDL_Surface * IMG_ReadXPMFromArrayToRGB888(char **xpm);
π DESCRIPTION π
so the surface you get back is always a 32-bit RGB surface. like, always always. no cap. it's not gonna switch it up on you.
but bestie, listen β if you actually wanted 8-bit indexed colors (and the XPM data is down for it, iykyk), then you should be calling IMG_ReadXPMFromArray() instead. different function, different era π
and when you're done with the surface? please, please dispose of it properly with a call to SDL_DestroySurface(). don't just leave it there like an unread group chat π
π¦ FUNCTION PARAMETERS π¦
xpmβ a null-terminated array of strings that make up the XPM data. yes, an array of strings, not one big blob. she's structured π
π RETURN VALUE π
returns a shiny new SDL_Surface, or NULL on error. if you get NULL, that's your sign to go check what went wrong π
β AVAILABILITY β
this function has been serving since SDL_image 3.0.0. she's not new, she's just been quietly slaying π
π SEE ALSO π
IMG_ReadXPMFromArray(3)β the 8-bit indexed colors sister function, go say hi π
and that's the whole page, bestie! source: SDL_image, version SDL_image 3.4.4 πβ¨ go forth and load those XPMs, you've got this π«ΆπΈ
π¦ where this page comes from
- ubuntu stonking: libsdl3-image-doc 3.4.4+ds-2 Β· zlib/libpng AND HPND-like AND zlib-like-permissive
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms