Class IFD

java.lang.Object
pixy.image.tiff.IFD

public final class IFD
extends java.lang.Object
Image File Directory
Version:
1.0 01/04/2013
Author:
Wen Yu, yuwen_66@yahoo.com
  • Constructor Details

    • IFD

      public IFD()
    • IFD

      public IFD​(IFD other)
  • Method Details

    • addChild

      public void addChild​(Tag tag, IFD child)
    • addField

      public void addField​(TiffField<?> tiffField)
    • addFields

      public void addFields​(java.util.Collection<TiffField<?>> tiffFields)
    • getChild

      public IFD getChild​(Tag tag)
    • getChildren

      public java.util.Map<Tag,​IFD> getChildren()
    • getEndOffset

      public int getEndOffset()
    • getField

      public TiffField<?> getField​(Tag tag)
    • getFieldAsString

      public java.lang.String getFieldAsString​(Tag tag)
      Return a String representation of the field
      Parameters:
      tag - Tag for the field
      Returns:
      a String representation of the field
    • getFields

      public java.util.Collection<TiffField<?>> getFields()
      Get all the fields for this IFD from the internal map.
    • getSize

      public int getSize()
    • getStartOffset

      public int getStartOffset()
    • removeAllFields

      public void removeAllFields()
      Remove all the entries from the IDF fields map
    • removeChild

      public IFD removeChild​(Tag tag)
    • removeField

      public TiffField<?> removeField​(Tag tag)
      Remove a specific field associated with the given tag
    • setNextIFDOffset

      public void setNextIFDOffset​(RandomAccessOutputStream os, int nextOffset) throws java.io.IOException
      Set the next IFD offset pointer

      Note: This should ONLY be called after the current IFD has been written to the RandomAccessOutputStream

      Parameters:
      os - RandomAccessOutputStream
      nextOffset - next IFD offset value
      Throws:
      java.io.IOException
    • write

      public int write​(RandomAccessOutputStream os, int offset) throws java.io.IOException
      Write this IFD and all the children, if any, to the output stream
      Parameters:
      os - RandomAccessOutputStream
      offset - stream offset to write this IFD
      Throws:
      java.io.IOException