com.sun.j3d.utils.geometry.compression
Class GeometryCompressor

java.lang.Object
  extended by com.sun.j3d.utils.geometry.compression.GeometryCompressor

public class GeometryCompressor
extends java.lang.Object

A GeometryCompressor takes a stream of geometric elements and quantization parameters (the CompressionStream object) and compresses it into a stream of commands as defined by appendix B of the Java 3D specification. The resulting data may be output in the form of a CompressedGeometryData node component or appended to a CompressedGeometryFile.

Since:
Java 3D 1.5
See Also:
CompressionStream, CompressedGeometryData, CompressedGeometryFile

Field Summary
private static boolean benchmark
           
private  CompressedGeometryData.Header cgHeader
           
private  HuffmanTable huffmanTable
           
private  CommandStream outputBuffer
           
private static boolean printHuffman
           
private static boolean printStream
           
private  long startTime
           
 
Constructor Summary
GeometryCompressor()
           
 
Method Summary
 CompressedGeometryData compress(CompressionStream stream)
          Compress a stream into a CompressedGeometryData node component.
 void compress(CompressionStream stream, CompressedGeometryFile f)
          Compress a stream and append the output to a CompressedGeometryFile.
private  void compressStream(CompressionStream stream)
           
private  void printBench(CompressionStream stream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

benchmark

private static final boolean benchmark
See Also:
Constant Field Values

printStream

private static final boolean printStream
See Also:
Constant Field Values

printHuffman

private static final boolean printHuffman
See Also:
Constant Field Values

huffmanTable

private HuffmanTable huffmanTable

outputBuffer

private CommandStream outputBuffer

cgHeader

private CompressedGeometryData.Header cgHeader

startTime

private long startTime
Constructor Detail

GeometryCompressor

public GeometryCompressor()
Method Detail

compress

public CompressedGeometryData compress(CompressionStream stream)
Compress a stream into a CompressedGeometryData node component.

Parameters:
stream - CompressionStream containing the geometry to be compressed
Returns:
a CompressedGeometryData node component

compress

public void compress(CompressionStream stream,
                     CompressedGeometryFile f)
              throws java.io.IOException
Compress a stream and append the output to a CompressedGeometryFile. The resource remains open for subsequent updates; its close() method must be called to create a valid compressed geometry resource file.

Parameters:
stream - CompressionStream containing the geometry to be compressed
f - a currently open CompressedGeometryFile with write access
Throws:
java.io.IOException - if write fails

compressStream

private void compressStream(CompressionStream stream)

printBench

private void printBench(CompressionStream stream)


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.