Adjustments
An adjustment is specified by a mode, a direction and a delta. For each reference point and corresponding shift vector, the adjustment is computed and applied. The resulting shift vector is again cached in the warping library. This way of implementation allows incremental adjustments.
Mode defines the way of the distortion. Following modes are available:
- Parallelogram
- Trapezoid
- Pin balance
- Pincushion
- Shift
- Size
- Rotation (around bitmap image center point)
Direction specifies the direction in which the distortion is applied. Following directions are available:
- Up
- Down
- Left
- Right
Delta specifies the amount of distortion that is applied. Delta is an unsigned integer value in range 0..255 (1 byte). The delta is added to the existing offset of the corresponding reference points.
Predefined Adjustments
Based on mode and direction, the following transformations are possible:
| Mode Direction |
Trapezoid | Parallelogram | Pincushion | Pin balance |
| Up |
|
|
|
|
| Down |
|
|
|
|
| Left |
|
|
|
|
| Right |
|
|
|
|
| Mode Direction |
Size | Rotation | Shift |
|---|---|---|---|
| Up |
|
|
|
| Down |
|
|
|
| Left |
|
|
|
| Right |
|
|
|
Formulas for adjustments
The following formulas describe the mathematically necessary adjustments of the reference points. If the requested adjustment exceeds the limit, no calculation shall be done and the previous status will be kept.
Trapezoid mode
Parallelogram mode
Pinbalance mode
Pincushion mode
Size mode
Rotation mode
Shift mode
-
NumOfRefPointsX - number of reference points in horizontal direction
NumOfRefPointsY - number of reference points in vertical direction
x[i][j] - x-coordinate of reference point, a 2-dimensional array of floating point variables
y[i][j] - y-coordinate of reference point, a 2-dimensional array of floating point variables