Index

Package: LoadPNG

Description

package LoadPNG is

Subprograms & Entries

LoadPNG_Copyright

function LoadPNG_Copyright return String;
Returns the copyright tag for LoadPNG.

LoadPNG_Version

function LoadPNG_Version return String;
Returns a string describing the library version in the form "LibraryName dotted.version"

Set_PNG_Screen_Gamma

procedure Set_PNG_Screen_Gamma
( gamma: Long_Float );
png_screen_gamma is slightly overloaded (sorry): A value of 0.0 means: Don't do any gamma correction in load_png() and load_memory_png(). This meaning was introduced in v1.4. A value of -1.0 means: Use the value from the environment variable SCREEN_GAMMA (if available), otherwise fallback to a value of 2.2 (a good guess for PC monitors, and the value for sRGB colourspace). This is the default. Otherwise, the value of png_screen_gamma is taken as-is.

Set_PNG_Compression_Level

procedure Set_PNG_Compression_Level
( level: Integer );
Choose zlib compression level for saving file. Default is Z_BEST_COMPRESSION.

Load_PNG

function Load_PNG
( filename: String;
pal: A_RGB ) return A_Bitmap;
Load a PNG from disk.

Load_PNG_Pf

function Load_PNG_Pf
( fp: not null A_Packfile;
pal: A_RGB ) return A_Bitmap;
Load a PNG from some place.

Load_Memory_PNG

function Load_Memory_PNG
( buffer: Address;
buffer_size: Natural;
pal: A_RGB ) return A_Bitmap;
Load a PNG from memory.

Save_PNG

function Save_PNG
( filename: String;
bmp: A_Bitmap;
pal: A_RGB ) return Integer;
Save a bitmap to disk in PNG format. Returns 0 on success.

Register_PNG_File_Type

procedure Register_PNG_File_Type;
Adds `PNG' to Allegro's internal file type table. You can then just use load_bitmap and save_bitmap as usual.

Register_PNG_Datafile_Object

procedure Register_PNG_Datafile_Object
( id: AL_ID );
Register an datafile type ID with Allegro, so that when an object with that type ID is encountered while loading a datafile, that object will be loaded as a PNG file.

LoadPNG_Init

function LoadPNG_Init return Integer;
This is supposed to resemble jpgalleg_init in JPGalleg 2.0, just in case you are lazier than lazy. It contains these 3 lines of code: register_png_datafile_object(DAT_ID('P','N','G',' ')); register_png_file_type(); return 0;