imgIsLbm function

int imgIsLbm(
  1. Pointer<SdlRWops> src
)

Detect LBM image data on a readable/seekable SDL_RWops.

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.

\param src a seekable/readable SDL_RWops to provide image data. \returns non-zero if this is LBM data, zero otherwise.

\since This function is available since SDL_image 2.0.0.

\sa IMG_isAVIF \sa IMG_isICO \sa IMG_isCUR \sa IMG_isBMP \sa IMG_isGIF \sa IMG_isJPG \sa IMG_isJXL \sa IMG_isPCX \sa IMG_isPNG \sa IMG_isPNM \sa IMG_isSVG \sa IMG_isQOI \sa IMG_isTIF \sa IMG_isXCF \sa IMG_isXPM \sa IMG_isXV \sa IMG_isWEBP

extern DECLSPEC int SDLCALL IMG_isLBM(SDL_RWops *src)

Implementation

int imgIsLbm(Pointer<SdlRWops> src) {
  final imgIsLbmLookupFunction = libSdl2Image.lookupFunction<
      Int32 Function(Pointer<SdlRWops> src),
      int Function(Pointer<SdlRWops> src)>('IMG_isLBM');
  return imgIsLbmLookupFunction(src);
}