Two of the parameters of FloodFill.fill are not intuitive:
Filter< Pair< T, U >, Pair< T, U > > filter: Compares a pair of image and mask pixels with a reference pair to determine whether or not the pixel should be added to the floodfill. A BiPredicate< T, U > that only checks the current pixel is more intuitive and the caller will always know the reference values anyway, and can include them in the BiPredicate if necessary.
Writer< U > writer: Interface that defines how to update a target value with a source value. Again, the caller has access to the source value and it would thus be more intuitive to use a Consumer< U > in this case.
I suggest we deprecate the Filter and Writer interfaces, and all method signatures that use these interfaces. We add new signatures that take BiPredicate and Consumer instead, and convenience methods as appiclable.
Two of the parameters of
FloodFill.fill
are not intuitive:Filter< Pair< T, U >, Pair< T, U > > filter
: Compares a pair of image and mask pixels with a reference pair to determine whether or not the pixel should be added to the floodfill. ABiPredicate< T, U >
that only checks the current pixel is more intuitive and the caller will always know the reference values anyway, and can include them in theBiPredicate
if necessary.Writer< U > writer
: Interface that defines how to update a target value with a source value. Again, the caller has access to the source value and it would thus be more intuitive to use aConsumer< U >
in this case.I suggest we deprecate the
Filter
andWriter
interfaces, and all method signatures that use these interfaces. We add new signatures that takeBiPredicate
andConsumer
instead, and convenience methods as appiclable.