kolrabi's another Image Library  1.11.0
 All Files Functions Groups Pages
Image File Operations

Loading, saving, determining type of image files. More...

Functions

ILboolean ILAPIENTRY ilCanIdentifyFormat (ILenum Format)
 Checks if a given image format can be automatically detected from data. More...
 
ILboolean ILAPIENTRY ilCanLoadFormat (ILenum Format)
 Checks if a given image format can be loaded. More...
 
ILboolean ILAPIENTRY ilCanSaveFormat (ILenum Format)
 Checks if a given image format can be saved. More...
 
ILAPI ILuint ILAPIENTRY ilDetermineSize (ILenum Type)
 Returns the size of the memory buffer needed to save the current image into this Type. More...
 
ILenum ILAPIENTRY ilDetermineType (ILconst_string FileName)
 Determines the type of a file from its contents or if necessary from its extension. More...
 
ILenum ILAPIENTRY ilDetermineTypeF (ILHANDLE File)
 Determines the type of a file from its contents. More...
 
ILenum ILAPIENTRY ilDetermineTypeFuncs ()
 Determines the type of a file from its contents starting from the current position of the current file. More...
 
ILenum ILAPIENTRY ilDetermineTypeL (const void *Lump, ILuint Size)
 Determines the type of a lump in memory from its contents. More...
 
ILAPI const ILconst_string
*ILAPIENTRY 
ilGetFormatExts (ILenum Format)
 Gets file extensions by which a given format is identified. More...
 
ILuint64 ILAPIENTRY ilGetLumpPos ()
 Get the current position into the memory lump (if any is set) of the currently bound image.
 
ILboolean ILAPIENTRY ilIsValid (ILenum Type, ILconst_string FileName)
 Check if a file is of a given type. More...
 
ILboolean ILAPIENTRY ilIsValidF (ILenum Type, ILHANDLE File)
 Check if a file is of a given type. More...
 
ILboolean ILAPIENTRY ilIsValidL (ILenum Type, void *Lump, ILuint Size)
 Check if a memory lump is of a given type. More...
 
ILboolean ILAPIENTRY ilLoad (ILenum Type, ILconst_string FileName)
 Attempts to load an image from a file. More...
 
ILboolean ILAPIENTRY ilLoadData (ILconst_string FileName, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp)
 Loads raw data from a file.
 
ILboolean ILAPIENTRY ilLoadDataF (ILHANDLE File, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp)
 Loads raw data from an already-opened file.
 
ILboolean ILAPIENTRY ilLoadDataL (void *Lump, ILuint Size, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp)
 Loads raw data from a memory "lump".
 
ILboolean ILAPIENTRY ilLoadF (ILenum Type, ILHANDLE File)
 Attempts to load an image from a file stream. More...
 
ILboolean ILAPIENTRY ilLoadFuncs (ILenum Type)
 Attempts to load an image using the currently set IO functions. More...
 
ILboolean ILAPIENTRY ilLoadImage (ILconst_string FileName)
 Attempts to load an image from a file with various different methods before failing - very generic. More...
 
ILboolean ILAPIENTRY ilLoadL (ILenum Type, const void *Lump, ILuint Size)
 Attempts to load an image from a memory buffer. More...
 
ILboolean ILAPIENTRY ilLoadPal (ILconst_string FileName)
 Loads a palette from FileName into the current image's palette.
 
void ILAPIENTRY ilResetRead ()
 Reset the file reading functions of the currently bound image to the default.
 
void ILAPIENTRY ilResetWrite ()
 Reset the file saving functions of the currently bound image to the default.
 
ILboolean ILAPIENTRY ilSave (ILenum Type, ILconst_string FileName)
 Attempts to save an image to a file. More...
 
ILboolean ILAPIENTRY ilSaveData (ILconst_string FileName)
 Save the current image to FileName as raw data.
 
ILuint ILAPIENTRY ilSaveF (ILenum Type, ILHANDLE File)
 Attempts to save an image to a file stream. More...
 
ILAPI ILboolean ILAPIENTRY ilSaveFuncs (ILenum type)
 Attempts to load an image using the currently set IO functions. More...
 
ILboolean ILAPIENTRY ilSaveImage (ILconst_string FileName)
 Saves the current image based on the extension given in FileName. More...
 
ILuint ILAPIENTRY ilSaveL (ILenum Type, void *Lump, ILuint Size)
 Attempts to save an image to a memory buffer. More...
 
ILboolean ILAPIENTRY ilSavePal (ILconst_string FileName)
 Saves a palette from the current image's palette to a file.
 
ILboolean ILAPIENTRY ilSetRead (fOpenProc aOpen, fCloseProc aClose, fEofProc aEof, fGetcProc aGetc, fReadProc aRead, fSeekProc aSeek, fTellProc aTell)
 Allows you to override the default file-reading functions.
 
ILboolean ILAPIENTRY ilSetWrite (fOpenProc Open, fCloseProc Close, fPutcProc Putc, fSeekProc Seek, fTellProc Tell, fWriteProc Write)
 Allows you to override the default file-writing functions.
 
ILenum ILAPIENTRY ilTypeFromExt (ILconst_string FileName)
 Get the image type for a given file name by its extension.
 

Detailed Description

Loading, saving, determining type of image files.

Function Documentation

ILboolean ILAPIENTRY ilCanIdentifyFormat ( ILenum  Format)

Checks if a given image format can be automatically detected from data.

Since
1.11.0
ILboolean ILAPIENTRY ilCanLoadFormat ( ILenum  Format)

Checks if a given image format can be loaded.

Since
1.11.0
ILboolean ILAPIENTRY ilCanSaveFormat ( ILenum  Format)

Checks if a given image format can be saved.

Since
1.11.0
ILAPI ILuint ILAPIENTRY ilDetermineSize ( ILenum  Type)

Returns the size of the memory buffer needed to save the current image into this Type.

A return value of 0 is an error.

ILenum ILAPIENTRY ilDetermineType ( ILconst_string  FileName)

Determines the type of a file from its contents or if necessary from its extension.

Uses globally set io functions (ilSetRead/ilSetReadF)

ILenum ILAPIENTRY ilDetermineTypeF ( ILHANDLE  File)

Determines the type of a file from its contents.

Uses globally set io functions (ilSetRead/ilSetReadF)

ILenum ILAPIENTRY ilDetermineTypeFuncs ( )

Determines the type of a file from its contents starting from the current position of the current file.

Uses globally set io functions (ilSetRead/ilSetReadF)

ILenum ILAPIENTRY ilDetermineTypeL ( const void *  Lump,
ILuint  Size 
)

Determines the type of a lump in memory from its contents.

Uses globally set io functions (ilSetRead/ilSetReadF)

ILAPI const ILconst_string* ILAPIENTRY ilGetFormatExts ( ILenum  Format)

Gets file extensions by which a given format is identified.

Returns
Pointer to an array containing file extensions, last entry in array is NULL. If format is unknown, NULL is returned.
Since
1.11.0
ILboolean ILAPIENTRY ilIsValid ( ILenum  Type,
ILconst_string  FileName 
)

Check if a file is of a given type.

Uses globally set io functions (ilSetRead/ilSetReadF)

ILboolean ILAPIENTRY ilIsValidF ( ILenum  Type,
ILHANDLE  File 
)

Check if a file is of a given type.

Uses globally set io functions (ilSetRead/ilSetReadF)

ILboolean ILAPIENTRY ilIsValidL ( ILenum  Type,
void *  Lump,
ILuint  Size 
)

Check if a memory lump is of a given type.

Uses globally set io functions (ilSetRead/ilSetReadF)

ILboolean ILAPIENTRY ilLoad ( ILenum  Type,
ILconst_string  FileName 
)

Attempts to load an image from a file.

The file format is specified by the user.

