IMG_LoadAPNGAnimation_IO(3)
π IMG_LoadAPNGAnimation_IO π
okay bestie, welcome to the SDL_image3 corner of the manual, where we're about to talk about IMG_LoadAPNGAnimation_IO β yes that's a whole mouthful, and yes it's iconic. this one's all about pulling an APNG animation straight out of an SDL_IOStream. let's go π¦
β¨ SYNOPSIS β¨
#include <SDL3_image/SDL_image.h>
IMG_Animation* IMG_LoadAPNGAnimation_IO(SDL_IOStream *src);
like, that's it. one include, one function, one pointer to an SDL_IOStream. slay π
πΈ DESCRIPTION πΈ
so here's the tea: if you already know β like, you are 100% certain, no doubt in your heart β that what you're holding is an APNG image, you can just call this function. it'll skip all of SDL_image's file format detection routines, because why make it guess when you already know the answer? main character energy fr fr β¨
that saidβ¦ generally it's better to use the abstract interfaces, okay? this is the shortcut, not the vibe. also worth noting: there's only an SDL_IOStream interface available here. that's the whole menu, no other options. π
and the most important thing β the way that you must clean up after yourself β when you're done with the returned animation, the app should dispose of it with a call to IMG_FreeAnimation(). do not leave that animation just sitting there. free your girl. π«Ά
not me reminding you again: IMG_FreeAnimation() when you're done. memory doesn't free itself, bestie. π
π§ FUNCTION PARAMETERS π§
srcβ anSDL_IOStreamfrom which data will be read. that's where the APNG bytes come from, that's the whole source of truth. π
β RETURN VALUE β
returns a brand new IMG_Animation (yes, a whole new one, fresh out the box π), or NULL on error. and if you get NULL, that's your sign that something went wrong β go check on it. π
π AVAILABILITY π
this function has been available since SDL_image 3.4.0. so if you're on anything older, it's giving "not yet, babe" β you're gonna need to upgrade. π
π SEE ALSO π
the whole friend group, obviously:
IMG_isPNG(3)IMG_LoadAnimation(3)IMG_LoadAnimation_IO(3)IMG_LoadAnimationTyped_IO(3)IMG_LoadANIAnimation_IO(3)IMG_LoadAVIFAnimation_IO(3)IMG_LoadGIFAnimation_IO(3)IMG_LoadWEBPAnimation_IO(3)IMG_FreeAnimation(3)
okay that's the whole page, no cap. this was SDL_image, version 3.4.8, brought to you by the SDL_image girlies, and IMG_LoadAPNGAnimation_IO(3) is out here living her best life. go forth, load that APNG, free that animation. periodt. π
β¨π
π¦ 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