|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectFacemorph.Mask
public class Mask
Defines a mask file (a list of which contours to follow in a Template and in which directions).
| Field Summary | |
|---|---|
static int |
CONTOUR_FORWARD
Indicates a line goes in the direction of points |
static int |
CONTOUR_REVERSE
Indicates a line goes in the opposite direction to the points |
static java.awt.Color |
maskColour
|
static int |
POINT
indicates a point, not a line |
| Constructor Summary | |
|---|---|
Mask()
Creates a new instance of Mask |
|
| Method Summary | |
|---|---|
void |
add(int index,
int dir)
Adds a contour or point to this mask |
Mask |
clone()
|
void |
delete(int index)
Delete a contour from this mask |
java.util.Vector<java.lang.Integer> |
getContours()
Get the list of contours for this mask |
java.util.Vector<java.lang.Integer> |
getDirections()
Get the list of directions for this mask |
void |
read(java.io.Reader r)
Reads a mask from a Reader (e.g. |
void |
read(java.lang.String file)
Reads a mask from a file |
void |
write(java.io.File f)
Writes the mask to a file |
void |
write(java.io.PrintWriter pw)
Writes the mask to a PrintWriter |
void |
write(java.lang.String fname)
Writes the mask to a file |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.awt.Color maskColour
public static final int CONTOUR_FORWARD
public static final int CONTOUR_REVERSE
public static final int POINT
| Constructor Detail |
|---|
public Mask()
| Method Detail |
|---|
public Mask clone()
clone in class java.lang.Object
public void read(java.lang.String file)
throws java.io.FileNotFoundException,
java.io.IOException
file - The name of the mask file
java.io.FileNotFoundException - thrown if file not found
java.io.IOException - thrown if some other I/O error
public void read(java.io.Reader r)
throws java.io.IOException
r - The Reader to read from
java.io.IOException - if an IOException occurs
public void write(java.lang.String fname)
throws java.io.IOException
fname - the name of the file to write to
java.io.IOException
public void write(java.io.File f)
throws java.io.IOException
f - the file to write to
java.io.IOExceptionpublic void write(java.io.PrintWriter pw)
pw - the PrintWriter to write topublic java.util.Vector<java.lang.Integer> getContours()
public java.util.Vector<java.lang.Integer> getDirections()
public void add(int index,
int dir)
index - the index of the contour or point to adddir - the direction the contour should be followed or point CONTOUR_FORWARD, CONTOUR_REVERSE or POINTpublic void delete(int index)
index - the index of the contour to remove
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||