icommand.vision
Class Region

java.lang.Object
  extended by icommand.vision.Region

public class Region
extends java.lang.Object

Representation of a region in the camera's field of view

Author:
Lawrie Griffiths

Field Summary
static int MAX_REGIONS
           
 
Constructor Summary
Region(int x, int y, int w, int h)
          Create a region
 
Method Summary
 void addColorListener(ColorListener cl, int color)
          Add a color listener
 void addLightListener(LightListener ll)
          Add a light listener
 void addMotionListener(MotionListener ml)
          Add a motion listener
 ColorListener[] getColorListeners()
          Return the array of color listeners
 int[] getColors()
          Return the array of colors corresponding to the color listeners
 int getHeight()
          Get the height of the region
 LightListener[] getLightListeners()
          Return the array of light listeners
 MotionListener[] getMotionListeners()
          Return the array of motion listeners
 int getWidth()
          Get the width of the region
 int getX()
          Get the X coordinate of the bottom left corner
 int getY()
          Get the Y coordinate of the bottom left corner
 boolean inRegion(int tx, int ty)
          Test if point is in the region
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_REGIONS

public static int MAX_REGIONS
Constructor Detail

Region

public Region(int x,
              int y,
              int w,
              int h)
Create a region

Parameters:
x - the x coordinate of the botton left corner
y - the y coordinate of the botton left corner
w - the width of the region
h - the height of the region
Method Detail

getX

public int getX()
Get the X coordinate of the bottom left corner


getY

public int getY()
Get the Y coordinate of the bottom left corner


getWidth

public int getWidth()
Get the width of the region

Returns:
the width of the region

getHeight

public int getHeight()
Get the height of the region

Returns:
the height of the region

inRegion

public boolean inRegion(int tx,
                        int ty)
Test if point is in the region

Parameters:
tx - test x coordinate
ty - test y coordinate

addMotionListener

public void addMotionListener(MotionListener ml)
Add a motion listener

Parameters:
ml - the listener to add

addColorListener

public void addColorListener(ColorListener cl,
                             int color)
Add a color listener

Parameters:
cl - the listener to add
color - the color to look for

addLightListener

public void addLightListener(LightListener ll)
Add a light listener

Parameters:
ll - the listener to add

getMotionListeners

public MotionListener[] getMotionListeners()
Return the array of motion listeners

Returns:
the motion listener array

getColorListeners

public ColorListener[] getColorListeners()
Return the array of color listeners

Returns:
the color listener array

getColors

public int[] getColors()
Return the array of colors corresponding to the color listeners

Returns:
the array of colors

getLightListeners

public LightListener[] getLightListeners()
Return the array of light listeners

Returns:
the light listener array


Copyright © 2006. All Rights Reserved.