on method

bool on(
  1. int x,
  2. int y
)

Implementation

bool on(int x, int y) =>
    x >= 0 && y >= 0 && x < w && y < h && data[y * w + x] > 0;