The functioning of this algorithm to be one of those tasks that computer scientists would call an "embarrassingly parallel problem" <shorturl.at/jrCKP>. One could easily split this into four subtasks each executing in parallel to give O(log n) complexity where n is the desired resolution.
In addition--I do not know if you have used this because I did not peer into your code--you may want to use a quadtree data structure, NOT an array.
In addition--I do not know if you have used this because I did not peer into your code--you may want to use a quadtree data structure, NOT an array.