public class Picture extends Object implements Cloneable, Serializable
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
count |
(package private) static JFrame |
f |
(package private) static boolean |
first |
Graphics |
graphics |
BufferedImage |
image |
(package private) static JLabel |
left |
BufferedImage |
original |
(package private) static JLabel |
right |
(package private) int[] |
xpoints |
(package private) int[] |
ypoints |
| Constructor and Description |
|---|
Picture() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPolygon(double[] vals,
int offset,
int numVertices)
Adds a polygon with the given colors.
|
void |
clear()
Erases the image.
|
Object |
clone() |
BufferedImage |
copyImage(BufferedImage image) |
(package private) int |
discretize(double value,
int max) |
void |
display(String title)
For debugging only.
|
void |
disposeGraphics() |
double |
error()
Computes the sum squared error between the image and the original.
|
(package private) double |
extend(double value) |
void |
load(File file)
Loads the original and creates a new blank image to scribble on, and a new graphics object.
|
(package private) double |
maxError()
The maximum possible error between the two images.
|
private void |
readObject(ObjectInputStream in) |
void |
save(File file)
Saves the image (not the original) out to a PNG file so you can compare.
|
private void |
writeObject(ObjectOutputStream out) |
public BufferedImage original
public BufferedImage image
public Graphics graphics
int[] xpoints
int[] ypoints
static JFrame f
static boolean first
static JLabel left
static JLabel right
int count
double extend(double value)
int discretize(double value,
int max)
public void disposeGraphics()
public void addPolygon(double[] vals,
int offset,
int numVertices)
public void clear()
double maxError()
public double error()
public void load(File file)
public void display(String title)
public void save(File file)
private void writeObject(ObjectOutputStream out) throws IOException
IOExceptionprivate void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic BufferedImage copyImage(BufferedImage image)
Copyright © 2014 Evolutionary Computation Laboratory at George Mason University. All rights reserved.