public class JPEGHuffmanTable extends Object
For more information about the operation of the standard JPEG plug-in, see the JPEG metadata format specification and usage notes
Modifier and Type | Field | Description |
---|---|---|
static final JPEGHuffmanTable |
StdACChrominance |
The standard AC chrominance Huffman table. |
static final JPEGHuffmanTable |
StdACLuminance |
The standard AC luminance Huffman table. |
static final JPEGHuffmanTable |
StdDCChrominance |
The standard DC chrominance Huffman table. |
static final JPEGHuffmanTable |
StdDCLuminance |
The standard DC luminance Huffman table. |
Constructor | Description |
---|---|
JPEGHuffmanTable |
Creates a Huffman table and initializes it. |
Modifier and Type | Method | Description |
---|---|---|
short[] |
getLengths() |
Returns an array of short s containing the number of values for each length in the Huffman table. |
short[] |
getValues() |
Returns an array of short s containing the values arranged by increasing length of their corresponding codes. |
String |
toString() |
Returns a String representing this Huffman table. |
public static final JPEGHuffmanTable StdDCLuminance
public static final JPEGHuffmanTable StdDCChrominance
public static final JPEGHuffmanTable StdACLuminance
public static final JPEGHuffmanTable StdACChrominance
public JPEGHuffmanTable(short[] lengths, short[] values)
lengths
- an array of short
s 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.IllegalArgumentException
- if lengths
or values
are null, the length of lengths
is greater than 16, the length of values
is greater than 256, if any value in lengths
or values
is less than zero, or if the arrays do not describe a valid Huffman table.public short[] getLengths()
short
s containing the number of values for each length in the Huffman table. The returned array is a copy.short
array where array[k-1]
is equal to the number of values in the table of length k
.public short[] getValues()
short
s 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.short
array of values.public String toString()
String
representing this Huffman table.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/imageio/plugins/jpeg/JPEGHuffmanTable.html