diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2014-05-23 11:22:21 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-05-23 11:22:21 -0700 |
commit | 68859523d2c2d9cbfde5511928fb2e0c0dd85574 (patch) | |
tree | 73d75b4ff07436dec80b1430d9674c9f563982e7 | |
parent | 57a2c2d75b90125dfcfad432821bf81d908fd833 (diff) | |
parent | 7ded0c8cca20ef980af4de4ba6ca7bad48d817b3 (diff) | |
download | android_packages_apps_Snap-68859523d2c2d9cbfde5511928fb2e0c0dd85574.tar.gz android_packages_apps_Snap-68859523d2c2d9cbfde5511928fb2e0c0dd85574.tar.bz2 android_packages_apps_Snap-68859523d2c2d9cbfde5511928fb2e0c0dd85574.zip |
Merge "Camera2: Fix face eyes display incorrect when face detection is on"
-rw-r--r-- | src/com/android/camera/ui/FaceView.java | 66 |
1 files changed, 50 insertions, 16 deletions
diff --git a/src/com/android/camera/ui/FaceView.java b/src/com/android/camera/ui/FaceView.java index 7adabf2ad..1868e0a38 100644 --- a/src/com/android/camera/ui/FaceView.java +++ b/src/com/android/camera/ui/FaceView.java @@ -233,10 +233,19 @@ public class FaceView extends View Log.e(TAG, "blink: (" + face.getLeftEyeBlinkDegree()+ ", " + face.getRightEyeBlinkDegree() + ")"); if (face.leftEye != null) { - point[0] = face.leftEye.x; - point[1] = face.leftEye.y-delta_y/2; - point[2] = face.leftEye.x; - point[3] = face.leftEye.y+delta_y/2; + if ((mDisplayOrientation == 90) || + (mDisplayOrientation == 270)) { + point[0] = face.leftEye.x; + point[1] = face.leftEye.y - delta_y / 2; + point[2] = face.leftEye.x; + point[3] = face.leftEye.y + delta_y / 2; + } else { + point[0] = face.leftEye.x - delta_x / 2; + point[1] = face.leftEye.y; + point[2] = face.leftEye.x + delta_x / 2; + point[3] = face.leftEye.y; + + } mMatrix.mapPoints (point); if (face.getLeftEyeBlinkDegree() >= blink_threshold) { canvas.drawLine(point[0]+ dx, point[1]+ dy, @@ -244,10 +253,18 @@ public class FaceView extends View } } if (face.rightEye != null) { - point[0] = face.rightEye.x; - point[1] = face.rightEye.y-delta_y/2; - point[2] = face.rightEye.x; - point[3] = face.rightEye.y+delta_y/2; + if ((mDisplayOrientation == 90) || + (mDisplayOrientation == 270)) { + point[0] = face.rightEye.x; + point[1] = face.rightEye.y - delta_y / 2; + point[2] = face.rightEye.x; + point[3] = face.rightEye.y + delta_y / 2; + } else { + point[0] = face.rightEye.x - delta_x / 2; + point[1] = face.rightEye.y; + point[2] = face.rightEye.x + delta_x / 2; + point[3] = face.rightEye.y; + } mMatrix.mapPoints (point); if (face.getRightEyeBlinkDegree() >= blink_threshold) { //Add offset to the points if the rect has an offset @@ -286,20 +303,37 @@ public class FaceView extends View (-length) + 0.5); if (face.getLeftEyeBlinkDegree() < blink_threshold) { - point[0] = face.leftEye.x; - point[1] = face.leftEye.y; - point[2] = face.leftEye.x + gazeRollX; - point[3] = face.leftEye.y + gazeRollY; + if ((mDisplayOrientation == 90) || + (mDisplayOrientation == 270)) { + point[0] = face.leftEye.x; + point[1] = face.leftEye.y; + point[2] = face.leftEye.x + gazeRollX; + point[3] = face.leftEye.y + gazeRollY; + } else { + point[0] = face.leftEye.x; + point[1] = face.leftEye.y; + point[2] = face.leftEye.x + gazeRollY; + point[3] = face.leftEye.y + gazeRollX; + } mMatrix.mapPoints (point); canvas.drawLine(point[0] +dx, point[1] + dy, point[2] + dx, point[3] +dy, mPaint); } if (face.getRightEyeBlinkDegree() < blink_threshold) { - point[0] = face.rightEye.x; - point[1] = face.rightEye.y; - point[2] = face.rightEye.x + gazeRollX; - point[3] = face.rightEye.y + gazeRollY; + if ((mDisplayOrientation == 90) || + (mDisplayOrientation == 270)) { + point[0] = face.rightEye.x; + point[1] = face.rightEye.y; + point[2] = face.rightEye.x + gazeRollX; + point[3] = face.rightEye.y + gazeRollY; + } else { + point[0] = face.rightEye.x; + point[1] = face.rightEye.y; + point[2] = face.rightEye.x + gazeRollY; + point[3] = face.rightEye.y + gazeRollX; + + } mMatrix.mapPoints (point); canvas.drawLine(point[0] + dx, point[1] + dy, point[2] + dx, point[3] + dy, mPaint); |