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