Package adams.data.spectrumimage
Class AbstractSpectrumImageGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.spectrumimage.AbstractSpectrumImageGenerator
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,Serializable
- Direct Known Subclasses:
AbstractSpectrumImageGeneratorWithRange
public abstract class AbstractSpectrumImageGenerator extends adams.core.option.AbstractOptionHandler
Ancestor for image generators from spectra.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ImageType
m_ImageType
the image type to generate.
-
Constructor Summary
Constructors Constructor Description AbstractSpectrumImageGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
check(Spectrum spectrum)
Hook method for checks before generating the image.void
defineOptions()
Adds options to the internal list of options.protected abstract BufferedImage
doGenerate(Spectrum spectrum)
Converts the spectrum into an image.BufferedImage
generate(Spectrum spectrum)
Converts the spectrum into an image.ImageType
getImageType()
Returns the type of image to generate.String
imageTypeTipText()
Returns the tip text for this property.protected BufferedImage
newImage(int width, int height)
Creates a new image.void
setImageType(ImageType value)
Sets the type of image to generate.protected void
setPixel(BufferedImage img, int x, int y, int val)
Sets the pixel in the image.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, 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
-
-
-
-
Field Detail
-
m_ImageType
protected ImageType m_ImageType
the image type to generate.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setImageType
public void setImageType(ImageType value)
Sets the type of image to generate.- Parameters:
value
- the type
-
getImageType
public ImageType getImageType()
Returns the type of image to generate.- Returns:
- the type
-
imageTypeTipText
public String imageTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
check
protected String check(Spectrum spectrum)
Hook method for checks before generating the image.- Parameters:
spectrum
- the spectrum to check- Returns:
- null if successful, otherwise the error message
-
newImage
protected BufferedImage newImage(int width, int height)
Creates a new image.- Parameters:
width
- the width of the imageheight
- the height of the image- Returns:
- the image
-
setPixel
protected void setPixel(BufferedImage img, int x, int y, int val)
Sets the pixel in the image.- Parameters:
img
- the image to updatex
- the x of the pixely
- the y of the pixelval
- the value to set
-
doGenerate
protected abstract BufferedImage doGenerate(Spectrum spectrum)
Converts the spectrum into an image.- Parameters:
spectrum
- the spectrum to convert- Returns:
- the generated image
-
generate
public BufferedImage generate(Spectrum spectrum)
Converts the spectrum into an image.- Parameters:
spectrum
- the spectrum to convert- Returns:
- the generated image
-
-