floodFill function

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

Implementation

(int rval, Mat image, Mat mask, Rect rect) floodFill(
  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>();
  cvRun(
    () => cimgproc.cv_floodFill(
      image.ref,
      mask!.ref,
      seedPoint.ref,
      newVal.ref,
      pRect,
      loDiff!.ref,
      upDiff!.ref,
      flags,
      pRval,
      ffi.nullptr,
    ),
  );
  final rval = pRval.value;
  calloc.free(pRval);
  return (rval, image, mask, Rect.fromPointer(pRect));
}