Sets a pixels at (x,y) with value p.
x
y
p
void setPixel(int x, int y, int p) => pixels[pixelIndex(x, y)] = p;