SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::Colorspace Class Reference

Colorspace definitions. More...

Public Member Functions

constexpr Colorspace (ColorspaceRaw cspace={})
 Wraps Colorspace. More...
 
constexpr Colorspace (ColorType type, ColorRange range, ColorPrimaries primaries, TransferCharacteristics transfer, MatrixCoefficients matrix, ChromaLocation chroma)
 Define custom Colorspace formats. More...
 
constexpr operator ColorspaceRaw () const
 Unwraps to the underlying Colorspace. More...
 
constexpr ColorType GetType () const
 Retrieve the type of a Colorspace. More...
 
constexpr ColorRange GetRange () const
 Retrieve the range of a Colorspace. More...
 
constexpr ChromaLocation GetChroma () const
 Retrieve the chroma sample location of an Colorspace. More...
 
constexpr ColorPrimaries GetPrimaries () const
 Retrieve the primaries of an Colorspace. More...
 
constexpr TransferCharacteristics GetTransfer () const
 Retrieve the transfer characteristics of an Colorspace. More...
 
constexpr MatrixCoefficients GetMatrix () const
 Retrieve the matrix coefficients of an Colorspace. More...
 
constexpr bool IsMatrixBT601 () const
 Determine if a Colorspace uses BT601 (or BT470BG) matrix coefficients. More...
 
constexpr bool IsMatrixBT709 () const
 Determine if an Colorspace uses BT709 matrix coefficients. More...
 
constexpr bool IsMatrixBT2020_NCL () const
 Determine if an Colorspace uses BT2020_NCL matrix coefficients. More...
 
constexpr bool IsLimitedRange () const
 A function to determine if an Colorspace has a limited range. More...
 
constexpr bool IsFullRange () const
 A function to determine if an Colorspace has a full range. More...
 

Detailed Description

Since similar colorspaces may vary in their details (matrix, transfer function, etc.), this is not an exhaustive list, but rather a representative sample of the kinds of colorspaces supported in SDL.

Since
This enum is available since SDL 3.2.0.
Category:
Wrap state
See also
Colorspaces
ColorPrimaries
ColorRange
ColorType
MatrixCoefficients
TransferCharacteristics

Constructor & Destructor Documentation

◆ Colorspace() [1/2]

constexpr SDL::Colorspace::Colorspace ( ColorspaceRaw  cspace = {})
inlineconstexpr
Parameters
cspacethe value to be wrapped

◆ Colorspace() [2/2]

constexpr SDL::Colorspace::Colorspace ( ColorType  type,
ColorRange  range,
ColorPrimaries  primaries,
TransferCharacteristics  transfer,
MatrixCoefficients  matrix,
ChromaLocation  chroma 
)
inlineconstexpr

For example, defining COLORSPACE_SRGB looks like this:

Colorspace definitions.
Definition: SDL3pp_pixels.h:1660
constexpr ColorPrimaries COLOR_PRIMARIES_BT709
ITU-R BT.709-6.
Definition: SDL3pp_pixels.h:1409
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_SRGB
IEC 61966-2-1 (sRGB or sYCC)
Definition: SDL3pp_pixels.h:1505
constexpr ColorType COLOR_TYPE_RGB
COLOR_TYPE_RGB.
Definition: SDL3pp_pixels.h:1360
constexpr ColorRange COLOR_RANGE_FULL
Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma.
Definition: SDL3pp_pixels.h:1389
constexpr ChromaLocation CHROMA_LOCATION_NONE
RGB, no chroma sampling.
Definition: SDL3pp_pixels.h:1610
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_IDENTITY
MATRIX_COEFFICIENTS_IDENTITY.
Definition: SDL3pp_pixels.h:1546
Parameters
typethe type of the new format, probably an ColorType value.
rangethe range of the new format, probably a ColorRange value.
primariesthe primaries of the new format, probably an ColorPrimaries value.
transferthe transfer characteristics of the new format, probably an TransferCharacteristics value.
matrixthe matrix coefficients of the new format, probably an MatrixCoefficients value.
chromathe chroma sample location of the new format, probably an ChromaLocation value.
Postcondition
a format value in the style of Colorspace.
Thread safety:
It is safe to call this macro from any thread.
Since
This macro is available since SDL 3.2.0.

Member Function Documentation

◆ operator ColorspaceRaw()

constexpr SDL::Colorspace::operator ColorspaceRaw ( ) const
inlineconstexpr
Returns
the underlying ColorspaceRaw.

The documentation for this class was generated from the following file: