SDL_COLORSPACERANGE(3)

SDL_COLORSPACERANGE πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, we're talking about SDL_COLORSPACERANGE today and it's genuinely such a lil cutie πŸŽ€


✨ NAME ✨

SDL_COLORSPACERANGE β€” a macro to retrieve the range of an SDL_Colorspace. that's it. that's the whole job. she's a one-trick pony and she ATE πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_pixels.h>

#define SDL_COLORSPACERANGE(cspace)      (SDL_ColorRange)(((cspace) >> 24) & 0x0F)

like look at her. shifting right by 24 and masking with 0x0F. bits getting rearranged like it's nothing πŸ¦‹ iconic behavior fr fr


✨ MACRO PARAMETERS ✨

  • cspace β€” an SDL_Colorspace to check. that's the one you're interrogating. hand her over and she'll tell you what range she's in 🫢

✨ RETURN VALUE ✨

Returns the SDL_ColorRange of cspace. no drama, no surprises, just the range. periodt πŸ‘‘


✨ THREAD SAFETY ✨

It is safe to call this macro from any thread. like literally any thread, no cap, go wild, she does not care 🌈


✨ AVAILABILITY ✨

This macro is available since SDL 3.2.0. so if you're on something older than that... bestie. upgrade. 😭


mwah πŸ’‹ that's the whole page. this one came from the Simple Directmedia Layer girlies, it's SDL 3.4.18 era, and it's documented right there in the SDL3 FUNCTIONS chapter β€” go forth and extract those ranges, you've got this πŸ§šπŸ’œ

πŸ“¦ where this page comes from