Class PNMImageReader
java.lang.Object
javax.imageio.ImageReader
com.twelvemonkeys.imageio.ImageReaderBase
com.twelvemonkeys.imageio.plugins.pnm.PNMImageReader
-
Field Summary
FieldsFields 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 TypeMethodDescription(package private) static StringasASCII(short type) private RasterclipRowToRect(Raster raster, Rectangle rect, int[] bands, int xSub) private WritableRasterclipToRect(WritableRaster raster, Rectangle rect, int[] bands) private int[]createBandOffsets(int numBands) intgetHeight(int imageIndex) getImageMetadata(int imageIndex) Default implementation that always returnsnull.getImageTypes(int imageIndex) getRawImageType(int imageIndex) intgetWidth(int imageIndex) static voidprivate voidnormalize(byte[] rowData, int start, int length) private voidnormalize(float[] rowData) private voidnormalize(short[] rowData) read(int imageIndex, ImageReadParam param) private static voidprivate static voidprivate voidprivate voidreadRowByte(WritableRaster destRaster, Raster rowRaster, byte[] rowDataByte, int bitsPerSample, int samplesPerPixel, DataInput input, int y, Rectangle srcRegion, int xSub, int ySub) private voidreadRowFloat(WritableRaster destRaster, Raster rowRaster, float[] rowDataFloat, int samplesPerPixel, DataInput input, int y, Rectangle srcRegion, int xSub, int ySub) private voidreadRowUShort(WritableRaster destRaster, Raster rowRaster, short[] rowDataUShort, int samplesPerPixel, DataInput input, int y, Rectangle srcRegion, int xSub, int ySub) protected voidResets all member variables.private DataInputMethods inherited from class ImageReaderBase
assertInput, checkBounds, dispose, fakeAOI, fakeSubsampling, getDestination, getNumImages, getStreamMetadata, hasExplicitDestination, reset, setInput, showItMethods inherited from class ImageReader
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, 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
-
Field Details
-
header
-
-
Constructor Details
-
PNMImageReader
PNMImageReader(ImageReaderSpi provider)
-
-
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
-
readHeader
- Throws:
IOException
-
asASCII
-
getWidth
- Specified by:
getWidthin classImageReader- Throws:
IOException
-
getHeight
- Specified by:
getHeightin classImageReader- Throws:
IOException
-
getRawImageType
- Overrides:
getRawImageTypein classImageReader- Throws:
IOException
-
createBandOffsets
private int[] createBandOffsets(int numBands) -
getImageTypes
- Specified by:
getImageTypesin classImageReader- Throws:
IOException
-
read
- Specified by:
readin classImageReader- Throws:
IOException
-
wrapInput
- Throws:
IIOException
-
clipRowToRect
-
clipToRect
-
readRowByte
private void readRowByte(WritableRaster destRaster, Raster rowRaster, byte[] rowDataByte, int bitsPerSample, int samplesPerPixel, DataInput input, int y, Rectangle srcRegion, int xSub, int ySub) throws IOException - Throws:
IOException
-
readRowUShort
private void readRowUShort(WritableRaster destRaster, Raster rowRaster, short[] rowDataUShort, int samplesPerPixel, DataInput input, int y, Rectangle srcRegion, int xSub, int ySub) throws IOException - Throws:
IOException
-
readRowFloat
private void readRowFloat(WritableRaster destRaster, Raster rowRaster, float[] rowDataFloat, int samplesPerPixel, DataInput input, int y, Rectangle srcRegion, int xSub, int ySub) throws IOException - Throws:
IOException
-
readFully
- Throws:
IOException
-
readFully
- Throws:
IOException
-
normalize
private void normalize(byte[] rowData, int start, int length) -
normalize
private void normalize(short[] rowData) -
normalize
private void normalize(float[] rowData) -
getImageMetadata
Description copied from class:ImageReaderBaseDefault implementation that always returnsnull.- Overrides:
getImageMetadatain classImageReaderBase- Parameters:
imageIndex- ignored, unless overridden- Returns:
null, unless overridden- Throws:
IOException- never, unless overridden.
-
main
- Throws:
IOException
-