java.lang.Object
org.opensourcephysics.cabrillo.tracker.Step
org.opensourcephysics.cabrillo.tracker.RGBStep
All Implemented Interfaces:
Cloneable

public class RGBStep extends Step
This is a step for RGBRegion. It measures video image RGB data within a defined shape.
Author:
Douglas Brown
  • Field Details

    • crosshair

      protected static GeneralPath crosshair
    • composite

      protected static AlphaComposite composite
    • marker

      protected static TPoint marker
    • position

      protected RGBStep.Position position
    • rgbRegion

      protected RGBRegion rgbRegion
    • width

      protected int width
    • height

      protected int height
    • panelHitShapes

      protected Map<Integer,Shape> panelHitShapes
    • polygonHitShapes

      protected Map<Integer,Shape[]> polygonHitShapes
    • rgbData

      protected double[] rgbData
    • dataValid

      protected boolean dataValid
    • stroke

      protected BasicStroke stroke
    • rgbShape

      protected Shape rgbShape
    • polygon

      protected RGBStep.Polygon2D polygon
  • Constructor Details

    • RGBStep

      public RGBStep(RGBRegion track, int n, double x, double y, int w, int h)
      Constructs a RGBStep with specified coordinates in image space and width and height in pixels.
      Parameters:
      track - the track
      n - the frame number
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
  • Method Details

    • getPosition

      public TPoint getPosition()
      Gets the position TPoint.
      Returns:
      the position TPoint
    • findInteractive

      public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
      Overrides Step findInteractive method.
      Overrides:
      findInteractive in class Step
      Parameters:
      panel - the drawing panel
      xpix - the x pixel position
      ypix - the y pixel position
      Returns:
      the TPoint that is hit, or null
    • draw

      public void draw(DrawingPanel panel, Graphics _g)
      Overrides Step draw method.
      Overrides:
      draw in class Step
      Parameters:
      panel - the drawing panel requesting the drawing
      _g - the graphics context on which to draw
    • getDefaultPoint

      public TPoint getDefaultPoint()
      Gets the default point. This returns RGBRegion.vertexHandle when a polygon is being edited.
      Overrides:
      getDefaultPoint in class Step
      Returns:
      the default TPoint
    • getMark

      protected Mark getMark(TrackerPanel trackerPanel)
      Overrides Step getMark method.
      Overrides:
      getMark in class Step
      Parameters:
      trackerPanel - the tracker panel
      Returns:
      the mark
    • setShapeSize

      public void setShapeSize(double w, double h)
      Sets the shape size.
      Parameters:
      h - the height
      w - the width
    • clone

      public Object clone()
      Clones this Step.
      Overrides:
      clone in class Step
      Returns:
      a clone of this step
    • toString

      public String toString()
      Returns a String describing this step.
      Overrides:
      toString in class Step
      Returns:
      a descriptive string
    • getRGBShape

      protected Shape getRGBShape(TPoint pt)
      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

      public double[] getRGBData(TrackerPanel trackerPanel)
      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

      public static XML.ObjectLoader getLoader()
      Returns an ObjectLoader to save and load data for this class.
      Returns:
      the object loader