decodeImageBuffer method

Future<List<Map>> decodeImageBuffer(
  1. Uint8List bytes,
  2. int width,
  3. int height,
  4. int stride,
  5. int format,
  6. int rotation,
)

Decodes barcodes from an image buffer.

The bytes parameter contains raw pixel data, while width, height, stride, and format define the dimensions and structure of the image.

Implementation

Future<List<Map<dynamic, dynamic>>> decodeImageBuffer(Uint8List bytes,
    int width, int height, int stride, int format, int rotation) async {
  final dsImage = jsify({
    'bytes': bytes,
    'width': width,
    'height': height,
    'stride': stride,
    'format': format,
    'orientation': rotation
  });

  CapturedResult barcodeResults =
      await handleThenable(_barcodeReader!.capture(dsImage, ""));

  if (barcodeResults.errorCode != 0) {
    return _errorWrapper(
        barcodeResults.errorCode, barcodeResults.errorString);
  }
  return _resultWrapper(barcodeResults.items);
}