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,
}) {
  final code = straightCode?.ptr ?? calloc<cvg.Mat>();
  final points = calloc<cvg.VecPoint>();
  final v = calloc<ffi.Pointer<ffi.Char>>();
  return cvRunAsync0(
    (callback) => cobjdetect.cv_QRCodeDetector_detectAndDecode(ref, img.ref, points, code, v, callback),
    (c) {
      final s = v.value.cast<Utf8>().toDartString();
      calloc.free(v);
      return c.complete((s, VecPoint.fromPointer(points), Mat.fromPointer(code)));
    },
  );
}