Package adams.data.imagefilter
Class KeepOnlyColors
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.imagefilter.AbstractImageFilterProvider
-
- adams.data.imagefilter.KeepOnlyColors
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
public class KeepOnlyColors extends AbstractImageFilterProvider
Keeps only the specified colors and turns all other pixels to transparent.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-color <adams.core.base.BaseColor> [-color ...] (property: colors) The colors to keep. default:
-replacement <java.awt.Color> (property: replacement) The color to replace the unwanted colors with. default: #ffffff
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseColor[]
m_Colors
the colors to keep.protected Color
m_Replacement
the replacement color.-
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 KeepOnlyColors()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
check()
Hook method for performing checks.String
colorsTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected ImageFilter
doGenerate(BufferedImage img)
Generates the actorImageFilter
instance.BaseColor[]
getColors()
Returns the colors to keep.Color
getReplacement()
Returns the color to replace the unwanted ones with.String
globalInfo()
Returns a string describing the object.String
replacementTipText()
Returns the tip text for this property.void
setColors(BaseColor[] value)
Sets the colors to keep.void
setReplacement(Color value)
Sets the color to replace the unwanted ones with.-
Methods inherited from class adams.data.imagefilter.AbstractImageFilterProvider
generate, imageToBufferedImage
-
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 classAbstractOptionHandler
-
setColors
public void setColors(BaseColor[] value)
Sets the colors to keep.- Parameters:
value
- the colors
-
getColors
public BaseColor[] getColors()
Returns the colors to keep.- Returns:
- the colors
-
colorsTipText
public String colorsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setReplacement
public void setReplacement(Color value)
Sets the color to replace the unwanted ones with.- Parameters:
value
- the replacement color
-
getReplacement
public Color getReplacement()
Returns the color to replace the unwanted ones with.- Returns:
- the replacement color
-
replacementTipText
public String replacementTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
check
protected void check()
Hook method for performing checks.- Overrides:
check
in classAbstractImageFilterProvider
-
doGenerate
protected ImageFilter doGenerate(BufferedImage img)
Generates the actorImageFilter
instance.- Specified by:
doGenerate
in classAbstractImageFilterProvider
- Parameters:
img
- the buffered image to filter- Returns:
- the image filter instance
-
-