Copyright 2011-01-06 Werner Randelshofer

ch.randelshofer.media.tiff
Class IFD

java.lang.Object
  extended by ch.randelshofer.media.tiff.IFD

public class IFD
extends java.lang.Object

Represents a TIFF Image File Directory (IFD).

An IFD consists of a 2-byte count of the number of directory entries (i.e., the number of fields), followed by a sequence of 12-byte field entries, followed by a 4-byte offset of the next IFD (or 0 if none).

There must be at least 1 IFD in a TIFF file and each IFD must have at least one entry.

Version:
2.0 2010-07-24 Reworked.
1.0 2009-12-26 Created.
Author:
Werner Randelshofer

Constructor Summary
IFD(long offset, boolean hasNextOffset)
           
 
Method Summary
 IFDEntry get(int index)
          Returns the IFDEntry at the specified index.
 int getCount()
          Returns the number of entries in the IFD.
 java.util.List<IFDEntry> getEntries()
          Returns an unmodifiale list of the IFDEntrys.
 long getLength()
          Returns the length of this IFD in bytes.
 long getNextOffset()
          Gets the offset of the next IFD.
 long getOffset()
          Returns the offset of the IFD.
 boolean hasNextOffset()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IFD

public IFD(long offset,
           boolean hasNextOffset)
Method Detail

getOffset

public long getOffset()
Returns the offset of the IFD.


getNextOffset

public long getNextOffset()
Gets the offset of the next IFD. Returns 0 if there is no next IFD.


hasNextOffset

public boolean hasNextOffset()

getCount

public int getCount()
Returns the number of entries in the IFD.


get

public IFDEntry get(int index)
Returns the IFDEntry at the specified index.


getEntries

public java.util.List<IFDEntry> getEntries()
Returns an unmodifiale list of the IFDEntrys.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getLength

public long getLength()
Returns the length of this IFD in bytes.


Copyright 2011-01-06 Werner Randelshofer