imreadAsync function

Future<Mat> imreadAsync(
  1. String filename, {
  2. int flags = IMREAD_COLOR,
})

Implementation

Future<Mat> imreadAsync(String filename, {int flags = IMREAD_COLOR}) async {
  final dst = Mat.empty();
  final cname = filename.toNativeUtf8().cast<ffi.Char>();
  return cvRunAsync0(
    (callback) => cimgcodecs.cv_imread(cname, flags, dst.ptr, callback),
    (c) {
      calloc.free(cname);
      return c.complete(dst);
    },
  );
}