IMG_SaveWEBPAnimation_IO(3)

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

πŸ’– IMG_SaveWEBPAnimation_IO(3) πŸ’–

okay so bestie, welcome to the SDL_image3 FUNCTIONS section of the manual, and today's main character is IMG_SaveWEBPAnimation_IO. she's the one who takes your whole animation and drops it into a WEBP file, through an SDL_IOStream. no cap. πŸŽ€


✨ NAME ✨

IMG_SaveWEBPAnimation_IO β€” save an animation in WEBP format to an SDL_IOStream. literally that's her whole job and she ate. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3_image/SDL_image.h>

bool IMG_SaveWEBPAnimation_IO(IMG_Animation *anim, SDL_IOStream *dst, bool closeio, int quality);

🫢 DESCRIPTION 🫢

so here's the tea, and it's actually important tea: if closeio is true, then dst is gonna get closed before the function returns. and not like "only if it worked" β€” whether this function succeeds or not. it's closing either way. so don't be out here planning to keep using dst afterwards, okay? πŸ’…


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • anim β€” the animation you wanna save. your lil masterpiece. your baby. πŸ‘‘
  • dst β€” an SDL_IOStream from which data will be written to. (yes bestie, the manpage really does say "from which data will be written to" β€” she's a little quirky like that, we love her anyway πŸ™ˆ)
  • closeio β€” true means close/free the SDL_IOStream before returning, false means leave it open. pick wisely, this one has consequences. 😭
  • quality β€” a number between 0 and 100. and she means two different things depending on your vibe:
    • for lossy: 0 gives the smallest size, 100 gives the largest. ✨
    • for lossless: this parameter is the amount of effort put into the compression. 0 is the fastest but gives larger files, compared to the slowest, but best, 100. so like... speed vs. quality, the eternal struggle. ⭐

πŸ”₯ RETURN VALUE πŸ”₯

returns true on success or false on failure. and if it fails? call SDL_GetError() for more information, because she will not be explaining herself unprompted. πŸ’€


🌈 AVAILABILITY 🌈

this function is available since SDL_image 3.4.0. so if you're on something older, it's giving "not yet, babe". 🧚


πŸ‘‘ SEE ALSO πŸ‘‘

the whole save-animation friend group, fr fr. go say hi. πŸ“


and that's the page!! mwah πŸ’– this was brought to you by SDL_image version 3.4.8, straight from the SDL_image corner of the world β€” go forth and save your animations, bestie, you've got this. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from