jwo.utils.gui
Class TargaReader

java.lang.Object
  extended byjwo.utils.gui.TargaReader

public class TargaReader
extends Object

Reads Targa (.tga) image files and creates Java Image objects from them. Only applies to uncompressed 24 or 32 bit files.

Version:
2.2, 7th August, 2003.
Author:
Ben Stahl, modified by Jo Wood.

Constructor Summary
TargaReader(File tgaFile)
          Reads the given targa file and stores the resulting image.
TargaReader(String tgaFilename)
          Reads the given targa file and stores the resulting image.
 
Method Summary
 Image getImage()
          Creates and reports the image as an Image object.
 Dimension getSize()
          Reports the size of the image.
 Image getThumbnail(int maxSize, boolean doSmoothing)
          Creates an image with the given maximum dimension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TargaReader

public TargaReader(String tgaFilename)
Reads the given targa file and stores the resulting image.

Parameters:
tgaFilename - Name of targa file to read.

TargaReader

public TargaReader(File tgaFile)
Reads the given targa file and stores the resulting image.

Parameters:
tgaFile - Targa file to read.
Method Detail

getImage

public Image getImage()
Creates and reports the image as an Image object.

Returns:
Image represented by the targa file.

getThumbnail

public Image getThumbnail(int maxSize,
                          boolean doSmoothing)
Creates an image with the given maximum dimension. The resampling required to do this can be optionally smoothed.

Parameters:
maxSize - Maximum dimension of the image.
doSmoothing - Image will be smoothed if true and image needs to be resampled.

getSize

public Dimension getSize()
Reports the size of the image.

Returns:
Size of image represented by the targa file.


Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005