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,
}) {
  loDiff ??= Scalar();
  upDiff ??= Scalar();
  mask ??= Mat.empty();
  final pRect = calloc<cvg.CvRect>();
  final pRval = calloc<ffi.Int>();
  return cvRunAsync0(
    (callback) => cimgproc.cv_floodFill(
      image.ref,
      mask!.ref,
      seedPoint.ref,
      newVal.ref,
      pRect,
      loDiff!.ref,
      upDiff!.ref,
      flags,
      pRval,
      callback,
    ),
    (c) {
      final rval = pRval.value;
      calloc.free(pRval);
      return c.complete((rval, image, mask!, Rect.fromPointer(pRect)));
    },
  );
}