|
SDL3pp
A slim C++ wrapper for SDL3
|
SDL offers facilities for pixel management. More...
Classes | |
| struct | SDL::PaletteParam |
| Safely wrap Palette for non owning parameters. More... | |
| struct | SDL::PaletteConstParam |
| Safely wrap Palette for non owning const parameters. More... | |
| 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::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::PixelFormatDetails = SDL_PixelFormatDetails |
| Details about the format of a pixel. More... | |
Functions | |
| constexpr Uint32 | SDL::DefinePixelFourCC (Uint8 A, Uint8 B, Uint8 C, Uint8 D) |
| A function for defining custom FourCC pixel formats. More... | |
| constexpr PixelFormat | SDL::DefinePixelFormat (PixelType type, int order, PackedLayout layout, int bits, int bytes) |
| A macro for defining custom non-FourCC pixel formats. More... | |
| constexpr Uint8 | SDL::PixelFormatFlags (PixelFormatRaw format) |
| Retrieve the flags of an PixelFormat. More... | |
| constexpr PixelType | SDL::PixelFormatType (PixelFormatRaw format) |
| A macro to retrieve the type of an PixelFormat. More... | |
| constexpr int | SDL::PixelFormatOrder (PixelFormatRaw format) |
| A macro to retrieve the order of an PixelFormat. More... | |
| constexpr PackedLayout | SDL::PixelFormatLayout (PixelFormatRaw format) |
| A macro to retrieve the layout of an PixelFormat. More... | |
| constexpr int | SDL::PixelFormatBitsPerPixel (PixelFormatRaw format) |
| A macro to determine an PixelFormat's bits per pixel. More... | |
| constexpr int | SDL::PixelFormatBytesPerPixel (PixelFormatRaw format) |
| A macro to determine an PixelFormat's bytes per pixel. More... | |
| constexpr bool | SDL::IsPixelFormatIndexed (PixelFormatRaw format) |
| A macro to determine if an PixelFormat is an indexed format. More... | |
| constexpr bool | SDL::IsPixelFormatPacked (PixelFormatRaw format) |
| A macro to determine if an PixelFormat is a packed format. More... | |
| constexpr bool | SDL::IsPixelFormatArray (PixelFormatRaw format) |
| A macro to determine if an PixelFormat is an array format. More... | |
| constexpr bool | SDL::IsPixelFormat10Bit (PixelFormatRaw format) |
| A macro to determine if an PixelFormat is a 10-bit format. More... | |
| constexpr bool | SDL::IsPixelFormatFloat (PixelFormatRaw format) |
| A macro to determine if an PixelFormat is a floating point format. More... | |
| constexpr Colorspace | SDL::DefineColorspace (ColorType type, ColorRange range, ColorPrimaries primaries, TransferCharacteristics transfer, MatrixCoefficients matrix, ChromaLocation chroma) |
| A macro for defining custom Colorspace formats. More... | |
| constexpr ColorType | SDL::ColorspaceType (ColorspaceRaw cspace) |
| A macro to retrieve the type of an Colorspace. More... | |
| constexpr ColorRange | SDL::ColorspaceRange (ColorspaceRaw cspace) |
| A macro to retrieve the range of an Colorspace. More... | |
| constexpr ChromaLocation | SDL::ColorspaceChroma (ColorspaceRaw cspace) |
| A macro to retrieve the chroma sample location of an Colorspace. More... | |
| constexpr ColorPrimaries | SDL::ColorspacePrimaries (ColorspaceRaw cspace) |
| A macro to retrieve the primaries of an Colorspace. More... | |
| constexpr TransferCharacteristics | SDL::ColorspaceTransfer (ColorspaceRaw cspace) |
| A macro to retrieve the transfer characteristics of an Colorspace. More... | |
| constexpr MatrixCoefficients | SDL::ColorspaceMatrix (ColorspaceRaw cspace) |
| A macro to retrieve the matrix coefficients of an Colorspace. More... | |
| constexpr bool | SDL::IsColorspaceMatrixBT601 (ColorspaceRaw cspace) |
| A macro to determine if an Colorspace uses BT601 (or BT470BG) matrix coefficients. More... | |
| constexpr bool | SDL::IsColorspaceMatrixBT709 (ColorspaceRaw cspace) |
| A macro to determine if an Colorspace uses BT709 matrix coefficients. More... | |
| constexpr bool | SDL::IsColorspaceMatrixBT2020_NCL (ColorspaceRaw cspace) |
| A macro to determine if an Colorspace uses BT2020_NCL matrix coefficients. More... | |
| constexpr bool | SDL::IsColorspaceLimitedRange (ColorspaceRaw cspace) |
| A macro to determine if an Colorspace has a limited range. More... | |
| constexpr bool | SDL::IsColorspaceFullRange (ColorspaceRaw cspace) |
| A macro to determine if an Colorspace has a full range. More... | |
| constexpr bool | SDL::operator== (ColorRaw lhs, ColorRaw rhs) |
| Comparison operator for Color. | |
| constexpr bool | SDL::operator== (const FColorRaw &lhs, const FColorRaw &rhs) |
| Comparison operator for FColor. | |
| constexpr auto | SDL::operator<=> (ColorRaw lhs, ColorRaw rhs) |
| Spaceship operator for Color. | |
| constexpr auto | SDL::operator<=> (const FColorRaw &lhs, const FColorRaw &rhs) |
| Spaceship operator for FColor. | |
| const char * | SDL::GetPixelFormatName (PixelFormatRaw format) |
| Get the human readable name of a pixel format. More... | |
| 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. More... | |
| 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. More... | |
| const PixelFormatDetails & | SDL::GetPixelFormatDetails (PixelFormatRaw format) |
| Create an PixelFormatDetails structure corresponding to a pixel format. More... | |
| Palette | SDL::CreatePalette (int ncolors) |
| Create a palette structure with the specified number of color entries. More... | |
| void | SDL::SetPaletteColors (PaletteParam palette, SpanRef< const ColorRaw > colors, int firstcolor=0) |
| Set a range of colors in a palette. More... | |
| void | SDL::DestroyPalette (PaletteRaw palette) |
| Free a palette created with Palette.Palette(). More... | |
| Uint32 | SDL::MapRGB (const PixelFormatDetails &format, PaletteConstParam palette, Uint8 r, Uint8 g, Uint8 b) |
| Map an RGB triple to an opaque pixel value for a given pixel format. More... | |
| Uint32 | SDL::MapRGBA (const PixelFormatDetails &format, Uint8 r, Uint8 g, Uint8 b, Uint8 a, PaletteConstParam palette={}) |
| Map an RGBA quadruple to a pixel value for a given pixel format. More... | |
| Uint32 | SDL::MapColor (const PixelFormatDetails &format, ColorRaw c, PaletteConstParam palette={}) |
| Map an RGBA quadruple to a pixel value for a given pixel format. More... | |
| void | SDL::GetRGB (Uint32 pixel, const PixelFormatDetails &format, PaletteConstParam palette, Uint8 *r, Uint8 *g, Uint8 *b) |
| Get RGB values from a pixel in the specified format. More... | |
| void | SDL::GetRGBA (Uint32 pixel, const PixelFormatDetails &format, PaletteConstParam palette, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) |
| Get RGBA values from a pixel in the specified format. More... | |
| Color | SDL::GetColor (Uint32 pixel, const PixelFormatDetails &format, PaletteConstParam palette={}) |
| Get RGBA values from a pixel in the specified format. More... | |
| constexpr Uint8 | SDL::PixelFormat::GetFlags () const |
| Retrieve the flags of an PixelFormat. More... | |
| constexpr PixelType | SDL::PixelFormat::GetType () const |
| Retrieve the type. More... | |
| constexpr int | SDL::PixelFormat::GetOrder () const |
| Retrieve the order. More... | |
| constexpr PackedLayout | SDL::PixelFormat::GetLayout () const |
| Retrieve the layout. More... | |
| constexpr int | SDL::PixelFormat::GetBitsPerPixel () const |
| Determine this's bits per pixel. More... | |
| constexpr int | SDL::PixelFormat::GetBytesPerPixel () const |
| Determine this's bytes per pixel. More... | |
| constexpr bool | SDL::PixelFormat::IsIndexed () const |
| Determine if this is an indexed format. More... | |
| constexpr bool | SDL::PixelFormat::IsPacked () const |
| Determine if this is a packed format. More... | |
| constexpr bool | SDL::PixelFormat::IsArray () const |
| Determine if this is an array format. More... | |
| constexpr bool | SDL::PixelFormat::Is10Bit () const |
| Determine if this is a 10-bit format. More... | |
| constexpr bool | SDL::PixelFormat::IsFloat () const |
| Determine if this is a floating point format. More... | |
| constexpr ColorType | SDL::Colorspace::GetType () const |
| Retrieve the type of a Colorspace. More... | |
| constexpr ColorRange | SDL::Colorspace::GetRange () const |
| Retrieve the range of a Colorspace. More... | |
| constexpr ChromaLocation | SDL::Colorspace::GetChroma () const |
| Retrieve the chroma sample location of an Colorspace. More... | |
| constexpr ColorPrimaries | SDL::Colorspace::GetPrimaries () const |
| Retrieve the primaries of an Colorspace. More... | |
| constexpr TransferCharacteristics | SDL::Colorspace::GetTransfer () const |
| Retrieve the transfer characteristics of an Colorspace. More... | |
| constexpr MatrixCoefficients | SDL::Colorspace::GetMatrix () const |
| Retrieve the matrix coefficients of an Colorspace. More... | |
| constexpr bool | SDL::Colorspace::IsMatrixBT601 () const |
| Determine if a Colorspace uses BT601 (or BT470BG) matrix coefficients. More... | |
| constexpr bool | SDL::Colorspace::IsMatrixBT709 () const |
| Determine if an Colorspace uses BT709 matrix coefficients. More... | |
| constexpr bool | SDL::Colorspace::IsMatrixBT2020_NCL () const |
| Determine if an Colorspace uses BT2020_NCL matrix coefficients. More... | |
| constexpr bool | SDL::Colorspace::IsLimitedRange () const |
| A function to determine if an Colorspace has a limited range. More... | |
| constexpr bool | SDL::Colorspace::IsFullRange () const |
| A function to determine if an Colorspace has a full range. More... | |
| const char * | SDL::PixelFormat::GetName () const |
| Get the human readable name of a pixel format. More... | |
| 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. More... | |
| 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. More... | |
| const PixelFormatDetails & | SDL::PixelFormat::GetDetails () const |
| Create an PixelFormatDetails structure corresponding to a pixel format. More... | |
| SDL::PixelFormat::operator const PixelFormatDetails & () const | |
| Same as GetDetails() | |
| void | SDL::Palette::SetColors (SpanRef< const ColorRaw > colors, int firstcolor=0) |
| Set a range of colors in a palette. More... | |
| void | SDL::Palette::Destroy () |
| Free a palette created with Palette.Palette(). More... | |
| Uint32 | SDL::Color::Map (const PixelFormatDetails &format, PaletteConstParam palette) const |
| Map an RGBA quadruple to a pixel value for a given pixel format. More... | |
| Uint32 | SDL::PixelFormat::Map (ColorRaw c, PaletteConstParam palette={}) const |
| Map an RGBA quadruple to a pixel value for a given pixel format. More... | |
| static Color | SDL::Color::Get (Uint32 pixel, const PixelFormatDetails &format, PaletteConstParam palette) |
| Get RGBA values from a pixel in the specified format. More... | |
| Color | SDL::PixelFormat::Get (Uint32 pixel, PaletteConstParam palette={}) const |
| Get RGBA values from a pixel in the specified format. More... | |
Variables | |
| constexpr Uint8 | SDL::ALPHA_OPAQUE = SDL_ALPHA_OPAQUE |
| A fully opaque 8-bit alpha value. More... | |
| constexpr float | SDL::ALPHA_OPAQUE_FLOAT = SDL_ALPHA_OPAQUE_FLOAT |
| A fully opaque floating point alpha value. More... | |
| constexpr Uint8 | SDL::ALPHA_TRANSPARENT = SDL_ALPHA_TRANSPARENT |
| A fully transparent 8-bit alpha value. More... | |
| constexpr float | SDL::ALPHA_TRANSPARENT_FLOAT = SDL_ALPHA_TRANSPARENT_FLOAT |
| A fully transparent floating point alpha value. More... | |
PixelTypes | |
Pixel type. | |
| using | SDL::PixelType = SDL_PixelType |
| Pixel type. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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 More... | |
| constexpr PackedLayout | SDL::PACKEDLAYOUT_1010102 |
| 1010102 More... | |
ColorTypes | |
| using | SDL::ColorType = SDL_ColorType |
| Colorspace color type. More... | |
| constexpr ColorType | SDL::COLOR_TYPE_UNKNOWN |
| COLOR_TYPE_UNKNOWN. More... | |
| constexpr ColorType | SDL::COLOR_TYPE_RGB = SDL_COLOR_TYPE_RGB |
| COLOR_TYPE_RGB. | |
| constexpr ColorType | SDL::COLOR_TYPE_YCBCR |
| COLOR_TYPE_YCBCR. More... | |
| constexpr bool | SDL::IsPixelFormatAlpha (PixelFormatRaw format) |
| A macro to determine if an PixelFormat has an alpha channel. More... | |
| constexpr bool | SDL::IsPixelFormatFourCC (PixelFormatRaw format) |
| A macro to determine if an PixelFormat is a "FourCC" format. More... | |
| constexpr bool | SDL::PixelFormat::IsAlpha () const |
| Determine if this has an alpha channel. More... | |
| constexpr bool | SDL::PixelFormat::IsFourCC () const |
| Determine if this is a "FourCC" format. More... | |
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. More... | |
| constexpr ColorRange | SDL::COLOR_RANGE_UNKNOWN |
| COLOR_RANGE_UNKNOWN. More... | |
| constexpr ColorRange | SDL::COLOR_RANGE_LIMITED = SDL_COLOR_RANGE_LIMITED |
| Narrow range, e.g. More... | |
| 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. | |
ChromaLocations | |
| using | SDL::ChromaLocation = SDL_ChromaLocation |
| Colorspace chroma sample location. More... | |
| constexpr ChromaLocation | SDL::CHROMA_LOCATION_NONE |
| RGB, no chroma sampling. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_INDEX1LSB |
| INDEX1LSB. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_INDEX1MSB |
| INDEX1MSB. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_INDEX2LSB |
| INDEX2LSB. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_INDEX2MSB |
| INDEX2MSB. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_INDEX4LSB |
| INDEX4LSB. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_INDEX4MSB |
| INDEX4MSB. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_INDEX8 = SDL_PIXELFORMAT_INDEX8 |
| INDEX8. | |
| constexpr PixelFormat | SDL::PIXELFORMAT_RGB332 = SDL_PIXELFORMAT_RGB332 |
| RGB332. | |
| constexpr PixelFormat | SDL::PIXELFORMAT_XRGB4444 |
| XRGB4444. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_XBGR4444 |
| XBGR4444. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_XRGB1555 |
| XRGB1555. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_XBGR1555 |
| XBGR1555. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ARGB4444 |
| ARGB4444. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_RGBA4444 |
| RGBA4444. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ABGR4444 |
| ABGR4444. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_BGRA4444 |
| BGRA4444. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ARGB1555 |
| ARGB1555. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_RGBA5551 |
| RGBA5551. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ABGR1555 |
| ABGR1555. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_BGRA5551 |
| BGRA5551. More... | |
| 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. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_RGBX8888 |
| RGBX8888. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_XBGR8888 |
| XBGR8888. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_BGRX8888 |
| BGRX8888. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ARGB8888 |
| ARGB8888. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_RGBA8888 |
| RGBA8888. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ABGR8888 |
| ABGR8888. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_BGRA8888 |
| BGRA8888. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_XRGB2101010 |
| XRGB2101010. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_XBGR2101010 |
| XBGR2101010. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ARGB2101010 |
| ARGB2101010. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ABGR2101010 |
| ABGR2101010. More... | |
| 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. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_BGR48_FLOAT |
| BGR48_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_RGBA64_FLOAT |
| RGBA64_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ARGB64_FLOAT |
| ARGB64_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_BGRA64_FLOAT |
| BGRA64_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ABGR64_FLOAT |
| ABGR64_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_RGB96_FLOAT |
| RGB96_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_BGR96_FLOAT |
| BGR96_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_RGBA128_FLOAT |
| RGBA128_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ARGB128_FLOAT |
| ARGB128_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_BGRA128_FLOAT |
| BGRA128_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_ABGR128_FLOAT |
| ABGR128_FLOAT. More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_YV12 |
| Planar mode: Y + V + U (3 planes) More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_IYUV |
| Planar mode: Y + U + V (3 planes) More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_YUY2 |
| Packed mode: Y0+U0+Y1+V0 (1 plane) More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_UYVY |
| Packed mode: U0+Y0+V0+Y1 (1 plane) More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_YVYU |
| Packed mode: Y0+V0+Y1+U0 (1 plane) More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_NV12 |
| Planar mode: Y + U/V interleaved (2 planes) More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_NV21 |
| Planar mode: Y + V/U interleaved (2 planes) More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_P010 |
| Planar mode: Y + U/V interleaved (2 planes) More... | |
| constexpr PixelFormat | SDL::PIXELFORMAT_EXTERNAL_OES |
| Android video texture format. More... | |
| 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. | |
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.
| using SDL::ArrayOrder = typedef SDL_ArrayOrder |
| using SDL::BitmapOrder = typedef SDL_BitmapOrder |
| using SDL::ChromaLocation = typedef SDL_ChromaLocation |
| using SDL::ColorPrimaries = typedef SDL_ColorPrimaries |
| using SDL::ColorRange = typedef SDL_ColorRange |
| using SDL::ColorType = typedef SDL_ColorType |
| using SDL::MatrixCoefficients = typedef SDL_MatrixCoefficients |
These are as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en
| using SDL::PackedLayout = typedef SDL_PackedLayout |
| using SDL::PackedOrder = typedef SDL_PackedOrder |
| using SDL::PixelFormatDetails = typedef SDL_PixelFormatDetails |
| using SDL::PixelType = typedef SDL_PixelType |
| using SDL::TransferCharacteristics = typedef SDL_TransferCharacteristics |
These are as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en
|
constexpr |
| cspace | an Colorspace to check. |
cspace.
|
constexpr |
| cspace | an Colorspace to check. |
cspace.
|
constexpr |
| cspace | an Colorspace to check. |
cspace.
|
constexpr |
| cspace | an Colorspace to check. |
cspace.
|
constexpr |
| cspace | an Colorspace to check. |
cspace.
|
constexpr |
| cspace | an Colorspace to check. |
cspace.
|
inline |
The palette entries are initialized to white.
| ncolors | represents the number of color entries in the color palette. |
| Error | on failure. |
|
constexpr |
For example, defining COLORSPACE_SRGB looks like this:
| type | the type of the new format, probably an ColorType value. |
| range | the range of the new format, probably a ColorRange value. |
| primaries | the primaries of the new format, probably an ColorPrimaries value. |
| transfer | the transfer characteristics of the new format, probably an TransferCharacteristics value. |
| matrix | the matrix coefficients of the new format, probably an MatrixCoefficients value. |
| chroma | the chroma sample location of the new format, probably an ChromaLocation value. |
|
constexpr |
For example, defining PIXELFORMAT_RGBA8888 looks like this:
| type | the type of the new format, probably a PixelType value. |
| order | the order of the new format, probably a BitmapOrder, PackedOrder, or ArrayOrder value. |
| layout | the layout of the new format, probably an PackedLayout value or zero. |
| bits | the number of bits per pixel of the new format. |
| bytes | the number of bytes per pixel of the new format. |
For example, defining PIXELFORMAT_YV12 looks like this:
| A | the first character of the FourCC code. |
| B | the second character of the FourCC code. |
| C | the third character of the FourCC code. |
| D | the fourth character of the FourCC code. |
|
inline |
|
inline |
| palette | the Palette structure to be freed. |
|
inlinestatic |
This will return PIXELFORMAT_UNKNOWN if the conversion wasn't possible.
| bpp | a bits per pixel value; usually 15, 16, or 32. |
| Rmask | the red mask for the format. |
| Gmask | the green mask for the format. |
| Bmask | the blue mask for the format. |
| Amask | the alpha mask for the format. |
|
inlinestatic |
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).
| pixel | a pixel value. |
| format | a pointer to PixelFormatDetails describing the pixel format. |
| palette | an optional palette for indexed formats, may be NULL. |
|
inline |
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).
| pixel | a pixel value. |
| palette | an optional palette for indexed formats, may be NULL. |
|
constexpr |
FourCC formats will report zero here, as it rarely makes sense to measure them per-pixel.
|
constexpr |
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.
|
constexpr |
cspace.
|
inline |
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).
| pixel | a pixel value. |
| format | a pointer to PixelFormatDetails describing the pixel format. |
| palette | an optional palette for indexed formats, may be nullptr. |
|
inline |
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.
| Error | on failure. |
|
constexpr |
This function is generally not needed directly by an app, which should use specific tests, like PixelFormat.IsFourCC, instead.
format.
|
constexpr |
This is usually a value from the PackedLayout enumeration, or zero if a layout doesn't make sense for the format type.
|
inline |
| bpp | a bits per pixel value; usually 15, 16, or 32. |
| Rmask | a pointer filled in with the red mask for the format. |
| Gmask | a pointer filled in with the green mask for the format. |
| Bmask | a pointer filled in with the blue mask for the format. |
| Amask | a pointer filled in with the alpha mask for the format. |
| Error | on failure. |
|
inline |
| format | one of the PixelFormat values. |
| bpp | a bits per pixel value; usually 15, 16, or 32. |
| Rmask | a pointer filled in with the red mask for the format. |
| Gmask | a pointer filled in with the green mask for the format. |
| Bmask | a pointer filled in with the blue mask for the format. |
| Amask | a pointer filled in with the alpha mask for the format. |
| Error | on failure. |
|
constexpr |
cspace.
|
inline |
|
constexpr |
This is usually a value from the BitmapOrder, PackedOrder, or ArrayOrder enumerations, depending on the format type.
|
inline |
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.
| format | one of the PixelFormat values. |
| Error | on failure. |
|
inline |
This will return PIXELFORMAT_UNKNOWN if the conversion wasn't possible.
| bpp | a bits per pixel value; usually 15, 16, or 32. |
| Rmask | the red mask for the format. |
| Gmask | the green mask for the format. |
| Bmask | the blue mask for the format. |
| Amask | the alpha mask for the format. |
|
inline |
| format | the pixel format to query. |
|
constexpr |
cspace.
|
constexpr |
cspace.
|
inline |
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]).
| pixel | a pixel value. |
| format | a pointer to PixelFormatDetails describing the pixel format. |
| palette | an optional palette for indexed formats, may be nullptr. |
| r | a pointer filled in with the red component, may be nullptr. |
| g | a pointer filled in with the green component, may be nullptr. |
| b | a pointer filled in with the blue component, may be nullptr. |
|
inline |
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).
| pixel | a pixel value. |
| format | a pointer to PixelFormatDetails describing the pixel format. |
| palette | an optional palette for indexed formats, may be nullptr. |
| r | a pointer filled in with the red component, may be nullptr. |
| g | a pointer filled in with the green component, may be nullptr. |
| b | a pointer filled in with the blue component, may be nullptr. |
| a | a pointer filled in with the alpha component, may be nullptr. |
|
constexpr |
cspace.
|
constexpr |
|
constexpr |
cspace.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
| cspace | an Colorspace to check. |
|
constexpr |
| cspace | an Colorspace to check. |
|
constexpr |
| cspace | an Colorspace to check. |
|
constexpr |
Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.
| cspace | an Colorspace to check. |
|
constexpr |
| cspace | an Colorspace to check. |
|
constexpr |
|
constexpr |
This covers custom and other unusual formats.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.
| format | an PixelFormat to check. |
|
constexpr |
Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.
| format | an PixelFormat to check. |
|
constexpr |
Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.
| format | an PixelFormat to check. |
|
constexpr |
Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.
| format | an PixelFormat to check. |
|
constexpr |
This covers custom and other unusual formats.
Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.
| format | an PixelFormat to check. |
|
constexpr |
Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.
| format | an PixelFormat to check. |
|
constexpr |
Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.
| format | an PixelFormat to check. |
|
inline |
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).
| c | the color components of the pixel in the range 0-255. |
| palette | an optional palette for indexed formats, may be NULL. |
|
inline |
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).
| format | a pointer to PixelFormatDetails describing the pixel format. |
| palette | an optional palette for indexed formats, may be NULL. |
|
inline |
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).
| format | a pointer to PixelFormatDetails describing the pixel format. |
| c | the color components of the pixel in the range 0-255. |
| palette | an optional palette for indexed formats, may be nullptr. |
|
inline |
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).
| format | a pointer to PixelFormatDetails describing the pixel format. |
| palette | an optional palette for indexed formats, may be nullptr. |
| r | the red component of the pixel in the range 0-255. |
| g | the green component of the pixel in the range 0-255. |
| b | the blue component of the pixel in the range 0-255. |
|
inline |
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).
| format | a pointer to PixelFormatDetails describing the pixel format. |
| r | the red component of the pixel in the range 0-255. |
| g | the green component of the pixel in the range 0-255. |
| b | the blue component of the pixel in the range 0-255. |
| a | the alpha component of the pixel in the range 0-255. |
| palette | an optional palette for indexed formats, may be nullptr. |
|
constexpr |
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.
| format | an PixelFormat to check. |
format.
|
constexpr |
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.
| format | an PixelFormat to check. |
format.
|
constexpr |
This function is generally not needed directly by an app, which should use specific tests, like PixelFormat.IsFourCC, instead.
| format | an PixelFormat to check. |
format.
|
constexpr |
This is usually a value from the PackedLayout enumeration, or zero if a layout doesn't make sense for the format type.
| format | an PixelFormat to check. |
format.
|
constexpr |
This is usually a value from the BitmapOrder, PackedOrder, or ArrayOrder enumerations, depending on the format type.
| format | an PixelFormat to check. |
format.
|
constexpr |
This is usually a value from the PixelType enumeration.
| format | an PixelFormat to check. |
format.| colors | an array of Color structures to copy into the palette. |
| firstcolor | the index of the first palette entry to modify. |
| Error | on failure. |
|
inline |
| palette | the Palette structure to modify. |
| colors | an array of Color structures to copy into the palette. |
| firstcolor | the index of the first palette entry to modify. |
| Error | on failure. |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel.
|
constexpr |
In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |