SDL_GetMasksForPixelFormat(3)
π SDL_GetMasksForPixelFormat π
okay bestie, welcome to the SDL_GetMasksForPixelFormat(3) page β yes it lives in the SDL3 FUNCTIONS crew, and yes it's about pixels, which means it's automatically iconic. π
β¨ NAME β¨
SDL_GetMasksForPixelFormat β converts one of the enumerated pixel formats into a bpp value plus RGBA masks. that's the whole job. she's a translator. a pixel-format-to-masks translator. slay. π
π SYNOPSIS π
#include <SDL3/SDL_pixels.h>
bool SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask);
look at her. six whole parameters. main character energy fr fr. π
π«Ά FUNCTION PARAMETERS π«Ά
formatβ one of theSDL_PixelFormatvalues. just hand her the format you're curious about and she'll spill everything.bppβ a bits-per-pixel value; usually15,16, or32. lowkey those three are the usual suspects.Rmaskβ a pointer that gets filled in with the red mask for the format. π΄Gmaskβ a pointer that gets filled in with the green mask for the format. π’Bmaskβ a pointer that gets filled in with the blue mask for the format. π΅Amaskβ a pointer that gets filled in with the alpha mask for the format. the transparency one. the vibe one. π«₯
bestie these are pointers, so she's writing into them. don't pass her something uninitialized and then act surprised, i'm begging. π
π RETURN VALUE π
Returns true on success or false on failure. and if it fails?? call SDL_GetError() for more information, because she will NOT be explaining herself unprompted. π
π§ THREAD SAFETY π§
It is safe to call this function from any thread. yes, any thread. she does not gatekeep, she does not play favourites, she is safe everywhere. periodt. π
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something older, no masks for you, sorry babe. π
πΈ SEE ALSO πΈ
SDL_GetPixelFormatForMasks(3)β the reverse direction, the uno reverse card, the "okay but what format do these masks make" question. iykyk. π¦
and that's the page!! this lil writeup came to you from Simple Directmedia Layer, version SDL 3.4.18, and it's literally the SDL_GetMasksForPixelFormat(3) manpage but make it cute. go forth and mask responsibly, bestie πβ¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms