SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Pixel Formats and Conversion Routines

SDL offers facilities for pixel management. More...

Classes

class  SDL::PixelFormat
 Pixel format. More...
class  SDL::Colorspace
 Colorspace definitions. More...
struct  SDL::Color
 A structure that represents a color as RGBA components. More...
struct  SDL::FColor
 The bits of this structure can be directly reinterpreted as a float-packed color which uses the PIXELFORMAT_RGBA128_FLOAT format. More...
class  SDL::PaletteIndex
 Auxiliary class for Palette to provide access to specific palette index. More...
struct  SDL::Palette
 A set of indexed colors representing a palette. More...

Typedefs

using SDL::PixelFormatRaw = SDL_PixelFormat
 Alias to raw representation for PixelFormat.
using SDL::ColorspaceRaw = SDL_Colorspace
 Alias to raw representation for Colorspace.
using SDL::ColorRaw = SDL_Color
 Alias to raw representation for Color.
using SDL::FColorRaw = SDL_FColor
 Alias to raw representation for FColor.
using SDL::PaletteRaw = SDL_Palette*
 Alias to raw representation for Palette.
using SDL::PaletteRawConst = const SDL_Palette*
 Alias to const raw representation for Palette.
using SDL::PaletteRef = ResourceRef<Palette>
 Reference for Palette.
using SDL::PaletteConstRef = ResourceConstRef<PaletteRaw, PaletteRawConst>
 Safely wrap Palette for non owning const parameters.
using SDL::PixelFormatDetails = SDL_PixelFormatDetails
 Details about the format of a pixel.

Functions

constexpr Uint32 SDL::DefinePixelFourCC (Uint8 A, Uint8 B, Uint8 C, Uint8 D)
 A function for defining custom FourCC pixel formats.
constexpr PixelFormat SDL::DefinePixelFormat (PixelType type, int order, PackedLayout layout, int bits, int bytes)
 A macro for defining custom non-FourCC pixel formats.
constexpr Uint8 SDL::PixelFormatFlags (PixelFormatRaw format)
 Retrieve the flags of an PixelFormat.
constexpr PixelType SDL::PixelFormatType (PixelFormatRaw format)
 A macro to retrieve the type of an PixelFormat.
constexpr int SDL::PixelFormatOrder (PixelFormatRaw format)
 A macro to retrieve the order of an PixelFormat.
constexpr PackedLayout SDL::PixelFormatLayout (PixelFormatRaw format)
 A macro to retrieve the layout of an PixelFormat.
constexpr int SDL::PixelFormatBitsPerPixel (PixelFormatRaw format)
 A macro to determine an PixelFormat's bits per pixel.
constexpr int SDL::PixelFormatBytesPerPixel (PixelFormatRaw format)
 A macro to determine an PixelFormat's bytes per pixel.
constexpr bool SDL::IsPixelFormatIndexed (PixelFormatRaw format)
 A macro to determine if an PixelFormat is an indexed format.
constexpr bool SDL::IsPixelFormatPacked (PixelFormatRaw format)
 A macro to determine if an PixelFormat is a packed format.
constexpr bool SDL::IsPixelFormatArray (PixelFormatRaw format)
 A macro to determine if an PixelFormat is an array format.
constexpr bool SDL::IsPixelFormat10Bit (PixelFormatRaw format)
 A macro to determine if an PixelFormat is a 10-bit format.
constexpr bool SDL::IsPixelFormatFloat (PixelFormatRaw format)
 A macro to determine if an PixelFormat is a floating point format.
constexpr Colorspace SDL::DefineColorspace (ColorType type, ColorRange range, ColorPrimaries primaries, TransferCharacteristics transfer, MatrixCoefficients matrix, ChromaLocation chroma)
 A macro for defining custom Colorspace formats.
constexpr ColorType SDL::ColorspaceType (ColorspaceRaw cspace)
 A macro to retrieve the type of an Colorspace.
constexpr ColorRange SDL::ColorspaceRange (ColorspaceRaw cspace)
 A macro to retrieve the range of an Colorspace.
constexpr ChromaLocation SDL::ColorspaceChroma (ColorspaceRaw cspace)
 A macro to retrieve the chroma sample location of an Colorspace.
constexpr ColorPrimaries SDL::ColorspacePrimaries (ColorspaceRaw cspace)
 A macro to retrieve the primaries of an Colorspace.
constexpr TransferCharacteristics SDL::ColorspaceTransfer (ColorspaceRaw cspace)
 A macro to retrieve the transfer characteristics of an Colorspace.
constexpr MatrixCoefficients SDL::ColorspaceMatrix (ColorspaceRaw cspace)
 A macro to retrieve the matrix coefficients of an Colorspace.
constexpr bool SDL::IsColorspaceMatrixBT601 (ColorspaceRaw cspace)
 A macro to determine if an Colorspace uses BT601 (or BT470BG) matrix coefficients.
constexpr bool SDL::IsColorspaceMatrixBT709 (ColorspaceRaw cspace)
 A macro to determine if an Colorspace uses BT709 matrix coefficients.
constexpr bool SDL::IsColorspaceMatrixBT2020_NCL (ColorspaceRaw cspace)
 Determine if an Colorspace uses BT2020_NCL matrix coefficients.
constexpr bool SDL::IsColorspaceLimitedRange (ColorspaceRaw cspace)
 A macro to determine if an Colorspace has a limited range.
constexpr bool SDL::IsColorspaceFullRange (ColorspaceRaw cspace)
 A macro to determine if an Colorspace has a full range.
constexpr bool SDL::operator== (ColorRaw lhs, ColorRaw rhs) noexcept
 Comparison operator for Color.
constexpr bool SDL::operator== (const FColorRaw &lhs, const FColorRaw &rhs) noexcept
 Comparison operator for FColor.
constexpr auto SDL::operator<=> (ColorRaw lhs, ColorRaw rhs) noexcept
 Spaceship operator for Color.
constexpr auto SDL::operator<=> (const FColorRaw &lhs, const FColorRaw &rhs) noexcept
 Spaceship operator for FColor.
const char * SDL::GetPixelFormatName (PixelFormatRaw format)
 Get the human readable name of a pixel format.
void SDL::GetMasksForPixelFormat (PixelFormatRaw format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask)
 Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
PixelFormat SDL::GetPixelFormatForMasks (int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
 Convert a bpp value and RGBA masks to an enumerated pixel format.
const PixelFormatDetailsSDL::GetPixelFormatDetails (PixelFormatRaw format)
 Create an PixelFormatDetails structure corresponding to a pixel format.
Palette SDL::CreatePalette (int ncolors)
 Create a palette structure with the specified number of color entries.
void SDL::SetPaletteColors (PaletteRef palette, SpanRef< const ColorRaw > colors, int firstcolor=0)
 Set a range of colors in a palette.
void SDL::DestroyPalette (PaletteRaw palette)
 Free a palette created with CreatePalette().
Uint32 SDL::MapRGB (const PixelFormatDetails &format, PaletteConstRef palette, Uint8 r, Uint8 g, Uint8 b)
 Map an RGB triple to an opaque pixel value for a given pixel format.
Uint32 SDL::MapRGBA (const PixelFormatDetails &format, Uint8 r, Uint8 g, Uint8 b, Uint8 a, PaletteConstRef palette={})
 Map an RGBA quadruple to a pixel value for a given pixel format.
Uint32 SDL::MapColor (const PixelFormatDetails &format, ColorRaw c, PaletteConstRef palette={})
 Map an RGBA quadruple to a pixel value for a given pixel format.
void SDL::GetRGB (Uint32 pixelvalue, const PixelFormatDetails &format, PaletteConstRef palette, Uint8 *r, Uint8 *g, Uint8 *b)
 Get RGB values from a pixel in the specified format.
void SDL::GetRGBA (Uint32 pixelvalue, const PixelFormatDetails &format, PaletteConstRef palette, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
 Get RGBA values from a pixel in the specified format.
Color SDL::GetColor (Uint32 pixel, const PixelFormatDetails &format, PaletteConstRef palette={})
 Get RGBA values from a pixel in the specified format.
constexpr SDL::PixelFormat::PixelFormat (PixelType type, int order, PackedLayout layout, int bits, int bytes)
 Defining custom non-FourCC pixel formats.
constexpr Uint8 SDL::PixelFormat::GetFlags () const
 Retrieve the flags of an PixelFormat.
constexpr PixelType SDL::PixelFormat::GetType () const
 Retrieve the type.
constexpr int SDL::PixelFormat::GetOrder () const
 Retrieve the order.
constexpr PackedLayout SDL::PixelFormat::GetLayout () const
 Retrieve the layout.
constexpr int SDL::PixelFormat::GetBitsPerPixel () const
 Determine this's bits per pixel.
constexpr int SDL::PixelFormat::GetBytesPerPixel () const
 Determine this's bytes per pixel.
constexpr bool SDL::PixelFormat::IsIndexed () const
 Determine if this is an indexed format.
constexpr bool SDL::PixelFormat::IsPacked () const
 Determine if this is a packed format.
constexpr bool SDL::PixelFormat::IsArray () const
 Determine if this is an array format.
constexpr bool SDL::PixelFormat::Is10Bit () const
 Determine if this is a 10-bit format.
constexpr bool SDL::PixelFormat::IsFloat () const
 Determine if this is a floating point format.
constexpr SDL::Colorspace::Colorspace (ColorType type, ColorRange range, ColorPrimaries primaries, TransferCharacteristics transfer, MatrixCoefficients matrix, ChromaLocation chroma)
 Define custom Colorspace formats.
constexpr ColorType SDL::Colorspace::GetType () const
 Retrieve the type of a Colorspace.
constexpr ColorRange SDL::Colorspace::GetRange () const
 Retrieve the range of a Colorspace.
constexpr ChromaLocation SDL::Colorspace::GetChroma () const
 Retrieve the chroma sample location of an Colorspace.
constexpr ColorPrimaries SDL::Colorspace::GetPrimaries () const
 Retrieve the primaries of an Colorspace.
constexpr TransferCharacteristics SDL::Colorspace::GetTransfer () const
 Retrieve the transfer characteristics of an Colorspace.
constexpr MatrixCoefficients SDL::Colorspace::GetMatrix () const
 Retrieve the matrix coefficients of an Colorspace.
constexpr bool SDL::Colorspace::IsMatrixBT601 () const
 Determine if a Colorspace uses BT601 (or BT470BG) matrix coefficients.
constexpr bool SDL::Colorspace::IsMatrixBT709 () const
 Determine if an Colorspace uses BT709 matrix coefficients.
constexpr bool SDL::Colorspace::IsMatrixBT2020_NCL () const
 Determine if an Colorspace uses BT2020_NCL matrix coefficients.
constexpr bool SDL::Colorspace::IsLimitedRange () const
 A function to determine if an Colorspace has a limited range.
constexpr bool SDL::Colorspace::IsFullRange () const
 A function to determine if an Colorspace has a full range.
const char * SDL::PixelFormat::GetName () const
 Get the human readable name of a pixel format.
void SDL::PixelFormat::GetMasks (int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) const
 Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
static PixelFormat SDL::PixelFormat::ForMasks (int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
 Convert a bpp value and RGBA masks to an enumerated pixel format.
const PixelFormatDetailsSDL::PixelFormat::GetDetails () const
 Create an PixelFormatDetails structure corresponding to a pixel format.
 SDL::PixelFormat::operator const PixelFormatDetails & () const
 Same as GetDetails().
 SDL::Palette::Palette (int ncolors)
 Create a palette structure with the specified number of color entries.
void SDL::Palette::SetColors (SpanRef< const ColorRaw > colors, int firstcolor=0)
 Set a range of colors in a palette.
PaletteIndexSDL::PaletteIndex::operator= (ColorRaw color)
 Assignment operator.
void SDL::Palette::Destroy ()
 Free a palette created with CreatePalette().
Uint32 SDL::Color::Map (const PixelFormatDetails &format, PaletteConstRef palette) const
 Map an RGBA quadruple to a pixel value for a given pixel format.
Uint32 SDL::PixelFormat::Map (ColorRaw c, PaletteConstRef palette={}) const
 Map an RGBA quadruple to a pixel value for a given pixel format.
static Color SDL::Color::Get (Uint32 pixel, const PixelFormatDetails &format, PaletteConstRef palette={})
 Get RGBA values from a pixel in the specified format.
Color SDL::PixelFormat::Get (Uint32 pixel, PaletteConstRef palette={}) const
 Get RGBA values from a pixel in the specified format.

Variables

constexpr Uint8 SDL::ALPHA_OPAQUE = SDL_ALPHA_OPAQUE
 A fully opaque 8-bit alpha value.
constexpr float SDL::ALPHA_OPAQUE_FLOAT = SDL_ALPHA_OPAQUE_FLOAT
 A fully opaque floating point alpha value.
constexpr Uint8 SDL::ALPHA_TRANSPARENT = SDL_ALPHA_TRANSPARENT
 A fully transparent 8-bit alpha value.
constexpr float SDL::ALPHA_TRANSPARENT_FLOAT = SDL_ALPHA_TRANSPARENT_FLOAT
 A fully transparent floating point alpha value.

PixelTypes

Pixel type.

using SDL::PixelType = SDL_PixelType
 Pixel type.
constexpr PixelType SDL::PIXELTYPE_UNKNOWN = SDL_PIXELTYPE_UNKNOWN
 UNKNOWN.
constexpr PixelType SDL::PIXELTYPE_INDEX1 = SDL_PIXELTYPE_INDEX1
 INDEX1.
constexpr PixelType SDL::PIXELTYPE_INDEX4 = SDL_PIXELTYPE_INDEX4
 INDEX4.
constexpr PixelType SDL::PIXELTYPE_INDEX8 = SDL_PIXELTYPE_INDEX8
 INDEX8.
constexpr PixelType SDL::PIXELTYPE_PACKED8 = SDL_PIXELTYPE_PACKED8
 PACKED8.
constexpr PixelType SDL::PIXELTYPE_PACKED16 = SDL_PIXELTYPE_PACKED16
 PACKED16.
constexpr PixelType SDL::PIXELTYPE_PACKED32 = SDL_PIXELTYPE_PACKED32
 PACKED32.
constexpr PixelType SDL::PIXELTYPE_ARRAYU8 = SDL_PIXELTYPE_ARRAYU8
 ARRAYU8.
constexpr PixelType SDL::PIXELTYPE_ARRAYU16 = SDL_PIXELTYPE_ARRAYU16
 ARRAYU16.
constexpr PixelType SDL::PIXELTYPE_ARRAYU32 = SDL_PIXELTYPE_ARRAYU32
 ARRAYU32.
constexpr PixelType SDL::PIXELTYPE_ARRAYF16 = SDL_PIXELTYPE_ARRAYF16
 ARRAYF16.
constexpr PixelType SDL::PIXELTYPE_ARRAYF32 = SDL_PIXELTYPE_ARRAYF32
 ARRAYF32.
constexpr PixelType SDL::PIXELTYPE_INDEX2 = SDL_PIXELTYPE_INDEX2
 INDEX2.

BitmapOrders

using SDL::BitmapOrder = SDL_BitmapOrder
 Bitmap pixel order, high bit -> low bit.
constexpr BitmapOrder SDL::BITMAPORDER_NONE = SDL_BITMAPORDER_NONE
 NONE.
constexpr BitmapOrder SDL::BITMAPORDER_4321 = SDL_BITMAPORDER_4321
 4321
constexpr BitmapOrder SDL::BITMAPORDER_1234 = SDL_BITMAPORDER_1234
 1234

PackedOrders

using SDL::PackedOrder = SDL_PackedOrder
 Packed component order, high bit -> low bit.
constexpr PackedOrder SDL::PACKEDORDER_NONE = SDL_PACKEDORDER_NONE
 NONE.
constexpr PackedOrder SDL::PACKEDORDER_XRGB = SDL_PACKEDORDER_XRGB
 XRGB.
constexpr PackedOrder SDL::PACKEDORDER_RGBX = SDL_PACKEDORDER_RGBX
 RGBX.
constexpr PackedOrder SDL::PACKEDORDER_ARGB = SDL_PACKEDORDER_ARGB
 ARGB.
constexpr PackedOrder SDL::PACKEDORDER_RGBA = SDL_PACKEDORDER_RGBA
 RGBA.
constexpr PackedOrder SDL::PACKEDORDER_XBGR = SDL_PACKEDORDER_XBGR
 XBGR.
constexpr PackedOrder SDL::PACKEDORDER_BGRX = SDL_PACKEDORDER_BGRX
 BGRX.
constexpr PackedOrder SDL::PACKEDORDER_ABGR = SDL_PACKEDORDER_ABGR
 ABGR.
constexpr PackedOrder SDL::PACKEDORDER_BGRA = SDL_PACKEDORDER_BGRA
 BGRA.

ArrayOrders

using SDL::ArrayOrder = SDL_ArrayOrder
 Array component order, low byte -> high byte.
constexpr ArrayOrder SDL::ARRAYORDER_NONE = SDL_ARRAYORDER_NONE
 NONE.
constexpr ArrayOrder SDL::ARRAYORDER_RGB = SDL_ARRAYORDER_RGB
 RGB.
constexpr ArrayOrder SDL::ARRAYORDER_RGBA = SDL_ARRAYORDER_RGBA
 RGBA.
constexpr ArrayOrder SDL::ARRAYORDER_ARGB = SDL_ARRAYORDER_ARGB
 ARGB.
constexpr ArrayOrder SDL::ARRAYORDER_BGR = SDL_ARRAYORDER_BGR
 BGR.
constexpr ArrayOrder SDL::ARRAYORDER_BGRA = SDL_ARRAYORDER_BGRA
 BGRA.
constexpr ArrayOrder SDL::ARRAYORDER_ABGR = SDL_ARRAYORDER_ABGR
 ABGR.

PackedLayouts

using SDL::PackedLayout = SDL_PackedLayout
 Packed component layout.
constexpr PackedLayout SDL::PACKEDLAYOUT_NONE = SDL_PACKEDLAYOUT_NONE
 NONE.
constexpr PackedLayout SDL::PACKEDLAYOUT_332 = SDL_PACKEDLAYOUT_332
 332
constexpr PackedLayout SDL::PACKEDLAYOUT_4444 = SDL_PACKEDLAYOUT_4444
 4444
constexpr PackedLayout SDL::PACKEDLAYOUT_1555 = SDL_PACKEDLAYOUT_1555
 1555
constexpr PackedLayout SDL::PACKEDLAYOUT_5551 = SDL_PACKEDLAYOUT_5551
 5551
constexpr PackedLayout SDL::PACKEDLAYOUT_565 = SDL_PACKEDLAYOUT_565
 565
constexpr PackedLayout SDL::PACKEDLAYOUT_8888 = SDL_PACKEDLAYOUT_8888
 8888
constexpr PackedLayout SDL::PACKEDLAYOUT_2101010
 2101010
constexpr PackedLayout SDL::PACKEDLAYOUT_1010102
 1010102

ColorTypes

using SDL::ColorType = SDL_ColorType
 Colorspace color type.
constexpr ColorType SDL::COLOR_TYPE_UNKNOWN
 COLOR_TYPE_UNKNOWN.
constexpr ColorType SDL::COLOR_TYPE_RGB = SDL_COLOR_TYPE_RGB
 COLOR_TYPE_RGB.
constexpr ColorType SDL::COLOR_TYPE_YCBCR
 COLOR_TYPE_YCBCR.
constexpr bool SDL::IsPixelFormatAlpha (PixelFormatRaw format)
 A macro to determine if an PixelFormat has an alpha channel.
constexpr bool SDL::IsPixelFormatFourCC (PixelFormatRaw format)
 A macro to determine if an PixelFormat is a "FourCC" format.
constexpr bool SDL::PixelFormat::IsAlpha () const
 Determine if this has an alpha channel.
constexpr bool SDL::PixelFormat::IsFourCC () const
 Determine if this is a "FourCC" format.

ColorRanges

using SDL::ColorRange = SDL_ColorRange
 Colorspace color range, as described by https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en.
constexpr ColorRange SDL::COLOR_RANGE_UNKNOWN
 COLOR_RANGE_UNKNOWN.
constexpr ColorRange SDL::COLOR_RANGE_LIMITED = SDL_COLOR_RANGE_LIMITED
 Narrow range, e.g.
constexpr ColorRange SDL::COLOR_RANGE_FULL = SDL_COLOR_RANGE_FULL
 Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma.

ColorPrimaries

using SDL::ColorPrimaries = SDL_ColorPrimaries
 Colorspace color primaries, as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_UNKNOWN
 COLOR_PRIMARIES_UNKNOWN.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_BT709
 ITU-R BT.709-6.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_UNSPECIFIED
 COLOR_PRIMARIES_UNSPECIFIED.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_BT470M
 ITU-R BT.470-6 System M.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_BT470BG
 ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_BT601
 ITU-R BT.601-7 525, SMPTE 170M.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_SMPTE240
 SMPTE 240M, functionally the same as COLOR_PRIMARIES_BT601.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_GENERIC_FILM
 Generic film (color filters using Illuminant C).
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_BT2020
 ITU-R BT.2020-2 / ITU-R BT.2100-0.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_XYZ
 SMPTE ST 428-1.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_SMPTE431
 SMPTE RP 431-2.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_SMPTE432
 SMPTE EG 432-1 / DCI P3.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_EBU3213
 EBU Tech. 3213-E.
constexpr ColorPrimaries SDL::COLOR_PRIMARIES_CUSTOM
 COLOR_PRIMARIES_CUSTOM.

TransferCharacteristics

using SDL::TransferCharacteristics = SDL_TransferCharacteristics
 Colorspace transfer characteristics.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_UNKNOWN
 TRANSFER_CHARACTERISTICS_UNKNOWN.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_BT709
 Rec. ITU-R BT.709-6 / ITU-R BT1361.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_UNSPECIFIED
 TRANSFER_CHARACTERISTICS_UNSPECIFIED.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_GAMMA22
 ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_GAMMA28
 ITU-R BT.470-6 System B, G.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_BT601
 SMPTE ST 170M / ITU-R BT.601-7 525 or 625.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_SMPTE240
 SMPTE ST 240M.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_LINEAR
 TRANSFER_CHARACTERISTICS_LINEAR.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_LOG100
 TRANSFER_CHARACTERISTICS_LOG100.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_LOG100_SQRT10
 TRANSFER_CHARACTERISTICS_LOG100_SQRT10.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_IEC61966
 IEC 61966-2-4.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_BT1361
 ITU-R BT1361 Extended Colour Gamut.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_SRGB
 IEC 61966-2-1 (sRGB or sYCC).
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_BT2020_10BIT
 ITU-R BT2020 for 10-bit system.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_BT2020_12BIT
 ITU-R BT2020 for 12-bit system.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_PQ
 SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_SMPTE428
 SMPTE ST 428-1.
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_HLG
 ARIB STD-B67, known as "hybrid log-gamma" (HLG).
constexpr TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_CUSTOM
 TRANSFER_CHARACTERISTICS_CUSTOM.

MatrixCoefficients

using SDL::MatrixCoefficients = SDL_MatrixCoefficients
 Colorspace matrix coefficients.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_IDENTITY
 MATRIX_COEFFICIENTS_IDENTITY.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_BT709
 ITU-R BT.709-6.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_UNSPECIFIED
 MATRIX_COEFFICIENTS_UNSPECIFIED.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_FCC
 US FCC Title 47.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_BT470BG
 ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as MATRIX_COEFFICIENTS_BT601.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_BT601
 ITU-R BT.601-7 525.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_SMPTE240
 SMPTE 240M.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_YCGCO
 MATRIX_COEFFICIENTS_YCGCO.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_BT2020_NCL
 ITU-R BT.2020-2 non-constant luminance.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_BT2020_CL
 ITU-R BT.2020-2 constant luminance.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_SMPTE2085
 SMPTE ST 2085.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL
 MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL
 MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_ICTCP
 ITU-R BT.2100-0 ICTCP.
constexpr MatrixCoefficients SDL::MATRIX_COEFFICIENTS_CUSTOM
 MATRIX_COEFFICIENTS_CUSTOM.

ChromaLocations

using SDL::ChromaLocation = SDL_ChromaLocation
 Colorspace chroma sample location.
constexpr ChromaLocation SDL::CHROMA_LOCATION_NONE
 RGB, no chroma sampling.
constexpr ChromaLocation SDL::CHROMA_LOCATION_LEFT = SDL_CHROMA_LOCATION_LEFT
 In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square.
constexpr ChromaLocation SDL::CHROMA_LOCATION_CENTER = SDL_CHROMA_LOCATION_CENTER
 In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square.
constexpr ChromaLocation SDL::CHROMA_LOCATION_TOPLEFT = SDL_CHROMA_LOCATION_TOPLEFT
 In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located").

PixelFormats

constexpr PixelFormat SDL::PIXELFORMAT_UNKNOWN
 UNKNOWN.
constexpr PixelFormat SDL::PIXELFORMAT_INDEX1LSB
 INDEX1LSB.
constexpr PixelFormat SDL::PIXELFORMAT_INDEX1MSB
 INDEX1MSB.
constexpr PixelFormat SDL::PIXELFORMAT_INDEX2LSB
 INDEX2LSB.
constexpr PixelFormat SDL::PIXELFORMAT_INDEX2MSB
 INDEX2MSB.
constexpr PixelFormat SDL::PIXELFORMAT_INDEX4LSB
 INDEX4LSB.
constexpr PixelFormat SDL::PIXELFORMAT_INDEX4MSB
 INDEX4MSB.
constexpr PixelFormat SDL::PIXELFORMAT_INDEX8 = SDL_PIXELFORMAT_INDEX8
 INDEX8.
constexpr PixelFormat SDL::PIXELFORMAT_RGB332 = SDL_PIXELFORMAT_RGB332
 RGB332.
constexpr PixelFormat SDL::PIXELFORMAT_XRGB4444
 XRGB4444.
constexpr PixelFormat SDL::PIXELFORMAT_XBGR4444
 XBGR4444.
constexpr PixelFormat SDL::PIXELFORMAT_XRGB1555
 XRGB1555.
constexpr PixelFormat SDL::PIXELFORMAT_XBGR1555
 XBGR1555.
constexpr PixelFormat SDL::PIXELFORMAT_ARGB4444
 ARGB4444.
constexpr PixelFormat SDL::PIXELFORMAT_RGBA4444
 RGBA4444.
constexpr PixelFormat SDL::PIXELFORMAT_ABGR4444
 ABGR4444.
constexpr PixelFormat SDL::PIXELFORMAT_BGRA4444
 BGRA4444.
constexpr PixelFormat SDL::PIXELFORMAT_ARGB1555
 ARGB1555.
constexpr PixelFormat SDL::PIXELFORMAT_RGBA5551
 RGBA5551.
constexpr PixelFormat SDL::PIXELFORMAT_ABGR1555
 ABGR1555.
constexpr PixelFormat SDL::PIXELFORMAT_BGRA5551
 BGRA5551.
constexpr PixelFormat SDL::PIXELFORMAT_RGB565 = SDL_PIXELFORMAT_RGB565
 RGB565.
constexpr PixelFormat SDL::PIXELFORMAT_BGR565 = SDL_PIXELFORMAT_BGR565
 BGR565.
constexpr PixelFormat SDL::PIXELFORMAT_RGB24 = SDL_PIXELFORMAT_RGB24
 RGB24.
constexpr PixelFormat SDL::PIXELFORMAT_BGR24 = SDL_PIXELFORMAT_BGR24
 BGR24.
constexpr PixelFormat SDL::PIXELFORMAT_XRGB8888
 XRGB8888.
constexpr PixelFormat SDL::PIXELFORMAT_RGBX8888
 RGBX8888.
constexpr PixelFormat SDL::PIXELFORMAT_XBGR8888
 XBGR8888.
constexpr PixelFormat SDL::PIXELFORMAT_BGRX8888
 BGRX8888.
constexpr PixelFormat SDL::PIXELFORMAT_ARGB8888
 ARGB8888.
constexpr PixelFormat SDL::PIXELFORMAT_RGBA8888
 RGBA8888.
constexpr PixelFormat SDL::PIXELFORMAT_ABGR8888
 ABGR8888.
constexpr PixelFormat SDL::PIXELFORMAT_BGRA8888
 BGRA8888.
constexpr PixelFormat SDL::PIXELFORMAT_XRGB2101010
 XRGB2101010.
constexpr PixelFormat SDL::PIXELFORMAT_XBGR2101010
 XBGR2101010.
constexpr PixelFormat SDL::PIXELFORMAT_ARGB2101010
 ARGB2101010.
constexpr PixelFormat SDL::PIXELFORMAT_ABGR2101010
 ABGR2101010.
constexpr PixelFormat SDL::PIXELFORMAT_RGB48 = SDL_PIXELFORMAT_RGB48
 RGB48.
constexpr PixelFormat SDL::PIXELFORMAT_BGR48 = SDL_PIXELFORMAT_BGR48
 BGR48.
constexpr PixelFormat SDL::PIXELFORMAT_RGBA64 = SDL_PIXELFORMAT_RGBA64
 RGBA64.
constexpr PixelFormat SDL::PIXELFORMAT_ARGB64 = SDL_PIXELFORMAT_ARGB64
 ARGB64.
constexpr PixelFormat SDL::PIXELFORMAT_BGRA64 = SDL_PIXELFORMAT_BGRA64
 BGRA64.
constexpr PixelFormat SDL::PIXELFORMAT_ABGR64 = SDL_PIXELFORMAT_ABGR64
 ABGR64.
constexpr PixelFormat SDL::PIXELFORMAT_RGB48_FLOAT
 RGB48_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_BGR48_FLOAT
 BGR48_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_RGBA64_FLOAT
 RGBA64_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_ARGB64_FLOAT
 ARGB64_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_BGRA64_FLOAT
 BGRA64_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_ABGR64_FLOAT
 ABGR64_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_RGB96_FLOAT
 RGB96_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_BGR96_FLOAT
 BGR96_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_RGBA128_FLOAT
 RGBA128_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_ARGB128_FLOAT
 ARGB128_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_BGRA128_FLOAT
 BGRA128_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_ABGR128_FLOAT
 ABGR128_FLOAT.
constexpr PixelFormat SDL::PIXELFORMAT_YV12
 Planar mode: Y + V + U (3 planes).
constexpr PixelFormat SDL::PIXELFORMAT_IYUV
 Planar mode: Y + U + V (3 planes).
constexpr PixelFormat SDL::PIXELFORMAT_YUY2
 Packed mode: Y0+U0+Y1+V0 (1 plane).
constexpr PixelFormat SDL::PIXELFORMAT_UYVY
 Packed mode: U0+Y0+V0+Y1 (1 plane).
constexpr PixelFormat SDL::PIXELFORMAT_YVYU
 Packed mode: Y0+V0+Y1+U0 (1 plane).
constexpr PixelFormat SDL::PIXELFORMAT_NV12
 Planar mode: Y + U/V interleaved (2 planes).
constexpr PixelFormat SDL::PIXELFORMAT_NV21
 Planar mode: Y + V/U interleaved (2 planes).
constexpr PixelFormat SDL::PIXELFORMAT_P010
 Planar mode: Y + U/V interleaved (2 planes).
constexpr PixelFormat SDL::PIXELFORMAT_EXTERNAL_OES
 Android video texture format.
constexpr PixelFormat SDL::PIXELFORMAT_MJPG = SDL_PIXELFORMAT_MJPG
 Motion JPEG.
constexpr PixelFormat SDL::PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA32
 RGBA32.
constexpr PixelFormat SDL::PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB32
 ARGB32.
constexpr PixelFormat SDL::PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA32
 BGRA32.
constexpr PixelFormat SDL::PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR32
 ABGR32.
constexpr PixelFormat SDL::PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX32
 RGBX32.
constexpr PixelFormat SDL::PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB32
 XRGB32.
constexpr PixelFormat SDL::PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX32
 BGRX32.
constexpr PixelFormat SDL::PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR32
 XBGR32.

Colorspaces

constexpr Colorspace SDL::COLORSPACE_UNKNOWN = SDL_COLORSPACE_UNKNOWN
 UNKNOWN.
constexpr Colorspace SDL::COLORSPACE_SRGB = SDL_COLORSPACE_SRGB
 Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709.
constexpr Colorspace SDL::COLORSPACE_SRGB_LINEAR = SDL_COLORSPACE_SRGB_LINEAR
 Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709.
constexpr Colorspace SDL::COLORSPACE_HDR10 = SDL_COLORSPACE_HDR10
 Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020.
constexpr Colorspace SDL::COLORSPACE_JPEG = SDL_COLORSPACE_JPEG
 Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601.
constexpr Colorspace SDL::COLORSPACE_BT601_LIMITED = SDL_COLORSPACE_BT601_LIMITED
 Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601.
constexpr Colorspace SDL::COLORSPACE_BT601_FULL = SDL_COLORSPACE_BT601_FULL
 Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601.
constexpr Colorspace SDL::COLORSPACE_BT709_LIMITED = SDL_COLORSPACE_BT709_LIMITED
 Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709.
constexpr Colorspace SDL::COLORSPACE_BT709_FULL = SDL_COLORSPACE_BT709_FULL
 Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709.
constexpr Colorspace SDL::COLORSPACE_BT2020_LIMITED = SDL_COLORSPACE_BT2020_LIMITED
 Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020.
constexpr Colorspace SDL::COLORSPACE_BT2020_FULL = SDL_COLORSPACE_BT2020_FULL
 Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020.
constexpr Colorspace SDL::COLORSPACE_RGB_DEFAULT = SDL_COLORSPACE_RGB_DEFAULT
 The default colorspace for RGB surfaces if no colorspace is specified.
constexpr Colorspace SDL::COLORSPACE_YUV_DEFAULT = SDL_COLORSPACE_YUV_DEFAULT
 The default colorspace for YUV surfaces if no colorspace is specified.

Detailed Description

SDL offers facilities for pixel management.

Largely these facilities deal with pixel format: what does this set of bits represent?

If you mostly want to think of a pixel as some combination of red, green, blue, and maybe alpha intensities, this is all pretty straightforward, and in many cases, is enough information to build a perfectly fine game.

However, the actual definition of a pixel is more complex than that:

Pixels are a representation of a color in a particular color space.

The first characteristic of a color space is the color type. SDL understands two different color types, RGB and YCbCr, or in SDL also referred to as YUV.

RGB colors consist of red, green, and blue channels of color that are added together to represent the colors we see on the screen.

https://en.wikipedia.org/wiki/RGB_color_model

YCbCr colors represent colors as a Y luma brightness component and red and blue chroma color offsets. This color representation takes advantage of the fact that the human eye is more sensitive to brightness than the color in an image. The Cb and Cr components are often compressed and have lower resolution than the luma component.

https://en.wikipedia.org/wiki/YCbCr

When the color information in YCbCr is compressed, the Y pixels are left at full resolution and each Cr and Cb pixel represents an average of the color information in a block of Y pixels. The chroma location determines where in that block of pixels the color information is coming from.

The color range defines how much of the pixel to use when converting a pixel into a color on the display. When the full color range is used, the entire numeric range of the pixel bits is significant. When narrow color range is used, for historical reasons, the pixel uses only a portion of the numeric range to represent colors.

The color primaries and white point are a definition of the colors in the color space relative to the standard XYZ color space.

https://en.wikipedia.org/wiki/CIE_1931_color_space

The transfer characteristic, or opto-electrical transfer function (OETF), is the way a color is converted from mathematically linear space into a non-linear output signals.

https://en.wikipedia.org/wiki/Rec._709#Transfer_characteristics

The matrix coefficients are used to convert between YCbCr and RGB colors.

Typedef Documentation

◆ ArrayOrder

using SDL::ArrayOrder = SDL_ArrayOrder

Array component order, low byte -> high byte.

Since
This enum is available since SDL 3.2.0.

◆ BitmapOrder

using SDL::BitmapOrder = SDL_BitmapOrder

Bitmap pixel order, high bit -> low bit.

Since
This enum is available since SDL 3.2.0.

◆ ChromaLocation

using SDL::ChromaLocation = SDL_ChromaLocation

Colorspace chroma sample location.

Since
This enum is available since SDL 3.2.0.

◆ ColorPrimaries

using SDL::ColorPrimaries = SDL_ColorPrimaries

Colorspace color primaries, as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en.

Since
This enum is available since SDL 3.2.0.

◆ ColorRange

using SDL::ColorRange = SDL_ColorRange

Colorspace color range, as described by https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en.

Since
This enum is available since SDL 3.2.0.

◆ ColorType

using SDL::ColorType = SDL_ColorType

Colorspace color type.

Since
This enum is available since SDL 3.2.0.

◆ MatrixCoefficients

using SDL::MatrixCoefficients = SDL_MatrixCoefficients

Colorspace matrix coefficients.

These are as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en

Since
This enum is available since SDL 3.2.0.

◆ PackedLayout

using SDL::PackedLayout = SDL_PackedLayout

Packed component layout.

Since
This enum is available since SDL 3.2.0.

◆ PackedOrder

using SDL::PackedOrder = SDL_PackedOrder

Packed component order, high bit -> low bit.

Since
This enum is available since SDL 3.2.0.

◆ PaletteRef

Reference for Palette.

This does not take ownership!

◆ PixelFormatDetails

using SDL::PixelFormatDetails = SDL_PixelFormatDetails

Details about the format of a pixel.

Since
This struct is available since SDL 3.2.0.

◆ PixelType

using SDL::PixelType = SDL_PixelType

Pixel type.

Since
This enum is available since SDL 3.2.0.

◆ TransferCharacteristics

using SDL::TransferCharacteristics = SDL_TransferCharacteristics

Colorspace transfer characteristics.

These are as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en

Since
This enum is available since SDL 3.2.0.

Function Documentation

◆ Colorspace()

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

Define custom Colorspace formats.

For example, defining COLORSPACE_SRGB looks like this:

constexpr Colorspace(ColorspaceRaw cspace={}) noexcept
Wraps Colorspace.
Definition SDL3pp_pixels.h:1616
constexpr ColorPrimaries COLOR_PRIMARIES_BT709
ITU-R BT.709-6.
Definition SDL3pp_pixels.h:1358
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_SRGB
IEC 61966-2-1 (sRGB or sYCC).
Definition SDL3pp_pixels.h:1454
constexpr ColorType COLOR_TYPE_RGB
COLOR_TYPE_RGB.
Definition SDL3pp_pixels.h:1309
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:1338
constexpr ChromaLocation CHROMA_LOCATION_NONE
RGB, no chroma sampling.
Definition SDL3pp_pixels.h:1557
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_IDENTITY
MATRIX_COEFFICIENTS_IDENTITY.
Definition SDL3pp_pixels.h:1493
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 function from any thread.
Since
This function is available since SDL 3.2.0.

◆ ColorspaceChroma()

ChromaLocation SDL::ColorspaceChroma ( ColorspaceRaw cspace)
constexpr

A macro to retrieve the chroma sample location of an Colorspace.

Parameters
cspacean Colorspace to check.
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.

◆ ColorspaceMatrix()

MatrixCoefficients SDL::ColorspaceMatrix ( ColorspaceRaw cspace)
constexpr

A macro to retrieve the matrix coefficients of an Colorspace.

Parameters
cspacean Colorspace to check.
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.

◆ ColorspacePrimaries()

ColorPrimaries SDL::ColorspacePrimaries ( ColorspaceRaw cspace)
constexpr

A macro to retrieve the primaries of an Colorspace.

Parameters
cspacean Colorspace to check.
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.

◆ ColorspaceRange()

ColorRange SDL::ColorspaceRange ( ColorspaceRaw cspace)
constexpr

A macro to retrieve the range of an Colorspace.

Parameters
cspacean Colorspace to check.
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.

◆ ColorspaceTransfer()

TransferCharacteristics SDL::ColorspaceTransfer ( ColorspaceRaw cspace)
constexpr

A macro to retrieve the transfer characteristics of an Colorspace.

Parameters
cspacean Colorspace to check.
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.

◆ ColorspaceType()

ColorType SDL::ColorspaceType ( ColorspaceRaw cspace)
constexpr

A macro to retrieve the type of an Colorspace.

Parameters
cspacean Colorspace to check.
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.

◆ CreatePalette()

Palette SDL::CreatePalette ( int ncolors)
inline

Create a palette structure with the specified number of color entries.

The palette entries are initialized to white.

Parameters
ncolorsrepresents the number of color entries in the color palette.
Returns
a new Palette structure on success.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Palette.Destroy
Palette.SetColors
Surface.SetPalette

◆ DefineColorspace()

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

A macro for defining custom Colorspace formats.

For example, defining COLORSPACE_SRGB looks like this:

constexpr Colorspace DefineColorspace(ColorType type, ColorRange range, ColorPrimaries primaries, TransferCharacteristics transfer, MatrixCoefficients matrix, ChromaLocation chroma)
A macro for defining custom Colorspace formats.
Definition SDL3pp_pixels.h:1857
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.
Returns
a format value in the style of Colorspace.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ DefinePixelFormat()

PixelFormat SDL::DefinePixelFormat ( PixelType type,
int order,
PackedLayout layout,
int bits,
int bytes )
constexpr

A macro for defining custom non-FourCC pixel formats.

For example, defining PIXELFORMAT_RGBA8888 looks like this:

32, 4)
constexpr PixelType PIXELTYPE_PACKED32
PACKED32.
Definition SDL3pp_pixels.h:182
constexpr PixelFormat DefinePixelFormat(PixelType type, int order, PackedLayout layout, int bits, int bytes)
A macro for defining custom non-FourCC pixel formats.
Definition SDL3pp_pixels.h:965
constexpr PackedOrder PACKEDORDER_RGBA
RGBA.
Definition SDL3pp_pixels.h:238
constexpr PackedLayout PACKEDLAYOUT_8888
8888
Definition SDL3pp_pixels.h:302
Parameters
typethe type of the new format, probably a PixelType value.
orderthe order of the new format, probably a BitmapOrder, PackedOrder, or ArrayOrder value.
layoutthe layout of the new format, probably an PackedLayout value or zero.
bitsthe number of bits per pixel of the new format.
bytesthe number of bytes per pixel of the new format.
Returns
a format value in the style of PixelFormat.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ DefinePixelFourCC()

Uint32 SDL::DefinePixelFourCC ( Uint8 A,
Uint8 B,
Uint8 C,
Uint8 D )
constexpr

A function for defining custom FourCC pixel formats.

For example, defining PIXELFORMAT_YV12 looks like this:

DefinePixelFourCC('Y', 'V', '1', '2')
constexpr Uint32 DefinePixelFourCC(Uint8 A, Uint8 B, Uint8 C, Uint8 D)
A function for defining custom FourCC pixel formats.
Definition SDL3pp_pixels.h:937
Parameters
Athe first character of the FourCC code.
Bthe second character of the FourCC code.
Cthe third character of the FourCC code.
Dthe fourth character of the FourCC code.
Returns
a format value in the style of PixelFormat.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ Destroy()

void SDL::Palette::Destroy ( )
inline

Free a palette created with CreatePalette().

Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread.
Since
This function is available since SDL 3.2.0.
See also
CreatePalette

◆ DestroyPalette()

void SDL::DestroyPalette ( PaletteRaw palette)
inline

Free a palette created with CreatePalette().

Parameters
palettethe Palette structure to be freed.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread.
Since
This function is available since SDL 3.2.0.
See also
CreatePalette

◆ ForMasks()

PixelFormat SDL::PixelFormat::ForMasks ( int bpp,
Uint32 Rmask,
Uint32 Gmask,
Uint32 Bmask,
Uint32 Amask )
inlinestatic

Convert a bpp value and RGBA masks to an enumerated pixel format.

This will return PIXELFORMAT_UNKNOWN if the conversion wasn't possible.

Parameters
bppa bits per pixel value; usually 15, 16, or 32.
Rmaskthe red mask for the format.
Gmaskthe green mask for the format.
Bmaskthe blue mask for the format.
Amaskthe alpha mask for the format.
Returns
the PixelFormat value corresponding to the format masks, or PIXELFORMAT_UNKNOWN if there isn't a match.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetMasks

◆ Get() [1/2]

Color SDL::Color::Get ( Uint32 pixel,
const PixelFormatDetails & format,
PaletteConstRef palette = {} )
inlinestatic

Get RGBA values from a pixel in the specified format.

This function uses the entire 8-bit [0..255] range when converting color components from pixel formats with less than 8-bits per RGB component (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).

If the surface has no alpha component, the alpha will be returned as 0xff (100% opaque).

Parameters
pixela pixel value.
formata pointer to PixelFormatDetails describing the pixel format.
palettean optional palette for indexed formats, may be NULL.
Returns
a color value.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetDetails()
GetRGBA()
Map()

◆ Get() [2/2]

Color SDL::PixelFormat::Get ( Uint32 pixel,
PaletteConstRef palette = {} ) const
inline

Get RGBA values from a pixel in the specified format.

This function uses the entire 8-bit [0..255] range when converting color components from pixel formats with less than 8-bits per RGB component (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).

If the surface has no alpha component, the alpha will be returned as 0xff (100% opaque).

Parameters
pixela pixel value.
palettean optional palette for indexed formats, may be NULL.
Returns
a color value.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified.
Since
This function is available since SDL 3.2.0.
See also
GetPixelFormatDetails()
GetRGBA()
Map()

◆ GetBitsPerPixel()

int SDL::PixelFormat::GetBitsPerPixel ( ) const
constexpr

Determine this's bits per pixel.

FourCC formats will report zero here, as it rarely makes sense to measure them per-pixel.

Returns
the bits-per-pixel.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
GetBytesPerPixel

◆ GetBytesPerPixel()

int SDL::PixelFormat::GetBytesPerPixel ( ) const
constexpr

Determine this'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.

Returns
the bytes-per-pixel.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
GetBitsPerPixel

◆ GetChroma()

ChromaLocation SDL::Colorspace::GetChroma ( ) const
constexpr

Retrieve the chroma sample location of an Colorspace.

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.

◆ GetColor()

Color SDL::GetColor ( Uint32 pixel,
const PixelFormatDetails & format,
PaletteConstRef palette = {} )
inline

Get RGBA values from a pixel in the specified format.

This function uses the entire 8-bit [0..255] range when converting color components from pixel formats with less than 8-bits per RGB component (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).

If the surface has no alpha component, the alpha will be returned as 0xff (100% opaque).

Parameters
pixela pixel value.
formata pointer to PixelFormatDetails describing the pixel format.
palettean optional palette for indexed formats, may be nullptr.
Returns
a color value.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetDetails
GetRGB
MapRGB
MapRGBA

◆ GetDetails()

const PixelFormatDetails & SDL::PixelFormat::GetDetails ( ) const
inline

Create an PixelFormatDetails structure corresponding to a pixel format.

Returned structure may come from a shared global cache (i.e. not newly allocated), and hence should not be modified, especially the palette. Weird errors such as Blit combination not supported may occur.

Returns
a PixelFormatDetails structure on success
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetFlags()

Uint8 SDL::PixelFormat::GetFlags ( ) const
constexpr

Retrieve the flags of an PixelFormat.

This function is generally not needed directly by an app, which should use specific tests, like PixelFormat.IsFourCC, instead.

Returns
the flags of format.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetLayout()

PackedLayout SDL::PixelFormat::GetLayout ( ) const
constexpr

Retrieve the layout.

This is usually a value from the PackedLayout enumeration, or zero if a layout doesn't make sense for the format type.

Returns
the layout
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetMasks()

void SDL::PixelFormat::GetMasks ( int * bpp,
Uint32 * Rmask,
Uint32 * Gmask,
Uint32 * Bmask,
Uint32 * Amask ) const
inline

Convert one of the enumerated pixel formats to a bpp value and RGBA masks.

Parameters
bppa bits per pixel value; usually 15, 16, or 32.
Rmaska pointer filled in with the red mask for the format.
Gmaska pointer filled in with the green mask for the format.
Bmaska pointer filled in with the blue mask for the format.
Amaska pointer filled in with the alpha mask for the format.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.ForMasks

◆ GetMasksForPixelFormat()

void SDL::GetMasksForPixelFormat ( PixelFormatRaw format,
int * bpp,
Uint32 * Rmask,
Uint32 * Gmask,
Uint32 * Bmask,
Uint32 * Amask )
inline

Convert one of the enumerated pixel formats to a bpp value and RGBA masks.

Parameters
formatone of the PixelFormat values.
bppa bits per pixel value; usually 15, 16, or 32.
Rmaska pointer filled in with the red mask for the format.
Gmaska pointer filled in with the green mask for the format.
Bmaska pointer filled in with the blue mask for the format.
Amaska pointer filled in with the alpha mask for the format.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.ForMasks

◆ GetMatrix()

MatrixCoefficients SDL::Colorspace::GetMatrix ( ) const
constexpr

Retrieve the matrix coefficients of an Colorspace.

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.

◆ GetName()

const char * SDL::PixelFormat::GetName ( ) const
inline

Get the human readable name of a pixel format.

Returns
the human readable name of the specified pixel format or "PIXELFORMAT_UNKNOWN" if the format isn't recognized.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetOrder()

int SDL::PixelFormat::GetOrder ( ) const
constexpr

Retrieve the order.

This is usually a value from the BitmapOrder, PackedOrder, or ArrayOrder enumerations, depending on the format type.

Returns
the order.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetPixelFormatDetails()

const PixelFormatDetails & SDL::GetPixelFormatDetails ( PixelFormatRaw format)
inline

Create an PixelFormatDetails structure corresponding to a pixel format.

Returned structure may come from a shared global cache (i.e. not newly allocated), and hence should not be modified, especially the palette. Weird errors such as Blit combination not supported may occur.

Parameters
formatone of the PixelFormat values.
Returns
a PixelFormatDetails structure on success
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetPixelFormatForMasks()

PixelFormat SDL::GetPixelFormatForMasks ( int bpp,
Uint32 Rmask,
Uint32 Gmask,
Uint32 Bmask,
Uint32 Amask )
inline

Convert a bpp value and RGBA masks to an enumerated pixel format.

This will return PIXELFORMAT_UNKNOWN if the conversion wasn't possible.

Parameters
bppa bits per pixel value; usually 15, 16, or 32.
Rmaskthe red mask for the format.
Gmaskthe green mask for the format.
Bmaskthe blue mask for the format.
Amaskthe alpha mask for the format.
Returns
the PixelFormat value corresponding to the format masks, or PIXELFORMAT_UNKNOWN if there isn't a match.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetMasks

◆ GetPixelFormatName()

const char * SDL::GetPixelFormatName ( PixelFormatRaw format)
inline

Get the human readable name of a pixel format.

Parameters
formatthe pixel format to query.
Returns
the human readable name of the specified pixel format or "PIXELFORMAT_UNKNOWN" if the format isn't recognized.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetPrimaries()

ColorPrimaries SDL::Colorspace::GetPrimaries ( ) const
constexpr

Retrieve the primaries of an Colorspace.

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()

ColorRange SDL::Colorspace::GetRange ( ) const
constexpr

Retrieve the range of a Colorspace.

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.

◆ GetRGB()

void SDL::GetRGB ( Uint32 pixelvalue,
const PixelFormatDetails & format,
PaletteConstRef palette,
Uint8 * r,
Uint8 * g,
Uint8 * b )
inline

Get RGB values from a pixel in the specified format.

This function uses the entire 8-bit [0..255] range when converting color components from pixel formats with less than 8-bits per RGB component (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).

Parameters
pixelvaluea pixel value.
formata pointer to PixelFormatDetails describing the pixel format.
palettean optional palette for indexed formats, may be nullptr.
ra pointer filled in with the red component, may be nullptr.
ga pointer filled in with the green component, may be nullptr.
ba pointer filled in with the blue component, may be nullptr.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetDetails
GetRGBA
MapRGB
MapColor

◆ GetRGBA()

void SDL::GetRGBA ( Uint32 pixelvalue,
const PixelFormatDetails & format,
PaletteConstRef palette,
Uint8 * r,
Uint8 * g,
Uint8 * b,
Uint8 * a )
inline

Get RGBA values from a pixel in the specified format.

This function uses the entire 8-bit [0..255] range when converting color components from pixel formats with less than 8-bits per RGB component (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).

If the surface has no alpha component, the alpha will be returned as 0xff (100% opaque).

Parameters
pixelvaluea pixel value.
formata pointer to PixelFormatDetails describing the pixel format.
palettean optional palette for indexed formats, may be nullptr.
ra pointer filled in with the red component, may be nullptr.
ga pointer filled in with the green component, may be nullptr.
ba pointer filled in with the blue component, may be nullptr.
aa pointer filled in with the alpha component, may be nullptr.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetDetails
GetRGB
MapRGB
MapColor

◆ GetTransfer()

TransferCharacteristics SDL::Colorspace::GetTransfer ( ) const
constexpr

Retrieve the transfer characteristics of an Colorspace.

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() [1/2]

ColorType SDL::Colorspace::GetType ( ) const
constexpr

Retrieve the type of a Colorspace.

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.

◆ GetType() [2/2]

PixelType SDL::PixelFormat::GetType ( ) const
constexpr

Retrieve the type.

Returns
the type as PixelType.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ Is10Bit()

bool SDL::PixelFormat::Is10Bit ( ) const
constexpr

Determine if this is a 10-bit format.

Returns
true if the format is 10-bit, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsAlpha()

bool SDL::PixelFormat::IsAlpha ( ) const
constexpr

Determine if this has an alpha channel.

Returns
true if the format has alpha, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsArray()

bool SDL::PixelFormat::IsArray ( ) const
constexpr

Determine if this is an array format.

Returns
true if the format is an array, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsColorspaceFullRange()

bool SDL::IsColorspaceFullRange ( ColorspaceRaw cspace)
constexpr

A macro to determine if an Colorspace has a full range.

Parameters
cspacean Colorspace to check.
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.

◆ IsColorspaceLimitedRange()

bool SDL::IsColorspaceLimitedRange ( ColorspaceRaw cspace)
constexpr

A macro to determine if an Colorspace has a limited range.

Parameters
cspacean Colorspace to check.
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.

◆ IsColorspaceMatrixBT2020_NCL()

bool SDL::IsColorspaceMatrixBT2020_NCL ( ColorspaceRaw cspace)
constexpr

Determine if an Colorspace uses BT2020_NCL matrix coefficients.

Parameters
cspacean Colorspace to check.
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.

◆ IsColorspaceMatrixBT601()

bool SDL::IsColorspaceMatrixBT601 ( ColorspaceRaw cspace)
constexpr

A macro to determine if an Colorspace uses BT601 (or BT470BG) matrix coefficients.

Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.

Parameters
cspacean Colorspace to check.
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.

◆ IsColorspaceMatrixBT709()

bool SDL::IsColorspaceMatrixBT709 ( ColorspaceRaw cspace)
constexpr

A macro to determine if an Colorspace uses BT709 matrix coefficients.

Parameters
cspacean Colorspace to check.
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.

◆ IsFloat()

bool SDL::PixelFormat::IsFloat ( ) const
constexpr

Determine if this is a floating point format.

Returns
true if the format is a floating point, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsFourCC()

bool SDL::PixelFormat::IsFourCC ( ) const
constexpr

Determine if this is a "FourCC" format.

This covers custom and other unusual formats.

Returns
true if the format has alpha, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsFullRange()

bool SDL::Colorspace::IsFullRange ( ) const
constexpr

A function to determine if an Colorspace has a full range.

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.

◆ IsIndexed()

bool SDL::PixelFormat::IsIndexed ( ) const
constexpr

Determine if this is an indexed format.

Returns
true if the format is indexed, 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()

bool SDL::Colorspace::IsLimitedRange ( ) const
constexpr

A function to determine if an Colorspace has a limited range.

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()

bool SDL::Colorspace::IsMatrixBT2020_NCL ( ) const
constexpr

Determine if an Colorspace uses BT2020_NCL matrix coefficients.

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()

bool SDL::Colorspace::IsMatrixBT601 ( ) const
constexpr

Determine if a Colorspace uses BT601 (or BT470BG) matrix coefficients.

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()

bool SDL::Colorspace::IsMatrixBT709 ( ) const
constexpr

Determine if an Colorspace uses BT709 matrix coefficients.

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.

◆ IsPacked()

bool SDL::PixelFormat::IsPacked ( ) const
constexpr

Determine if this is a packed format.

Returns
true if the format is packed, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsPixelFormat10Bit()

bool SDL::IsPixelFormat10Bit ( PixelFormatRaw format)
constexpr

A macro to determine if an PixelFormat is a 10-bit format.

Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.

Parameters
formatan PixelFormat to check.
Returns
true if the format is 10-bit, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsPixelFormatAlpha()

bool SDL::IsPixelFormatAlpha ( PixelFormatRaw format)
constexpr

A macro to determine if an PixelFormat has an alpha channel.

Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.

Parameters
formatan PixelFormat to check.
Returns
true if the format has alpha, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsPixelFormatArray()

bool SDL::IsPixelFormatArray ( PixelFormatRaw format)
constexpr

A macro to determine if an PixelFormat is an array format.

Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.

Parameters
formatan PixelFormat to check.
Returns
true if the format is an array, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsPixelFormatFloat()

bool SDL::IsPixelFormatFloat ( PixelFormatRaw format)
constexpr

A macro to determine if an PixelFormat is a floating point format.

Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.

Parameters
formatan PixelFormat to check.
Returns
true if the format is a floating point, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsPixelFormatFourCC()

bool SDL::IsPixelFormatFourCC ( PixelFormatRaw format)
constexpr

A macro to determine if an 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.

Parameters
formatan PixelFormat to check.
Returns
true if the format has alpha, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsPixelFormatIndexed()

bool SDL::IsPixelFormatIndexed ( PixelFormatRaw format)
constexpr

A macro to determine if an PixelFormat is an indexed format.

Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.

Parameters
formatan PixelFormat to check.
Returns
true if the format is indexed, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ IsPixelFormatPacked()

bool SDL::IsPixelFormatPacked ( PixelFormatRaw format)
constexpr

A macro to determine if an PixelFormat is a packed format.

Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.

Parameters
formatan PixelFormat to check.
Returns
true if the format is packed, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ Map() [1/2]

Uint32 SDL::Color::Map ( const PixelFormatDetails & format,
PaletteConstRef palette ) const
inline

Map an RGBA quadruple to a pixel value for a given pixel format.

This function maps the RGBA color value to the specified pixel format and returns the pixel value best approximating the given RGBA color value for the given pixel format.

If the specified pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette).

If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned.

If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

Parameters
formata pointer to PixelFormatDetails describing the pixel format.
palettean optional palette for indexed formats, may be NULL.
Returns
a pixel value.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified.

◆ Map() [2/2]

Uint32 SDL::PixelFormat::Map ( ColorRaw c,
PaletteConstRef palette = {} ) const
inline

Map an RGBA quadruple to a pixel value for a given pixel format.

This function maps the RGBA color value to the specified pixel format and returns the pixel value best approximating the given RGBA color value for the given pixel format.

If the specified pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette).

If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned.

If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

Parameters
cthe color components of the pixel in the range 0-255.
palettean optional palette for indexed formats, may be NULL.
Returns
a pixel value.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified.
Since
This function is available since SDL 3.2.0.
See also
GetPixelFormatDetails()
Get()
MapRGBA()
Surface.MapColor()

◆ MapColor()

Uint32 SDL::MapColor ( const PixelFormatDetails & format,
ColorRaw c,
PaletteConstRef palette = {} )
inline

Map an RGBA quadruple to a pixel value for a given pixel format.

This function maps the RGBA color value to the specified pixel format and returns the pixel value best approximating the given RGBA color value for the given pixel format.

If the specified pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette).

If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned.

If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

Parameters
formata pointer to PixelFormatDetails describing the pixel format.
cthe color components of the pixel in the range 0-255.
palettean optional palette for indexed formats, may be nullptr.
Returns
a pixel value.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetDetails
GetRGBA
MapRGB
Surface.MapRGBA

◆ MapRGB()

Uint32 SDL::MapRGB ( const PixelFormatDetails & format,
PaletteConstRef palette,
Uint8 r,
Uint8 g,
Uint8 b )
inline

Map an RGB triple to an opaque pixel value for a given pixel format.

This function maps the RGB color value to the specified pixel format and returns the pixel value best approximating the given RGB color value for the given pixel format.

If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned.

If the specified pixel format has an alpha component it will be returned as all 1 bits (fully opaque).

If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

Parameters
formata pointer to PixelFormatDetails describing the pixel format.
palettean optional palette for indexed formats, may be nullptr.
rthe red component of the pixel in the range 0-255.
gthe green component of the pixel in the range 0-255.
bthe blue component of the pixel in the range 0-255.
Returns
a pixel value.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetDetails
GetRGB
MapColor
Surface.MapRGB

◆ MapRGBA()

Uint32 SDL::MapRGBA ( const PixelFormatDetails & format,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a,
PaletteConstRef palette = {} )
inline

Map an RGBA quadruple to a pixel value for a given pixel format.

This function maps the RGBA color value to the specified pixel format and returns the pixel value best approximating the given RGBA color value for the given pixel format.

If the specified pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette).

If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned.

If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

Parameters
formata pointer to PixelFormatDetails describing the pixel format.
rthe red component of the pixel in the range 0-255.
gthe green component of the pixel in the range 0-255.
bthe blue component of the pixel in the range 0-255.
athe alpha component of the pixel in the range 0-255.
palettean optional palette for indexed formats, may be nullptr.
Returns
a pixel value.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetDetails
GetRGBA
MapRGB
Surface.MapRGBA

◆ Palette()

SDL::Palette::Palette ( int ncolors)
inline

Create a palette structure with the specified number of color entries.

The palette entries are initialized to white.

Parameters
ncolorsrepresents the number of color entries in the color palette.
Postcondition
a new Palette structure on success.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Palette.Destroy
Palette.SetColors
Surface.SetPalette

◆ PixelFormat()

SDL::PixelFormat::PixelFormat ( PixelType type,
int order,
PackedLayout layout,
int bits,
int bytes )
constexpr

Defining custom non-FourCC pixel formats.

For example, defining PIXELFORMAT_RGBA8888 looks like this:

constexpr PixelFormat(PixelFormatRaw format={}) noexcept
Wraps PixelFormat.
Definition SDL3pp_pixels.h:367
Parameters
typethe type of the new format, probably a PixelType value.
orderthe order of the new format, probably a BitmapOrder, PackedOrder, or ArrayOrder value.
layoutthe layout of the new format, probably an PackedLayout value or zero.
bitsthe number of bits per pixel of the new format.
bytesthe number of bytes per pixel of the new format.
Postcondition
a format value in the style of PixelFormat.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ PixelFormatBitsPerPixel()

int SDL::PixelFormatBitsPerPixel ( PixelFormatRaw format)
constexpr

A macro to determine an 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.

Parameters
formatan PixelFormat to check.
Returns
the bits-per-pixel of format.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetBytesPerPixel

◆ PixelFormatBytesPerPixel()

int SDL::PixelFormatBytesPerPixel ( PixelFormatRaw format)
constexpr

A macro to determine an 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.

Parameters
formatan PixelFormat to check.
Returns
the bytes-per-pixel of format.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
PixelFormat.GetBitsPerPixel

◆ PixelFormatFlags()

Uint8 SDL::PixelFormatFlags ( PixelFormatRaw format)
constexpr

Retrieve the flags of an PixelFormat.

This function is generally not needed directly by an app, which should use specific tests, like PixelFormat.IsFourCC, instead.

Parameters
formatan PixelFormat to check.
Returns
the flags of format.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ PixelFormatLayout()

PackedLayout SDL::PixelFormatLayout ( PixelFormatRaw format)
constexpr

A macro to retrieve the layout of an PixelFormat.

This is usually a value from the PackedLayout enumeration, or zero if a layout doesn't make sense for the format type.

Parameters
formatan PixelFormat to check.
Returns
the layout of format.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ PixelFormatOrder()

int SDL::PixelFormatOrder ( PixelFormatRaw format)
constexpr

A macro to retrieve the order of an PixelFormat.

This is usually a value from the BitmapOrder, PackedOrder, or ArrayOrder enumerations, depending on the format type.

Parameters
formatan PixelFormat to check.
Returns
the order of format.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ PixelFormatType()

PixelType SDL::PixelFormatType ( PixelFormatRaw format)
constexpr

A macro to retrieve the type of an PixelFormat.

This is usually a value from the PixelType enumeration.

Parameters
formatan PixelFormat to check.
Returns
the type of format.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ SetColors()

void SDL::Palette::SetColors ( SpanRef< const ColorRaw > colors,
int firstcolor = 0 )
inline

Set a range of colors in a palette.

Parameters
colorsan array of Color structures to copy into the palette.
firstcolorthe index of the first palette entry to modify.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread.
Since
This function is available since SDL 3.2.0.
See also
Palette.Palette

◆ SetPaletteColors()

void SDL::SetPaletteColors ( PaletteRef palette,
SpanRef< const ColorRaw > colors,
int firstcolor = 0 )
inline

Set a range of colors in a palette.

Parameters
palettethe Palette structure to modify.
colorsan array of Color structures to copy into the palette.
firstcolorthe index of the first palette entry to modify.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread.
Since
This function is available since SDL 3.2.0.

Variable Documentation

◆ ALPHA_OPAQUE

Uint8 SDL::ALPHA_OPAQUE = SDL_ALPHA_OPAQUE
constexpr

A fully opaque 8-bit alpha value.

Since
This constant is available since SDL 3.2.0.
See also
ALPHA_TRANSPARENT

◆ ALPHA_OPAQUE_FLOAT

float SDL::ALPHA_OPAQUE_FLOAT = SDL_ALPHA_OPAQUE_FLOAT
constexpr

A fully opaque floating point alpha value.

Since
This constant is available since SDL 3.2.0.
See also
ALPHA_TRANSPARENT_FLOAT

