IMG_SaveAnimationTyped_IO(3)

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

πŸ’– IMG_SaveAnimationTyped_IO(3) πŸ’–

okay so bestie, you're in the SDL_image3 FUNCTIONS section of the SDL_image manual, and today's main character is IMG_SaveAnimationTyped_IO. it saves an animation to an SDL_IOStream and honestly? she ate. ✨


🌸 NAME 🌸

IMG_SaveAnimationTyped_IO β€” save an animation to an SDL_IOStream. no cap, that's literally the whole job. πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3_image/SDL_image.h>

bool IMG_SaveAnimationTyped_IO(IMG_Animation *anim, SDL_IOStream *dst, bool closeio, const char *type);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so first things first: if you just wanna save to a filename, you can use IMG_SaveAnimation() instead. that one's your girl for the simple path. this function is the one you call when you're working with an SDL_IOStream directly. πŸ’…

now, about closeio: if it's true, then dst gets closed before returning β€” and yes, that's whether this function succeeds or not. it does not care. it does not wait. it closes. periodt. 😭

and for formats that accept a quality value, a default quality of 90 will be used. so if you were wondering "hmm what quality do I get if I don't say anything" β€” it's 90. mystery solved. πŸ•΅οΈβ™€οΈ


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • anim β€” the animation to save. your blorbos, your moving pictures, your whole vibe. 🫢
  • dst β€” an SDL_IOStream that data will be written to. this is where the magic goes. ✨
  • closeio β€” true to close/free the SDL_IOStream before returning, false to leave it open. you're the one holding the door, so choose wisely. πŸšͺ
  • type β€” a filename extension that represent this data ("GIF", etc). yes, just the extension, like "GIF". not a whole path, not a whole mime type, just the lil extension bestie. πŸ“

🌈 RETURN VALUE 🌈

returns true on success or false on failure. and if it fails, please, please call SDL_GetError() for more information β€” she will tell you what went wrong, and it's giving helpful. πŸ’œ


⭐ AVAILABILITY ⭐

this function is available since SDL_image 3.4.0. so if you're on anything older, it's not there and you're gonna have a bad time. πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie!! πŸ₯³ this was SDL_image version 3.4.8 serving you IMG_SaveAnimationTyped_IO(3) realness. go save some animations, slay responsibly, and remember: false means check SDL_GetError(). mwah πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from