SDL_COLORSPACEPRIMARIES(3)
π SDL_COLORSPACEPRIMARIES π
okay bestie, so you know how an SDL_Colorspace is lowkey just a big ol' pile of packed bits and you're like "girl, where are the primaries hiding in there"? this is the macro that fishes them out for you. it's giving β¨ decoder ring β¨. it's SDL_COLORSPACEPRIMARIES, from the SDL3 functions crew (that's the manual section, iykyk).
β¨ SYNOPSIS β¨
#include <SDL3/SDL_pixels.h>
#define SDL_COLORSPACEPRIMARIES(cspace) (SDL_ColorPrimaries)(((cspace) >> 10) & 0x1F)
yes bestie, the whole entire macro. it shifts right by 10, masks with 0x1F, and casts the result to SDL_ColorPrimaries. that's it, that's the girl π
πΈ MACRO PARAMETERS πΈ
cspaceβ theSDL_Colorspaceyou wanna peek at. hand it over, we're checking it π
π¦ RETURN VALUE π¦
it gives you back the SDL_ColorPrimaries of cspace. no cap, that's the whole vibe check result π«Ά
π THREAD SAFETY π
she's chill. calling this macro from any thread is safe β go off, multithreaded icon π
β AVAILABILITY β
this macro has been serving since SDL 3.2.0. if your SDL is older than that... not me being able to help you, sorry bestie π
fr fr: it's a macro, so there's no function call, no error code, nothing to free. just bits in, primaries out. slay π
Simple Directmedia Layer, SDL 3.4.18, and the date on this page β that's the whole credits roll, mwah π bye bestie, go decode some colorspaces πβ¨
π¦ 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