loci.formats.out
Class ImageIOWriter

java.lang.Object
  extended by loci.formats.FormatHandler
      extended by loci.formats.FormatWriter
          extended by loci.formats.out.ImageIOWriter
All Implemented Interfaces:
IFormatHandler, IFormatWriter, StatusReporter
Direct Known Subclasses:
JPEGWriter, PNGWriter

public abstract class ImageIOWriter
extends FormatWriter

ImageIOWriter is the superclass for file format writers that use the javax.imageio library.

Source code:
Trac, SVN

Author:
Curtis Rueden ctrueden at wisc.edu

Field Summary
protected  String kind
           
protected  DataOutputStream out
           
 
Fields inherited from class loci.formats.FormatWriter
cm, compression, compressionTypes, fps, initialized, metadataRetrieve
 
Fields inherited from class loci.formats.FormatHandler
currentId, debug, debugLevel, format, statusListeners, suffixes
 
Constructor Summary
ImageIOWriter(String format, String[] suffixes, String kind)
          Constructs an ImageIO-based writer with the given name, default suffixes and output type (e.g., png, jpeg).
ImageIOWriter(String format, String suffix, String kind)
          Constructs an ImageIO-based writer with the given name, default suffix and output type (e.g., png, jpeg).
 
Method Summary
 void close()
          Closes currently open file(s) and frees allocated memory.
 int[] getPixelTypes()
          Gets the supported pixel types.
 void saveImage(Image image, boolean last)
          Saves the given image to the current file.
 
Methods inherited from class loci.formats.FormatWriter
canDoStacks, canDoStacks, getColorModel, getCompressionTypes, getFramesPerSecond, getMetadataRetrieve, getPixelTypes, isSupportedType, isSupportedType, save, saveBytes, saveBytes, saveImage, setColorModel, setCompression, setFramesPerSecond, setId, setMetadataRetrieve
 
Methods inherited from class loci.formats.FormatHandler
addStatusListener, debug, getFormat, getStatusListeners, getSuffixes, isThisType, isThisType, removeStatusListener, setDebug, setDebugLevel, setId, status, status, status, trace, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface loci.formats.IFormatHandler
getFormat, getSuffixes, isThisType, isThisType, setId
 
Methods inherited from interface loci.formats.StatusReporter
addStatusListener, getStatusListeners, removeStatusListener
 

Field Detail

kind

protected String kind

out

protected DataOutputStream out
Constructor Detail

ImageIOWriter

public ImageIOWriter(String format,
                     String suffix,
                     String kind)
Constructs an ImageIO-based writer with the given name, default suffix and output type (e.g., png, jpeg).


ImageIOWriter

public ImageIOWriter(String format,
                     String[] suffixes,
                     String kind)
Constructs an ImageIO-based writer with the given name, default suffixes and output type (e.g., png, jpeg).

Method Detail

saveImage

public void saveImage(Image image,
                      boolean last)
               throws FormatException,
                      IOException
Description copied from interface: IFormatWriter
Saves the given image to the current file. If this image is the last one in the file, the last flag must be set.

Throws:
FormatException
IOException

getPixelTypes

public int[] getPixelTypes()
Description copied from interface: IFormatWriter
Gets the supported pixel types.

Specified by:
getPixelTypes in interface IFormatWriter
Overrides:
getPixelTypes in class FormatWriter

close

public void close()
           throws IOException
Description copied from interface: IFormatHandler
Closes currently open file(s) and frees allocated memory.

Throws:
IOException