dLife Home Page

dlife.vision.cameras
Class SingleImageCamera

java.lang.Object
  extended by java.util.Observable
      extended by dlife.robot.Device
          extended by dlife.vision.Camera
              extended by dlife.vision.cameras.SingleImageCamera
All Implemented Interfaces:
Observer

public class SingleImageCamera
extends Camera

A Camera that displays a single image. The image can be in any format that is supported by the ImageIO class. This includes at least bmp, wbmp, jpeg, gif, and png images.

To launch an SingleImageCamera in Stand Alone mode:

  1. Ensure that the basic dLife installation is done.
  2. Double click the dLifeDist/UserScripts/SingleImageCamera file (Mac/Linux) or the dLifeDist/UserScripts/SingleImageCamera.bat file (Windows).

Version:
Sep 23, 2010
Author:
Grant Braught, Dickinson College

Field Summary
 
Fields inherited from class dlife.vision.Camera
BOTH_VIDEO, FILTERED_VIDEO, RAW_VIDEO
 
Fields inherited from class dlife.robot.Device
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount
 
Constructor Summary
SingleImageCamera()
          Construct a new SingleImageCamera that prompts the user to choose an image to use.
SingleImageCamera(URL path)
          Construct a new SingleImageCamera using the file specified by the given URL.
 
Method Summary
static void main(String[] args)
          Display the GUI for a Camera using a single image as the video source.
 
Methods inherited from class dlife.vision.Camera
addFilter, clearDrawing, createGUIObjects, drawCircle, drawLine, drawOval, drawRectangle, drawString, freeze, getFilterManager, getFilters, getHeight, getSeekLocation, getVideoDisplay, getVideoSource, getWidth, insertFilter, pause, play, readStateFromRobot, removeFilter, removeFilter, rewind, seek, setFilters, shutDown, startUp, stepBackward, stepForward, update
 
Methods inherited from class dlife.robot.Device
getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getRobot, getSensorReadCount, getSensorReadRate, setAutoRead, setGUIUpdateDelay, setReadDelay, setRobot, startAutoReadTimer, 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

SingleImageCamera

public SingleImageCamera()
                  throws VideoSourceCreationFailedException
Construct a new SingleImageCamera that prompts the user to choose an image to use.

Throws:
VideoSourceCreationFailedException

SingleImageCamera

public SingleImageCamera(URL path)
                  throws VideoSourceCreationFailedException
Construct a new SingleImageCamera using the file specified by the given URL. The URL may indicate a file on the local machine or available via a network.

Parameters:
path - the path to an image file.
Throws:
VideoSourceCreationFailedException - if the source cannot be created from the given URL.
Method Detail

main

public static void main(String[] args)
                 throws VideoSourceCreationFailedException
Display the GUI for a Camera using a single image as the video source. The user is asked to select a file containing the image to use.

Parameters:
args - none
Throws:
VideoSourceCreationFailedException

dLife Home Page