1. -- 
  2. -- Copyright (c) 2012 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 Ada.Streams;                       use Ada.Streams; 
  10. with Allegro.Bitmaps;                   use Allegro.Bitmaps; 
  11.  
  12. package Resources.Images is 
  13.  
  14.     -- Returns True if the given format is supported. The format string is the 
  15.     -- image format file extension without a leading dot character. 
  16.     function Is_Format_Supported( format : String ) return Boolean; 
  17.  
  18.     -- Loads the an image of the given format from a memory block. The format 
  19.     -- string is the image format file extension without a leading dot 
  20.     -- character. Raises a RESOURCE_FORMAT_ERROR on error. 
  21.     function Load_Image( format : String; 
  22.                          data   : not null access Stream_Element_Array 
  23.                        ) return A_Allegro_Bitmap; 
  24.  
  25.     -- Loads an image from resource file 'resource', if it's not null and of a 
  26.     -- supported image format. The filename of 'resource' will be used to 
  27.     -- determine the file format. Raises a RESOURCE_FORMAT_ERROR on error. 
  28.     function Load_Image( resource : A_Resource_File ) return A_Allegro_Bitmap; 
  29.  
  30.     -- Loads an image from 'filepath', if it's of a supported image format. 
  31.     -- If 'filename' is relative, it will be searched for according to the 
  32.     -- standard rules for finding a resource. (See Resources.Load_Resource) 
  33.     -- Raises a RESOURCE_ERROR on file not found, and RESOURCE_FORMAT_ERROR on 
  34.     -- file load error. 
  35.     function Load_Image( filepath : String; group : String ) return A_Allegro_Bitmap; 
  36.  
  37. end Resources.Images;