Get the buffer index for the x, y pixel coordinates. No range checking is done.
x
y
int index(int x, int y) => y * width + x;