setChannel method

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

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

Implementation

@override
void setChannel(int x, int y, int value, [ImageChannel? channel]) {
  assert(x >= 0 && x < width, 'x($x) out of with boundary(0 - $width)');
  assert(y >= 0 && y < height, 'y($y) out of height boundary(0 - $height)');
  _buffer.setUint8(y * _width + x, value);
}