DevIL Documentation Home | Previous | Next

ilConvertImage

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


ILboolean ilConvertImage(
  ILenum DestFormat,
  ILenum DestType
);

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
IL_COLOUR_INDEX

DestType
The type the current image should be converted to. Values accepted for DestType include:
IL_BYTE
IL_UNSIGNED_BYTE
IL_SHORT
IL_UNSIGNED_SHORT
IL_INT
IL_UNSIGNED_INT
IL_FLOAT
IL_DOUBLE

Remarks

ilConvertImage converts the current bound image from its format/type to DestFormat and DestType. Almost all conversions are allowable.

Error Codes

IL_ILLEGAL_OPERATION - There is currently no image bound. Use ilGenImages and ilBindImage before calling this function.
IL_INVALID_CONVERSION - DestFormat and/or DestType 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