Table:  For selecting the operation mode 
+ combination:  For the output LUT buffers 
MIL_ID SrcArrayBufId,  //in 
MIL_ID DstXLutOrArrayBufId,  //in 
MIL_ID DstYLutBufId,  //in 
MIL_INT OperationMode,  //in 
MIL_INT Transform,  //in 
MIL_DOUBLE Val1,  //in 
MIL_DOUBLE Val2  //in 
This function generates coefficients or LUTs to be used by MimWarp() to perform firstorder polynomial warpings or perspective polynomial warpings. Specifically, this function can generate:
Coefficients for a firstorder polynomial warping (M_WARP_POLYNOMIAL).
Coefficients or LUTs for a perspective polynomial warping that maps an arbitrary quadrilateral onto a rectangle (M_WARP_4_CORNER) or that maps a rectangle onto an arbitrary quadrilateral (M_WARP_4_CORNER_REVERSE).
LUTs, based on the input of a matrix of coefficients, for a firstorder polynomial warping or for a perspective polynomial warping (M_WARP_LUT).
Note that when generating LUTs for a M_WARP_4_CORNER or a M_WARP_4_CORNER_REVERSE perspective polynomial warping, the coefficients that were internally generated and used cannot be retrieved. To generate LUTs while saving the coefficients, you must call MgenWarpParameter() twice: once to generate the coefficients needed to produce the LUTs, and the second time to actually generate the LUTs with M_WARP_LUT.
For a firstorder polynomial warping, this function can generate coefficients or LUTs for a rotation, a scaling, a shearing, or a translation. To combine coefficients (for example, to generate coefficients that will perform both a rotation and a translation), you need to make separate calls to this function, using the previous output buffer of type M_ARRAY as your current input buffer. If required, after the appropriate coefficients are generated, you can pass the coefficient buffer to MgenWarpParameter() with M_WARP_LUT to generate the corresponding LUTs.
Coefficients are calculated such that each pixel position of the destination buffer, (x _{d},y _{d}) is associated with a specific point in the source buffer, (x _{s},y _{s}), according to the following equation:
Where x_{s} and y_{s} are defined as follows:
Note that in the case of a firstorder polynomial warping, the c_{0}, c_{1}, c_{2} coefficients are 0, 0, and 1, respectively. The equation then reduces to:
Specifies the input buffer from which to generate coefficients or LUT entries. If an input buffer is not required to perform the coefficient generation, set this parameter to M_NULL.
See the Parameter associations section for possible values that can be specified.
Specifies the buffer in which to place generated coefficients or XLUT entries.
See the Parameter associations section for possible values that can be specified.
Specifies the buffer in which to place YLUT entries. If you are not generating LUTs, set this parameter to M_NULL.
See the Parameter associations section for possible values that can be specified.
Specifies the mode of operation.
See the Parameter associations section for possible values that can be specified.
Specifies the type of firstorder polynomial warping for which to generate coefficients. If you are not generating coefficients for a firstorder polynomial warping (M_WARP_POLYNOMIAL), set the this parameter to M_DEFAULT.
For specifying the type of firstorder polynomial
warping


Value  Description  
M_ROTATE 
Generates coefficients for a counterclockwise rotation around (0,0) by Val1 °. 

M_SCALE 
Generates coefficients for an image scaling, by a factor of Val1 in the Xdirection and by a factor of Val2 in the Ydirection. 

M_SHEAR_X 
Generates coefficients or for a shearing in the Xdirection, by a factor of Val1. 

M_SHEAR_Y 
Generates coefficients for a shearing in the Ydirection, by a factor of Val1. 

M_TRANSLATE 
Generates coefficients for a translation by Val1 pixels in the Xdirection and by Val2 pixels in the Ydirection. 
The table below lists possible values for the SrcArrayBufId, DstXLutOrArrayBufId, DstYLutBufId, and OperationMode parameters.
For selecting the operation mode


OperationMode  Description  
SrcArrayBufId  
DstXLutOrArrayBufId  
DstYLutBufId  
M_WARP_4_CORNER + 
Generates coefficients or LUT values for a perspective polynomial warping which, when passed to MimWarp(), maps an arbitrary quadrilateral onto a rectangle. 

SrcArrayBufId 
Specifies the input buffer which contains the X and Y positions of the four corners of the quadrilateral and the topleft and bottomright corners of the rectangle. 

DstXLutOrArrayBufId 
Specifies the buffer in which to place the generated coefficients or Xcomponent LUT entries. 

MIL array buffer identifier 
Specifies the MIL array buffer identifier. 

MIL LUT buffer identifier 
Specifies the MIL LUT buffer identifier. 

DstYLutBufId 
Specifies the buffer in which to place the Ycomponent LUT entries. 

M_NULL 
Specifies that the coefficients will be generated. 

MIL LUT buffer identifier 
Specifies the MIL LUT buffer identifier. 

M_WARP_4_CORNER_REVERSE + 
Generates coefficients or LUT values for a perspective polynomial warping which, when passed to MimWarp(), maps a rectangle onto an arbitrary quadrilateral. 

SrcArrayBufId 
Specifies the input buffer which contains the X and Y positions of the four corners of the quadrilateral and the topleft and bottomright corners of the rectangle. 

DstXLutOrArrayBufId 
Specifies the buffer in which to place the generated coefficients or Xcomponent LUT entries. 

MIL array buffer identifier 
Specifies the MIL array buffer identifier. 

MIL LUT buffer identifier 
Specifies the MIL LUT buffer identifier. 

DstYLutBufId 
Specifies the buffer in which to place the Ycomponent LUT entries. 

M_NULL 
Specifies that the coefficients will be generated. 

MIL LUT buffer identifier 
Specifies a signed 16 or 32bit integer buffer, which has an M_LUT attribute and the same Ysize as the destination image buffer that will be passed to MimWarp(). 

M_WARP_LUT + 
Generates LUTs that can be passed to MimWarp() to perform a warping that is equivalent to the warping that would be performed if the coefficients specified in the SrcArrayBufId parameter were used instead. 

SrcArrayBufId 
Specifies the input buffer which contains the coefficients of the polynomial equations used to perform the warping. 

DstXLutOrArrayBufId  
DstYLutBufId  
M_WARP_POLYNOMIAL 
Generates coefficients that can be passed to MimWarp() to perform a firstorder polynomial warping. 

SrcArrayBufId 
Specifies the input buffer containing the coefficients generated by a previous call to MgenWarpParameter(). 

M_NULL 
Specifies that this is the first call to MgenWarpParameter(). 

MIL array buffer identifier 
Specifies a MIL array buffer identifier. 

DstXLutOrArrayBufId 
Specifies the identifier of a 3x3 floatingpoint buffer with an M_ARRAY attribute in which to place the generated coefficients. 

DstYLutBufId 
Specifies to ignore this parameter. 
You can add the following value to the abovementioned values to specify the number of fractional bits for the source address.
For the output LUT buffers


Combination value  Description  
M_FIXED_POINT + n 
Specifies the number of fractional bits for the source address (x _{s} , y _{s}). 
Header  Include mil.h. 
Library  Use mil.lib. 
DLL  Requires mil.dll. 