imreadAsync function

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

IMRead reads an image from a file into a Mat. The flags param is one of the IMReadFlag flags. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function returns an empty Mat.

For further details, please see: http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56

Implementation

Future<Mat> imreadAsync(String filename, {int flags = IMREAD_COLOR}) async {
  final cname = filename.toNativeUtf8().cast<ffi.Char>();
  final rval = cvRunAsync((callback) => cimgcodecs.Image_IMRead_Async(cname, flags, callback), matCompleter);
  calloc.free(cname);
  return rval;
}