PremultiplyAlpha
Premultiply the alpha on a block of pixels.
This is safe to use with ASrc = ADst, but not for other overlapping areas.
Definition
Unit: Neslib.Sdl3.Video
procedure PremultiplyAlpha(const AWidth, AHeight: Integer;
const ASrcFormat: TSdlPixelFormat; const ASrc: Pointer;
const ASrcPitch: Integer; const ADstFormat: TSdlPixelFormat;
const ADst: Pointer; const ADstPitch: Integer; const ALinear: Boolean); inline
Parameters
AWidth
: Integer
: The width of the block to convert, in pixels.
AHeight
: Integer
: The height of the block to convert, in pixels.
ASrcFormat
: TSdlPixelFormat
: The pixel format of ASrc.
ASrc
: Pointer
: A pointer to the source pixels.
ASrcPitch
: Integer
: The pitch of the source pixels, in bytes.
ADstFormat
: TSdlPixelFormat
: The pixel format of ADst.
ADst
: Pointer
: A pointer to be filled in with premultiplied pixel data.
ADstPitch
: Integer
: The pitch of the destination pixels, in bytes.
ALinear
: Boolean
: True to convert from sRGB to linear space for the alpha multiplication, False to do multiplication in sRGB space.
Exceptions
ESdlError
: Raised on failure.