function MergeReg(F, B: TColor32): TColor32;
procedure MergeMem(F: TColor32; var B: TColor32);
Merges a foregrownd (F) color with the background color (B) using the alpha component of the foreground color. It does merge the alpha-channels.
SA = 1 - (1 - FA) (1 - BA)
SRGB = (FA * FRGB + BA * (1 - FA) * BRGB) / SA
MergeReg takes parameters and produces the result operating on CPU registers.
MergeMem operates with the background color referenced by a memory address.
Note, that after using the Merge function, you have to call EMMS. Otherwise CPU will be unable to handle floating point instructions.
Blend, BlendEx, Combine, EMMS, MergeEx, Color Types
Copyright ©2000-2012 Alex Denisov and the Graphics32 Team - Graphics32 v1.9.1 - Build on 28-August-2012