Class FillPixer
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.FillPixer
-
- All Implemented Interfaces:
Pixer
public class FillPixer extends java.lang.Object implements Pixer
Pixer that iterates over all points inside a polygon. Should handle all polygons (convex, concave, re-entrant). I think(?) the algorithm is about as efficient as it's going to get for a single-threaded implementation. Memory consumption is low.- Since:
- 6 Oct 2021
- Author:
- Mark Taylor
- See Also:
- https://alienryderflex.com/polygon_fill/
-
-
Constructor Summary
Constructors Constructor Description FillPixer(int[] xs, int[] ys, int np, java.awt.Rectangle bounds)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getX()
Returns the X coordinate of the current point.int
getY()
Returns the Y coordinate of the current point.boolean
next()
Advances to the next point to be dispensed by this iterator.
-
-
-
Constructor Detail
-
FillPixer
public FillPixer(int[] xs, int[] ys, int np, java.awt.Rectangle bounds)
Constructor.- Parameters:
xs
- np-element array giving graphics X vertex coordinatesys
- np-element array giving graphics Y vertex coordinatesnp
- number of verticesbounds
- actual bounds within which pixels are required, or null for all pixels
-
-