SDL_ISCOLORSPACE_MATRIX_BT601(3)

πŸ’– SDL_ISCOLORSPACE_MATRIX_BT601 πŸ’–

okay bestie, so this is a page straight outta the SDL3 FUNCTIONS manual, and it's about a lil macro named SDL_ISCOLORSPACE_MATRIX_BT601. She's small, she's iconic, and she does exactly one job. Let's get into it 🫢


✨ NAME ✨

SDL_ISCOLORSPACE_MATRIX_BT601 β€” a macro that tells you if an SDL_Colorspace is rockin' BT601 (or BT470BG) matrix coefficients. that's it. that's the whole vibe check πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_pixels.h>

#define SDL_ISCOLORSPACE_MATRIX_BT601(cspace)        (SDL_COLORSPACEMATRIX(cspace) == SDL_MATRIX_COEFFICIENTS_BT601 || SDL_COLORSPACEMATRIX(cspace) == SDL_MATRIX_COEFFICIENTS_BT470BG)

like. look at her. one line. no notes. πŸ‘‘


✨ DESCRIPTION ✨

so basically you hand her a colorspace and she's like "hmm is this BT601 coded or BT470BG coded?" and she answers. slay.

⚠️ BESTIE LISTEN β€” this macro double-evaluates its parameter. so do NOT pass it expressions with side-effects, fr fr. like if your expression increments something or does literally anything spicy, it's gonna happen twice. no cap. keep it boring, keep it safe. 🚨

✨ MACRO PARAMETERS ✨

  • cspace β€” an SDL_Colorspace you wanna check. the lil guy you're interrogating πŸ•΅οΈβ™€οΈ

✨ RETURN VALUE ✨

  • returns true if it's BT601 or BT470BG πŸ’š
  • returns false otherwise πŸ’€

✨ THREAD SAFETY ✨

it is safe to call this macro from any thread. go wild, queen. multithreaded and unbothered 🌈✨


✨ AVAILABILITY ✨

this macro has been available since SDL 3.2.0. she's not new new but she's still serving πŸŽ€


okay that's the whole page, you're basically an expert now πŸ’œ

Simple Directmedia Layer wrote this one, SDL 3.4.18 is the version on the tin, and SDL_ISCOLORSPACE_MATRIX_BT601(3) is the section she lives in. mwah, go check your colorspaces bestie πŸ’…πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from