|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
javax.imageio.ImageReader
public abstract class ImageReader

An abstract superclass for parsing and decoding of images. This class must be subclassed by classes that read in images in the context of the Java Image I/O framework.
ImageReader objects are normally instantiated by
the service provider interface (SPI) class for the specific format.
Service provider classes (e.g., instances of
ImageReaderSpi) are registered with the
IIORegistry, which uses them for format recognition
and presentation of available format readers and writers.
When an input source is set (using the setInput
method), it may be marked as "seek forward only". This setting
means that images contained within the input source will only be
read in order, possibly allowing the reader to avoid caching
portions of the input containing data associated with images that
have been read previously.
ImageWriter
,
IIORegistry
,
ImageReaderSpi

| Field Summary | |
|---|---|
protected Locale |
availableLocales
An array of Locales which may be used to localize
warning messages, or null if localization is not
supported. |
protected boolean |
ignoreMetadata
true if the current input source has been marked
as allowing metadata to be ignored by setInput. |
protected Object |
input
The ImageInputStream or other
Object by setInput and retrieved
by getInput. |
protected Locale |
locale
The current Locale to be used for localization, or
null if none has been set. |
protected int |
minIndex
The smallest valid index for reading, initially 0. |
protected ImageReaderSpi |
originatingProvider
The ImageReaderSpi that instantiated this object,
or null if its identity is not known or none
exists. |
protected List |
progressListeners
A List of currently registered
IIOReadProgressListeners, initialized by default
to null, which is synonymous with an empty
List. |
protected boolean |
seekForwardOnly
true if the current input source has been marked
as allowing only forward seeking by setInput. |
protected List |
updateListeners
A List of currently registered
IIOReadUpdateListeners, initialized by default to
null, which is synonymous with an empty
List. |
protected List |
warningListeners
A List of currently registered
IIOReadWarningListeners, initialized by default to
null, which is synonymous with an empty
List. |
protected List |
warningLocales
A List of the Locales associated with
each currently registered IIOReadWarningListener,
initialized by default to null, which is
synonymous with an empty List. |
| Constructor Summary | |
|---|---|
protected |
ImageReader
Constructs an ImageReader and sets its
originatingProvider field to the supplied value. |
| Method Summary | |
|---|---|
void |
abort
Requests that any current read operation be aborted. |
protected boolean |
abortRequested
Returns true if a request to abort the current
read operation has been made since the reader was instantiated or
clearAbortRequest was called. |
void |
addIIOReadProgressListener
Adds an IIOReadProgressListener to the list of
registered progress listeners. |
void |
addIIOReadUpdateListener
Adds an IIOReadUpdateListener to the list of
registered update listeners. |
void |
addIIOReadWarningListener
Adds an IIOReadWarningListener to the list of
registered warning listeners. |
boolean |
canReadRaster
Returns true if this plug-in supports reading
just a of pixel data. |
protected static void |
checkReadParamBandSettings
A utility method that may be used by readers to test the validity of the source and destination band settings of an ImageReadParam. |
protected void |
clearAbortRequest
Clears any previous abort request. |
protected static void |
computeRegions
Computes the source region of interest and the destination region of interest, taking the width and height of the source image, an optional destination image, and an optional ImageReadParam into account. |
void |
dispose
Allows any resources held by this object to be released. |
float |
getAspectRatio
Returns the aspect ratio of the given image (that is, its width divided by its height) as a float. |
Locale |
getAvailableLocales
Returns an array of Locales that may be used to
localize warning listeners and compression settings. |
ImageReadParam |
getDefaultReadParam
Returns a default ImageReadParam object
appropriate for this format. |
protected static BufferedImage |
getDestination
Returns the BufferedImage to which decoded pixel
data should be written. |
String |
getFormatName
Returns a String identifying the format of the
input source. |
abstract int |
getHeight
Returns the height in pixels of the given image within the input source. |
abstract IIOMetadata |
getImageMetadata
Returns an IIOMetadata object containing metadata
associated with the given image, or null if the
reader does not support reading metadata, is set to ignore
metadata, or if no metadata is available. |
IIOMetadata |
getImageMetadata
Returns an IIOMetadata object representing the
metadata associated with the given image, or null
if the reader does not support reading metadata or none
is available. |
abstract Iterator |
getImageTypes
Returns an Iterator containing possible image
types to which the given image may be decoded, in the form of
ImageTypeSpecifierss. |
Object |
getInput
Returns the ImageInputStream or other
Object previously set as the input source. |
Locale |
getLocale
Returns the currently set Locale, or
null if none has been set. |
int |
getMinIndex
Returns the lowest valid index for reading an image, thumbnail, or image metadata. |
abstract int |
getNumImages
Returns the number of images, not including thumbnails, available from the current input source. |
int |
getNumThumbnails
Returns the number of thumbnail preview images associated with the given image. |
ImageReaderSpi |
getOriginatingProvider
Returns the ImageReaderSpi that was passed in on
the constructor. |
ImageTypeSpecifier |
getRawImageType
Returns an ImageTypeSpecifier indicating the
SampleModel and ColorModel which most
closely represents the "raw" internal format of the image. |
protected static Rectangle |
getSourceRegion
A utility method that may be used by readers to compute the region of the source image that should be read, taking into account any source region and subsampling offset settings in the supplied ImageReadParam. |
abstract IIOMetadata |
getStreamMetadata
Returns an IIOMetadata object representing the
metadata associated with the input source as a whole (i.e., not
associated with any particular image), or null if
the reader does not support reading metadata, is set to ignore
metadata, or if no metadata is available. |
IIOMetadata |
getStreamMetadata
Returns an IIOMetadata object representing the
metadata associated with the input source as a whole (i.e.,
not associated with any particular image). |
int |
getThumbnailHeight
Returns the height of the thumbnail preview image indexed by thumbnailIndex, associated with the image indexed
by ImageIndex. |
int |
getThumbnailWidth
Returns the width of the thumbnail preview image indexed by thumbnailIndex, associated with the image indexed
by ImageIndex. |
int |
getTileGridXOffset
Returns the X coordinate of the upper-left corner of tile (0, 0) in the given image. |
int |
getTileGridYOffset
Returns the Y coordinate of the upper-left corner of tile (0, 0) in the given image. |
int |
getTileHeight
Returns the height of a tile in the given image. |
int |
getTileWidth
Returns the width of a tile in the given image. |
abstract int |
getWidth
Returns the width in pixels of the given image within the input source. |
boolean |
hasThumbnails
Returns true if the given image has thumbnail
preview images associated with it. |
boolean |
isIgnoringMetadata
Returns true if the current input source has been
marked as allowing metadata to be ignored by passing
true as the ignoreMetadata argument
to the setInput method. |
boolean |
isImageTiled
Returns true if the image is organized into
tiles, that is, equal-sized non-overlapping rectangles. |
boolean |
isRandomAccessEasy
Returns true if the storage format of the given
image places no inherent impediment on random access to pixels. |
boolean |
isSeekForwardOnly
Returns true if the current input source has been
marked as seek forward only by passing true as the
seekForwardOnly argument to the
setInput method. |
protected void |
processImageComplete
Broadcasts the completion of an image read to all registered IIOReadProgressListeners by calling their
imageComplete method. |
protected void |
processImageProgress
Broadcasts the current percentage of image completion to all registered IIOReadProgressListeners by calling
their imageProgress method. |
protected void |
processImageStarted
Broadcasts the start of an image read to all registered IIOReadProgressListeners by calling their
imageStarted method. |
protected void |
processImageUpdate
Broadcasts the update of a set of samples to all registered IIOReadUpdateListeners by calling their
imageUpdate method. |
protected void |
processPassComplete
Broadcasts the end of a progressive pass to all registered IIOReadUpdateListeners by calling their
passComplete method. |
protected void |
processPassStarted
Broadcasts the beginning of a progressive pass to all registered IIOReadUpdateListeners by calling their
passStarted method. |
protected void |
processReadAborted
Broadcasts that the read has been aborted to all registered IIOReadProgressListeners by calling their
readAborted method. |
protected void |
processSequenceComplete
Broadcasts the completion of an sequence of image reads to all registered IIOReadProgressListeners by calling
their sequenceComplete method. |
protected void |
processSequenceStarted
Broadcasts the start of an sequence of image reads to all registered IIOReadProgressListeners by calling
their sequenceStarted method. |
protected void |
processThumbnailComplete
Broadcasts the completion of a thumbnail read to all registered IIOReadProgressListeners by calling their
thumbnailComplete method. |
protected void |
processThumbnailPassComplete
Broadcasts the end of a thumbnail progressive pass to all registered IIOReadUpdateListeners by calling their
thumbnailPassComplete method. |
protected void |
processThumbnailPassStarted
Broadcasts the beginning of a thumbnail progressive pass to all registered IIOReadUpdateListeners by calling their
thumbnailPassStarted method. |
protected void |
processThumbnailProgress
Broadcasts the current percentage of thumbnail completion to all registered IIOReadProgressListeners by calling
their thumbnailProgress method. |
protected void |
processThumbnailStarted
Broadcasts the start of a thumbnail read to all registered IIOReadProgressListeners by calling their
thumbnailStarted method. |
protected void |
processThumbnailUpdate
Broadcasts the update of a set of samples in a thumbnail image to all registered IIOReadUpdateListeners by
calling their thumbnailUpdate method. |
protected void |
processWarningOccurred
Broadcasts a warning message to all registered IIOReadWarningListeners by calling their
warningOccurred method. |
protected void |
processWarningOccurred
Broadcasts a localized warning message to all registered IIOReadWarningListeners by calling their
warningOccurred method with a string taken
from a ResourceBundle. |
BufferedImage |
read
Reads the image indexed by imageIndex and returns
it as a complete BufferedImage, using a default
ImageReadParam. |
abstract BufferedImage |
read |