--
-- Copyright (c) 2012 Kevin Wellwood
-- All rights reserved.
--
-- This source code is distributed under the Modified BSD License. For terms and
-- conditions, see license.txt.
--
with Ada.Streams; use Ada.Streams;
with Allegro.Bitmaps; use Allegro.Bitmaps;
package Resources.Images is
-- Returns True if the given format is supported. The format string is the
-- image format file extension without a leading dot character.
function Is_Format_Supported( format : String ) return Boolean;
-- Loads the an image of the given format from a memory block. The format
-- string is the image format file extension without a leading dot
-- character. Raises a RESOURCE_FORMAT_ERROR on error.
function Load_Image( format : String;
data : not null access Stream_Element_Array
) return A_Allegro_Bitmap;
-- Loads an image from resource file 'resource', if it's not null and of a
-- supported image format. The filename of 'resource' will be used to
-- determine the file format. Raises a RESOURCE_FORMAT_ERROR on error.
function Load_Image( resource : A_Resource_File ) return A_Allegro_Bitmap;
-- Loads an image from 'filepath', if it's of a supported image format.
-- If 'filename' is relative, it will be searched for according to the
-- standard rules for finding a resource. (See Resources.Load_Resource)
-- Raises a RESOURCE_ERROR on file not found, and RESOURCE_FORMAT_ERROR on
-- file load error.
function Load_Image( filepath : String; group : String ) return A_Allegro_Bitmap;
end Resources.Images;