|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectloci.formats.ImageWriter
public class ImageWriter
ImageWriter is the master file format writer for all supported formats. It uses one instance of each writer subclass (specified in writers.txt, or other class list source) to identify file formats and write data.
Field Summary | |
---|---|
protected String[] |
compressionTypes
Compression types for all file format writers. |
protected int |
current
Current form index. |
protected String |
currentId
Name of current file. |
protected IFormatWriter[] |
writers
List of supported file format writers. |
Constructor Summary | |
---|---|
ImageWriter()
Constructs a new ImageWriter with the default list of writer classes from writers.txt. |
|
ImageWriter(ClassList classList)
Constructs a new ImageWriter from the given list of writer classes. |
Method Summary | |
---|---|
void |
addStatusListener(StatusListener l)
Adds a listener for status update events. |
boolean |
canDoStacks()
Reports whether the writer can save multiple images to a single file. |
boolean |
canDoStacks(String id)
Deprecated. Replaced by canDoStacks() |
void |
close()
Closes currently open file(s) and frees allocated memory. |
ColorModel |
getColorModel()
Gets the color model. |
String[] |
getCompressionTypes()
Gets the available compression types. |
String |
getFormat()
Gets the name of this file format. |
String |
getFormat(String id)
Gets a string describing the file format for the given file. |
int |
getFramesPerSecond()
Gets the frames per second to use when writing. |
MetadataRetrieve |
getMetadataRetrieve()
Retrieves the current metadata retrieval object for this writer. |
int[] |
getPixelTypes()
Gets the supported pixel types. |
int[] |
getPixelTypes(String id)
Deprecated. Replaced by getPixelTypes() |
StatusListener[] |
getStatusListeners()
Gets a list of all registered status update listeners. |
String[] |
getSuffixes()
Gets the default file suffixes for this file format. |
IFormatWriter |
getWriter()
Gets the writer used to save the current file. |
IFormatWriter |
getWriter(Class c)
Gets the file format writer instance matching the given class. |
IFormatWriter |
getWriter(String id)
Gets the writer used to save the given file. |
IFormatWriter[] |
getWriters()
Gets all constituent file format writers. |
boolean |
isSupportedType(int type)
Checks if the given pixel type is supported. |
boolean |
isSupportedType(String id,
int type)
Deprecated. Replaced by isSupportedType(int type) |
boolean |
isThisType(String name)
Checks if the given string is a valid filename for this file format. |
boolean |
isThisType(String name,
boolean open)
Checks if the given string is a valid filename for this file format. |
void |
removeStatusListener(StatusListener l)
Removes a listener for status update events. |
void |
save(String id,
Image image,
boolean last)
Deprecated. Replaced by saveImage(Image, boolean) |
void |
saveBytes(byte[] bytes,
boolean last)
Saves the given byte array to the current file. |
void |
saveBytes(byte[] bytes,
int series,
boolean lastInSeries,
boolean last)
Saves the given byte array to the given series in the current file. |
void |
saveImage(Image image,
boolean last)
Saves the given image to the current file. |
void |
saveImage(Image image,
int series,
boolean lastInSeries,
boolean last)
Saves the given image to the given series in the current file. |
void |
setColorModel(ColorModel cm)
Sets the color model. |
void |
setCompression(String compress)
Sets the current compression type. |
void |
setFramesPerSecond(int rate)
Sets the frames per second to use when writing. |
void |
setId(String id)
Sets the current file name. |
void |
setId(String id,
boolean force)
Sets the current file name. |
void |
setMetadataRetrieve(MetadataRetrieve r)
Sets the metadata retrieval object from which to retrieve standardized metadata. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IFormatWriter[] writers
protected String[] compressionTypes
protected String currentId
protected int current
Constructor Detail |
---|
public ImageWriter()
public ImageWriter(ClassList classList)
Method Detail |
---|
public String getFormat(String id) throws FormatException, IOException
FormatException
IOException
public IFormatWriter getWriter(String id) throws FormatException
FormatException
public IFormatWriter getWriter()
public IFormatWriter getWriter(Class c)
public IFormatWriter[] getWriters()
public void saveBytes(byte[] bytes, boolean last) throws FormatException, IOException
IFormatWriter
saveBytes
in interface IFormatWriter
FormatException
IOException
public void saveBytes(byte[] bytes, int series, boolean lastInSeries, boolean last) throws FormatException, IOException
IFormatWriter
saveBytes
in interface IFormatWriter
FormatException
IOException
public void saveImage(Image image, boolean last) throws FormatException, IOException
IFormatWriter
saveImage
in interface IFormatWriter
FormatException
IOException
public void saveImage(Image image, int series, boolean lastInSeries, boolean last) throws FormatException, IOException
IFormatWriter
saveImage
in interface IFormatWriter
FormatException
IOException
public boolean canDoStacks()
IFormatWriter
canDoStacks
in interface IFormatWriter
public void setMetadataRetrieve(MetadataRetrieve r)
IFormatWriter
setMetadataRetrieve
in interface IFormatWriter
public MetadataRetrieve getMetadataRetrieve()
IFormatWriter
null
metadata retrieval object.
getMetadataRetrieve
in interface IFormatWriter
public void setColorModel(ColorModel cm)
IFormatWriter
setColorModel
in interface IFormatWriter
public ColorModel getColorModel()
IFormatWriter
getColorModel
in interface IFormatWriter
public void setFramesPerSecond(int rate)
IFormatWriter
setFramesPerSecond
in interface IFormatWriter
public int getFramesPerSecond()
IFormatWriter
getFramesPerSecond
in interface IFormatWriter
public String[] getCompressionTypes()
IFormatWriter
getCompressionTypes
in interface IFormatWriter
public int[] getPixelTypes()
IFormatWriter
getPixelTypes
in interface IFormatWriter
public boolean isSupportedType(int type)
IFormatWriter
isSupportedType
in interface IFormatWriter
public void setCompression(String compress) throws FormatException
IFormatWriter
setCompression
in interface IFormatWriter
FormatException
public boolean isThisType(String name)
IFormatHandler
isThisType
in interface IFormatHandler
public boolean isThisType(String name, boolean open)
IFormatHandler
isThisType
in interface IFormatHandler
open
- If true, and the file extension is insufficient to determine
the file type, the (existing) file is opened for further analysis.public String getFormat()
IFormatHandler
getFormat
in interface IFormatHandler
public String[] getSuffixes()
IFormatHandler
getSuffixes
in interface IFormatHandler
public void setId(String id) throws FormatException, IOException
IFormatHandler
setId
in interface IFormatHandler
FormatException
IOException
public void setId(String id, boolean force) throws FormatException, IOException
IFormatHandler
setId
in interface IFormatHandler
force
- If set, the handler will be re-initialized no matter what.
FormatException
IOException
public void close() throws IOException
IFormatHandler
close
in interface IFormatHandler
IOException
public void addStatusListener(StatusListener l)
StatusReporter
addStatusListener
in interface StatusReporter
public void removeStatusListener(StatusListener l)
StatusReporter
removeStatusListener
in interface StatusReporter
public StatusListener[] getStatusListeners()
StatusReporter
getStatusListeners
in interface StatusReporter
public boolean canDoStacks(String id) throws FormatException
canDoStacks()
canDoStacks
in interface IFormatWriter
FormatException
public int[] getPixelTypes(String id) throws FormatException, IOException
getPixelTypes()
getPixelTypes
in interface IFormatWriter
FormatException
IOException
public boolean isSupportedType(String id, int type) throws FormatException, IOException
isSupportedType(int type)
isSupportedType
in interface IFormatWriter
FormatException
IOException
public void save(String id, Image image, boolean last) throws FormatException, IOException
saveImage(Image, boolean)
save
in interface IFormatWriter
FormatException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |