OSDN Git Service

Camera2: Update shading mode spec
authorZhijun He <zhijunhe@google.com>
Sat, 18 Jan 2014 00:43:05 +0000 (16:43 -0800)
committerZhijun He <zhijunhe@google.com>
Sat, 18 Jan 2014 00:43:05 +0000 (16:43 -0800)
Change-Id: Id4dc8de6e66aa130677ecab700a982943fcd8e09

core/java/android/hardware/camera2/CameraMetadata.java
core/java/android/hardware/camera2/CaptureRequest.java
core/java/android/hardware/camera2/CaptureResult.java

index 8756dd1..5c80be1 100644 (file)
@@ -943,6 +943,31 @@ public abstract class CameraMetadata {
     public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2;
 
     //
+    // Enumeration values for CaptureRequest#SHADING_MODE
+    //
+
+    /**
+     * <p>No lens shading correction is applied</p>
+     * @see CaptureRequest#SHADING_MODE
+     * @hide
+     */
+    public static final int SHADING_MODE_OFF = 0;
+
+    /**
+     * <p>Must not slow down frame rate relative to sensor raw output</p>
+     * @see CaptureRequest#SHADING_MODE
+     * @hide
+     */
+    public static final int SHADING_MODE_FAST = 1;
+
+    /**
+     * <p>Frame rate may be reduced by high quality</p>
+     * @see CaptureRequest#SHADING_MODE
+     * @hide
+     */
+    public static final int SHADING_MODE_HIGH_QUALITY = 2;
+
+    //
     // Enumeration values for CaptureRequest#STATISTICS_FACE_DETECT_MODE
     //
 
index 13a6cb6..0321e90 100644 (file)
@@ -1141,6 +1141,39 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable {
             new Key<Integer>("android.sensor.sensitivity", int.class);
 
     /**
+     * <p>Quality of lens shading correction applied
+     * to the image data.</p>
+     * <p>When set to OFF mode, no lens shading correction will be applied by the
+     * camera device, and an identity lens shading map data will be provided
+     * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
+     * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>,
+     * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map
+     * shown below:</p>
+     * <pre><code>[ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
+     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
+     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
+     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
+     * 1.0, 1.0, 1.0, 1.0,   1.0, 1.0, 1.0, 1.0,
+     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0 ]
+     * </code></pre>
+     * <p>When set to other modes, lens shading correction will be applied by the
+     * camera device. Applications can request lens shading map data by setting
+     * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide
+     * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified
+     * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p>
+     *
+     * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
+     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
+     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
+     * @see #SHADING_MODE_OFF
+     * @see #SHADING_MODE_FAST
+     * @see #SHADING_MODE_HIGH_QUALITY
+     * @hide
+     */
+    public static final Key<Integer> SHADING_MODE =
+            new Key<Integer>("android.shading.mode", int.class);
+
+    /**
      * <p>State of the face detector
      * unit</p>
      * <p>Whether face detection is enabled, and whether it
index 9990142..9237267 100644 (file)
@@ -1378,6 +1378,39 @@ public final class CaptureResult extends CameraMetadata {
             new Key<Float>("android.sensor.temperature", float.class);
 
     /**
+     * <p>Quality of lens shading correction applied
+     * to the image data.</p>
+     * <p>When set to OFF mode, no lens shading correction will be applied by the
+     * camera device, and an identity lens shading map data will be provided
+     * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
+     * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>,
+     * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map
+     * shown below:</p>
+     * <pre><code>[ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
+     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
+     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
+     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
+     * 1.0, 1.0, 1.0, 1.0,   1.0, 1.0, 1.0, 1.0,
+     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0 ]
+     * </code></pre>
+     * <p>When set to other modes, lens shading correction will be applied by the
+     * camera device. Applications can request lens shading map data by setting
+     * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide
+     * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified
+     * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p>
+     *
+     * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
+     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
+     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
+     * @see #SHADING_MODE_OFF
+     * @see #SHADING_MODE_FAST
+     * @see #SHADING_MODE_HIGH_QUALITY
+     * @hide
+     */
+    public static final Key<Integer> SHADING_MODE =
+            new Key<Integer>("android.shading.mode", int.class);
+
+    /**
      * <p>State of the face detector
      * unit</p>
      * <p>Whether face detection is enabled, and whether it