org.geotiff.image.jai
Class GeoTIFFDirectory

java.lang.Object
  extended by org.libtiff.jai.codec.XTIFFDirectory
      extended by org.geotiff.image.jai.GeoTIFFDirectory
All Implemented Interfaces:
java.io.Serializable

public class GeoTIFFDirectory
extends XTIFFDirectory
implements java.io.Serializable

An extension of the XTIFFDirectory that understands the structure of the GeoTIFF key set

Author:
Niles D. Ritter
See Also:
Serialized Form

Constructor Summary
GeoTIFFDirectory()
          public constructor (for serializability)
GeoTIFFDirectory(com.sun.media.jai.codec.SeekableStream stream, int directory)
          Constructs a GeoTIFFDirectory from a SeekableStream.
GeoTIFFDirectory(com.sun.media.jai.codec.SeekableStream stream, long ifd_offset)
          Constructs a GeoTIFFDirectory by reading a SeekableStream.
 
Method Summary
 void addGeoKey(int key, int type, int count, java.lang.Object data)
          Add a geoKey to the directory
 void addGeoKey(XTIFFField geoKey)
          Add an existing geoKey to the directory.
 XTIFFField[] getFields()
          Returns an array of XTIFFFields containing all the fields in this directory.
 XTIFFField getGeoKey(int key)
          Indexed Accessor to the Geokeys,indexed by the key values.
 XTIFFField[] getGeoKeys()
          Returns an array of XTIFFFields containing all the fields corresponding to the GeoKeys.
 double[] getPixelScale()
          return the pixel scale tag values
 double[] getTiepoints()
          return the tiepoint tag values
 double[] getTransformationMatrix()
          return the transformation matrix tag values
 void setPixelScale(double[] scales)
          return the pixel scale tag values
 void setTiepoints(double[] tiepoints)
          set the tiepoint tag values
 void setTransformationMatrix(double[] matrix)
          return the pixel scale tag values
 
Methods inherited from class org.libtiff.jai.codec.XTIFFDirectory
addField, addField, create, create, create, createField, createTileCodec, createTileCodec, getCompression, getField, getFieldAsByte, getFieldAsByte, getFieldAsDouble, getFieldAsDouble, getFieldAsFloat, getFieldAsFloat, getFieldAsLong, getFieldAsLong, getImageType, getNumDirectories, getNumEntries, getTags, getTileCodec, isBigEndian, isTagPresent, isTiled, readFieldValue, registerTileCodec, setCompression, setFactory, setImageType, setIsTiled, sizeOfType, unRegisterTileCodec
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoTIFFDirectory

public GeoTIFFDirectory()
public constructor (for serializability)


GeoTIFFDirectory

public GeoTIFFDirectory(com.sun.media.jai.codec.SeekableStream stream,
                        long ifd_offset)
                 throws java.io.IOException
Constructs a GeoTIFFDirectory by reading a SeekableStream. The ifd_offset parameter specifies the stream offset from which to begin reading; this mechanism is sometimes used to store private IFDs within a TIFF file that are not part of the normal sequence of IFDs.

Throws:
java.io.IOException

GeoTIFFDirectory

public GeoTIFFDirectory(com.sun.media.jai.codec.SeekableStream stream,
                        int directory)
                 throws java.io.IOException
Constructs a GeoTIFFDirectory from a SeekableStream. The directory parameter specifies which directory to read from the linked list present in the stream; directory 0 is normally read but it is possible to store multiple images in a single TIFF file by maintaing multiple directories.

Throws:
java.io.IOException
Method Detail

getFields

public XTIFFField[] getFields()
Returns an array of XTIFFFields containing all the fields in this directory. Prior to returning array, determine if there are any GeoKeys, and if so, set up the corresponding GeoTIFF fields.

Overrides:
getFields in class XTIFFDirectory

addGeoKey

public void addGeoKey(int key,
                      int type,
                      int count,
                      java.lang.Object data)
Add a geoKey to the directory


addGeoKey

public void addGeoKey(XTIFFField geoKey)
Add an existing geoKey to the directory.


getGeoKeys

public XTIFFField[] getGeoKeys()
Returns an array of XTIFFFields containing all the fields corresponding to the GeoKeys.


getGeoKey

public XTIFFField getGeoKey(int key)
Indexed Accessor to the Geokeys,indexed by the key values.


getTiepoints

public double[] getTiepoints()
return the tiepoint tag values


getPixelScale

public double[] getPixelScale()
return the pixel scale tag values


getTransformationMatrix

public double[] getTransformationMatrix()
return the transformation matrix tag values


setTiepoints

public void setTiepoints(double[] tiepoints)
set the tiepoint tag values


setPixelScale

public void setPixelScale(double[] scales)
return the pixel scale tag values


setTransformationMatrix

public void setTransformationMatrix(double[] matrix)
return the pixel scale tag values