Package org.opensourcephysics.media.core
Class GhostFilter
java.lang.Object
org.opensourcephysics.display.OSPRuntime.Supported
org.opensourcephysics.media.core.Filter
org.opensourcephysics.media.core.GhostFilter
- Direct Known Subclasses:
DarkGhostFilter
This is a Filter that produces fading ghost images of bright objects on a
dark background.
- Version:
- 1.0
- Author:
- Douglas Brown
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Inner Inspector class to control filter parametersNested classes/interfaces inherited from class org.opensourcephysics.media.core.Filter
Filter.InspectorDlg
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
protected double
protected NumberField
protected JLabel
protected JSlider
protected GhostFilter.Inspector
protected int[]
Fields inherited from class org.opensourcephysics.media.core.Filter
ableButton, autoScale720x480, changed, clearButton, closeButton, copyItem, deleteItem, doCreateOutput, enabledAction, enabledItem, frame, h, hasInspector, haveGUI, heightFactor, input, inspectorDlg, inspectorVisible, inspectorX, inspectorY, nPixelsIn, output, pixelsIn, pixelsOut, previousState, propertiesItem, PROPERTY_FILTER_BRIGHTNESS, PROPERTY_FILTER_COLOR, PROPERTY_FILTER_ENABLED, PROPERTY_FILTER_FILTER, PROPERTY_FILTER_IMAGE, PROPERTY_FILTER_MEAN, PROPERTY_FILTER_RESET, PROPERTY_FILTER_TAB, PROPERTY_FILTER_VISIBLE, ROTATE_180, ROTATE_CCW_90, ROTATE_CW_90, ROTATE_NONE, rotationType, source, stack, vidPanel, w, widthFactor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears ghosts.double
getFade()
Gets the fade.static XML.ObjectLoader
Returns an XML.ObjectLoader to save and load filter data.protected void
Creates and initializes the input and output images.protected Filter.InspectorDlg
protected Filter.InspectorDlg
void
refresh()
Refreshes this filter's GUIvoid
setEnabled
(boolean enabled) Overrides the setEnabled method to force reinitialization.void
setFade
(double fade) Sets the fade.protected void
Sets the output image pixels to a ghost of the input pixels.Methods inherited from class org.opensourcephysics.media.core.Filter
addLocation, copy, dispose, finalize, getFilteredImage, getFrame, getInspector, getMenu, getPixels, getPixelsIn, getPixelsOut, getRaster, initializeSource, isChanged, isEnabled, setVideoPanel
Methods inherited from class org.opensourcephysics.display.OSPRuntime.Supported
addListeners, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListenerSafely, dispose, firePropertyChange, firePropertyChange, removeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
fade
protected double fade -
defaultFade
protected double defaultFade -
inspector
-
fadeLabel
-
fadeField
-
fadeSlider
-
values
protected int[] values
-
-
Constructor Details
-
GhostFilter
public GhostFilter()Constructs a GhostFilter object with default fade.
-
-
Method Details
-
setFade
public void setFade(double fade) Sets the fade.- Parameters:
fade
- the fraction by which a ghost image fades each time it is rendered. A fade of 0 never fades, while a fade of 1 fades completely and so is never seen.
-
getFade
public double getFade()Gets the fade.- Returns:
- the fade.
- See Also:
-
setEnabled
public void setEnabled(boolean enabled) Overrides the setEnabled method to force reinitialization.- Overrides:
setEnabled
in classFilter
- Parameters:
enabled
-true
if this is enabled.
-
newInspector
- Specified by:
newInspector
in classFilter
-
initInspector
- Specified by:
initInspector
in classFilter
-
clear
public void clear()Clears ghosts. -
refresh
public void refresh()Refreshes this filter's GUI -
initializeSubclass
protected void initializeSubclass()Creates and initializes the input and output images.- Specified by:
initializeSubclass
in classFilter
- Parameters:
image
- a new source image
-
setOutputPixels
protected void setOutputPixels()Sets the output image pixels to a ghost of the input pixels.- Specified by:
setOutputPixels
in classFilter
-
getLoader
Returns an XML.ObjectLoader to save and load filter data.- Returns:
- the object loader
-