Package adams.data.io.output
Class JAIExplicitImageWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractImageWriter<BufferedImageContainer>
-
- adams.data.io.output.JAIExplicitImageWriter
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,FileFormatHandler
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,ImageWriter<BufferedImageContainer>
,OutputStreamImageWriter<BufferedImageContainer>
,Serializable
public class JAIExplicitImageWriter extends AbstractImageWriter<BufferedImageContainer> implements OutputStreamImageWriter<BufferedImageContainer>
Java Advanced Imaging (JAI) image writer using explicit image type writers.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING min-user-mode: Expert
-writer <adams.data.io.output.jaiwriter.AbstractJAIWriter> (property: writer) The writer to use. default: adams.data.io.output.jaiwriter.JPEGWriter
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractJAIWriter
m_Writer
the actual writer to use.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description JAIExplicitImageWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected String
doWrite(PlaceholderFile file, BufferedImageContainer cont)
Performs the actual writing of the image file.ImageReader
getCorrespondingReader()
Returns, if available, the corresponding reader.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension(s) of the format.AbstractJAIWriter
getWriter()
Returns the writer to use.String
globalInfo()
Returns a string describing the object.void
setWriter(AbstractJAIWriter value)
Sets the writer to use.String
write(OutputStream stream, BufferedImageContainer cont)
Writes the image to the stream.String
writerTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.io.output.AbstractImageWriter
check, getDefaultFormatExtension, getWriters, isAvailable, write
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.io.FileFormatHandler
getDefaultFormatExtension
-
Methods inherited from interface adams.data.io.output.ImageWriter
isAvailable, write
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_Writer
protected AbstractJAIWriter m_Writer
the actual writer to use.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setWriter
public void setWriter(AbstractJAIWriter value)
Sets the writer to use.- Parameters:
value
- the writer
-
getWriter
public AbstractJAIWriter getWriter()
Returns the writer to use.- Returns:
- the writer
-
writerTipText
public String writerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceFileFormatHandler
- Specified by:
getFormatDescription
in classAbstractImageWriter<BufferedImageContainer>
- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensions
in interfaceFileFormatHandler
- Specified by:
getFormatExtensions
in classAbstractImageWriter<BufferedImageContainer>
- Returns:
- the extension(s) (without the dot!)
-
getCorrespondingReader
public ImageReader getCorrespondingReader()
Returns, if available, the corresponding reader.- Specified by:
getCorrespondingReader
in interfaceImageWriter<BufferedImageContainer>
- Specified by:
getCorrespondingReader
in classAbstractImageWriter<BufferedImageContainer>
- Returns:
- the reader, null if none available
-
doWrite
protected String doWrite(PlaceholderFile file, BufferedImageContainer cont)
Performs the actual writing of the image file.- Specified by:
doWrite
in classAbstractImageWriter<BufferedImageContainer>
- Parameters:
file
- the file to write tocont
- the image container to write- Returns:
- null if successfully written, otherwise error message
-
write
public String write(OutputStream stream, BufferedImageContainer cont)
Writes the image to the stream. Callers must close the stream.- Specified by:
write
in interfaceOutputStreamImageWriter<BufferedImageContainer>
- Parameters:
stream
- the stream to write tocont
- the image container to write- Returns:
- null if successfully written, otherwise error message
-
-