Package gov.nih.mipav.model.file
Class MetadataExtractor.JpegDirectory
- java.lang.Object
-
- gov.nih.mipav.model.file.MetadataExtractor.Directory
-
- gov.nih.mipav.model.file.MetadataExtractor.JpegDirectory
-
- Enclosing class:
- MetadataExtractor
public class MetadataExtractor.JpegDirectory extends MetadataExtractor.Directory
Directory of tags and values for the SOF0 JPEG segment. This segment holds basic metadata about the image.- Author:
- Darrell Silver http://www.darrellsilver.com and Drew Noakes https://drewnoakes.com
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMap<java.lang.Integer,java.lang.String>_tagNameMapstatic intTAG_COMPONENT_DATA_1the first of a possible 4 color components.static intTAG_COMPONENT_DATA_2the second of a possible 4 color components.static intTAG_COMPONENT_DATA_3the third of a possible 4 color components.static intTAG_COMPONENT_DATA_4the fourth of a possible 4 color components.static intTAG_COMPRESSION_TYPEstatic intTAG_DATA_PRECISIONThis is in bits/sample, usually 8 (12 and 16 not supported by most software).static intTAG_IMAGE_HEIGHTThe image's height.static intTAG_IMAGE_WIDTHThe image's width.static intTAG_NUMBER_OF_COMPONENTSUsually 1 = grey scaled, 3 = color YcbCr or YIQ, 4 = color CMYK Each component TAG_COMPONENT_DATA_[1-4], has the following meaning: component Id(1byte)(1 = Y, 2 = Cb, 3 = Cr, 4 = I, 5 = Q), sampling factors (1byte) (bit 0-3 vertical., 4-7 horizontal.), quantization table number (1 byte).-
Fields inherited from class gov.nih.mipav.model.file.MetadataExtractor.Directory
_definedTagList, _descriptor, _tagMap
-
-
Constructor Summary
Constructors Constructor Description JpegDirectory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetadataExtractor.JpegComponentgetComponent(int componentNumber)intgetImageHeight()intgetImageWidth()java.lang.StringgetName()Provides the name of the directory, for display purposes.intgetNumberOfComponents()protected java.util.HashMap<java.lang.Integer,java.lang.String>getTagNameMap()Provides the map of tag names, hashed by tag type identifier.-
Methods inherited from class gov.nih.mipav.model.file.MetadataExtractor.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 Detail
-
TAG_COMPRESSION_TYPE
public static final int TAG_COMPRESSION_TYPE
- See Also:
- Constant Field Values
-
TAG_DATA_PRECISION
public static final int TAG_DATA_PRECISION
This is in bits/sample, usually 8 (12 and 16 not supported by most software).- See Also:
- Constant Field Values
-
TAG_IMAGE_HEIGHT
public static final int TAG_IMAGE_HEIGHT
The image's height. Necessary for decoding the image, so it should always be there.- See Also:
- Constant Field Values
-
TAG_IMAGE_WIDTH
public static final int TAG_IMAGE_WIDTH
The image's width. Necessary for decoding the image, so it should always be there.- See Also:
- Constant Field Values
-
TAG_NUMBER_OF_COMPONENTS
public static final int TAG_NUMBER_OF_COMPONENTS
Usually 1 = grey scaled, 3 = color YcbCr or YIQ, 4 = color CMYK Each component TAG_COMPONENT_DATA_[1-4], has the following meaning: component Id(1byte)(1 = Y, 2 = Cb, 3 = Cr, 4 = I, 5 = Q), sampling factors (1byte) (bit 0-3 vertical., 4-7 horizontal.), quantization table number (1 byte).This info is from http://www.funducode.com/freec/Fileformats/format3/format3b.htm
- See Also:
- Constant Field Values
-
TAG_COMPONENT_DATA_1
public static final int TAG_COMPONENT_DATA_1
the first of a possible 4 color components. Number of components specified in TAG_NUMBER_OF_COMPONENTS.- See Also:
- Constant Field Values
-
TAG_COMPONENT_DATA_2
public static final int TAG_COMPONENT_DATA_2
the second of a possible 4 color components. Number of components specified in TAG_NUMBER_OF_COMPONENTS.- See Also:
- Constant Field Values
-
TAG_COMPONENT_DATA_3
public static final int TAG_COMPONENT_DATA_3
the third of a possible 4 color components. Number of components specified in TAG_NUMBER_OF_COMPONENTS.- See Also:
- Constant Field Values
-
TAG_COMPONENT_DATA_4
public static final int TAG_COMPONENT_DATA_4
the fourth of a possible 4 color components. Number of components specified in TAG_NUMBER_OF_COMPONENTS.- See Also:
- Constant Field Values
-
_tagNameMap
private final java.util.HashMap<java.lang.Integer,java.lang.String> _tagNameMap
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from class:MetadataExtractor.DirectoryProvides the name of the directory, for display purposes. E.g.Exif- Specified by:
getNamein classMetadataExtractor.Directory- Returns:
- the name of the directory
-
getTagNameMap
protected java.util.HashMap<java.lang.Integer,java.lang.String> getTagNameMap()
Description copied from class:MetadataExtractor.DirectoryProvides the map of tag names, hashed by tag type identifier.- Specified by:
getTagNameMapin classMetadataExtractor.Directory- Returns:
- the map of tag names
-
getComponent
public MetadataExtractor.JpegComponent getComponent(int componentNumber)
- Parameters:
componentNumber- The zero-based index of the component. This number is normally between 0 and 3. Use getNumberOfComponents for bounds-checking.- Returns:
- the JpegComponent having the specified number.
-
getImageWidth
public int getImageWidth() throws MetadataExtractor.MetadataException
-
getImageHeight
public int getImageHeight() throws MetadataExtractor.MetadataException
-
getNumberOfComponents
public int getNumberOfComponents() throws MetadataExtractor.MetadataException
-
-