IMG_isXV(3)

πŸ’… IMG_isXV(3) β€” the vibe check for XV files ✨

ok so like, hi bestie 🫢 you're in the SDL_image3 FUNCTIONS part of the manual, and this little icon right here is IMG_isXV β€” she's the one who peek-slaps a stream and goes "hmm, is this XV data or not?" πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3_image/SDL_image.h>

bool IMG_isXV(SDL_IOStream *src);

🌸 DESCRIPTION 🌸

Okay so here's the tea β˜• β€” this function tries to figure out if a file is a given filetype, and it does it by reading the absolute least amount possible from the SDL_IOStream (usually like, a few bytes, that's it, she's efficient πŸ’…).

And here's a thing you need to know, no cap: there is no distinction made between "not the filetype in question" and basic i/o errors. 😭 Like, she's not gonna tell you which one it was. Both just come back as a no.

Now the good part 🫢 β€” this function will always attempt to seek src back to where it started when the function was called. But (and this is important, bestie) it will not report any errors in doing so. So assuming seeking actually works, that means you can immediately use it with a different IMG_isTYPE function, or load the image without any further seeking. main character energy, honestly πŸ‘‘

Also, lowkey the biggest one: you do not need to call this function to load data. SDL_image can work to determine file type in many cases in its standard load functions. So she's here if you want her, not because you're obligated πŸ’–


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • src β€” a seekable/readable SDL_IOStream to provide image data.

⭐ RETURN VALUE ⭐

Returns true if this is XV data, false otherwise. That's it, that's the whole answer ✨


πŸŽ€ AVAILABILITY πŸŽ€

This function is available since SDL_image 3.0.0 β€” she's been iconic since day one, periodt.


🌈 SEE ALSO 🌈

the whole is-squad, fr fr β€” go check them out:


ngl the one thing to remember: she reads a few bytes, she puts the stream back where she found it, and she does not snitch about i/o errors. πŸ’€ that's the whole vibe.

ok bye bestie, go detect some XV files πŸ’œ this page came to you from SDL_image 3.4.4 β€” mwah πŸ“

πŸ“¦ where this page comes from