1. with Allegro.Palettes;                  use Allegro.Palettes; 
  2.  
  3. -- Allegro 4.4.2 - Truecolor pixel formats 
  4. package Allegro.Truecolor is 
  5.  
  6.     type Color_Type is new Unsigned_32; 
  7.  
  8.     ---------------------------------------------------------------------------- 
  9.  
  10.     function GetR( color : Color_Type ) return Natural; 
  11.     function GetG( color : Color_Type ) return Natural; 
  12.     function GetB( color : Color_Type ) return Natural; 
  13.     function GetA( color : Color_Type ) return Natural; 
  14.  
  15.     function GetR8( color : Color_Type ) return Natural; 
  16.     function GetG8( color : Color_Type ) return Natural; 
  17.     function GetB8( color : Color_Type ) return Natural; 
  18.  
  19.     function GetR15( color : Color_Type ) return Natural; 
  20.     function GetG15( color : Color_Type ) return Natural; 
  21.     function GetB15( color : Color_Type ) return Natural; 
  22.  
  23.     function GetR16( color : Color_Type ) return Natural; 
  24.     function GetG16( color : Color_Type ) return Natural; 
  25.     function GetB16( color : Color_Type ) return Natural; 
  26.  
  27.     function GetR24( color : Color_Type ) return Natural; 
  28.     function GetG24( color : Color_Type ) return Natural; 
  29.     function GetB24( color : Color_Type ) return Natural; 
  30.  
  31.     function GetR32( color : Color_Type ) return Natural; 
  32.     function GetG32( color : Color_Type ) return Natural; 
  33.     function GetB32( color : Color_Type ) return Natural; 
  34.     function GetA32( color : Color_Type ) return Natural; 
  35.  
  36.     function GetR_Depth( color_depth : Natural; color : Color_Type ) return Natural; 
  37.     function GetG_Depth( color_depth : Natural; color : Color_Type ) return Natural; 
  38.     function GetB_Depth( color_depth : Natural; color : Color_Type ) return Natural; 
  39.     function GetA_Depth( color_depth : Natural; color : Color_Type ) return Natural; 
  40.  
  41.     function Makecol( r, g, b : Natural ) return Color_Type; 
  42.     function Makecol8( r, g, b : Natural ) return Color_Type; 
  43.     function Makecol15( r, g, b : Natural ) return Color_Type; 
  44.     function Makecol16( r, g, b : Natural ) return Color_Type; 
  45.     function Makecol24( r, g, b : Natural ) return Color_Type; 
  46.     function Makecol32( r, g, b : Natural ) return Color_Type; 
  47.  
  48.     function Makecol15_Dither( r, g, b, x, y : Integer ) return Color_Type; 
  49.     function Makecol16_Dither( r, g, b, x, y : Integer ) return Color_Type; 
  50.  
  51.     function Makeacol( r, g, b, a : Natural ) return Color_Type; 
  52.     function Makeacol32( r, g, b, a : Natural ) return Color_Type; 
  53.  
  54.     function Makecol_Depth( color_depth, r, g, b : Natural ) return Color_Type; 
  55.     function Makeacol_Depth( color_depth, r, g, b, a : Natural ) return Color_Type; 
  56.  
  57.     -- Returns True if the colors compare within tolerance bounds. If any of the 
  58.     -- components of the colors differ by more than 'tolerance', the comparison 
  59.     -- will fail 
  60.     function Compare( a, b : Color_Type; tolerance : Natural := 0 ) return Boolean; 
  61.  
  62.     -- Returns the foreground color adjusted for contrast against the background. 
  63.     function Contrast( fg, bg : Color_Type; ratio : Float := 1.75 ) return Color_Type; 
  64.  
  65.     -- Returns white or black, depending on the brightness of the background. 
  66.     function Hard_Contrast( bg : Color_Type ) return Color_Type; 
  67.  
  68.     -- Returns a color which is lighter or darker than the input. The color will 
  69.     -- be darker where 0 < factor < 1 and lighter where factor > 1. 
  70.     function Lighten( color : Color_Type; factor : Float ) return Color_Type; 
  71.  
  72.     function Make_Grey( brightness : Natural ) return Color_Type; 
  73.  
  74.     function Palette_Color( index : Palette_Index ) return Color_Type; 
  75.  
  76. private 
  77.  
  78.     pragma Import( C, GetR, "getr" ); 
  79.     pragma Import( C, GetG, "getg" ); 
  80.     pragma Import( C, GetB, "getb" ); 
  81.     pragma Import( C, GetA, "geta" ); 
  82.  
  83.     pragma Import( C, GetR8, "getr8" ); 
  84.     pragma Import( C, GetG8, "getg8" ); 
  85.     pragma Import( C, GetB8, "getb8" ); 
  86.  
  87.     pragma Import( C, GetR15, "getr15" ); 
  88.     pragma Import( C, GetG15, "getg15" ); 
  89.     pragma Import( C, GetB15, "getb15" ); 
  90.  
  91.     pragma Import( C, GetR16, "getr16" ); 
  92.     pragma Import( C, GetG16, "getg16" ); 
  93.     pragma Import( C, GetB16, "getb16" ); 
  94.  
  95.     pragma Import( C, GetR24, "getr24" ); 
  96.     pragma Import( C, GetG24, "getg24" ); 
  97.     pragma Import( C, GetB24, "getb24" ); 
  98.  
  99.     pragma Import( C, GetR32, "getr32" ); 
  100.     pragma Import( C, GetG32, "getg32" ); 
  101.     pragma Import( C, GetB32, "getb32" ); 
  102.     pragma Import( C, GetA32, "geta32" ); 
  103.  
  104.     pragma Import( C, GetR_Depth, "getr_depth" ); 
  105.     pragma Import( C, GetG_Depth, "getg_depth" ); 
  106.     pragma Import( C, GetB_Depth, "getb_depth" ); 
  107.     pragma Import( C, GetA_Depth, "geta_depth" ); 
  108.  
  109.     pragma Import( C, Makecol,   "makecol" ); 
  110.     pragma Import( C, Makecol8,  "makecol8" ); 
  111.     pragma Import( C, Makecol15, "makecol15" ); 
  112.     pragma Import( C, Makecol16, "makecol16" ); 
  113.     pragma Import( C, Makecol24, "makecol24" ); 
  114.     pragma Import( C, Makecol32, "makecol32" ); 
  115.  
  116.     pragma Import( C, Makecol15_Dither, "makecol15_dither" ); 
  117.     pragma Import( C, Makecol16_Dither, "makecol16_dither" ); 
  118.  
  119.     pragma Import( C, Makeacol, "makeacol" ); 
  120.     pragma Import( C, Makeacol32, "makeacol32" ); 
  121.  
  122.     pragma Import( C, Makecol_Depth, "makecol_depth" ); 
  123.     pragma Import( C, Makeacol_Depth, "makeacol_depth" ); 
  124.  
  125.     pragma Import( C, Palette_Color, "get_palette_color" ); 
  126.  
  127. end Allegro.Truecolor;