Package adams.gui.print
Class JPEGWriter
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
public class JPEGWriter extends BufferedImageBasedWriter
Outputs JPEG images.
Valid options are:
-D (property: debug) If set to true, scheme may output additional info to the console.
-file <adams.core.io.PlaceholderFile> (property: file) The file to save the image to. default: .
-scaling (property: scalingEnabled) If set to true, then scaling will be used.
-scale-x <double> (property: XScale) The scaling factor for the X-axis. default: 1.0
-scale-y <double> (property: YScale) The scaling factor for the Y axis. default: 1.0
-custom-dimensions (property: useCustomDimensions) Whether to use custom dimensions or use the component's ones.
-custom-width <int> (property: customWidth) The custom width. default: -1
-custom-height <int> (property: customHeight) The custom height. default: -1
-background <java.awt.Color> (property: background) The background color. default: #ffffff
-type <RGB|GRAY> (property: type) The type of image to create. default: RGB
-quality <double> (property: quality) The JPEG quality (0.0 - 1.0). default: 1.0
Based on weka.gui.visualize.JPEGWriter- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.gui.print.BufferedImageBasedWriter
BufferedImageBasedWriter.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected double
m_Quality
the quality of the image.-
Fields inherited from class adams.gui.print.BufferedImageBasedWriter
m_Background, m_Type
-
Fields inherited from class adams.gui.print.ScalableComponentWriter
m_ScalingEnabled, m_xScale, m_yScale
-
Fields inherited from class adams.gui.print.JComponentWriter
m_Component, m_CustomHeight, m_CustomWidth, m_Enabled, m_OutputFile, m_UseCustomDimensions
-
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 JPEGWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.void
generateOutput()
generates the actual output.String
getDescription()
returns the name of the writer, to display in the FileChooser.String[]
getExtensions()
returns the extensions (incl.double
getQuality()
returns the quality the JPEG will be stored in.String
globalInfo()
Returns a string describing the object.String
qualityTipText()
Returns the tip text for this property.void
setQuality(double value)
sets the quality the JPEG is saved in.-
Methods inherited from class adams.gui.print.BufferedImageBasedWriter
backgroundTipText, createBufferedImage, getBackground, getType, newImage, setBackground, setType, typeTipText
-
Methods inherited from class adams.gui.print.ScalableComponentWriter
getScalingEnabled, getXScale, getYScale, scalingEnabledTipText, setScalingEnabled, setXScale, setYScale, XScaleTipText, YScaleTipText
-
Methods inherited from class adams.gui.print.JComponentWriter
customHeightTipText, customWidthTipText, enabledTipText, fileTipText, forCommandLine, forName, getComponent, getCustomHeight, getCustomWidth, getEnabled, getFile, getFileFilters, getUseCustomDimensions, getWriterForExtension, getWriterForFile, getWriterForFile, getWriters, main, setComponent, setCustomHeight, setCustomWidth, setEnabled, setFile, setUseCustomDimensions, toOutput, toOutput, toOutput, useCustomDimensionsTipText
-
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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
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 classBufferedImageBasedWriter
-
getDescription
public String getDescription()
returns the name of the writer, to display in the FileChooser.- Specified by:
getDescription
in classJComponentWriter
- Returns:
- the name of the writer
-
getExtensions
public String[] getExtensions()
returns the extensions (incl. ".") of the output format, to use in the FileChooser.- Specified by:
getExtensions
in classJComponentWriter
- Returns:
- the file extensions
-
setQuality
public void setQuality(double value)
sets the quality the JPEG is saved in.- Parameters:
value
- the quality to use
-
getQuality
public double getQuality()
returns the quality the JPEG will be stored in.- Returns:
- the quality
-
qualityTipText
public String qualityTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
generateOutput
public void generateOutput() throws Exception
generates the actual output.- Specified by:
generateOutput
in classJComponentWriter
- Throws:
Exception
- if something goes wrong
-
-