core.io
Class ImageIO

java.lang.Object
  extended bycore.io.ImageIO

public class ImageIO
extends java.lang.Object

Writes an RGBImage to a file. This is a static class. Available file formats are: TIFF: Tagged Image File Format; TGA: Truevision (Targa); MonoTGA: gray-scale Truevision (Targa); Raw: Raw RGB pixel data; RawX: Raw RGB pixel data, 4-pixel horizontal interleaving;

Version:
1.0
Author:
Andreas Sundquist

Field Summary
private static byte[] bytes
           
private static java.io.FileOutputStream file
           
private static java.io.FileInputStream ifile
           
private static boolean reversebytes
           
 
Constructor Summary
ImageIO()
           
 
Method Summary
private static int i(byte b)
           
private static byte ReadByte()
           
private static int ReadDword()
           
static RGBImage ReadTIFF(java.lang.String filename)
          Reads 'filename' as a TIFF file and creates an RGBImage object that represents its contents.
private static int ReadWord()
           
private static void WriteBGR(byte r, byte g, byte b)
           
private static void WriteByte(int x)
           
private static void WriteDword(int x)
           
static void WriteMonoTGA(RGBImage image, java.lang.String filename)
          Writes a MonoTGA file representing 'image' to 'filename' The RGB components are mixed together in (50%, 35%, 15%) proportions
static void WriteRawRGB(RGBImage image, java.lang.String filename)
          Writes a Raw file representing 'image' to 'filename' The pixels are written in RGB, left-right, top-down order
static void WriteRawX(RGBImage image, java.lang.String filename)
          Writes a RawX file representing 'image' to 'filename' The pixels are written in RGB, left-right, top-down, 4-interleaved order
private static void WriteRGB(byte r, byte g, byte b)
           
static void WriteTGA(RGBImage image, java.lang.String filename)
          Writes a TGA file represneting 'image' to 'filename'
static void WriteTIFF(RGBImage image, java.lang.String filename)
          Writes a TIFF file representing 'image' to 'filename'
private static void WriteTIFFEntry(int tag, int type, int count, int data)
           
private static void WriteWord(int x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private static java.io.FileOutputStream file

ifile

private static java.io.FileInputStream ifile

bytes

private static byte[] bytes

reversebytes

private static boolean reversebytes
Constructor Detail

ImageIO

public ImageIO()
Method Detail

WriteTIFF

public static void WriteTIFF(RGBImage image,
                             java.lang.String filename)
Writes a TIFF file representing 'image' to 'filename'


ReadTIFF

public static RGBImage ReadTIFF(java.lang.String filename)
Reads 'filename' as a TIFF file and creates an RGBImage object that represents its contents. Note that this is NOT a full TIFF reader implementation, and only works with uncompressed 24-bit images.


WriteRawRGB

public static void WriteRawRGB(RGBImage image,
                               java.lang.String filename)
Writes a Raw file representing 'image' to 'filename' The pixels are written in RGB, left-right, top-down order


WriteRawX

public static void WriteRawX(RGBImage image,
                             java.lang.String filename)
Writes a RawX file representing 'image' to 'filename' The pixels are written in RGB, left-right, top-down, 4-interleaved order


WriteMonoTGA

public static void WriteMonoTGA(RGBImage image,
                                java.lang.String filename)
Writes a MonoTGA file representing 'image' to 'filename' The RGB components are mixed together in (50%, 35%, 15%) proportions


WriteTGA

public static void WriteTGA(RGBImage image,
                            java.lang.String filename)
Writes a TGA file represneting 'image' to 'filename'


i

private static int i(byte b)

WriteByte

private static void WriteByte(int x)
                       throws java.io.IOException
Throws:
java.io.IOException

ReadByte

private static byte ReadByte()
                      throws java.io.IOException
Throws:
java.io.IOException

WriteWord

private static void WriteWord(int x)
                       throws java.io.IOException
Throws:
java.io.IOException

ReadWord

private static int ReadWord()
                     throws java.io.IOException
Throws:
java.io.IOException

WriteDword

private static void WriteDword(int x)
                        throws java.io.IOException
Throws:
java.io.IOException

ReadDword

private static int ReadDword()
                      throws java.io.IOException
Throws:
java.io.IOException

WriteRGB

private static void WriteRGB(byte r,
                             byte g,
                             byte b)
                      throws java.io.IOException
Throws:
java.io.IOException

WriteBGR

private static void WriteBGR(byte r,
                             byte g,
                             byte b)
                      throws java.io.IOException
Throws:
java.io.IOException

WriteTIFFEntry

private static void WriteTIFFEntry(int tag,
                                   int type,
                                   int count,
                                   int data)
                            throws java.io.IOException
Throws:
java.io.IOException