|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Image
java.awt.image.VolatileImage
scenic.ScenicImage
public class ScenicImage
The ScenicImage class is used to store images that can be directly used by the Scenic library. This class extends the VolatileImage class, but it also adds several new methods for reading and writing data. The image data is stored in video memory to make hardware acceleration possible.
The format of the image data is specified by the format attribute. Different formats are defined in the Format class.
| Field Summary |
|---|
| Fields inherited from class java.awt.image.VolatileImage |
|---|
IMAGE_INCOMPATIBLE, IMAGE_OK, IMAGE_RESTORED |
| Fields inherited from class java.awt.Image |
|---|
SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty |
| Fields inherited from interface java.awt.Transparency |
|---|
BITMASK, OPAQUE, TRANSLUCENT |
| Constructor Summary | |
|---|---|
ScenicImage()
Constructs an empty image |
|
ScenicImage(java.awt.image.BufferedImage image)
Creates an image from the given BufferedImage. |
|
ScenicImage(int width,
int height,
int format)
Constructs an image with given parameters. |
|
ScenicImage(int width,
int height,
int format,
int options)
Constructs an image with given parameters. |
|
| Method Summary | |
|---|---|
void |
addObserver(ScenicImageObserver observer)
|
boolean |
contentsLost()
Checks if the contents of the image are lost. |
java.awt.image.BufferedImage |
convertToBufferedImage()
Converts the image to a java.awt.image.BufferedImage object. |
java.awt.image.BufferedImage |
convertToBufferedImage(int type)
Converts the image to a java.awt.image.BufferedImage object. |
void |
create(int width,
int height,
int format)
Creates an image with the given parameters. |
void |
create(int width,
int height,
int format,
int options)
Creates an image with the given parameters. |
java.awt.Graphics2D |
createGraphics()
|
void |
deleteObserver(ScenicImageObserver observer)
|
void |
free()
Frees the resources associated with the image. |
java.awt.ImageCapabilities |
getCapabilities()
|
int |
getFormat()
Gets the format of the image. |
int |
getHeight()
Gets the height of the image. |
int |
getHeight(java.awt.image.ImageObserver observer)
|
static ScenicImage |
getImageFromCache(java.awt.image.BufferedImage img)
Tries to get a cached ScenicImage that has the content of the given BufferedImage. |
java.lang.Object |
getProperty(java.lang.String name,
java.awt.image.ImageObserver observer)
|
java.awt.image.BufferedImage |
getSnapshot()
|
int |
getWidth()
Gets the width of the image. |
int |
getWidth(java.awt.image.ImageObserver observer)
|
void |
read(int x,
int y,
int width,
int height,
byte[] data,
int format)
Reads the pixel data of the image in the given rectangle. |
void |
read(int x,
int y,
int width,
int height,
float[] data,
int format)
Reads the pixel data of the image in the given rectangle. |
void |
read(int x,
int y,
int width,
int height,
int[] data,
int format)
Reads the pixel data of the image in the given rectangle. |
int |
validate(java.awt.GraphicsConfiguration gc)
|
void |
write(int x,
int y,
int width,
int height,
byte[] data,
int format)
Writes the pixel data of the image in the given rectangle. |
void |
write(int x,
int y,
int width,
int height,
float[] data,
int format)
Writes the pixel data of the image in the given rectangle. |
void |
write(int x,
int y,
int width,
int height,
int[] data,
int format)
Writes the pixel data of the image in the given rectangle. |
| Methods inherited from class java.awt.image.VolatileImage |
|---|
flush, getGraphics, getSource, getTransparency |
| Methods inherited from class java.awt.Image |
|---|
getAccelerationPriority, getCapabilities, getScaledInstance, setAccelerationPriority |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ScenicImage()
public ScenicImage(int width,
int height,
int format)
width - the width of the image.height - the height of the image.format - the format of the image (must be one of the
constants defined in the Format class).
public ScenicImage(int width,
int height,
int format,
int options)
width - the width of the image.height - the height of the image.format - the format of the image (must be one of the
constants defined in the Format class).options - options for the image (must be a combination
of the constants in ImageOptions class).public ScenicImage(java.awt.image.BufferedImage image)
image - the source image.| Method Detail |
|---|
public static ScenicImage getImageFromCache(java.awt.image.BufferedImage img)
img - BufferedImage
public java.awt.image.BufferedImage convertToBufferedImage(int type)
type - type of the image
public java.awt.image.BufferedImage convertToBufferedImage()
public int getWidth()
getWidth in class java.awt.image.VolatileImagepublic int getHeight()
getHeight in class java.awt.image.VolatileImagepublic int getFormat()
public void create(int width,
int height,
int format,
int options)
width - the width of the image.height - the height of the image.format - the format of the image (must be one of the
constants defined in the Format class).options - options for the image (must be one of the
constants defined in the ImageOptions class).
public void create(int width,
int height,
int format)
width - the width of the image.height - the height of the image.format - the format of the image (must be one of the
constants defined in the Format class).public void addObserver(ScenicImageObserver observer)
public void deleteObserver(ScenicImageObserver observer)
public boolean contentsLost()
contentsLost in class java.awt.image.VolatileImagepublic void free()
public void write(int x,
int y,
int width,
int height,
byte[] data,
int format)
x - the left side of the rectangley - the top of the rectanglewidth - the width of the rectangleheight - the height of the rectangledata - the pixel dataformat - format of the pixel data
public void write(int x,
int y,
int width,
int height,
int[] data,
int format)
x - the left side of the rectangley - the top of the rectanglewidth - the width of the rectangleheight - the height of the rectangledata - the pixel dataformat - format of the pixel data
public void write(int x,
int y,
int width,
int height,
float[] data,
int format)
x - the left side of the rectangley - the top of the rectanglewidth - the width of the rectangleheight - the height of the rectangledata - the pixel dataformat - format of the pixel data
public void read(int x,
int y,
int width,
int height,
byte[] data,
int format)
x - the left side of the rectangley - the top of the rectanglewidth - the width of the rectangleheight - the height of the rectangledata - the pixel dataformat - format of the pixel data
public void read(int x,
int y,
int width,
int height,
int[] data,
int format)
x - the left side of the rectangley - the top of the rectanglewidth - the width of the rectangleheight - the height of the rectangledata - the pixel dataformat - format of the pixel data
public void read(int x,
int y,
int width,
int height,
float[] data,
int format)
x - the left side of the rectangley - the top of the rectanglewidth - the width of the rectangleheight - the height of the rectangledata - the pixel dataformat - format of the pixel datapublic java.awt.image.BufferedImage getSnapshot()
getSnapshot in class java.awt.image.VolatileImagepublic java.awt.Graphics2D createGraphics()
createGraphics in class java.awt.image.VolatileImagepublic int validate(java.awt.GraphicsConfiguration gc)
validate in class java.awt.image.VolatileImagepublic java.awt.ImageCapabilities getCapabilities()
getCapabilities in class java.awt.image.VolatileImagepublic int getWidth(java.awt.image.ImageObserver observer)
getWidth in class java.awt.Imagepublic int getHeight(java.awt.image.ImageObserver observer)
getHeight in class java.awt.Image
public java.lang.Object getProperty(java.lang.String name,
java.awt.image.ImageObserver observer)
getProperty in class java.awt.Image
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||