floodFill function
(int, Mat, Mat, Rect)
floodFill(
- InputOutputArray image,
- Point seedPoint,
- Scalar newVal, {
- InputOutputArray? mask,
- Scalar? loDiff,
- Scalar? upDiff,
- int flags = 4,
Fills a connected component with the given color.
https://docs.opencv.org/4.x/d7/d1b/group__imgproc__misc.html#ga366aae45a6c1289b341d140839f18717
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));
}