setChannelSafe method

  1. @override
void setChannelSafe(
  1. int x,
  2. int y,
  3. int value, [
  4. ImageChannel? channel,
])
override

set the gray value(0-255) at Point(x, y) without exception. channel is ignored

Implementation

@override
void setChannelSafe(int x, int y, int value, [ImageChannel? channel]) {
  if (x >= 0 && x < width && y >= 0 && y < height) {
    setChannel(x, y, value, channel);
  }
}