1. with Allegro.Bitmaps;                   use Allegro.Bitmaps; 
  2.  
  3. package Super2xSaI is 
  4.  
  5.     Copyright : constant String := "Copyright (c) Derek Liauw Kie Fa, 1999"; 
  6.     Version   : constant String := "2xSaI"; 
  7.  
  8.     -- Initializes the Super 2xSaI library. This must be called before calling 
  9.     -- a filtering procedure. 
  10.     -- 
  11.     -- depth: the color depth to use when filtering. source and destination 
  12.     --        bitmaps must use this color depth. 
  13.     function Init_2xSaI( depth : Integer ) return Integer; 
  14.     pragma Precondition( depth = 8 or else 
  15.                          depth = 15 or else 
  16.                          depth = 16 or else 
  17.                          depth = 24 or else 
  18.                          depth = 32 ); 
  19.  
  20.     -- Enlarges a bitmap by 2x magnification using the Super 2xSaI filter. The 
  21.     -- destination bitmap dimensions must be at least 
  22.     -- (dx+width*2-1) by (dy+height*2-1). 
  23.     -- 
  24.     -- src   : the source bitmap 
  25.     -- dest  : the destination bitmap (must be large enough!) 
  26.     -- sx, sy: the source bitmap coordinates 
  27.     -- dx, sy: the destination bitmap coordinates 
  28.     -- width : the width of the area from the source bitmap to scale 
  29.     -- height: the height of the area from the source bitmap to scale 
  30.     procedure Super2xSaI( src, dest     : not null A_Bitmap; 
  31.                           sx, sy, 
  32.                           dx, dy        : Integer; 
  33.                           width, height : Positive ); 
  34.     pragma Precondition( Get_Width( src ) >= width ); 
  35.     pragma Precondition( Get_Height( src ) >= height ); 
  36.     pragma Precondition( Get_Width( dest ) >= dx + width*2 ); 
  37.     pragma Precondition( Get_Height( dest ) >= dy + height*2 ); 
  38.  
  39.     -- Enlarges a bitmap by 2x magnification using the Super Eagle filter. The 
  40.     -- destination bitmap dimensions must be at least 
  41.     -- (dx+width*2-1) by (dy+height*2-1). 
  42.     -- 
  43.     -- src   : the source bitmap 
  44.     -- dest  : the destination bitmap (must be large enough!) 
  45.     -- sx, sy: the source bitmap coordinates 
  46.     -- dx, sy: the destination bitmap coordinates 
  47.     -- width : the width of the area from the source bitmap to scale 
  48.     -- height: the height of the area from the source bitmap to scale 
  49.     procedure SuperEagle( src, dest     : not null A_Bitmap; 
  50.                           sx, sy, 
  51.                           dx, dy        : Integer; 
  52.                           width, height : Positive ); 
  53.     pragma Precondition( Get_Width( src ) >= width ); 
  54.     pragma Precondition( Get_Height( src ) >= height ); 
  55.     pragma Precondition( Get_Width( dest ) >= dx + width*2 ); 
  56.     pragma Precondition( Get_Height( dest ) >= dy + height*2 ); 
  57.  
  58. private 
  59.  
  60.     pragma Import( C, Init_2xSaI, "Init_2xSaI" ); 
  61.     pragma Import( C, Super2xSaI, "Super2xSaI" ); 
  62.     pragma Import( C, SuperEagle, "SuperEagle" ); 
  63.  
  64. end Super2xSaI;