Class RGBStep
java.lang.Object
org.opensourcephysics.cabrillo.tracker.Step
org.opensourcephysics.cabrillo.tracker.RGBStep
- All Implemented Interfaces:
Cloneable
This is a step for RGBRegion. It measures video image RGB data within a defined shape.
- Author:
- Douglas Brown
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static AlphaCompositeprotected static GeneralPathprotected booleanprotected intprotected static TPointprotected RGBStep.Polygon2Dprotected RGBStep.Positionprotected double[]protected RGBRegionprotected Shapeprotected BasicStrokeprotected intFields inherited from class org.opensourcephysics.cabrillo.tracker.Step
dataVisible, defaultIndex, footprint, format, hitRect, n, panelMarks, points, screenPoints, selectionShape, selectionStroke, trackID, transform, type, TYPE_ACCELERATION, TYPE_UNKNOWN, TYPE_VELOCITY, valid -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappend(double x, double y) clone()Clones this Step.voiddraw(DrawingPanel panel, Graphics _g) Overrides Step draw method.findInteractive(DrawingPanel panel, int xpix, int ypix) Overrides Step findInteractive method.Gets the default point.static XML.ObjectLoaderReturns an ObjectLoader to save and load data for this class.protected MarkgetMark(TrackerPanel trackerPanel) Overrides Step getMark method.protected intprotected double[][]Gets the position TPoint.double[]getRGBData(TrackerPanel trackerPanel) Gets the RGB data.protected ShapegetRGBShape(TPoint pt) Gets the RGB shape after moving it to a given point.protected booleanprotected voidsetPolygonVertices(double[][] vertices) voidsetShapeSize(double w, double h) Sets the shape size.toString()Returns a String describing this step.Methods inherited from class org.opensourcephysics.cabrillo.tracker.Step
dispose, erase, erase, getFrameNumber, getLength, getPointIndex, getPoints, getTrack, remark, remark, repaint, repaint, setDefaultPointIndex, setFootprint, setHitRectCenter
-
Field Details
-
crosshair
-
composite
-
marker
-
position
-
rgbRegion
-
width
protected int width -
height
protected int height -
panelHitShapes
-
polygonHitShapes
-
rgbData
protected double[] rgbData -
dataValid
protected boolean dataValid -
stroke
-
rgbShape
-
polygon
-
-
Constructor Details
-
RGBStep
Constructs a RGBStep with specified coordinates in image space and width and height in pixels.- Parameters:
track- the trackn- the frame numberx- the x coordinatey- the y coordinatew- the widthh- the height
-
-
Method Details
-
getPosition
Gets the position TPoint.- Returns:
- the position TPoint
-
findInteractive
Overrides Step findInteractive method.- Overrides:
findInteractivein classStep- Parameters:
panel- the drawing panelxpix- the x pixel positionypix- the y pixel position- Returns:
- the TPoint that is hit, or null
-
draw
Overrides Step draw method. -
getDefaultPoint
Gets the default point. This returns RGBRegion.vertexHandle when a polygon is being edited.- Overrides:
getDefaultPointin classStep- Returns:
- the default TPoint
-
getMark
Overrides Step getMark method. -
setShapeSize
public void setShapeSize(double w, double h) Sets the shape size.- Parameters:
h- the heightw- the width
-
clone
Clones this Step. -
toString
Returns a String describing this step. -
getRGBShape
Gets the RGB shape after moving it to a given point.- Parameters:
pt- the point- Returns:
- the shape
-
append
protected void append(double x, double y) -
isPolygonClosed
protected boolean isPolygonClosed() -
getPolygonVertexCount
protected int getPolygonVertexCount() -
getPolygonVertices
protected double[][] getPolygonVertices() -
setPolygonVertices
protected void setPolygonVertices(double[][] vertices) -
getRGBData
Gets the RGB data. Return array is {R,G,B,luma,pixels}- Parameters:
trackerPanel- the tracker panel- Returns:
- an integer array of data values
-
getLoader
Returns an ObjectLoader to save and load data for this class.- Returns:
- the object loader
-