include: Filled in all remaining missing documentation!
This commit is contained in:
@@ -213,25 +213,170 @@ typedef enum SDL_PackedLayout
|
||||
SDL_PACKEDLAYOUT_1010102
|
||||
} SDL_PackedLayout;
|
||||
|
||||
/**
|
||||
* A macro for defining custom FourCC pixel formats.
|
||||
*
|
||||
* For example, defining SDL_PIXELFORMAT_YV12 looks like this:
|
||||
*
|
||||
* ```c
|
||||
* SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2')
|
||||
* ```
|
||||
*
|
||||
* \param A the first character of the FourCC code.
|
||||
* \param B the second character of the FourCC code.
|
||||
* \param C the third character of the FourCC code.
|
||||
* \param D the fourth character of the FourCC code.
|
||||
* \returns a format value in the style of SDL_PixelFormat.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
|
||||
|
||||
/**
|
||||
* A macro for defining custom non-FourCC pixel formats.
|
||||
*
|
||||
* For example, defining SDL_PIXELFORMAT_RGBA8888 looks like this:
|
||||
*
|
||||
* ```c
|
||||
* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 32, 4)
|
||||
* ```
|
||||
*
|
||||
* \param type the type of the new format, probably a SDL_PixelType value.
|
||||
* \param order the order of the new format, probably a SDL_BitmapOrder, SDL_PackedOrder, or SDL_ArrayOrder value.
|
||||
* \param layout the layout of the new format, probably an SDL_PackedLayout value or zero.
|
||||
* \param bits the number of bits per pixel of the new format.
|
||||
* \param bytes the number of bytes per pixel of the new format.
|
||||
* \returns a format value in the style of SDL_PixelFormat.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
|
||||
((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
|
||||
((bits) << 8) | ((bytes) << 0))
|
||||
|
||||
#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
|
||||
#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
|
||||
#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
|
||||
#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
|
||||
#define SDL_BITSPERPIXEL(X) \
|
||||
(SDL_ISPIXELFORMAT_FOURCC(X) ? 0 : (((X) >> 8) & 0xFF))
|
||||
#define SDL_BYTESPERPIXEL(X) \
|
||||
(SDL_ISPIXELFORMAT_FOURCC(X) ? \
|
||||
((((X) == SDL_PIXELFORMAT_YUY2) || \
|
||||
((X) == SDL_PIXELFORMAT_UYVY) || \
|
||||
((X) == SDL_PIXELFORMAT_YVYU) || \
|
||||
((X) == SDL_PIXELFORMAT_P010)) ? 2 : 1) : (((X) >> 0) & 0xFF))
|
||||
/**
|
||||
* A macro to retrieve the flags of an SDL_PixelFormat.
|
||||
*
|
||||
* This macro is generally not needed directly by an app, which should use
|
||||
* specific tests, like SDL_ISPIXELFORMAT_FOURCC, instead.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns the flags of `format`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_PIXELFLAG(format) (((format) >> 28) & 0x0F)
|
||||
|
||||
/**
|
||||
* A macro to retrieve the type of an SDL_PixelFormat.
|
||||
*
|
||||
* This is usually a value from the SDL_PixelType enumeration.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns the type of `format`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_PIXELTYPE(format) (((format) >> 24) & 0x0F)
|
||||
|
||||
/**
|
||||
* A macro to retrieve the order of an SDL_PixelFormat.
|
||||
*
|
||||
* This is usually a value from the SDL_BitmapOrder, SDL_PackedOrder, or
|
||||
* SDL_ArrayOrder enumerations, depending on the format type.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns the order of `format`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_PIXELORDER(format) (((format) >> 20) & 0x0F)
|
||||
|
||||
/**
|
||||
* A macro to retrieve the layout of an SDL_PixelFormat.
|
||||
*
|
||||
* This is usually a value from the SDL_PackedLayout enumeration, or zero if
|
||||
* a layout doesn't make sense for the format type.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns the layout of `format`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_PIXELLAYOUT(format) (((format) >> 16) & 0x0F)
|
||||
|
||||
/**
|
||||
* A macro to determine an SDL_PixelFormat's bits per pixel.
|
||||
*
|
||||
* Note that this macro double-evaluates its parameter, so do not use
|
||||
* expressions with side-effects here.
|
||||
*
|
||||
* FourCC formats will report zero here, as it rarely makes sense to measure
|
||||
* them per-pixel.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns the bits-per-pixel of `format`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*
|
||||
* \sa SDL_BYTESPERPIXEL
|
||||
*/
|
||||
#define SDL_BITSPERPIXEL(format) \
|
||||
(SDL_ISPIXELFORMAT_FOURCC(format) ? 0 : (((format) >> 8) & 0xFF))
|
||||
|
||||
/**
|
||||
* A macro to determine an SDL_PixelFormat's bytes per pixel.
|
||||
*
|
||||
* Note that this macro double-evaluates its parameter, so do not use
|
||||
* expressions with side-effects here.
|
||||
*
|
||||
* FourCC formats do their best here, but many of them don't have a meaningful
|
||||
* measurement of bytes per pixel.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns the bytes-per-pixel of `format`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*
|
||||
* \sa SDL_BITSPERPIXEL
|
||||
*/
|
||||
#define SDL_BYTESPERPIXEL(format) \
|
||||
(SDL_ISPIXELFORMAT_FOURCC(format) ? \
|
||||
((((format) == SDL_PIXELFORMAT_YUY2) || \
|
||||
((format) == SDL_PIXELFORMAT_UYVY) || \
|
||||
((format) == SDL_PIXELFORMAT_YVYU) || \
|
||||
((format) == SDL_PIXELFORMAT_P010)) ? 2 : 1) : (((format) >> 0) & 0xFF))
|
||||
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_PixelFormat is an indexed format.
|
||||
*
|
||||
* Note that this macro double-evaluates its parameter, so do not use
|
||||
* expressions with side-effects here.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns true if the format is indexed, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISPIXELFORMAT_INDEXED(format) \
|
||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
|
||||
@@ -239,12 +384,38 @@ typedef enum SDL_PackedLayout
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_PixelFormat is a packed format.
|
||||
*
|
||||
* Note that this macro double-evaluates its parameter, so do not use
|
||||
* expressions with side-effects here.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns true if the format is packed, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISPIXELFORMAT_PACKED(format) \
|
||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_PixelFormat is an array format.
|
||||
*
|
||||
* Note that this macro double-evaluates its parameter, so do not use
|
||||
* expressions with side-effects here.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns true if the format is an array, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISPIXELFORMAT_ARRAY(format) \
|
||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \
|
||||
@@ -253,16 +424,55 @@ typedef enum SDL_PackedLayout
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_PixelFormat is a 10-bit format.
|
||||
*
|
||||
* Note that this macro double-evaluates its parameter, so do not use
|
||||
* expressions with side-effects here.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns true if the format is 10-bit, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISPIXELFORMAT_10BIT(format) \
|
||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32) && \
|
||||
(SDL_PIXELLAYOUT(format) == SDL_PACKEDLAYOUT_2101010)))
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_PixelFormat is a floating point format.
|
||||
*
|
||||
* Note that this macro double-evaluates its parameter, so do not use
|
||||
* expressions with side-effects here.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns true if the format is 10-bit, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISPIXELFORMAT_FLOAT(format) \
|
||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_PixelFormat has an alpha channel.
|
||||
*
|
||||
* Note that this macro double-evaluates its parameter, so do not use
|
||||
* expressions with side-effects here.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns true if the format has alpha, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISPIXELFORMAT_ALPHA(format) \
|
||||
((SDL_ISPIXELFORMAT_PACKED(format) && \
|
||||
((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
|
||||
@@ -275,8 +485,23 @@ typedef enum SDL_PackedLayout
|
||||
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \
|
||||
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA))))
|
||||
|
||||
/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
|
||||
#define SDL_ISPIXELFORMAT_FOURCC(format) \
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_PixelFormat is a "FourCC" format.
|
||||
*
|
||||
* This covers custom and other unusual formats.
|
||||
*
|
||||
* Note that this macro double-evaluates its parameter, so do not use
|
||||
* expressions with side-effects here.
|
||||
*
|
||||
* \param format an SDL_PixelFormat to check.
|
||||
* \returns true if the format has alpha, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISPIXELFORMAT_FOURCC(format) /* The flag is set to 1 because 0x1? is not in the printable ASCII range */ \
|
||||
((format) && (SDL_PIXELFLAG(format) != 1))
|
||||
|
||||
/* Note: If you modify this enum, update SDL_GetPixelFormatName() */
|
||||
@@ -591,22 +816,171 @@ typedef enum SDL_ChromaLocation
|
||||
|
||||
|
||||
/* Colorspace definition */
|
||||
|
||||
/**
|
||||
* A macro for defining custom SDL_Colorspace formats.
|
||||
*
|
||||
* For example, defining SDL_COLORSPACE_SRGB looks like this:
|
||||
*
|
||||
* ```c
|
||||
* 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)
|
||||
* ```
|
||||
*
|
||||
* \param type the type of the new format, probably an SDL_ColorType value.
|
||||
* \param range the range of the new format, probably a SDL_ColorRange value.
|
||||
* \param primaries the primaries of the new format, probably an SDL_ColorPrimaries value.
|
||||
* \param transfer the transfer characteristics of the new format, probably an SDL_TransferCharacteristics value.
|
||||
* \param matrix the matrix coefficients of the new format, probably an SDL_MatrixCoefficients value.
|
||||
* \param chroma the chroma sample location of the new format, probably an SDL_ChromaLocation value.
|
||||
* \returns a format value in the style of SDL_Colorspace.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_DEFINE_COLORSPACE(type, range, primaries, transfer, matrix, chroma) \
|
||||
(((Uint32)(type) << 28) | ((Uint32)(range) << 24) | ((Uint32)(chroma) << 20) | \
|
||||
((Uint32)(primaries) << 10) | ((Uint32)(transfer) << 5) | ((Uint32)(matrix) << 0))
|
||||
|
||||
#define SDL_COLORSPACETYPE(X) (SDL_ColorType)(((X) >> 28) & 0x0F)
|
||||
#define SDL_COLORSPACERANGE(X) (SDL_ColorRange)(((X) >> 24) & 0x0F)
|
||||
#define SDL_COLORSPACECHROMA(X) (SDL_ChromaLocation)(((X) >> 20) & 0x0F)
|
||||
#define SDL_COLORSPACEPRIMARIES(X) (SDL_ColorPrimaries)(((X) >> 10) & 0x1F)
|
||||
#define SDL_COLORSPACETRANSFER(X) (SDL_TransferCharacteristics)(((X) >> 5) & 0x1F)
|
||||
#define SDL_COLORSPACEMATRIX(X) (SDL_MatrixCoefficients)((X) & 0x1F)
|
||||
/**
|
||||
* A macro to retrieve the type of an SDL_Colorspace.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns the SDL_ColorType for `cspace`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_COLORSPACETYPE(cspace) (SDL_ColorType)(((cspace) >> 28) & 0x0F)
|
||||
|
||||
#define SDL_ISCOLORSPACE_MATRIX_BT601(X) (SDL_COLORSPACEMATRIX(X) == SDL_MATRIX_COEFFICIENTS_BT601 || SDL_COLORSPACEMATRIX(X) == SDL_MATRIX_COEFFICIENTS_BT470BG)
|
||||
#define SDL_ISCOLORSPACE_MATRIX_BT709(X) (SDL_COLORSPACEMATRIX(X) == SDL_MATRIX_COEFFICIENTS_BT709)
|
||||
#define SDL_ISCOLORSPACE_MATRIX_BT2020_NCL(X) (SDL_COLORSPACEMATRIX(X) == SDL_MATRIX_COEFFICIENTS_BT2020_NCL)
|
||||
#define SDL_ISCOLORSPACE_LIMITED_RANGE(X) (SDL_COLORSPACERANGE(X) != SDL_COLOR_RANGE_FULL)
|
||||
#define SDL_ISCOLORSPACE_FULL_RANGE(X) (SDL_COLORSPACERANGE(X) == SDL_COLOR_RANGE_FULL)
|
||||
/**
|
||||
* A macro to retrieve the range of an SDL_Colorspace.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns the SDL_ColorRange of `cspace`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_COLORSPACERANGE(cspace) (SDL_ColorRange)(((cspace) >> 24) & 0x0F)
|
||||
|
||||
/**
|
||||
* A macro to retrieve the chroma sample location of an SDL_Colorspace.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns the SDL_ChromaLocation of `cspace`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_COLORSPACECHROMA(cspace) (SDL_ChromaLocation)(((cspace) >> 20) & 0x0F)
|
||||
|
||||
/**
|
||||
* A macro to retrieve the primaries of an SDL_Colorspace.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns the SDL_ColorPrimaries of `cspace`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_COLORSPACEPRIMARIES(cspace) (SDL_ColorPrimaries)(((cspace) >> 10) & 0x1F)
|
||||
|
||||
/**
|
||||
* A macro to retrieve the transfer characteristics of an SDL_Colorspace.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns the SDL_TransferCharacteristics of `cspace`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_COLORSPACETRANSFER(cspace) (SDL_TransferCharacteristics)(((cspace) >> 5) & 0x1F)
|
||||
|
||||
/**
|
||||
* A macro to retrieve the matrix coefficients of an SDL_Colorspace.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns the SDL_MatrixCoefficients of `cspace`.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_COLORSPACEMATRIX(cspace) (SDL_MatrixCoefficients)((cspace) & 0x1F)
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_Colorspace uses BT601 (or BT470BG) matrix coefficients.
|
||||
*
|
||||
* Note that this macro double-evaluates its parameter, so do not use
|
||||
* expressions with side-effects here.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns true if BT601 or BT470BG, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISCOLORSPACE_MATRIX_BT601(cspace) (SDL_COLORSPACEMATRIX(cspace) == SDL_MATRIX_COEFFICIENTS_BT601 || SDL_COLORSPACEMATRIX(cspace) == SDL_MATRIX_COEFFICIENTS_BT470BG)
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_Colorspace uses BT709 matrix coefficients.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns true if BT709, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISCOLORSPACE_MATRIX_BT709(cspace) (SDL_COLORSPACEMATRIX(cspace) == SDL_MATRIX_COEFFICIENTS_BT709)
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_Colorspace uses BT2020_NCL matrix coefficients.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns true if BT709, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISCOLORSPACE_MATRIX_BT2020_NCL(cspace) (SDL_COLORSPACEMATRIX(cspace) == SDL_MATRIX_COEFFICIENTS_BT2020_NCL)
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_Colorspace has a limited range.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns true if limited range, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISCOLORSPACE_LIMITED_RANGE(cspace) (SDL_COLORSPACERANGE(cspace) != SDL_COLOR_RANGE_FULL)
|
||||
|
||||
/**
|
||||
* A macro to determine if an SDL_Colorspace has a full range.
|
||||
*
|
||||
* \param cspace an SDL_Colorspace to check.
|
||||
* \returns true if full range, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this macro from any thread.
|
||||
*
|
||||
* \since This macro is available since SDL 3.1.3.
|
||||
*/
|
||||
#define SDL_ISCOLORSPACE_FULL_RANGE(cspace) (SDL_COLORSPACERANGE(cspace) == SDL_COLOR_RANGE_FULL)
|
||||
|
||||
/**
|
||||
* Colorspace definitions.
|
||||
|
||||
Reference in New Issue
Block a user