Class LineProfileStep
java.lang.Object
org.opensourcephysics.cabrillo.tracker.Step
org.opensourcephysics.cabrillo.tracker.LineProfileStep
- All Implemented Interfaces:
Cloneable
This is a step for a LineProfile. It is used for obtaining line profile data
from a video image.
- Author:
- Douglas Brown
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.opensourcephysics.cabrillo.tracker.LineProfileStep.Corner[][]protected booleanprotected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[]protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[]protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.Handleprotected LineProfileprotected TPointprotected TPointprotected TreeSet<org.opensourcephysics.cabrillo.tracker.LineProfileStep.Intersection>protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[][]protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[][]protected ArrayList<org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridVertex>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
ConstructorsConstructorDescriptionLineProfileStep(LineProfile track, int n, double x1, double y1, double x2, double y2) Constructs a LineProfileStep with specified end point coordinates in image space. -
Method Summary
Modifier and TypeMethodDescriptionvoidclone()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 center handle.static intGets the step length.Gets end 1.Gets end 2.protected MarkgetMark(TrackerPanel trackerPanel) Overrides Step getMark method.double[][]getProfileData(TrackerPanel trackerPanel) Gets the line profile data.booleanGets whether the ends are enabled.protected voidrotate()Rotates this step about its center to keep it either horizontal or parallel to the x-axis.voidsetEndsEnabled(boolean enabled) Enables and disables the interactivity of the ends.voidsetFootprint(Footprint footprint) Overrides Step setFootprint method.toString()Returns a String describing this step.Methods inherited from class org.opensourcephysics.cabrillo.tracker.Step
dispose, erase, erase, getDefaultPoint, getFrameNumber, getPointIndex, getPoints, getTrack, remark, remark, repaint, repaint, setDefaultPointIndex, setHitRectCenter
-
Field Details
-
lineEnd0
-
lineEnd1
-
handle
protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.Handle handle -
endsEnabled
protected boolean endsEnabled -
panelEnd0Shapes
-
panelEnd1Shapes
-
panelShaftShapes
-
line
-
corners
protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.Corner[][] corners -
endX
protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[] endX -
endY
protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[] endY -
sweepX
protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[][] sweepX -
sweepY
protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[][] sweepY -
sorter
-
vertices
-
-
Constructor Details
-
LineProfileStep
Constructs a LineProfileStep with specified end point coordinates in image space.- Parameters:
track- the trackn- the frame numberx1- the x coordinate of end 1y1- the y coordinate of end 1x2- the x coordinate of end 2y2- the y coordinate of end 2
-
-
Method Details
-
getLineEnd0
Gets end 1.- Returns:
- end 1
-
getLineEnd1
Gets end 2.- Returns:
- end 2
-
getHandle
Gets the center handle.- Returns:
- the handle
-
setEndsEnabled
public void setEndsEnabled(boolean enabled) Enables and disables the interactivity of the ends.- Parameters:
enabled-trueto enable the ends
-
isEndsEnabled
public boolean isEndsEnabled()Gets whether the ends are enabled.- Returns:
trueif the ends are enabled
-
setFootprint
Overrides Step setFootprint method.- Overrides:
setFootprintin classStep- Parameters:
footprint- the footprint
-
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. -
getMark
Overrides Step getMark method. -
clone
Clones this Step. -
toString
Returns a String describing this step. -
getProfileData
Gets the line profile data.- Parameters:
trackerPanel- the tracker panel- Returns:
- an integer array of values for image pixels along the line
-
rotate
protected void rotate()Rotates this step about its center to keep it either horizontal or parallel to the x-axis. -
getLength
public static int getLength()Gets the step length.- Returns:
- the length of the points array
-
clearData
public void clearData()
-