Declaration ​
pascal
function BlendReg(F, B: TColor32): TColor32;
procedure BlendMem(F: TColor32; var B: TColor32);
procedure BlendMems(F: TColor32; Dst: PColor32; Count: Integer);
function BlendRegEx(F, B: TColor32; M: Cardinal): TColor32;
procedure BlendMemEx(F: TColor32; var B: TColor32; M: Cardinal);
function BlendRegRGB(F, B: TColor32; W: Cardinal): TColor32;
procedure BlendMemRGB(F: TColor32; var B: TColor32; W: Cardinal);
procedure BlendLine(Src, Dst: PColor32; Count: Integer);
procedure BlendLineEx(Src, Dst: PColor32; Count: Integer; M: Cardinal);Parameters ​
| Parameter | Type | Description |
|---|---|---|
F | TColor32 | Foreground pixel color. |
B | TColor32 | Background pixel color. |
M | Cardinal | Master alpha weight or mask value (0..255). |
W | Cardinal | Explicit blending weight (0..255). |
Src | PColor32 | Pointer to the first source foreground pixel in memory. |
Dst | PColor32 | Pointer to the first destination background pixel in memory. |
Count | Integer | Number of contiguous background pixels to blend. |
Returns ​
| Type | Description |
|---|---|
TColor32 | The blended 32-bit ARGB result color. |
Description ​
The Blend* family of functions performs standard alpha blending, compositing a foreground color
The background color Merge instead.
Variant Summary ​
| Variant | Signature | Description |
|---|---|---|
BlendReg | function(F, B: TColor32): TColor32; | Blends foreground |
BlendMem | procedure(F: TColor32; var B: TColor32); | Blends foreground |
BlendMems | procedure(F: TColor32; B: PColor32; Count: Integer); | Blends uniform foreground Count background pixels starting at |
BlendRegEx | function(F, B: TColor32; M: Cardinal): TColor32; | Register blending with master alpha / mask factor |
BlendMemEx | procedure(F: TColor32; var B: TColor32; M: Cardinal); | In-memory blending with master alpha / mask factor |
BlendRegRGB | function(F, B: TColor32; W: Cardinal): TColor32; | Register blending with explicit blend weight |
BlendMemRGB | procedure(F: TColor32; var B: TColor32; W: Cardinal); | In-memory blending with explicit blend weight |
BlendLine | procedure(Src, Dst: PColor32; Count: Integer); | Scanline blending of Count source pixels onto destination pixels. |
BlendLineEx | procedure(Src, Dst: PColor32; Count: Integer; M: Cardinal); | Scanline blending with master alpha factor |
INFO
All these functions are actually delegates; At startup, Graphics32 binds them to the optimal implementation (Pure Pascal, x86/x64 assembly, or SSE2 vector instructions) supported by the host CPU.