|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.meltingice.caman.Image
public class Image
Represents a single image. Abstracts over retrieving pixel data and loading images from files.
Field Summary | |
---|---|
int[] |
pixels
|
Constructor Summary | |
---|---|
Image(java.lang.String file)
Creates a new Image based on the given filename. |
Method Summary | |
---|---|
java.awt.image.BufferedImage |
getDestImage()
Returns a writeable BufferedImage that is used to write the rendered image into. |
int |
getHeight()
Gets the height of the image |
int[] |
getPixel(int x,
int y)
|
int |
getPixelRGB(int x,
int y)
Gets the RGB value of an arbitrary pixel in the image specified by pixel location. |
int |
getWidth()
Gets the width of the image |
void |
setPixel(int x,
int y,
int[] rgb)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int[] pixels
Constructor Detail |
---|
public Image(java.lang.String file) throws java.io.IOException
file
- The filepath to the image to load
java.io.IOException
- If the image cannot be found or loaded.Method Detail |
---|
public int getWidth()
public int getHeight()
public int getPixelRGB(int x, int y)
x
- The x location of the pixely
- The y location of the pixel
public java.awt.image.BufferedImage getDestImage()
public int[] getPixel(int x, int y)
public void setPixel(int x, int y, int[] rgb)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |