All Packages  This Package  Class Hierarchy  Class Search  Index

Class com.activated.jimi.Jimi
java.lang.Object
   |
   +----com.activated.jimi.Jimi

  Summary

public class  Jimi
     extends java.lang.Object
{
          // Methods 29
     public static void addExtension(Extension) throws JimiException;
     public static JimiReader createJimiReader(InputStream) throws JimiException;
     public static JimiReader createJimiReader(String) throws JimiException;
     public static JimiReader createJimiReader(URL) throws JimiException;
     public static JimiWriter createJimiWriter(String) throws JimiException;
     public static JimiReader createTypedJimiReader(String) throws JimiException;
     public static JimiWriter createTypedJimiWriter(String) throws JimiException;
     public static String[] getDecoderTypes();
     public static String[] getEncoderTypes();
     public static Image getImage(InputStream);
     public static Image getImage(InputStream, String);
     public static Image getImage(String);
     public static Image getImage(String, String);
     public static Image getImage(URL);
     public static Image getImage(URL, String);
     public static ImageProducer getImageProducer(InputStream);
     public static ImageProducer getImageProducer(InputStream, String);
     public static ImageProducer getImageProducer(String);
     public static ImageProducer getImageProducer(String, String);
     public static ImageProducer getImageProducer(URL);
     public static ImageProducer getImageProducer(URL, String);
     public static void main(String[]);
     public static void putImage(Image, String) throws JimiException;
     public static void putImage(ImageProducer, String) throws JimiException;
     public static void putImage(String, Image, OutputStream) throws JimiException;
     public static void putImage(String, Image, String) throws JimiException;
     public static void putImage(String, ImageProducer, OutputStream) throws JimiException;
     public static void putImage(String, ImageProducer, String) throws JimiException;
     public static void verifyKey() throws JimiException;

}

Jimi - Java Image Management Interface

(c) 1997, 1998 Activated Intelligence

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. Currently the type of encoded image format is derived from the name of the file containing the image. This means that any URL or filename must have the correct filename extension to be loaded correctly. This will be supplemented with a content based type detection in future revisions.

To be able to decode images which have no valid filename extensions or come from an InputStream it is possible to specify the type of the encoded image format using the methods with a typeID parameter.

They currently are not implemented as generalized file type recognition is not yet available.

It is possible to add recognition of new file extensions as an already supported Type ID as follows.
Jimi.addExpansion(com.activated.jimi.Expansion)
It is also possible to override existing extension mappings as follows.

Saving Images

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




  Methods

· main

Summary  |  Top

   public static void main(String[] args) 


· verifyKey

Summary  |  Top
   public static void verifyKey()  throws JimiException


· getImageProducer

Summary  |  Top
   public static ImageProducer getImageProducer(InputStream in) 

not currently implemented returns an error ImageProducer

Parameter Description
in input stream to retrieve encoded image from

Returns:
Image Producer which provides the decode image from the specified input source.


· getImageProducer

Summary  |  Top
   public static ImageProducer getImageProducer(InputStream in, 
                                                String typeID) 

Parameter Description
in input stream to retrieve encoded image from
typeID the type of image data in the InputStream

Returns:
Image Producer which provides the decode image from the specified input source.


· getImage

Summary  |  Top
   public static Image getImage(InputStream in) 

not currently implemented returns an error Image

Parameter Description
in input stream to retrieve encoded image from

Returns:
Image based on image data decoded from image source


· getImage

Summary  |  Top
   public static Image getImage(InputStream in, 
                                String typeID) 

Parameter Description
in input stream to retrieve encoded image from
typeID the type of image data in the InputStream

Returns:
Image based on image data decoded from image source


· getImageProducer

Summary  |  Top
   public static ImageProducer getImageProducer(String fileName) 

Parameter Description
fileName name of file to retrieve image from.

Returns:
Image Producer which provides the decode image from the specified input source.


· getImageProducer

Summary  |  Top
   public static ImageProducer getImageProducer(String fileName, 
                                                String typeID) 

Parameter Description
fileName name of file to retrieve image from.
typeID the type of image data in the file

Returns:
Image Producer which provides the decode image from the specified input source.


· getImage

Summary  |  Top
   public static Image getImage(String fileName) 

Parameter Description
fileName name of file to retrieve image from.

Returns:
Image based on image data decoded from image source


· getImage

Summary  |  Top
   public static Image getImage(String fileName, 
                                String typeID) 

Parameter Description
fileName name of file to retrieve image from.
typeID the type of image data in the file

Returns:
Image based on image data decoded from image source


· getImageProducer

Summary  |  Top
   public static ImageProducer getImageProducer(URL url) 

Parameter Description
url to the file to retrieve image from.

Returns:
Image Producer which provides the decode image from the specified input source.


· getImageProducer

Summary  |  Top
   public static ImageProducer getImageProducer(URL url, 
                                                String typeID) 

Parameter Description
url to the file to retrieve image from.
typeID the type of image data in the file

