with Allegro.Bitmaps; use Allegro.Bitmaps;
with Allegro.Files; use Allegro.Files;
with Allegro.Palettes; use Allegro.Palettes;
with Interfaces.C.Strings; use Interfaces.C.Strings;
package Allegro.Image_Files is
type A_Bitmap_Loader is
access function( filename : C.Strings.chars_ptr; pal : A_RGB ) return A_Bitmap;
type A_Bitmap_Saver is
access function( filename : C.Strings.chars_ptr;
bmp : A_Bitmap;
pal : A_RGB ) return Integer;
subtype Conv_Type is Unsigned_32;
COLORCONV_NONE : constant Conv_Type;
COLORCONV_8_TO_15 : constant Conv_Type;
COLORCONV_8_TO_16 : constant Conv_Type;
COLORCONV_8_TO_24 : constant Conv_Type;
COLORCONV_8_TO_32 : constant Conv_Type;
COLORCONV_15_TO_8 : constant Conv_Type;
COLORCONV_15_TO_16 : constant Conv_Type;
COLORCONV_15_TO_24 : constant Conv_Type;
COLORCONV_15_TO_32 : constant Conv_Type;
COLORCONV_16_TO_8 : constant Conv_Type;
COLORCONV_16_TO_15 : constant Conv_Type;
COLORCONV_16_TO_24 : constant Conv_Type;
COLORCONV_16_TO_32 : constant Conv_Type;
COLORCONV_24_TO_8 : constant Conv_Type;
COLORCONV_24_TO_15 : constant Conv_Type;
COLORCONV_24_TO_16 : constant Conv_Type;
COLORCONV_24_TO_32 : constant Conv_Type;
COLORCONV_32_TO_8 : constant Conv_Type;
COLORCONV_32_TO_15 : constant Conv_Type;
COLORCONV_32_TO_16 : constant Conv_Type;
COLORCONV_32_TO_24 : constant Conv_Type;
COLORCONV_32A_TO_8 : constant Conv_Type;
COLORCONV_32A_TO_15 : constant Conv_Type;
COLORCONV_32A_TO_16 : constant Conv_Type;
COLORCONV_32A_TO_24 : constant Conv_Type;
COLORCONV_DITHER_PAL : constant Conv_Type;
COLORCONV_DITHER_HI : constant Conv_Type;
COLORCONV_KEEP_TRANS : constant Conv_Type;
COLORCONV_DITHER : constant Conv_Type;
COLORCONV_EXPAND_256 : constant Conv_Type;
COLORCONV_REDUCE_TO_256 : constant Conv_Type;
COLORCONV_EXPAND_15_TO_16 : constant Conv_Type;
COLORCONV_REDUCE_16_TO_15 : constant Conv_Type;
COLORCONV_EXPAND_HI_TO_TRUE : constant Conv_Type;
COLORCONV_REDUCE_TRUE_TO_HI : constant Conv_Type;
COLORCONV_24_EQUALS_32 : constant Conv_Type;
COLORCONV_TOTAL : constant Conv_Type;
COLORCONV_PARTIAL : constant Conv_Type;
COLORCONV_MOST : constant Conv_Type;
COLORCONV_KEEP_ALPHA : constant Conv_Type;
function Get_Color_Conversion return Integer;
function Load_Bitmap( filename : String; pal : A_RGB ) return A_Bitmap;
function Load_BMP( filename : String; pal : A_RGB ) return A_Bitmap;
function Load_BMP_pf( f : not null A_Packfile; pal : A_RGB ) return A_Bitmap;
function Load_LBM( filename : String; pal : A_RGB ) return A_Bitmap;
function Load_PCX( filename : String; pal : A_RGB ) return A_Bitmap;
function Load_PCX_pf( filename : String; pal : A_RGB ) return A_Bitmap;
function Load_TGA( filename : String; pal : A_RGB ) return A_Bitmap;
function Load_TGA_pf( filename : String; pal : A_RGB ) return A_Bitmap;
procedure Register_Bitmap_File_Type( ext : String;
load : A_Bitmap_Loader;
save : A_Bitmap_Saver );
function Save_Bitmap( filename : String; bmp : A_Bitmap; pal : A_RGB ) return Boolean;
function Save_BMP( filename : String; bmp : A_Bitmap; pal : A_RGB ) return Boolean;
function Save_BMP_pf( f : A_Packfile; bmp : A_Bitmap; pal : A_RGB ) return Boolean;
function Save_PCX( filename : String; bmp : A_Bitmap; pal : A_RGB ) return Boolean;
function Save_PCX_pf( f : A_Packfile; bmp : A_Bitmap; pal : A_RGB ) return Boolean;
function Save_TGA( filename : String; bmp : A_Bitmap; pal : A_RGB ) return Boolean;
function Save_TGA_pf( f : A_Packfile; bmp : A_Bitmap; pal : A_RGB ) return Boolean;
procedure Set_Color_Conversion( mode : Conv_Type );
private
COLORCONV_NONE : constant Conv_Type := 16#00000000#;
COLORCONV_8_TO_15 : constant Conv_Type := 16#00000001#;
COLORCONV_8_TO_16 : constant Conv_Type := 16#00000002#;
COLORCONV_8_TO_24 : constant Conv_Type := 16#00000004#;
COLORCONV_8_TO_32 : constant Conv_Type := 16#00000008#;
COLORCONV_15_TO_8 : constant Conv_Type := 16#00000010#;
COLORCONV_15_TO_16 : constant Conv_Type := 16#00000020#;
COLORCONV_15_TO_24 : constant Conv_Type := 16#00000040#;
COLORCONV_15_TO_32 : constant Conv_Type := 16#00000080#;
COLORCONV_16_TO_8 : constant Conv_Type := 16#00000100#;
COLORCONV_16_TO_15 : constant Conv_Type := 16#00000200#;
COLORCONV_16_TO_24 : constant Conv_Type := 16#00000400#;
COLORCONV_16_TO_32 : constant Conv_Type := 16#00000800#;
COLORCONV_24_TO_8 : constant Conv_Type := 16#00001000#;
COLORCONV_24_TO_15 : constant Conv_Type := 16#00002000#;
COLORCONV_24_TO_16 : constant Conv_Type := 16#00004000#;
COLORCONV_24_TO_32 : constant Conv_Type := 16#00008000#;
COLORCONV_32_TO_8 : constant Conv_Type := 16#00010000#;
COLORCONV_32_TO_15 : constant Conv_Type := 16#00020000#;
COLORCONV_32_TO_16 : constant Conv_Type := 16#00040000#;
COLORCONV_32_TO_24 : constant Conv_Type := 16#00080000#;
COLORCONV_32A_TO_8 : constant Conv_Type := 16#00100000#;
COLORCONV_32A_TO_15 : constant Conv_Type := 16#00200000#;
COLORCONV_32A_TO_16 : constant Conv_Type := 16#00400000#;
COLORCONV_32A_TO_24 : constant Conv_Type := 16#00800000#;
COLORCONV_DITHER_PAL : constant Conv_Type := 16#01000000#;
COLORCONV_DITHER_HI : constant Conv_Type := 16#02000000#;
COLORCONV_KEEP_TRANS : constant Conv_Type := 16#04000000#;
COLORCONV_DITHER : constant Conv_Type := COLORCONV_DITHER_PAL or
COLORCONV_DITHER_HI;
COLORCONV_EXPAND_256 : constant Conv_Type := COLORCONV_8_TO_15 or
COLORCONV_8_TO_16 or
COLORCONV_8_TO_24 or
COLORCONV_8_TO_32;
COLORCONV_REDUCE_TO_256 : constant Conv_Type := COLORCONV_15_TO_8 or
COLORCONV_16_TO_8 or
COLORCONV_24_TO_8 or
COLORCONV_32_TO_8 or
COLORCONV_32A_TO_8;
COLORCONV_EXPAND_15_TO_16 : constant Conv_Type := COLORCONV_15_TO_16;
COLORCONV_REDUCE_16_TO_15 : constant Conv_Type := COLORCONV_16_TO_15;
COLORCONV_EXPAND_HI_TO_TRUE : constant Conv_Type := COLORCONV_15_TO_24 or
COLORCONV_15_TO_32 or
COLORCONV_16_TO_24 or
COLORCONV_16_TO_32;
COLORCONV_REDUCE_TRUE_TO_HI : constant Conv_Type := COLORCONV_24_TO_15 or
COLORCONV_24_TO_16 or
COLORCONV_32_TO_15 or
COLORCONV_32_TO_16;
COLORCONV_24_EQUALS_32 : constant Conv_Type := COLORCONV_24_TO_32 or
COLORCONV_32_TO_24;
COLORCONV_TOTAL : constant Conv_Type := COLORCONV_EXPAND_256 or
COLORCONV_REDUCE_TO_256 or
COLORCONV_EXPAND_15_TO_16 or
COLORCONV_REDUCE_16_TO_15 or
COLORCONV_EXPAND_HI_TO_TRUE or
COLORCONV_REDUCE_TRUE_TO_HI or
COLORCONV_24_EQUALS_32 or
COLORCONV_32A_TO_15 or
COLORCONV_32A_TO_16 or
COLORCONV_32A_TO_24;
COLORCONV_PARTIAL : constant Conv_Type := COLORCONV_EXPAND_15_TO_16 or
COLORCONV_REDUCE_16_TO_15 or
COLORCONV_24_EQUALS_32;
COLORCONV_MOST : constant Conv_Type := COLORCONV_EXPAND_15_TO_16 or
COLORCONV_REDUCE_16_TO_15 or
COLORCONV_EXPAND_HI_TO_TRUE or
COLORCONV_REDUCE_TRUE_TO_HI or
COLORCONV_24_EQUALS_32;
COLORCONV_KEEP_ALPHA : constant Conv_Type := COLORCONV_TOTAL and not
(COLORCONV_32A_TO_8 or
COLORCONV_32A_TO_15 or
COLORCONV_32A_TO_16 or
COLORCONV_32A_TO_24);
pragma Convention( C, A_Bitmap_Loader );
pragma Convention( C, A_Bitmap_Saver );
pragma Import( C, Get_Color_Conversion, "get_color_conversion" );
pragma Import( C, Load_BMP_pf, "load_bmp_pf" );
pragma Import( C, Load_PCX_pf, "load_pcx_pf" );
pragma Import( C, Load_TGA_pf, "load_tga_pf" );
pragma Import( C, Set_Color_Conversion, "set_color_conversion" );
end Allegro.Image_Files;