detectAndDecodeAsync method

Future<(String, VecPoint, Mat)> detectAndDecodeAsync(
  1. InputArray img
)

Implementation

Future<(String ret, VecPoint points, Mat straightCode)> detectAndDecodeAsync(InputArray img) async {
  final rval = cvRunAsync3<(String, VecPoint, Mat)>(
      (callback) => cobjdetect.QRCodeDetector_DetectAndDecode_Async(ref, img.ref, callback),
      (c, prval, points, straightCode) {
    // prval is a char ** pointer
    final rval = prval.cast<ffi.Pointer<ffi.Char>>().value.toDartString();
    calloc.free(prval);
    return c.complete(
      (
        rval,
        VecPoint.fromPointer(points.cast<cobjdetect.VecPoint>()),
        Mat.fromPointer(straightCode.cast<cobjdetect.Mat>()),
      ),
    );
  });
  return rval;
}