public abstract class BaseImageReader extends ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
Modifier | Constructor and Description |
---|---|
protected |
BaseImageReader(ImageReaderSpi originatingProvider) |
Modifier and Type | Method and Description |
---|---|
void |
createBufferedImage()
Creates a BufferedImage from the image, based on a parsed internal representation.
|
int |
getHeight()
Returns the height of the image in pixels.
|
int |
getHeight(int imageIndex) |
BufferedImage |
getImage()
Returns the BufferedImage that has been created from this ImageReader.
|
IIOMetadata |
getImageMetadata(int imageIndex) |
Iterator<ImageTypeSpecifier> |
getImageTypes(int imageIndex) |
int |
getNumImages(boolean allowSearch) |
IIOMetadata |
getStreamMetadata() |
int |
getWidth()
Returns the width of the image in pixels.
|
int |
getWidth(int imageIndex) |
protected abstract void |
parse()
Parses the image from the internal buffer, to an internal representation.
|
void |
processFile()
Reads and parses a file, and stores a BufferedImage; this is the method
you will use most often.
|
BufferedImage |
read(int imageIndex,
ImageReadParam ignored) |
void |
readFile(File file)
Reads the image from a file, and stores it in an internal buffer.
|
void |
readFile(ImageInputStream iis)
Reads the image from an ImageInputStream into an internal buffer.
|
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, dispose, getAspectRatio, getAvailableLocales, getDefaultReadParam, getDestination, 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, reset, setInput, setInput, setInput, setLocale
protected BaseImageReader(ImageReaderSpi originatingProvider)
protected abstract void parse() throws IllegalDataException
IllegalDataException
- If parsing cannot be completed due to illegal data.public BufferedImage getImage()
public void processFile() throws IllegalDataException, UnsupportedVariantException
IllegalDataException
- If illegal data is encountered.UnsupportedVariantException
- If an unsupported variant of the image
format is encountered.public int getNumImages(boolean allowSearch) throws IOException
getNumImages
in class ImageReader
IOException
public int getWidth(int imageIndex) throws IOException
getWidth
in class ImageReader
IOException
public int getHeight(int imageIndex) throws IOException
getHeight
in class ImageReader
IOException
public int getWidth()
public int getHeight()
public void readFile(File file)
file
- The file to be read.public void createBufferedImage()
public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IOException
getImageTypes
in class ImageReader
IOException
public IIOMetadata getStreamMetadata() throws IOException
getStreamMetadata
in class ImageReader
IOException
public IIOMetadata getImageMetadata(int imageIndex) throws IOException
getImageMetadata
in class ImageReader
IOException
public BufferedImage read(int imageIndex, ImageReadParam ignored)
read
in class ImageReader
public void readFile(ImageInputStream iis)
iis
- The ImageInputStream to be read.Copyright © 2020. All rights reserved.