Class TGAImageReader
java.lang.Object
javax.imageio.ImageReader
com.twelvemonkeys.imageio.ImageReaderBase
com.twelvemonkeys.imageio.plugins.tga.TGAImageReader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TGAExtensionsprivate TGAHeaderprivate static final intMaximum plausible decoded-to-input expansion ratio for TGA, used to bound the destination allocation against the input length.Fields 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 TypeMethodDescriptionprivate RasterclipRowToRect(Raster raster, Rectangle rect, int[] bands, int xSub) private WritableRasterclipToRect(WritableRaster raster, Rectangle rect, int[] bands) intgetHeight(int imageIndex) getImageMetadata(int imageIndex) Default implementation that always returnsnull.getImageTypes(int imageIndex) intgetNumThumbnails(int imageIndex) getRawImageType(int imageIndex) intgetThumbnailHeight(int imageIndex, int thumbnailIndex) intgetThumbnailWidth(int imageIndex, int thumbnailIndex) intgetWidth(int imageIndex) booleanhasThumbnails(int imageIndex) private booleanisOriginLowerLeft(int origin) static voidread(int imageIndex, ImageReadParam param) booleanprivate static voidprivate static voidprivate voidprivate voidreadRowByte(DataInput input, int height, Rectangle srcRegion, boolean flip, int xSub, int ySub, byte[] rowDataByte, WritableRaster destChannel, Raster srcChannel, int y) private voidreadRowInt(DataInput input, int height, Rectangle srcRegion, boolean flip, int xSub, int ySub, int[] rowDataInt, WritableRaster destChannel, Raster srcChannel, int y) private voidreadRowUShort(DataInput input, int height, Rectangle srcRegion, boolean flip, int xSub, int ySub, short[] rowDataUShort, WritableRaster destChannel, Raster srcChannel, int y) readThumbnail(int imageIndex, int thumbnailIndex) private voidremoveAlpha32(byte[] rowData) protected voidResets all member variables.private static voidskipToEnd(ImageInputStream stream) Methods inherited from class ImageReaderBase
assertInput, checkBounds, dispose, fakeAOI, fakeSubsampling, getDestination, getNumImages, getStreamMetadata, hasExplicitDestination, reset, setInput, showIt, validateSourceSize, validateSourceSizeMethods inherited from class ImageReader
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getOriginatingProvider, getSourceRegion, getStreamMetadata, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, 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, readRaster, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale
-
Field Details
-
MAX_EXPANSION_RATIO
private static final int MAX_EXPANSION_RATIOMaximum plausible decoded-to-input expansion ratio for TGA, used to bound the destination allocation against the input length. TGA is uncompressed or run-length encoded; 128:1 leaves margin above RLE's maximum (~64:1 for 8-bit pixels), so no valid image is rejected.- See Also:
-
header
-
extensions
-
-
Constructor Details
-
TGAImageReader
TGAImageReader(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
-
getWidth
- Specified by:
getWidthin classImageReader- Throws:
IOException
-
getHeight
- Specified by:
getHeightin classImageReader- Throws:
IOException
-
getImageTypes
- Specified by:
getImageTypesin classImageReader- Throws:
IOException
-
getRawImageType
- Overrides:
getRawImageTypein classImageReader- Throws:
IOException
-
read
- Specified by:
readin classImageReader- Throws:
IOException
-
isOriginLowerLeft
- Throws:
IIOException
-
readRowByte
private void readRowByte(DataInput input, int height, Rectangle srcRegion, boolean flip, int xSub, int ySub, byte[] rowDataByte, WritableRaster destChannel, Raster srcChannel, int y) throws IOException - Throws:
IOException
-
removeAlpha32
private void removeAlpha32(byte[] rowData) -
readRowUShort
private void readRowUShort(DataInput input, int height, Rectangle srcRegion, boolean flip, int xSub, int ySub, short[] rowDataUShort, WritableRaster destChannel, Raster srcChannel, int y) throws IOException - Throws:
IOException
-
readRowInt
private void readRowInt(DataInput input, int height, Rectangle srcRegion, boolean flip, int xSub, int ySub, int[] rowDataInt, WritableRaster destChannel, Raster srcChannel, int y) throws IOException - Throws:
IOException
-
readFully
- Throws:
IOException
-
readFully
- Throws:
IOException
-
clipRowToRect
-
clipToRect
-
readHeader
- Throws:
IOException
-
skipToEnd
- Throws:
IOException
-
readerSupportsThumbnails
public boolean readerSupportsThumbnails()- Overrides:
readerSupportsThumbnailsin classImageReader
-
hasThumbnails
- Overrides:
hasThumbnailsin classImageReader- Throws:
IOException
-
getNumThumbnails
- Overrides:
getNumThumbnailsin classImageReader- Throws:
IOException
-
getThumbnailWidth
- Overrides:
getThumbnailWidthin classImageReader- Throws:
IOException
-
getThumbnailHeight
- Overrides:
getThumbnailHeightin classImageReader- Throws:
IOException
-
readThumbnail
- Overrides:
readThumbnailin classImageReader- Throws:
IOException
-
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
-