1. with Allegro.Bitmaps;                   use Allegro.Bitmaps; 
  2.  
  3. package Scaling is 
  4.  
  5.     type Filter_Type is 
  6.     ( 
  7.         Filter_Nearest,    -- effectively no filter 
  8.         Filter_Quality,    -- choose best looking filter 
  9.         Filter_HQX, 
  10.         Filter_2xSaI, 
  11.         Filter_Eagle, 
  12.         Filter_ScaleX 
  13.     ); 
  14.  
  15.     INIT_EXCEPTION : exception; 
  16.  
  17.     ---------------------------------------------------------------------------- 
  18.  
  19.     -- Raises INIT_EXCEPTION with message if not successful. 
  20.     procedure Initialize( color_depth : Integer ); 
  21.  
  22.     procedure Finalize; 
  23.  
  24.     -- Scales the upper left corner of the source bitmap onto the upper left 
  25.     -- corner of the destination bitmap. The filter type is used to do the 
  26.     -- scale if it is available for the given magnification. If the requested 
  27.     -- filter can't scale to the requested magnification, the default filter 
  28.     -- is used. Note: This procedure is not thread-safe. 
  29.     procedure Scale( src, 
  30.                      dst           : not null A_Bitmap; 
  31.                      src_width, 
  32.                      src_height    : Positive; 
  33.                      magnification : Float; 
  34.                      filter        : Filter_Type := Filter_Nearest ); 
  35.  
  36.     -- Filter names are Filter_Type members without the Filter_ prefix. If the 
  37.     -- name doesn't match a filter, 'default' will be returned. 
  38.     function To_Filter( name    : String; 
  39.                         default : Filter_Type := Filter_Type'First 
  40.                       ) return Filter_Type; 
  41.  
  42. end Scaling;