hades.models.imaging
Class DifferenceFilter

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.imaging.SimpleFilter
          extended byhades.models.imaging.DifferenceFilter
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable

public class DifferenceFilter
extends SimpleFilter

DifferenceFilter - a simple red filter for RGB images Signals are expected to be ImageSignals.

See Also:
Serialized Form

Field Summary
(package private)  int h_A
           
(package private)  int h_B
           
(package private)  int h_Y
           
(package private)  java.awt.Image image_A
           
(package private)  java.awt.Image image_B
           
(package private)  int[] pixels_A
           
(package private)  int[] pixels_B
           
(package private)  int[] pixels_Y
           
(package private)  Port port_A
           
(package private)  Port port_B
           
(package private)  Port port_Y
           
(package private)  int w_A
           
(package private)  int w_B
           
(package private)  int w_Y
           
 
Fields inherited from class hades.models.imaging.SimpleFilter
inputImage, outputImage, t_delay
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
DifferenceFilter()
           
 
Method Summary
 int[] calculateDifference(int[] pixels_A, int w_A, int h_A, int[] pixels_B, int w_B, int h_B)
           
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 java.awt.Image createImageFromPixels(int[] pixels_Y, int w, int h)
           
 void dbg(java.lang.String msg)
           
 void evaluate(java.lang.Object arg)
          evaluate(): called by the simulation engine on all events that concern this object.
 java.awt.Image filter(java.awt.Image image_A, java.awt.Image image_B)
           
 int[] getPixels(java.awt.Image image)
           
 java.lang.String toString()
          toString() - the usual info method
 
Methods inherited from class hades.models.imaging.SimpleFilter
elaborate, filter, getBufferedImage, getClone, initialize, msg, write
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getToolTip, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setSymbol, setVersionId, setVisible, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hades.simulator.Simulatable
message
 

Field Detail

port_A

Port port_A

port_B

Port port_B

port_Y

Port port_Y

image_A

java.awt.Image image_A

image_B

java.awt.Image image_B

w_A

int w_A

h_A

int h_A

w_B

int w_B

h_B

int h_B

w_Y

int w_Y

h_Y

int h_Y

pixels_Y

int[] pixels_Y

pixels_A

int[] pixels_A

pixels_B

int[] pixels_B
Constructor Detail

DifferenceFilter

public DifferenceFilter()
Method Detail

filter

public java.awt.Image filter(java.awt.Image image_A,
                             java.awt.Image image_B)

getPixels

public int[] getPixels(java.awt.Image image)

calculateDifference

public int[] calculateDifference(int[] pixels_A,
                                 int w_A,
                                 int h_A,
                                 int[] pixels_B,
                                 int w_B,
                                 int h_B)

createImageFromPixels

public java.awt.Image createImageFromPixels(int[] pixels_Y,
                                            int w,
                                            int h)

evaluate

public void evaluate(java.lang.Object arg)
Description copied from interface: Simulatable
evaluate(): called by the simulation engine on all events that concern this object. The object is responsible for updating its internal state and for scheduling all pending output events.

Specified by:
evaluate in interface Simulatable
Overrides:
evaluate in class SimpleFilter

configure

public void configure()
Description copied from class: SimObject
create and display a 'ConfigDialog' to set the parameters for a SimObject. The default ConfigDialog for the base class (SimObject) itself is empty except for the 'instance name' of the SimObject.

Overrides:
configure in class SimpleFilter

dbg

public void dbg(java.lang.String msg)

toString

public java.lang.String toString()
toString() - the usual info method

Overrides:
toString in class SimpleFilter