visad.data.tiff
Class LegacyTiffForm
- java.lang.Object
-
- visad.data.FormNode
-
- visad.data.Form
-
- visad.data.tiff.LegacyTiffForm
-
- All Implemented Interfaces:
- FormBlockReader, FormFileInformer, FormProgressInformer
Deprecated.Use TiffForm, or visad.data.bio.LociForm with loci.formats.in.TiffReader and loci.formats.out.TiffWriter
public class LegacyTiffForm extends Form implements FormFileInformer, FormBlockReader, FormProgressInformer
LegacyTiffForm is the old VisAD data form for the TIFF file format. It relies on either ImageJ or JAI being available in the class path, and is very inefficient when dealing with large multi-page TIFF files. 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) This form requires ImageJ, available from the ImageJ web site. Note that features marked with "(with JAI)" also 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.
-
-
Constructor Summary
Constructors Constructor and Description LegacyTiffForm()Deprecated.Constructs a new TIFF file form.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voidadd(java.lang.String id, Data data, boolean replace)Deprecated.Adds data to an existing TIFF file.voidclose()Deprecated.Closes any open files.intgetBlockCount(java.lang.String id)Deprecated.Determines the number of blocks in the given file.java.lang.String[]getDefaultSuffixes()Deprecated.Returns the default file SUFFIXES for the TIFF file format.FormNodegetForms(Data data)Deprecated.Return the data forms that are compatible with a data object.doublegetPercentComplete()Deprecated.Get the percentage complete of the form's current operation.booleanisThisType(byte[] block)Deprecated.Checks if the given block is a valid header for a TIFF file.booleanisThisType(java.lang.String name)Deprecated.Checks if the given string is a valid filename for a TIFF file.static voidmain(java.lang.String[] args)Deprecated.Run 'java visad.data.visad.LegacyTiffForm in_file out_file' to convert in_file to out_file in TIFF data format.DataImplopen(java.lang.String id)Deprecated.Opens an existing TIFF file from the given filename.DataImplopen(java.lang.String id, int block_number)Deprecated.Obtains the specified block from the given file.DataImplopen(java.net.URL url)Deprecated.Opens an existing TIFF file from the given URL.voidsave(java.lang.String id, Data data, boolean replace)Deprecated.Saves a VisAD Data object to an uncompressed TIFF file.-
Methods inherited from class visad.data.Form
getMathType
-
-
-
-
Constructor Detail
-
LegacyTiffForm
public LegacyTiffForm()
Deprecated.Constructs a new TIFF file form.
-
-
Method Detail
-
isThisType
public boolean isThisType(java.lang.String name)
Deprecated.Checks if the given string is a valid filename for a TIFF file.- Specified by:
isThisTypein interfaceFormFileInformer- Parameters:
name- name of the file- Returns:
- true if the name is right for this type of form
-
isThisType
public boolean isThisType(byte[] block)
Deprecated.Checks if the given block is a valid header for a TIFF file.- Specified by:
isThisTypein interfaceFormFileInformer- Parameters:
block- block of bytes from file- Returns:
- true if the magic number is right
-
getDefaultSuffixes
public java.lang.String[] getDefaultSuffixes()
Deprecated.Returns the default file SUFFIXES for the TIFF file format.- Specified by:
getDefaultSuffixesin interfaceFormFileInformer- Returns:
- array of suffixes
-
save
public void save(java.lang.String id, Data data, boolean replace) throws BadFormException, java.io.IOException, java.rmi.RemoteException, VisADExceptionDeprecated.Saves a VisAD Data object to an uncompressed TIFF file.- Specified by:
savein classFormNode- Parameters:
id- Filename of TIFF file to save.data- VisAD Data to convert to TIFF format.replace- Whether to overwrite an existing file.- Throws:
BadFormExceptionjava.io.IOExceptionjava.rmi.RemoteExceptionVisADException
-
add
public void add(java.lang.String id, Data data, boolean replace) throws BadFormExceptionDeprecated.Adds data to an existing TIFF file.- Specified by:
addin classFormNode- Throws:
BadFormException- Always thrown (method is not implemented).
-
open
public DataImpl open(java.lang.String id) throws BadFormException, java.io.IOException, VisADException
Deprecated.Opens an existing TIFF file from the given filename.- Specified by:
openin classFormNode- Returns:
- VisAD Data object containing TIFF data.
- Throws:
BadFormExceptionjava.io.IOExceptionVisADException
-
open
public DataImpl open(java.net.URL url) throws BadFormException, java.io.IOException, VisADException
Deprecated.Opens an existing TIFF file from the given URL.- Specified by:
openin classFormNode- Returns:
- VisAD Data object containing TIFF data.
- Throws:
BadFormException- Always thrown (method is not implemented).java.io.IOExceptionVisADException
-
getForms
public FormNode getForms(Data data)
Deprecated.Description copied from class:FormNodeReturn the data forms that are compatible with a data object.
-
open
public DataImpl open(java.lang.String id, int block_number) throws BadFormException, java.io.IOException, VisADException
Deprecated.Description copied from interface:FormBlockReaderObtains the specified block from the given file.- Specified by:
openin interfaceFormBlockReader- Parameters:
id- The file from which to load data blocks.block_number- The block number of the block to load.- Throws:
VisADException- If the block number is invalid.BadFormExceptionjava.io.IOException
-
getBlockCount
public int getBlockCount(java.lang.String id) throws BadFormException, java.io.IOException, VisADExceptionDeprecated.Description copied from interface:FormBlockReaderDetermines the number of blocks in the given file.- Specified by:
getBlockCountin interfaceFormBlockReader- Parameters:
id- The file for which to get a block count.- Throws:
BadFormExceptionjava.io.IOExceptionVisADException
-
close
public void close() throws BadFormException, java.io.IOException, VisADExceptionDeprecated.Description copied from interface:FormBlockReaderCloses any open files.- Specified by:
closein interfaceFormBlockReader- Throws:
BadFormExceptionjava.io.IOExceptionVisADException
-
getPercentComplete
public double getPercentComplete()
Deprecated.Description copied from interface:FormProgressInformerGet the percentage complete of the form's current operation.- Specified by:
getPercentCompletein interfaceFormProgressInformer- Returns:
- The percentage complete (0.0 - 100.0), or Double.NaN if no operation is currently taking place.
-
main
public static void main(java.lang.String[] args) throws VisADException, java.rmi.RemoteException, java.io.IOExceptionDeprecated.Run 'java visad.data.visad.LegacyTiffForm in_file out_file' to convert in_file to out_file in TIFF data format.- Throws:
VisADExceptionjava.rmi.RemoteExceptionjava.io.IOException
-
-
DMelt 3.0 © DataMelt by jWork.ORG