Java Doc for XTIFFDirectory.java in  » GIS » openjump » org » libtiff » jai » codec » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » openjump » org.libtiff.jai.codec 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.libtiff.jai.codec.XTIFFDirectory

All known Subclasses:   org.geotiff.image.jai.GeoTIFFDirectory,
XTIFFDirectory
public class XTIFFDirectory extends Object implements java.io.Serializable(Code)
XTIFFDirectory is an extensible TIFF directory object. This class may be extended without changing the XTIFF codec by overriding the XTIFFFactory instance registered in this class. In addition, this class is the repository of all XTIFFTileCodec's which may be augmented with new codecs, again without overriding the ImageCodec. If the jai "tiff" codec has been overridden through the XTIFFDescriptor.register() method, each XTIFF image will possess a property called "tiff.directory" which will be an object of the type created by the factory. The class is declared as serializable to permit its transmission to remote images as a set of parameters to the codec, and to be able to survive as an instantiated property of the RenderedImage.
author:
   Niles Ritter
See Also:   XTIFFDescriptor
See Also:   XTIFFField
See Also:   XTIFFTileCodec
See Also:   XTIFFFactory


Field Summary
 boolean_isTiled
    
protected static  XTIFFFactoryfactory
    
 TreeMapfieldIndex
    
 booleanisBigEndian
     A boolean storing the endianness of the stream.
protected transient  SeekableStreamstream
     The stream being read.
protected static  HashtabletileCodecs
    

Constructor Summary
public  XTIFFDirectory()
     The default constructor.
protected  XTIFFDirectory(SeekableStream stream, int directory)
     Constructs a XTIFFDirectory from a SeekableStream.
protected  XTIFFDirectory(SeekableStream stream, long ifd_offset)
     Constructs a XTIFFDirectory by reading a SeekableStream.

Method Summary
public  voidaddField(int tag, int type, int count, Object obj)
     Create and add a TIFF field to this directory.
public  voidaddField(XTIFFField field)
     Add an existing TIFF field to this directory.
public static  XTIFFDirectorycreate(SeekableStream stream, int directory)
     Constructs a XTIFFDirectory from a SeekableStream.
public static  XTIFFDirectorycreate(SeekableStream stream, long ifd_offset)
     Constructs a TIFFDirectory 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.
public static  XTIFFDirectorycreate()
     Constructs an XTIFFDirectory from the currently.
public static  XTIFFFieldcreateField(int tag, int type, int count, Object obj)
    
public  XTIFFTileCodeccreateTileCodec(XTIFFDecodeParam param)
     Constructs a tile codec for decoding data, using the compression defined in the current directory.
public  XTIFFTileCodeccreateTileCodec(XTIFFEncodeParam param)
     Constructs a tile codec for encoding data, using the compression defined in the current directory.
public  intgetCompression()
     Return the type of compression indicated in the TIFF fields, or XTIFF.COMPRESSION_NON if not specified.
public  XTIFFFieldgetField(int tag)
     Returns the value of a given tag as a XTIFFField, or null if the tag is not present.
public  bytegetFieldAsByte(int tag, int index)
     Returns the value of a particular index of a given tag as a byte.
public  bytegetFieldAsByte(int tag)
     Returns the value of index 0 of a given tag as a byte.
public  doublegetFieldAsDouble(int tag, int index)
     Returns the value of a particular index of a given tag as a double.
public  doublegetFieldAsDouble(int tag)
     Returns the value of index 0 of a given tag as a double.
public  floatgetFieldAsFloat(int tag, int index)
     Returns the value of a particular index of a given tag as a float.
public  floatgetFieldAsFloat(int tag)
     Returns the value of index 0 of a given tag as a float.
public  longgetFieldAsLong(int tag, int index)
     Returns the value of a particular index of a given tag as a long.
public  longgetFieldAsLong(int tag)
     Returns the value of index 0 of a given tag as a long.
public  XTIFFField[]getFields()
     Returns an array of XTIFFFields containing all the fields in this directory.
public  intgetImageType()
     Get the JAI Image decoded type.
