Class HuffmanTablesDirectory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn instance of this class holds a JPEG Huffman table. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<HuffmanTablesDirectory.HuffmanTable>static final int(package private) static final byte[](package private) static final byte[](package private) static final byte[](package private) static final byte[](package private) static final byte[](package private) static final byte[](package private) static final byte[](package private) static final byte[]Fields inherited from class com.drew.metadata.Directory
_definedTagList, _descriptor, _tagMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()Provides the name of the directory, for display purposes.intgetTable(int tableNumber) protected List<HuffmanTablesDirectory.HuffmanTable>Provides the map of tag names, hashed by tag type identifier.booleanThe opposite ofisTypical().booleanEvaluates whether all the tables in thisHuffmanTablesDirectoryare "typical" Huffman tables.Methods inherited from class com.drew.metadata.Directory
addError, containsTag, getBoolean, getBooleanObject, getByteArray, getDate, getDate, getDate, getDescription, getDouble, getDoubleObject, getErrorCount, getErrors, getFloat, getFloatObject, getInt, getIntArray, getInteger, getLong, getLongObject, getObject, getParent, getRational, getRationalArray, getString, getString, getStringArray, getStringValue, getStringValueArray, getTagCount, getTagName, getTags, hasErrors, hasTagName, isEmpty, setBoolean, setByteArray, setDate, setDescriptor, setDouble, setDoubleArray, setFloat, setFloatArray, setInt, setIntArray, setLong, setObject, setObjectArray, setParent, setRational, setRationalArray, setString, setStringArray, setStringValue, setStringValueArray, toString
-
Field Details
-
TAG_NUMBER_OF_TABLES
public static final int TAG_NUMBER_OF_TABLES- See Also:
-
TYPICAL_LUMINANCE_DC_LENGTHS
static final byte[] TYPICAL_LUMINANCE_DC_LENGTHS -
TYPICAL_LUMINANCE_DC_VALUES
static final byte[] TYPICAL_LUMINANCE_DC_VALUES -
TYPICAL_CHROMINANCE_DC_LENGTHS
static final byte[] TYPICAL_CHROMINANCE_DC_LENGTHS -
TYPICAL_CHROMINANCE_DC_VALUES
static final byte[] TYPICAL_CHROMINANCE_DC_VALUES -
TYPICAL_LUMINANCE_AC_LENGTHS
static final byte[] TYPICAL_LUMINANCE_AC_LENGTHS -
TYPICAL_LUMINANCE_AC_VALUES
static final byte[] TYPICAL_LUMINANCE_AC_VALUES -
TYPICAL_CHROMINANCE_AC_LENGTHS
static final byte[] TYPICAL_CHROMINANCE_AC_LENGTHS -
TYPICAL_CHROMINANCE_AC_VALUES
static final byte[] TYPICAL_CHROMINANCE_AC_VALUES -
tables
-
_tagNameMap
-
-
Constructor Details
-
HuffmanTablesDirectory
public HuffmanTablesDirectory()
-
-
Method Details
-
getName
Description copied from class:DirectoryProvides the name of the directory, for display purposes. E.g.Exif -
getTagNameMap
Description copied from class:DirectoryProvides the map of tag names, hashed by tag type identifier.- Specified by:
getTagNameMapin classDirectory- Returns:
- the map of tag names
-
getTable
- Parameters:
tableNumber- The zero-based index of the table. This number is normally between 0 and 3. UsegetNumberOfTables()for bounds-checking.- Returns:
- The
HuffmanTablesDirectory.HuffmanTablehaving the specified number.
-
getNumberOfTables
- Returns:
- The number of Huffman tables held by this
HuffmanTablesDirectoryinstance. - Throws:
MetadataException
-
getTables
- Returns:
- The
ListofHuffmanTablesDirectory.HuffmanTables in thisDirectory.
-
isTypical
public boolean isTypical()Evaluates whether all the tables in thisHuffmanTablesDirectoryare "typical" Huffman tables."Typical" has a special meaning in this context as the JPEG standard (ISO/IEC 10918 or ITU-T T.81) defines 4 Huffman tables that has been developed from the average statistics of a large set of images with 8-bit precision. Using these instead of calculating the optimal Huffman tables for a given image is faster, and is preferred by many hardware encoders and some hardware decoders.
Even though the JPEG standard doesn't define these as "standard tables" and requires a decoder to be able to read any valid Huffman tables, some are in reality limited decoding images using these "typical" tables. Standards like DCF (Design rule for Camera File system) and DLNA (Digital Living Network Alliance) actually requires any compliant JPEG to use only the "typical" Huffman tables.
This is also related to the term "optimized" JPEG. An "optimized" JPEG is a JPEG that doesn't use the "typical" Huffman tables.
- Returns:
- Whether or not all the tables in this
HuffmanTablesDirectoryare the predefined "typical" Huffman tables.
-
isOptimized
public boolean isOptimized()The opposite ofisTypical().- Returns:
- Whether or not the tables in this
HuffmanTablesDirectoryare "optimized" - which means that at least one of them aren't one of the "typical" Huffman tables.
-