Constructs a dsdl2.PixelFormat from a vanilla SDL_PixelFormat* from bindbc-sdl
Constructs a dsdl2.PixelFormat using an SDL_PixelFormatEnum from bindbc-sdl
Constructs a dsdl2.PixelFormat using an indexed SDL_PixelFormatEnum from bindbc-sdl, allowing use with dsdl2.Palettes
Constructs a dsdl2.PixelFormat from user-provided bit masks for RGB color and alpha channels by internally using SDL_MasksToPixelFormatEnum to retrieve the SDL_PixelFormatEnum
Instantiates indexed dsdl2.PixelFormat for use with dsdl2.Palettes from SDL_PIXELFORMAT_* enumeration constants
Instantiates indexed dsdl2.PixelFormat for use with dsdl2.Palettes from SDL_PIXELFORMAT_* enumeration constants (from SDL 2.0.4)
Retrieves one of the dsdl2.PixelFormat multiton presets from SDL_PIXELFORMAT_* enumeration constants
Retrieves one of the dsdl2.PixelFormat multiton presets from SDL_PIXELFORMAT_* enumeration constants (from SDL 2.0.5)
Gets the bit depth (size of a pixel in bits) of the dsdl2.PixelFormat
Gets the how many bytes needed to represent a pixel in the dsdl2.PixelFormat
Wraps SDL_ISPIXELFORMAT_FOURCC which checks whether the dsdl2.PixelFormat represents a unique format
Wraps SDL_GetRGB which converts a pixel uint value to a comprehensible dsdl2.Color struct without accounting the alpha value (automatically set to opaque [255]), based on the pixel format defined by the dsdl2.PixelFormat
Wraps SDL_GetRGBA which converts a pixel uint value to a comprehensible dsdl2.Color struct, based on the pixel format defined by the dsdl2.PixelFormat
Wraps SDL_ISPIXELFORMAT_ALPHA which checks whether the dsdl2.PixelFormat is capable of storing alpha value
Wraps SDL_ISPIXELFORMAT_INDEXED which checks whether the dsdl2.PixelFormat is indexed
Wraps SDL_MapRGB which converts a dsdl2.Color to its pixel uint value according to the pixel format defined by the dsdl2.PixelFormat without accounting the alpha value, assuming that it's opaque
Wraps SDL_MapRGBA which converts a dsdl2.Color to its pixel uint value according to the pixel format defined by the dsdl2.PixelFormat
Equality operator overload
Gets the dsdl2.Palette bounds to the indexed dsdl2.PixelFormat
Wraps SDL_SetPixelFormatPalette which sets the dsdl2.Palette for indexed dsdl2.PixelFormats`
Gets the SDL_PixelFormatEnum of the underlying SDL_PixelFormat
Gets the hash of the dsdl2.PixelFormat
Wraps SDL_PixelFormatEnumToMasks which gets the bit mask for all four channels of the dsdl2.PixelFormat
Formats the dsdl2.PixelFormat into its construction representation: "dsdl2.PixelFormat(<sdlPixelFormatEnum>)" or "dsdl2.PixelFormat(<sdlPixelFormatEnum>, <palette>)"
Internal SDL_PixelFormat pointer
static if (sdlSupport >= SDLSupport.v2_0_5) { const auto rgba32 = dsdl2.PixelFormat.rgba32; assert(rgba32.mapRGBA(dsdl2.Color(0x12, 0x34, 0x56, 0x78)) == 0x12345678); assert(rgba32.getRGBA(0x12345678) == dsdl2.Color(0x12, 0x34, 0x56, 0x78)); } const auto rgba8888 = dsdl2.PixelFormat.rgba8888; version (LittleEndian) { assert(rgba8888.mapRGBA(dsdl2.Color(0x12, 0x34, 0x56, 0x78)) == 0x12345678); assert(rgba8888.getRGBA(0x12345678) == dsdl2.Color(0x12, 0x34, 0x56, 0x78)); } version (BigEndian) { assert(rgba8888.mapRGBA(dsdl2.Color(0x12, 0x34, 0x56, 0x78)) == 0x78563412); assert(rgba8888.get(0x78563412) == dsdl2.Color(0x12, 0x34, 0x56, 0x78)); }
D class that wraps SDL_PixelFormat defining the color and alpha channel bit layout in the internal representation of a pixel