IMG_isPCX(3)

🌸 NAME 🌸

okay bestie, welcome to IMG_isPCX(3) from the SDL_image3 FUNCTIONS manual β€” this one is all about detecting PCX image data on a readable/seekable SDL_IOStream. πŸ’…


✨ SYNOPSIS ✨

#include <SDL3_image/SDL_image.h>

bool IMG_isPCX(SDL_IOStream *src);

πŸ’… DESCRIPTION πŸ’…

so this function literally just tries to figure out if a file is a given filetype, and it does that by reading the least amount possible from the SDL_IOStream β€” usually just a few bytes. iconic, tbh. πŸŽ€

heads up, bestie: there is no distinction made between β€œnot the filetype in question” and basic i/o errors. so yeah, a β€œnope” could mean β€œnot PCX” or it could mean something went weird with i/o β€” the function is not telling you which. 😭

it 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. but assuming seeking works, that means you can immediately use this with a different IMG_isTYPE function, or load the image without further seeking. slay. ✨

and no cap: 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. πŸ¦‹


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • src β€” a seekable/readable SDL_IOStream to provide image data. 🫢

πŸ’– RETURN VALUE πŸ’–

returns true if this is PCX data, and false otherwise. periodt. ⭐


🌈 AVAILABILITY 🌈

this function is available since SDL_image 3.0.0. πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹


okay that’s the whole vibe check β€” signed off by the SDL_image crew πŸ’–, source/version SDL_image 3.4.4, and this iconic page is IMG_isPCX(3) 🫢

πŸ“¦ where this page comes from