|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
icommand.vision.Vision
public class Vision
Java version of Vision Command.
Field Summary |
---|
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Vision(java.lang.String title)
Create the viewer frame with a title. |
Method Summary | |
---|---|
static void |
addColorListener(int region,
ColorListener cl,
int color)
Add a Color Listener for the region |
static void |
addLightListener(int region,
LightListener ll)
Add a Light Listener for the region |
static void |
addMotionListener(int region,
MotionListener ml)
Add a Motion Listener for the region |
void |
addNotify()
|
static void |
addRectRegion(int region,
int x,
int y,
int width,
int height)
Add a rectangular region |
void |
controllerUpdate(javax.media.ControllerEvent evt)
Controller Listener. |
static void |
flipHorizontal(boolean flip)
Flip the image in the image viewer horizontally |
static int |
getAvgBlue(int region)
Get the average blue value for the region |
static int |
getAvgGreen(int region)
Get the average green value for the region |
static int |
getAvgRed(int region)
Get the average red value for the region |
static int |
getAvgRGB(int region)
Get the average RGB value for the region |
static java.awt.Frame |
getFrame()
Get the viewer frame. |
static Region[] |
getRegions()
Get the array of regions |
static boolean |
isRecording()
Test is recording is in progress |
boolean |
open(javax.media.protocol.DataSource tds)
Given a datasource, create a processor and use that processor as a player to playback the media. |
static void |
playSound(java.lang.String fileName)
Play an audio file |
static void |
setFrameRate(float rate)
Set the frame rate |
static void |
setImageSize(int width,
int height)
Set the size of the video viewer image |
static void |
snapshot(java.lang.String filename)
Take a snapshot |
static void |
startRecorder(java.lang.String fileName,
int millis)
Start the video recorder |
static void |
startViewer(java.lang.String title)
Start the video viewer frame |
static void |
stopRecording()
|
static void |
stopViewer()
Close Video viewer |
static void |
writeImage(java.lang.String fn,
byte[] data,
int width,
int height)
Write to fn file the data using the
width, height variables. |
Methods inherited from class java.awt.Frame |
---|
getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Constructor Detail |
---|
public Vision(java.lang.String title)
title
- the title for the viewerMethod Detail |
---|
public static java.awt.Frame getFrame()
public boolean open(javax.media.protocol.DataSource tds)
public static void stopViewer()
public void addNotify()
addNotify
in class java.awt.Frame
public void controllerUpdate(javax.media.ControllerEvent evt)
controllerUpdate
in interface javax.media.ControllerListener
public static void startViewer(java.lang.String title)
public static void playSound(java.lang.String fileName)
fileName
- the audio file to playpublic static void addRectRegion(int region, int x, int y, int width, int height)
region
- the region numberx
- the x co-ordinate of the region bottom left cornery
- the y co-ordinate of the region bottom left cornerwidth
- the width of the regionheight
- the height of the regionpublic static Region[] getRegions()
public static void setFrameRate(float rate)
rate
- the required frame ratepublic static void setImageSize(int width, int height)
width
- the required image widthheight
- the required image heightpublic static void addMotionListener(int region, MotionListener ml)
region
- the regionml
- the Motion Listenerpublic static void addColorListener(int region, ColorListener cl, int color)
region
- the regioncl
- the Color Listenercolor
- the color to listen forpublic static void addLightListener(int region, LightListener ll)
region
- the regionll
- the Light Listenerpublic static void snapshot(java.lang.String filename)
filename
- the JPG file to write the snapshop topublic static void writeImage(java.lang.String fn, byte[] data, int width, int height) throws java.io.FileNotFoundException, java.io.IOException
fn
file the data
using the
width, height
variables. Data is assumed to be 8bit RGB. A
JPEG format file is written.
fn
- the filenamedata
- the data to writewidth
- the width of the imageheight
- the height of the image
java.io.FileNotFoundException
- if the directory/image specified is wrong
java.io.IOException
- if there are problems reading the file.public static void startRecorder(java.lang.String fileName, int millis)
fileName
- the file to write the video tomillis
- the number of milliseconds to record for. 0 means record
until stopRecoder() is called.public static boolean isRecording()
public static void stopRecording()
public static int getAvgRed(int region)
region
- the region
public static int getAvgGreen(int region)
region
- the region
public static int getAvgBlue(int region)
region
- the region
public static int getAvgRGB(int region)
region
- the region
public static void flipHorizontal(boolean flip)
flip
- true to flip, else false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |