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,
}) {
  points ??= VecPoint();
  final ret = calloc<ffi.Pointer<ffi.Char>>();
  straightCode ??= Mat.empty();
  return cvRunAsync0(
    (callback) =>
        cobjdetect.cv_QRCodeDetector_decode(ref, img.ref, points!.ptr, straightCode!.ref, ret, callback),
    (c) {
      final info = ret.value.cast<Utf8>().toDartString();
      calloc.free(ret);
      return c.complete((info, points, straightCode));
    },
  );
}