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 (SDL_Colorspace colorspace={})
 Wraps Colorspace.
 
constexpr Colorspace (ColorType type, ColorRange range, ColorPrimaries primaries, TransferCharacteristics transfer, MatrixCoefficients matrix, ChromaLocation chroma)
 Define custom Colorspace formats.
 
constexpr bool operator== (const Colorspace &other) const =default
 Default comparison operator.
 
constexpr bool operator== (SDL_Colorspace colorspace) const
 Compares with the underlying type.
 
constexpr operator SDL_Colorspace () const
 True if a valid colorspace.
 
constexpr operator bool () const
 Check if valid.
 
constexpr ColorType GetType () const
 Retrieve the type of a Colorspace.
 
constexpr ColorRange GetRange () const
 Retrieve the range of a Colorspace.
 
constexpr ChromaLocation GetChroma () const
 Retrieve the chroma sample location of an Colorspace.
 
constexpr ColorPrimaries GetPrimaries () const
 Retrieve the primaries of an Colorspace.
 
constexpr TransferCharacteristics GetTransfer () const
 Retrieve the transfer characteristics of an Colorspace.
 
constexpr MatrixCoefficients GetMatrix () const
 Retrieve the matrix coefficients of an Colorspace.
 
constexpr bool IsMatrixBT601 () const
 Determine if a Colorspace uses BT601 (or BT470BG) matrix coefficients.
 
constexpr bool IsMatrixBT709 () const
 Determine if an Colorspace uses BT709 matrix coefficients.
 
constexpr bool IsMatrixBT2020_NCL () const
 Determine if an Colorspace uses BT2020_NCL matrix coefficients.
 
constexpr bool IsLimitedRange () const
 A function to determine if an Colorspace has a limited range.
 
constexpr bool IsFullRange () const
 A function to determine if an Colorspace has a full range.
 

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 ( SDL_Colorspace  colorspace = {})
inlineconstexpr
Parameters
colorspacethe 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:1301
constexpr ColorPrimaries COLOR_PRIMARIES_BT709
ITU-R BT.709-6.
Definition SDL3pp_pixels.h:1044
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_SRGB
IEC 61966-2-1 (sRGB or sYCC)
Definition SDL3pp_pixels.h:1144
constexpr ColorType COLOR_TYPE_RGB
COLOR_TYPE_RGB.
Definition SDL3pp_pixels.h:993
constexpr ColorRange COLOR_RANGE_FULL
Full range, e.g.
Definition SDL3pp_pixels.h:1024
constexpr ChromaLocation CHROMA_LOCATION_NONE
RGB, no chroma sampling.
Definition SDL3pp_pixels.h:1251
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_IDENTITY
MATRIX_COEFFICIENTS_IDENTITY.
Definition SDL3pp_pixels.h:1187
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

◆ GetChroma()

constexpr ChromaLocation SDL::Colorspace::GetChroma ( ) const
inlineconstexpr
Returns
the ChromaLocation of cspace.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetMatrix()

constexpr MatrixCoefficients SDL::Colorspace::GetMatrix ( ) const
inlineconstexpr
Returns
the MatrixCoefficients of cspace.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetPrimaries()

constexpr ColorPrimaries SDL::Colorspace::GetPrimaries ( ) const
inlineconstexpr
Returns
the ColorPrimaries of cspace.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetRange()

constexpr ColorRange SDL::Colorspace::GetRange ( ) const
inlineconstexpr
Returns
the ColorRange of cspace.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetTransfer()

constexpr TransferCharacteristics SDL::Colorspace::GetTransfer ( ) const
inlineconstexpr
Returns
the TransferCharacteristics of cspace.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetType()

constexpr ColorType SDL::Colorspace::GetType ( ) const
inlineconstexpr
Returns
the ColorType for cspace.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsFullRange()

constexpr bool SDL::Colorspace::IsFullRange ( ) const
inlineconstexpr
Returns
true if full range, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsLimitedRange()

constexpr bool SDL::Colorspace::IsLimitedRange ( ) const
inlineconstexpr
Returns
true if limited range, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsMatrixBT2020_NCL()

constexpr bool SDL::Colorspace::IsMatrixBT2020_NCL ( ) const
inlineconstexpr
Returns
true if BT2020_NCL, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsMatrixBT601()

constexpr bool SDL::Colorspace::IsMatrixBT601 ( ) const
inlineconstexpr
Returns
true if BT601 or BT470BG, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsMatrixBT709()

constexpr bool SDL::Colorspace::IsMatrixBT709 ( ) const
inlineconstexpr
Returns
true if BT709, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ operator bool()

constexpr SDL::Colorspace::operator bool ( ) const
inlineexplicitconstexpr
Returns
True if valid state, false otherwise.

◆ operator SDL_Colorspace()

constexpr SDL::Colorspace::operator SDL_Colorspace ( ) const
inlineconstexpr

Unwraps to the underlying Colorspace.

Returns
the underlying Colorspace.

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