IMG_isAVIF(3)

πŸ’… IMG_isAVIF(3) β€” the AVIF vibe check πŸ’…

okay so welcome to the IMG_isAVIF(3) page from the SDL_image3 FUNCTIONS manual, bestie. This is the function that checks whether some image data is AVIF before you commit. No cap. πŸ’–


🌸 NAME 🌸

IMG_isAVIF β€” detect AVIF image data on a readable/seekable SDL_IOStream. That's the whole assignment. ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3_image/SDL_image.h>

bool IMG_isAVIF(SDL_IOStream *src);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so here's the tea: this function tries to figure out whether a file is a given filetype, and it reads the least amount possible from the SDL_IOStream β€” usually just a few bytes. Tiny little sniff, queen behavior. πŸ’…

There is no distinction made between "not the filetype in question" and basic i/o errors. So if it says nope, it might be a different filetype or something went sideways with i/o β€” the function is not here to spill which one. 😭

This function will always attempt to seek src back to where it started when this function was called, but it will not report any errors in doing so. Assuming seeking works, this means you can immediately use this with a different IMG_isTYPE function, or load the image without further seeking. Convenient? Iconic. ✨

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 this is a vibe check, not a mandatory step. 🫢

⭐ FUNCTION PARAMETERS ⭐

  • src β€” a seekable/readable SDL_IOStream to provide image data. That's the source stream, bestie, and it needs to be both seekable and readable. πŸ’–

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns true if this is AVIF data, false otherwise. Literally a yes/no situation. ✨

🌈 AVAILABILITY 🌈

This function is available since SDL_image 3.0.0. Periodt. πŸ‘‘

πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie. This one comes from the SDL_image 3.4.4 docs; the footer didn't list a date, so I'm not inventing one β€” mwah πŸ’‹

πŸ“¦ where this page comes from