detectAndDecodeAsync method

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

Implementation

Future<(String ret, VecPoint points, Mat straightCode)> detectAndDecodeAsync(
  InputArray img, {
  VecPoint? points,
  OutputArray? straightCode,
}) {
  straightCode ??= Mat.empty();
  final points = VecPoint();
  final v = calloc<ffi.Pointer<ffi.Char>>();
  return cvRunAsync0(
    (callback) => cobjdetect.cv_QRCodeDetector_detectAndDecode(
        ref, img.ref, points.ptr, straightCode!.ptr, v, callback),
    (c) {
      final s = v.value.cast<Utf8>().toDartString();
      calloc.free(v);
      return c.complete((s, points, straightCode!));
    },
  );
}