Class ThumbsDBImageReader
java.lang.Object
javax.imageio.ImageReader
com.twelvemonkeys.imageio.ImageReaderBase
com.twelvemonkeys.imageio.plugins.thumbsdb.ThumbsDBImageReader
ThumbsDBImageReader
- Version:
- $Id: ThumbsDBImageReader.java,v 1.0 22.jan.2007 18:49:38 haku Exp$
- Author:
- Harald Kuhr, last modified by $Author: haku$
- See Also:
-
Field Summary
Fields inherited from class ImageReaderBase
imageInputFields inherited from class ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()voiddispose()intgetHeight(int pIndex) getImageTypes(int pIndex) intgetNumImages(boolean allowSearch) Default implementation that always returns1.intgetWidth(int pIndex) booleanbooleanstatic voidTest code belowread(int pIndex, ImageReadParam pParam) Reads the image data from the given input stream, and returns it as aBufferedImage.read(String pName, ImageReadParam pParam) Reads the image data from the given input stream, and returns it as aBufferedImage.protected voidResets all member variables.voidOverridessetInput, to allow easy access to the input, in case it is anImageInputStream.voidsetLoadEagerly(boolean pLoadEagerly) Instructs the reader wether it should read and cache alle thumbnails in sequence, during the first read operation.Methods inherited from class ImageReaderBase
assertInput, checkBounds, fakeAOI, fakeSubsampling, getDestination, getImageMetadata, getStreamMetadata, hasExplicitDestination, reset, showItMethods inherited from class ImageReader
abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale
-
Constructor Details
-
ThumbsDBImageReader
public ThumbsDBImageReader() -
ThumbsDBImageReader
-
-
Method Details
-
resetMembers
protected void resetMembers()Description copied from class:ImageReaderBaseResets all member variables. This method is by default invoked from:- Specified by:
resetMembersin classImageReaderBase
-
dispose
public void dispose()- Overrides:
disposein classImageReaderBase
-
isLoadEagerly
public boolean isLoadEagerly() -
setLoadEagerly
public void setLoadEagerly(boolean pLoadEagerly) Instructs the reader wether it should read and cache alle thumbnails in sequence, during the first read operation.This is useful mainly if you need to read all the thumbnails, and you need them in random order, as it requires less repositioning in the underlying stream.
- Parameters:
pLoadEagerly-trueif the reader should read all thumbs on first read
-
read
Reads the image data from the given input stream, and returns it as aBufferedImage.- Specified by:
readin classImageReader- Parameters:
pIndex- the index of the image to readpParam- additional parameters used while decoding, may benull, in which case defaults will be used- Returns:
- a
BufferedImage - Throws:
IndexOutOfBoundsException- ifpIndexis out of boundsIllegalStateException- if the input source has not been setIOException- if an error occurs during reading
-
read
Reads the image data from the given input stream, and returns it as aBufferedImage.- Parameters:
pName- the name of the image to readpParam- additional parameters used while decoding, may benull, in which case defaults will be used- Returns:
- a
BufferedImage - Throws:
FileNotFoundException- if the given file name is not found in the "Catalog" entry of theCompoundDocumentIllegalStateException- if the input source has not been setIOException- if an error occurs during reading
-
abort
public void abort()- Overrides:
abortin classImageReader
-
setInput
Description copied from class:ImageReaderBaseOverridessetInput, to allow easy access to the input, in case it is anImageInputStream.- Overrides:
setInputin classImageReaderBase- Parameters:
input- theImageInputStreamor otherObjectto use for future decoding.seekForwardOnly- iftrue, images and metadata may only be read in ascending order from this input source.ignoreMetadata- iftrue, metadata may be ignored during reads.- See Also:
-
getNumImages
Description copied from class:ImageReaderBaseDefault implementation that always returns1.- Overrides:
getNumImagesin classImageReaderBase- Parameters:
allowSearch- ignored, unless overridden- Returns:
1, unless overridden- Throws:
IOException- never, unless overridden
-
getWidth
- Specified by:
getWidthin classImageReader- Throws:
IOException
-
getHeight
- Specified by:
getHeightin classImageReader- Throws:
IOException
-
getImageTypes
- Specified by:
getImageTypesin classImageReader- Throws:
IOException
-
isPresent
-
main
-