Improved performance of the leveling image by using QImage::scanline.
Max segment lenght is calculated using the minimun grid size of the interpolator and dividing it by 2. ¿is 2 the sweet point?