◆ ALPHA_TRANSPARENT

Uint8 SDL::ALPHA_TRANSPARENT = SDL_ALPHA_TRANSPARENT
constexpr

A fully transparent 8-bit alpha value.

Since
This constant is available since SDL 3.2.0.
See also
ALPHA_OPAQUE

◆ ALPHA_TRANSPARENT_FLOAT

float SDL::ALPHA_TRANSPARENT_FLOAT = SDL_ALPHA_TRANSPARENT_FLOAT
constexpr

A fully transparent floating point alpha value.

Since
This constant is available since SDL 3.2.0.
See also
ALPHA_OPAQUE_FLOAT

◆ CHROMA_LOCATION_CENTER

ChromaLocation SDL::CHROMA_LOCATION_CENTER = SDL_CHROMA_LOCATION_CENTER
constexpr

In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square.

In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel.

◆ CHROMA_LOCATION_LEFT

ChromaLocation SDL::CHROMA_LOCATION_LEFT = SDL_CHROMA_LOCATION_LEFT
constexpr

In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square.

In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically.

◆ CHROMA_LOCATION_NONE

ChromaLocation SDL::CHROMA_LOCATION_NONE
constexpr
Initial value:
=
SDL_CHROMA_LOCATION_NONE

RGB, no chroma sampling.

◆ COLOR_PRIMARIES_BT2020

ColorPrimaries SDL::COLOR_PRIMARIES_BT2020
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_BT2020

ITU-R BT.2020-2 / ITU-R BT.2100-0.

◆ COLOR_PRIMARIES_BT470BG

ColorPrimaries SDL::COLOR_PRIMARIES_BT470BG
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_BT470BG

ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625.

◆ COLOR_PRIMARIES_BT470M

ColorPrimaries SDL::COLOR_PRIMARIES_BT470M
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_BT470M

ITU-R BT.470-6 System M.

◆ COLOR_PRIMARIES_BT601

ColorPrimaries SDL::COLOR_PRIMARIES_BT601
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_BT601

ITU-R BT.601-7 525, SMPTE 170M.

◆ COLOR_PRIMARIES_BT709

ColorPrimaries SDL::COLOR_PRIMARIES_BT709
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_BT709

ITU-R BT.709-6.

◆ COLOR_PRIMARIES_CUSTOM

ColorPrimaries SDL::COLOR_PRIMARIES_CUSTOM
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_CUSTOM

COLOR_PRIMARIES_CUSTOM.

◆ COLOR_PRIMARIES_EBU3213

ColorPrimaries SDL::COLOR_PRIMARIES_EBU3213
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_EBU3213

EBU Tech. 3213-E.

◆ COLOR_PRIMARIES_GENERIC_FILM

ColorPrimaries SDL::COLOR_PRIMARIES_GENERIC_FILM
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_GENERIC_FILM

Generic film (color filters using Illuminant C).

◆ COLOR_PRIMARIES_SMPTE240

ColorPrimaries SDL::COLOR_PRIMARIES_SMPTE240
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_SMPTE240

SMPTE 240M, functionally the same as COLOR_PRIMARIES_BT601.

◆ COLOR_PRIMARIES_SMPTE431

ColorPrimaries SDL::COLOR_PRIMARIES_SMPTE431
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_SMPTE431

SMPTE RP 431-2.

◆ COLOR_PRIMARIES_SMPTE432

ColorPrimaries SDL::COLOR_PRIMARIES_SMPTE432
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_SMPTE432

SMPTE EG 432-1 / DCI P3.

◆ COLOR_PRIMARIES_UNKNOWN

ColorPrimaries SDL::COLOR_PRIMARIES_UNKNOWN
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_UNKNOWN

COLOR_PRIMARIES_UNKNOWN.

◆ COLOR_PRIMARIES_UNSPECIFIED

ColorPrimaries SDL::COLOR_PRIMARIES_UNSPECIFIED
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_UNSPECIFIED

COLOR_PRIMARIES_UNSPECIFIED.

◆ COLOR_PRIMARIES_XYZ

ColorPrimaries SDL::COLOR_PRIMARIES_XYZ
constexpr
Initial value:
=
SDL_COLOR_PRIMARIES_XYZ

SMPTE ST 428-1.

◆ COLOR_RANGE_LIMITED

ColorRange SDL::COLOR_RANGE_LIMITED = SDL_COLOR_RANGE_LIMITED
constexpr

Narrow range, e.g.

16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma

◆ COLOR_RANGE_UNKNOWN

ColorRange SDL::COLOR_RANGE_UNKNOWN
constexpr
Initial value:
=
SDL_COLOR_RANGE_UNKNOWN

COLOR_RANGE_UNKNOWN.

◆ COLOR_TYPE_UNKNOWN

ColorType SDL::COLOR_TYPE_UNKNOWN
constexpr
Initial value:
=
SDL_COLOR_TYPE_UNKNOWN

COLOR_TYPE_UNKNOWN.

◆ COLOR_TYPE_YCBCR

ColorType SDL::COLOR_TYPE_YCBCR
constexpr
Initial value:
=
SDL_COLOR_TYPE_YCBCR

COLOR_TYPE_YCBCR.

◆ MATRIX_COEFFICIENTS_BT2020_CL

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_BT2020_CL
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_BT2020_CL

ITU-R BT.2020-2 constant luminance.

◆ MATRIX_COEFFICIENTS_BT2020_NCL

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_BT2020_NCL
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_BT2020_NCL

ITU-R BT.2020-2 non-constant luminance.

◆ MATRIX_COEFFICIENTS_BT470BG

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_BT470BG
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_BT470BG

ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as MATRIX_COEFFICIENTS_BT601.

◆ MATRIX_COEFFICIENTS_BT601

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_BT601
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_BT601

ITU-R BT.601-7 525.

◆ MATRIX_COEFFICIENTS_BT709

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_BT709
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_BT709

ITU-R BT.709-6.

◆ MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL

MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL.

◆ MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL

MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL.

◆ MATRIX_COEFFICIENTS_CUSTOM

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_CUSTOM
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_CUSTOM

MATRIX_COEFFICIENTS_CUSTOM.

◆ MATRIX_COEFFICIENTS_FCC

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_FCC
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_FCC

US FCC Title 47.

◆ MATRIX_COEFFICIENTS_ICTCP

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_ICTCP
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_ICTCP

ITU-R BT.2100-0 ICTCP.

◆ MATRIX_COEFFICIENTS_IDENTITY

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_IDENTITY
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_IDENTITY

MATRIX_COEFFICIENTS_IDENTITY.

◆ MATRIX_COEFFICIENTS_SMPTE2085

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_SMPTE2085
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_SMPTE2085

SMPTE ST 2085.

◆ MATRIX_COEFFICIENTS_SMPTE240

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_SMPTE240
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_SMPTE240

SMPTE 240M.

◆ MATRIX_COEFFICIENTS_UNSPECIFIED

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_UNSPECIFIED
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_UNSPECIFIED

MATRIX_COEFFICIENTS_UNSPECIFIED.

◆ MATRIX_COEFFICIENTS_YCGCO

MatrixCoefficients SDL::MATRIX_COEFFICIENTS_YCGCO
constexpr
Initial value:
=
SDL_MATRIX_COEFFICIENTS_YCGCO

MATRIX_COEFFICIENTS_YCGCO.

◆ PACKEDLAYOUT_1010102

PackedLayout SDL::PACKEDLAYOUT_1010102
constexpr
Initial value:
=
SDL_PACKEDLAYOUT_1010102

1010102

◆ PACKEDLAYOUT_2101010

PackedLayout SDL::PACKEDLAYOUT_2101010
constexpr
Initial value:
=
SDL_PACKEDLAYOUT_2101010

2101010

◆ PIXELFORMAT_ABGR128_FLOAT

PixelFormat SDL::PIXELFORMAT_ABGR128_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_ABGR128_FLOAT

ABGR128_FLOAT.

◆ PIXELFORMAT_ABGR1555

PixelFormat SDL::PIXELFORMAT_ABGR1555
constexpr
Initial value:
=
SDL_PIXELFORMAT_ABGR1555

ABGR1555.

◆ PIXELFORMAT_ABGR2101010

PixelFormat SDL::PIXELFORMAT_ABGR2101010
constexpr
Initial value:
=
SDL_PIXELFORMAT_ABGR2101010

ABGR2101010.

◆ PIXELFORMAT_ABGR4444

PixelFormat SDL::PIXELFORMAT_ABGR4444
constexpr
Initial value:
=
SDL_PIXELFORMAT_ABGR4444

ABGR4444.

◆ PIXELFORMAT_ABGR64_FLOAT

PixelFormat SDL::PIXELFORMAT_ABGR64_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_ABGR64_FLOAT

ABGR64_FLOAT.

◆ PIXELFORMAT_ABGR8888

PixelFormat SDL::PIXELFORMAT_ABGR8888
constexpr
Initial value:
=
SDL_PIXELFORMAT_ABGR8888

ABGR8888.

◆ PIXELFORMAT_ARGB128_FLOAT

PixelFormat SDL::PIXELFORMAT_ARGB128_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_ARGB128_FLOAT

ARGB128_FLOAT.

◆ PIXELFORMAT_ARGB1555

PixelFormat SDL::PIXELFORMAT_ARGB1555
constexpr
Initial value:
=
SDL_PIXELFORMAT_ARGB1555

ARGB1555.

◆ PIXELFORMAT_ARGB2101010

PixelFormat SDL::PIXELFORMAT_ARGB2101010
constexpr
Initial value:
=
SDL_PIXELFORMAT_ARGB2101010

ARGB2101010.

◆ PIXELFORMAT_ARGB4444

PixelFormat SDL::PIXELFORMAT_ARGB4444
constexpr
Initial value:
=
SDL_PIXELFORMAT_ARGB4444

ARGB4444.

◆ PIXELFORMAT_ARGB64_FLOAT

PixelFormat SDL::PIXELFORMAT_ARGB64_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_ARGB64_FLOAT

ARGB64_FLOAT.

◆ PIXELFORMAT_ARGB8888

PixelFormat SDL::PIXELFORMAT_ARGB8888
constexpr
Initial value:
=
SDL_PIXELFORMAT_ARGB8888

ARGB8888.

◆ PIXELFORMAT_BGR48_FLOAT

PixelFormat SDL::PIXELFORMAT_BGR48_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_BGR48_FLOAT

BGR48_FLOAT.

◆ PIXELFORMAT_BGR96_FLOAT

PixelFormat SDL::PIXELFORMAT_BGR96_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_BGR96_FLOAT

BGR96_FLOAT.

◆ PIXELFORMAT_BGRA128_FLOAT

PixelFormat SDL::PIXELFORMAT_BGRA128_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_BGRA128_FLOAT

BGRA128_FLOAT.

◆ PIXELFORMAT_BGRA4444

PixelFormat SDL::PIXELFORMAT_BGRA4444
constexpr
Initial value:
=
SDL_PIXELFORMAT_BGRA4444

BGRA4444.

◆ PIXELFORMAT_BGRA5551

