BlendEx

function BlendRegEx(F, B, M: TColor32): TColor32;

procedure BlendMemEx(F: TColor32; var B: TColor32; M: TColor32);

Description

Mixes a foreground color with the background color using alpha of the foreground color scaled by the master alpha value M.

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

M is defined as TColor32 to avoid unnecessary type conversions, it must store only values in [0..255] range, the function does not perform range checking and the result in case M > 255 is not specified.

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

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

Using BlendMemEx 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 BlendEx functions, you have to call EMMS. Otherwise CPU will be unable to handle floating point instructions.

See Also

Blend, Combine, EMMS, Merge, MergeEx, TColor32