import java.io.*;
import java.awt.image.*;

public class TgaIOwidget {
	
	
	public static String writeTGAFile( String outputFileName, BufferedImage bi ) {
		
		try {
			BufferedWriter out = new BufferedWriter(new FileWriter("outfilename"));
			out.write("aString");
			out.close();
		} catch (IOException e) {
			System.out.println(e);
		}
	}
	
	protected static writeHeader( BufferedWriter out, BufferedImage bi ) throws IOException{
		 // Fill in the header structure
		TargaHead h;
		h.imageType = (nBands == 1) ? TargaRawBW : TargaRawRGB;
		// TODO:  is TargaRawBW the right thing, or only binary?
		h.width     = bi.width;
		h.height    = bi.height;
		h.pixelSize = 8 * nBands;
		
	}
	
	protected class TargaHead {
		byte idLength;		// number of chars in identification field
		byte colorMapType;	// color map type
		byte imageType;		// image type code
		byte cMapOrigin[2];	// color map origin
		byte cMapLength[2];	// color map length
		byte cMapBits;		// color map entry size
		short x0;		// x-origin of image
		short y0;		// y-origin of image
		short width;		// width of image
		short height;		// height of image
		byte pixelSize;		// image pixel size
		byte descriptor;	// image descriptor byte
	}
}