Returns:
Image Producer which provides the decode image from the specified input source.


· getImage

Summary  |  Top
   public static Image getImage(URL url) 

Parameter Description
url to the file to retrieve image from.

Returns:
Image based on image data decoded from image source


· getImage

Summary  |  Top
   public static Image getImage(URL url, 
                                String typeID) 

Parameter Description
url to the file to retrieve image from.
typeID the type of image data in the file

Returns:
Image based on image data decoded from image source


· putImage

Summary  |  Top
   public static void putImage(String id, 
                               ImageProducer prod, 
                               String fileName)  throws JimiException

Parameter Description
id String identifier which specifies the format of the encoding to store the image in
prod image data source of image to be encoded to destination
fileName destination for encoded image format data

Throws: JimiException
if any problems occur when writing the image.


· putImage

Summary  |  Top
   public static void putImage(String id, 
                               ImageProducer prod, 
                               OutputStream out)  throws JimiException

Parameter Description
id String identifier which specifies the format of the encoding to store the image in
prod image data source of image to be encoded to destination
out destination for encoded image format data

Throws: JimiException
if any problems occur when writing the image.


· putImage

Summary  |  Top
   public static void putImage(String id, 
                               Image img, 
                               String fileName)  throws JimiException

Parameter Description
id String identifier which specifies the format of the encoding to store the image in
img image data source of image to be encoded to destination
fileName destination for encoded image format data

Throws: JimiException
if any problems occur when writing the image.


· putImage

Summary  |  Top
   public static void putImage(String id, 
                               Image img, 
                               OutputStream out)  throws JimiException

Parameter Description
id String identifier which specifies the format of the encoding to store the image in
img image data source of image to be encoded to destination
out destination for encoded image format data

Throws: JimiException
if any problems occur when writing the image.


· putImage

Summary  |  Top
   public static void putImage(ImageProducer producer, 
                               String filename)  throws JimiException

Save an image to a file.

Parameter Description
producer the ImageProducer to draw image data from
filename the name of the file to save to



· putImage

Summary  |  Top
   public static void putImage(Image image, 
                               String filename)  throws JimiException

Save an image to a file.

Parameter Description
producer the ImageProducer to draw image data from
filename the name of the file to save to



· createTypedJimiReader

Summary  |  Top
   public static JimiReader createTypedJimiReader(String typeID)  throws JimiException

Parameter Description
typeID type of image that JimiReader object is required for

Returns:
JimiReader object which is able to handle images of the specified image type.
Throws: JimiException
if cant create JimiReader for type.


· createJimiReader

Summary  |  Top
   public static JimiReader createJimiReader(String fileName)  throws JimiException

Parameter Description
fileName is the image data source to create a JimiReader object for.

Returns:
JimiReader which is able to handle image of the same type as the image source parameter and has its source set to the parameter.
Throws: JimiException
if JimiReader cannot be created based on the image source.


· createJimiReader

Summary  |  Top
   public static JimiReader createJimiReader(URL url)  throws JimiException

Parameter Description
url is the image data source to create a JimiReader object for.

Returns:
JimiReader which is able to handle image of the same type as the image source parameter and has its source set to the parameter.
Throws: JimiException
if JimiReader cannot be created based on the image source.


· createJimiReader

Summary  |  Top
   public static JimiReader createJimiReader(InputStream in)  throws JimiException

Parameter Description
in is the image data source to create a JimiReader object for.

Returns:
JimiReader which is able to handle image of the same type as the image source parameter and has its source set to the parameter.
Throws: JimiException
if JimiReader cannot be created based on the image source.


· createTypedJimiWriter

Summary  |  Top
   public static JimiWriter createTypedJimiWriter(String typeID)  throws JimiException

Parameter Description
typeID ID of the type of image to be written. This must be non-null.

Returns:
JimiWriter object which writes the specified image file format.
Throws: JimiException
if cant create JimiWriter for passed typeID.


· createJimiWriter

Summary  |  Top
   public static JimiWriter createJimiWriter(String filename)  throws JimiException

Create a JimiWriter for a specified filename. The type of image format will be determined from the filename extension if possible.

Parameter Description
filename the filename to determine encoding type from



· getEncoderTypes

Summary  |  Top
   public static String[] getEncoderTypes() 

Returns:
an array of strings which represent the types of images that can be encoded by Jimi.


· getDecoderTypes

Summary  |  Top
   public static String[] getDecoderTypes() 

Returns:
an array of strings which represent the types of images that can be decoded by Jimi.


· addExtension

Summary  |  Top
   public static void addExtension(Extension xTension)  throws JimiException

Encoders and decoders come packaged as Extension classes. We can systematically add Extensions by calling this method.

Parameter Description
xTension An extension to the core functionality of Jimi

Throws: JimiException
The Extension can't be found, or it does not implement all of the encoders or decoders it claims it will. If an exception is thrown it is possible that some of the encoders or decoders have been added, but not others. Which encoders or decoders these might be should not be anticipated in advance.


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7