Exemple #1
0
 /**
  * Adjusts the x coordinate from the preview's coordinate system to the view coordinate system.
  */
 public float translateX(float x) {
   if (mOverlay.mFacing == CameraSource.CAMERA_FACING_FRONT) {
     return mOverlay.getWidth() - scaleX(x);
   } else {
     return scaleX(x);
   }
 }
 /**
  * Called when the item is assumed to be gone for good. Remove the graphic annotation from the
  * overlay.
  */
 @Override
 public void onDone() {
   mOverlay.remove(mGraphic);
 }
 /**
  * Hide the graphic when the corresponding face was not detected. This can happen for intermediate
  * frames temporarily, for example if the face was momentarily blocked from view.
  */
 @Override
 public void onMissing(Detector.Detections<T> detectionResults) {
   mOverlay.remove(mGraphic);
 }
 /** Update the position/characteristics of the item within the overlay. */
 @Override
 public void onUpdate(Detector.Detections<T> detectionResults, T item) {
   mOverlay.add(mGraphic);
   mGraphic.updateItem(item);
 }
Exemple #5
0
 public void postInvalidate() {
   mOverlay.postInvalidate();
 }