isBoundsSafe method

bool isBoundsSafe(
  1. num x,
  2. num y
)

Returns true if the given pixel coordinates is within the dimensions of the image.

Implementation

bool isBoundsSafe(num x, num y) =>
    x >= 0 && y >= 0 && x < width && y < height;