Class GraphicOverlay.Graphic

java.lang.Object
app.pivo.android.prosdk.tracking.GraphicOverlay.Graphic
Direct Known Subclasses:
ActionGraphic
Enclosing class:
GraphicOverlay

public abstract static class GraphicOverlay.Graphic
extends Object
Base class for a custom graphics object to be rendered within the graphic overlay. Subclass this and implement the draw(Canvas) method to define the graphics element. Add instances to the overlay using GraphicOverlay.add(Graphic).
  • Constructor Summary

    Constructors
    Constructor Description
    Graphic​(GraphicOverlay overlay)  
  • Method Summary

    Modifier and Type Method Description
    abstract void draw​(Canvas canvas)
    Draw the graphic on the supplied canvas.
    Context getApplicationContext()
    Returns the application context of the app.
    float getHeightScaleFactor()  
    float getWidthScaleFactor()  
    void postInvalidate()  
    int previewHeight()  
    int previewWidth()  
    float scaleX​(float horizontal)
    Adjusts a horizontal value of the supplied value from the preview scale to the view scale.
    float scaleY​(float vertical)
    Adjusts a vertical value of the supplied value from the preview scale to the view scale.
    float translateX​(float x)
    Adjusts the x coordinate from the preview's coordinate system to the view coordinate system.
    float translateX2​(float y)
    Adjusts the x coordinate from the preview's coordinate system to the view coordinate system.
    float translateX3​(float y)  
    float translateY​(float y)
    Adjusts the y coordinate from the preview's coordinate system to the view coordinate system.
    float translateY2​(float x)
    Adjusts the y coordinate from the preview's coordinate system to the view coordinate system.
    float translateY3​(float x)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • draw

      public abstract void draw​(Canvas canvas)
      Draw the graphic on the supplied canvas. Drawing should use the following methods to convert to view coordinates for the graphics that are drawn:
      1. scaleX(float) and scaleY(float) adjust the size of the supplied value from the preview scale to the view scale.
      2. translateX(float) and translateY(float) adjust the coordinate from the preview's coordinate system to the view coordinate system.
      Parameters:
      canvas - drawing canvas
    • previewWidth

      public int previewWidth()
    • previewHeight

      public int previewHeight()
    • getWidthScaleFactor

      public float getWidthScaleFactor()
    • getHeightScaleFactor

      public float getHeightScaleFactor()
    • scaleX

      public float scaleX​(float horizontal)
      Adjusts a horizontal value of the supplied value from the preview scale to the view scale.
    • scaleY

      public float scaleY​(float vertical)
      Adjusts a vertical value of the supplied value from the preview scale to the view scale.
    • getApplicationContext

      public Context getApplicationContext()
      Returns the application context of the app.
    • translateX

      public float translateX​(float x)
      Adjusts the x coordinate from the preview's coordinate system to the view coordinate system.
    • translateX2

      public float translateX2​(float y)
      Adjusts the x coordinate from the preview's coordinate system to the view coordinate system.
    • translateX3

      public float translateX3​(float y)
    • translateY

      public float translateY​(float y)
      Adjusts the y coordinate from the preview's coordinate system to the view coordinate system.
    • translateY2

      public float translateY2​(float x)
      Adjusts the y coordinate from the preview's coordinate system to the view coordinate system.
    • translateY3

      public float translateY3​(float x)
    • postInvalidate

      public void postInvalidate()