Class PNMImageReader
java.lang.Object
javax.imageio.ImageReader
com.twelvemonkeys.imageio.ImageReaderBase
com.twelvemonkeys.imageio.plugins.pnm.PNMImageReader
-
Field Summary
FieldsFields inherited from class com.twelvemonkeys.imageio.ImageReaderBase
imageInput
Fields inherited from class javax.imageio.ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static String
asASCII
(short type) private Raster
clipRowToRect
(Raster raster, Rectangle rect, int[] bands, int xSub) private WritableRaster
clipToRect
(WritableRaster raster, Rectangle rect, int[] bands) private int[]
createBandOffsets
(int numBands) int
getHeight
(int imageIndex) getImageMetadata
(int imageIndex) Default implementation that always returnsnull
.getImageTypes
(int imageIndex) getRawImageType
(int imageIndex) int
getWidth
(int imageIndex) static void
private void
normalize
(byte[] rowData, int start, int length) private void
normalize
(float[] rowData) private void
normalize
(short[] rowData) read
(int imageIndex, ImageReadParam param) private static void
private static void
private void
private void
readRowByte
(WritableRaster destRaster, Raster rowRaster, byte[] rowDataByte, int bitsPerSample, int samplesPerPixel, DataInput input, int y, Rectangle srcRegion, int xSub, int ySub) private void
readRowFloat
(WritableRaster destRaster, Raster rowRaster, float[] rowDataFloat, int samplesPerPixel, DataInput input, int y, Rectangle srcRegion, int xSub, int ySub) private void
readRowUShort
(WritableRaster destRaster, Raster rowRaster, short[] rowDataUShort, int samplesPerPixel, DataInput input, int y, Rectangle srcRegion, int xSub, int ySub) protected void
Resets all member variables.private DataInput
Methods inherited from class com.twelvemonkeys.imageio.ImageReaderBase
assertInput, checkBounds, dispose, fakeAOI, fakeSubsampling, getDestination, getNumImages, getStreamMetadata, hasExplicitDestination, reset, setInput, showIt
Methods inherited from class javax.imageio.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:ImageReaderBase
Resets all member variables. This method is by default invoked from:- Specified by:
resetMembers
in classImageReaderBase
-
readHeader
- Throws:
IOException
-
asASCII
-
getWidth
- Specified by:
getWidth
in classImageReader
- Throws:
IOException
-
getHeight
- Specified by:
getHeight
in classImageReader
- Throws:
IOException
-
getRawImageType
- Overrides:
getRawImageType
in classImageReader
- Throws:
IOException
-
createBandOffsets
private int[] createBandOffsets(int numBands) -
getImageTypes
- Specified by:
getImageTypes
in classImageReader
- Throws:
IOException
-
read
- Specified by:
read
in 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:ImageReaderBase
Default implementation that always returnsnull
.- Overrides:
getImageMetadata
in classImageReaderBase
- Parameters:
imageIndex
- ignored, unless overridden- Returns:
null
, unless overridden- Throws:
IOException
- never, unless overridden.
-
main
- Throws:
IOException
-