IMG_isPNM(3)

NAME πŸ’…

okay bestie, this is IMG_isPNM(3) from the SDL_image3 FUNCTIONS manual β€” the little function that detects PNM image data on a readable/seekable SDL_IOStream. πŸ•΅οΈβ€β™€οΈβœ¨

SYNOPSIS 🌸

#include <SDL3_image/SDL_image.h>

bool IMG_isPNM(SDL_IOStream *src);

DESCRIPTION πŸ¦‹

so this function attempts to determine if a file is a given filetype, and it reads the least amount possible from the SDL_IOStream β€” usually just a few bytes. lowkey efficient, highkey iconic. πŸ’…

It does not make any distinction between β€œnot the filetype in question” and basic i/o errors. no cap, that means a no can be either one. 😭

This function will always attempt to seek src back to where it started when this function was called, but it will not report any errors in doing so. assuming seeking works, this means you can immediately use this with a different IMG_isTYPE function, or load the image without further seeking. slay. 🫢

You do not need to call this function to load data; SDL_image can work to determine file type in many cases in its standard load functions. so this is a vibe check, not a mandatory step. πŸ’–

FUNCTION PARAMETERS πŸŽ€

  • src β€” a seekable/readable SDL_IOStream to provide image data. that's the whole mood. ✨

RETURN VALUE 🌸

Returns true if this is PNM data, false otherwise. simple as that, bestie. πŸ’…

AVAILABILITY 🌈

This function is available since SDL_image 3.0.0. periodt. πŸ‘‘

SEE ALSO πŸ’œ


xoxo, your local manpage bestie πŸ’– β€” footer tea: source/version SDL_image 3.4.4, page IMG_isPNM(3), and no date listed on this copy, bestie. 🫢

πŸ“¦ where this page comes from