IMG_isANI(3)
π IMG_isANI(3) β the SDL_image3 glow-up
okay bestie, gather round π«Ά this one lives in the SDL_image3 FUNCTIONS section of the manual, and it's honestly such a chill little function. Its whole job? Detect ANI animated cursor data on a readable/seekable SDL_IOStream. That's it. That's the gig. π
β¨ NAME β¨
IMG_isANI β sniffs out whether your SDL_IOStream is giving ANI animated cursor energy, and it needs the stream to be readable and seekable to do it. π¦
πΈ SYNOPSIS πΈ
#include <SDL3_image/SDL_image.h>
bool IMG_isANI(SDL_IOStream *src);
π DESCRIPTION π
So here's the tea, bestie. This function tries to figure out if a file is a given filetype, and it does it by reading the least amount possible from the SDL_IOStream β usually just a few bytes. lowkey efficient, highkey iconic. β¨
And here's a thing you gotta know: there is no distinction made between "not the filetype in question" and basic i/o errors. Like, it's not gonna sit you down and explain which one happened. It just... doesn't. π
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 the sneaky bit β it will not report any errors in doing so. So assuming seeking actually works, that means you can immediately use this with a different IMG_isTYPE function, or load the image without any further seeking. no extra steps, we love a clean handoff. π
Also real talk: 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 like, it's a vibe-check tool, not a mandatory step. π
π FUNCTION PARAMETERS π
srcβ a seekable/readableSDL_IOStreamthat's gonna hand over the image data.
π¦ RETURN VALUE π¦
Returns true if this is ANI animated cursor data, false otherwise. Binary queen. periodt. π
β AVAILABILITY β
This function has been available since SDL_image 3.0.0. she's been here a minute and she's not leaving. π
π₯ SEE ALSO π₯
the whole friend group, fr fr:
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)IMG_isXV(3)
and that's the whole page bestie, we ate and left no crumbs π this was brought to you by SDL_image, version 3.4.8 β mwah, take care of her ππ§
π¦ where this page comes from
- fedora 43: SDL3_image-devel 3.4.8-1.fc43 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- fedora 43: SDL3_image-devel 3.4.8-1.fc43 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- fedora 44: SDL3_image-devel 3.4.8-1.fc44 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- fedora 44: SDL3_image-devel 3.4.8-1.fc44 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms