OSDN Git Service

Changed double to float. viewFinder -> viewfinder.
authorJiawen Chen <jiawen@google.com>
Tue, 9 Sep 2014 21:14:39 +0000 (14:14 -0700)
committerJiawen Chen <jiawen@google.com>
Wed, 10 Sep 2014 20:36:26 +0000 (13:36 -0700)
Change-Id: I5f10a5e8dae40f56457b863d5e8c703e7bf68e49

src/com/android/camera/one/OneCamera.java
src/com/android/camera/one/v2/OneCameraImpl.java
src/com/android/camera/one/v2/OneCameraZslImpl.java

index 1b7ecca..4e95f7f 100644 (file)
@@ -310,7 +310,7 @@ public interface OneCamera {
      * The preview size requested from the camera device will depend on this as
      * well as the requested photo/video aspect ratio.
      */
-    public void setViewFinderSize(int width, int height);
+    public void setViewfinderSize(int width, int height);
 
     /**
      * @return Whether this camera supports flash.
@@ -341,7 +341,7 @@ public interface OneCamera {
      * @return The aspect ratio of the full size capture (usually the native
      *         resolution of the camera).
      */
-    public double getFullSizeAspectRatio();
+    public float getFullSizeAspectRatio();
 
     /**
      * @return Whether this camera is facing to the back.
index e1f3469..258eadd 100644 (file)
@@ -202,7 +202,7 @@ public class OneCameraImpl extends AbstractOneCamera {
      * The aspect ratio (width/height) of the full resolution for this camera.
      * Usually the native aspect ratio of this camera.
      */
-    private final double mFullSizeAspectRatio;
+    private final float mFullSizeAspectRatio;
     /** The Camera2 API capture session currently active. */
     private CameraCaptureSession mCaptureSession;
     /** The surface onto which to render the preview. */
@@ -344,7 +344,7 @@ public class OneCameraImpl extends AbstractOneCamera {
     }
 
     @Override
-    public void setViewFinderSize(int width, int height) {
+    public void setViewfinderSize(int width, int height) {
         throw new RuntimeException("Not implemented yet.");
     }
 
@@ -383,7 +383,7 @@ public class OneCameraImpl extends AbstractOneCamera {
     }
 
     @Override
-    public double getFullSizeAspectRatio() {
+    public float getFullSizeAspectRatio() {
         return mFullSizeAspectRatio;
     }
 
@@ -662,10 +662,10 @@ public class OneCameraImpl extends AbstractOneCamera {
      * @return The aspect ration, in terms of width/height of the full capture
      *         size.
      */
-    private static double calculateFullSizeAspectRatio(CameraCharacteristics characteristics) {
+    private static float calculateFullSizeAspectRatio(CameraCharacteristics characteristics) {
         Rect activeArraySize =
                 characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE);
-        return (double) activeArraySize.width() / activeArraySize.height();
+        return ((float)(activeArraySize.width())) / activeArraySize.height();
     }
 
     /**
index 34284dd..4d6f632 100644 (file)
@@ -120,8 +120,9 @@ public class OneCameraZslImpl extends AbstractOneCamera {
      * continuous AF.
      */
     private static final String FOCUS_RESUME_CALLBACK_TOKEN = "RESUME_CONTINUOUS_AF";
+
     /** Zero weight 3A region, to reset regions per API. */
-    MeteringRectangle[] ZERO_WEIGHT_3A_REGION = AutoFocusHelper.getZeroWeightRegion();
+    /*package*/ MeteringRectangle[] ZERO_WEIGHT_3A_REGION = AutoFocusHelper.getZeroWeightRegion();
 
     /**
      * Thread on which high-priority camera operations, such as grabbing preview
@@ -144,7 +145,7 @@ public class OneCameraZslImpl extends AbstractOneCamera {
      * The aspect ratio (width/height) of the full resolution for this camera.
      * Usually the native aspect ratio of this camera.
      */
-    private final double mFullSizeAspectRatio;
+    private final float mFullSizeAspectRatio;
     /** The Camera2 API capture session currently active. */
     private CameraCaptureSession mCaptureSession;
     /** The surface onto which to render the preview. */
@@ -349,7 +350,6 @@ public class OneCameraZslImpl extends AbstractOneCamera {
                 largestSupportedSize.getHeight());
     }
 
-
     private void onShutterInvokeUI(final PhotoCaptureParameters params) {
         // Tell CaptureModule shutter has occurred so it can flash the screen.
         params.callback.onQuickExpose();
@@ -518,7 +518,7 @@ public class OneCameraZslImpl extends AbstractOneCamera {
     }
 
     @Override
-    public void setViewFinderSize(int width, int height) {
+    public void setViewfinderSize(int width, int height) {
         throw new RuntimeException("Not implemented yet.");
     }
 
@@ -558,7 +558,7 @@ public class OneCameraZslImpl extends AbstractOneCamera {
     }
 
     @Override
-    public double getFullSizeAspectRatio() {
+    public float getFullSizeAspectRatio() {
         return mFullSizeAspectRatio;
     }
 
@@ -917,10 +917,10 @@ public class OneCameraZslImpl extends AbstractOneCamera {
      * @return The aspect ration, in terms of width/height of the full capture
      *         size.
      */
-    private static double calculateFullSizeAspectRatio(CameraCharacteristics characteristics) {
+    private static float calculateFullSizeAspectRatio(CameraCharacteristics characteristics) {
         Rect activeArraySize =
                 characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE);
-        return (double) activeArraySize.width() / activeArraySize.height();
+        return ((float) activeArraySize.width()) / activeArraySize.height();
     }
 
     /**