com.sun.jimi.core
Class Jimi

java.lang.Object
  |
  +--com.sun.jimi.core.Jimi

public class Jimi
extends java.lang.Object

Jimi - Java Image Management Interface

(c) 1997-1999 Sun Microsystems, Inc.

Introduction

The Java Image Management Interface provides facilities for loading and saving images in many different file formats. It provides a simple interface to loading and saving of images which is consistent with the way the built-in AWT Toolkit image load mechanism for jpeg and gif files operates.

This class "Jimi" presents the highest and simplest level access to the image loading and saving functionality.

Image Data Sources and Destinations

The 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.

Loading Images

The methods to use for loading images have the method name 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);

Saving Images

The methods to use for saving images have the method name putImage.


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

ASYNCHRONOUS

public static final int ASYNCHRONOUS

SYNCHRONOUS

public static final int SYNCHRONOUS

IN_MEMORY

public static final int IN_MEMORY

VIRTUAL_MEMORY

public static final int VIRTUAL_MEMORY

ONE_SHOT

public static final int ONE_SHOT

defaultFlags

protected static int defaultFlags

memoryFactory

protected static JimiImageFactory memoryFactory

vmemFactory

protected static JimiImageFactory vmemFactory

oneshotFactory

protected static JimiImageFactory oneshotFactory
Method Detail

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.lang.String filename)
Get an ImageProducer for an image.
Parameters:
filename - the file to read the image from
Returns:
the ImageProducer

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.lang.String filename,
                                                            int flags)
Get an ImageProducer for an image.
Parameters:
filename - the file to read the image from
flags - flags indicating the mode of image loading
Returns:
the ImageProducer

getImage

public static java.awt.Image getImage(java.lang.String filename)
Load an Image.
Parameters:
filename - the file to load the image from
Returns:
the Image

getImage

public static java.awt.Image getImage(java.lang.String filename,
                                      int flags)
Load an Image.
Parameters:
filename - the file to load the image from
flags - flags indicating the mode of image loading
Returns:
the Image

getRasterImage

public static JimiRasterImage getRasterImage(java.lang.String filename)
                                      throws JimiException
Load an image into a JimiRasterImage for easier access to image information.
Parameters:
filename - the file to load the image from

getRasterImage

public static JimiRasterImage getRasterImage(java.lang.String filename,
                                             int flags)
                                      throws JimiException
Load an image into a JimiRasterImage for easier access to image information.
Parameters:
filename - the file to load the image from
flags - flags indicating the mode of image loading
Returns:
a JimiRasterImage representing the image

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.io.InputStream in)
Get an ImageProducer for an image.
Parameters:
in - the stream to read the image from
Returns:
the ImageProducer

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.io.InputStream in,
                                                            int flags)
Get an ImageProducer for an image.
Parameters:
in - the stream to read the image from
flags - flags indicating the mode of image loading
Returns:
the ImageProducer

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.io.InputStream in,
                                                            java.lang.String typeID)
Get an ImageProducer for an image.
Parameters:
in - the stream to read the image from
typeID - the mime-type of the image data format
Returns:
the ImageProducer

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.io.InputStream in,
                                                            java.lang.String typeID,
                                                            int flags)
Get an ImageProducer for an image.
Parameters:
in - the stream to read the image from
typeID - the mime-type of the image data format
flags - flags indicating the mode of image loading
Returns:
the ImageProducer

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.lang.String filename,
                                                            java.lang.String typeID)
Get an ImageProducer for an image.
Parameters:
filename - the file to read the image from
typeID - the mime-type of the image data format
Returns:
the ImageProducer

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.lang.String filename,
                                                            java.lang.String typeID,
                                                            int flags)
Get an ImageProducer for an image.
Parameters:
filename - the file to read the image from
typeID - the mime-type of the image data format
flags - flags indicating the mode of image loading
Returns:
the ImageProducer

getImage

public static java.awt.Image getImage(java.io.InputStream in)
Load an Image.
Parameters:
in - the stream to load the image from
Returns:
the Image

getImage

public static java.awt.Image getImage(java.io.InputStream in,
                                      int flags)
Load an Image.
Parameters:
in - the stream to load the image from
flags - flags indicating the mode of image loading
Returns:
the Image

getImage

public static java.awt.Image getImage(java.io.InputStream in,
                                      java.lang.String typeID)
Load an Image.
Parameters:
in - the stream to load the image from
Returns:
the Image

