DevIL Documentation Home | Previous | Next

ilConvertImage

The ilConvertImage function converts an image from one format to another.


ILboolean ilConvertImage(
  ILenum DestFormat
);

Parameters

DestFormat
The format the current image should be converted to. Values accepted for DestFormat include:
IL_RGB
IL_RGBA
IL_BGR
IL_BGRA
IL_LUMINANCE

Remarks

ilConvertImage converts the current bound image from its format to DestFormat. Almost all conversions are allowable, except for conversions to IL_COLOR_INDEX images. ilConvertImage automatically assumes right now that all images loaded are of type IL_UNSIGNED_BYTE.

Error Codes

IL_ILLEGAL_OPERATION - There is currently no image bound. Use ilGenImages and ilBindImage before calling this function.
IL_INVALID_CONVERSION - The current image uses greater than 32 bits per pixel, or DestFormat was an invalid identifier.
IL_OUT_OF_MEMORY - Could not allocate memory for the converted image data.

See Also

ilGenImages, ilBindImage, ilGetBoolean, ilGetBooleanv, ilGetInteger, ilGetIntegerv, ilConvertPal