Rings
Version 0.3

threeD.io
Class FileEncoder

java.lang.Object
  extended bythreeD.io.FileEncoder

public class FileEncoder
extends java.lang.Object

The FileEncoder class provides static methods for encoding Scene and Surface objects and storing them in local files.


Field Summary
static int JPEGEncoding
          The integer code for a JPEG image encoding.
static int PIXEncoding
          The integer code for a PIX image encoding.
static int PPMEncoding
          The integer code for a PPM image encoding.
static int XMLEncoding
          The integer code for an XML encoding.
 
Constructor Summary
FileEncoder()
           
 
Method Summary
static void encodeImageFile(RGB[][] image, java.io.File file, int encoding)
          Encodes the image represented by the specified RGB array using the encoding specified by the integer encoding code and saves the encoded data in the file represented by the specified File object.
static void encodeSceneFile(Scene scene, java.io.File file, int encoding)
          Encodes the specified Scene object using the encoding specified by the integer encoding code and saves the encoded data in the file represented by the specified File object.
static void encodeSurfaceFile(Surface surface, java.io.File file, int encoding)
          Encodes the specified Surface object using the encoding specified by the integer encoding code and saves the encoded data in the file represented by the specified File object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLEncoding

public static final int XMLEncoding
The integer code for an XML encoding.

See Also:
Constant Field Values

PPMEncoding

public static final int PPMEncoding
The integer code for a PPM image encoding.

See Also:
Constant Field Values

PIXEncoding

public static final int PIXEncoding
The integer code for a PIX image encoding.

See Also:
Constant Field Values

JPEGEncoding

public static final int JPEGEncoding
The integer code for a JPEG image encoding.

See Also:
Constant Field Values
Constructor Detail

FileEncoder

public FileEncoder()
Method Detail

encodeSceneFile

public static void encodeSceneFile(Scene scene,
                                   java.io.File file,
                                   int encoding)
                            throws java.io.IOException
Encodes the specified Scene object using the encoding specified by the integer encoding code and saves the encoded data in the file represented by the specified File object. If the encoding code is not recognized, the method returns.

Throws:
java.io.IOException

encodeSurfaceFile

public static void encodeSurfaceFile(Surface surface,
                                     java.io.File file,
                                     int encoding)
                              throws java.io.IOException
Encodes the specified Surface object using the encoding specified by the integer encoding code and saves the encoded data in the file represented by the specified File object. If the encoding code is not recognized, the method returns.

Throws:
java.io.IOException

encodeImageFile

public static void encodeImageFile(RGB[][] image,
                                   java.io.File file,
                                   int encoding)
                            throws java.io.IOException
Encodes the image represented by the specified RGB array using the encoding specified by the integer encoding code and saves the encoded data in the file represented by the specified File object. If the encoding code is not recognized, the method returns.

Throws:
java.io.IOException

Rings
Version 0.3

Copyright 2003-05 Mike Murray