Parameters
TypeFormat of this file. Acceptable values are IL_BLP, IL_BMP, IL_CUT, IL_DCX, IL_DDS, IL_DICOM, IL_DOOM, IL_DOOM_FLAT, IL_DPX, IL_EXR, IL_FITS, IL_FTX, IL_GIF, IL_HDR, IL_ICO, IL_ICNS, IL_IFF, IL_IWI, IL_JP2, IL_JPG, IL_LIF, IL_MDL, IL_MNG, IL_MP3, IL_PCD, IL_PCX, IL_PIX, IL_PNG, IL_PNM, IL_PSD, IL_PSP, IL_PXR, IL_ROT, IL_SGI, IL_SUN, IL_TEXTURE, IL_TGA, IL_TIF, IL_TPL, IL_UTX, IL_VTF, IL_WAL, IL_WBMP, IL_XPM, IL_RAW, IL_JASC_PAL and IL_TYPE_UNKNOWN. If IL_TYPE_UNKNOWN is specified, ilLoad will try to determine the type of the file and load it.
FileNameAnsi or Unicode string, depending on the compiled version of DevIL, that gives the filename of the file to load.
Returns
Boolean value of failure or success. Returns IL_FALSE if all three loading methods have been tried and failed.
ILboolean ILAPIENTRY ilLoadF ( ILenum  Type,
ILHANDLE  File 
)

Attempts to load an image from a file stream.

The file format is specified by the user.

Parameters
TypeFormat of this file. Acceptable values are IL_BLP, IL_BMP, IL_CUT, IL_DCX, IL_DDS, IL_DICOM, IL_DOOM, IL_DOOM_FLAT, IL_DPX, IL_EXR, IL_FITS, IL_FTX, IL_GIF, IL_HDR, IL_ICO, IL_ICNS, IL_IFF, IL_IWI, IL_JP2, IL_JPG, IL_LIF, IL_MDL, IL_MNG, IL_MP3, IL_PCD, IL_PCX, IL_PIX, IL_PNG, IL_PNM, IL_PSD, IL_PSP, IL_PXR, IL_ROT, IL_SGI, IL_SUN, IL_TEXTURE, IL_TGA, IL_TIF, IL_TPL, IL_UTX, IL_VTF, IL_WAL, IL_WBMP, IL_XPM, IL_RAW, IL_JASC_PAL and IL_TYPE_UNKNOWN. If IL_TYPE_UNKNOWN is specified, ilLoadF will try to determine the type of the file and load it.
FileFile stream to load from. The caller is responsible for closing the handle.
Returns
Boolean value of failure or success. Returns IL_FALSE if loading fails.
ILboolean ILAPIENTRY ilLoadFuncs ( ILenum  Type)

Attempts to load an image using the currently set IO functions.

The file format is specified by the user.

Parameters
TypeFormat of this file. Acceptable values are IL_BLP, IL_BMP, IL_CUT, IL_DCX, IL_DDS, IL_DICOM, IL_DOOM, IL_DOOM_FLAT, IL_DPX, IL_EXR, IL_FITS, IL_FTX, IL_GIF, IL_HDR, IL_ICO, IL_ICNS, IL_IFF, IL_IWI, IL_JP2, IL_JPG, IL_LIF, IL_MDL, IL_MNG, IL_MP3, IL_PCD, IL_PCX, IL_PIX, IL_PNG, IL_PNM, IL_PSD, IL_PSP, IL_PXR, IL_ROT, IL_SGI, IL_SUN, IL_TEXTURE, IL_TGA, IL_TIF, IL_TPL, IL_UTX, IL_VTF, IL_WAL, IL_WBMP, IL_XPM, IL_RAW, IL_JASC_PAL and IL_TYPE_UNKNOWN. If IL_TYPE_UNKNOWN is specified, ilLoadFuncs fails.
Returns
Boolean value of failure or success. Returns IL_FALSE if loading fails.
ILboolean ILAPIENTRY ilLoadImage ( ILconst_string  FileName)

Attempts to load an image from a file with various different methods before failing - very generic.

The ilLoadImage function allows a general interface to the specific internal file-loading routines. First, it finds the extension and checks to see if any user-registered functions (registered through ilRegisterLoad) match the extension. If nothing matches, it takes the extension and determines which function to call based on it. Lastly, it attempts to identify the image based on various image header verification functions, such as ilIsValidPngF. If all this checking fails, IL_FALSE is returned with no modification to the current bound image.

