Package adams.data.io.output.jaiwriter
Class AbstractJAIWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.jaiwriter.AbstractJAIWriter
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
BMPWriter
,GIFWriter
,JPEGWriter
,PNGWriter
public abstract class AbstractJAIWriter extends AbstractOptionHandler
Ancestor for classes that return a configured JAI ImageIO writer.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
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 AbstractJAIWriter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String[]
getFormatExtensions()
Returns the extension(s) of the format.abstract ImageWriteParam
getParameters()
Returns the parameters for the writer.abstract ImageWriter
getWriter()
Returns the writer.abstract boolean
removeAlphaChannel()
Returns whether the alpha channel must be removed.String
write(PlaceholderFile file, BufferedImage img)
Performs the actual writing of the image file.String
write(OutputStream stream, BufferedImage img)
Writes the image to the stream.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
getFormatExtensions
public abstract String[] getFormatExtensions()
Returns the extension(s) of the format.- Returns:
- the extension(s) (without the dot!)
-
getWriter
public abstract ImageWriter getWriter() throws Exception
Returns the writer.- Returns:
- the writer
- Throws:
Exception
- if determining of writer fails
-
getParameters
public abstract ImageWriteParam getParameters() throws Exception
Returns the parameters for the writer.- Returns:
- the parameters
- Throws:
Exception
- if determining of writer or setting of parameters fails
-
removeAlphaChannel
public abstract boolean removeAlphaChannel()
Returns whether the alpha channel must be removed.- Returns:
- true if to remove
-
write
public String write(PlaceholderFile file, BufferedImage img)
Performs the actual writing of the image file.- Parameters:
file
- the file to write toimg
- the image to write- Returns:
- null if successfully written, otherwise error message
-
write
public String write(OutputStream stream, BufferedImage img)
Writes the image to the stream. Callers must close the stream.- Parameters:
stream
- the stream to write toimg
- the image to write- Returns:
- null if successfully written, otherwise error message
-
-