IMG_LoadPNM_IO(3)

πŸ¦‹ IMG_LoadPNM_IO(3) β€” a page from the SDL_image3 FUNCTIONS manual πŸ¦‹

πŸŽ€ NAME πŸŽ€

IMG_LoadPNM_IO β€” load a PNM image directly. That’s the headline, bestie, and it is serving exactly what it says on the tin. ✨

🌸 SYNOPSIS 🌸

#include <SDL3_image/SDL_image.h>

SDL_Surface * IMG_LoadPNM_IO(SDL_IOStream *src);

πŸ’– DESCRIPTION πŸ’–

Okay so picture this: you already know, like, for sure that the image you have is a PNM image. In that case you can call IMG_LoadPNM_IO, and it will skip SDL_image’s file format detection routines. Shortcut era ⚑

Generally, though, it’s better to use the abstract interfaces. Also important: there is only an SDL_IOStream interface available here β€” that’s the whole interface menu, no cap. πŸ’…

🫢 FUNCTION PARAMETERS 🫢

  • src β€” an SDL_IOStream to load image data from. That’s the plug, bestie. 🫢

😭 RETURN VALUE 😭

Returns a SDL surface, or NULL on error. So if it comes back NULL, that’s the error timeline, not a vibe. πŸ’€

πŸ‘‘ AVAILABILITY πŸ‘‘

This function is available since SDL_image 3.0.0. Iconic behavior, honestly. πŸ‘‘

πŸ‘€ SEE ALSO πŸ‘€

These are the other format-specific besties β€” go say hi: 🌈


πŸŽ€ cute little sign-off: this page’s source is the SDL_image manual, its version is SDL_image 3.4.4, and the footer didn’t give a date β€” so I’m not inventing one, bestie. Stay slay out there! 🫢🌈

πŸ“¦ where this page comes from