IMG_CREATEANIMATIONDECODER_IO(3)

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

πŸ’– IMG_CreateAnimationDecoder_IO(3) πŸ’–

okay so bestie, welcome to the SDL_image3 girlies' corner of the manual pages ✨ this one lives in the FUNCTIONS section and it's literally the glow-up your image-loading era has been waiting for.


🌸 NAME 🌸

IMG_CreateAnimationDecoder_IO β€” she builds you a decoder that reads a whole series of images (a.k.a. an animation, a.k.a. the moment it all pops off) straight out of an IOStream. πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3_image/SDL_image.h>

IMG_AnimationDecoder * IMG_CreateAnimationDecoder_IO(SDL_IOStream *src, bool closeio, const char *type);

no cap, that's the whole signature. one call. iconic. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

here's the tea: this function hands you back a decoder, and that decoder is obsessed with reading a whole series of images from an IOStream. like, all the frames. the full main character arc. 🌈

these animation types are currently supported (the VIP list, the guest list, the whole thing):

  • ANI
  • APNG
  • AVIFS
  • GIF
  • WEBP

now, about closeio, because this part lowkey matters a lot:

if closeio is true, then src will be closed before returning if this function fails β€” or it'll be closed when the animation decoder is closed, if this function succeeds. either way, true means you're handing over the keys and she's locking up when she leaves. πŸ—οΈ

🫢 FUNCTION PARAMETERS 🫢

  • src β€” an SDL_IOStream holding a series of images. that's the source material, the raw footage, the content. πŸ“Ό
  • closeio β€” true to close the SDL_IOStream when done, false to leave it open. your call, bestie, but you do have to make one.
  • type β€” a filename extension that represents this data ("WEBP", etc). yes it's a string, yes you write it like that. πŸ’«

⭐ RETURN VALUE ⭐

returns a brand new IMG_AnimationDecoder on success β€” slay β€” or NULL on failure. 😭

if you get NULL, do not just sit there wondering what went wrong: call SDL_GetError() for more information. she will tell you. fr fr.


πŸ‘‘ AVAILABILITY πŸ‘‘

this function is available since SDL_image 3.4.0. so if you're on something older, it's giving not yet, sorry babe. πŸ’€


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, obviously:


and that's the page, bestie!! πŸŽ€ this was SDL_image documentation, version SDL_image 3.4.8, and yes the header says IMG_CreateA...onDecoder_IO(3) because even manpage titles get truncated for the aesthetic. πŸ’– mwah, go decode something gorgeous. πŸ¦‹βœ¨

πŸ“¦ where this page comes from