1. with Interfaces;                        use Interfaces; 
  2. with System;                            use System; 
  3.  
  4. package Scale_X is 
  5.  
  6.     pragma Pure; 
  7.  
  8.     -- Returns the copyright tag for Scale2X. 
  9.     function Copyright return String; 
  10.  
  11.     -- Returns a string describing the library version. 
  12.     function Version return String; 
  13.  
  14.     -- Scales source 2x to destination. 
  15.     -- 
  16.     -- dst     : address of destination bitmap 
  17.     -- dstXres : width in pixels of destination bitmap 
  18.     -- src     : address of source bitmap 
  19.     -- srcXres : width in pixels of source bitmap 
  20.     -- width   : width of top left area in source bitmap to scale 
  21.     -- height  : height of top left area in source bitmap to scale 
  22.     procedure Scale2x( dst     : Address; 
  23.                        dstXres : Unsigned_32; 
  24.                        src     : Address; 
  25.                        srcXres : Unsigned_32; 
  26.                        width, 
  27.                        height  : Positive ); 
  28.     pragma Precondition( dst /= Null_Address ); 
  29.     pragma Precondition( src /= Null_Address ); 
  30.     pragma Precondition( Unsigned_32(width) <= srcXres ); 
  31.     pragma Precondition( dstXres >= Unsigned_32(width) * 2 ); 
  32.  
  33.     -- Scales source 3x to destination. 
  34.     -- 
  35.     -- dst     : address of destination bitmap 
  36.     -- dstXres : width in pixels of destination bitmap 
  37.     -- src     : address of source bitmap 
  38.     -- srcXres : width in pixels of source bitmap 
  39.     -- width   : width of top left area in source bitmap to scale 
  40.     -- height  : height of top left area in source bitmap to scale 
  41.     procedure Scale3x( dst     : Address; 
  42.                        dstXres : Unsigned_32; 
  43.                        src     : Address; 
  44.                        srcXres : Unsigned_32; 
  45.                        width, 
  46.                        height  : Positive ); 
  47.     pragma Precondition( dst /= Null_Address ); 
  48.     pragma Precondition( src /= Null_Address ); 
  49.     pragma Precondition( Unsigned_32(width) <= srcXres ); 
  50.     pragma Precondition( dstXres >= Unsigned_32(width) * 3 ); 
  51.  
  52.     -- Scales source 4x to destination, returning True on success. This function 
  53.     -- essentially applies the scale2x function twice. The function could 
  54.     -- possibly fail there isn't enough memory available for a temporary bitmap. 
  55.     -- 
  56.     -- dst     : address of destination bitmap 
  57.     -- dstXres : width in pixels of destination bitmap 
  58.     -- src     : address of source bitmap 
  59.     -- srcXres : width in pixels of source bitmap 
  60.     -- width   : width of top left area in source bitmap to scale 
  61.     -- height  : height of top left area in source bitmap to scale 
  62.     function Scale4x( dst     : Address; 
  63.                       dstXres : Unsigned_32; 
  64.                       src     : Address; 
  65.                       srcXres : Unsigned_32; 
  66.                       width, 
  67.                       height  : Positive ) return Boolean; 
  68.     pragma Precondition( dst /= Null_Address ); 
  69.     pragma Precondition( src /= Null_Address ); 
  70.     pragma Precondition( Unsigned_32(width) <= srcXres ); 
  71.     pragma Precondition( dstXres >= Unsigned_32(width) * 4 ); 
  72.  
  73.     -- Scales source 2x wide by 3x high to destination. 
  74.     -- 
  75.     -- dst     : address of destination bitmap 
  76.     -- dstXres : width in pixels of destination bitmap 
  77.     -- src     : address of source bitmap 
  78.     -- srcXres : width in pixels of source bitmap 
  79.     -- width   : width of top left area in source bitmap to scale 
  80.     -- height  : height of top left area in source bitmap to scale 
  81.     procedure Scale2x3( dst     : Address; 
  82.                         dstXres : Unsigned_32; 
  83.                         src     : Address; 
  84.                         srcXres : Unsigned_32; 
  85.                         width, 
  86.                         height  : Positive ); 
  87.     pragma Precondition( dst /= Null_Address ); 
  88.     pragma Precondition( src /= Null_Address ); 
  89.     pragma Precondition( Unsigned_32(width) <= srcXres ); 
  90.     pragma Precondition( dstXres >= Unsigned_32(width) * 2 ); 
  91.  
  92.     -- Scales source 2x wide by 4x high to destination. 
  93.     -- 
  94.     -- dst     : address of destination bitmap 
  95.     -- dstXres : width in pixels of destination bitmap 
  96.     -- src     : address of source bitmap 
  97.     -- srcXres : width in pixels of source bitmap 
  98.     -- width   : width of top left area in source bitmap to scale 
  99.     -- height  : height of top left area in source bitmap to scale 
  100.     procedure Scale2x4( dst     : Address; 
  101.                         dstXres : Unsigned_32; 
  102.                         src     : Address; 
  103.                         srcXres : Unsigned_32; 
  104.                         width, 
  105.                         height  : Positive ); 
  106.     pragma Precondition( dst /= Null_Address ); 
  107.     pragma Precondition( src /= Null_Address ); 
  108.     pragma Precondition( Unsigned_32(width) <= srcXres ); 
  109.     pragma Precondition( dstXres >= Unsigned_32(width) * 2 ); 
  110.  
  111. end Scale_X;