getPixelSafe method
Get the pixel from the given x
, y
coordinate. If the pixel coordinates
are out of bounds, PixelUndefined is returned.
Implementation
Pixel getPixelSafe(int x, int y, [Pixel? pixel]) {
if (x < 0 || x >= width || y < 0 || y >= height) {
return Pixel.undefined;
}
return getPixel(x, y, pixel);
}