DevIL Documentation Home | Previous | Next

iluCrop

The iluCrop function "crops" the current image to a different size.


ILboolean iluCrop(
  ILuint XOff,
  ILuint YOff,
  ILuint ZOff,
  ILuint Width,
  ILuint Height,
  ILuint Depth
);

Parameters

XOff
Number of pixels to skip in the x direction.
YOff
Number of pixels to skip in the y direction.
ZOff
Number of pixels to skip in the z direction.
Width
Number of pixels to preserve in the x direction.
Height
Number of pixels to preserve in the y direction.
Depth
Number of pixels to preserve in the z direction.

Remarks

iluCrop "crops" the current image to new dimensions. The new image appears the same as the original, but portions of the image are clipped-off, depending on the values of the parameters of these functions. If XOff + Width, YOff + Height or ZOff + Depth is larger than the current image's dimensions, ILU_ILLEGAL_OPERATION is set.

Error Codes

ILU_ILLEGAL_OPERATION - There is currently no image bound. Use ilGenImages and ilBindImage before calling this function.
ILU_OUT_OF_MEMORY - Could not allocate memory for the new image data.
ILU_ILLEGAL_OPERATION - XOff + Width, YOff + Height, or ZOff + Depth is greater than the current image's dimensions.

See Also

ilGenImages, ilBindImage