|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jimi.core.JimiReader
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 |
public static final int UNKNOWN
protected static final int STREAM_BUFFER_SIZE
protected JimiDecoderFactory decoderFactory
protected JimiDecoder decoder
protected JimiImageFactory imageFactory
protected java.io.InputStream input
protected JimiRasterImage cacheJimiImage
protected java.awt.image.ImageProducer cacheImageProducer
protected java.awt.Image cacheImage
protected int cacheIndex
protected int seriesIndex
protected ImageSeriesDecodingController series
protected boolean synchronous
protected boolean builtinJPEG
protected java.awt.image.ImageProducer jpegProducer
protected java.net.URL location
protected java.lang.String filename
protected ProgressListener listener
protected java.lang.Runnable cleanupCommand
Constructor Detail |
protected JimiReader(JimiImageFactory imageFactory, JimiDecoderFactory decoderFactory, java.io.InputStream input) throws JimiException
imageFactory
- factory for creating imagesdecoderFactory
- factory for creating the decoderinput
- stream to read image data fromprotected JimiReader(JimiImageFactory imageFactory, java.io.InputStream input, java.lang.String typeID) throws JimiException
imageFactory
- factory for creating imagesinput
- stream to read image data fromtypeID
- the mimetype of the image formatprotected JimiReader(JimiImageFactory factory, java.lang.String filename, java.lang.String typeID) throws JimiException
imageFactory
- factory for creating imagesfilename
- the name of the image filetypeID
- the mimetype of the image formatprotected JimiReader(JimiImageFactory imageFactory, java.net.URL location) throws JimiException
imageFactory
- factory for creating imageslocation
- the URL of the image fileprotected JimiReader(JimiImageFactory imageFactory, java.net.URL location, java.lang.String typeID) throws JimiException
imageFactory
- factory for creating imageslocation
- the URL of the image filetypeID
- the mimetype of the image formatprotected JimiReader(JimiImageFactory imageFactory, java.lang.String filename) throws JimiException
imageFactory
- factory for creating imagesfilename
- the name of the image fileprotected JimiReader(JimiImageFactory imageFactory, java.io.InputStream input) throws JimiException
imageFactory
- factory for creating imagesinput
- stream to read image data fromprotected JimiReader(JimiImageFactory imageFactory) throws JimiException
imageFactory
- factory for creating imagesMethod Detail |
public int getNumberOfImages()
public void setProgressListener(ProgressListener listener)
public void setMimeType(java.lang.String typeID) throws JimiException
protected void initReader(JimiImageFactory imageFactory, JimiDecoderFactory decoderFactory, java.io.InputStream input)
protected void initReader(JimiImageFactory imageFactory, JimiDecoderFactory decoderFactory)
protected void initReader(JimiImageFactory factory)
public void setSource(java.io.InputStream input) throws JimiException
in
- InputStream from which to read image datapublic void setSource(java.lang.String filename) throws JimiException
filename
- the name of the file to read frompublic void setSource(java.net.URL location) throws JimiException
location
- the location to read frompublic void setBlocking(boolean synchronous)
synchronous
- true if getImage-methods should block until the image
is fully loadedpublic java.awt.Dimension getSize() throws JimiException
public JimiRasterImage getRasterImage() throws JimiException
public java.awt.image.ImageProducer getImageProducer()
public java.awt.Image getImage()
public java.util.Enumeration getRasterImageEnumeration()
public java.util.Enumeration getImageEnumeration()
public java.util.Enumeration getImageProducerEnumeration()
public void skipNextImage() throws JimiException
public java.awt.image.ImageProducer getImageProducer(int n) throws JimiException
n
- the index of the image to decodepublic java.awt.Image getImage(int n) throws JimiException
n
- the index of the image to decodepublic void close()
protected JimiRasterImage getNextJimiImage() throws JimiException
protected JimiRasterImage getNextJimiImage(boolean allowSynchronous) throws JimiException
allowSynchronous
- false if blocking should not be performed in this methodprotected java.awt.image.ImageProducer getNextImageProducer() throws JimiException
protected java.awt.Image getNextImage() throws JimiException
protected boolean hasMoreElements()
protected JimiDecodingController getNextController()
protected java.awt.Image getBuiltinImage()
protected JimiRasterImage getBuiltinJimiImage() throws JimiException
protected java.awt.Image getBuiltinJPEG()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |