Java Doc for TIFFField.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » com » sun » media » 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 » 6.0 JDK Modules » Java Advanced Imaging » com.sun.media.jai.codec 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.media.jai.codec.TIFFField

TIFFField
public class TIFFField extends Object implements Comparable,Serializable(Code)
A class representing a field in a TIFF 6.0 Image File Directory.

The TIFF file format is described in more detail in the comments for the TIFFDescriptor class.

A field in a TIFF Image File Directory (IFD). A field is defined as a sequence of values of identical data type. TIFF 6.0 defines 12 data types, which are mapped internally onto the Java datatypes byte, int, long, float, and double.

This class is not a committed part of the JAI API. It may be removed or changed in future releases of JAI.
See Also:   javax.media.jai.operator.TIFFDescriptor
See Also:   TIFFDirectory



Field Summary
final public static  intTIFF_ASCII
     Flag for null-terminated ASCII strings.
final public static  intTIFF_BYTE
     Flag for 8 bit unsigned integers.
final public static  intTIFF_DOUBLE
     Flag for 64 bit IEEE doubles.
final public static  intTIFF_FLOAT
     Flag for 32 bit IEEE floats.
final public static  intTIFF_LONG
     Flag for 32 bit unsigned integers.
final public static  intTIFF_RATIONAL
     Flag for pairs of 32 bit unsigned integers.
final public static  intTIFF_SBYTE
     Flag for 8 bit signed integers.
final public static  intTIFF_SHORT
     Flag for 16 bit unsigned integers.
final public static  intTIFF_SLONG
     Flag for 32 bit signed integers.
final public static  intTIFF_SRATIONAL
     Flag for pairs of 32 bit signed integers.
final public static  intTIFF_SSHORT
     Flag for 16 bit signed integers.
final public static  intTIFF_UNDEFINED
     Flag for 8 bit uninterpreted bytes.
 intcount
     The number of data items present in the field.
 Objectdata
     The field data.
 inttag
     The tag number.
 inttype
     The tag type.

Constructor Summary
 TIFFField()
     The default constructor.
public  TIFFField(int tag, int type, int count, Object data)
     Constructs a TIFFField with arbitrary data.

Method Summary
public  intcompareTo(Object o)
     Compares this TIFFField with another TIFFField by comparing the tags.
public  byte[]getAsBytes()
     Returns the data as an uninterpreted array of bytes.
public  char[]getAsChars()
     Returns TIFF_SHORT data as an array of chars (unsigned 16-bit integers).
public  doublegetAsDouble(int index)
     Returns data in any numerical format as a float.
public  double[]getAsDoubles()
     Returns TIFF_DOUBLE data as an array of doubles.
public  floatgetAsFloat(int index)
     Returns data in any numerical format as a float.
public  float[]getAsFloats()
     Returns TIFF_FLOAT data as an array of floats.
public  intgetAsInt(int index)
     Returns data in TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, TIFF_SHORT, TIFF_SSHORT, or TIFF_SLONG format as an int.

TIFF_BYTE and TIFF_UNDEFINED data are treated as unsigned; that is, no sign extension will take place and the returned value will be in the range [0, 255].

public  int[]getAsInts()
     Returns TIFF_SLONG data as an array of ints (signed 32-bit integers).
public  longgetAsLong(int index)
     Returns data in TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG, or TIFF_LONG format as a long.

TIFF_BYTE and TIFF_UNDEFINED data are treated as unsigned; that is, no sign extension will take place and the returned value will be in the range [0, 255].

public  long[]getAsLongs()
     Returns TIFF_LONG data as an array of longs (signed 64-bit integers).
public  long[]getAsRational(int index)
     Returns a TIFF_RATIONAL data item as a two-element array of ints.
public  long[][]getAsRationals()
     Returns TIFF_RATIONAL data as an array of 2-element arrays of longs.
public  int[]getAsSRational(int index)
     Returns a TIFF_SRATIONAL data item as a two-element array of ints.
public  int[][]getAsSRationals()
     Returns TIFF_SRATIONAL data as an array of 2-element arrays of ints.
public  short[]getAsShorts()
     Returns TIFF_SSHORT data as an array of shorts (signed 16-bit integers).
public  StringgetAsString(int index)
     Returns a TIFF_ASCII data item as a String.
public  intgetCount()
     Returns the number of data items present in the field.
public  intgetTag()
     Returns the tag number, between 0 and 65535.
public  intgetType()
     Returns the type of the data stored in the field. For a TIFF6.0 file, the value will equal one of the TIFF_ constants defined in this class.

Field Detail
TIFF_ASCII
final public static int TIFF_ASCII(Code)
Flag for null-terminated ASCII strings.



TIFF_BYTE
final public static int TIFF_BYTE(Code)
Flag for 8 bit unsigned integers.



TIFF_DOUBLE
final public static int TIFF_DOUBLE(Code)
Flag for 64 bit IEEE doubles.



TIFF_FLOAT
final public static int TIFF_FLOAT(Code)
Flag for 32 bit IEEE floats.



TIFF_LONG
final public static int TIFF_LONG(Code)
Flag for 32 bit unsigned integers.



TIFF_RATIONAL
final public static int TIFF_RATIONAL(Code)
Flag for pairs of 32 bit unsigned integers.



TIFF_SBYTE
final public static int TIFF_SBYTE(Code)
Flag for 8 bit signed integers.



TIFF_SHORT
final public static int TIFF_SHORT(Code)
Flag for 16 bit unsigned integers.



TIFF_SLONG
final public static int TIFF_SLONG(Code)
Flag for 32 bit signed integers.



TIFF_SRATIONAL
final public static int TIFF_SRATIONAL(Code)
Flag for pairs of 32 bit signed integers.



TIFF_SSHORT
final public static int TIFF_SSHORT(Code)
Flag for 16 bit signed integers.



TIFF_UNDEFINED
final public static int TIFF_UNDEFINED(Code)
Flag for 8 bit uninterpreted bytes.



count
int count(Code)
The number of data items present in the field.



data
Object data(Code)
The field data.



tag
int tag(Code)
The tag number.



type
int type(Code)
The tag type.




Constructor Detail
TIFFField
TIFFField()(Code)
The default constructor.



TIFFField
public TIFFField(int tag, int type, int count, Object data)(Code)
Constructs a TIFFField with arbitrary data. The data parameter must be an array of a Java type appropriate for the type of the TIFF field. Since there is no available 32-bit unsigned datatype, long is used. The mapping between types is as follows:
TIFF type Java type
TIFF_BYTE byte
TIFF_ASCII String
TIFF_SHORT char
TIFF_LONG long
TIFF_RATIONAL long[2]
TIFF_SBYTE byte
TIFF_UNDEFINED byte
TIFF_SSHORT short
TIFF_SLONG int
TIFF_SRATIONAL int[2]
TIFF_FLOAT float
TIFF_DOUBLE double

Note that the data parameter should always be the actual field value regardless of the number of bytes required for that value. This is the case despite the fact that the TIFF IFD Entry corresponding to the field may actually contain the offset to the field's value rather than the value itself (the latter occurring if and only if the value fits into 4 bytes).





Method Detail
compareTo
public int compareTo(Object o)(Code)
Compares this TIFFField with another TIFFField by comparing the tags.

Note: this class has a natural ordering that is inconsistent with equals().
throws:
  IllegalArgumentException - if the parameter is null.
throws:
  ClassCastException - if the parameter is not aTIFFField.




getAsBytes
public byte[] getAsBytes()(Code)
Returns the data as an uninterpreted array of bytes. The type of the field must be one of TIFF_BYTE, TIFF_SBYTE, or TIFF_UNDEFINED;

For data in TIFF_BYTE format, the application must take care when promoting the data to longer integral types to avoid sign extension.

A ClassCastException will be thrown if the field is not of type TIFF_BYTE, TIFF_SBYTE, or TIFF_UNDEFINED.




getAsChars
public char[] getAsChars()(Code)
Returns TIFF_SHORT data as an array of chars (unsigned 16-bit integers).

A ClassCastException will be thrown if the field is not of type TIFF_SHORT.




getAsDouble
public double getAsDouble(int index)(Code)
Returns data in any numerical format as a float. Data in TIFF_SRATIONAL or TIFF_RATIONAL format are evaluated by dividing the numerator into the denominator using double-precision arithmetic.

A ClassCastException will be thrown if the field is of type TIFF_UNDEFINED or TIFF_ASCII.




getAsDoubles
public double[] getAsDoubles()(Code)
Returns TIFF_DOUBLE data as an array of doubles.

A ClassCastException will be thrown if the field is not of type TIFF_DOUBLE.




getAsFloat
public float getAsFloat(int index)(Code)
Returns data in any numerical format as a float. Data in TIFF_SRATIONAL or TIFF_RATIONAL format are evaluated by dividing the numerator into the denominator using double-precision arithmetic and then truncating to single precision. Data in TIFF_SLONG, TIFF_LONG, or TIFF_DOUBLE format may suffer from truncation.

A ClassCastException will be thrown if the field is of type TIFF_UNDEFINED or TIFF_ASCII.




getAsFloats
public float[] getAsFloats()(Code)
Returns TIFF_FLOAT data as an array of floats.

A ClassCastException will be thrown if the field is not of type TIFF_FLOAT.




getAsInt
public int getAsInt(int index)(Code)
Returns data in TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, TIFF_SHORT, TIFF_SSHORT, or TIFF_SLONG format as an int.

TIFF_BYTE and TIFF_UNDEFINED data are treated as unsigned; that is, no sign extension will take place and the returned value will be in the range [0, 255]. TIFF_SBYTE data will be returned in the range [-128, 127].

A ClassCastException will be thrown if the field is not of type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, TIFF_SHORT, TIFF_SSHORT, or TIFF_SLONG.




getAsInts
public int[] getAsInts()(Code)
Returns TIFF_SLONG data as an array of ints (signed 32-bit integers).

A ClassCastException will be thrown if the field is not of type TIFF_SLONG.




getAsLong
public long getAsLong(int index)(Code)
Returns data in TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG, or TIFF_LONG format as a long.

TIFF_BYTE and TIFF_UNDEFINED data are treated as unsigned; that is, no sign extension will take place and the returned value will be in the range [0, 255]. TIFF_SBYTE data will be returned in the range [-128, 127].

A ClassCastException will be thrown if the field is not of type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG, or TIFF_LONG.




getAsLongs
public long[] getAsLongs()(Code)
Returns TIFF_LONG data as an array of longs (signed 64-bit integers).

A ClassCastException will be thrown if the field is not of type TIFF_LONG.




getAsRational
public long[] getAsRational(int index)(Code)
Returns a TIFF_RATIONAL data item as a two-element array of ints.

A ClassCastException will be thrown if the field is not of type TIFF_RATIONAL.




getAsRationals
public long[][] getAsRationals()(Code)
Returns TIFF_RATIONAL data as an array of 2-element arrays of longs.

A ClassCastException will be thrown if the field is not of type TIFF_RATTIONAL.




getAsSRational
public int[] getAsSRational(int index)(Code)
Returns a TIFF_SRATIONAL data item as a two-element array of ints.

A ClassCastException will be thrown if the field is not of type TIFF_SRATIONAL.




getAsSRationals
public int[][] getAsSRationals()(Code)
Returns TIFF_SRATIONAL data as an array of 2-element arrays of ints.

A ClassCastException will be thrown if the field is not of type TIFF_SRATIONAL.




getAsShorts
public short[] getAsShorts()(Code)
Returns TIFF_SSHORT data as an array of shorts (signed 16-bit integers).

A ClassCastException will be thrown if the field is not of type TIFF_SSHORT.




getAsString
public String getAsString(int index)(Code)
Returns a TIFF_ASCII data item as a String.

A ClassCastException will be thrown if the field is not of type TIFF_ASCII.




getCount
public int getCount()(Code)
Returns the number of data items present in the field.



getTag
public int getTag()(Code)
Returns the tag number, between 0 and 65535.



getType
public int getType()(Code)
Returns the type of the data stored in the field. For a TIFF6.0 file, the value will equal one of the TIFF_ constants defined in this class. For future revisions of TIFF, higher values are possible.



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.