Package app.pivo.android.prosdk.tracking
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 thedraw(Canvas)method to define the graphics element. Add instances to the overlay usingGraphicOverlay.add(Graphic).
-
-
Constructor Summary
Constructors Constructor Description Graphic(GraphicOverlay overlay)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voiddraw(Canvas canvas)Draw the graphic on the supplied canvas.ContextgetApplicationContext()Returns the application context of the app.floatgetHeightScaleFactor()floatgetWidthScaleFactor()voidpostInvalidate()intpreviewHeight()intpreviewWidth()floatscaleX(float horizontal)Adjusts a horizontal value of the supplied value from the preview scale to the view scale.floatscaleY(float vertical)Adjusts a vertical value of the supplied value from the preview scale to the view scale.floattranslateX(float x)Adjusts the x coordinate from the preview's coordinate system to the view coordinate system.floattranslateX2(float y)Adjusts the x coordinate from the preview's coordinate system to the view coordinate system.floattranslateX3(float y)floattranslateY(float y)Adjusts the y coordinate from the preview's coordinate system to the view coordinate system.floattranslateY2(float x)Adjusts the y coordinate from the preview's coordinate system to the view coordinate system.floattranslateY3(float x)
-
-
-
Constructor Detail
-
Graphic
public Graphic(GraphicOverlay overlay)
-
-
Method Detail
-
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:scaleX(float)andscaleY(float)adjust the size of the supplied value from the preview scale to the view scale.translateX(float)andtranslateY(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()
-
-