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 β€” the SDL_Colorspace you 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