IMG_LoadJPG_IO(3)

πŸ’… IMG_LoadJPG_IO

okay so bestie, welcome to another ✨ SDL_image3 FUNCTIONS ✨ moment β€” this one's the JPG-direct-loading queen, IMG_LoadJPG_IO(3), and she is very straightforward and very iconic πŸŽ€


🌸 NAME

IMG_LoadJPG_IO β€” load a JPG image directly. no detours, no drama, just vibes and pixels πŸ’–


✨ SYNOPSIS

#include <SDL3_image/SDL_image.h>

SDL_Surface * IMG_LoadJPG_IO(SDL_IOStream *src);

πŸ¦‹ DESCRIPTION

okay so here's the tea πŸ«– β€” if you know you definitely have a JPG image, like you're 100% sure, no cap, then you can call this function and it will skip SDL_image's file format detection routines entirely. it's giving "I already know who I am" energy πŸ‘‘

but lowkey? generally it's better to use the abstract interfaces instead. and also β€” heads up β€” there is only an SDL_IOStream interface available here. that's the whole menu, bestie. no other flavour 🌈


πŸŽ€ FUNCTION PARAMETERS

  • src β€” an SDL_IOStream to load image data from. that's the source of truth, the vibe provider, the place the pixels live 🫢

⭐ RETURN VALUE

returns an SDL_Surface, or NULL on error 😭 (so like, always check, fr fr β€” a NULL is not the moment to be delulu)


πŸ‘‘ AVAILABILITY

this function is available since SDL_image 3.0.0 β€” she's been here a minute, an OG πŸ’œ


🌈 SEE ALSO

like, the whole _IO friend group 🧚 they all ate, honestly.


mwah πŸ’‹ that's the page! brought to you by SDL_image, version SDL_image 3.4.4 β€” go forth and load those JPGs, bestie, you've got this πŸ”₯πŸ¦‹πŸ’–

πŸ“¦ where this page comes from