function read(a, b) {
        val = imageData[b * width + a];
        sum += val;
        min = val < min ? val : min;
        max = val > max ? val : max;
        line.push(val);
    }
Scans a line of the given image from point p1 to p2 and returns a result object containing
gray-scale values (0-255) of the underlying pixels in addition to the min
and max values.
@param {Object} imageWrapper
@param {Object} p1 The start point {x,y}
@param {Object} p2 The end point {x,y}
@returns {line, min, max}