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_Colorsthe colors to keep.protected Colorm_Replacementthe 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 voidcheck()Hook method for performing checks.StringcolorsTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected ImageFilterdoGenerate(BufferedImage img)Generates the actorImageFilterinstance.BaseColor[]getColors()Returns the colors to keep.ColorgetReplacement()Returns the color to replace the unwanted ones with.StringglobalInfo()Returns a string describing the object.StringreplacementTipText()Returns the tip text for this property.voidsetColors(BaseColor[] value)Sets the colors to keep.voidsetReplacement(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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
checkin classAbstractImageFilterProvider
-
doGenerate
protected ImageFilter doGenerate(BufferedImage img)
Generates the actorImageFilterinstance.- Specified by:
doGeneratein classAbstractImageFilterProvider- Parameters:
img- the buffered image to filter- Returns:
- the image filter instance
-
-