Blend

function BlendReg(F, B: TColor32): TColor32;

procedure BlendMem(F: TColor32; var B: TColor32);

Description

Mixes a foregrownd (F) color with the background color (B) using the alpha component of the foreground color.

SRGB = FA * FRGB + (1 FA) * BRGB;

BlendReg takes parameters and produces the result operating on CPU registers.

BlendMem operates with the background color referenced by a memory address.

Using BlendMem is more efficient when blending/combining data to a bitmap, since it excludes writing operation for transparent pixels and reading operation for opaque ones.

Note, that after using the Blend function, you have to call EMMS. Otherwise CPU will be unable to handle floating point instructions.

See Also

BlendEx, Combine, EMMS, Merge, MergeEx, Color Types