IMG_LoadWEBP_IO(3)

πŸ’… IMG_LoadWEBP_IO(3) β€” the SDL_image3 functions girlies

okay so bestie, quick vibe check: you're in the SDL_image3 functions section of the manual, and today's main character is IMG_LoadWEBP_IO πŸŽ€


✨ NAME ✨

IMG_LoadWEBP_IO β€” load a WEBP image directly, no detective work needed πŸ•΅οΈβ€β™€οΈπŸ’–


✨ SYNOPSIS ✨

#include <SDL3_image/SDL_image.h>

SDL_Surface * IMG_LoadWEBP_IO(SDL_IOStream *src);

✨ DESCRIPTION ✨

so like, if you already know you definitely have a WEBP image β€” no doubts, no second-guessing, she's confident β€” you can call this function, and it will skip SDL_image's file format detection routines. literally just straight in, no sniffing around πŸ”₯

generally it's better to use the abstract interfaces, ngl. also (and this is the tea β˜•) there is only an SDL_IOStream interface available here β€” that's the whole menu, that's the only flavor.


✨ FUNCTION PARAMETERS ✨

  • src β€” an SDL_IOStream to load image data from 🫢 that's the snack source, the place the bytes live.

✨ RETURN VALUE ✨

returns an SDL_Surface, or NULL on error 😭 if you get NULL, something went wrong β€” check it, don't just vibe past it.


✨ AVAILABILITY ✨

this function is available since SDL_image 3.0.0 β€” she's been iconic from the start, periodt πŸ‘‘


✨ SEE ALSO ✨

the whole friend group, fr fr β€” every single one of these is invited to the group chat:


aaaand that's the page!! πŸ’…βœ¨ this absolute banger comes to you courtesy of SDL_image, version SDL_image 3.4.4 β€” go load some WEBPs, bestie, you got this πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from