Package org.opensourcephysics.media.core
Class StrobeFilter
java.lang.Object
org.opensourcephysics.display.OSPRuntime.Supported
org.opensourcephysics.media.core.Filter
org.opensourcephysics.media.core.StrobeFilter
This is a Filter that produces fading strobe images.
- Version:
- 1.0
- Author:
- Douglas Brown
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensourcephysics.media.core.Filter
Filter.InspectorDlg
-
Field Summary
FieldsFields 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 strobe images.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
boolean
Gets the bright trails flag.protected Filter.InspectorDlg
void
refresh()
Refreshes this filter's GUIvoid
setBrightTrails
(boolean bright) Sets the bright trails flag.void
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 strobe 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
-
prevPixels
protected int[] prevPixels
-
-
Constructor Details
-
StrobeFilter
public StrobeFilter()Constructs a StrobeFilter object with default fade.
-
-
Method Details
-
setFade
public void setFade(double fade) Sets the fade.- Parameters:
fade
- the fraction by which the strobe 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:
-
setBrightTrails
public void setBrightTrails(boolean bright) Sets the bright trails flag. When true, trails are bright on dark backgrounds and fade to black. Otherwise trails are dark on bright backgrounds and fade to white.- Parameters:
light
- true for bright trails on dark backgrounds
-
isBrightTrails
public boolean isBrightTrails()Gets the bright trails flag.- Returns:
- true if trails are bright
- 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 strobe images. -
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 strobe of the input pixels.- Specified by:
setOutputPixels
in classFilter
-
getLoader
Returns an XML.ObjectLoader to save and load filter data.- Returns:
- the object loader
-