Rotate an image.


void MimRotate(SrcImageBufId, DestImageBufId, Angle, SrcCenX, SrcCenY, DstCenX, DstCenY, InterpolationMode)

MIL_ID SrcImageBufId; Source image buffer identifier
MIL_ID DestImageBufId; Destination image buffer identifier
double Angle; Angle of rotation
double SrcCenX; X-coordinate of source rotation center
double SrcCenY; Y-coordinate of source rotation center
double DstCenX; X-coordinate of destination rotation center
double DstCenY; Y-coordinate of destination rotation center
long InterpolationMode; Mode of interpolation


This function rotates an image by the specified angle of rotation, using the specified interpolation mode. The center of rotation in the source image is determined by the specified X and Ysource rotation-center coordinates. The rotated image will then be clipped to fit the destination buffer. It will be placed in the destination buffer with its center positioned at the specified X and Y destination center coordinates.

The SrcImageBufId parameter specifies the identifier of the data source of the operation. This parameter must be given an image buffer identifier.

The DestImageBufId parameter specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier.

The Angle parameter specifies the angle of rotation, in degrees. When a positive angle is specified, the function rotates the image in a counter-clockwise direction.

The SrcCenX and SrcCenY parameters specify the X and Y coordinates to use as the center of rotation in the source image. M_DEFAULT can be used to rotate the image about its true center.

The DstCenX and DstCenY parameters specify X and Y coordinates in the destination buffer. This is the location to which the specified center of the rotated source image will be mapped. If M_DEFAULT is specified as the coordinates, the true center of the destination buffer will be used.

The InterpolationMode parameter specifies the mode of interpolation. This parameter can be set to one of the following:

M_NEAREST_NEIGHBOR Nearest neighbor interpolation.
M_BILINEAR Bilinear interpolation.
M_BICUBIC Bicubic interpolation.

The destination pixels that do not have corresponding pixels in the source image buffer remain unchanged. M_CLEAR can be added to the interpolation mode, in order to clear any pixel in the destination buffer that does not correspond to a (rotated) source pixel.


In-place processing is supported, but the source and destination image buffers cannot partially overlap (a situation that can only occur when using child buffers).