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,
}) async =>
cvRunAsync2(
(callback) => cffi.FloodFill_Async(
image.ref,
mask?.ref ?? Mat.empty().ref,
seedPoint.ref,
newVal.ref,
loDiff?.ref ?? Scalar().ref,
upDiff?.ref ?? Scalar().ref,
flags,
callback,
),
(c, prval, prect) {
final rval = prval.cast<ffi.Int>().value;
calloc.free(prval);
final rect = Rect.fromPointer(prect.cast<cvg.Rect>());
c.complete((rval, image, mask ?? Mat.empty(), rect));
},
);