This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.imageio.plugins.jpeg
class JPEGHuffmanTable

java.lang.Object extended by javax.imageio.plugins.jpeg.JPEGHuffmanTable

public class JPEGHuffmanTable
extends Object

A class encapsulating a single JPEG Huffman table. Fields are provided for the "standard" tables from taken from Annex K of the JPEG specification. These are the tables used as defaults. This class differs from the old unsupported com.sun.image.codec.jpeg.JPEGHuffmanTable in two ways:

  1. The lengths arrays for this class do not contain an ignored 0th entry. The lengths array in a JPEG stream does not contain an extra entry, and this class is used to represent the contents of a JPEG stream.
  2. The old class incorrectly referred to Huffman "symbols", while expecting an array of values to be encoded. This class has a getValues method instead of a getSymbols method.

For more information about the operation of the built-in JPEG plug-ins, see the JPEG metadata format specification and usage notes.


Field Summary
static JPEGHuffmanTable StdACChrominance
          The standard AC chrominance Huffman table.
static JPEGHuffmanTable StdACLuminance
          The standard AC luminance Huffman table.
static JPEGHuffmanTable StdDCChrominance
          The standard DC chrominance Huffman table.
static JPEGHuffmanTable StdDCLuminance
          The standard DC luminance Huffman table.
 
Constructor Summary
JPEGHuffmanTable(short[] lengths, short[] values)

          Creates a Huffman table and initializes it.
 
Method Summary
 short[]

          Return an array of shorts containing the number of values for each length in the Huffman table.
 short[]

          Return an array of shorts containing the values arranged by increasing length of their corresponding codes.
 String

          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

StdACChrominance

public static final JPEGHuffmanTable StdACChrominance
The standard AC chrominance Huffman table.

StdACLuminance

public static final JPEGHuffmanTable StdACLuminance
The standard AC luminance Huffman table.

StdDCChrominance

public static final JPEGHuffmanTable StdDCChrominance
The standard DC chrominance Huffman table.

StdDCLuminance

public static final JPEGHuffmanTable StdDCLuminance
The standard DC luminance Huffman table.
Constructor Detail

JPEGHuffmanTable

public JPEGHuffmanTable(short[] lengths,
                        short[] values)
Creates a Huffman table and initializes it. The input arrays are copied. The arrays must describe a possible Huffman table. For example, 3 codes cannot be expressed with a single bit.

Parameters:
lengths - an array of shorts where lengths[k] is equal to the number of values with corresponding codes of length k + 1 bits.
values - an array of shorts containing the values in order of increasing code length.
Method Detail

getLengths

public short[] getLengths()
Return an array of shorts containing the number of values for each length in the Huffman table. The returned array is a copy.

Returns:
a short array where array[k-1] is equal to the number of values in the table of length k.

getValues

public short[] getValues()
Return an array of shorts containing the values arranged by increasing length of their corresponding codes. The interpretation of the array is dependent on the values returned from getLengths. The returned array is a copy.

Returns:
a short array of values.

toString

public String toString()
Overrides:
toString in class Object


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.