public static  intgetNumDirectories(SeekableStream stream)
     Returns the number of image directories (subimages) stored in a given TIFF file, represented by a SeekableStream.
public  intgetNumEntries()
     Returns the number of directory entries.
public  int[]getTags()
     Returns an ordered array of ints indicating the tag values.
public static  XTIFFTileCodecgetTileCodec(int comp)
     Return the currently registered XTIFFTileCodec for this compression type.
protected  voidinitialize()
    
public  booleanisBigEndian()
     Returns a boolean indicating whether the byte order used in the the TIFF file is big-endian (i.e.
public  booleanisTagPresent(int tag)
     Returns true if a tag appears in the directory.
public  booleanisTiled()
    
protected  doublereadDouble(SeekableStream stream)
    
public  ObjectreadFieldValue(int tag, int type, int count)
     TIFF field-value reader.
protected  floatreadFloat(SeekableStream stream)
    
protected  voidreadHeader()
     reads the TIFF header.
protected  intreadInt(SeekableStream stream)
    
protected  longreadLong(SeekableStream stream)
    
protected  shortreadShort(SeekableStream stream)
    
protected  longreadUnsignedInt(SeekableStream stream)
    
protected  intreadUnsignedShort(SeekableStream stream)
    
public static  voidregisterTileCodec(int comp, XTIFFTileCodec codec)
     Register a new XTIFFTileCodec for encoding and decoding compressed TIFF image data.
public  voidsetCompression(int compression)
     Specifies the type of compression to be used.
public static  voidsetFactory(XTIFFFactory fact)
     Set the XTIFFFactory, which is used to construct the XTIFFDirectory object assigned as a "tiff.directory" property in the resulting jai image.
Parameters:
  fact - the factory to register.
public  voidsetImageType(int image_type)
     Set the JAI Image decoded type.
public  voidsetIsTiled(boolean isTiled)
     If set, the data will be written out in tiled format, instead of in strips.
public  intsizeOfType(int type)
     Return the size of a data type.
public static  voidunRegisterTileCodec(int comp)
     UnRegister the XTIFFTileCodec corresponding to the TIFF compression type.

Field Detail
_isTiled
boolean _isTiled(Code)
A boolean indicating tiled tagset



factory
protected static XTIFFFactory factory(Code)
default directory factory



fieldIndex
TreeMap fieldIndex(Code)
for dynamically adding fields in sorted order



isBigEndian
boolean isBigEndian(Code)
A boolean storing the endianness of the stream.



stream
protected transient SeekableStream stream(Code)
The stream being read. Not persisted



tileCodecs
protected static Hashtable tileCodecs(Code)




Constructor Detail
XTIFFDirectory
public XTIFFDirectory()(Code)
The default constructor. Publicized for Serializability



XTIFFDirectory
protected XTIFFDirectory(SeekableStream stream, int directory) throws IOException(Code)
Constructs a XTIFFDirectory 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.
Parameters:
  stream - a SeekableStream to read from.
Parameters:
  directory - the index of the directory to read.



XTIFFDirectory
protected XTIFFDirectory(SeekableStream stream, long ifd_offset) throws IOException(Code)
Constructs a XTIFFDirectory 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.
Parameters:
  stream - a SeekableStream to read from.
Parameters:
  ifd_offset - the long byte offset of the directory.




Method Detail
addField
public void addField(int tag, int type, int count, Object obj)(Code)
Create and add a TIFF field to this directory.
Parameters:
  tag - the TIFF tag listed in XTIFF
Parameters:
  type - the TIFF field type listed in XTIFFField
Parameters:
  count - the number of values in array obj
Parameters:
  obj - the array of values
See Also:   XTIFFField
See Also:   XTIFF



addField
public void addField(XTIFFField field)(Code)
Add an existing TIFF field to this directory.
Parameters:
  type - the XTIFFField type code
See Also:   XTIFFField



create
public static XTIFFDirectory create(SeekableStream stream, int directory) throws IOException(Code)
Constructs a XTIFFDirectory 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.
Parameters:
  stream - a SeekableStream to read from.
Parameters:
  directory - the index of the directory to read.
See Also:   XTIFFFactory



create
public static XTIFFDirectory create(SeekableStream stream, long ifd_offset) throws IOException(Code)
Constructs a TIFFDirectory 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. Uses the XTIFFFactory to do this, so to extend the directory class, the factory method should be extended and registered instead of this one.
Parameters:
  stream - a SeekableStream to read from.
Parameters:
  ifd_offset - the long byte offset of the directory.
See Also:   XTIFFFactory



create
public static XTIFFDirectory create()(Code)
Constructs an XTIFFDirectory from the currently. registered XTIFFDirectory factory.
See Also:   XTIFFFactory



createField
public static XTIFFField createField(int tag, int type, int count, Object obj)(Code)
Create a TIFF field
Parameters:
  tag - the TIFF tag listed in XTIFF
Parameters:
  type - the TIFF field type listed in XTIFFField
Parameters:
  count - the number of values in array obj
Parameters:
  obj - the array of values
See Also:   XTIFFField
See Also:   XTIFF



createTileCodec
public XTIFFTileCodec createTileCodec(XTIFFDecodeParam param) throws IOException(Code)
Constructs a tile codec for decoding data, using the compression defined in the current directory.
Parameters:
  param - the encoding param
See Also:   XTIFFTileCodec



createTileCodec
public XTIFFTileCodec createTileCodec(XTIFFEncodeParam param) throws IOException(Code)
Constructs a tile codec for encoding data, using the compression defined in the current directory.
Parameters:
  param - the encoding param
See Also:   XTIFFTileCodec



getCompression
public int getCompression()(Code)
Return the type of compression indicated in the TIFF fields, or XTIFF.COMPRESSION_NON if not specified.



getField
public XTIFFField getField(int tag)(Code)
Returns the value of a given tag as a XTIFFField, or null if the tag is not present.



getFieldAsByte
public byte getFieldAsByte(int tag, int index)(Code)
Returns the value of a particular index of a given tag as a byte. The caller is responsible for ensuring that the tag is present and has type XTIFFField.TIFF_SBYTE, TIFF_BYTE, or TIFF_UNDEFINED.



getFieldAsByte
public byte getFieldAsByte(int tag)(Code)
Returns the value of index 0 of a given tag as a byte. The caller is responsible for ensuring that the tag is present and has type XTIFFField.TIFF_SBYTE, TIFF_BYTE, or TIFF_UNDEFINED.



getFieldAsDouble
public double getFieldAsDouble(int tag, int index)(Code)
Returns the value of a particular index of a given tag as a double. The caller is responsible for ensuring that the tag is present and has numeric type (all but TIFF_UNDEFINED and TIFF_ASCII).



getFieldAsDouble
public double getFieldAsDouble(int tag)(Code)
Returns the value of index 0 of a given tag as a double. The caller is responsible for ensuring that the tag is present and has numeric type (all but TIFF_UNDEFINED and TIFF_ASCII).



getFieldAsFloat
public float getFieldAsFloat(int tag, int index)(Code)
Returns the value of a particular index of a given tag as a float. The caller is responsible for ensuring that the tag is present and has numeric type (all but TIFF_UNDEFINED and TIFF_ASCII).



getFieldAsFloat
public float getFieldAsFloat(int tag)(Code)
Returns the value of index 0 of a given tag as a float. The caller is responsible for ensuring that the tag is present and has numeric type (all but TIFF_UNDEFINED and TIFF_ASCII).



getFieldAsLong
public long getFieldAsLong(int tag, int index)(Code)
Returns the value of a particular index of a given tag as a long. The caller is responsible for ensuring that the tag is present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG.



getFieldAsLong
public long getFieldAsLong(int tag)(Code)
Returns the value of index 0 of a given tag as a long. The caller is responsible for ensuring that the tag is present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG.



getFields
public XTIFFField[] getFields()(Code)
Returns an array of XTIFFFields containing all the fields in this directory.



getImageType
public int getImageType()(Code)
Get the JAI Image decoded type. This method is called by the XTIFFTileCodeImpl object during the decode() method to determine what type of colorspace and sample model to use.



getNumDirectories
public static int getNumDirectories(SeekableStream stream) throws IOException(Code)
Returns the number of image directories (subimages) stored in a given TIFF file, represented by a SeekableStream.



getNumEntries
public int getNumEntries()(Code)
Returns the number of directory entries.



getTags
public int[] getTags()(Code)
Returns an ordered array of ints indicating the tag values.



getTileCodec
public static XTIFFTileCodec getTileCodec(int comp)(Code)
Return the currently registered XTIFFTileCodec for this compression type. Used by the XTIFFImage to decode the compression data.
See Also:   XTIFFTileCodec



initialize
protected void initialize() throws IOException(Code)
Initialize the directory from a stream



isBigEndian
public boolean isBigEndian()(Code)
Returns a boolean indicating whether the byte order used in the the TIFF file is big-endian (i.e. whether the byte order is from the most significant to the least significant)



isTagPresent
public boolean isTagPresent(int tag)(Code)
Returns true if a tag appears in the directory.



isTiled
public boolean isTiled()(Code)
If true this image uses TIFF 6.0 tiling



readDouble
protected double readDouble(SeekableStream stream) throws IOException(Code)



readFieldValue
public Object readFieldValue(int tag, int type, int count) throws IOException, ArrayIndexOutOfBoundsException(Code)
TIFF field-value reader. Override if there are new field types. Also override sizeOfType() and, possibly the createField method of the factory, if the field needs new accessors.



readFloat
protected float readFloat(SeekableStream stream) throws IOException(Code)



readHeader
protected void readHeader() throws IOException(Code)
reads the TIFF header. Not likely to be overridden.



readInt
protected int readInt(SeekableStream stream) throws IOException(Code)



readLong
protected long readLong(SeekableStream stream) throws IOException(Code)



readShort
protected short readShort(SeekableStream stream) throws IOException(Code)



readUnsignedInt
protected long readUnsignedInt(SeekableStream stream) throws IOException(Code)



readUnsignedShort
protected int readUnsignedShort(SeekableStream stream) throws IOException(Code)



registerTileCodec
public static void registerTileCodec(int comp, XTIFFTileCodec codec)(Code)
Register a new XTIFFTileCodec for encoding and decoding compressed TIFF image data. This overrides any existing codec previously registered.
Parameters:
  comp - The TIFF compression code indicated by the
Parameters:
  codec - The codec to register.XTIFF.TIFFTAG_COMPRESSION field.
See Also:   XTIFFTileCodec



setCompression
public void setCompression(int compression)(Code)
Specifies the type of compression to be used. The compression type specified will be honored only if it is compatible with the image being written out.
Parameters:
  compression - The compression type.



setFactory
public static void setFactory(XTIFFFactory fact)(Code)
Set the XTIFFFactory, which is used to construct the XTIFFDirectory object assigned as a "tiff.directory" property in the resulting jai image.
Parameters:
  fact - the factory to register. The factory is guaranteed to always be non-null; if a null is passedin then the default XTIFFFactory is used.a null object is passed in
See Also:   XTIFFFactory



setImageType
public void setImageType(int image_type)(Code)
Set the JAI Image decoded type. This method is called by the XTIFFImage constructor to indicate to the XTIFFTileCodec what type of colorspace and sample model to use. The types are enumerated in the XTIFF class.
See Also:   XTIFF
See Also:   XTIFFImage
See Also:   XTIFFTileCodec



setIsTiled
public void setIsTiled(boolean isTiled)(Code)
If set, the data will be written out in tiled format, instead of in strips.
Parameters:
  isTiled - Specifies whether the image data should be wriiten out in tiled format.



sizeOfType
public int sizeOfType(int type) throws ArrayIndexOutOfBoundsException(Code)
Return the size of a data type. Extend if you need to define new TIFF field types. Also override the createField() method of the XTIFFFactory, the XTIFFField class, and the readFieldValue() method here.
Parameters:
  type - the XTIFFField type code
See Also:   XTIFFField
See Also:   XTIFFFactory



unRegisterTileCodec
public static void unRegisterTileCodec(int comp)(Code)
UnRegister the XTIFFTileCodec corresponding to the TIFF compression type.
Parameters:
  comp - The TIFF compression code indicated



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.