# 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: <sup>1</sup>/<sub>16</sub> px, **1**: <sup>1</sup>/<sub>8</sub> px, **2**: <sup>1</sup>/<sub>4</sub> px, **3**: <sup>1</sup>/<sub>2</sub> px, **4**: 1 px, **5**: 2 px, **6**: 4 px, **7**: 8 px.

##### Example

**PixResolution: 0**   
Factor for multiplying: 0.0625f

<div drawio-diagram="2019"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-02/drawing-7-1676953501.png" alt=""/></div>

  
**PixResolution: 1**   
Factor for multiplying: 0.125f

<div drawio-diagram="2020"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-02/drawing-7-1676953527.png" alt=""/></div>

  
**PixResolution: 2**   
Factor for multiplying: 0.25f

<div drawio-diagram="2021"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-02/drawing-7-1676953546.png" alt=""/></div>

  
**PixResolution: 3**   
Factor for multiplying: 0.5f

<div drawio-diagram="2022"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-02/drawing-7-1676953579.png" alt=""/></div>

  
**PixResolution: 4**   
Factor for multiplying: 1.0f

<div drawio-diagram="2023"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-02/drawing-7-1676953593.png" alt=""/></div>

  
**PixResolution &gt; 4**  
WarpMatrix is no longer computed since delta calculation leads to "out of trapezoid limit" error

<div class="contents" id="bkmrk--4"><div class="contents"><div class="textblock"></div></div></div>#### 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: -(2<sup>n-1</sup>) .. + (2<sup>n-1</sup>- 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

<div class="contents" id="bkmrk-if-%22numofbitsperpara"><div class="contents"><div class="textblock">- if "NumOfBitsPerParam" is 8, the warping parameter corresponding to point X<sub>n</sub>Y<sub>n</sub> is represented as: 0xA0 0xA0
- if "NumOfBitsPerParam" is 12, the warping parameter corresponding to point X<sub>n</sub>Y<sub>n</sub> is represented as: 0x0A 0x00 0xA0

</div></div></div>**NumOfBitsPerParam: 8**

<div drawio-diagram="2017"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-02/drawing-7-1676953439.png" alt=""/></div>

**NumOfBitsPerParam: 12**

<div drawio-diagram="2018"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-02/drawing-7-1676953455.png" alt=""/></div>

---

<div class="contents" id="bkmrk--8"><div class="textblock"></div></div>