com.drew.metadata.jpeg

Class JpegDirectory

Implemented Interfaces:
Serializable

public class JpegDirectory
extends 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

Field Summary

static int
TAG_JPEG_COMPONENT_DATA_1
the first of a possible 4 color components.
static int
TAG_JPEG_COMPONENT_DATA_2
the second of a possible 4 color components.
static int
TAG_JPEG_COMPONENT_DATA_3
the third of a possible 4 color components.
static int
TAG_JPEG_COMPONENT_DATA_4
the fourth of a possible 4 color components.
static int
TAG_JPEG_DATA_PRECISION
This is in bits/sample, usually 8 (12 and 16 not supported by most software).
static int
TAG_JPEG_IMAGE_HEIGHT
The image's height.
static int
TAG_JPEG_IMAGE_WIDTH
The image's width.
static int
TAG_JPEG_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).
protected static HashMap
tagNameMap

Fields inherited from class com.drew.metadata.Directory

_definedTagList, _descriptor, _tagMap

Constructor Summary

JpegDirectory()

Method Summary

JpegComponent
getComponent(int componentNumber)
int
getImageHeight()
int
getImageWidth()
String
getName()
int
getNumberOfComponents()
protected HashMap
getTagNameMap()

Methods inherited from class com.drew.metadata.Directory

addError, containsTag, getBoolean, getByteArray, getDate, getDescription, getDouble, getErrorCount, getErrors, getFloat, getInt, getIntArray, getLong, getName, getObject, getRational, getRationalArray, getString, getStringArray, getTagCount, getTagIterator, getTagName, getTagNameMap, hasErrors, setBoolean, setByteArray, setDate, setDescriptor, setDouble, setFloat, setInt, setIntArray, setLong, setObject, setObjectArray, setRational, setRationalArray, setString, setStringArray

Field Details

TAG_JPEG_COMPONENT_DATA_1

public static final int TAG_JPEG_COMPONENT_DATA_1
the first of a possible 4 color components. Number of components specified in TAG_JPEG_NUMBER_OF_COMPONENTS.
Field Value:
6

TAG_JPEG_COMPONENT_DATA_2

public static final int TAG_JPEG_COMPONENT_DATA_2
the second of a possible 4 color components. Number of components specified in TAG_JPEG_NUMBER_OF_COMPONENTS.
Field Value:
7

TAG_JPEG_COMPONENT_DATA_3

public static final int TAG_JPEG_COMPONENT_DATA_3
the third of a possible 4 color components. Number of components specified in TAG_JPEG_NUMBER_OF_COMPONENTS.
Field Value:
8

TAG_JPEG_COMPONENT_DATA_4

public static final int TAG_JPEG_COMPONENT_DATA_4
the fourth of a possible 4 color components. Number of components specified in TAG_JPEG_NUMBER_OF_COMPONENTS.
Field Value:
9

TAG_JPEG_DATA_PRECISION

public static final int TAG_JPEG_DATA_PRECISION
This is in bits/sample, usually 8 (12 and 16 not supported by most software).
Field Value:
0

TAG_JPEG_IMAGE_HEIGHT

public static final int TAG_JPEG_IMAGE_HEIGHT
The image's height. Necessary for decoding the image, so it should always be there.
Field Value:
1

TAG_JPEG_IMAGE_WIDTH

public static final int TAG_JPEG_IMAGE_WIDTH
The image's width. Necessary for decoding the image, so it should always be there.
Field Value:
3

TAG_JPEG_NUMBER_OF_COMPONENTS

public static final int TAG_JPEG_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

Field Value:
5

tagNameMap

protected static final HashMap tagNameMap

Constructor Details

JpegDirectory

public JpegDirectory()

Method Details

getComponent

public 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:

getImageHeight

public int getImageHeight()
            throws MetadataException

getImageWidth

public int getImageWidth()
            throws MetadataException

getName

public String getName()
Overrides:
getName in interface Directory

getNumberOfComponents

public int getNumberOfComponents()
            throws MetadataException

getTagNameMap

protected HashMap getTagNameMap()
Overrides:
getTagNameMap in interface Directory

Copyright © 2006 Drew Noakes. All Rights Reserved.