summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYin-Chia Yeh <yinchiayeh@google.com>2014-05-19 10:23:27 -0700
committerEino-Ville Talvala <etalvala@google.com>2014-05-28 01:36:53 -0700
commit817f8933ee1c11130ad2ca45b5ac8ce8b729f125 (patch)
tree8eb7b7be726bd16ba605a776967539d9fa476c8f
parent197123db245abf6203332e8eff44a18fe6d2144f (diff)
downloadframeworks_base-817f8933ee1c11130ad2ca45b5ac8ce8b729f125.zip
frameworks_base-817f8933ee1c11130ad2ca45b5ac8ce8b729f125.tar.gz
frameworks_base-817f8933ee1c11130ad2ca45b5ac8ce8b729f125.tar.bz2
Camera2: Replace int[] by MeteringRectangle
Bug: 14628001 Change-Id: I8ae4efa24d41043046a84b04e5209259a8a21063
-rw-r--r--core/java/android/hardware/camera2/CaptureRequest.java38
-rw-r--r--core/java/android/hardware/camera2/CaptureResult.java38
-rw-r--r--core/java/android/hardware/camera2/params/MeteringRectangle.java8
3 files changed, 32 insertions, 52 deletions
diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java
index a4aa296..a133312 100644
--- a/core/java/android/hardware/camera2/CaptureRequest.java
+++ b/core/java/android/hardware/camera2/CaptureRequest.java
@@ -693,9 +693,6 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
/**
* <p>List of areas to use for
* metering.</p>
- * <p>Each area is a rectangle plus weight: xmin, ymin,
- * xmax, ymax, weight. The rectangle is defined to be inclusive of the
- * specified coordinates.</p>
* <p>The coordinate system is based on the active pixel array,
* with (0,0) being the top-left pixel in the active pixel array, and
* ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
@@ -711,8 +708,8 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* @see CaptureRequest#SCALER_CROP_REGION
* @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
*/
- public static final Key<int[]> CONTROL_AE_REGIONS =
- new Key<int[]>("android.control.aeRegions", int[].class);
+ public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
+ new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
/**
* <p>Range over which fps can be adjusted to
@@ -768,26 +765,23 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
/**
* <p>List of areas to use for focus
* estimation.</p>
- * <p>Each area is a rectangle plus weight: xmin, ymin,
- * xmax, ymax, weight. The rectangle is defined to be inclusive of the
- * specified coordinates.</p>
* <p>The coordinate system is based on the active pixel array,
* with (0,0) being the top-left pixel in the active pixel array, and
* ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
* {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
* bottom-right pixel in the active pixel array. The weight
* should be nonnegative.</p>
- * <p>If all regions have 0 weight, then no specific focus area
- * needs to be used by the camera device. If the focusing region is
- * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture
- * result metadata, the camera device will ignore the sections outside
- * the region and output the used sections in the result metadata.</p>
+ * <p>If all regions have 0 weight, then no specific metering area
+ * needs to be used by the camera device. If the metering region is
+ * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
+ * the camera device will ignore the sections outside the region and output the
+ * used sections in the result metadata.</p>
*
* @see CaptureRequest#SCALER_CROP_REGION
* @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
*/
- public static final Key<int[]> CONTROL_AF_REGIONS =
- new Key<int[]>("android.control.afRegions", int[].class);
+ public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
+ new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
/**
* <p>Whether the camera device will trigger autofocus for this request.</p>
@@ -854,27 +848,23 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
/**
* <p>List of areas to use for illuminant
* estimation.</p>
- * <p>Only used in AUTO mode.</p>
- * <p>Each area is a rectangle plus weight: xmin, ymin,
- * xmax, ymax, weight. The rectangle is defined to be inclusive of the
- * specified coordinates.</p>
* <p>The coordinate system is based on the active pixel array,
* with (0,0) being the top-left pixel in the active pixel array, and
* ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
* {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
* bottom-right pixel in the active pixel array. The weight
* should be nonnegative.</p>
- * <p>If all regions have 0 weight, then no specific auto-white balance (AWB) area
- * needs to be used by the camera device. If the AWB region is
- * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
+ * <p>If all regions have 0 weight, then no specific metering area
+ * needs to be used by the camera device. If the metering region is
+ * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
* the camera device will ignore the sections outside the region and output the
* used sections in the result metadata.</p>
*
* @see CaptureRequest#SCALER_CROP_REGION
* @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
*/
- public static final Key<int[]> CONTROL_AWB_REGIONS =
- new Key<int[]>("android.control.awbRegions", int[].class);
+ public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
+ new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
/**
* <p>Information to the camera device 3A (auto-exposure,
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index 9aa56cf..694aae3 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -539,9 +539,6 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
/**
* <p>List of areas to use for
* metering.</p>
- * <p>Each area is a rectangle plus weight: xmin, ymin,
- * xmax, ymax, weight. The rectangle is defined to be inclusive of the
- * specified coordinates.</p>
* <p>The coordinate system is based on the active pixel array,
* with (0,0) being the top-left pixel in the active pixel array, and
* ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
@@ -557,8 +554,8 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* @see CaptureRequest#SCALER_CROP_REGION
* @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
*/
- public static final Key<int[]> CONTROL_AE_REGIONS =
- new Key<int[]>("android.control.aeRegions", int[].class);
+ public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
+ new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
/**
* <p>Range over which fps can be adjusted to
@@ -812,26 +809,23 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
/**
* <p>List of areas to use for focus
* estimation.</p>
- * <p>Each area is a rectangle plus weight: xmin, ymin,
- * xmax, ymax, weight. The rectangle is defined to be inclusive of the
- * specified coordinates.</p>
* <p>The coordinate system is based on the active pixel array,
* with (0,0) being the top-left pixel in the active pixel array, and
* ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
* {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
* bottom-right pixel in the active pixel array. The weight
* should be nonnegative.</p>
- * <p>If all regions have 0 weight, then no specific focus area
- * needs to be used by the camera device. If the focusing region is
- * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture
- * result metadata, the camera device will ignore the sections outside
- * the region and output the used sections in the result metadata.</p>
+ * <p>If all regions have 0 weight, then no specific metering area
+ * needs to be used by the camera device. If the metering region is
+ * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
+ * the camera device will ignore the sections outside the region and output the
+ * used sections in the result metadata.</p>
*
* @see CaptureRequest#SCALER_CROP_REGION
* @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
*/
- public static final Key<int[]> CONTROL_AF_REGIONS =
- new Key<int[]>("android.control.afRegions", int[].class);
+ public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
+ new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
/**
* <p>Whether the camera device will trigger autofocus for this request.</p>
@@ -1295,27 +1289,23 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
/**
* <p>List of areas to use for illuminant
* estimation.</p>
- * <p>Only used in AUTO mode.</p>
- * <p>Each area is a rectangle plus weight: xmin, ymin,
- * xmax, ymax, weight. The rectangle is defined to be inclusive of the
- * specified coordinates.</p>
* <p>The coordinate system is based on the active pixel array,
* with (0,0) being the top-left pixel in the active pixel array, and
* ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
* {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
* bottom-right pixel in the active pixel array. The weight
* should be nonnegative.</p>
- * <p>If all regions have 0 weight, then no specific auto-white balance (AWB) area
- * needs to be used by the camera device. If the AWB region is
- * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
+ * <p>If all regions have 0 weight, then no specific metering area
+ * needs to be used by the camera device. If the metering region is
+ * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
* the camera device will ignore the sections outside the region and output the
* used sections in the result metadata.</p>
*
* @see CaptureRequest#SCALER_CROP_REGION
* @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
*/
- public static final Key<int[]> CONTROL_AWB_REGIONS =
- new Key<int[]>("android.control.awbRegions", int[].class);
+ public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
+ new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
/**
* <p>Information to the camera device 3A (auto-exposure,
diff --git a/core/java/android/hardware/camera2/params/MeteringRectangle.java b/core/java/android/hardware/camera2/params/MeteringRectangle.java
index a26c57d..a7a3b59 100644
--- a/core/java/android/hardware/camera2/params/MeteringRectangle.java
+++ b/core/java/android/hardware/camera2/params/MeteringRectangle.java
@@ -57,7 +57,7 @@ public final class MeteringRectangle {
* @param height height >= 0
* @param meteringWeight weight >= 0
*
- * @throws IllegalArgumentException if any of the parameters were non-negative
+ * @throws IllegalArgumentException if any of the parameters were negative
*/
public MeteringRectangle(int x, int y, int width, int height, int meteringWeight) {
mX = checkArgumentNonnegative(x, "x must be nonnegative");
@@ -74,7 +74,7 @@ public final class MeteringRectangle {
* @param dimensions a non-{@code null} {@link android.util.Size Size} with width, height >= 0
* @param meteringWeight weight >= 0
*
- * @throws IllegalArgumentException if any of the parameters were non-negative
+ * @throws IllegalArgumentException if any of the parameters were negative
* @throws NullPointerException if any of the arguments were null
*/
public MeteringRectangle(Point xy, Size dimensions, int meteringWeight) {
@@ -94,7 +94,7 @@ public final class MeteringRectangle {
* @param rect a non-{@code null} rectangle with all x,y,w,h dimensions >= 0
* @param meteringWeight weight >= 0
*
- * @throws IllegalArgumentException if any of the parameters were non-negative
+ * @throws IllegalArgumentException if any of the parameters were negative
* @throws NullPointerException if any of the arguments were null
*/
public MeteringRectangle(Rect rect, int meteringWeight) {
@@ -210,7 +210,7 @@ public final class MeteringRectangle {
&& mY == other.mY
&& mWidth == other.mWidth
&& mHeight == other.mHeight
- && mWidth == other.mWidth);
+ && mWeight == other.mWeight);
}
/**