|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.imageio.ImageReader
public abstract class ImageReader
A class for decoding images within the ImageIO framework. An ImageReader for a given format is instantiated by an ImageReaderSpi for that format. ImageReaderSpis are registered with the IIORegistry. The ImageReader API supports reading animated images that may have multiple frames; to support such images many methods take an index parameter. Images may also be read in multiple passes, where each successive pass increases the level of detail in the destination image.
Field Summary | |
---|---|
protected Locale[] |
availableLocales
All locales available for localization of warning messages, or null if localization is not supported. |
protected boolean |
ignoreMetadata
true if the input source does not require metadata to be read, false otherwise. |
protected Object |
input
An ImageInputStream from which image data is read. |
protected Locale |
locale
The current locale used to localize warning messages, or null if no locale has been set. |
protected int |
minIndex
The minimum index at which data can be read. |
protected ImageReaderSpi |
originatingProvider
The image reader SPI that instantiated this reader. |
protected List<IIOReadProgressListener> |
progressListeners
A list of installed progress listeners. |
protected boolean |
seekForwardOnly
true if this reader should only read data further ahead in the stream than its current location. |
protected List<IIOReadUpdateListener> |
updateListeners
A list of installed update listeners. |
protected List<IIOReadWarningListener> |
warningListeners
A list of installed warning listeners. |
protected List<Locale> |
warningLocales
A list of warning locales corresponding with the list of installed warning listeners. |
Constructor Summary | |
---|---|
protected |
ImageReader(ImageReaderSpi originatingProvider)
Construct an image reader. |
Method Summary | |
---|---|
void |
abort()
Request that reading be aborted. |
protected boolean |
abortRequested()
Check if the abort flag is set. |
void |
addIIOReadProgressListener(IIOReadProgressListener listener)
Install a read progress listener. |
void |
addIIOReadUpdateListener(IIOReadUpdateListener listener)
Install a read update listener. |
void |
addIIOReadWarningListener(IIOReadWarningListener listener)
Install a read warning listener. |
boolean |
canReadRaster()
Check if this reader can handle raster data. |
protected static void |
checkReadParamBandSettings(ImageReadParam param,
int numSrcBands,
int numDstBands)
Check that the given read parameters have valid source and destination band settings. |
protected void |
clearAbortRequest()
Clear the abort flag. |
protected static void |
computeRegions(ImageReadParam param,
int srcWidth,
int srcHeight,
BufferedImage image,
Rectangle srcRegion,
Rectangle destRegion)
Calcluate the source and destination regions that will be read from and written to, given image parameters and/or a destination buffered image. |
void |
dispose()
Releases any resources allocated to this object. |
float |
getAspectRatio(int imageIndex)
Returns the aspect ratio of this image, the ration of its width to its height. |
Locale[] |
getAvailableLocales()
Retrieve the available locales. |
ImageReadParam |
getDefaultReadParam()
Retrieve the default read parameters for this reader's image format. |
protected static BufferedImage |
getDestination(ImageReadParam param,
Iterator<ImageTypeSpecifier> imageTypes,
int width,
int height)
Return a suitable destination buffered image. |
String |
getFormatName()
Retrieve the format of the input source. |
abstract int |
getHeight(int imageIndex)
Get the height of the input image in pixels. |
abstract IIOMetadata |
getImageMetadata(int imageIndex)
Get the metadata associated with this image. |
IIOMetadata |
getImageMetadata(int imageIndex,
String formatName,
Set<String> nodeNames)
Get the metadata associated with this image. |
abstract Iterator<ImageTypeSpecifier> |
getImageTypes(int imageIndex)
Get an iterator over the collection of image types into which this reader can decode image data. |
Object |
getInput()
Get this reader's image input source. |
Locale |
getLocale()
Get this reader's locale. |
int |
getMinIndex()
Get the index at which the next image will be read. |
abstract int |
getNumImages(boolean allowSearch)
Return the number of images available from the image input source, not including thumbnails. |
int |
getNumThumbnails(int imageIndex)
Get the number of thumbnails associated with an image. |
ImageReaderSpi |
getOriginatingProvider()
Get the ImageReaderSpi that created this reader or null. |
ImageTypeSpecifier |
getRawImageType(int imageIndex)
Get the image type specifier that most closely represents the internal data representation used by this reader. |
protected static Rectangle |
getSourceRegion(ImageReadParam param,
int srcWidth,
int srcHeight)
Calculate a source region based on the given source image dimensions and parameters. |
abstract IIOMetadata |
getStreamMetadata()
Get the metadata associated with the image being read. |
IIOMetadata |
getStreamMetadata(String formatName,
Set<String> nodeNames)
Get the metadata associated with the image being read. |
int |
getThumbnailHeight(int imageIndex,
int thumbnailIndex)
Get the height of a thumbnail image. |
int |
getThumbnailWidth(int imageIndex,
int thumbnailIndex)
Get the width of a thumbnail image. |
int |
getTileGridXOffset(int imageIndex)
Get the X coordinate in pixels of the top-left corner of the first tile in this image. |
int |
getTileGridYOffset(int imageIndex)
Get the Y coordinate in pixels of the top-left corner of the first tile in this image. |
int |
getTileHeight(int imageIndex)
Get the height of an image tile. |
int |
getTileWidth(int imageIndex)
Get the width of an image tile. |
abstract int |
getWidth(int imageIndex)
Get the width of the input image in pixels. |
boolean |
hasThumbnails(int imageIndex)
Check whether or not the given image has thumbnails associated with it. |
boolean |
isIgnoringMetadata()
Check if this image reader ignores metadata. |
boolean |
isImageTiled(int imageIndex)
Check if the given image is sub-divided into equal-sized non-overlapping pixel rectangles. |
boolean |
isRandomAccessEasy(int imageIndex)
Check if all pixels in this image are readily accessible. |
boolean |
isSeekForwardOnly()
Check if this image reader may only seek forward within the input stream. |
protected void |
processImageComplete()
Notifies all installed read progress listeners that image loading has completed by calling their imageComplete methods. |
protected void |
processImageProgress(float percentageDone)
Notifies all installed read progress listeners that a certain percentage of the image has been loaded, by calling their imageProgress methods. |
protected void |
processImageStarted(int imageIndex)
Notifies all installed read progress listeners, by calling their imageStarted methods, that image loading has started on the given image. |
protected void |
processImageUpdate(BufferedImage image,
int minX,
int minY,
int width,
int height,
int periodX,
int periodY,
int[] bands)
Notifies all installed read update listeners, by calling their imageUpdate methods, that the set of samples has changed. |
protected void |
processPassComplete(BufferedImage image)
Notifies all installed update progress listeners, by calling their passComplete methods, that a progressive pass has completed. |
protected void |
processPassStarted(BufferedImage image,
int pass,
int minPass,
int maxPass,
int minX,
int minY,
int periodX,
int periodY,
int[] bands)
Notifies all installed read update listeners, by calling their passStarted methods, that a new pass has begun. |
protected void |
processReadAborted()
Notifies all installed read progress listeners that image loading has been aborted by calling their readAborted methods. |
protected void |
processSequenceComplete()
Notifies all installed read progress listeners, by calling their sequenceComplete methods, that a sequence of images has completed loading. |
protected void |
processSequenceStarted(int minIndex)
Notifies all installed read progress listeners, by calling their sequenceStarted methods, a sequence of images has started loading. |
protected void |
processThumbnailComplete()
Notifies all installed read progress listeners, by calling their thumbnailComplete methods, that a thumbnail has completed loading. |
protected void |
processThumbnailPassComplete(BufferedImage thumbnail)
Notifies all installed update progress listeners, by calling their thumbnailPassComplete methods, that a progressive pass has completed on a thumbnail. |
protected void |
processThumbnailPassStarted(BufferedImage thumbnail,
int pass,
int minPass,
int maxPass,
int minX,
int minY,
int periodX,
int periodY,
int[] bands)
Notifies all installed read update listeners, by calling their thumbnailPassStarted methods, that a new pass has begun. |
protected void |
processThumbnailProgress(float percentageDone)
Notifies all installed read progress listeners that a certain percentage of a thumbnail has been loaded, by calling their thumbnailProgress methods. |
protected void |
processThumbnailStarted(int imageIndex,
int thumbnailIndex)
Notifies all installed read progress listeners, by calling their imageStarted methods, that thumbnail loading has started on the given thumbnail of the given image. |
protected void |
processThumbnailUpdate(BufferedImage image,
int minX,
int minY,
int width,
int height,
int periodX,
int periodY,
int[] bands)
Notifies all installed read update listeners, by calling their thumbnailUpdate methods, that the set of samples has changed. |
protected void |
processWarningOccurred(String warning)
Notifies all installed warning listeners, by calling their warningOccurred methods, that a warning message has been raised. |
protected void |
processWarningOccurred(String baseName,
String keyword)
Notify all installed warning listeners, by calling their warningOccurred methods, that a warning message has been raised. |
BufferedImage |
read(int imageIndex)
Read the given frame all at once, using default image read parameters, and return a buffered image. |
abstract BufferedImage |
read(int imageIndex,
ImageReadParam param)
Read the given frame into a buffered image using the given read parameters. |
IIOImage |
readAll(int imageIndex,
ImageReadParam param)
Read the given frame all at once, using the given image read parameters, and return an IIOImage. |
Iterator<IIOImage> |
readAll(Iterator<? extends ImageReadParam> params)
Read all image frames all at once, using the given image read parameters iterator, and return an iterator over a collection of IIOImages. |
RenderedImage |
readAsRenderedImage(int imageIndex,
ImageReadParam param)
Read a rendered image. |
boolean |
readerSupportsThumbnails()
Check if this reader supports reading thumbnails. |
Raster |
readRaster(int imageIndex,
ImageReadParam param)
Read raw raster data. |
BufferedImage |
readThumbnail(int imageIndex,
int thumbnailIndex)
Read a thumbnail. |
BufferedImage |
readTile(int imageIndex,
int tileX,
int tileY)
Read the given tile into a buffered image. |
Raster |
readTileRaster(int imageIndex,
int tileX,
int tileY)
Read the given tile into a raster containing the raw image data. |
void |
removeAllIIOReadProgressListeners()
Uninstall all read progress listeners. |
void |
removeAllIIOReadUpdateListeners()
Uninstall all read update listeners. |
void |
removeAllIIOReadWarningListeners()
Uninstall all read warning listeners. |
void |
removeIIOReadProgressListener(IIOReadProgressListener listener)
Uninstall the given read progress listener. |
void |
removeIIOReadUpdateListener(IIOReadUpdateListener listener)
Uninstall the given read update listener. |
void |
removeIIOReadWarningListener(IIOReadWarningListener listener)
Uninstall the given read warning listener. |
void |
reset()
Reset this reader's internal state. |
void |
setInput(Object input)
Set the input source to the given object. |
void |
setInput(Object in,
boolean seekForwardOnly)
Set the input source to the given object and specify whether this reader should be allowed to read input from the data stream more than once. |
void |
setInput(Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
Set the input source to the given object, specify whether this reader should be allowed to read input from the data stream more than once, and specify whether this reader should ignore metadata in the input stream. |
void |
setLocale(Locale locale)
Set the current locale or use the default locale. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Locale[] availableLocales
protected boolean ignoreMetadata
protected Object input
protected Locale locale
protected int minIndex
protected ImageReaderSpi originatingProvider
protected List<IIOReadProgressListener> progressListeners
protected boolean seekForwardOnly
protected List<IIOReadUpdateListener> updateListeners
protected List<IIOReadWarningListener> warningListeners
protected List<Locale> warningLocales
Constructor Detail |
---|
protected ImageReader(ImageReaderSpi originatingProvider)
originatingProvider
- the provider that is constructing this
image reader, or nullMethod Detail |
---|
public void abort()
protected boolean abortRequested()
public void addIIOReadProgressListener(IIOReadProgressListener listener)
listener
- a read progress listener or nullpublic void addIIOReadUpdateListener(IIOReadUpdateListener listener)
listener
- a read update listenerpublic void addIIOReadWarningListener(IIOReadWarningListener listener)
listener
- a read warning listenerpublic boolean canReadRaster()
protected void clearAbortRequest()
public void dispose()
public float getAspectRatio(int imageIndex) throws IOException
imageIndex
- the frame index
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic Locale[] getAvailableLocales()
public ImageReadParam getDefaultReadParam()
public String getFormatName() throws IOException
IOException
- if a read error occurspublic abstract int getHeight(int imageIndex) throws IOException
imageIndex
- the frame index
IllegalStateException
- if input has not been set
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic abstract IIOMetadata getImageMetadata(int imageIndex) throws IOException
imageIndex
- the frame index
IllegalStateException
- if input has not been set
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic abstract Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IOException
imageIndex
- the frame index
IllegalStateException
- if input has not been set
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)
input
- the input source objectseekForwardOnly
- true if this reader should be allowed to
read input from the data stream more than once, false otherwiseignoreMetadata
- true if this reader should ignore metadata
associated with the input source, false otherwise
IllegalArgumentException
- if input is not a valid input
source for this reader and is not an ImageInputStreampublic void setInput(Object in, boolean seekForwardOnly)
in
- the input source objectseekForwardOnly
- true if this reader should be allowed to
read input from the data stream more than once, false otherwise
IllegalArgumentException
- if input is not a valid input
source for this reader and is not an ImageInputStreampublic void setInput(Object input)
input
- the input source object
IllegalArgumentException
- if input is not a valid input
source for this reader and is not an ImageInputStreampublic Object getInput()
public Locale getLocale()
public abstract int getNumImages(boolean allowSearch) throws IOException
allowSearch
- true if all images should be available at
once, false otherwise
IllegalStateException
- if input has not been set, or if
seekForwardOnly is true
IOException
- if a read error occurspublic int getNumThumbnails(int imageIndex) throws IOException
imageIndex
- the frame index
IOException
public ImageReaderSpi getOriginatingProvider()
public abstract IIOMetadata getStreamMetadata() throws IOException
IOException
- if a read error occurspublic int getThumbnailHeight(int imageIndex, int thumbnailIndex) throws IOException
imageIndex
- the frame indexthumbnailIndex
- the thumbnail index
UnsupportedOperationException
- if this reader does not
support thumbnails
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if either index is
out-of-bounds
IOException
- if a read error occurspublic int getThumbnailWidth(int imageIndex, int thumbnailIndex) throws IOException
imageIndex
- the frame indexthumbnailIndex
- the thumbnail index
UnsupportedOperationException
- if this reader does not
support thumbnails
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if either index is
out-of-bounds
IOException
- if a read error occurspublic int getTileGridXOffset(int imageIndex) throws IOException
imageIndex
- the frame index
IllegalStateException
- if input is needed but the input
source is not set
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic int getTileGridYOffset(int imageIndex) throws IOException
imageIndex
- the frame index
IllegalStateException
- if input is needed but the input
source is not set
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic int getTileHeight(int imageIndex) throws IOException
imageIndex
- the frame index
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic int getTileWidth(int imageIndex) throws IOException
imageIndex
- the frame index
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic abstract int getWidth(int imageIndex) throws IOException
imageIndex
- the image's index
IllegalStateException
- if input has not been set
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic boolean hasThumbnails(int imageIndex) throws IOException
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic boolean isIgnoringMetadata()
public boolean isImageTiled(int imageIndex) throws IOException
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic boolean isRandomAccessEasy(int imageIndex) throws IOException
imageIndex
- the frame index
IllegalStateException
- if input is null and it is
needed to determine the return value
IndexOutOfBoundsException
- if the frame index is
out-of-bounds but the frame data must be accessed to determine
the return value
IOException
- if a read error occurspublic boolean isSeekForwardOnly()
protected void processImageComplete()
protected void processImageProgress(float percentageDone)
percentageDone
- the percentage of image data that has been
loadedprotected void processImageStarted(int imageIndex)
imageIndex
- the frame index of the image that has started
loadingprotected void processImageUpdate(BufferedImage image, int minX, int minY, int width, int height, int periodX, int periodY, int[] bands)
image
- the buffered image that is being updatedminX
- the X coordinate of the top-left pixel in this passminY
- the Y coordinate of the top-left pixel in this passwidth
- the total width of the rectangle covered by this
pass, including skipped pixelsheight
- the total height of the rectangle covered by this
pass, including skipped pixelsperiodX
- the horizontal sample intervalperiodY
- the vertical sample intervalbands
- the affected bands in the destinationprotected void processPassComplete(BufferedImage image)
image
- the image that has being updatedprotected void processPassStarted(BufferedImage image, int pass, int minPass, int maxPass, int minX, int minY, int periodX, int periodY, int[] bands)
image
- the buffered image that is being updatedpass
- the current pass numberminPass
- the pass at which decoding will beginmaxPass
- the pass at which decoding will endminX
- the X coordinate of the top-left pixel in this passminY
- the Y coordinate of the top-left pixel in this passwidth
- the total width of the rectangle covered by this
pass, including skipped pixelsheight
- the total height of the rectangle covered by this
pass, including skipped pixelsperiodX
- the horizontal sample intervalperiodY
- the vertical sample intervalbands
- the affected bands in the destinationprotected void processReadAborted()
protected void processSequenceComplete()
protected void processSequenceStarted(int minIndex)
minIndex
- the index of the first image in the sequenceprotected void processThumbnailComplete()
protected void processThumbnailPassComplete(BufferedImage thumbnail)
thumbnail
- the thumbnail that has being updatedprotected void processThumbnailPassStarted(BufferedImage thumbnail, int pass, int minPass, int maxPass, int minX, int minY, int periodX, int periodY, int[] bands)
thumbnail
- the thumbnail that is being updatedpass
- the current pass numberminPass
- the pass at which decoding will beginmaxPass
- the pass at which decoding will endminX
- the X coordinate of the top-left pixel in this passminY
- the Y coordinate of the top-left pixel in this passwidth
- the total width of the rectangle covered by this
pass, including skipped pixelsheight
- the total height of the rectangle covered by this
pass, including skipped pixelsperiodX
- the horizontal sample intervalperiodY
- the vertical sample intervalbands
- the affected bands in the destinationprotected void processThumbnailProgress(float percentageDone)
percentageDone
- the percentage of thumbnail data that has
been loadedprotected void processThumbnailStarted(int imageIndex, int thumbnailIndex)
imageIndex
- the frame index of the image one of who's
thumbnails has started loadingthumbnailIndex
- the index of the thumbnail that has started
loadingprotected void processThumbnailUpdate(BufferedImage image, int minX, int minY, int width, int height, int periodX, int periodY, int[] bands)
image
- the buffered image that is being updatedminX
- the X coordinate of the top-left pixel in this passminY
- the Y coordinate of the top-left pixel in this passwidth
- the total width of the rectangle covered by this
pass, including skipped pixelsheight
- the total height of the rectangle covered by this
pass, including skipped pixelsperiodX
- the horizontal sample intervalperiodY
- the vertical sample intervalbands
- the affected bands in the destinationprotected void processWarningOccurred(String warning)
warning
- the warning message
IllegalArgumentException
- if warning is nullprotected void processWarningOccurred(String baseName, String keyword)
baseName
- the basename of the resource from which to
retrieve the warning messagekeyword
- the keyword used to retrieve the warning from the
resource bundle
IllegalArgumentException
- if either baseName or keyword
is null
IllegalArgumentException
- if no resource bundle is
found using baseName
IllegalArgumentException
- if the given keyword produces
no results from the resource bundle
IllegalArgumentException
- if the retrieved object is
not a Stringpublic abstract BufferedImage read(int imageIndex, ImageReadParam param) throws IOException
imageIndex
- the index of the frame to readparam
- the image read parameters to use when reading
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic boolean readerSupportsThumbnails()
public Raster readRaster(int imageIndex, ImageReadParam param) throws IOException
imageIndex
- the frame indexparam
- the image read parameters
UnsupportedOperationException
- if this reader doesn't
support rasters
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic BufferedImage readThumbnail(int imageIndex, int thumbnailIndex) throws IOException
imageIndex
- the frame indexthumbnailIndex
- the thumbnail index
UnsupportedOperationException
- if this reader doesn't
support thumbnails
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if either the frame index or
the thumbnail index is out-of-bounds
IOException
- if a read error occurspublic void removeAllIIOReadProgressListeners()
public void removeAllIIOReadUpdateListeners()
public void removeAllIIOReadWarningListeners()
public void removeIIOReadProgressListener(IIOReadProgressListener listener)
listener
- the listener to removepublic void removeIIOReadUpdateListener(IIOReadUpdateListener listener)
listener
- the listener to removepublic void removeIIOReadWarningListener(IIOReadWarningListener listener)
listener
- the listener to removepublic void setLocale(Locale locale)
locale
- the locale to set, or nullprotected static void checkReadParamBandSettings(ImageReadParam param, int numSrcBands, int numDstBands)
param
- the image parameters to checknumSrcBands
- the number of input source bandsnumDstBands
- the number of ouput destination bands
IllegalArgumentException
- if either the given source or
destination band indices are invalidprotected static void computeRegions(ImageReadParam param, int srcWidth, int srcHeight, BufferedImage image, Rectangle srcRegion, Rectangle destRegion)
param
- read parameters, or nullsrcWidth
- the width of the source imagesrcHeight
- the height of the source imageimage
- the destination image, or nullsrcRegion
- a rectangle whose values will be set to the
clipped source regiondestRegion
- a rectangle whose values will be set to the
clipped destination region
IllegalArgumentException
- if either srcRegion or
destRegion is null
IllegalArgumentException
- if either of the calculated
regions is emptyprotected static BufferedImage getDestination(ImageReadParam param, Iterator<ImageTypeSpecifier> imageTypes, int width, int height) throws IIOException
param
- image read parameters from which a destination image
or image type is retrieved, or nullimageTypes
- a collection of legal image typeswidth
- the width of the source imageheight
- the height of the source image
IIOException
- if param.getDestinationType() does not
return an image type in imageTypes
IllegalArgumentException
- if imageTypes is null or
empty, or if a non-ImageTypeSpecifier object is retrieved from
imageTypes
IllegalArgumentException
- if the resulting destination
region is empty
IllegalArgumentException
- if the product of width and
height is greater than Integer.MAX_VALUEpublic IIOMetadata getImageMetadata(int imageIndex, String formatName, Set<String> nodeNames) throws IOException
imageIndex
- the frame indexformatName
- the format of metadata requestednodeNames
- a set of Strings specifiying node names to be
retrieved
IllegalStateException
- if input has not been set
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IllegalArgumentException
- if formatName is null
IllegalArgumentException
- if nodeNames is null
IOException
- if a read error occurspublic int getMinIndex()
public ImageTypeSpecifier getRawImageType(int imageIndex) throws IOException
imageIndex
- the frame index
IllegalStateException
- if input has not been set
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occursprotected static Rectangle getSourceRegion(ImageReadParam param, int srcWidth, int srcHeight)
param
- image parameters, or nullsrcWidth
- the width of the source imagesrcHeight
- the height of the source image
public IIOMetadata getStreamMetadata(String formatName, Set<String> nodeNames) throws IOException
formatName
- the format of metadata requestednodeNames
- a set of Strings specifiying node names to be
retrieved
IllegalArgumentException
- if formatName is null
IllegalArgumentException
- if nodeNames is null
IOException
- if a read error occurspublic BufferedImage read(int imageIndex) throws IOException
imageIndex
- the index of the image frame to read
IllegalStateException
- if input has not been set
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IOException
- if a read error occurspublic IIOImage readAll(int imageIndex, ImageReadParam param) throws IOException
imageIndex
- the index of the image frame to readparam
- the image read parameters
IllegalStateException
- if input has not been set
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IllegalArgumentException
- if param.getSourceBands() and
param.getDestinationBands() are incompatible
IllegalArgumentException
- if either the source or
destination image regions are empty
IOException
- if a read error occurspublic Iterator<IIOImage> readAll(Iterator<? extends ImageReadParam> params) throws IOException
params
- iterator over the image read parameters
IllegalStateException
- if input has not been set
IllegalArgumentException
- if a non-ImageReadParam is
found in params
IllegalArgumentException
- if param.getSourceBands() and
param.getDestinationBands() are incompatible
IllegalArgumentException
- if either the source or
destination image regions are empty
IOException
- if a read error occurspublic RenderedImage readAsRenderedImage(int imageIndex, ImageReadParam param) throws IOException
imageIndex
- the index of the image frame to readparam
- the image read parameters
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IllegalArgumentException
- if param.getSourceBands() and
param.getDestinationBands() are incompatible
IllegalArgumentException
- if either the source or
destination image regions are empty
IOException
- if a read error occurspublic BufferedImage readTile(int imageIndex, int tileX, int tileY) throws IOException
imageIndex
- the frame indextileX
- the horizontal tile coordinatetileY
- the vertical tile coordinate
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IllegalArgumentException
- if the tile coordinates are
out-of-bounds
IOException
- if a read error occurspublic Raster readTileRaster(int imageIndex, int tileX, int tileY) throws IOException
imageIndex
- the frame indextileX
- the horizontal tile coordinatetileY
- the vertical tile coordinate
UnsupportedOperationException
- if rasters are not
supported
IllegalStateException
- if input is null
IndexOutOfBoundsException
- if the frame index is
out-of-bounds
IllegalArgumentException
- if the tile coordinates are
out-of-bounds
IOException
- if a read error occurspublic void reset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |