|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jimi.core.Jimi
This class "Jimi" presents the highest and simplest level access to the image loading and saving functionality.
getImageProducer
methods are provided for those wishing to
avoid the overhead of having an Image object created for the decoded
image.Image data may be loaded from the following image data sources.
The encoded image data can be output to the following destinations.
getImage
.
Images can be loaded in several ways, including using custom Virtual Memory Management,
and also with an enhanced interface which provides more fined-grained access to images -
JimiRasterImage. To be able to decode images, all you need is a filename, URL, or InputStream
to read them from. Some of the basic getImage
methods available are:
When loading images, there are several flags available:
For example, to create an ImageProducer for reading the file "myFile.png", you would write:
ImageProducer myProducer = Jimi.getImageProducer("myFile.png", Jimi.VIRTUAL_MEMORY);
putImage
.
putImage(typeID, Image, filename)
putImage(typeID, Image, OutputStream)
putImage(typeID, ImageProducer, filename)
putImage(typls
eID, ImageProducer, OutputStream)
Field Summary | |
static int |
ASYNCHRONOUS
|
protected static int |
defaultFlags
|
static int |
IN_MEMORY
|
protected static JimiImageFactory |
memoryFactory
|
static int |
ONE_SHOT
|
protected static JimiImageFactory |
oneshotFactory
|
static int |
SYNCHRONOUS
|
static int |
VIRTUAL_MEMORY
|
protected static JimiImageFactory |
vmemFactory
|
Method Summary | |
static JimiReader |
createJimiReader(java.io.InputStream input)
Create a JimiReader to control decoding of an image or series of images. |
static JimiReader |
createJimiReader(java.io.InputStream input,
int flags)
Create a JimiReader to control decoding of an image or series of images. |
static JimiReader |
createJimiReader(java.lang.String filename)
Create a JimiReader to control decoding of an image or series of images. |
static JimiReader |
createJimiReader(java.lang.String filename,
int flags)
Create a JimiReader to control decoding of an image or series of images. |
static JimiReader |
createJimiReader(java.net.URL location)
Create a JimiReader to control decoding of an image or series of images. |
static JimiReader |
createJimiReader(java.net.URL location,
int flags)
Create a JimiReader to control decoding of an image or series of images. |
static JimiWriter |
createJimiWriter(java.lang.String filename)
Create a JimiWriter to control encoding of an image or series of images. |
static JimiWriter |
createJimiWriter(java.lang.String id,
java.io.OutputStream output)
Create a JimiWriter to control encoding of an image or series of images. |
static JimiRasterImage |
createRasterImage(java.awt.image.ImageProducer producer)
Create a JimiRasterImage using pixel data collected from an ImageProducer. |
static JimiRasterImage |
createRasterImage(java.awt.image.ImageProducer producer,
int flags)
Create a JimiRasterImage using pixel data collected from an ImageProducer. |
protected static JimiRasterImage |
createRasterImage(java.awt.image.ImageProducer producer,
JimiImageFactory factory)
|
static JimiReader |
createTypedJimiReader(java.io.InputStream input,
java.lang.String typeID)
Create a JimiReader to control decoding of an image or series of images. |
static JimiReader |
createTypedJimiReader(java.io.InputStream input,
java.lang.String typeID,
int flags)
Create a JimiReader to control decoding of an image or series of images. |
static JimiReader |
createTypedJimiReader(java.lang.String typeID)
Create a JimiReader without setting the decoding source. |
static JimiReader |
createTypedJimiReader(java.lang.String typeID,
int flags)
Create a JimiReader without setting the decoding source. |
static JimiWriter |
createTypedJimiWriter(java.lang.String typeID)
Create a JimiWriter for a specified Mime-type to control image encoding with. |
static java.lang.String[] |
getDecoderTypes()
Get a list of all mime-types supported for image encoding. |
static java.lang.String[] |
getEncoderTypes()
Get a list of all mime-types supported for image encoding. |
static JimiImageFactory |
getFactory(int flags)
Get a JimiImageFactory based on flags provided. |
static java.awt.Image |
getImage(java.io.InputStream in)
Load an Image. |
static java.awt.Image |
getImage(java.io.InputStream in,
int flags)
Load an Image. |
static java.awt.Image |
getImage(java.io.InputStream in,
java.lang.String typeID)
Load an Image. |
static java.awt.Image |
getImage(java.io.InputStream in,
java.lang.String typeID,
int flags)
Load an Image. |
static java.awt.Image |
getImage(java.lang.String filename)
Load an Image. |
static java.awt.Image |
getImage(java.lang.String filename,
int flags)
Load an Image. |
static java.awt.Image |
getImage(java.lang.String filename,
java.lang.String typeID)
Load an Image. |
static java.awt.Image |
getImage(java.lang.String filename,
java.lang.String typeID,
int flags)
Load an Image. |
static java.awt.Image |
getImage(java.net.URL location)
Load an Image. |
static java.awt.Image |
getImage(java.net.URL location,
int flags)
Load an Image. |
static java.awt.Image |
getImage(java.net.URL location,
java.lang.String typeID)
Load an Image. |
static java.awt.Image |
getImage(java.net.URL location,
java.lang.String typeID,
int flags)
Load an Image. |
static java.awt.image.ImageProducer |
getImageProducer(java.io.InputStream in)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.io.InputStream in,
int flags)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.io.InputStream in,
java.lang.String typeID)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.io.InputStream in,
java.lang.String typeID,
int flags)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.lang.String filename)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.lang.String filename,
int flags)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.lang.String filename,
java.lang.String typeID)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.lang.String filename,
java.lang.String typeID,
int flags)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.net.URL location)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.net.URL location,
int flags)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.net.URL location,
java.lang.String typeID)
Get an ImageProducer for an image. |
static java.awt.image.ImageProducer |
getImageProducer(java.net.URL location,
java.lang.String typeID,
int flags)
Get an ImageProducer for an image. |
static JimiRasterImage |
getRasterImage(java.io.InputStream input)
|
static JimiRasterImage |
getRasterImage(java.io.InputStream input,
int flags)
|
static JimiRasterImage |
getRasterImage(java.io.InputStream input,
java.lang.String typeID)
Load an image into a JimiRasterImage for easier access to image information. |
static JimiRasterImage |
getRasterImage(java.io.InputStream input,
java.lang.String typeID,
int flags)
Load an image into a JimiRasterImage for easier access to image information. |
static JimiRasterImage |
getRasterImage(java.lang.String filename)
Load an image into a JimiRasterImage for easier access to image information. |
static JimiRasterImage |
getRasterImage(java.lang.String filename,
int flags)
Load an image into a JimiRasterImage for easier access to image information. |
static JimiRasterImage |
getRasterImage(java.net.URL location)
Load an image into a JimiRasterImage for easier access to image information. |
static JimiRasterImage |
getRasterImage(java.net.URL location,
int flags)
Load an image into a JimiRasterImage for easier access to image information. |
static JimiRasterImage |
getRasterImage(java.net.URL location,
java.lang.String typeID)
Load an image into a JimiRasterImage for easier access to image information. |
static JimiRasterImage |
getRasterImage(java.net.URL location,
java.lang.String typeID,
int flags)
Load an image into a JimiRasterImage for easier access to image information. |
static void |
main(java.lang.String[] args)
Entry method: "-version" prints Jimi version and build number. |
static void |
putImage(java.awt.image.ImageProducer producer,
java.lang.String filename)
Save an image. |
static void |
putImage(java.awt.Image image,
java.lang.String filename)
Save an image. |
static void |
putImage(JimiImage ji,
java.lang.String filename)
Save an image. |
static void |
putImage(java.lang.String id,
java.awt.Image image,
java.io.OutputStream output)
Save an image. |
static void |
putImage(java.lang.String id,
java.awt.image.ImageProducer producer,
java.io.OutputStream output)
Save an image. |
static void |
putImage(java.lang.String id,
java.awt.image.ImageProducer image,
java.lang.String filename)
Save an image. |
static void |
putImage(java.lang.String id,
java.awt.Image image,
java.lang.String filename)
Save an image. |
static void |
putImage(java.lang.String id,
JimiImage ji,
java.io.OutputStream output)
Save an image. |
static void |
putImage(java.lang.String id,
JimiImage image,
java.lang.String filename)
Save an image. |
static void |
setDefaultFlags(int flags)
Set the default flags to use for image decoding. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int ASYNCHRONOUS
public static final int SYNCHRONOUS
public static final int IN_MEMORY
public static final int VIRTUAL_MEMORY
public static final int ONE_SHOT
protected static int defaultFlags
protected static JimiImageFactory memoryFactory
protected static JimiImageFactory vmemFactory
protected static JimiImageFactory oneshotFactory
Method Detail |
public static java.awt.image.ImageProducer getImageProducer(java.lang.String filename)
filename
- the file to read the image frompublic static java.awt.image.ImageProducer getImageProducer(java.lang.String filename, int flags)
filename
- the file to read the image fromflags
- flags indicating the mode of image loadingpublic static java.awt.Image getImage(java.lang.String filename)
filename
- the file to load the image frompublic static java.awt.Image getImage(java.lang.String filename, int flags)
filename
- the file to load the image fromflags
- flags indicating the mode of image loadingpublic static JimiRasterImage getRasterImage(java.lang.String filename) throws JimiException
filename
- the file to load the image frompublic static JimiRasterImage getRasterImage(java.lang.String filename, int flags) throws JimiException
filename
- the file to load the image fromflags
- flags indicating the mode of image loadingpublic static java.awt.image.ImageProducer getImageProducer(java.io.InputStream in)
in
- the stream to read the image frompublic static java.awt.image.ImageProducer getImageProducer(java.io.InputStream in, int flags)
in
- the stream to read the image fromflags
- flags indicating the mode of image loadingpublic static java.awt.image.ImageProducer getImageProducer(java.io.InputStream in, java.lang.String typeID)
in
- the stream to read the image fromtypeID
- the mime-type of the image data formatpublic static java.awt.image.ImageProducer getImageProducer(java.io.InputStream in, java.lang.String typeID, int flags)
in
- the stream to read the image fromtypeID
- the mime-type of the image data formatflags
- flags indicating the mode of image loadingpublic static java.awt.image.ImageProducer getImageProducer(java.lang.String filename, java.lang.String typeID)
filename
- the file to read the image fromtypeID
- the mime-type of the image data formatpublic static java.awt.image.ImageProducer getImageProducer(java.lang.String filename, java.lang.String typeID, int flags)
filename
- the file to read the image fromtypeID
- the mime-type of the image data formatflags
- flags indicating the mode of image loadingpublic static java.awt.Image getImage(java.io.InputStream in)
in
- the stream to load the image frompublic static java.awt.Image getImage(java.io.InputStream in, int flags)
in
- the stream to load the image fromflags
- flags indicating the mode of image loadingpublic static java.awt.Image getImage(java.io.InputStream in, java.lang.String typeID)
in
- the stream to load the image frompublic static java.awt.Image getImage(java.io.InputStream in, java.lang.String typeID, int flags)
in
- the stream to load the image fromflags
- flags indicating the mode of image loadingpublic static java.awt.Image getImage(java.lang.String filename, java.lang.String typeID, int flags)
filename
- the file to read the image fromflags
- flags indicating the mode of image loadingpublic static java.awt.Image getImage(java.lang.String filename, java.lang.String typeID)
filename
- the file to read the image fromflags
- flags indicating the mode of image loadingpublic static java.awt.image.ImageProducer getImageProducer(java.net.URL location)
location
- the location to read the image frompublic static java.awt.image.ImageProducer getImageProducer(java.net.URL location, int flags)
location
- the location to read the image fromflags
- flags indicating the mode of image loadingpublic static java.awt.image.ImageProducer getImageProducer(java.net.URL location, java.lang.String typeID, int flags)
location
- the location to read the image fromtypeID
- mime-type of the image formatflags
- flags indicating the mode of image loadingpublic static java.awt.image.ImageProducer getImageProducer(java.net.URL location, java.lang.String typeID)
location
- the location to read the image fromtypeID
- mime-type of the image formatpublic static java.awt.Image getImage(java.net.URL location, java.lang.String typeID, int flags)
location
- the location to load the image fromtypeID
- mime-type of the image formatflags
- flags indicating the mode of image loadingpublic static java.awt.Image getImage(java.net.URL location, java.lang.String typeID)
location
- the location to load the image fromtypeID
- mime-type of the image formatpublic static java.awt.Image getImage(java.net.URL location)
loaction
- the location to load the image frompublic static java.awt.Image getImage(java.net.URL location, int flags)
location
- the location to load the image fromflags
- flags indicating the mode of image loadingpublic static JimiRasterImage getRasterImage(java.net.URL location) throws JimiException
location
- the location to load the image frompublic static JimiRasterImage getRasterImage(java.net.URL location, int flags) throws JimiException
location
- the file to load the image fromflags
- flags indicating the mode of image loadingpublic static JimiRasterImage getRasterImage(java.net.URL location, java.lang.String typeID) throws JimiException
location
- the location to load the image fromtypeID
- the mime-type of the imagepublic static JimiRasterImage getRasterImage(java.net.URL location, java.lang.String typeID, int flags) throws JimiException
location
- the location to load the image fromtypeID
- the mime-type of the imageflags
- flags indicating the mode of image loadingpublic static JimiRasterImage getRasterImage(java.io.InputStream input, java.lang.String typeID) throws JimiException
input
- the stream to read image data fromtypeID
- the mimetype of the image data formatpublic static JimiRasterImage getRasterImage(java.io.InputStream input, java.lang.String typeID, int flags) throws JimiException
input
- the stream to read image data fromtypeID
- the mimetype of the image data formatflags
- flags indicating the mode of image loadingpublic static JimiRasterImage getRasterImage(java.io.InputStream input) throws JimiException
public static JimiRasterImage getRasterImage(java.io.InputStream input, int flags) throws JimiException
public static void putImage(java.awt.Image image, java.lang.String filename) throws JimiException
image
- the image to savefilename
- the file to write the image intopublic static void putImage(java.awt.image.ImageProducer producer, java.lang.String filename) throws JimiException
producer
- the image to savefilename
- the file to write the image intopublic static void putImage(JimiImage ji, java.lang.String filename) throws JimiException
ji
- the image to savefilename
- the file to write the image intopublic static void putImage(java.lang.String id, java.awt.Image image, java.io.OutputStream output) throws JimiException
image
- the image to saveoutput
- the stream to write the image intoid
- the mime-type of the format to save the image aspublic static void putImage(java.lang.String id, java.awt.image.ImageProducer producer, java.io.OutputStream output) throws JimiException
producer
- the image to saveoutput
- the stream to write the image intoid
- the mime-type of the format to save the image aspublic static void putImage(java.lang.String id, JimiImage ji, java.io.OutputStream output) throws JimiException
ji
- the image to saveoutput
- the stream to write the image intoid
- the mime-type of the format to save the image aspublic static void putImage(java.lang.String id, JimiImage image, java.lang.String filename) throws JimiException
image
- the image to savefilename
- the file to write toid
- the mime-type of the format to save the image aspublic static void putImage(java.lang.String id, java.awt.Image image, java.lang.String filename) throws JimiException
image
- the image to savefilename
- the file to write toid
- the mime-type of the format to save the image aspublic static void putImage(java.lang.String id, java.awt.image.ImageProducer image, java.lang.String filename) throws JimiException
image
- the image to savefilename
- the file to write toid
- the mime-type of the format to save the image aspublic static JimiRasterImage createRasterImage(java.awt.image.ImageProducer producer) throws JimiException
producer
- the ImageProducer to collect data frompublic static JimiRasterImage createRasterImage(java.awt.image.ImageProducer producer, int flags) throws JimiException
producer
- the ImageProducer to collect data fromflags
- the flags indicating which type of image to create, either
VIRUTAL_MEMORY or IN_MEMORY.public static JimiReader createTypedJimiReader(java.lang.String typeID) throws JimiException
setSource
.typeID
- the mime-type for the decoding.public static JimiReader createTypedJimiReader(java.lang.String typeID, int flags) throws JimiException
setSource
.typeID
- the mime-type for the decoding.flags
- flags indicating the mode of image loadingpublic static JimiReader createJimiReader(java.lang.String filename) throws JimiException
filename
- the file to read the image frompublic static JimiReader createJimiReader(java.io.InputStream input) throws JimiException
filename
- the file to read the image frompublic static JimiReader createTypedJimiReader(java.io.InputStream input, java.lang.String typeID) throws JimiException
input
- the stream to read image data fromtypeID
- the mimetype of the image file formatflags
- the flags indicating which type of image to create, eitherpublic static JimiReader createTypedJimiReader(java.io.InputStream input, java.lang.String typeID, int flags) throws JimiException
input
- the stream to read image data fromtypeID
- the mimetype of the image file formatflags
- the flags indicating which type of image to create, eitherpublic static JimiWriter createTypedJimiWriter(java.lang.String typeID) throws JimiException
typeID
- the mime-type of the format to write withpublic static JimiReader createJimiReader(java.net.URL location) throws JimiException
filename
- the file to read the image frompublic static JimiReader createJimiReader(java.lang.String filename, int flags) throws JimiException
filename
- the file to read the image frompublic static JimiReader createJimiReader(java.io.InputStream input, int flags) throws JimiException
filename
- the file to read the image frompublic static JimiReader createJimiReader(java.net.URL location, int flags) throws JimiException
filename
- the file to read the image frompublic static JimiWriter createJimiWriter(java.lang.String filename) throws JimiException
filename
- the file to write topublic static JimiWriter createJimiWriter(java.lang.String id, java.io.OutputStream output) throws JimiException
id
- the mime-type of the format to write image data asoutput
- the stream to write topublic static void setDefaultFlags(int flags)
ASYNCHRONOUS | IN_MEMORY
.flags
- decoding flagspublic static java.lang.String[] getEncoderTypes()
public static java.lang.String[] getDecoderTypes()
protected static JimiRasterImage createRasterImage(java.awt.image.ImageProducer producer, JimiImageFactory factory) throws JimiException
public static JimiImageFactory getFactory(int flags)
flags
- flags indicating whether to give in-memory, VMM, or One-shot.public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |