IMG_SaveAVIF_IO(3)

okay so welcome to IMG_SaveAVIF_IO(3), bestie β€” this is the SDL_image3 FUNCTIONS manual, and today’s main character is saving an SDL_Surface into AVIF image data via an SDL_IOStream ✨

🌸 NAME 🌸

IMG_SaveAVIF_IO β€” save an SDL_Surface into AVIF image data, via an SDL_IOStream. That’s the whole vibe πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3_image/SDL_image.h>

bool IMG_SaveAVIF_IO(SDL_Surface *surface, SDL_IOStream *dst, bool closeio, int quality);

πŸ¦‹ DESCRIPTION πŸ¦‹

If your whole goal is β€œsave to a filename,” bestie, skip this one and use IMG_SaveAVIF() instead. This function is the SDL_IOStream route, iykyk.

⚠️ okay but listen: if closeio is true, then dst will be closed before returning β€” whether this function succeeds or not. It’s giving cleanup on aisle every outcome πŸ’€

πŸ“ FUNCTION PARAMETERS πŸ“

  • surface β€” the SDL_Surface you want to save. The actual art, the moment, the material πŸ’–
  • dst β€” the SDL_IOStream where the image data gets saved. This is the destination bestie.
  • closeio β€” true means close/free the SDL_IOStream before returning; false means leave it open. Choose wisely, no cap.
  • quality β€” the desired quality, ranging between 0 (lowest) and 100 (highest). Lowkey 0 is rough, highkey 100 is the slay end of the scale ✨

🌈 RETURN VALUE 🌈

Returns true on success or false on failure; call SDL_GetError() for more information. So if it’s giving failure, go ask SDL_GetError() what happened 🫢

⭐ AVAILABILITY ⭐

This function is available since SDL_image 3.0.0. Iconic, honestly.

πŸ‘‘ SEE ALSO πŸ‘‘

  • IMG_SaveAVIF(3) β€” the filename-saving sibling, if that’s more your speed πŸ’œ

signed off with πŸ’– from the footer: source/version is SDL_image 3.4.4, and the date isn’t listed on this page, so we’re not inventing one β€” periodt πŸŽ€

πŸ“¦ where this page comes from