DevIL Documentation Home | Previous | Next

ilLoad, ilLoadF, ilLoadL

These functions load a specific type of image from a file, file handle or memory "lump".


ILboolean ilLoad(
  ILenum Type,
  char *FileName
);

ILboolean ilLoadF( ILenum Type, ILHANDLE File );

ILboolean ilLoadL( ILenum Type, ILvoid *Lump, ILuint Size );


Parameters

Type
IL_TYPE_UNKNOWN
Tells DevIL to try to determine the type of image present in FileName, File or Lump.
IL_BMP
Load the image as a Microsoft bitmap (.bmp).
IL_CUT
Load the image as a .cut image.
IL_DDS
Load the image as a DirectDraw Surface (.dds) image.
IL_DOOM
Load the image as a Doom texture.
IL_DOOM_FLAT
Load the image as a Doom flat (floor).
IL_GIF
Load the image as a Graphics Interchange Format (.gif) file.
IL_ICO
Load the image as a Microsoft icon (.ico).
IL_JPG
Load the image as a Jpeg (.jpg).
IL_LIF
Load the image as a Homeworld .lif file.
IL_MNG
Load the image as a .mng file.
IL_PCD
Load the image as a .pcd image.
IL_PCX
Load the image as a PCX.
IL_PIC
Load the image as a .pic image.
IL_PNG
Load the image as a Portable Network Graphics (.png) image.
IL_PNM
Load the image as a Portable AnyMap (.pbm, .pgm or .ppm).
IL_PSD
Load the image as an Adobe Photoshop (.psd) image.
IL_PSP
Load the image as a Paint Shop Pro (.psp) image.
IL_SGI
Load the image as a SGI (.bw, .rgb, .rgba or .sgi).
IL_TGA
Load the image as a TrueVision Targa.
IL_TIF
Load the image as a TIFF (.tif or .tiff) image.
IL_RAW
Load the image as raw data with a 13-byte header.
IL_JASC_PAL
Load the file into the current image's palette as a Paint Shop Pro (Jasc) palette.
FileName
The filename of a file to open.
File
Pointer to a file handle to read from.
Lump
Pointer to a memory "lump" to read from.
Size
Size of the memory "lump". If zero, no bounds-checking is done.

Remarks

ilLoad can be used much in the same way ilLoadImage is used, except with ilLoad, it is possible to force OpenIL to load a file as a specific image format, no matter what the extension. ilLoadF is useful for when an image is being read from some type of resource or .pak-type file, as is ilLoadL. To provide support for other languages than C/C++, ilSetFileCallbacks was introduced to allow loading from file handles in these languages via ilLoadF.

Due to limitations in the external libraries used, ilLoadF and ilLoadL do not support all the formats ilLoad does. ilLoadF is missing support for IL_TIF images. ilLoadL also lacks support for the IL_TIF format.

Error Codes

IL_ILLEGAL_OPERATION - There is currently no image bound. Use ilGenImages and ilBindImage before calling this function.
IL_COULD_NOT_OPEN_FILE - The file pointed to by FileName could not be opened. Either the file does not exist or is in use by another process.
IL_INVALID_ENUM - Type was of an invalid value.
IL_INVALID_PARAM - FileName, File or Lump was NULL.
IL_INVALID_FILE_HEADER - The file had an invalid header and could not be loaded.
IL_ILLEGAL_FILE_VALUE - The file could not be loaded due to an invalid value present.
IL_OUT_OF_MEMORY - Could not allocate memory for the new image data.
IL_LIB_JPEG_ERROR - Error occurred when trying to load a jpeg.
IL_LIB_PNG_ERROR - Error occurred when trying to load a png.

See Also

ilGenImages, ilBindImage, ilLoadImage, ilSave, ilSaveImage, ilSetFileCallbacks