FirebaseVisionImage.fromBytes constructor

FirebaseVisionImage.fromBytes(
  1. Uint8List bytes,
  2. FirebaseVisionImageMetadata metadata
)

Construct a FirebaseVisionImage 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 FirebaseVisionImage.fromBytes(
  Uint8List bytes,
  FirebaseVisionImageMetadata metadata,
) {
  return FirebaseVisionImage._(
    type: _ImageType.bytes,
    bytes: bytes,
    metadata: metadata,
  );
}