PixelFormat.this - multiple declarations

Function PixelFormat.this

Constructs a dsdl2.PixelFormat from a vanilla SDL_PixelFormat* from bindbc-sdl

this (
  sdl.pixels.SDL_PixelFormat* sdlPixelFormat,
  bool isOwner = true,
  void* userRef = null
);

Parameters

NameDescription
sdlPixelFormat the SDL_PixelFormat pointer to manage
isOwner whether the instance owns the given SDL_PixelFormat* and should destroy it on its own
userRef optional pointer to maintain reference link, avoiding GC cleanup

Function PixelFormat.this

Constructs a dsdl2.PixelFormat using an SDL_PixelFormatEnum from bindbc-sdl

this (
  uint sdlPixelFormatEnum
) @trusted;

Parameters

NameDescription
sdlPixelFormatEnum the SDL_PixelFormatEnum enumeration (non-indexed)

Throws

dsdl2.SDLException if allocation failed

Function PixelFormat.this

Constructs a dsdl2.PixelFormat using an indexed SDL_PixelFormatEnum from bindbc-sdl, allowing use with dsdl2.Palettes

this (
  uint sdlPixelFormatEnum,
  Palette palette
) @trusted;

Parameters

NameDescription
sdlPixelFormatEnum the SDL_PixelFormatEnum enumeration (indexed)
palette the dsdl2.Palette class instance to bind as the color palette

Throws

dsdl2.SDLException if allocation or palette-setting failed

Function PixelFormat.this

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

this (
  ubyte bitsPerPixel,
  uint[4] rgbaMasks
) @trusted;

Parameters

NameDescription
bitsPerPixel size of one pixel in bits
rgbaMasks bit masks for the red, green, blue, and alpha channels

Throws

dsdl2.SDLException if pixel format conversion not possible