Package adams.data.image.transformer
Class XScreenMask
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,ImageTransformer<BufferedImageContainer>
,FlowContextHandler
,Serializable
,Comparable
public class XScreenMask extends AbstractBufferedImageTransformer
Masks out a color by making it 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 <RED|GREEN|BLUE|YELLOW> (property: color) Color to be masked. default: RED
-down <boolean> (property: down) If true, then pixels <= threshold are not masked and the others' alpha channel are set to 0 (made transparent). default: true
-threshold <int> (property: threshold) Threshold value used for binarization, specify -1 to automatically determine a threshold. default: 127 minimum: -1 maximum: 255
- Version:
- $Revision$
- Author:
- lx51 (lx51 at students dot waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected XScreenMaskHelper.Color
m_Color
Color to be masked out.protected boolean
m_Down
If true, then pixels <= threshold are not masked and the others' alpha channel are set to 0 (made transparent).protected int
m_Threshold
Threshold value used for binarization, specify -1 to automatically determine a threshold.-
Fields inherited from class adams.data.image.AbstractImageTransformer
m_FlowContext
-
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 XScreenMask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
colorTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected BufferedImageContainer[]
doTransform(BufferedImageContainer container)
Masks the image.String
downTipText()
Returns the tip text for this property.XScreenMaskHelper.Color
getColor()
Gets color to be masked out.boolean
getDown()
Get whether mask is applied below or above the threshold.int
getThreshold()
Get the manual threshold value.String
globalInfo()
Returns a string describing the object.void
setColor(XScreenMaskHelper.Color value)
Sets color to be masked out.void
setDown(boolean value)
Set whether mask is applied below or above the threshold.void
setThreshold(int value)
Set the manual threshold value.String
thresholdTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.image.transformer.AbstractBufferedImageTransformer
forCommandLine, forName, getTransformations
-
Methods inherited from class adams.data.image.AbstractImageTransformer
checkImage, cleanUp, compareTo, destroy, equals, getFlowContext, getQuickInfo, initialize, setFlowContext, shallowCopy, shallowCopy, transform
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_Color
protected XScreenMaskHelper.Color m_Color
Color to be masked out.
-
m_Down
protected boolean m_Down
If true, then pixels <= threshold are not masked and the others' alpha channel are set to 0 (made transparent).
-
m_Threshold
protected int m_Threshold
Threshold value used for binarization, specify -1 to automatically determine a threshold.
-
-
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
-
getColor
public XScreenMaskHelper.Color getColor()
Gets color to be masked out.- Returns:
- color to be masked out
-
setColor
public void setColor(XScreenMaskHelper.Color value)
Sets color to be masked out.- Parameters:
value
- bias
-
colorTipText
public String colorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDown
public boolean getDown()
Get whether mask is applied below or above the threshold.- Returns:
- threshold direction
-
setDown
public void setDown(boolean value)
Set whether mask is applied below or above the threshold.- Parameters:
value
- threshold direction
-
downTipText
public String downTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getThreshold
public int getThreshold()
Get the manual threshold value.- Returns:
- manual threshold value
-
setThreshold
public void setThreshold(int value)
Set the manual threshold value.- Parameters:
value
- manual threshold value
-
thresholdTipText
public String thresholdTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doTransform
protected BufferedImageContainer[] doTransform(BufferedImageContainer container)
Masks the image.- Specified by:
doTransform
in classAbstractImageTransformer<BufferedImageContainer>
- Parameters:
container
- the image to be processed- Returns:
- the masked image
-
-