Image I/O addon

al_init_image_addon

bool al_init_image_addon(void)

Initializes the IIO addon.

al_shutdown_image_addon

void al_shutdown_image_addon(void)

Shut down the IIO addon. This is done automatically at program exit, but can be called any time the user wishes as well.

al_register_bitmap_loader

bool al_register_bitmap_loader(const char *extension,
   ALLEGRO_BITMAP *(*loader)(const char *filename))

Register a handler for al_load_bitmap. The given function will be used to handle the loading of bitmaps files with the given extension.

The extension should include the leading dot ('.') character. It will be matched case-insensitively.

The loader argument may be NULL to unregister an entry.

Returns true on success, false on error. Returns false if unregistering an entry that doesn't exist.

al_register_bitmap_saver

bool al_register_bitmap_saver(const char *extension,
   bool (*saver)(const char *filename, ALLEGRO_BITMAP *bmp))

Register a handler for al_save_bitmap. The given function will be used to handle the loading of bitmaps files with the given extension.

The extension should include the leading dot ('.') character. It will be matched case-insensitively.

The saver argument may be NULL to unregister an entry.

Returns true on success, false on error. Returns false if unregistering an entry that doesn't exist.

al_register_bitmap_loader_stream

bool al_register_bitmap_loader_stream(const char *extension,
   ALLEGRO_BITMAP *(*loader_stream)(ALLEGRO_FILE *fp))

Register a handler for al_load_bitmap_stream. The given function will be used to handle the loading of bitmaps files with the given extension.

The extension should include the leading dot ('.') character. It will be matched case-insensitively.

The fs_loader argument may be NULL to unregister an entry.

Returns true on success, false on error. Returns false if unregistering an entry that doesn't exist.

al_register_bitmap_saver_stream

bool al_register_bitmap_saver_stream(const char *extension,
   bool (*saver_stream)(ALLEGRO_FILE *fp, ALLEGRO_BITMAP *bmp))

Register a handler for al_save_bitmap_stream. The given function will be used to handle the loading of bitmaps files with the given extension.

The extension should include the leading dot ('.') character. It will be matched case-insensitively.

The saver_stream argument may be NULL to unregister an entry.

Returns true on success, false on error. Returns false if unregistering an entry that doesn't exist.

al_load_bitmap

ALLEGRO_BITMAP *al_load_bitmap(const char *filename)

Loads an image file into an ALLEGRO_BITMAP. The file type is determined by the extension.

Returns NULL on error.

See also: al_load_bitmap_stream, al_register_bitmap_loader, al_set_new_bitmap_format, al_set_new_bitmap_flags

al_load_bitmap_stream

ALLEGRO_BITMAP *al_load_bitmap_stream(ALLEGRO_FILE *fp, const char *ident)

Loads an image from an ALLEGRO_FILE stream into an ALLEGRO_BITMAP. The file type is determined by the passed 'ident' parameter, which is a file name extension including the leading dot.

Returns NULL on error.

See also: al_load_bitmap, al_register_bitmap_loader_stream

al_save_bitmap

bool al_save_bitmap(const char *filename, ALLEGRO_BITMAP *bitmap)

Saves an ALLEGRO_BITMAP to an image file. The file type is determined by the extension.

Returns true on success, false on error.

See also: al_save_bitmap_stream, al_register_bitmap_saver

al_save_bitmap_stream

bool al_save_bitmap_stream(ALLEGRO_FILE *fp, const char *ident,
   ALLEGRO_BITMAP *bitmap)

Saves an ALLEGRO_BITMAP to an ALLEGRO_FILE stream. The file type is determined by the passed 'ident' parameter, which is a file name extension including the leading dot.

Returns true on success, false on error.

See also: al_save_bitmap, al_register_bitmap_saver_stream

al_load_bmp

ALLEGRO_BITMAP *al_load_bmp(const char *filename)

Create a new ALLEGRO_BITMAP from a BMP file. The bitmap is created with al_create_bitmap.

Returns NULL on error.

See Also: al_load_bitmap.

al_load_bmp_stream

See al_load_bmp and al_load_bitmap_stream.

al_load_jpg

ALLEGRO_BITMAP *al_load_jpg(char const *filename)

Create a new ALLEGRO_BITMAP from a JPEG file. The bitmap is created with al_create_bitmap.

Returns NULL on error.

See Also: al_load_bitmap.

al_load_jpg_stream

See al_load_jpg and al_load_bitmap_stream.

al_load_pcx

ALLEGRO_BITMAP *al_load_pcx(const char *filename)

Create a new ALLEGRO_BITMAP from a PCX file. The bitmap is created with al_create_bitmap.

Returns NULL on error.

See Also: al_load_bitmap.

al_load_pcx_stream

See al_load_pcx and al_load_bitmap_stream.

al_load_png

ALLEGRO_BITMAP *al_load_png(const char *filename)

Create a new ALLEGRO_BITMAP from a PNG file. The bitmap is created with al_create_bitmap.

Returns NULL on error.

See Also: al_load_bitmap.

al_load_png_stream

See al_load_png and al_load_bitmap_stream.

al_load_tga

ALLEGRO_BITMAP *al_load_tga(const char *filename)

Create a new ALLEGRO_BITMAP from a TGA file. The bitmap is created with al_create_bitmap.

Returns NULL on error.

See Also: al_load_bitmap.

al_load_tga_stream

See al_load_tga and al_load_bitmap_stream.

al_save_bmp

bool al_save_bmp(const char *filename, ALLEGRO_BITMAP *bmp)

Save an ALLEGRO_BITMAP as a BMP file.

Returns true on success, false on error.

See Also: al_save_bitmap.

al_save_bmp_stream

See al_save_bmp and al_save_bitmap_stream.

al_save_jpg

bool al_save_jpg(char const *filename, ALLEGRO_BITMAP *bmp)

Save an ALLEGRO_BITMAP as a JPEG file.

Returns true on success, false on error.

See Also: al_save_bitmap.

al_save_jpg_stream

See al_save_jpg and al_save_bitmap_stream.

al_save_pcx

bool al_save_pcx(const char *filename, ALLEGRO_BITMAP *bmp)

Save an ALLEGRO_BITMAP as a PCX file.

Returns true on success, false on error.

See Also: al_save_bitmap.

al_save_pcx_stream

See al_save_pcx and al_save_bitmap_stream.

al_save_png

bool al_save_png(const char *filename, ALLEGRO_BITMAP *bmp)

Save an ALLEGRO_BITMAP as a PNG file.

Returns true on success, false on error.

See Also: al_save_bitmap.

al_save_png_stream

See al_save_png and al_save_bitmap_stream.

al_save_tga

bool al_save_tga(const char *filename, ALLEGRO_BITMAP *bmp)

Save an ALLEGRO_BITMAP as a TGA file.

Returns true on success, false on error.

See Also: al_save_bitmap.

al_save_tga_stream

See al_save_tga and al_save_bitmap_stream.

al_get_allegro_image_version

uint32_t al_get_allegro_image_version(void)

Returns the (compiled) version of the addon, in the same format as al_get_allegro_version.

Last updated: 2009-09-13 09:23:37 UTC