All Packages  This Package  Class Hierarchy  Class Search  Index

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

  Summary

public class  JimiReader
     extends java.lang.Object
     implements com.activated.util.PropertyOwner
{
          // Methods 22
     public void clearProperties();
     public Image getImage();
     public Image getImage(int) throws JimiException;
     public Enumeration getImageEnumeration();
     public ImageProducer getImageProducer();
     public ImageProducer getImageProducer(int) throws JimiException;
     public Enumeration getImageProducerEnumeration();
     public JimiImage getJimiImage();
     public JimiImage getJimiImage(int) throws JimiException;
     public Enumeration getJimiImageEnumeration();
     public int getNumberOfImages();
     public Object getPossibleValuesForProperty(String) throws InvalidOptionException;
     public Object getProperty(String);
     public String getPropertyDescription(String) throws InvalidOptionException;
     public Enumeration getPropertyNames();
     public Dimension getSize() throws JimiException;
     public void setBlocking(boolean);
     public void setProperty(String, Object) throws InvalidOptionException;
     public void setSource(InputStream) throws JimiException;
     public void setSource(String) throws JimiException;
     public void setSource(URL) throws JimiException;
     public void setStorage(StorageFactory);
}

This class provides an abstraction handle object to allow for the client to set options controlling the decoding of images.

This class provides the handle used to load multiple images from a single data source.

This class provides the ability to return a JimiImage object which encapsulates an Images data.

See Also: setProperty, setBlocking, getJimiImage, JimiImage


  Cross Reference

Returned By:
Jimi.createJimiReader(), Jimi.createJimiReader(), Jimi.createJimiReader(), Jimi.createTypedJimiReader()





  Methods

· setBlocking

Summary  |  Top
   public void setBlocking(boolean block) 

By default JimiReader returns Image, ImageProducer or JimiImage in an asynchronous manner as per the normal operation of Java Image and ImageProducer instances.

Because Image and ImageProducers are inherently asynchronous the closest approximation provide to blocking on loading of the image is to ensure that all image data is decoded and in memory before return of the appropriate object.

Parameter Description
block flag indicating what state to switch JimiReader to operate in. If set then any getImage, getImageProducer or getJimiImage will block on loading the image until it is completely loaded.



· setSource

Summary  |  Top
   public void setSource(InputStream in)  throws JimiException

Replace or set the source for the image data. The JimiReader object already exists and the type of image file format that can be decoded is set. Setting the image source to an image file of a type different from what this JimiReader object is set for will generate exceptions and or errors from any methods which retrieve Image data in any form.

Parameter Description
in InputStream from which to read image data

Throws: JimiException
is not currently thrown


· setSource

Summary  |  Top
   public void setSource(String fileName)  throws JimiException

Replace or set the source for the image data. The JimiReader object already exists and the type of image file format that can be decoded is set. Setting the image source to an image file of a type different from what this JimiReader object is set for will generate exceptions and or errors from any methods which retrieve Image data in any form.

Parameter Description
fileName The name of the file from which to read image data

Throws: JimiException
is not currently thrown


· setSource

Summary  |  Top
   public void setSource(URL url)  throws JimiException

Replace or set the source for the image data. The JimiReader object already exists and the type of image file format that can be decoded is set. Setting the image source to an image file of a type different from what this JimiReader object is set for will generate exceptions and or errors from any methods which retrieve Image data in any form.

Parameter Description
url The URL of the file from which to read image data

Throws: JimiException
is not currently thrown


· getImage

Summary  |  Top
   public Image getImage() 

Returns:
Image of the decoded data from data source
Throws: IllegalArgumentException
if data source not set


· getImageProducer

Summary  |  Top
   public ImageProducer getImageProducer() 

Returns:
ImageProducer of the decoded data from data source
Throws: IllegalArgumentException
if data source not set


· getJimiImage

Summary  |  Top
   public JimiImage getJimiImage() 

Returns:
JimiImage of the decoded data from data source. This JimiImage is not guaranteed to be complete at the time of return by this method unless blocking is enabled. To wait for a JimiImage to complete loading use waitCoverage()
Throws: IllegalArgumentException
if data source not set


· getImageEnumeration

Summary  |  Top
   public Enumeration getImageEnumeration() 

Returns:
enumeration of Image objects loaded from image data source


· getImageProducerEnumeration

Summary  |  Top
   public Enumeration getImageProducerEnumeration() 

Returns:
enumeration of ImageProducer objects loaded from image data source


· getJimiImageEnumeration

Summary  |  Top
   public Enumeration getJimiImageEnumeration() 

Returns:
enumeration of JimiImage objects loaded from image data source


· getImage

Summary  |  Top
   public Image getImage(int n)  throws JimiException

Parameter Description
n the index of the image you want. An index value of 0 indicates the first image.

Returns:
the JimiImage containing the data decoded from the data source
Throws: IllegalArgumentException
if data source not set
Throws: JimiException
thrown if an error encountered retrieving an image from a multiple image file.


· getJimiImage

Summary  |  Top
   public JimiImage getJimiImage(int n)  throws JimiException

Parameter Description
n the index of the image you want. An index value of 0 indicates the first image.

Returns:
the JimiImage containing the data decoded from the data source
Throws: IllegalArgumentException
if data source not set
Throws: JimiException
thrown if an error encountered retrieving an image from a multiple image file.


· getImageProducer

Summary  |  Top
   public ImageProducer getImageProducer(int n)  throws JimiException

Parameter Description
n the index of the image you want. An index value of 0 indicates the first image.

Returns:
the ImageProducer which provides the data decoded from the data source
Throws: IllegalArgumentException
if data source not set
Throws: JimiException
if requesting an image sequentially before the current one and there is no way to rewind the data input source.


· getSize

Summary  |  Top
   public Dimension getSize()  throws JimiException

Returns:
the dimensions of the image that would be retrieved by getImage, getImageProducer or getJimiImage.
Throws: JimiException
thrown if the wait() on the JimiImage for the image width and height is interrupted.


· getPossibleValuesForProperty

Summary  |  Top
   public Object getPossibleValuesForProperty(String propName)  throws InvalidOptionException

The properties of this JimiReader are simple proxies for the properties of the underlying decoder

Throws: InvalidOptionException
thrown if request values for a property name not supported by this object.
Implements:
getPossibleValuesForProperty in interface PropertyOwner


· getPropertyDescription

Summary  |  Top
   public String getPropertyDescription(String propName)  throws InvalidOptionException

Proxies appropriately.

Throws: InvalidOptionException
thrown if request a description for a property name not supported by this object.
Implements:
getPropertyDescription in interface PropertyOwner


· clearProperties

Summary  |  Top
   public void clearProperties() 

The properties of this JimiReader are simple proxies for the properties of the underlying decoder

Implements:
clearProperties in interface PropertyOwner


· getProperty

Summary  |  Top
   public Object getProperty(String key) 

The properties of this JimiReader are simple proxies for the properties of the underlying decoder

Implements:
getProperty in interface PropertyOwner


· getPropertyNames

Summary  |  Top
   public Enumeration getPropertyNames() 

The properties of this JimiReader are simple proxies for the properties of the underlying decoder

Implements:
getPropertyNames in interface PropertyOwner


· setProperty

Summary  |  Top
   public void setProperty(String name, 
                           Object value)  throws InvalidOptionException

The properties of this JimiReader are simple proxies for the properties of the underlying decoder

Throws: InvalidOptionException
thrown if name of the property is not valid for this object or if the value is out of range for this object for th given name.
Implements:
setProperty in interface PropertyOwner


· getNumberOfImages

Summary  |  Top
   public int getNumberOfImages() 

This method calls the method of the same name in the JimiDecoder implementation.

Returns:
the number of images in the file being decoded. It is possible that the number of images is unknown ahead of time therefore it is valid for this method to return JimiDecoder.UNKNOWNCOUNT. The multi image GIF Decoder returns UNKNOWNCOUNT.

See Also: com.activated.jimi.JimiDecoder.html



· setStorage

Summary  |  Top
   public void setStorage(StorageFactory sFact) 

Parameter Description
sFact the StorageFactory to be used to create JimiImage instances where and when they are required in this class. If null then the default StorageFactory will be used.



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