org.opensourcephysics.cabrillo.tracker
Class TRegion

java.lang.Object
  extended by java.awt.Polygon
      extended by org.opensourcephysics.cabrillo.tracker.TRegion
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable

public class TRegion
extends java.awt.Polygon

This is a region determined by inside and outside pixel values.

Author:
Douglas Brown
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.Polygon
bounds, npoints, xpoints, ypoints
 
Constructor Summary
TRegion(java.awt.image.BufferedImage image, int x0, int y0)
          Constructs a region starting from a specified image pixel position.
 
Method Summary
 void findEdge()
          Finds and traces the edge that defines the inside/outside of the region.
 TPoint getCenter()
          Gets the center point of the region.
 
Methods inherited from class java.awt.Polygon
addPoint, contains, contains, contains, contains, contains, contains, getBoundingBox, getBounds, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, invalidate, reset, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TRegion

public TRegion(java.awt.image.BufferedImage image,
               int x0,
               int y0)
Constructs a region starting from a specified image pixel position.

Parameters:
image - the image
x0 - the starting x position
y0 - the starting y position
Method Detail

getCenter

public TPoint getCenter()
Gets the center point of the region.

Returns:
the center

findEdge

public void findEdge()
Finds and traces the edge that defines the inside/outside of the region.