recognizeByBuffer method

  1. @override
Future<List<List<MrzLine>>?> recognizeByBuffer(
  1. Uint8List bytes,
  2. int width,
  3. int height,
  4. int stride,
  5. int format,
)
override

Do OCR by image buffer. Returns a List<List<MrzLine>> containing the OCR results.

Implementation

@override
Future<List<List<MrzLine>>?> recognizeByBuffer(
    Uint8List bytes, int width, int height, int stride, int format) async {
  List<dynamic>? results =
      await methodChannel.invokeMethod('recognizeByBuffer', {
    'bytes': bytes,
    'width': width,
    'height': height,
    'stride': stride,
    'format': format,
  });

  if (results == null || results.isEmpty) return [];

  return _resultWrapper(results);
}