boundsSafe method Null safety

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

Is the given x, y pixel coordinates within the resolution of the image.

Implementation

bool boundsSafe(int x, int y) => x >= 0 && x < width && y >= 0 && y < height;