SDL Wiki
(This function is part of SDL_image, a separate library from SDL.)

IMG_isBMP

Detect BMP image data on a readable/seekable SDL_RWops.

Header File

Defined in <SDL_image.h>

Syntax

int IMG_isBMP(SDL_RWops *src);

Function Parameters

SDL_RWops * src a seekable/readable SDL_RWops to provide image data.

Return Value

(int) Returns non-zero if this is BMP data, zero otherwise.

Remarks

This function attempts to determine if a file is a given filetype, reading the least amount possible from the SDL_RWops (usually a few bytes).

There is no distinction made between "not the filetype in question" and basic i/o errors.

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

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.

Version

This function is available since SDL_image 2.0.0.

See Also


CategoryAPI, CategoryAPIFunction


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.