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 character. 
  20.     -- An exception is raised on error. 
  21.     function Load_From_Memory( format : String; 
  22.                                data   : not null access Stream_Element_Array 
  23.                              ) return A_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. If an image can't beloaded then null will be 
  28.     -- returned. 
  29.     function Load_Image( resource : A_Resource_File ) return A_Bitmap; 
  30.  
  31.     -- Loads an image from 'filepath', if it's of a supported image format. 
  32.     -- If 'filename' is relative, it will be searched for according to the 
  33.     -- standard rules for finding a resource. (See Resources.Load_Resource) 
  34.     -- If the image can't beloaded then null will be returned. 
  35.     function Load_Image( filepath : String; group : String ) return A_Bitmap; 
  36.  
  37. end Resources.Images;