dLife Home Page

dlife.vision
Class VideoDisplay

java.lang.Object
  extended by java.util.Observable
      extended by dlife.robot.Device
          extended by dlife.robot.PseudoDevice
              extended by dlife.vision.VideoDisplay
All Implemented Interfaces:
Observer

public class VideoDisplay
extends PseudoDevice
implements Observer

A VideoDisplay is a wrapper for two BufferedImageWithOverlay objects, one for the raw video and one for the filtered video. It provides access to the two BufferedImageWithOverlay objects so that they can be manipulated independently by the controlling Camera and FilterList objects. This also provides a GUI containing the two video windows, one for the raw video and one for the filtered video.

Version:
Jun 10, 2009
Author:
Grant Braught, Dickinson College

Field Summary
 
Fields inherited from class dlife.robot.Device
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount
 
Constructor Summary
VideoDisplay(int width, int height)
          Construct a new VideoDisplay with two BufferedImageWithOverlay components of the specified size.
 
Method Summary
protected  DeviceDisplay[] createGUIObjects()
          Get the object that is the GUI for the VideoDisplay.
 BufferedImageWithOverlay getFiltered()
          Get the BufferedImageWithOverlay object that is being used to display the filtered video.
 BufferedImageWithOverlay getRaw()
          Get the BufferedImageWithOverlay object that is being used to display the raw video.
static void main(String[] args)
          Little test method that pops up a VideoDisplay in a Window for testing purposes.
 void readStateFromPseudoDevice()
          Does nothing.
 void update(Observable o, Object arg)
          The VideoDisplay can be an observer on the VideoSource that it is displaying.
 
Methods inherited from class dlife.robot.PseudoDevice
freeze, getRobot, readStateFromRobot, setRobot
 
Methods inherited from class dlife.robot.Device
getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getSensorReadCount, getSensorReadRate, setAutoRead, setGUIUpdateDelay, setReadDelay, shutDown, startAutoReadTimer, startUp, stopAutoReadTimer
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VideoDisplay

public VideoDisplay(int width,
                    int height)
Construct a new VideoDisplay with two BufferedImageWithOverlay components of the specified size.

Parameters:
width - the width of the BufferedImageWithOverlay components.
height - the height of the BufferedImageWithOverlay components.
Method Detail

readStateFromPseudoDevice

public void readStateFromPseudoDevice()
Does nothing.

Specified by:
readStateFromPseudoDevice in class PseudoDevice

createGUIObjects

protected DeviceDisplay[] createGUIObjects()
Get the object that is the GUI for the VideoDisplay.

Specified by:
createGUIObjects in class Device
Returns:
a reference to the GUI.

getRaw

public BufferedImageWithOverlay getRaw()
Get the BufferedImageWithOverlay object that is being used to display the raw video.

Returns:
the raw BufferedImageWithOverlay object.

getFiltered

public BufferedImageWithOverlay getFiltered()
Get the BufferedImageWithOverlay object that is being used to display the filtered video.

Returns:
the filtered BufferedImageWithOverlay object.

update

public void update(Observable o,
                   Object arg)
The VideoDisplay can be an observer on the VideoSource that it is displaying. If this is the case then this method will be invoked when the VideoSource changes. This method will then enable (disable) the mouse click/drag events in the BufferedImageWithOverlay objects when the video is paused (played).

Specified by:
update in interface Observer

main

public static void main(String[] args)
Little test method that pops up a VideoDisplay in a Window for testing purposes.

Parameters:
args - none

dLife Home Page