floodFillAsync function

Future<(int, Mat, Mat, Rect)> floodFillAsync(
  1. InputOutputArray image,
  2. Point seedPoint,
  3. Scalar newVal, {
  4. InputOutputArray? mask,
  5. Scalar? loDiff,
  6. Scalar? upDiff,
  7. int flags = 4,
})

Implementation

Future<(int rval, Mat image, Mat mask, Rect rect)> floodFillAsync(
  InputOutputArray image,
  Point seedPoint,
  Scalar newVal, {
  InputOutputArray? mask,
  Scalar? loDiff,
  Scalar? upDiff,
  int flags = 4,
}) async =>
    cvRunAsync2(
      (callback) => cffi.FloodFill_Async(
        image.ref,
        mask?.ref ?? Mat.empty().ref,
        seedPoint.ref,
        newVal.ref,
        loDiff?.ref ?? Scalar().ref,
        upDiff?.ref ?? Scalar().ref,
        flags,
        callback,
      ),
      (c, prval, prect) {
        final rval = prval.cast<ffi.Int>().value;
        calloc.free(prval);
        final rect = Rect.fromPointer(prect.cast<cvg.Rect>());
        c.complete((rval, image, mask ?? Mat.empty(), rect));
      },
    );