From 8c13670c13a7a965884d92193b039e26c96b95c6 Mon Sep 17 00:00:00 2001
From: Wu-cheng Li When the face detection is running, {@link Parameters#setWhiteBalance(String)},
* {@link Parameters#setFocusAreas(List)}, and {@link Parameters#setMeteringAreas(List)}
- * have no effect.
+ * have no effect. The camera uses the detected faces to do auto-white balance,
+ * auto exposure, and autofocus.
+ *
+ * If the apps call {@link #autoFocus(AutoFocusCallback)}, the camera
+ * will stop sending face callbacks. The last face callback indicates the
+ * areas used to do autofocus. After focus completes, face detection will
+ * resume sending face callbacks. If the apps call {@link
+ * #cancelAutoFocus()}, the face callbacks will also resume. After calling {@link #takePicture(Camera.ShutterCallback, Camera.PictureCallback,
+ * Camera.PictureCallback)} or {@link #stopPreview()}, and then resuming
+ * preview with {@link #startPreview()}, the apps should call this method
+ * again to resume face detection. The direction is relative to the sensor orientation, that is, what
* the sensor sees. The direction is not affected by the rotation or
- * mirroring of {@link #setDisplayOrientation(int)}.
Here is the matrix to convert driver coordinates to View coordinates + * in pixels.
+ *+ * Matrix matrix = new Matrix(); + * CameraInfo info = CameraHolder.instance().getCameraInfo()[cameraId]; + * // Need mirror for front camera. + * boolean mirror = (info.facing == CameraInfo.CAMERA_FACING_FRONT); + * matrix.setScale(mirror ? -1 : 1, 1); + * // This is the value for android.hardware.Camera.setDisplayOrientation. + * matrix.postRotate(displayOrientation); + * // Camera driver coordinates range from (-1000, -1000) to (1000, 1000). + * // UI coordinates range from (0, 0) to (width, height). + * matrix.postScale(view.getWidth() / 2000f, view.getHeight() / 2000f); + * matrix.postTranslate(view.getWidth() / 2f, view.getHeight() / 2f); + ** * @see #startFaceDetection() */ -- cgit v1.2.3-59-g8ed1b