IMG_isANI(3)

πŸ“¦
version 3.4.8 Β· 5 versions
, in fedora 43, fedora 44

πŸ’… 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/readable SDL_IOStream that'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:


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