Parameters
FileNameAnsi or Unicode string, depending on the compiled version of DevIL, that gives the filename of the file to load.
Returns
Boolean value of failure or success. Returns IL_FALSE if all three loading methods have been tried and failed.
ILboolean ILAPIENTRY ilLoadL ( ILenum  Type,
const void *  Lump,
ILuint  Size 
)

Attempts to load an image from a memory buffer.

The file format is specified by the user.

Parameters
TypeFormat of this file. Acceptable values are IL_BLP, IL_BMP, IL_CUT, IL_DCX, IL_DDS, IL_DICOM, IL_DOOM, IL_DOOM_FLAT, IL_DPX, IL_EXR, IL_FITS, IL_FTX, IL_GIF, IL_HDR, IL_ICO, IL_ICNS, IL_IFF, IL_IWI, IL_JP2, IL_JPG, IL_LIF, IL_MDL, IL_MNG, IL_MP3, IL_PCD, IL_PCX, IL_PIX, IL_PNG, IL_PNM, IL_PSD, IL_PSP, IL_PXR, IL_ROT, IL_SGI, IL_SUN, IL_TEXTURE, IL_TGA, IL_TIF, IL_TPL, IL_UTX, IL_VTF, IL_WAL, IL_WBMP, IL_XPM, IL_RAW, IL_JASC_PAL and IL_TYPE_UNKNOWN. If IL_TYPE_UNKNOWN is specified, ilLoadL will try to determine the type of the file and load it.
LumpThe buffer where the file data is located
SizeSize of the buffer
Returns
Boolean value of failure or success. Returns IL_FALSE if loading fails.
ILboolean ILAPIENTRY ilSave ( ILenum  Type,
ILconst_string  FileName 
)

Attempts to save an image to a file.

The file format is specified by the user.

Parameters
TypeFormat of this file. Acceptable values are IL_BMP, IL_CHEAD, IL_DDS, IL_EXR, IL_HDR, IL_JP2, IL_JPG, IL_PCX, IL_PNG, IL_PNM, IL_PSD, IL_RAW, IL_SGI, IL_TGA, IL_TIF, IL_VTF, IL_WBMP and IL_JASC_PAL.
FileNameAnsi or Unicode string, depending on the compiled version of DevIL, that gives the filename to save to.
Returns
Boolean value of failure or success. Returns IL_FALSE if saving failed.
ILuint ILAPIENTRY ilSaveF ( ILenum  Type,
ILHANDLE  File 
)

Attempts to save an image to a file stream.

The file format is specified by the user.

Parameters
TypeFormat of this file. Acceptable values are all supported image and palette type values, eg. IL_BMP, IL_CHEAD, IL_DDS, IL_EXR, etc. If the given type is a palette type only the palette is saved.
FileFile stream to save to.
Returns
Boolean value of failure or success. Returns IL_FALSE if saving failed.
ILAPI ILboolean ILAPIENTRY ilSaveFuncs ( ILenum  type)

Attempts to load an image using the currently set IO functions.

The file format is specified by the user.

Parameters
typeThe image/palette file type to save.
See Also
ilSetWrite
ILboolean ILAPIENTRY ilSaveImage ( ILconst_string  FileName)

Saves the current image based on the extension given in FileName.

Parameters
FileNameAnsi or Unicode string, depending on the compiled version of DevIL, that gives the filename to save to.
Returns
Boolean value of failure or success. Returns IL_FALSE if saving failed.
ILuint ILAPIENTRY ilSaveL ( ILenum  Type,
void *  Lump,
ILuint  Size 
)

Attempts to save an image to a memory buffer.

The file format is specified by the user.

Parameters
TypeFormat of this image file. Acceptable values are IL_BMP, IL_CHEAD, IL_DDS, IL_EXR, IL_HDR, IL_JP2, IL_JPG, IL_PCX, IL_PNG, IL_PNM, IL_PSD, IL_RAW, IL_SGI, IL_TGA, IL_TIF, IL_VTF, IL_WBMP and IL_JASC_PAL.
LumpMemory buffer to save to
SizeSize of the memory buffer
Returns
The number of bytes written to the lump, or 0 in case of failure