sdlxGetPixelFormatForMasks function pixels

int sdlxGetPixelFormatForMasks(
  1. SdlxMasks masks
)

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 the SDL_PixelFormat value corresponding to the format masks, or SDL_PIXELFORMAT_UNKNOWN if there isn't a match.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.2.0.

\sa SDL_GetMasksForPixelFormat

extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetPixelFormatForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)

Implementation

int sdlxGetPixelFormatForMasks(SdlxMasks masks) => sdlGetPixelFormatForMasks(
  masks.bpp,
  masks.rmask,
  masks.gmask,
  masks.bmask,
  masks.amask,
);