org.opensourcephysics.media.core
Class DarkGhostFilter

java.lang.Object
  extended by org.opensourcephysics.media.core.Filter
      extended by org.opensourcephysics.media.core.DarkGhostFilter

public class DarkGhostFilter
extends Filter

This is a Filter that produces fading ghost images of dark objects on a bright background.

Version:
1.0
Author:
Douglas Brown

Field Summary
protected  int[] pixels
           
protected  int[] values
           
 
Fields inherited from class org.opensourcephysics.media.core.Filter
ableButton, clearButton, closeButton, deleteItem, enabledAction, enabledItem, frame, hasInspector, inspectorVisible, inspectorX, inspectorY, propertiesItem, stack, support, vidPanel
 
Constructor Summary
DarkGhostFilter()
          Constructs a GhostFilter object with default fade.
 
Method Summary
 void clear()
          Clears ghosts.
 double getFade()
          Gets the fade.
 java.awt.image.BufferedImage getFilteredImage(java.awt.image.BufferedImage sourceImage)
          Applies the filter to a source image and returns the result.
 javax.swing.JDialog getInspector()
          Implements abstract Filter method.
static XML.ObjectLoader getLoader()
          Returns an XML.ObjectLoader to save and load filter data.
 void refresh()
          Refreshes this filter's GUI
 void setEnabled(boolean enabled)
          Overrides the setEnabled method to force reinitialization.
 void setFade(double fade)
          Sets the fade.
 
Methods inherited from class org.opensourcephysics.media.core.Filter
addPropertyChangeListener, addPropertyChangeListener, getMenu, isEnabled, removePropertyChangeListener, removePropertyChangeListener, setVideoPanel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pixels

protected int[] pixels

values

protected int[] values
Constructor Detail

DarkGhostFilter

public DarkGhostFilter()
Constructs a GhostFilter object with default fade.

Method Detail

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:
setFade(double)

setEnabled

public void setEnabled(boolean enabled)
Overrides the setEnabled method to force reinitialization.

Overrides:
setEnabled in class Filter
Parameters:
enabled - true if this is enabled.

getFilteredImage

public java.awt.image.BufferedImage getFilteredImage(java.awt.image.BufferedImage sourceImage)
Applies the filter to a source image and returns the result.

Specified by:
getFilteredImage in class Filter
Parameters:
sourceImage - the source image
Returns:
the filtered image

getInspector

public javax.swing.JDialog getInspector()
Implements abstract Filter method.

Specified by:
getInspector in class Filter
Returns:
the inspector

clear

public void clear()
Clears ghosts.

Overrides:
clear in class Filter

refresh

public void refresh()
Refreshes this filter's GUI

Overrides:
refresh in class Filter

getLoader

public static XML.ObjectLoader getLoader()
Returns an XML.ObjectLoader to save and load filter data.

Returns:
the object loader