decodeAsync method

Future<(String, VecPoint?, Mat?)> decodeAsync(
  1. InputArray img, {
  2. VecPoint? points,
  3. Mat? straightCode,
})

Implementation

Future<(String ret, VecPoint? points, Mat? straightCode)> decodeAsync(
  InputArray img, {
  VecPoint? points,
  Mat? straightCode,
}) {
  final p = points?.ptr ?? calloc<cvg.VecPoint>();
  final ret = calloc<ffi.Pointer<ffi.Char>>();
  straightCode ??= Mat.empty();
  return cvRunAsync0(
    (callback) => cobjdetect.cv_QRCodeDetector_decode(ref, img.ref, p, straightCode!.ref, ret, callback),
    (c) {
      final info = ret.value.cast<Utf8>().toDartString();
      calloc.free(ret);
      return c.complete((info, VecPoint.fromPointer(p), straightCode));
    },
  );
}