getChannel method
Implementation
@override
int getChannel(int x, int y, [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);
return _buffer.getUint8(
y * _width * bytePerPixel + x * bytePerPixel + channel!.index);
}