|
SDL3pp
A slim C++ wrapper for SDL3
|
Pixel format. More...
Public Member Functions | |
| constexpr | PixelFormat (PixelFormatRaw format={}) noexcept |
| Wraps PixelFormat. | |
| constexpr | PixelFormat (PixelType type, int order, PackedLayout layout, int bits, int bytes) |
| Defining custom non-FourCC pixel formats. | |
| constexpr | operator PixelFormatRaw () const noexcept |
| Unwraps to the underlying PixelFormat. | |
| constexpr Uint8 | GetFlags () const |
| Retrieve the flags of an PixelFormat. | |
| constexpr PixelType | GetType () const |
| Retrieve the type. | |
| constexpr int | GetOrder () const |
| Retrieve the order. | |
| constexpr PackedLayout | GetLayout () const |
| Retrieve the layout. | |
| constexpr int | GetBitsPerPixel () const |
| Determine this's bits per pixel. | |
| constexpr int | GetBytesPerPixel () const |
| Determine this's bytes per pixel. | |
| constexpr bool | IsIndexed () const |
| Determine if this is an indexed format. | |
| constexpr bool | IsPacked () const |
| Determine if this is a packed format. | |
| constexpr bool | IsArray () const |
| Determine if this is an array format. | |
| constexpr bool | Is10Bit () const |
| Determine if this is a 10-bit format. | |
| constexpr bool | IsFloat () const |
| Determine if this is a floating point format. | |
| const char * | GetName () const |
| Get the human readable name of a pixel format. | |
| void | 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. | |
| const PixelFormatDetails & | GetDetails () const |
| Create an PixelFormatDetails structure corresponding to a pixel format. | |
| operator const PixelFormatDetails & () const | |
| Same as GetDetails(). | |
| Uint32 | Map (ColorRaw c, PaletteConstRef palette={}) const |
| Map an RGBA quadruple to a pixel value for a given pixel format. | |
| Color | Get (Uint32 pixel, PaletteConstRef palette={}) const |
| Get RGBA values from a pixel in the specified format. | |
ColorTypes | |
| constexpr bool | IsAlpha () const |
| Determine if this has an alpha channel. | |
| constexpr bool | IsFourCC () const |
| Determine if this is a "FourCC" format. | |
Static Public Member Functions | |
| static PixelFormat | ForMasks (int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) |
| Convert a bpp value and RGBA masks to an enumerated pixel format. | |
Pixel format.
SDL's pixel formats have the following naming convention:
The 32-bit byte-array encodings such as RGBA32 are aliases for the appropriate 8888 encoding for the current platform. For example, RGBA32 is an alias for ABGR8888 on little-endian CPUs like x86, or an alias for RGBA8888 on big-endian CPUs.
|
inlineconstexprnoexcept |
Wraps PixelFormat.
| format | the value to be wrapped |
|
inlineconstexprnoexcept |
Unwraps to the underlying PixelFormat.