1. -- 
  2. -- Copyright (c) 2013 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. with Allegro.Color;                     use Allegro.Color; 
  10. with Interfaces;                        use Interfaces; 
  11.  
  12. -- Allegro 5.0.9 - Bitmaps routines 
  13. package Allegro.Bitmaps is 
  14.  
  15.     -- Bitmaps 
  16.  
  17.     type Allegro_Bitmap is limited private; 
  18.     type A_Allegro_Bitmap is access all Allegro_Bitmap; 
  19.  
  20.     subtype Allegro_Bitmap_Flags is Unsigned_32; 
  21.     ALLEGRO_MEMORY_BITMAP          : constant Allegro_Bitmap_Flags; 
  22.     ALLEGRO_KEEP_BITMAP_FORMAT     : constant Allegro_Bitmap_Flags; 
  23.     ALLEGRO_FORCE_LOCKING          : constant Allegro_Bitmap_Flags; 
  24.     ALLEGRO_NO_PRESERVE_TEXTURE    : constant Allegro_Bitmap_Flags; 
  25.     ALLEGRO_ALPHA_TEST             : constant Allegro_Bitmap_Flags; 
  26.     ALLEGRO_MIN_LINEAR             : constant Allegro_Bitmap_Flags; 
  27.     ALLEGRO_MAG_LINEAR             : constant Allegro_Bitmap_Flags; 
  28.     ALLEGRO_MIPMAP                 : constant Allegro_Bitmap_Flags; 
  29.     ALLEGRO_NO_PREMULTIPLIED_ALPHA : constant Allegro_Bitmap_Flags; 
  30.     ALLEGRO_VIDEO_BITMAP           : constant Allegro_Bitmap_Flags; 
  31.  
  32.     function Al_Get_New_Bitmap_Flags return Allegro_Bitmap_Flags; 
  33.     pragma Import( C, Al_Get_New_Bitmap_Flags, "al_get_new_bitmap_flags" ); 
  34.  
  35.     function Al_Get_New_Bitmap_Format return Allegro_Pixel_Format; 
  36.     pragma Import( C, Al_Get_New_Bitmap_Format, "al_get_new_bitmap_format" ); 
  37.  
  38.     procedure Al_Set_New_Bitmap_Flags( flags : Allegro_Bitmap_Flags ); 
  39.     pragma Import( C, Al_Set_New_Bitmap_Flags, "al_set_new_bitmap_flags" ); 
  40.  
  41.     procedure Al_Add_New_Bitmap_Flag( flag : Allegro_Bitmap_Flags ); 
  42.     pragma Import( C, Al_Add_New_Bitmap_Flag, "al_add_new_bitmap_flag" ); 
  43.  
  44.     procedure Al_Set_New_Bitmap_Format( format : Allegro_Pixel_Format ); 
  45.     pragma Import( C, Al_Set_New_Bitmap_Format, "al_set_new_bitmap_format" ); 
  46.  
  47.     function Al_Create_Bitmap( w, h : Integer ) return A_Allegro_Bitmap; 
  48.     pragma Import( C, Al_Create_Bitmap, "al_create_bitmap" ); 
  49.  
  50.     function Al_Clone_Bitmap( bitmap : A_Allegro_Bitmap ) return A_Allegro_Bitmap; 
  51.     pragma Import( C, Al_Clone_Bitmap, "al_clone_bitmap" ); 
  52.  
  53.     procedure Al_Destroy_Bitmap( bitmap : in out A_Allegro_Bitmap ); 
  54.  
  55.     function Al_Get_Bitmap_Flags( bitmap : A_Allegro_Bitmap ) return Allegro_Bitmap_Flags; 
  56.     pragma Import( C, Al_Get_Bitmap_Flags, "al_get_bitmap_flags" ); 
  57.  
  58.     function Al_Get_Bitmap_Format( bitmap : A_Allegro_Bitmap ) return Allegro_Pixel_Format; 
  59.     pragma Import( C, Al_Get_Bitmap_Format, "al_get_bitmap_format" ); 
  60.  
  61.     function Al_Get_Bitmap_Height( bitmap : A_Allegro_Bitmap ) return Integer; 
  62.     pragma Import( C, Al_Get_Bitmap_Height, "al_get_bitmap_height" ); 
  63.  
  64.     function Al_Get_Bitmap_Width( bitmap : A_Allegro_Bitmap ) return Integer; 
  65.     pragma Import( C, Al_Get_Bitmap_Width, "al_get_bitmap_width" ); 
  66.  
  67.     -- Bitmap access 
  68.  
  69.     function Al_Get_Pixel( bitmap : A_Allegro_Bitmap; x, y : Integer ) return Allegro_Color; 
  70.     pragma Import( C, Al_Get_Pixel, "al_get_pixel" ); 
  71.  
  72.     procedure Al_Put_Pixel( x, y : Integer; color : Allegro_Color ); 
  73.     pragma Import( C, Al_Put_Pixel, "al_put_pixel" ); 
  74.  
  75.     procedure Al_Put_Blended_Pixel( x, y : Integer; color : Allegro_Color ); 
  76.     pragma Import( C, Al_Put_Blended_Pixel, "al_put_blended_pixel" ); 
  77.  
  78.     -- Masking 
  79.  
  80.     procedure Al_Convert_Mask_To_Alpha( bitmap     : A_Allegro_Bitmap; 
  81.                                         mask_color : Allegro_Color ); 
  82.     pragma Import( C, Al_Convert_Mask_To_Alpha, "al_convert_mask_to_alpha" ); 
  83.  
  84.     -- Clipping 
  85.  
  86.     procedure Al_Get_Clipping_Rectangle( x, y, w, h : out Integer ); 
  87.     pragma Import( C, Al_Get_Clipping_Rectangle, "al_get_clipping_rectangle" ); 
  88.  
  89.     procedure Al_Reset_Clipping_Rectangle; 
  90.     pragma Import( C, Al_Reset_Clipping_Rectangle, "al_reset_clipping_rectangle" ); 
  91.  
  92.     procedure Al_Set_Clipping_Rectangle( x, y, width, height : Integer ); 
  93.     pragma Import( C, Al_Set_Clipping_Rectangle, "al_set_clipping_rectangle" ); 
  94.  
  95.     -- Sub bitmaps 
  96.  
  97.     function Al_Create_Sub_Bitmap( parent : A_Allegro_Bitmap; 
  98.                                    x, y   : Integer; 
  99.                                    w, h   : Integer ) return A_Allegro_Bitmap; 
  100.     pragma Import( C, Al_Create_Sub_Bitmap, "al_create_sub_bitmap" ); 
  101.  
  102.     function Al_Is_Sub_Bitmap( bitmap : A_Allegro_Bitmap ) return Boolean; 
  103.  
  104.     function Al_Get_Parent_Bitmap( bitmap : A_Allegro_Bitmap ) return A_Allegro_Bitmap; 
  105.     pragma Import( C, Al_Get_Parent_Bitmap, "al_get_parent_bitmap" ); 
  106.  
  107. private 
  108.  
  109.     ALLEGRO_MEMORY_BITMAP          : constant Allegro_Bitmap_Flags := 16#0001#; 
  110.     ALLEGRO_KEEP_BITMAP_FORMAT     : constant Allegro_Bitmap_Flags := 16#0002#; 
  111.     ALLEGRO_FORCE_LOCKING          : constant Allegro_Bitmap_Flags := 16#0004#; 
  112.     ALLEGRO_NO_PRESERVE_TEXTURE    : constant Allegro_Bitmap_Flags := 16#0008#; 
  113.     ALLEGRO_ALPHA_TEST             : constant Allegro_Bitmap_Flags := 16#0010#; 
  114.     ALLEGRO_MIN_LINEAR             : constant Allegro_Bitmap_Flags := 16#0040#; 
  115.     ALLEGRO_MAG_LINEAR             : constant Allegro_Bitmap_Flags := 16#0080#; 
  116.     ALLEGRO_MIPMAP                 : constant Allegro_Bitmap_Flags := 16#0100#; 
  117.     ALLEGRO_NO_PREMULTIPLIED_ALPHA : constant Allegro_Bitmap_Flags := 16#0200#; 
  118.     ALLEGRO_VIDEO_BITMAP           : constant Allegro_Bitmap_Flags := 16#0400#; 
  119.  
  120.     type Allegro_Bitmap is limited null record; 
  121.     pragma Convention( C, Allegro_Bitmap ); 
  122.  
  123. end Allegro.Bitmaps;