convertBGRA8888toImageColor function Null safety

dynamic convertBGRA8888toImageColor(
  1. dynamic image
)

Converts CameraImage in BGRA8888 format to BGR Image.

Implementation

imglib.Image convertBGRA8888toImageColor(CameraImage image) {
  var data = NativeDataStruct();

  convertBGRA8888(image.planes, data);
  imglib.Image img1 = imglib.Image.fromBytes(width: image.width, height: image.height, bytes: data.bytes!.buffer, order: imglib.ChannelOrder.bgr);

  return img1;
}