visad.data.tiff
Class TiffForm

java.lang.Object
  extended by visad.data.FormNode
      extended by visad.data.Form
          extended by visad.data.tiff.TiffForm
All Implemented Interfaces:
FormFileInformer

public class TiffForm
extends Form
implements FormFileInformer

TiffForm is the VisAD data form for the TIFF file format. The following table indicates features that the form supports:

  uncompressed compressed (LZW)
single image read and write read only (with JAI)
multi-page read and write read only (with JAI)

Note that features marked with "(with JAI)" require the Java Advanced Imaging (JAI) package, available at Sun's Java Advanced Imaging web site. Also, no support for reading TIFF data from URLs is provided. However, the visad.data.jai package provides limited support for importing single-image TIFF data from a URL.


Field Summary
 
Fields inherited from class visad.data.Form
mathType
 
Constructor Summary
TiffForm()
          Constructs a new TIFF file form.
 
Method Summary
 void add(java.lang.String id, Data data, boolean replace)
          Adds data to an existing TIFF file.
 java.lang.String[] getDefaultSuffixes()
          Returns the default file suffixes for the TIFF file format.
 FormNode getForms(Data data)
          Return the data forms that are compatible with a data object.
 boolean isThisType(byte[] block)
          Checks if the given block is a valid header for a TIFF file.
 boolean isThisType(java.lang.String name)
          Checks if the given string is a valid filename for a TIFF file.
static void main(java.lang.String[] args)
          Run 'java visad.data.visad.TiffForm in_file out_file' to convert in_file to out_file in TIFF data format.
 DataImpl open(java.lang.String id)
          Opens an existing TIFF file from the given filename.
 DataImpl open(java.net.URL url)
          Opens an existing TIFF file from the given URL.
 void save(java.lang.String id, Data data, boolean replace)
          Saves a VisAD Data object to an uncompressed TIFF file.
 
Methods inherited from class visad.data.Form
getMathType
 
Methods inherited from class visad.data.FormNode
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TiffForm

public TiffForm()
Constructs a new TIFF file form.

Method Detail

isThisType

public boolean isThisType(java.lang.String name)
Checks if the given string is a valid filename for a TIFF file.

Specified by:
isThisType in interface FormFileInformer

isThisType

public boolean isThisType(byte[] block)
Checks if the given block is a valid header for a TIFF file.

Specified by:
isThisType in interface FormFileInformer

getDefaultSuffixes

public java.lang.String[] getDefaultSuffixes()
Returns the default file suffixes for the TIFF file format.

Specified by:
getDefaultSuffixes in interface FormFileInformer

save

public void save(java.lang.String id,
                 Data data,
                 boolean replace)
          throws BadFormException,
                 java.io.IOException,
                 java.rmi.RemoteException,
                 VisADException
Saves a VisAD Data object to an uncompressed TIFF file.

Specified by:
save in class FormNode
Parameters:
id - Filename of TIFF file to save.
data - VisAD Data to convert to TIFF format.
replace - Whether to overwrite an existing file.
Throws:
BadFormException
java.io.IOException
java.rmi.RemoteException
VisADException

add

public void add(java.lang.String id,
                Data data,
                boolean replace)
         throws BadFormException
Adds data to an existing TIFF file.

Specified by:
add in class FormNode
Throws:
BadFormException - Always thrown (method is not implemented).

open

public DataImpl open(java.lang.String id)
              throws BadFormException,
                     java.io.IOException,
                     VisADException
Opens an existing TIFF file from the given filename.

Specified by:
open in class FormNode
Returns:
VisAD Data object containing TIFF data.
Throws:
BadFormException
java.io.IOException
VisADException

open

public DataImpl open(java.net.URL url)
              throws BadFormException,
                     java.io.IOException,
                     VisADException
Opens an existing TIFF file from the given URL.

Specified by:
open in class FormNode
Returns:
VisAD Data object containing TIFF data.
Throws:
BadFormException - Always thrown (method is not implemented).
java.io.IOException
VisADException

getForms

public FormNode getForms(Data data)
Description copied from class: FormNode
Return the data forms that are compatible with a data object.

Specified by:
getForms in class FormNode

main

public static void main(java.lang.String[] args)
                 throws VisADException,
                        java.rmi.RemoteException,
                        java.io.IOException
Run 'java visad.data.visad.TiffForm in_file out_file' to convert in_file to out_file in TIFF data format.

Throws:
VisADException
java.rmi.RemoteException
java.io.IOException