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, javax.imageio.spi.IIORegistry , javax.imageio.spi.ImageReaderSpi
| Modifier and Type | Field and Description |
|---|---|
| private boolean | abortFlag
If |
| protected Locale[] | availableLocales
An array of |
| protected boolean | ignoreMetadata
|
| protected Object | input
The |
| protected Locale | locale
The current |
| protected int | minIndex
The smallest valid index for reading, initially 0. |
| protected ImageReaderSpi | originatingProvider
The |
| protected List | progressListeners
A |
| protected boolean | seekForwardOnly
|
| protected List | updateListeners
A |
| protected List | warningListeners
A |
| protected List | warningLocales
A |
| Access | Constructor and Description |
|---|---|
| protected | ImageReader(ImageReaderSpi
the originatingProvider)ImageReaderSpi that is
invoking this constructor, or null.Constructs an |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| protected synchronized boolean | Returns: true if the current read operation should
be aborted.Returns |
| public void | addIIOReadProgressListener(IIOReadProgressListener
an IIOReadProgressListener to be registered. listener)Adds an |
| public void | addIIOReadUpdateListener(IIOReadUpdateListener
an IIOReadUpdateListener to be registered. listener)Adds an |
| public void | addIIOReadWarningListener(IIOReadWarningListener
an listener)IIOReadWarningListener to be registered.Adds an |
| pack-priv static <T> List | |
| public boolean | Returns: true if this plug-in supports reading raw
Rasters.Returns |
| protected static void | checkReadParamBandSettings(ImageReadParam
the param, int ImageReadParam being used to read
the image.the number of bands of the image as it exists
int the input source. numSrcBands, int the number of bands in the destination image
being written. numDstBands)A utility method that may be used by readers to test the
validity of the source and destination band settings of an
|
| protected synchronized void | |
| protected static void | computeRegions(ImageReadParam
an param, int ImageReadParam, or null.the width of the source image. srcWidth, int the height of the source image. srcHeight, BufferedImage a image, Rectangle BufferedImage that will be the
destination image, or null.a srcRegion, Rectangle Rectangle that will be filled with
the source region of interest.a destRegion)Rectangle that will be filled with
the destination region of interest.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
|
| public void | |
| public float | Returns: afloat indicating the aspect ratio of the
given image.the index of the image to be queried. imageIndex)Returns the aspect ratio of the given image (that is, its width
divided by its height) as a |
| public Locale[] | Returns: an array ofLocales that may be used as
arguments to setLocale, or null.Returns an array of |
| public ImageReadParam | Returns: anImageReadParam object which may be used
to control the decoding process using a set of default settings.Returns a default |
| protected static BufferedImage | Returns: theBufferedImage to which decoded pixel
data should be written.an param, Iterator<ImageTypeSpecifier> ImageReadParam to be used to get
the destination image or image type, or null.an imageTypes, int Iterator of
ImageTypeSpecifiers indicating the legal image
types, with the default first.the true width of the image or tile being decoded. width, int the true width of the image or tile being decoded. height)Returns the |
| public String | Returns: the format name, as aString.Returns a |
| public abstract int | Returns: the height of the image, as anint.the index of the image to be queried. imageIndex)Returns the height in pixels of the given image within the input source. |
| public abstract IIOMetadata | Returns: anIIOMetadata object, or
null.the index of the image whose metadata is to
be retrieved. imageIndex)Returns an |
| public IIOMetadata | Returns: anIIOMetadata object, or null.the index of the image whose metadata is to
be retrieved. imageIndex, String a metadata format name that may be used to retrieve
a document from the returned formatName, Set<String> IIOMetadata object.a nodeNames)Set containing the names of
nodes that may be contained in a retrieved document.Returns an |
| public abstract Iterator | Returns: anIterator containing at least one
ImageTypeSpecifier representing suggested image
types for decoding the current given image.the index of the image to be
imageIndex)retrieved.Returns an |
| public Object | Returns: theObject that will be used for future
decoding, or null.Returns the |
| public Locale | Returns: the currentLocale, or null.Returns the currently set |
| private IIOMetadata | |
| public int | Returns: the minimum legal index for reading.Returns the lowest valid index for reading an image, thumbnail, or image metadata. |
| public abstract int | Returns: the number of images, as anint, or
-1 if allowSearch is
false and a search would be required.if allowSearch)true, the true number of
images will be returned even if a search is required. If
false, the reader may return -1
without performing the search.Returns the number of images, not including thumbnails, available from the current input source. |
| public int | Returns: the number of thumbnails associated with the given image.the index of the image being queried. imageIndex)Returns the number of thumbnail preview images associated with the given image. |
| public ImageReaderSpi | Returns: anImageReaderSpi, or null.Returns the |
| public ImageTypeSpecifier | Returns: anImageTypeSpecifier.the index of the image to be queried. imageIndex)Returns an |
| protected static Rectangle | Returns: the source region as aRectangle.the param, int ImageReadParam being used, or
null.the width of the source image. srcWidth, int the height of the source image. srcHeight)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 |
| public abstract IIOMetadata | Returns: anIIOMetadata object, or null.Returns an |
| public IIOMetadata | Returns: anIIOMetadata object, or null.a metadata format name that may be used to retrieve
a document from the returned formatName, Set<String> IIOMetadata object.a nodeNames)Set containing the names of
nodes that may be contained in a retrieved document.Returns an |
| public int | Returns: the height of the desired thumbnail as anint.the index of the image to be retrieved. imageIndex, int the index of the thumbnail to be retrieved. thumbnailIndex)Returns the height of the thumbnail preview image indexed by
|
| public int | Returns: the width of the desired thumbnail as anint.the index of the image to be retrieved. imageIndex, int the index of the thumbnail to be retrieved. thumbnailIndex)Returns the width of the thumbnail preview image indexed by
|
| public int | Returns: the X offset of the tile grid.the index of the image to be queried. imageIndex)Returns the X coordinate of the upper-left corner of tile (0, 0) in the given image. |
| public int | Returns: the Y offset of the tile grid.the index of the image to be queried. imageIndex)Returns the Y coordinate of the upper-left corner of tile (0, 0) in the given image. |
| public int | Returns: the height of a tile.the index of the image to be queried. imageIndex)Returns the height of a tile in the given image. |
| public int | Returns: the width of a tile.the index of the image to be queried. imageIndex)Returns the width of a tile in the given image. |
| public abstract int | Returns: the width of the image, as anint.the index of the image to be queried. imageIndex)Returns the width in pixels of the given image within the input source. |
| public boolean | Returns: true if the given image has thumbnails.the index of the image being queried. imageIndex)Returns |
| public boolean | Returns: true if the metadata may be ignored.Returns |
| public boolean | Returns: true if the image is tiled.the index of the image to be queried. imageIndex)Returns |
| public boolean | Returns: true if reading a region of interest of
the given image is likely to be efficient.the index of the image to be queried. imageIndex)Returns |
| public boolean | Returns: true if the input source is seek forward
only.Returns |
| protected void | processImageComplete()
Broadcasts the completion of an image read to all registered
|
| protected void | processImageProgress(float
the current percentage of completion,
as a percentageDone)float.Broadcasts the current percentage of image completion to all
registered |
| protected void | processImageStarted(int
the index of the image about to be read. imageIndex)Broadcasts the start of an image read to all registered
|
| protected void | processImageUpdate(BufferedImage
the theImage, int BufferedImage being updated.the X coordinate of the upper-left pixel included
in the pass. minX, int the X coordinate of the upper-left pixel included
in the pass. minY, int the total width of the area being updated, including
pixels being skipped if width, int periodX > 1.the total height of the area being updated,
including pixels being skipped if height, int periodY > 1.the horizontal separation between pixels. periodX, int the vertical separation between pixels. periodY, int[] an array of bands)ints indicating the
set of affected bands of the destination.Broadcasts the update of a set of samples to all registered
|
| protected void | processPassComplete(BufferedImage
the theImage)BufferedImage being updated.Broadcasts the end of a progressive pass to all
registered |
| protected void | processPassStarted(BufferedImage
the theImage, int BufferedImage being updated.the index of the current pass, starting with 0. pass, int the index of the first pass that will be decoded. minPass, int the index of the last pass that will be decoded. maxPass, int the X coordinate of the upper-left pixel included
in the pass. minX, int the X coordinate of the upper-left pixel included
in the pass. minY, int the horizontal separation between pixels. periodX, int the vertical separation between pixels. periodY, int[] an array of bands)ints indicating the
set of affected bands of the destination.Broadcasts the beginning of a progressive pass to all
registered |
| protected void | processReadAborted()
Broadcasts that the read has been aborted to all registered
|
| protected void | processSequenceComplete()
Broadcasts the completion of an sequence of image reads to all
registered |
| protected void | processSequenceStarted(int
the lowest index being read. minIndex)Broadcasts the start of an sequence of image reads to all
registered |
| protected void | processThumbnailComplete()
Broadcasts the completion of a thumbnail read to all registered
|
| protected void | processThumbnailPassComplete(BufferedImage
the theThumbnail)BufferedImage thumbnail
being updated.Broadcasts the end of a thumbnail progressive pass to all
registered |
| protected void | processThumbnailPassStarted(BufferedImage
the theThumbnail, int BufferedImage thumbnail
being updated.the index of the current pass, starting with 0. pass, int the index of the first pass that will be decoded. minPass, int the index of the last pass that will be decoded. maxPass, int the X coordinate of the upper-left pixel included
in the pass. minX, int the X coordinate of the upper-left pixel included
in the pass. minY, int the horizontal separation between pixels. periodX, int the vertical separation between pixels. periodY, int[] an array of bands)ints indicating the
set of affected bands of the destination.Broadcasts the beginning of a thumbnail progressive pass to all
registered |
| protected void | processThumbnailProgress(float
the current percentage of completion,
as a percentageDone)float.Broadcasts the current percentage of thumbnail completion to
all registered |
| protected void | processThumbnailStarted(int
the index of the image associated with the
thumbnail. imageIndex, int the index of the thumbnail. thumbnailIndex)Broadcasts the start of a thumbnail read to all registered
|
| protected void | processThumbnailUpdate(BufferedImage
the theThumbnail, int BufferedImage thumbnail
being updated.the X coordinate of the upper-left pixel included
in the pass. minX, int the X coordinate of the upper-left pixel included
in the pass. minY, int the total width of the area being updated, including
pixels being skipped if width, int periodX > 1.the total height of the area being updated,
including pixels being skipped if height, int periodY > 1.the horizontal separation between pixels. periodX, int the vertical separation between pixels. periodY, int[] an array of bands)ints indicating the
set of affected bands of the destination.Broadcasts the update of a set of samples in a thumbnail image
to all registered |
| protected void | processWarningOccurred(String
the warning message to send. warning)Broadcasts a warning message to all registered
|
| protected void | processWarningOccurred(String
the base name of a set of
baseName, String ResourceBundles containing localized warning
messages.the keyword used to index the warning message
within the set of keyword)ResourceBundles.Broadcasts a localized warning message to all registered
|
| public BufferedImage | Returns: the desired portion of the image as aBufferedImage.the index of the image to be retrieved. imageIndex)Reads the image indexed by |
| public abstract BufferedImage | Returns: the desired portion of the image as aBufferedImage.the index of the image to be retrieved. imageIndex, ImageReadParam an param)ImageReadParam used to control
the reading process, or null.Reads the image indexed by |
| public IIOImage | Returns: anIIOImage containing the desired portion
of the image, a set of thumbnails, and associated image
metadata.the index of the image to be retrieved. imageIndex, ImageReadParam an param)ImageReadParam used to control
the reading process, or null.Reads the image indexed by |
| public Iterator | Returns: anIterator representing the
contents of the input source as IIOImages.an params)Iterator containing
ImageReadParam objects.Returns an |
| public RenderedImage | Returns: aRenderedImage object providing a view of
the image.the index of the image to be retrieved. imageIndex, ImageReadParam an param)ImageReadParam used to control
the reading process, or null.Returns a |
| public boolean | Returns: true if thumbnails are supported.Returns |
| public Raster | Returns: the desired portion of the image as aRaster.the index of the image to be read. imageIndex, ImageReadParam an param)ImageReadParam used to control
the reading process, or null.Returns a new |
| public BufferedImage | Returns: the desired thumbnail as aBufferedImage.the index of the image to be retrieved. imageIndex, int the index of the thumbnail to be retrieved. thumbnailIndex)Returns the thumbnail preview image indexed by
|
| public BufferedImage | Returns: the tile as aBufferedImage.the index of the image to be retrieved. imageIndex, int the column index (starting with 0) of the tile
to be retrieved. tileX, int the row index (starting with 0) of the tile
to be retrieved. tileY)Reads the tile indicated by the |
| public Raster | Returns: the tile as aRaster.the index of the image to be retrieved. imageIndex, int the column index (starting with 0) of the tile
to be retrieved. tileX, int the row index (starting with 0) of the tile
to be retrieved. tileY)Returns a new |
| public void | removeAllIIOReadProgressListeners()
Removes all currently registered
|
| public void | |
| public void | |
| pack-priv static <T> List | |
| public void | removeIIOReadProgressListener(IIOReadProgressListener
an IIOReadProgressListener to be unregistered. listener)Removes an |
| public void | removeIIOReadUpdateListener(IIOReadUpdateListener
an IIOReadUpdateListener to be unregistered. listener)Removes an |
| public void | removeIIOReadWarningListener(IIOReadWarningListener
an IIOReadWarningListener to be unregistered. listener)Removes an |
| public void | |
| public void | setInput(Object
the input, boolean ImageInputStream or other
Object to use for future decoding.if seekForwardOnly, boolean true, images and metadata
may only be read in ascending order from this input source.if ignoreMetadata)true, metadata
may be ignored during reads.Sets the input source to use to the given
|
| public void | |
| public void | |
| public void |