getImage

public static java.awt.Image getImage(java.io.InputStream in,
                                      java.lang.String typeID,
                                      int flags)
Load an Image.
Parameters:
in - the stream to load the image from
flags - flags indicating the mode of image loading
Returns:
the Image

getImage

public static java.awt.Image getImage(java.lang.String filename,
                                      java.lang.String typeID,
                                      int flags)
Load an Image.
Parameters:
filename - the file to read the image from
flags - flags indicating the mode of image loading
Returns:
the Image

getImage

public static java.awt.Image getImage(java.lang.String filename,
                                      java.lang.String typeID)
Load an Image.
Parameters:
filename - the file to read the image from
flags - flags indicating the mode of image loading
Returns:
the Image

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.net.URL location)
Get an ImageProducer for an image.
Parameters:
location - the location to read the image from
Returns:
the ImageProducer

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.net.URL location,
                                                            int flags)
Get an ImageProducer for an image.
Parameters:
location - the location to read the image from
flags - flags indicating the mode of image loading
Returns:
the ImageProducer

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.net.URL location,
                                                            java.lang.String typeID,
                                                            int flags)
Get an ImageProducer for an image.
Parameters:
location - the location to read the image from
typeID - mime-type of the image format
flags - flags indicating the mode of image loading
Returns:
the ImageProducer

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.net.URL location,
                                                            java.lang.String typeID)
Get an ImageProducer for an image.
Parameters:
location - the location to read the image from
typeID - mime-type of the image format
Returns:
the ImageProducer

getImage

public static java.awt.Image getImage(java.net.URL location,
                                      java.lang.String typeID,
                                      int flags)
Load an Image.
Parameters:
location - the location to load the image from
typeID - mime-type of the image format
flags - flags indicating the mode of image loading
Returns:
the Image

getImage

public static java.awt.Image getImage(java.net.URL location,
                                      java.lang.String typeID)
Load an Image.
Parameters:
location - the location to load the image from
typeID - mime-type of the image format
Returns:
the Image

getImage

public static java.awt.Image getImage(java.net.URL location)
Load an Image.
Parameters:
loaction - the location to load the image from
Returns:
the Image

getImage

public static java.awt.Image getImage(java.net.URL location,
                                      int flags)
Load an Image.
Parameters:
location - the location to load the image from
flags - flags indicating the mode of image loading
Returns:
the Image

getRasterImage

public static JimiRasterImage getRasterImage(java.net.URL location)
                                      throws JimiException
Load an image into a JimiRasterImage for easier access to image information.
Parameters:
location - the location to load the image from

getRasterImage

public static JimiRasterImage getRasterImage(java.net.URL location,
                                             int flags)
                                      throws JimiException
Load an image into a JimiRasterImage for easier access to image information.
Parameters:
location - the file to load the image from
flags - flags indicating the mode of image loading
Returns:
a JimiRasterImage representing the image

getRasterImage

public static JimiRasterImage getRasterImage(java.net.URL location,
                                             java.lang.String typeID)
                                      throws JimiException
Load an image into a JimiRasterImage for easier access to image information.
Parameters:
location - the location to load the image from
typeID - the mime-type of the image

getRasterImage

public static JimiRasterImage getRasterImage(java.net.URL location,
                                             java.lang.String typeID,
                                             int flags)
                                      throws JimiException
Load an image into a JimiRasterImage for easier access to image information.
Parameters:
location - the location to load the image from
typeID - the mime-type of the image
flags - flags indicating the mode of image loading

getRasterImage

public static JimiRasterImage getRasterImage(java.io.InputStream input,
                                             java.lang.String typeID)
                                      throws JimiException
Load an image into a JimiRasterImage for easier access to image information.
Parameters:
input - the stream to read image data from
typeID - the mimetype of the image data format
Returns:
a JimiRasterImage representing the image

getRasterImage

public static JimiRasterImage getRasterImage(java.io.InputStream input,
                                             java.lang.String typeID,
                                             int flags)
                                      throws JimiException
Load an image into a JimiRasterImage for easier access to image information.
Parameters:
input - the stream to read image data from
typeID - the mimetype of the image data format
flags - flags indicating the mode of image loading
Returns:
a JimiRasterImage representing the image

getRasterImage

public static JimiRasterImage getRasterImage(java.io.InputStream input)
                                      throws JimiException

getRasterImage

