org.opensourcephysics.media.core
Class BrightnessFilter

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

public class BrightnessFilter
extends Filter

This is a Filter that changes the brightness and contrast of a source image.

Version:
1.0
Author:
Douglas Brown

Field Summary
 
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
BrightnessFilter()
          Constructs a default BrightnessFilter object.
 
Method Summary
 void clear()
          Clears this filter
 int getBrightness()
          Gets the brightness.
 double getContrast()
          Gets the contrast.
 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(int brightness)
          Sets the brightness.
 void setContrast(double contrast)
          Sets the contrast.
 
Methods inherited from class org.opensourcephysics.media.core.Filter
addPropertyChangeListener, addPropertyChangeListener, getMenu, isEnabled, removePropertyChangeListener, removePropertyChangeListener, setEnabled, setVideoPanel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrightnessFilter

public BrightnessFilter()
Constructs a default BrightnessFilter object.

Method Detail

setContrast

public void setContrast(double contrast)
Sets the contrast.

Parameters:
contrast - the contrast.

getContrast

public double getContrast()
Gets the contrast.

Returns:
the contrast.

setBrightness

public void setBrightness(int brightness)
Sets the brightness.

Parameters:
brightness - the brightness.

getBrightness

public int getBrightness()
Gets the brightness.

Returns:
the brightness.

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

getLoader

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

Returns:
the object loader