Class PixelFormat
D class that wraps SDL_PixelFormat defining the color and alpha channel bit layout in the internal
 representation of a pixel
					
			class PixelFormat
			;
					
				
			Constructors
| Name | Description | 
|---|---|
| this(sdlPixelFormat, isOwner, userRef) | Constructs a dsdlfrom a vanillaSDL_PixelFormat*from bindbc-sdl | 
| this(sdlPixelFormatEnum) | Constructs a dsdlusing anSDL_PixelFormatEnumfrom bindbc-sdl | 
| this(sdlPixelFormatEnum, palette) | Constructs a dsdlusing an indexedSDL_PixelFormatEnumfrom bindbc-sdl, allowing use withdsdls | 
| this(bitsPerPixel, rgbaMasks) | Constructs a dsdlfrom user-provided bit masks for RGB color and alpha channels by internally
 usingSDL_MasksToPixelFormatEnumto retrieve theSDL_PixelFormatEnum | 
Fields
| Name | Type | Description | 
|---|---|---|
| sdlPixelFormat | sdl | Internal SDL_PixelFormatpointer | 
Properties
| Name | Type | Description | 
|---|---|---|
| bitsPerPixel[get] | ubyte | Gets the bit depth (size of a pixel in bits) of the dsdl | 
| bytesPerPixel[get] | ulong | Gets the how many bytes needed to represent a pixel in the dsdl | 
| fourCC[get] | bool | Wraps SDL_ISPIXELFORMAT_FOURCCwhich checks whether thedsdlrepresents a unique format | 
| hasAlpha[get] | bool | Wraps SDL_ISPIXELFORMAT_ALPHAwhich checks whether thedsdlis capable of storing alpha value | 
| indexed[get] | bool | Wraps SDL_ISPIXELFORMAT_INDEXEDwhich checks whether thedsdlis indexed | 
| palette[get] | inout(Palette) | Gets the dsdlbounds to the indexeddsdl | 
| palette[set] | Palette | Wraps SDL_SetPixelFormatPalettewhich sets thedsdlfor indexeddsdls` | 
| sdlPixelFormatEnum[get] | uint | Gets the SDL_PixelFormatEnumof the underlyingSDL_PixelFormat | 
Methods
| Name | Description | 
|---|---|
| getRGB(pixel) | Wraps SDL_GetRGBwhich converts a pixeluintvalue to a comprehensibledsdlstruct without
 accounting the alpha value (automatically set to opaque [255]), based on the pixel format defined by thedsdl | 
| getRGBA(pixel) | Wraps SDL_GetRGBAwhich converts a pixeluintvalue to a comprehensibledsdlstruct, based on
 the pixel format defined by thedsdl | 
| mapRGB(color) | Wraps SDL_MapRGBwhich converts adsdlto its pixeluintvalue according to the pixel format
 defined by thedsdlwithout accounting the alpha value, assuming that it's opaque | 
| mapRGBA(color) | Wraps SDL_MapRGBAwhich converts adsdlto its pixeluintvalue according to the pixel format
 defined by thedsdl | 
| opEquals(rhs) | Equality operator overload | 
| toHash() | Gets the hash of the dsdl | 
| toMasks() | Wraps SDL_PixelFormatEnumToMaskswhich gets the bit mask for all four channels of thedsdl | 
| toString() | Formats the dsdlinto its construction representation:"dsdl.PixelFormat(<sdlPixelFormatEnum>)"or"dsdl.PixelFormat(<sdlPixelFormatEnum>, <palette>)" | 
Aliases
| Name | Description | 
|---|---|
| abgr1555 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| abgr32 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants
 (from SDL 2.0.5) | 
| abgr4444 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| abgr8888 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| argb1555 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| argb2101010 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| argb32 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants
 (from SDL 2.0.5) | 
| argb4444 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| argb8888 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| bgr24 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| bgr555 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| bgr565 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| bgr888 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| bgra32 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants
 (from SDL 2.0.5) | 
| bgra4444 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| bgra5551 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| bgra8888 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| bgrx8888 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| index1lsb | Instantiates indexed dsdlfor use withdsdls fromSDL_PIXELFORMAT_*enumeration
 constants | 
| index1msb | Instantiates indexed dsdlfor use withdsdls fromSDL_PIXELFORMAT_*enumeration
 constants | 
| index4lsb | Instantiates indexed dsdlfor use withdsdls fromSDL_PIXELFORMAT_*enumeration
 constants | 
| index4msb | Instantiates indexed dsdlfor use withdsdls fromSDL_PIXELFORMAT_*enumeration
 constants | 
| index8 | Instantiates indexed dsdlfor use withdsdls fromSDL_PIXELFORMAT_*enumeration
 constants | 
| iyuv | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| nv12 | Instantiates indexed dsdlfor use withdsdls fromSDL_PIXELFORMAT_*enumeration constants (from SDL 2.0.4) | 
| nv21 | Instantiates indexed dsdlfor use withdsdls fromSDL_PIXELFORMAT_*enumeration constants (from SDL 2.0.4) | 
| rgb24 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| rgb332 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| rgb444 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| rgb555 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| rgb565 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| rgb888 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| rgba32 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants
 (from SDL 2.0.5) | 
| rgba444 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| rgba5551 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| rgba8888 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| rgbx8888 | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| uyvy | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
| yuy2 | Instantiates indexed dsdlfor use withdsdls fromSDL_PIXELFORMAT_*enumeration
 constants | 
| yv12 | Instantiates indexed dsdlfor use withdsdls fromSDL_PIXELFORMAT_*enumeration
 constants | 
| yvyu | Retrieves one of the dsdlmultiton presets fromSDL_PIXELFORMAT_*enumeration constants | 
Example
static if (sdlSupport >= SDLSupport