SDL_ISCOLORSPACE_LIMITED_RANGE(3)

πŸ’– SDL_ISCOLORSPACE_LIMITED_RANGE πŸ’–

okay bestie, so this one is from the SDL3 function pages, and it's literally the tiniest little macro with the biggest "am I in range or not" energy. It's a macro that tells you whether an SDL_Colorspace has a limited range. That's it. That's the whole job. And it eats. πŸ‘‘


✨ NAME ✨

SDL_ISCOLORSPACE_LIMITED_RANGE β€” a macro to determine if an SDL_Colorspace has a limited range. no cap, that's literally what it does πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_pixels.h>

#define SDL_ISCOLORSPACE_LIMITED_RANGE(cspace)       (SDL_COLORSPACERANGE(cspace) != SDL_COLOR_RANGE_FULL)

like look at her. one line. flawless. the way that she just compares SDL_COLORSPACERANGE(cspace) against SDL_COLOR_RANGE_FULL and calls it a day?? iconic behavior fr fr πŸ’…


πŸ¦‹ MACRO PARAMETERS πŸ¦‹

  • cspace β€” an SDL_Colorspace to check. that's the one and only thing you're handing over, bestie 🫢

πŸ’œ RETURN VALUE πŸ’œ

Returns true if limited range, false otherwise.

so basically: limited range β†’ true, not limited range β†’ false. she's a yes/no girlie and she knows it πŸ’–

🧚 THREAD SAFETY 🧚

It is safe to call this macro from any thread. 🌈

not me being able to hit this from literally any thread with zero anxiety?? we LOVE a thread-safe macro. no locking, no drama, no tears 😭✨

πŸ‘‘ AVAILABILITY πŸ‘‘

This macro is available since SDL 3.2.0. ⭐

so if you're on anything older than that, she simply does not exist for you yet. sorry bestie πŸ’€


anyway that's the whole page, short and sweet like a lil macaron πŸ“ This little legend comes to you courtesy of Simple Directmedia Layer, rocking the SDL 3.4.18 era of the manual β€” k bye, go check your color ranges, mwah πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from