org.opensourcephysics.media.core
Class SumFilter

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

public class SumFilter
extends Filter

This is a Filter that sums pixel values from multiple images.

Version:
1.0
Author:
Douglas Brown

Field Summary
protected  int[] bsums
           
protected  int[] gsums
           
protected  int[] pixels
           
protected  int[] rsums
           
 
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
SumFilter()
          Constructs a SumFilter.
 
Method Summary
 void addNextImage()
          Requests that this filter add the next image it recieves
 void clear()
          Clears this filter
 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 setBrightness(double fraction)
          Sets the brightness fraction.
 void setEnabled(boolean enabled)
          Overrides Filter method.
 void setMean(boolean mean)
          Sets the mean flag.
 
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

rsums

protected int[] rsums

gsums

protected int[] gsums

bsums

protected int[] bsums
Constructor Detail

SumFilter

public SumFilter()
Constructs a SumFilter.

Method Detail

setBrightness

public void setBrightness(double fraction)
Sets the brightness fraction.

Parameters:
fraction - the brightness as a fraction of full

setMean

public void setMean(boolean mean)
Sets the mean flag.

Parameters:
mean - true to show the mean

setEnabled

public void setEnabled(boolean enabled)
Overrides Filter method.

Overrides:
setEnabled in class Filter
Parameters:
enabled - true to enable this filter.

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 this filter

Overrides:
clear in class Filter

refresh

public void refresh()
Refreshes this filter's GUI

Overrides:
refresh in class Filter

addNextImage

public void addNextImage()
Requests that this filter add the next image it recieves


getLoader

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

Returns:
the object loader