public static JimiRasterImage getRasterImage(java.io.InputStream input,
                                             int flags)
                                      throws JimiException

putImage

public static void putImage(java.awt.Image image,
                            java.lang.String filename)
                     throws JimiException
Save an image.
Parameters:
image - the image to save
filename - the file to write the image into
Throws:
JimiException - if an error prevents image encoding

putImage

public static void putImage(java.awt.image.ImageProducer producer,
                            java.lang.String filename)
                     throws JimiException
Save an image.
Parameters:
producer - the image to save
filename - the file to write the image into
Throws:
JimiException - if an error prevents image encoding

putImage

public static void putImage(JimiImage ji,
                            java.lang.String filename)
                     throws JimiException
Save an image.
Parameters:
ji - the image to save
filename - the file to write the image into
Throws:
JimiException - if an error prevents image encoding

putImage

public static void putImage(java.lang.String id,
                            java.awt.Image image,
                            java.io.OutputStream output)
                     throws JimiException
Save an image.
Parameters:
image - the image to save
output - the stream to write the image into
id - the mime-type of the format to save the image as
Throws:
JimiException - if an error prevents image encoding

putImage

public static void putImage(java.lang.String id,
                            java.awt.image.ImageProducer producer,
                            java.io.OutputStream output)
                     throws JimiException
Save an image.
Parameters:
producer - the image to save
output - the stream to write the image into
id - the mime-type of the format to save the image as
Throws:
JimiException - if an error prevents image encoding

putImage

public static void putImage(java.lang.String id,
                            JimiImage ji,
                            java.io.OutputStream output)
                     throws JimiException
Save an image.
Parameters:
ji - the image to save
output - the stream to write the image into
id - the mime-type of the format to save the image as
Throws:
JimiException - if an error prevents image encoding

putImage

public static void putImage(java.lang.String id,
                            JimiImage image,
                            java.lang.String filename)
                     throws JimiException
Save an image.
Parameters:
image - the image to save
filename - the file to write to
id - the mime-type of the format to save the image as
Throws:
JimiException - if an error prevents image encoding

putImage

public static void putImage(java.lang.String id,
                            java.awt.Image image,
                            java.lang.String filename)
                     throws JimiException
Save an image.
Parameters:
image - the image to save
filename - the file to write to
id - the mime-type of the format to save the image as
Throws:
JimiException - if an error prevents image encoding

putImage

public static void putImage(java.lang.String id,
                            java.awt.image.ImageProducer image,
                            java.lang.String filename)
                     throws JimiException
Save an image.
Parameters:
image - the image to save
filename - the file to write to
id - the mime-type of the format to save the image as
Throws:
JimiException - if an error prevents image encoding

createRasterImage

public static JimiRasterImage createRasterImage(java.awt.image.ImageProducer producer)
                                         throws JimiException
Create a JimiRasterImage using pixel data collected from an ImageProducer.
Parameters:
producer - the ImageProducer to collect data from
Returns:
the resulting JimiRasterImage
Throws:
JimiException - if an error prevents the image from being created

createRasterImage

public static JimiRasterImage createRasterImage(java.awt.image.ImageProducer producer,
                                                int flags)
                                         throws JimiException
Create a JimiRasterImage using pixel data collected from an ImageProducer.
Parameters:
producer - the ImageProducer to collect data from
flags - the flags indicating which type of image to create, either VIRUTAL_MEMORY or IN_MEMORY.
Returns:
the resulting JimiRasterImage
Throws:
JimiException - if an error prevents the image from being created

createTypedJimiReader

public static JimiReader createTypedJimiReader(java.lang.String typeID)
                                        throws JimiException
Create a JimiReader without setting the decoding source. The reader must later be initialized with setSource.
Parameters:
typeID - the mime-type for the decoding.
Returns:
the JimiReader

createTypedJimiReader

public static JimiReader createTypedJimiReader(java.lang.String typeID,
                                               int flags)
                                        throws JimiException
Create a JimiReader without setting the decoding source. The reader must later be initialized with setSource.
Parameters:
typeID - the mime-type for the decoding.
flags - flags indicating the mode of image loading
Returns:
the JimiReader

createJimiReader

public static JimiReader createJimiReader(java.lang.String filename)
                                   throws JimiException
Create a JimiReader to control decoding of an image or series of images.
Parameters:
filename - the file to read the image from
Returns:
the JimiReader
Throws:
JimiException - if an error prevents the JimiReader from being initialized

createJimiReader

public static JimiReader createJimiReader(java.io.InputStream input)
                                   throws JimiException
Create a JimiReader to control decoding of an image or series of images.
Parameters:
filename - the file to read the image from
Returns:
the JimiReader
Throws:
JimiException - if an error prevents the JimiReader from being initialized

createTypedJimiReader

public static JimiReader createTypedJimiReader(java.io.InputStream input,
                                               java.lang.String typeID)
                                        throws JimiException
Create a JimiReader to control decoding of an image or series of images.
Parameters:
input - the stream to read image data from
typeID - the mimetype of the image file format
flags - the flags indicating which type of image to create, either
Returns:
a JimiReader to read an image from the stream

createTypedJimiReader

public static JimiReader createTypedJimiReader(java.io.InputStream input,
                                               java.lang.String typeID,
                                               int flags)
                                        throws JimiException
Create a JimiReader to control decoding of an image or series of images.
Parameters:
input - the stream to read image data from
typeID - the mimetype of the image file format
flags - the flags indicating which type of image to create, either
Returns:
a JimiReader to read an image from the stream

createTypedJimiWriter

public static JimiWriter createTypedJimiWriter(java.lang.String typeID)
                                        throws JimiException
Create a JimiWriter for a specified Mime-type to control image encoding with.
Parameters:
typeID - the mime-type of the format to write with

createJimiReader

public static JimiReader createJimiReader(java.net.URL location)
                                   throws JimiException
Create a JimiReader to control decoding of an image or series of images.
Parameters:
filename - the file to read the image from
Returns:
the JimiReader
Throws:
JimiException - if an error prevents the JimiReader from being initialized

createJimiReader

public static JimiReader createJimiReader(java.lang.String filename,
                                          int flags)
                                   throws JimiException
Create a JimiReader to control decoding of an image or series of images.
Parameters:
filename - the file to read the image from
Returns:
the JimiReader
Throws:
JimiException - if an error prevents the JimiReader from being initialized

createJimiReader

public static JimiReader createJimiReader(java.io.InputStream input,
                                          int flags)
                                   throws JimiException
Create a JimiReader to control decoding of an image or series of images.
Parameters:
filename - the file to read the image from
Returns:
the JimiReader
Throws:
JimiException - if an error prevents the JimiReader from being initialized

createJimiReader

public static JimiReader createJimiReader(java.net.URL location,
                                          int flags)
                                   throws JimiException
Create a JimiReader to control decoding of an image or series of images.
Parameters:
filename - the file to read the image from
Returns:
the JimiReader
Throws:
JimiException - if an error prevents the JimiReader from being initialized

createJimiWriter

public static JimiWriter createJimiWriter(java.lang.String filename)
                                   throws JimiException
Create a JimiWriter to control encoding of an image or series of images.
Parameters:
filename - the file to write to
Returns:
the JimiWriter
Throws:
JimiException - if an error prevents the JimiWriter from being initialized

createJimiWriter

public static JimiWriter createJimiWriter(java.lang.String id,
                                          java.io.OutputStream output)
                                   throws JimiException
Create a JimiWriter to control encoding of an image or series of images.
Parameters:
id - the mime-type of the format to write image data as
output - the stream to write to
Returns:
the JimiWriter
Throws:
JimiException - if an error prevents the JimiWriter from being initialized

setDefaultFlags

public static void setDefaultFlags(int flags)
Set the default flags to use for image decoding. This is initially set to ASYNCHRONOUS | IN_MEMORY.
Parameters:
flags - decoding flags

getEncoderTypes

public static java.lang.String[] getEncoderTypes()
Get a list of all mime-types supported for image encoding.
Returns:
a String[] containing the types

getDecoderTypes

public static java.lang.String[] getDecoderTypes()
Get a list of all mime-types supported for image encoding.
Returns:
a String[] containing the types

createRasterImage

protected static JimiRasterImage createRasterImage(java.awt.image.ImageProducer producer,
                                                   JimiImageFactory factory)
                                            throws JimiException

getFactory

public static JimiImageFactory getFactory(int flags)
Get a JimiImageFactory based on flags provided.
Parameters:
flags - flags indicating whether to give in-memory, VMM, or One-shot.

main

public static void main(java.lang.String[] args)
Entry method: "-version" prints Jimi version and build number. "-encoders" lists all encoder mime-types "-decoders" lists all decoder mime-types