com.sun.image.codec.jpeg
Class JPEGHuffmanTable

java.lang.Object
  |
  +--com.sun.image.codec.jpeg.JPEGHuffmanTable

public class JPEGHuffmanTable
extends Object

A class to encapsulate a JPEG Huffman table.

Note that the classes in the com.sun.image.codec.jpeg package are not part of the core Java APIs. They are a part of Sun's JDK and JRE distributions. Although other licensees may choose to distribute these classes, developers cannot depend on their availability in non-Sun implementations. We expect that equivalent functionality will eventually be available in a core API or standard extension.


Field Summary
static JPEGHuffmanTable StdACChrominance
          Standard Huffman table ( JPEG standard section K.3 )
static JPEGHuffmanTable StdACLuminance
          Standard Huffman table ( JPEG standard section K.3 )
static JPEGHuffmanTable StdDCChrominance
          Standard Huffman table ( JPEG standard section K.3 )
static JPEGHuffmanTable StdDCLuminance
          Standard Huffman table ( JPEG standard section K.3 )
 
Constructor Summary
JPEGHuffmanTable(short[] lengths, short[] symbols)
          Creates a Huffman Table and initializes it.
 
Method Summary
 short[] getLengths()
          Return a copy of the array containing the number of symbols for each length in the Huffman table.
 short[] getSymbols()
          Return an array containing the Huffman symbols arranged by increasing length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

StdDCLuminance

public static final JPEGHuffmanTable StdDCLuminance
Standard Huffman table ( JPEG standard section K.3 )

StdDCChrominance

public static final JPEGHuffmanTable StdDCChrominance
Standard Huffman table ( JPEG standard section K.3 )

StdACLuminance

public static final JPEGHuffmanTable StdACLuminance
Standard Huffman table ( JPEG standard section K.3 )

StdACChrominance

public static final JPEGHuffmanTable StdACChrominance
Standard Huffman table ( JPEG standard section K.3 )
Constructor Detail

JPEGHuffmanTable

public JPEGHuffmanTable(short[] lengths,
                        short[] symbols)
Creates a Huffman Table and initializes it.
Parameters:
lengths - lengths[k] = # of symbols with codes of length k bits; lengths[0] is ignored
symbols - symbols in order of increasing code length
Throws:
IllegalArgumentException - if the length of lengths is greater than 17
IllegalArgumentException - if the length of symbols is greater than 256
IllegalArgumentException - if any of the values in lengths or symbols is less than zero
Method Detail

getLengths

public short[] getLengths()
Return a copy of the array containing the number of symbols for each length in the Huffman table.
Returns:
A short array where array[k] = # of symbols in the table of length k. array[0] is unused

getSymbols

public short[] getSymbols()
Return an array containing the Huffman symbols arranged by increasing length. To make use of this array you must refer the the lengths array.
Returns:
A short array of Huffman symbols


Submit a bug or feature
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.