GoogleVisionImage.fromBytes constructor

GoogleVisionImage.fromBytes(
  1. Uint8List bytes,
  2. GoogleVisionImageMetadata metadata
)

Construct a GoogleVisionImage from a list of bytes.

On Android, expects android.graphics.ImageFormat.NV21 format. Note: Concatenating the planes of android.graphics.ImageFormat.YUV_420_888 into a single plane, converts it to android.graphics.ImageFormat.NV21.

On iOS, expects kCVPixelFormatType_32BGRA format. However, this should work with most formats from kCVPixelFormatType_*.

Implementation

factory GoogleVisionImage.fromBytes(
  Uint8List bytes,
  GoogleVisionImageMetadata metadata,
) {
  return GoogleVisionImage._(
    type: _ImageType.bytes,
    bytes: bytes,
    metadata: metadata,
  );
}