Skip to main content

Pixel Resolution and Number of Bits per Parameter

Pixel Resolution

The pixel resolution determines the warping accuracy. The final displacement of a reference point is the product of the warping parameter by parameter resolution. A warping parameter is therefore given by the desired displacement divided by resolution.

The resolution values supported by the warping library are: 0: 1/16 px, 1: 1/8 px, 2: 1/4 px, 3: 1/2 px, 4: 1 px, 5: 2 px, 6: 4 px, 7: 8 px.

Example

PixResolution: 0
Factor for multiplying: 0.0625f

drawing-7-1676953501.png


PixResolution: 1
Factor for multiplying: 0.125f

drawing-7-1676953527.png


PixResolution: 2
Factor for multiplying: 0.25f

drawing-7-1676953546.png


PixResolution: 3
Factor for multiplying: 0.5f

drawing-7-1676953579.png


PixResolution: 4
Factor for multiplying: 1.0f

drawing-7-1676953593.png


PixResolution > 4
WarpMatrix is no longer computed since delta calculation leads to "out of trapezoid limit" error

Number of Bits per Parameter

The configuration parameter "NumOfBitsPerParam" gives the allowed range for the warping parameter data. Therefore, each parameter is represented as a signed integer value of the given bit width.

If n is the number of bits, then the allowed range is: -(2n-1) .. + (2n-1- 1).

Maximum possible value for "NumOfBitsPerParam" is 16. Considering this, the maximum allowed range for the warping parameter data is: −32 768 .. 32 767.

The length of the parameter data is given by the following formula: 2 * NumOfRefPointsX * NumOfRefPointsY * NumOfBitsPerParam / 8.

Example
  • if "NumOfBitsPerParam" is 8, the warping parameter corresponding to point XnYn is represented as: 0xA0 0xA0
  • if "NumOfBitsPerParam" is 12, the warping parameter corresponding to point XnYn is represented as: 0x0A 0x00 0xA0

NumOfBitsPerParam: 8

drawing-7-1676953439.png

NumOfBitsPerParam: 12

drawing-7-1676953455.png