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/readableSDL_IOStreamto 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:
IMG_isANI(3)IMG_isAVIF(3)IMG_isBMP(3)IMG_isCUR(3)IMG_isGIF(3)IMG_isICO(3)IMG_isJPG(3)IMG_isJXL(3)IMG_isLBM(3)IMG_isPCX(3)IMG_isPNG(3)IMG_isPNM(3)IMG_isQOI(3)IMG_isSVG(3)IMG_isTIF(3)IMG_isWEBP(3)IMG_isXCF(3)IMG_isXPM(3)
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
- 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