convertCameraImage static method

Image? convertCameraImage(
  1. CameraImage cameraImage
)

Converts a CameraImage in YUV420 format to Image in RGB format

Implementation

static Image? convertCameraImage(CameraImage cameraImage) {
  if (cameraImage.format.group == ImageFormatGroup.yuv420) {
    return convertYUV420ToImage(cameraImage);
  } else if (cameraImage.format.group == ImageFormatGroup.bgra8888) {
    return convertBGRA8888ToImage(cameraImage);
  } else {
    return null;
  }
}