org.opensourcephysics.media.core
Class GrayScaleFilter

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

public class GrayScaleFilter
extends Filter

This is a Filter that produces a grayscale version of the source.

Version:
1.0
Author:
Douglas Brown

Field Summary
static double WT_B_VID
           
static double WT_FLAT
           
static double WT_G_VID
           
static double WT_R_VID
           
 
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
GrayScaleFilter()
          Constructs a GrayScaleFilter object.
 
Method Summary
 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 setWeights(double r, double g, double b)
           
 
Methods inherited from class org.opensourcephysics.media.core.Filter
addPropertyChangeListener, addPropertyChangeListener, clear, getMenu, isEnabled, removePropertyChangeListener, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WT_R_VID

public static final double WT_R_VID
See Also:
Constant Field Values

WT_G_VID

public static final double WT_G_VID
See Also:
Constant Field Values

WT_B_VID

public static final double WT_B_VID
See Also:
Constant Field Values

WT_FLAT

public static final double WT_FLAT
See Also:
Constant Field Values
Constructor Detail

GrayScaleFilter

public GrayScaleFilter()
Constructs a GrayScaleFilter object.

Method Detail

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

setWeights

public void setWeights(double r,
                       double g,
                       double b)

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