AnalysisImage.from constructor

AnalysisImage.from(
  1. Map<String, dynamic> map
)

Implementation

factory AnalysisImage.from(Map<String, dynamic> map) {
  final format = inputAnalysisImageFormatParser(map["format"]);
  if (format == InputAnalysisImageFormat.nv21) {
    return Nv21Image.from(map);
  } else if (format == InputAnalysisImageFormat.bgra8888) {
    return Bgra8888Image.from(map);
  } else if (format == InputAnalysisImageFormat.yuv_420) {
    return Yuv420Image.from(map);
  } else if (format == InputAnalysisImageFormat.jpeg) {
    return JpegImage.from(map);
  } else {
    throw "Unsupported AnalysisImage format: $format";
  }
}