|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--ach.image.tiff.TiffImageProducer
TiffImageProducer.java
Copyright (c) 1997-2000 Helge Hackbarth, All Rights Reserved.
Provides an image producer for platform independent TIFF images.
Supports color depths of 1, 4, 8 and 24 bit. Image can be loaded
asynchronously as separate thread or synchronously in conjunction
with an EMemImageSource which will be faster for images with less
than 8 bits per pixel as packed data are stored without conversion.
THE AUTHOR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE FOR ANY
DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
| Constructor Summary | |
TiffImageProducer()
Constructor for synchronous loading of a Tiff image. |
|
TiffImageProducer(byte[] buf,
int page)
Constructor for asynchronous loading from byte array representing an image in Tiff format. |
|
TiffImageProducer(java.net.URL context,
java.lang.String name,
int page)
Constructor for asynchronous loading a Tiff image from either file or URL |
|
| Method Summary | |
void |
addConsumer(java.awt.image.ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in data for this image. |
java.lang.String |
getErrorMsg()
If image production completed with an error status the error message can be requested with this method. |
ImageInfo |
getImageInfo(java.lang.String fileName,
int page)
Get ImageInfo for a TIFF file from local file system |
static java.awt.image.ImageProducer |
getImageProducer(byte[] imgFileBA,
int page)
Retrieve an EMemImageSource (extension of an ImageProducer) for a TIFF image from a byte array. |
static java.awt.image.ImageProducer |
getImageProducer(java.lang.String name,
int page)
Retrieve an EMemImageSource (extension of an ImageProducer) for a TIFF image from a (local) file. |
static java.awt.image.ImageProducer |
getImageProducer(java.net.URL context,
int page)
Retrieve an EMemImageSource (extension of an ImageProducer) for a TIFF image from an URL. |
static java.awt.image.ImageProducer |
getImageProducer(java.net.URL context,
java.lang.String name,
int page)
Retrieve an EMemImageSource (extension of an ImageProducer) for a TIFF image from an URL or file (either the context or the name parameter must be null). |
boolean |
isConsumer(java.awt.image.ImageConsumer ic)
Determine if an ImageConsumer is on the list of consumers currently interested in data for this image. |
void |
removeConsumer(java.awt.image.ImageConsumer ic)
Remove an ImageConsumer from the list of consumers interested in data for this image. |
void |
requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order. |
static void |
reverseBitOrder(byte[] buffer,
int off,
int count)
reverse the bit order for each byte in a buffer starting from offset |
void |
run()
The TiffImageProducer is automatically started as separate thread when startProduction was called for an image consumer. |
void |
startProduction(java.awt.image.ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in data for this image, and immediately start delivery of the image data through the ImageConsumer interface. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TiffImageProducer()
public TiffImageProducer(java.net.URL context,
java.lang.String name,
int page)
context - the URL of an image (null if loaded from local file system)name - pathname if load from local file systempage - allows to load a particular page of a multi page tiff file
public TiffImageProducer(byte[] buf,
int page)
buf - an array of bytes representing the image data in Tiff formatpage - allows to load a particular page of a multi page tiff file| Method Detail |
public ImageInfo getImageInfo(java.lang.String fileName,
int page)
throws java.io.IOException,
UnknownFileFormatException
fileName - specifying the path to the TIFF filepage - allows to access a particular page for multipage TIFF files
public static void reverseBitOrder(byte[] buffer,
int off,
int count)
buffer - containing the bytes to be reversedoff - offset to start fromcount - number of bytes to be processed
public static java.awt.image.ImageProducer getImageProducer(java.net.URL context,
java.lang.String name,
int page)
throws java.awt.AWTException
context - contains the URL.name - contains the file name if loaded from local file systempage - contains page (may be > 1 for multi document images)java.awt.AWTException - on stream or bitmap data errors
public static java.awt.image.ImageProducer getImageProducer(java.lang.String name,
int page)
throws java.awt.AWTException
name - contains the file name.page - contains page (may be > 1 for multi document images)java.awt.AWTException - on stream or bitmap data errors
public static java.awt.image.ImageProducer getImageProducer(java.net.URL context,
int page)
throws java.awt.AWTException
page - contains page (may be > 1 for multi document images)java.awt.AWTException - on stream or bitmap data errors
public static java.awt.image.ImageProducer getImageProducer(byte[] imgFileBA,
int page)
throws java.awt.AWTException
imgFileBA - contains the file as byte arraypage - contains page (may be > 1 for multi document images)java.awt.AWTException - on stream or bitmap data errorspublic void addConsumer(java.awt.image.ImageConsumer ic)
addConsumer in interface java.awt.image.ImageProducerImageConsumerpublic void run()
run in interface java.lang.Runnablepublic boolean isConsumer(java.awt.image.ImageConsumer ic)
isConsumer in interface java.awt.image.ImageProducerImageConsumerpublic void removeConsumer(java.awt.image.ImageConsumer ic)
removeConsumer in interface java.awt.image.ImageProducerImageConsumerpublic void startProduction(java.awt.image.ImageConsumer ic)
startProduction in interface java.awt.image.ImageProducerImageConsumerpublic void requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
requestTopDownLeftRightResend in interface java.awt.image.ImageProducerImageConsumerpublic java.lang.String getErrorMsg()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||