com.faa.graphics.util
Class JPG2QuadTree
java.lang.Object
|
+--com.faa.graphics.util.JPG2QuadTree
- public class JPG2QuadTree
- extends java.lang.Object
Method Summary |
static void |
createQuadTreeNode(int x,
int y,
int size)
Create a node on the xml file, representing the given portion of the image. |
static boolean |
isWhite(int pixel)
Any pixel on the image which is not RGB == (255,255,255) is treated as
a black pixel. |
static void |
main(java.lang.String[] args)
Receive the name of the jpg to convert, plus the optional output filename and
convert the JPG into a QuadTree |
static void |
processImage(java.lang.String inputFile)
Get the source image from the file
precondition: the file exists, can be read, and is a B/W JPEG |
static void |
usage()
Simply output the usage rules |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
JPG2QuadTree
public JPG2QuadTree()
main
public static void main(java.lang.String[] args)
- Receive the name of the jpg to convert, plus the optional output filename and
convert the JPG into a QuadTree
- Parameters:
args
- only two arguments are allowed: the name of the jpg and the output
file name.
processImage
public static void processImage(java.lang.String inputFile)
- Get the source image from the file
precondition: the file exists, can be read, and is a B/W JPEG
- Parameters:
inputFile
- the name of the file
isWhite
public static boolean isWhite(int pixel)
- Any pixel on the image which is not RGB == (255,255,255) is treated as
a black pixel. This method tells whether a pixel is white or not
- Parameters:
pixel
- the pixel to treat- Returns:
- whether the pixel is white or not
createQuadTreeNode
public static void createQuadTreeNode(int x,
int y,
int size)
- Create a node on the xml file, representing the given portion of the image.
Note that this may imply calling this function recursively several times
- Parameters:
x
- the x coordinate for the square portiony
- the y coordinate for the square portionsize
- the side (witdth/height) of the square portion
usage
public static void usage()
- Simply output the usage rules