DevIL Documentation Home | Previous | Next


The ilGetAlpha function returns the alpha channel of the currently bound image.

ILubyte *ilGetAlpha(
  ILenum Type


The type (IL_UNSIGNED_BYTE, IL_FLOAT, etc.) that you want the alpha in.


ilGetAlpha returns a copy of the alpha data in the currently bound image. You must free this data yourself, since it is a copy. If there is no alpha in the current image, ilGetAlpha returns an array of data filled with 0xFF but does not modify the original image. The data returned by ilGetAlpha has the same dimensions as the currently bound image, so use ilGetInteger to determine the correct dimensions.

Error Codes

IL_ILLEGAL_OPERATION - There is currently no image bound. Use ilGenImages and ilBindImage before calling this function.
IL_INVALID_PARAM - Type was not a legal value.

See Also

ilGenImages, ilBindImage, ilGetInteger