1. with Allegro.Bitmaps;                   use Allegro.Bitmaps; 
  2.  
  3. package Tanskanen is 
  4.  
  5.     copyright : constant String := "By Esa Tanskanen (Fladimir da Gorf)"; 
  6.     version   : constant String := "BlendColors32"; 
  7.  
  8.     -- Draws a 32bit bitmap onto another 32bit bitmap using alpha channel 
  9.     -- blending. 'src' will be clipped when drawn onto 'dst'. This procedure is 
  10.     -- highly optimized for speed. 
  11.     -- 
  12.     -- src   : The source bitmap 
  13.     -- dst   : The destination bitmap 
  14.     -- dst_x : The X coordinate on 'dst' to draw 'src' 
  15.     -- dst_y : The Y coordinate on 'dst' to draw 'src' 
  16.     procedure AlphaBlend32( src, 
  17.                             dst   : not null A_Bitmap; 
  18.                             dst_x, 
  19.                             dst_y : Integer ); 
  20.  
  21.     -- Draws a 32bit bitmap onto another 32bit bitmap using alpha channel 
  22.     -- blending and with a specified opacity, 'globalAlpha'. The value of 
  23.     -- 'globalAlpha' should be within 0..255, where 0 is completely transparent 
  24.     -- and 255 is completely opaque. 'src' will be clipped when drawn onto 
  25.     -- 'dst'. This procedure is highly optimized for speed. 
  26.     -- 
  27.     -- src         : The source bitmap 
  28.     -- dst         : The destination bitmap 
  29.     -- dst_x       : The X coordinate on 'dst' to draw 'src' 
  30.     -- dst_y       : The Y coordinate on 'dst' to draw 'src' 
  31.     -- globalAlpha : The global color to use blending 'src' to 'dst' 
  32.     procedure AlphaBlend32_Ex( src, 
  33.                                dst         : not null A_Bitmap; 
  34.                                dst_x, 
  35.                                dst_y       : Integer; 
  36.                                globalAlpha : Integer ); 
  37.     pragma Precondition( globalAlpha >= 0 and then globalAlpha <= 255 ); 
  38.  
  39. private 
  40.  
  41.     pragma Import( C, AlphaBlend32, "AlphaBlend32" ); 
  42.     pragma Import( C, AlphaBlend32_Ex, "AlphaBlend32_Ex" ); 
  43.  
  44. end Tanskanen;