Graphic Overlay
A view which renders a series of custom graphics to be overlaid on top of an associated preview (i.e., the camera preview). The creator can add graphics objects, update the objects, and remove them, triggering the appropriate drawing and invalidation within the view.
Supports scaling and mirroring of the graphics relative the camera's preview properties. The idea is that detection items are expressed in terms of a preview size, but need to be scaled up to the full view size, and also mirrored in the case of the front-facing camera.
Associated Graphic items should use .translateX and .translateY to convert to view coordinate from the preview's coordinate.
Constructors
Types
Base class for a custom graphics object to be rendered within the graphic overlay. Subclass this and implement the Graphic.draw method to define the graphics element. Add instances to the overlay using GraphicOverlay.add.
Functions
Adds a graphic to the overlay.
Sets the camera attributes for size and facing direction, which informs how to transform image coordinates later.
Adjusts the rect
's coordinate from the preview's coordinate system to the view coordinate system.