SDL_DEFINE_COLORSPACE - Man Page

Name

SDL_DEFINE_COLORSPACE ā€” A macro for defining custom SDL_Colorspace
formats.

Header File

Defined in SDL3/SDL_pixels.h

Synopsis

#include "SDL3/SDL.h"

#define SDL_DEFINE_COLORSPACE(type, range, primaries, transfer, matrix, chroma) .BI (((Uint32)(type)<<28)|((Uint32)(range)<<24)|((Uint32)(chroma)<<20)|.BI    ((Uint32)(primaries) << 10) | ((Uint32)(transfer) << 5) | ((Uint32)(matrix) << 0))

Description

For example, defining SDL_COLORSPACE_SRGB
looks like this:

SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB,
                      SDL_COLOR_RANGE_FULL,
                      SDL_COLOR_PRIMARIES_BT709,
                      SDL_TRANSFER_CHARACTERISTICS_SRGB,
                      SDL_MATRIX_COEFFICIENTS_IDENTITY,
                      SDL_CHROMA_LOCATION_NONE)

Return Value

Returns a format value in the style of SDL_Colorspace .

Thread Safety

It is safe to call this macro from any thread.

Availability

This macro is available since SDL 3.2.0.

Info

SDL 3.2.2 Simple Directmedia Layer SDL3 FUNCTIONS