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.Rect>();
final pRval = calloc<ffi.Int>();
cvRun(
() => cffi.FloodFill(
image.ref,
mask!.ref,
seedPoint.ref,
newVal.ref,
pRect,
loDiff!.ref,
upDiff!.ref,
flags,
pRval,
),
);
final rval = pRval.value;
calloc.free(pRval);
return (rval, image, mask, Rect.fromPointer(pRect));
}