setChannel method
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)');
assert(channel != null);
_buffer.setUint8(
y * _width * bytePerPixel + x * bytePerPixel + channel!.index,
value,
);
}