|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.resource.FastImageIO
public class FastImageIO
Provides routines for writing and reading uncompressed 8-bit color mapped images in a manner that is extremely fast and generates a minimal amount of garbage during the loading process.
| Field Summary | |
|---|---|
protected static int[] |
_cmap
Used when loading our color map. |
protected static Point |
_origin
Used when creating our writable raster. |
static String |
FILE_SUFFIX
A suffix for use when storing raw images in bundles or on the file system. |
| Constructor Summary | |
|---|---|
FastImageIO()
|
|
| Method Summary | |
|---|---|
static boolean |
canWrite(BufferedImage image)
Returns true if the supplied image is of a format that is supported by the fast image I/O services, false if not. |
static BufferedImage |
read(ByteBuffer byteBuffer)
Reads an image from the supplied byte buffer (which must return the image format previously written via a call to write(java.awt.image.BufferedImage, java.io.OutputStream)). |
static BufferedImage |
read(File file)
Reads an image from the supplied file (which must contain an image previously written via a call to write(java.awt.image.BufferedImage, java.io.OutputStream)). |
static BufferedImage |
read(InputStream in)
Reads an image from the supplied input stream (which must return the image format previously written via a call to write(java.awt.image.BufferedImage, java.io.OutputStream)). |
static void |
write(BufferedImage image,
OutputStream out)
Writes the supplied image to the supplied output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String FILE_SUFFIX
protected static int[] _cmap
protected static Point _origin
| Constructor Detail |
|---|
public FastImageIO()
| Method Detail |
|---|
public static boolean canWrite(BufferedImage image)
public static void write(BufferedImage image,
OutputStream out)
throws IOException
IOException - thrown if an error occurs writing to the output stream.
public static BufferedImage read(File file)
throws IOException
write(java.awt.image.BufferedImage, java.io.OutputStream)).
IOException - thrown if an error occurs reading from the file.
public static BufferedImage read(InputStream in)
throws IOException
write(java.awt.image.BufferedImage, java.io.OutputStream)).
IOException - thrown if an error occurs reading from the file.
public static BufferedImage read(ByteBuffer byteBuffer)
throws IOException
write(java.awt.image.BufferedImage, java.io.OutputStream)).
IOException - thrown if an error occurs reading from the file.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||