SDL_ISPIXELFORMAT_10BIT(3)

πŸ’… SDL_ISPIXELFORMAT_10BIT β€” a macro to determine if an SDL_PixelFormat is a 10-bit format

okay bestie, welcome to the SDL3 functions corner of the manual, where we check whether a pixel format is serving 10-bit realness or not. this one lives in SDL_pixels.h and it's a macro, so buckle up πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3/SDL_pixels.h>

#define SDL_ISPIXELFORMAT_10BIT(format)    \
      (!SDL_ISPIXELFORMAT_FOURCC(format) && \
       ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32) && \
        (SDL_PIXELLAYOUT(format) == SDL_PACKEDLAYOUT_2101010)))

like, look at her. she's giving very much "check three things and return a bool" energy and honestly? obsessed πŸ’–


🌸 DESCRIPTION 🌸

heads up bestie!! this macro double-evaluates its parameter, so do not pass it expressions with side-effects. fr fr. that's not a vibe, that's a bug waiting to happen 😭

πŸ¦‹ MACRO PARAMETERS πŸ¦‹

  • format β€” an SDL_PixelFormat to check. just hand her the format and she'll tell you what's up πŸ’β€β™€οΈ

⭐ RETURN VALUE ⭐

Returns true if the format is 10-bit, false otherwise. no in-between, no "it's complicated", just a clean lil bool for you 🫢


🧚 THREAD SAFETY 🧚

It is safe to call this macro from any thread. periodt. call it from your main thread, your worker thread, your little render thread β€” she does not care, she is thriving everywhere πŸ‘‘


🌈 AVAILABILITY 🌈

This macro is available since SDL 3.2.0. so if you're on something older... bestie, it's giving upgrade ✨


and that's the whole page, no cap πŸ’œ shoutout to Simple Directmedia Layer for making it, this is from SDL 3.4.18, and if you need me I'll be over here checking pixel formats like the main character I am πŸ’…πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from