floodFillAsync function
Future<(int, Mat, Mat, Rect)>
floodFillAsync(
- 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
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)));
},
);
}