loci.formats
Class ImageWriter

java.lang.Object
  extended byloci.formats.FormatHandler
      extended byloci.formats.FormatWriter
          extended byloci.formats.ImageWriter

public class ImageWriter
extends FormatWriter

ImageWriter is master file format writer for all supported formats.


Field Summary
protected  int index
          Current form index.
protected static Class[] writerClasses
          List of writer classes.
protected  FormatWriter[] writers
          List of supported file format writers.
 
Fields inherited from class loci.formats.FormatWriter
fps
 
Fields inherited from class loci.formats.FormatHandler
chooser, currentId, filters, format, suffixes
 
Constructor Summary
ImageWriter()
          Constructs a new ImageWriter.
 
Method Summary
protected  void createFilters()
          Creates JFileChooser file filters for this file format.
 String getFormat(String id)
          Gets a string describing the file format for the given file.
 FormatWriter getWriter(Class c)
          Gets the file format writer instance matching the given class.
 FormatWriter getWriter(String id)
          Gets the writer used to save the given file.
protected  void initFile(String id)
          Initializes the given image file.
static void main(String[] args)
           
 void save(String id, Image image, boolean last)
          Saves the given image to the specified (possibly already open) file.
 void testConvert(String[] args)
          A utility method for converting a file from the command line.
 
Methods inherited from class loci.formats.FormatWriter
getFramesPerSecond, save, setFramesPerSecond
 
Methods inherited from class loci.formats.FormatHandler
getFileChooser, getFileFilters, getFormat, getSuffixes, isThisType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writerClasses

protected static Class[] writerClasses
List of writer classes.


writers

protected FormatWriter[] writers
List of supported file format writers.


index

protected int index
Current form index.

Constructor Detail

ImageWriter

public ImageWriter()
Constructs a new ImageWriter.

Method Detail

getFormat

public String getFormat(String id)
                 throws FormatException,
                        IOException
Gets a string describing the file format for the given file.

Throws:
FormatException
IOException

getWriter

public FormatWriter getWriter(String id)
                       throws FormatException,
                              IOException
Gets the writer used to save the given file.

Throws:
FormatException
IOException

getWriter

public FormatWriter getWriter(Class c)
Gets the file format writer instance matching the given class.


save

public void save(String id,
                 Image image,
                 boolean last)
          throws FormatException,
                 IOException
Saves the given image to the specified (possibly already open) file. If this image is the last one in the file, the last flag must be set.

Specified by:
save in class FormatWriter
Throws:
FormatException
IOException

testConvert

public void testConvert(String[] args)
                 throws FormatException,
                        IOException
A utility method for converting a file from the command line.

Overrides:
testConvert in class FormatWriter
Throws:
FormatException
IOException

createFilters

protected void createFilters()
Creates JFileChooser file filters for this file format.

Overrides:
createFilters in class FormatHandler

initFile

protected void initFile(String id)
                 throws FormatException,
                        IOException
Initializes the given image file.

Throws:
FormatException
IOException

main

public static void main(String[] args)
                 throws FormatException,
                        IOException
Throws:
FormatException
IOException