pixelIndex method

int pixelIndex(
  1. int x,
  2. int y
)

Index of a pixel (x,y) at pixels.

Implementation

int pixelIndex(int x, int y) => (width * y) + x;