diff options
author | Emilian Peev <epeevs@codeaurora.org> | 2014-10-08 17:28:01 +0300 |
---|---|---|
committer | Emilian Peev <epeevs@codeaurora.org> | 2014-10-14 14:45:44 +0300 |
commit | cadb5fefc9b02e6363817bf3eb4b053f895a2498 (patch) | |
tree | 854c637ad3b751183bafdc090f3c5b8c8d332023 /src/com/android | |
parent | 9aa0b4af98c821b032b2ff708dda2034ba401e52 (diff) | |
download | android_packages_apps_Snap-cadb5fefc9b02e6363817bf3eb4b053f895a2498.tar.gz android_packages_apps_Snap-cadb5fefc9b02e6363817bf3eb4b053f895a2498.tar.bz2 android_packages_apps_Snap-cadb5fefc9b02e6363817bf3eb4b053f895a2498.zip |
Camera: Rotate face mouth based on face orientation
Face mouth can be rotated according to the
face orientation information.
Change-Id: Id00fd52e529ddeace54e031dea221f694e48e97c
CRs-Fixed: 726313
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/camera/ui/FaceView.java | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/com/android/camera/ui/FaceView.java b/src/com/android/camera/ui/FaceView.java index 9e50f166a..f697a5df9 100644 --- a/src/com/android/camera/ui/FaceView.java +++ b/src/com/android/camera/ui/FaceView.java @@ -345,31 +345,32 @@ public class FaceView extends View face.getSmileScore()); if (face.getSmileDegree() < smile_threashold_no_smile) { - if ((mDisplayOrientation == 90) || - (mDisplayOrientation == 270)) { - point[0] = face.mouth.x; - point[1] = face.mouth.y - delta_y; - point[2] = face.mouth.x; - point[3] = face.mouth.y + delta_y; - } else { - point[0] = face.mouth.x - delta_x; - point[1] = face.mouth.y; - point[2] = face.mouth.x + delta_x ; - point[3] = face.mouth.y; - } - mMatrix.mapPoints (point); + point[0] = face.mouth.x - delta_x; + point[1] = face.mouth.y; + point[2] = face.mouth.x + delta_x ; + point[3] = face.mouth.y; + Matrix faceMatrix = new Matrix(mMatrix); + faceMatrix.preRotate(face.getRollDirection(), + face.mouth.x, face.mouth.y); + faceMatrix.mapPoints(point); canvas.drawLine(point[0] + dx, point[1] + dy, point[2] + dx, point[3] + dy, mPaint); } else if (face.getSmileDegree() < smile_threashold_small_smile) { + int rotation_mouth = mDisplayOrientation - + face.getRollDirection(); + if (0 > rotation_mouth) { + rotation_mouth = 360 + rotation_mouth; + } mRect.set(face.mouth.x-delta_x, face.mouth.y-delta_y, face.mouth.x+delta_x, face.mouth.y+delta_y); mMatrix.mapRect(mRect); mRect.offset(dx, dy); - canvas.drawArc(mRect, 0, 180, true, mPaint); + canvas.drawArc(mRect, rotation_mouth, + 180, true, mPaint); } else { mRect.set(face.mouth.x-delta_x, face.mouth.y-delta_y, face.mouth.x+delta_x, |