public class PNMImageReader extends ImageReader
PNMImageReadParam
.Modifier and Type | Field and Description |
---|---|
private String |
aLine |
private boolean |
gotHeader
Indicates whether the header is read.
|
private int |
height
The original image height.
|
private ImageInputStream |
iis
The input stream where reads from
|
private long |
imageDataOffset
The stream position where the image data starts.
|
private static int |
LINE_FEED |
private static byte[] |
lineSeparator |
private int |
maxValue
Maximum pixel value.
|
private PNMMetadata |
metadata |
private static int |
PBM_ASCII |
private static int |
PBM_RAW |
private static int |
PGM_ASCII |
private static int |
PGM_RAW |
private static int |
PPM_ASCII |
private static int |
PPM_RAW |
private StringTokenizer |
token |
private int |
variant
File variant: PBM/PGM/PPM, ASCII/RAW.
|
private int |
width
The original image width.
|
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
Constructor and Description |
---|
PNMImageReader(ImageReaderSpi originator)
Constructs
PNMImageReader from the provided
ImageReaderSpi . |
Modifier and Type | Method and Description |
---|---|
boolean |
canReadRaster() |
private void |
checkIndex(int imageIndex) |
ImageReadParam |
getDefaultReadParam() |
int |
getHeight(int imageIndex) |
IIOMetadata |
getImageMetadata(int imageIndex) |
Iterator |
getImageTypes(int imageIndex) |
int |
getMaxValue() |
int |
getNumImages(boolean allowSearch)
Overrides the method defined in the superclass.
|
IIOMetadata |
getStreamMetadata() |
int |
getVariant() |
int |
getWidth(int imageIndex) |
boolean |
isRandomAccessEasy(int imageIndex) |
private boolean |
isRaw(int v)
Returns true if file variant is raw format, false if ASCII.
|
BufferedImage |
read(int imageIndex,
ImageReadParam param) |
private void |
readComments(ImageInputStream stream,
PNMMetadata metadata)
Reads the comments.
|
void |
readHeader() |
private int |
readInteger(ImageInputStream stream)
Reads the next integer.
|
Raster |
readRaster(int imageIndex,
ImageReadParam param) |
void |
reset() |
void |
setInput(Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
Overrides the method defined in the superclass.
|
private void |
skipInteger(ImageInputStream stream,
int num) |
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, checkReadParamBandSettings, clearAbortRequest, computeRegions, dispose, getAspectRatio, getAvailableLocales, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale
private static final int PBM_ASCII
private static final int PGM_ASCII
private static final int PPM_ASCII
private static final int PBM_RAW
private static final int PGM_RAW
private static final int PPM_RAW
private static final int LINE_FEED
private static byte[] lineSeparator
private int variant
private int maxValue
private ImageInputStream iis
private boolean gotHeader
private long imageDataOffset
private int width
private int height
private String aLine
private StringTokenizer token
private PNMMetadata metadata
public PNMImageReader(ImageReaderSpi originator)
PNMImageReader
from the provided
ImageReaderSpi
.public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)
setInput
in class ImageReader
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 getVariant()
public int getMaxValue()
private void checkIndex(int imageIndex)
public void readHeader() throws IOException
IOException
public Iterator getImageTypes(int imageIndex) throws IOException
getImageTypes
in class ImageReader
IOException
public ImageReadParam getDefaultReadParam()
getDefaultReadParam
in class ImageReader
public IIOMetadata getImageMetadata(int imageIndex) throws IOException
getImageMetadata
in class ImageReader
IOException
public IIOMetadata getStreamMetadata() throws IOException
getStreamMetadata
in class ImageReader
IOException
public boolean isRandomAccessEasy(int imageIndex) throws IOException
isRandomAccessEasy
in class ImageReader
IOException
public BufferedImage read(int imageIndex, ImageReadParam param) throws IOException
read
in class ImageReader
IOException
public boolean canReadRaster()
canReadRaster
in class ImageReader
public Raster readRaster(int imageIndex, ImageReadParam param) throws IOException
readRaster
in class ImageReader
IOException
public void reset()
reset
in class ImageReader
private boolean isRaw(int v)
private void readComments(ImageInputStream stream, PNMMetadata metadata) throws IOException
IOException
private int readInteger(ImageInputStream stream) throws IOException
IOException
private void skipInteger(ImageInputStream stream, int num) throws IOException
IOException
Copyright © 2016 Open Microscopy Environment