Math2DFloodFill_4Neighbour(Int32, Int32, FuncInt32, Int32, Boolean, ActionInt32, Int32, Int32, Int32, Int32, Int32) Method |
A very general flood fill algorithm (4-Neighbour algorithm).
It tests iteratively the 4 neighbouring pixels.
Namespace: Altaxo.GeometryAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax public static void FloodFill_4Neighbour(
int xStart,
int yStart,
Func<int, int, bool> IsPixelToBeFilled,
Action<int, int> SetPixelToNewValue,
int xLower,
int yLower,
int xSize,
int ySize
)
Parameters
- xStart Int32
- The start pixel's x coordinate.
- yStart Int32
- The start pixel's x coordinate.
- IsPixelToBeFilled FuncInt32, Int32, Boolean
-
Function that evaluated if the pixel fulfills a condition so that it should be set to a new value.
Args are the x and y pixel coordinates,
the return value is true if the pixel should be set to a new value.
- SetPixelToNewValue ActionInt32, Int32
-
Action to set the pixel to a new value.
Args are the x and y coordinates of the pixel.
Since the pixel's value is never tested again, there is no need to really set the pixel's value.
Thus, this action can also be used to count the pixels that fulfill the condition given in IsPixelToBeFilled, etc.
- xLower Int32
- The lowest possible value for a pixel's x coordinate.
- yLower Int32
- The lowest possible value for a pixel's y coordinate
- xSize Int32
- The x size. The x coordinate can take values from xStart to xStart+xSize-1.
- ySize Int32
- The y size. The y coordinate can take values from yStart to yStart+ySize-1.
See Also