sampleLine(p1, p2, size) {
			let result = 0;
			let d = this.distanceResultPoint(p1, p2);
			let moduleSize = d / size;
			let px = p1.getX();
			let py = p1.getY();
			let dx = moduleSize * (p2.getX() - p1.getX()) / d;
			let dy = moduleSize * (p2.getY() - p1.getY()) / d;
			for (let i = 0; i < size; i++) {
				if (this.image.get(MathUtils.round(px + i * dx), MathUtils.round(py + i * dy))) {
					result |= 1 << (size - i - 1);
				}
			}
			return result;
		}
Samples a line.

@param p1   start point (inclusive)
@param p2   end point (exclusive)
@param size number of bits
@return the array of bits as an int (first bit is high-order bit of result)