sdlMasksToPixelFormatEnum function

int sdlMasksToPixelFormatEnum(
  1. int bpp,
  2. int rmask,
  3. int gmask,
  4. int bmask,
  5. int amask,
)

Convert a bpp value and RGBA masks to an enumerated pixel format.

This will return SDL_PIXELFORMAT_UNKNOWN if the conversion wasn't possible.

\param bpp a bits per pixel value; usually 15, 16, or 32 \param Rmask the red mask for the format \param Gmask the green mask for the format \param Bmask the blue mask for the format \param Amask the alpha mask for the format \returns one of the SDL_PixelFormatEnum values

\since This function is available since SDL 2.0.0.

\sa SDL_PixelFormatEnumToMasks

extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)

Implementation

int sdlMasksToPixelFormatEnum(
    int bpp, int rmask, int gmask, int bmask, int amask) {
  final sdlMasksToPixelFormatEnumLookupFunction = libSdl2.lookupFunction<
      Uint32 Function(
          Int32 bpp, Uint32 rmask, Uint32 gmask, Uint32 bmask, Uint32 amask),
      int Function(int bpp, int rmask, int gmask, int bmask,
          int amask)>('SDL_MasksToPixelFormatEnum');
  return sdlMasksToPixelFormatEnumLookupFunction(
      bpp, rmask, gmask, bmask, amask);
}