PixelFormat SDL::PIXELFORMAT_BGRA5551
constexpr
Initial value:
=
SDL_PIXELFORMAT_BGRA5551

BGRA5551.

◆ PIXELFORMAT_BGRA64_FLOAT

PixelFormat SDL::PIXELFORMAT_BGRA64_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_BGRA64_FLOAT

BGRA64_FLOAT.

◆ PIXELFORMAT_BGRA8888

PixelFormat SDL::PIXELFORMAT_BGRA8888
constexpr
Initial value:
=
SDL_PIXELFORMAT_BGRA8888

BGRA8888.

◆ PIXELFORMAT_BGRX8888

PixelFormat SDL::PIXELFORMAT_BGRX8888
constexpr
Initial value:
=
SDL_PIXELFORMAT_BGRX8888

BGRX8888.

◆ PIXELFORMAT_EXTERNAL_OES

PixelFormat SDL::PIXELFORMAT_EXTERNAL_OES
constexpr
Initial value:
=
SDL_PIXELFORMAT_EXTERNAL_OES

Android video texture format.

◆ PIXELFORMAT_INDEX1LSB

PixelFormat SDL::PIXELFORMAT_INDEX1LSB
constexpr
Initial value:
=
SDL_PIXELFORMAT_INDEX1LSB

INDEX1LSB.

◆ PIXELFORMAT_INDEX1MSB

PixelFormat SDL::PIXELFORMAT_INDEX1MSB
constexpr
Initial value:
=
SDL_PIXELFORMAT_INDEX1MSB

INDEX1MSB.

◆ PIXELFORMAT_INDEX2LSB

PixelFormat SDL::PIXELFORMAT_INDEX2LSB
constexpr
Initial value:
=
SDL_PIXELFORMAT_INDEX2LSB

INDEX2LSB.

◆ PIXELFORMAT_INDEX2MSB

PixelFormat SDL::PIXELFORMAT_INDEX2MSB
constexpr
Initial value:
=
SDL_PIXELFORMAT_INDEX2MSB

INDEX2MSB.

◆ PIXELFORMAT_INDEX4LSB

PixelFormat SDL::PIXELFORMAT_INDEX4LSB
constexpr
Initial value:
=
SDL_PIXELFORMAT_INDEX4LSB

INDEX4LSB.

◆ PIXELFORMAT_INDEX4MSB

PixelFormat SDL::PIXELFORMAT_INDEX4MSB
constexpr
Initial value:
=
SDL_PIXELFORMAT_INDEX4MSB

INDEX4MSB.

◆ PIXELFORMAT_IYUV

PixelFormat SDL::PIXELFORMAT_IYUV
constexpr
Initial value:
=
SDL_PIXELFORMAT_IYUV

Planar mode: Y + U + V (3 planes).

◆ PIXELFORMAT_NV12

PixelFormat SDL::PIXELFORMAT_NV12
constexpr
Initial value:
=
SDL_PIXELFORMAT_NV12

Planar mode: Y + U/V interleaved (2 planes).

◆ PIXELFORMAT_NV21

PixelFormat SDL::PIXELFORMAT_NV21
constexpr
Initial value:
=
SDL_PIXELFORMAT_NV21

Planar mode: Y + V/U interleaved (2 planes).

◆ PIXELFORMAT_P010

PixelFormat SDL::PIXELFORMAT_P010
constexpr
Initial value:
=
SDL_PIXELFORMAT_P010

Planar mode: Y + U/V interleaved (2 planes).

◆ PIXELFORMAT_RGB48_FLOAT

PixelFormat SDL::PIXELFORMAT_RGB48_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_RGB48_FLOAT

RGB48_FLOAT.

◆ PIXELFORMAT_RGB96_FLOAT

PixelFormat SDL::PIXELFORMAT_RGB96_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_RGB96_FLOAT

RGB96_FLOAT.

◆ PIXELFORMAT_RGBA128_FLOAT

PixelFormat SDL::PIXELFORMAT_RGBA128_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_RGBA128_FLOAT

RGBA128_FLOAT.

◆ PIXELFORMAT_RGBA4444

PixelFormat SDL::PIXELFORMAT_RGBA4444
constexpr
Initial value:
=
SDL_PIXELFORMAT_RGBA4444

RGBA4444.

◆ PIXELFORMAT_RGBA5551

PixelFormat SDL::PIXELFORMAT_RGBA5551
constexpr
Initial value:
=
SDL_PIXELFORMAT_RGBA5551

RGBA5551.

◆ PIXELFORMAT_RGBA64_FLOAT

PixelFormat SDL::PIXELFORMAT_RGBA64_FLOAT
constexpr
Initial value:
=
SDL_PIXELFORMAT_RGBA64_FLOAT

RGBA64_FLOAT.

◆ PIXELFORMAT_RGBA8888

PixelFormat SDL::PIXELFORMAT_RGBA8888
constexpr
Initial value:
=
SDL_PIXELFORMAT_RGBA8888

RGBA8888.

◆ PIXELFORMAT_RGBX8888

PixelFormat SDL::PIXELFORMAT_RGBX8888
constexpr
Initial value:
=
SDL_PIXELFORMAT_RGBX8888

RGBX8888.

◆ PIXELFORMAT_UNKNOWN

PixelFormat SDL::PIXELFORMAT_UNKNOWN
constexpr
Initial value:
=
SDL_PIXELFORMAT_UNKNOWN

UNKNOWN.

◆ PIXELFORMAT_UYVY

PixelFormat SDL::PIXELFORMAT_UYVY
constexpr
Initial value:
=
SDL_PIXELFORMAT_UYVY

Packed mode: U0+Y0+V0+Y1 (1 plane).

◆ PIXELFORMAT_XBGR1555

PixelFormat SDL::PIXELFORMAT_XBGR1555
constexpr
Initial value:
=
SDL_PIXELFORMAT_XBGR1555

XBGR1555.

◆ PIXELFORMAT_XBGR2101010

PixelFormat SDL::PIXELFORMAT_XBGR2101010
constexpr
Initial value:
=
SDL_PIXELFORMAT_XBGR2101010

XBGR2101010.

◆ PIXELFORMAT_XBGR4444

PixelFormat SDL::PIXELFORMAT_XBGR4444
constexpr
Initial value:
=
SDL_PIXELFORMAT_XBGR4444

XBGR4444.

◆ PIXELFORMAT_XBGR8888

PixelFormat SDL::PIXELFORMAT_XBGR8888
constexpr
Initial value:
=
SDL_PIXELFORMAT_XBGR8888

XBGR8888.

◆ PIXELFORMAT_XRGB1555

PixelFormat SDL::PIXELFORMAT_XRGB1555
constexpr
Initial value:
=
SDL_PIXELFORMAT_XRGB1555

XRGB1555.

◆ PIXELFORMAT_XRGB2101010

PixelFormat SDL::PIXELFORMAT_XRGB2101010
constexpr
Initial value:
=
SDL_PIXELFORMAT_XRGB2101010

XRGB2101010.

◆ PIXELFORMAT_XRGB4444

PixelFormat SDL::PIXELFORMAT_XRGB4444
constexpr
Initial value:
=
SDL_PIXELFORMAT_XRGB4444

XRGB4444.

◆ PIXELFORMAT_XRGB8888

PixelFormat SDL::PIXELFORMAT_XRGB8888
constexpr
Initial value:
=
SDL_PIXELFORMAT_XRGB8888

XRGB8888.

◆ PIXELFORMAT_YUY2

PixelFormat SDL::PIXELFORMAT_YUY2
constexpr
Initial value:
=
SDL_PIXELFORMAT_YUY2

Packed mode: Y0+U0+Y1+V0 (1 plane).

◆ PIXELFORMAT_YV12

PixelFormat SDL::PIXELFORMAT_YV12
constexpr
Initial value:
=
SDL_PIXELFORMAT_YV12

Planar mode: Y + V + U (3 planes).

◆ PIXELFORMAT_YVYU

PixelFormat SDL::PIXELFORMAT_YVYU
constexpr
Initial value:
=
SDL_PIXELFORMAT_YVYU

Packed mode: Y0+V0+Y1+U0 (1 plane).

◆ TRANSFER_CHARACTERISTICS_BT1361

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_BT1361
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_BT1361

ITU-R BT1361 Extended Colour Gamut.

◆ TRANSFER_CHARACTERISTICS_BT2020_10BIT

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_BT2020_10BIT
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT

ITU-R BT2020 for 10-bit system.

◆ TRANSFER_CHARACTERISTICS_BT2020_12BIT

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_BT2020_12BIT
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT

ITU-R BT2020 for 12-bit system.

◆ TRANSFER_CHARACTERISTICS_BT601

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_BT601
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_BT601

SMPTE ST 170M / ITU-R BT.601-7 525 or 625.

◆ TRANSFER_CHARACTERISTICS_BT709

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_BT709
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_BT709

Rec. ITU-R BT.709-6 / ITU-R BT1361.

◆ TRANSFER_CHARACTERISTICS_CUSTOM

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_CUSTOM
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_CUSTOM

TRANSFER_CHARACTERISTICS_CUSTOM.

◆ TRANSFER_CHARACTERISTICS_GAMMA22

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_GAMMA22
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_GAMMA22

ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM.

◆ TRANSFER_CHARACTERISTICS_GAMMA28

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_GAMMA28
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_GAMMA28

ITU-R BT.470-6 System B, G.

◆ TRANSFER_CHARACTERISTICS_HLG

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_HLG
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_HLG

ARIB STD-B67, known as "hybrid log-gamma" (HLG).

◆ TRANSFER_CHARACTERISTICS_IEC61966

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_IEC61966
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_IEC61966

IEC 61966-2-4.

◆ TRANSFER_CHARACTERISTICS_LINEAR

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_LINEAR
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_LINEAR

TRANSFER_CHARACTERISTICS_LINEAR.

◆ TRANSFER_CHARACTERISTICS_LOG100

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_LOG100
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_LOG100

TRANSFER_CHARACTERISTICS_LOG100.

◆ TRANSFER_CHARACTERISTICS_LOG100_SQRT10

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_LOG100_SQRT10
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10

TRANSFER_CHARACTERISTICS_LOG100_SQRT10.

◆ TRANSFER_CHARACTERISTICS_PQ

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_PQ
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_PQ

SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.

◆ TRANSFER_CHARACTERISTICS_SMPTE240

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_SMPTE240
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_SMPTE240

SMPTE ST 240M.

◆ TRANSFER_CHARACTERISTICS_SMPTE428

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_SMPTE428
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_SMPTE428

SMPTE ST 428-1.

◆ TRANSFER_CHARACTERISTICS_SRGB

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_SRGB
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_SRGB

IEC 61966-2-1 (sRGB or sYCC).

◆ TRANSFER_CHARACTERISTICS_UNKNOWN

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_UNKNOWN
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_UNKNOWN

TRANSFER_CHARACTERISTICS_UNKNOWN.

◆ TRANSFER_CHARACTERISTICS_UNSPECIFIED

TransferCharacteristics SDL::TRANSFER_CHARACTERISTICS_UNSPECIFIED
constexpr
Initial value:
=
SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED

TRANSFER_CHARACTERISTICS_UNSPECIFIED.