public class TGAReader extends ImageReader implements JImageReader
Reader for Targa Truevision (.tga) images.
Most TGA variants are supported. Exceptions include 8-bit color mapped images
Modifier and Type | Field and Description |
---|---|
static int |
COLORMAP_NONE |
static int |
COLORMAP_PRESENT |
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
Constructor and Description |
---|
TGAReader() |
TGAReader(ImageReaderSpi originatingProvider) |
TGAReader(String string) |
Modifier and Type | Method and Description |
---|---|
static boolean |
canReadImage(ImageInputStream iis) |
void |
createBufferedImage()
Creates a BufferedImage from the TGA image.
|
void |
exportImage(BufferedImage image,
String fileName)
Exports a (currently monochrome) TGA image.
|
int |
getHeight()
Returns the image's height.
|
int |
getHeight(int imageIndex) |
BufferedImage |
getImage()
Returns the image that the reader has imported.
|
IIOMetadata |
getImageMetadata(int imageIndex) |
Iterator<ImageTypeSpecifier> |
getImageTypes(int image) |
Map<String,String> |
getMetadata() |
String |
getMetadataSummary()
Returns a summary of the image's metadata.
|
int |
getNumImages(boolean whatever) |
IIOMetadata |
getStreamMetadata() |
int |
getWidth()
Returns the image's width.
|
int |
getWidth(int imageIndex) |
void |
parse() |
void |
processFile()
Processes the file supplied at initialization, and stores the image in the reader.
|
BufferedImage |
read(int imageIndex,
ImageReadParam ignored) |
void |
readFile() |
void |
readFile(ImageInputStream iis)
Reads the TGA file into the buffer.
|
String |
toString() |
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
public static final int COLORMAP_NONE
public static final int COLORMAP_PRESENT
public TGAReader()
public TGAReader(ImageReaderSpi originatingProvider)
public TGAReader(String string)
public void processFile() throws IllegalDataException, UnsupportedVariantException
JImageReader
processFile
in interface JImageReader
IllegalDataException
- If the data is not valid for this type of reader.UnsupportedVariantException
- If the supplied file is a variant of the reader's format that is not supported.public void readFile()
public void readFile(ImageInputStream iis)
iis
- The ImageInputStream to readpublic void parse() throws IllegalDataException, UnsupportedVariantException
public void createBufferedImage()
public BufferedImage getImage()
JImageReader
getImage
in interface JImageReader
public int getWidth()
JImageReader
getWidth
in interface JImageReader
public int getHeight()
JImageReader
getHeight
in interface JImageReader
public String getMetadataSummary()
JImageReader
getMetadataSummary
in interface JImageReader
public void exportImage(BufferedImage image, String fileName)
image
- The image to be exported.fileName
- The name of the file, as it should be written to disk.public BufferedImage read(int imageIndex, ImageReadParam ignored)
read
in class ImageReader
public IIOMetadata getImageMetadata(int imageIndex)
getImageMetadata
in class ImageReader
public IIOMetadata getStreamMetadata()
getStreamMetadata
in class ImageReader
public Iterator<ImageTypeSpecifier> getImageTypes(int image)
getImageTypes
in class ImageReader
public int getHeight(int imageIndex)
getHeight
in class ImageReader
public int getWidth(int imageIndex)
getWidth
in class ImageReader
public int getNumImages(boolean whatever)
getNumImages
in class ImageReader
public static boolean canReadImage(ImageInputStream iis)
Copyright © 2020. All rights reserved.