|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object texturesynthesis.wangtilesynthesizer.EditableImage
public class EditableImage
An easily editable image class. This image class supports simple image manipulation procedures such as setting and getting the pixel values and copying parts of images to other images. The pixel values are stored in the ARGB format with 8 bits of precision.
Field Summary | |
---|---|
private int |
height
The height of this image. |
private int[] |
pixels
An array to store the pixel values of this image. |
private int |
width
The width of this image. |
Constructor Summary | |
---|---|
EditableImage(int width,
int height)
The constructor. |
Method Summary | |
---|---|
void |
copyFromImage(EditableImage source,
int x,
int y)
Copies the whole source image to this image to position x, y. |
int |
get(int x,
int y)
Gets the pixel at x, y. |
java.awt.image.BufferedImage |
getBufferedImage()
Returns this image as a BufferedImage. |
int |
getHeight()
Gets the height of this image. |
EditableImage |
getPart(java.awt.Rectangle rect)
Returns a sub-image of this image as a new EditableImage. |
int |
getWidth()
Gets the width of this image. |
void |
set(EditableImage source,
java.awt.Rectangle rect,
int x,
int y)
Copies pixels from another image. |
void |
set(int x,
int y,
int value)
Sets the pixel at x, y to value |
void |
set(int x,
int y,
int w,
int h,
int[] values)
Copies a rectangular area of pixels from the array to this image. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int[] pixels
private int width
private int height
Constructor Detail |
---|
public EditableImage(int width, int height)
width
- the width of this image.height
- the height of this image.Method Detail |
---|
public int get(int x, int y)
x
- x-coordinatey
- y-coordinate
public void set(int x, int y, int value)
x
- x-coordinatey
- y-coordinatevalue
- the pixel valuepublic void set(int x, int y, int w, int h, int[] values)
x
- the x-coordinate of the top left corner of the target areay
- the y-coordinate of the top left corner of the target areaw
- the width of the target areah
- the height of the target areavalues
- the array of valuespublic void set(EditableImage source, java.awt.Rectangle rect, int x, int y)
source
- the source imagerect
- the area of the source image to be copiedx
- the target x-coordinatey
- the target y-coordinatepublic int getWidth()
public int getHeight()
public void copyFromImage(EditableImage source, int x, int y)
source
- the source imagex
- start position x-coordinatey
- start position y-coordinatepublic EditableImage getPart(java.awt.Rectangle rect)
rect
- the rectangel representing the sub-image's area
public java.awt.image.BufferedImage getBufferedImage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |