Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jimi.core
Class JimiReader

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

public class JimiReader
extends java.lang.Object

JimiReader provides more fine-grained control of the decoding process, and allows reading series' of images from a single image file.

Field Summary
`protected boolean` | `builtinJPEG` set to true if built-in JPEG decoding is in use
`protected java.awt.Image` | `cacheImage`
`protected java.awt.image.ImageProducer` | `cacheImageProducer`
`protected int` | `cacheIndex`
`protected JimiRasterImage` | `cacheJimiImage`
`protected java.lang.Runnable` | `cleanupCommand`
`protected JimiDecoder` | `decoder`
`protected JimiDecoderFactory` | `decoderFactory`
`protected java.lang.String` | `filename`
`protected JimiImageFactory` | `imageFactory`
`protected java.io.InputStream` | `input`
`protected java.awt.image.ImageProducer` | `jpegProducer`
`protected ProgressListener` | `listener`
`protected java.net.URL` | `location`
`protected ImageSeriesDecodingController` | `series`
`protected int` | `seriesIndex` image series state
`protected static int` | `STREAM_BUFFER_SIZE`
`protected boolean` | `synchronous` true if images should be fully decoded before being returned
`static int` | `UNKNOWN`

Constructor Summary
`protected` | `JimiReader(JimiImageFactory imageFactory)` Create and partially initialize a JimiReader.
`protected` | `JimiReader(JimiImageFactory imageFactory, java.io.InputStream input)` Create and partially initialize a JimiReader.
`protected` | `JimiReader(JimiImageFactory imageFactory, java.io.InputStream input, java.lang.String typeID)` Create and partially initialize a JimiReader.
`protected` | `JimiReader(JimiImageFactory imageFactory, JimiDecoderFactory decoderFactory, java.io.InputStream input)` Create and partially initialize a JimiReader.
`protected` | `JimiReader(JimiImageFactory imageFactory, java.lang.String filename)` Create and partially initialize a JimiReader.
`protected` | `JimiReader(JimiImageFactory factory, java.lang.String filename, java.lang.String typeID)` Create and partially initialize a JimiReader.
`protected` | `JimiReader(JimiImageFactory imageFactory, java.net.URL location)` Create and partially initialize a JimiReader.
`protected` | `JimiReader(JimiImageFactory imageFactory, java.net.URL location, java.lang.String typeID)` Create and partially initialize a JimiReader.

Method Summary
`void` | `close()` Close the reader.
`protected java.awt.Image` | `getBuiltinImage()` Use the JDKs inbuilt JPEG decoder to read an image.
`protected JimiRasterImage` | `getBuiltinJimiImage()` Use the JDKs inbuilt JPEG decoder to read an image, and convert it to a JimiRasterImage.
`protected java.awt.Image` | `getBuiltinJPEG()` Low-level interface to builtin JPEG decoder.
`java.awt.Image` | `getImage()` Reada single image from the source and return an Image representation.
`java.awt.Image` | `getImage(int n)` Get an Image at a specified index in the image series.
`java.util.Enumeration` | `getImageEnumeration()` Enumerate all images stored in the file.
`java.awt.image.ImageProducer` | `getImageProducer()` Read a single image from the source and return an ImageProducer for it.
`java.awt.image.ImageProducer` | `getImageProducer(int n)` Get an ImageProducer for an image at a specified index in the image series.
`java.util.Enumeration` | `getImageProducerEnumeration()` Enumerate all images stored in the file.
`protected JimiDecodingController` | `getNextController()` Get the decoding controller for the next image in the series.
`protected java.awt.Image` | `getNextImage()` Get the next available JimiImage.
`protected java.awt.image.ImageProducer` | `getNextImageProducer()` Get the next available ImageProducer.
`protected JimiRasterImage` | `getNextJimiImage()`
`protected JimiRasterImage` | `getNextJimiImage(boolean allowSynchronous)` Get the next available image.
`int` | `getNumberOfImages()` Find out how many images are available.
`JimiRasterImage` | `getRasterImage()` Read a single JimiRasterImage from the source.
`java.util.Enumeration` | `getRasterImageEnumeration()` Enumerate all images stored in the file.
`java.awt.Dimension` | `getSize()` Get the size of the first image.
`protected boolean` | `hasMoreElements()` Check if more images are available.
`protected void` | `initReader(JimiImageFactory factory)` Initialize or re-initialize the reader.
`protected void` | `initReader(JimiImageFactory imageFactory, JimiDecoderFactory decoderFactory)` Initialize or re-initialize the reader.
`protected void` | `initReader(JimiImageFactory imageFactory, JimiDecoderFactory decoderFactory, java.io.InputStream input)` Initialize or re-initialize the reader.
`void` | `setBlocking(boolean synchronous)` Choose whether to block on image loading, i.e.
`void` | `setMimeType(java.lang.String typeID)` Set the mime-type of the format.
`void` | `setProgressListener(ProgressListener listener)` Register a ProgressListener to be informed of decoding progress.
`void` | `setSource(java.io.InputStream input)` Replace or set the source for the image data.
`void` | `setSource(java.lang.String filename)` Set a file as the image data source.
`void` | `setSource(java.net.URL location)` Set a URL as the image data source.
`void` | `skipNextImage()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### UNKNOWN

    public static final int UNKNOWN

### STREAM_BUFFER_SIZE

    protected static final int STREAM_BUFFER_SIZE

### decoderFactory

    protected JimiDecoderFactory decoderFactory

### decoder

    protected JimiDecoder decoder

### imageFactory

    protected JimiImageFactory imageFactory

### input

    protected java.io.InputStream input

### cacheJimiImage

    protected JimiRasterImage cacheJimiImage

### cacheImageProducer

    protected java.awt.image.ImageProducer cacheImageProducer

### cacheImage

    protected java.awt.Image cacheImage

### cacheIndex

    protected int cacheIndex

### seriesIndex

    protected int seriesIndex

  image series state

### series

    protected ImageSeriesDecodingController series

### synchronous

    protected boolean synchronous

  true if images should be fully decoded before being returned

### builtinJPEG

    protected boolean builtinJPEG

  set to true if built-in JPEG decoding is in use

### jpegProducer

    protected java.awt.image.ImageProducer jpegProducer

### location

    protected java.net.URL location

### filename

    protected java.lang.String filename

### listener

    protected ProgressListener listener

### cleanupCommand

    protected java.lang.Runnable cleanupCommand

Constructor Detail

### JimiReader

    protected JimiReader(JimiImageFactory imageFactory,
                         JimiDecoderFactory decoderFactory,
                         java.io.InputStream input)
                  throws JimiException

  Create and partially initialize a JimiReader.
  Parameters:
    `imageFactory` - factory for creating images
    `decoderFactory` - factory for creating the decoder
    `input` - stream to read image data from

### JimiReader

    protected JimiReader(JimiImageFactory imageFactory,
                         java.io.InputStream input,
                         java.lang.String typeID)
                  throws JimiException

  Create and partially initialize a JimiReader.
  Parameters:
    `imageFactory` - factory for creating images
    `input` - stream to read image data from
    `typeID` - the mimetype of the image format

### JimiReader

    protected JimiReader(JimiImageFactory factory,
                         java.lang.String filename,
                         java.lang.String typeID)
                  throws JimiException

  Create and partially initialize a JimiReader.
  Parameters:
    `imageFactory` - factory for creating images
    `filename` - the name of the image file
    `typeID` - the mimetype of the image format

### JimiReader

    protected JimiReader(JimiImageFactory imageFactory,
                         java.net.URL location)
                  throws JimiException

  Create and partially initialize a JimiReader.
  Parameters:
    `imageFactory` - factory for creating images
    `location` - the URL of the image file

### JimiReader

    protected JimiReader(JimiImageFactory imageFactory,
                         java.net.URL location,
                         java.lang.String typeID)
                  throws JimiException

  Create and partially initialize a JimiReader.
  Parameters:
    `imageFactory` - factory for creating images
    `location` - the URL of the image file
    `typeID` - the mimetype of the image format

### JimiReader

    protected JimiReader(JimiImageFactory imageFactory,
                         java.lang.String filename)
                  throws JimiException

  Create and partially initialize a JimiReader.
  Parameters:
    `imageFactory` - factory for creating images
    `filename` - the name of the image file

### JimiReader

    protected JimiReader(JimiImageFactory imageFactory,
                         java.io.InputStream input)
                  throws JimiException

  Create and partially initialize a JimiReader.
  Parameters:
    `imageFactory` - factory for creating images
    `input` - stream to read image data from

### JimiReader

    protected JimiReader(JimiImageFactory imageFactory)
                  throws JimiException

  Create and partially initialize a JimiReader.
  Parameters:
    `imageFactory` - factory for creating images

Method Detail

### getNumberOfImages

    public int getNumberOfImages()

  Find out how many images are available.

### setProgressListener

    public void setProgressListener(ProgressListener listener)

  Register a ProgressListener to be informed of decoding progress.

### setMimeType

    public void setMimeType(java.lang.String typeID)
                     throws JimiException

  Set the mime-type of the format.

### initReader

    protected void initReader(JimiImageFactory imageFactory,
                              JimiDecoderFactory decoderFactory,
                              java.io.InputStream input)

  Initialize or re-initialize the reader.

### initReader

    protected void initReader(JimiImageFactory imageFactory,
                              JimiDecoderFactory decoderFactory)

  Initialize or re-initialize the reader.

### initReader

    protected void initReader(JimiImageFactory factory)

  Initialize or re-initialize the reader.

### setSource

    public void setSource(java.io.InputStream input)
                   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.
  Parameters:
    `in` - InputStream from which to read image data
  Throws:
    JimiException - is not currently thrown

### setSource

    public void setSource(java.lang.String filename)
                   throws JimiException

  Set a file as the image data source.
  Parameters:
    `filename` - the name of the file to read from

### setSource

    public void setSource(java.net.URL location)
                   throws JimiException

  Set a URL as the image data source.
  Parameters:
    `location` - the location to read from

### setBlocking

    public void setBlocking(boolean synchronous)

  Choose whether to block on image loading, i.e. operate synchronously.
  Parameters:
    `synchronous` - true if getImage-methods should block until the image is fully loaded

### getSize

    public java.awt.Dimension getSize()
                               throws JimiException

  Get the size of the first image.

### getRasterImage

    public JimiRasterImage getRasterImage()
                                   throws JimiException

  Read a single JimiRasterImage from the source.
  Returns:
    the JimiRasterImage
  Throws:
    JimiException - if an error prevents the image from being loaded

### getImageProducer

    public java.awt.image.ImageProducer getImageProducer()

  Read a single image from the source and return an ImageProducer for it.
  Returns:
    the ImageProducer
  Throws:
    JimiException - if an error prevents the image from being loaded

### getImage

    public java.awt.Image getImage()

  Reada single image from the source and return an Image representation.
  Returns:
    the Image

### getRasterImageEnumeration

    public java.util.Enumeration getRasterImageEnumeration()

  Enumerate all images stored in the file.
  Returns:
    the Enumeration of JimiRasterImages.

### getImageEnumeration

    public java.util.Enumeration getImageEnumeration()

  Enumerate all images stored in the file.
  Returns:
    the Enumeration of Images.

### getImageProducerEnumeration

    public java.util.Enumeration getImageProducerEnumeration()

  Enumerate all images stored in the file.
  Returns:
    the Enumeration of ImageProducers.

### skipNextImage

    public void skipNextImage()
                       throws JimiException

### getImageProducer

    public java.awt.image.ImageProducer getImageProducer(int n)
                                                  throws JimiException

  Get an ImageProducer for an image at a specified index in the image series. This method is not guaranteed to return corrently when referencing an image behind the reader's current index.
  Parameters:
    `n` - the index of the image to decode
  Returns:
    the ImageProducer for image number n
  Throws:
    JimiException - if an error prevents decoding

### getImage

    public java.awt.Image getImage(int n)
                            throws JimiException

  Get an Image at a specified index in the image series. This method is not guaranteed to return corrently when referencing an image behind the reader's current index.
  Parameters:
    `n` - the index of the image to decode
  Returns:
    the ImageProducer for image number n
  Throws:
    JimiException - if an error prevents decoding

### close

    public void close()

  Close the reader. This can be called to indicate that no more images will be requested. When all requested images are fully loaded, the input is closed. This is implied by single-image getting methods.

### getNextJimiImage

    protected JimiRasterImage getNextJimiImage()
                                        throws JimiException

### getNextJimiImage

    protected JimiRasterImage getNextJimiImage(boolean allowSynchronous)
                                        throws JimiException

  Get the next available image.
  Parameters:
    `allowSynchronous` - false if blocking should not be performed in this method
  Returns:
    the image
  Throws:
    JimiException - if an error prevents the image from being loaded

### getNextImageProducer

    protected java.awt.image.ImageProducer getNextImageProducer()
                                                         throws JimiException

  Get the next available ImageProducer.
  Throws:
    JimiException - if no more ImageProducers can be loaded

### getNextImage

    protected java.awt.Image getNextImage()
                                   throws JimiException

  Get the next available JimiImage.
  Throws:
    JimiException - if no more JimiImages can be loaded

### hasMoreElements

    protected boolean hasMoreElements()

  Check if more images are available.

### getNextController

    protected JimiDecodingController getNextController()

  Get the decoding controller for the next image in the series.

### getBuiltinImage

    protected java.awt.Image getBuiltinImage()

  Use the JDKs inbuilt JPEG decoder to read an image. Ensure that the image is back-ended by a JimiRasterImage.

### getBuiltinJimiImage

    protected JimiRasterImage getBuiltinJimiImage()
                                           throws JimiException

  Use the JDKs inbuilt JPEG decoder to read an image, and convert it to a JimiRasterImage.

### getBuiltinJPEG

    protected java.awt.Image getBuiltinJPEG()

  Low-level interface to builtin JPEG decoder.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD