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 class
protected class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static AlphaComposite
protected static GeneralPath
protected boolean
protected int
protected static TPoint
protected RGBStep.Polygon2D
protected RGBStep.Position
protected double[]
protected RGBRegion
protected Shape
protected BasicStroke
protected int
Fields 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 void
append
(double x, double y) clone()
Clones this Step.void
draw
(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.ObjectLoader
Returns an ObjectLoader to save and load data for this class.protected Mark
getMark
(TrackerPanel trackerPanel) Overrides Step getMark method.protected int
protected double[][]
Gets the position TPoint.double[]
getRGBData
(TrackerPanel trackerPanel) Gets the RGB data.protected Shape
getRGBShape
(TPoint pt) Gets the RGB shape after moving it to a given point.protected boolean
protected void
setPolygonVertices
(double[][] vertices) void
setShapeSize
(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:
findInteractive
in 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:
getDefaultPoint
in 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
-