decode static method

Future<List<UCode>> decode(
  1. Uint8List gray,
  2. int width,
  3. int height,
  4. int rowStride,
  5. UCodeScanOptions options,
)

Decodes a grayscale buffer in the worker isolate.

Implementation

static Future<List<UCode>> decode(Uint8List gray, int width, int height, int rowStride, UCodeScanOptions options) async {
  await _ensureStarted();
  final SendPort? port = _port;
  if (port == null) return const <UCode>[];
  final int job = _nextJob++;
  final Completer<List<UCode>> completer = Completer<List<UCode>>();
  _pending[job] = completer;
  port.send(<String, Object?>{
    "job": job,
    "gray": gray,
    "width": width,
    "height": height,
    "rowStride": rowStride,
    "options": options.toMap(),
  });
  return completer.future;
}