public abstract class ImageMap
extends java.lang.Object
This is an abstract class. Subclasses implement specific ways of storing images.
Modifier and Type | Field and Description |
---|---|
static int |
PREVIEW_HEIGHT |
static int |
PREVIEW_WIDTH |
Constructor and Description |
---|
ImageMap() |
Modifier and Type | Method and Description |
---|---|
abstract float |
getAverageComponent(int component)
Get the average value for a particular component, over the entire image.
|
abstract void |
getColor(RGBColor theColor,
boolean wrapx,
boolean wrapy,
double x,
double y,
double xsize,
double ysize)
Get the color at a particular location.
|
abstract float |
getComponent(int component,
boolean wrapx,
boolean wrapy,
double x,
double y,
double xsize,
double ysize)
Get the value of a single component at a particular location in the image.
|
abstract int |
getComponentCount()
Get the number of components in the image.
|
abstract void |
getGradient(Vec2 grad,
int component,
boolean wrapx,
boolean wrapy,
double x,
double y,
double xsize,
double ysize)
Get the gradient of a single component at a particular location in the image.
|
abstract int |
getHeight()
Get the height of the image.
|
int |
getID()
Get an ID number which is unique (within this session) for this image.
|
abstract java.awt.Image |
getPreview()
Get a scaled down copy of the image, to use for previews.
|
abstract int |
getWidth()
Get the width of the image.
|
static ImageMap |
loadImage(java.io.File file)
Construct an appropriate subclass of ImageMap from an image file.
|
abstract void |
writeToStream(java.io.DataOutputStream out)
Write out the object's representation to an output stream.
|
public static final int PREVIEW_WIDTH
public static final int PREVIEW_HEIGHT
public static ImageMap loadImage(java.io.File file) throws java.lang.Exception
java.lang.Exception
public abstract int getWidth()
public abstract int getHeight()
public abstract int getComponentCount()
public abstract float getComponent(int component, boolean wrapx, boolean wrapy, double x, double y, double xsize, double ysize)
public abstract float getAverageComponent(int component)
public abstract void getColor(RGBColor theColor, boolean wrapx, boolean wrapy, double x, double y, double xsize, double ysize)
public abstract void getGradient(Vec2 grad, int component, boolean wrapx, boolean wrapy, double x, double y, double xsize, double ysize)
public abstract java.awt.Image getPreview()
public int getID()
public abstract void writeToStream(java.io.DataOutputStream out) throws java.io.IOException
java.io.IOException