|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectij.process.PolygonFiller
public class PolygonFiller
This class fills polygons using the scan-line filling algorithm described at "http://www.cs.rit.edu/~icss571/filling/".
Field Summary | |
---|---|
(package private) int |
activeEdges
|
(package private) int[] |
aedge
|
(package private) int |
BLACK
|
(package private) int |
edges
|
(package private) double[] |
eslope
|
(package private) double[] |
ex
|
(package private) int[] |
ey1
|
(package private) int[] |
ey2
|
(package private) int |
n
|
(package private) int[] |
sedge
|
(package private) int |
WHITE
|
(package private) int[] |
x
|
(package private) int[] |
y
|
Constructor Summary | |
---|---|
PolygonFiller()
Constructs a PolygonFiller. |
|
PolygonFiller(int[] x,
int[] y,
int n)
Constructs a PolygonFiller using the specified polygon. |
Method Summary | |
---|---|
(package private) void |
activateEdges(int y)
Adds edges to the active edge table. |
(package private) void |
addToSortedTable(int edge)
Currently not used since searching the entire edge table does not seem to take a significant amount of time. |
(package private) void |
allocateArrays(int n)
|
(package private) void |
buildEdgeTable(int[] x,
int[] y,
int n)
Generates the edge table. |
void |
fill(ImageProcessor ip,
java.awt.Rectangle r)
Fills the polygon using the ImageProcessor's current drawing color. |
ImageProcessor |
getMask(int width,
int height)
Returns a byte mask containing a filled version of the polygon. |
(package private) void |
printActiveEdges()
Display the contents of the active edge table |
(package private) void |
printEdges()
Display the contents of the edge table |
(package private) void |
removeInactiveEdges(int y)
Removes edges from the active edge table that are no longer needed. |
void |
setPolygon(int[] x,
int[] y,
int n)
Specifies the polygon to be filled. |
(package private) void |
sortActiveEdges()
Sorts the active edges list by x coordinate using a selection sort. |
(package private) void |
updateXCoordinates()
Updates the x coordinates in the active edges list and sorts the list if necessary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
int BLACK
int WHITE
int edges
int activeEdges
int[] x
int[] y
int n
double[] ex
int[] ey1
int[] ey2
double[] eslope
int[] sedge
int[] aedge
Constructor Detail |
---|
public PolygonFiller()
public PolygonFiller(int[] x, int[] y, int n)
Method Detail |
---|
public void setPolygon(int[] x, int[] y, int n)
void allocateArrays(int n)
void buildEdgeTable(int[] x, int[] y, int n)
void addToSortedTable(int edge)
public void fill(ImageProcessor ip, java.awt.Rectangle r)
public ImageProcessor getMask(int width, int height)
void updateXCoordinates()
void sortActiveEdges()
void removeInactiveEdges(int y)
void activateEdges(int y)
void printEdges()
void printActiveEdges()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |