Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Eino-Ville Talvala | 2f1a2e4 | 2013-07-25 17:12:05 -0700 | [diff] [blame] | 17 | package android.hardware.camera2; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 18 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 19 | import android.hardware.camera2.impl.CameraMetadataNative; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 20 | |
| 21 | /** |
| 22 | * <p>The results of a single image capture from the image sensor.</p> |
| 23 | * |
| 24 | * <p>Contains the final configuration for the capture hardware (sensor, lens, |
| 25 | * flash), the processing pipeline, the control algorithms, and the output |
| 26 | * buffers.</p> |
| 27 | * |
| 28 | * <p>CaptureResults are produced by a {@link CameraDevice} after processing a |
| 29 | * {@link CaptureRequest}. All properties listed for capture requests can also |
| 30 | * be queried on the capture result, to determine the final values used for |
| 31 | * capture. The result also includes additional metadata about the state of the |
| 32 | * camera device during the capture.</p> |
| 33 | * |
| 34 | */ |
| 35 | public final class CaptureResult extends CameraMetadata { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 36 | |
| 37 | private final CameraMetadataNative mResults; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 38 | private final CaptureRequest mRequest; |
| 39 | private final int mSequenceId; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 40 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 41 | /** |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 42 | * Takes ownership of the passed-in properties object |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 43 | * @hide |
| 44 | */ |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 45 | public CaptureResult(CameraMetadataNative results, CaptureRequest parent, int sequenceId) { |
| 46 | if (results == null) { |
| 47 | throw new IllegalArgumentException("results was null"); |
| 48 | } |
| 49 | |
| 50 | if (parent == null) { |
| 51 | throw new IllegalArgumentException("parent was null"); |
| 52 | } |
| 53 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 54 | mResults = results; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 55 | mRequest = parent; |
| 56 | mSequenceId = sequenceId; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public <T> T get(Key<T> key) { |
| 61 | return mResults.get(key); |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 62 | } |
| 63 | |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 64 | /** |
| 65 | * Get the request associated with this result. |
| 66 | * |
| 67 | * <p>Whenever a request is successfully captured, with |
| 68 | * {@link CameraDevice.CaptureListener#onCaptureCompleted}, |
| 69 | * the {@code result}'s {@code getRequest()} will return that {@code request}. |
| 70 | * </p> |
| 71 | * |
| 72 | * <p>In particular, |
| 73 | * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() { |
| 74 | * {@literal @}Override |
| 75 | * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) { |
| 76 | * assert(myResult.getRequest.equals(myRequest) == true); |
| 77 | * } |
| 78 | * }; |
| 79 | * </code></pre> |
| 80 | * </p> |
| 81 | * |
| 82 | * @return The request associated with this result. Never {@code null}. |
| 83 | */ |
| 84 | public CaptureRequest getRequest() { |
| 85 | return mRequest; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Get the frame number associated with this result. |
| 90 | * |
| 91 | * <p>Whenever a request has been processed, regardless of failure or success, |
| 92 | * it gets a unique frame number assigned to its future result/failure.</p> |
| 93 | * |
| 94 | * <p>This value monotonically increments, starting with 0, |
| 95 | * for every new result or failure; and the scope is the lifetime of the |
| 96 | * {@link CameraDevice}.</p> |
| 97 | * |
| 98 | * @return int frame number |
| 99 | */ |
| 100 | public int getFrameNumber() { |
| 101 | return get(REQUEST_FRAME_COUNT); |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * The sequence ID for this failure that was returned by the |
| 106 | * {@link CameraDevice#capture} family of functions. |
| 107 | * |
| 108 | * <p>The sequence ID is a unique monotonically increasing value starting from 0, |
| 109 | * incremented every time a new group of requests is submitted to the CameraDevice.</p> |
| 110 | * |
| 111 | * @return int The ID for the sequence of requests that this capture result is a part of |
| 112 | * |
| 113 | * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted |
| 114 | */ |
| 115 | public int getSequenceId() { |
| 116 | return mSequenceId; |
| 117 | } |
| 118 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 119 | /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 120 | * The key entries below this point are generated from metadata |
| 121 | * definitions in /system/media/camera/docs. Do not modify by hand or |
| 122 | * modify the comment blocks at the start or end. |
| 123 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ |
| 124 | |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 125 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 126 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 127 | * <p>A color transform matrix to use to transform |
| 128 | * from sensor RGB color space to output linear sRGB color space</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 129 | * <p>This matrix is either set by the camera device when the request |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 130 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 131 | * directly by the application in the request when the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 132 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 133 | * <p>In the latter case, the camera device may round the matrix to account |
| 134 | * for precision issues; the final rounded matrix should be reported back |
| 135 | * in this matrix result metadata. The transform should keep the magnitude |
| 136 | * of the output color values within <code>[0, 1.0]</code> (assuming input color |
| 137 | * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 138 | * |
| 139 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 140 | */ |
| 141 | public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM = |
| 142 | new Key<Rational[]>("android.colorCorrection.transform", Rational[].class); |
| 143 | |
| 144 | /** |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 145 | * <p>Gains applying to Bayer raw color channels for |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 146 | * white-balance</p> |
| 147 | * <p>The 4-channel white-balance gains are defined in |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 148 | * the order of <code>[R G_even G_odd B]</code>, where <code>G_even</code> is the gain |
| 149 | * for green pixels on even rows of the output, and <code>G_odd</code> |
| 150 | * is the gain for green pixels on the odd rows. if a HAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 151 | * does not support a separate gain for even/odd green channels, |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 152 | * it should use the <code>G_even</code> value, and write <code>G_odd</code> equal to |
| 153 | * <code>G_even</code> in the output result metadata.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 154 | * <p>This array is either set by HAL when the request |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 155 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or |
Igor Murashkin | d5ff06a | 2013-08-20 15:15:06 -0700 | [diff] [blame] | 156 | * directly by the application in the request when the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 157 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 158 | * <p>The output should be the gains actually applied by the HAL to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 159 | * the current frame.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 160 | * |
| 161 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 162 | */ |
| 163 | public static final Key<float[]> COLOR_CORRECTION_GAINS = |
| 164 | new Key<float[]>("android.colorCorrection.gains", float[].class); |
| 165 | |
| 166 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 167 | * <p>The ID sent with the latest |
| 168 | * CAMERA2_TRIGGER_PRECAPTURE_METERING call</p> |
| 169 | * <p>Must be 0 if no |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 170 | * CAMERA2_TRIGGER_PRECAPTURE_METERING trigger received yet |
| 171 | * by HAL. Always updated even if AE algorithm ignores the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 172 | * trigger</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 173 | * @hide |
| 174 | */ |
| 175 | public static final Key<Integer> CONTROL_AE_PRECAPTURE_ID = |
| 176 | new Key<Integer>("android.control.aePrecaptureId", int.class); |
| 177 | |
| 178 | /** |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 179 | * <p>The desired mode for the camera device's |
| 180 | * auto-exposure routine.</p> |
| 181 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is |
| 182 | * AUTO.</p> |
| 183 | * <p>When set to any of the ON modes, the camera device's |
| 184 | * auto-exposure routine is enabled, overriding the |
| 185 | * application's selected exposure time, sensor sensitivity, |
| 186 | * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
| 187 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and |
| 188 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes |
| 189 | * is selected, the camera device's flash unit controls are |
| 190 | * also overridden.</p> |
| 191 | * <p>The FLASH modes are only available if the camera device |
| 192 | * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> |
| 193 | * <p>If flash TORCH mode is desired, this field must be set to |
| 194 | * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> |
| 195 | * <p>When set to any of the ON modes, the values chosen by the |
| 196 | * camera device auto-exposure routine for the overridden |
| 197 | * fields for a given capture will be available in its |
| 198 | * CaptureResult.</p> |
| 199 | * |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 200 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 201 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
| 202 | * @see CaptureRequest#FLASH_MODE |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 203 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 204 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 205 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 206 | * @see #CONTROL_AE_MODE_OFF |
| 207 | * @see #CONTROL_AE_MODE_ON |
| 208 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH |
| 209 | * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH |
| 210 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE |
| 211 | */ |
| 212 | public static final Key<Integer> CONTROL_AE_MODE = |
| 213 | new Key<Integer>("android.control.aeMode", int.class); |
| 214 | |
| 215 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 216 | * <p>List of areas to use for |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 217 | * metering.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 218 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 219 | * xmax, ymax, weight. The rectangle is defined to be inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 220 | * specified coordinates.</p> |
| 221 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 222 | * with (0,0) being the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 223 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 224 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 225 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 226 | * should be nonnegative.</p> |
| 227 | * <p>If all regions have 0 weight, then no specific metering area |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 228 | * needs to be used by the HAL. If the metering region is |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 229 | * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 230 | * should ignore the sections outside the region and output the |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 231 | * used sections in the frame metadata.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 232 | * |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 233 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 234 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 235 | */ |
| 236 | public static final Key<int[]> CONTROL_AE_REGIONS = |
| 237 | new Key<int[]>("android.control.aeRegions", int[].class); |
| 238 | |
| 239 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 240 | * <p>Current state of AE algorithm</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 241 | * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always |
| 242 | * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 243 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 244 | * the algorithm states to INACTIVE.</p> |
| 245 | * <p>The camera device can do several state transitions between two results, if it is |
| 246 | * allowed by the state transition table. For example: INACTIVE may never actually be |
| 247 | * seen in a result.</p> |
| 248 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 249 | * AE state becomes CONVERGED, then the image data associated with this result should |
| 250 | * be good to use.</p> |
| 251 | * <p>Below are state transition tables for different AE modes.</p> |
| 252 | * <table> |
| 253 | * <thead> |
| 254 | * <tr> |
| 255 | * <th align="center">State</th> |
| 256 | * <th align="center">Transition Cause</th> |
| 257 | * <th align="center">New State</th> |
| 258 | * <th align="center">Notes</th> |
| 259 | * </tr> |
| 260 | * </thead> |
| 261 | * <tbody> |
| 262 | * <tr> |
| 263 | * <td align="center">INACTIVE</td> |
| 264 | * <td align="center"></td> |
| 265 | * <td align="center">INACTIVE</td> |
| 266 | * <td align="center">Camera device auto exposure algorithm is disabled</td> |
| 267 | * </tr> |
| 268 | * </tbody> |
| 269 | * </table> |
| 270 | * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p> |
| 271 | * <table> |
| 272 | * <thead> |
| 273 | * <tr> |
| 274 | * <th align="center">State</th> |
| 275 | * <th align="center">Transition Cause</th> |
| 276 | * <th align="center">New State</th> |
| 277 | * <th align="center">Notes</th> |
| 278 | * </tr> |
| 279 | * </thead> |
| 280 | * <tbody> |
| 281 | * <tr> |
| 282 | * <td align="center">INACTIVE</td> |
| 283 | * <td align="center">Camera device initiates AE scan</td> |
| 284 | * <td align="center">SEARCHING</td> |
| 285 | * <td align="center">Values changing</td> |
| 286 | * </tr> |
| 287 | * <tr> |
| 288 | * <td align="center">INACTIVE</td> |
| 289 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 290 | * <td align="center">LOCKED</td> |
| 291 | * <td align="center">Values locked</td> |
| 292 | * </tr> |
| 293 | * <tr> |
| 294 | * <td align="center">SEARCHING</td> |
| 295 | * <td align="center">Camera device finishes AE scan</td> |
| 296 | * <td align="center">CONVERGED</td> |
| 297 | * <td align="center">Good values, not changing</td> |
| 298 | * </tr> |
| 299 | * <tr> |
| 300 | * <td align="center">SEARCHING</td> |
| 301 | * <td align="center">Camera device finishes AE scan</td> |
| 302 | * <td align="center">FLASH_REQUIRED</td> |
| 303 | * <td align="center">Converged but too dark w/o flash</td> |
| 304 | * </tr> |
| 305 | * <tr> |
| 306 | * <td align="center">SEARCHING</td> |
| 307 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 308 | * <td align="center">LOCKED</td> |
| 309 | * <td align="center">Values locked</td> |
| 310 | * </tr> |
| 311 | * <tr> |
| 312 | * <td align="center">CONVERGED</td> |
| 313 | * <td align="center">Camera device initiates AE scan</td> |
| 314 | * <td align="center">SEARCHING</td> |
| 315 | * <td align="center">Values changing</td> |
| 316 | * </tr> |
| 317 | * <tr> |
| 318 | * <td align="center">CONVERGED</td> |
| 319 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 320 | * <td align="center">LOCKED</td> |
| 321 | * <td align="center">Values locked</td> |
| 322 | * </tr> |
| 323 | * <tr> |
| 324 | * <td align="center">FLASH_REQUIRED</td> |
| 325 | * <td align="center">Camera device initiates AE scan</td> |
| 326 | * <td align="center">SEARCHING</td> |
| 327 | * <td align="center">Values changing</td> |
| 328 | * </tr> |
| 329 | * <tr> |
| 330 | * <td align="center">FLASH_REQUIRED</td> |
| 331 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 332 | * <td align="center">LOCKED</td> |
| 333 | * <td align="center">Values locked</td> |
| 334 | * </tr> |
| 335 | * <tr> |
| 336 | * <td align="center">LOCKED</td> |
| 337 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 338 | * <td align="center">SEARCHING</td> |
| 339 | * <td align="center">Values not good after unlock</td> |
| 340 | * </tr> |
| 341 | * <tr> |
| 342 | * <td align="center">LOCKED</td> |
| 343 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 344 | * <td align="center">CONVERGED</td> |
| 345 | * <td align="center">Values good after unlock</td> |
| 346 | * </tr> |
| 347 | * <tr> |
| 348 | * <td align="center">LOCKED</td> |
| 349 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 350 | * <td align="center">FLASH_REQUIRED</td> |
| 351 | * <td align="center">Exposure good, but too dark</td> |
| 352 | * </tr> |
| 353 | * <tr> |
| 354 | * <td align="center">PRECAPTURE</td> |
| 355 | * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 356 | * <td align="center">CONVERGED</td> |
| 357 | * <td align="center">Ready for high-quality capture</td> |
| 358 | * </tr> |
| 359 | * <tr> |
| 360 | * <td align="center">PRECAPTURE</td> |
| 361 | * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 362 | * <td align="center">LOCKED</td> |
| 363 | * <td align="center">Ready for high-quality capture</td> |
| 364 | * </tr> |
| 365 | * <tr> |
| 366 | * <td align="center">Any state</td> |
| 367 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td> |
| 368 | * <td align="center">PRECAPTURE</td> |
| 369 | * <td align="center">Start AE precapture metering sequence</td> |
| 370 | * </tr> |
| 371 | * </tbody> |
| 372 | * </table> |
| 373 | * |
| 374 | * @see CaptureRequest#CONTROL_AE_LOCK |
| 375 | * @see CaptureRequest#CONTROL_AE_MODE |
| 376 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 377 | * @see CaptureRequest#CONTROL_MODE |
| 378 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 379 | * @see #CONTROL_AE_STATE_INACTIVE |
| 380 | * @see #CONTROL_AE_STATE_SEARCHING |
| 381 | * @see #CONTROL_AE_STATE_CONVERGED |
| 382 | * @see #CONTROL_AE_STATE_LOCKED |
| 383 | * @see #CONTROL_AE_STATE_FLASH_REQUIRED |
| 384 | * @see #CONTROL_AE_STATE_PRECAPTURE |
| 385 | */ |
| 386 | public static final Key<Integer> CONTROL_AE_STATE = |
| 387 | new Key<Integer>("android.control.aeState", int.class); |
| 388 | |
| 389 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 390 | * <p>Whether AF is currently enabled, and what |
| 391 | * mode it is set to</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 392 | * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO.</p> |
Zhijun He | 78146ec | 2014-01-14 18:12:13 -0800 | [diff] [blame] | 393 | * <p>If the lens is controlled by the camera device auto-focus algorithm, |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 394 | * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState} |
Zhijun He | 78146ec | 2014-01-14 18:12:13 -0800 | [diff] [blame] | 395 | * in result metadata.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 396 | * |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 397 | * @see CaptureResult#CONTROL_AF_STATE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 398 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 399 | * @see #CONTROL_AF_MODE_OFF |
| 400 | * @see #CONTROL_AF_MODE_AUTO |
| 401 | * @see #CONTROL_AF_MODE_MACRO |
| 402 | * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO |
| 403 | * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE |
| 404 | * @see #CONTROL_AF_MODE_EDOF |
| 405 | */ |
| 406 | public static final Key<Integer> CONTROL_AF_MODE = |
| 407 | new Key<Integer>("android.control.afMode", int.class); |
| 408 | |
| 409 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 410 | * <p>List of areas to use for focus |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 411 | * estimation.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 412 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 413 | * xmax, ymax, weight. The rectangle is defined to be inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 414 | * specified coordinates.</p> |
| 415 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 416 | * with (0,0) being the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 417 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 418 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 419 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 420 | * should be nonnegative.</p> |
| 421 | * <p>If all regions have 0 weight, then no specific focus area |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 422 | * needs to be used by the HAL. If the focusing region is |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 423 | * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 424 | * should ignore the sections outside the region and output the |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 425 | * used sections in the frame metadata.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 426 | * |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 427 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 428 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 429 | */ |
| 430 | public static final Key<int[]> CONTROL_AF_REGIONS = |
| 431 | new Key<int[]>("android.control.afRegions", int[].class); |
| 432 | |
| 433 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 434 | * <p>Current state of AF algorithm</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 435 | * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always |
| 436 | * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 437 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 438 | * the algorithm states to INACTIVE.</p> |
| 439 | * <p>The camera device can do several state transitions between two results, if it is |
| 440 | * allowed by the state transition table. For example: INACTIVE may never actually be |
| 441 | * seen in a result.</p> |
| 442 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 443 | * AF state becomes FOCUSED, then the image data associated with this result should |
| 444 | * be sharp.</p> |
| 445 | * <p>Below are state transition tables for different AF modes.</p> |
| 446 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p> |
| 447 | * <table> |
| 448 | * <thead> |
| 449 | * <tr> |
| 450 | * <th align="center">State</th> |
| 451 | * <th align="center">Transition Cause</th> |
| 452 | * <th align="center">New State</th> |
| 453 | * <th align="center">Notes</th> |
| 454 | * </tr> |
| 455 | * </thead> |
| 456 | * <tbody> |
| 457 | * <tr> |
| 458 | * <td align="center">INACTIVE</td> |
| 459 | * <td align="center"></td> |
| 460 | * <td align="center">INACTIVE</td> |
| 461 | * <td align="center">Never changes</td> |
| 462 | * </tr> |
| 463 | * </tbody> |
| 464 | * </table> |
| 465 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p> |
| 466 | * <table> |
| 467 | * <thead> |
| 468 | * <tr> |
| 469 | * <th align="center">State</th> |
| 470 | * <th align="center">Transition Cause</th> |
| 471 | * <th align="center">New State</th> |
| 472 | * <th align="center">Notes</th> |
| 473 | * </tr> |
| 474 | * </thead> |
| 475 | * <tbody> |
| 476 | * <tr> |
| 477 | * <td align="center">INACTIVE</td> |
| 478 | * <td align="center">AF_TRIGGER</td> |
| 479 | * <td align="center">ACTIVE_SCAN</td> |
| 480 | * <td align="center">Start AF sweep, Lens now moving</td> |
| 481 | * </tr> |
| 482 | * <tr> |
| 483 | * <td align="center">ACTIVE_SCAN</td> |
| 484 | * <td align="center">AF sweep done</td> |
| 485 | * <td align="center">FOCUSED_LOCKED</td> |
| 486 | * <td align="center">Focused, Lens now locked</td> |
| 487 | * </tr> |
| 488 | * <tr> |
| 489 | * <td align="center">ACTIVE_SCAN</td> |
| 490 | * <td align="center">AF sweep done</td> |
| 491 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 492 | * <td align="center">Not focused, Lens now locked</td> |
| 493 | * </tr> |
| 494 | * <tr> |
| 495 | * <td align="center">ACTIVE_SCAN</td> |
| 496 | * <td align="center">AF_CANCEL</td> |
| 497 | * <td align="center">INACTIVE</td> |
| 498 | * <td align="center">Cancel/reset AF, Lens now locked</td> |
| 499 | * </tr> |
| 500 | * <tr> |
| 501 | * <td align="center">FOCUSED_LOCKED</td> |
| 502 | * <td align="center">AF_CANCEL</td> |
| 503 | * <td align="center">INACTIVE</td> |
| 504 | * <td align="center">Cancel/reset AF</td> |
| 505 | * </tr> |
| 506 | * <tr> |
| 507 | * <td align="center">FOCUSED_LOCKED</td> |
| 508 | * <td align="center">AF_TRIGGER</td> |
| 509 | * <td align="center">ACTIVE_SCAN</td> |
| 510 | * <td align="center">Start new sweep, Lens now moving</td> |
| 511 | * </tr> |
| 512 | * <tr> |
| 513 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 514 | * <td align="center">AF_CANCEL</td> |
| 515 | * <td align="center">INACTIVE</td> |
| 516 | * <td align="center">Cancel/reset AF</td> |
| 517 | * </tr> |
| 518 | * <tr> |
| 519 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 520 | * <td align="center">AF_TRIGGER</td> |
| 521 | * <td align="center">ACTIVE_SCAN</td> |
| 522 | * <td align="center">Start new sweep, Lens now moving</td> |
| 523 | * </tr> |
| 524 | * <tr> |
| 525 | * <td align="center">Any state</td> |
| 526 | * <td align="center">Mode change</td> |
| 527 | * <td align="center">INACTIVE</td> |
| 528 | * <td align="center"></td> |
| 529 | * </tr> |
| 530 | * </tbody> |
| 531 | * </table> |
| 532 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p> |
| 533 | * <table> |
| 534 | * <thead> |
| 535 | * <tr> |
| 536 | * <th align="center">State</th> |
| 537 | * <th align="center">Transition Cause</th> |
| 538 | * <th align="center">New State</th> |
| 539 | * <th align="center">Notes</th> |
| 540 | * </tr> |
| 541 | * </thead> |
| 542 | * <tbody> |
| 543 | * <tr> |
| 544 | * <td align="center">INACTIVE</td> |
| 545 | * <td align="center">Camera device initiates new scan</td> |
| 546 | * <td align="center">PASSIVE_SCAN</td> |
| 547 | * <td align="center">Start AF scan, Lens now moving</td> |
| 548 | * </tr> |
| 549 | * <tr> |
| 550 | * <td align="center">INACTIVE</td> |
| 551 | * <td align="center">AF_TRIGGER</td> |
| 552 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 553 | * <td align="center">AF state query, Lens now locked</td> |
| 554 | * </tr> |
| 555 | * <tr> |
| 556 | * <td align="center">PASSIVE_SCAN</td> |
| 557 | * <td align="center">Camera device completes current scan</td> |
| 558 | * <td align="center">PASSIVE_FOCUSED</td> |
| 559 | * <td align="center">End AF scan, Lens now locked</td> |
| 560 | * </tr> |
| 561 | * <tr> |
| 562 | * <td align="center">PASSIVE_SCAN</td> |
| 563 | * <td align="center">Camera device fails current scan</td> |
| 564 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 565 | * <td align="center">End AF scan, Lens now locked</td> |
| 566 | * </tr> |
| 567 | * <tr> |
| 568 | * <td align="center">PASSIVE_SCAN</td> |
| 569 | * <td align="center">AF_TRIGGER</td> |
| 570 | * <td align="center">FOCUSED_LOCKED</td> |
| 571 | * <td align="center">Immediate trans. If focus is good, Lens now locked</td> |
| 572 | * </tr> |
| 573 | * <tr> |
| 574 | * <td align="center">PASSIVE_SCAN</td> |
| 575 | * <td align="center">AF_TRIGGER</td> |
| 576 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 577 | * <td align="center">Immediate trans. if focus is bad, Lens now locked</td> |
| 578 | * </tr> |
| 579 | * <tr> |
| 580 | * <td align="center">PASSIVE_SCAN</td> |
| 581 | * <td align="center">AF_CANCEL</td> |
| 582 | * <td align="center">INACTIVE</td> |
| 583 | * <td align="center">Reset lens position, Lens now locked</td> |
| 584 | * </tr> |
| 585 | * <tr> |
| 586 | * <td align="center">PASSIVE_FOCUSED</td> |
| 587 | * <td align="center">Camera device initiates new scan</td> |
| 588 | * <td align="center">PASSIVE_SCAN</td> |
| 589 | * <td align="center">Start AF scan, Lens now moving</td> |
| 590 | * </tr> |
| 591 | * <tr> |
| 592 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 593 | * <td align="center">Camera device initiates new scan</td> |
| 594 | * <td align="center">PASSIVE_SCAN</td> |
| 595 | * <td align="center">Start AF scan, Lens now moving</td> |
| 596 | * </tr> |
| 597 | * <tr> |
| 598 | * <td align="center">PASSIVE_FOCUSED</td> |
| 599 | * <td align="center">AF_TRIGGER</td> |
| 600 | * <td align="center">FOCUSED_LOCKED</td> |
| 601 | * <td align="center">Immediate trans. Lens now locked</td> |
| 602 | * </tr> |
| 603 | * <tr> |
| 604 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 605 | * <td align="center">AF_TRIGGER</td> |
| 606 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 607 | * <td align="center">Immediate trans. Lens now locked</td> |
| 608 | * </tr> |
| 609 | * <tr> |
| 610 | * <td align="center">FOCUSED_LOCKED</td> |
| 611 | * <td align="center">AF_TRIGGER</td> |
| 612 | * <td align="center">FOCUSED_LOCKED</td> |
| 613 | * <td align="center">No effect</td> |
| 614 | * </tr> |
| 615 | * <tr> |
| 616 | * <td align="center">FOCUSED_LOCKED</td> |
| 617 | * <td align="center">AF_CANCEL</td> |
| 618 | * <td align="center">INACTIVE</td> |
| 619 | * <td align="center">Restart AF scan</td> |
| 620 | * </tr> |
| 621 | * <tr> |
| 622 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 623 | * <td align="center">AF_TRIGGER</td> |
| 624 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 625 | * <td align="center">No effect</td> |
| 626 | * </tr> |
| 627 | * <tr> |
| 628 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 629 | * <td align="center">AF_CANCEL</td> |
| 630 | * <td align="center">INACTIVE</td> |
| 631 | * <td align="center">Restart AF scan</td> |
| 632 | * </tr> |
| 633 | * </tbody> |
| 634 | * </table> |
| 635 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p> |
| 636 | * <table> |
| 637 | * <thead> |
| 638 | * <tr> |
| 639 | * <th align="center">State</th> |
| 640 | * <th align="center">Transition Cause</th> |
| 641 | * <th align="center">New State</th> |
| 642 | * <th align="center">Notes</th> |
| 643 | * </tr> |
| 644 | * </thead> |
| 645 | * <tbody> |
| 646 | * <tr> |
| 647 | * <td align="center">INACTIVE</td> |
| 648 | * <td align="center">Camera device initiates new scan</td> |
| 649 | * <td align="center">PASSIVE_SCAN</td> |
| 650 | * <td align="center">Start AF scan, Lens now moving</td> |
| 651 | * </tr> |
| 652 | * <tr> |
| 653 | * <td align="center">INACTIVE</td> |
| 654 | * <td align="center">AF_TRIGGER</td> |
| 655 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 656 | * <td align="center">AF state query, Lens now locked</td> |
| 657 | * </tr> |
| 658 | * <tr> |
| 659 | * <td align="center">PASSIVE_SCAN</td> |
| 660 | * <td align="center">Camera device completes current scan</td> |
| 661 | * <td align="center">PASSIVE_FOCUSED</td> |
| 662 | * <td align="center">End AF scan, Lens now locked</td> |
| 663 | * </tr> |
| 664 | * <tr> |
| 665 | * <td align="center">PASSIVE_SCAN</td> |
| 666 | * <td align="center">Camera device fails current scan</td> |
| 667 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 668 | * <td align="center">End AF scan, Lens now locked</td> |
| 669 | * </tr> |
| 670 | * <tr> |
| 671 | * <td align="center">PASSIVE_SCAN</td> |
| 672 | * <td align="center">AF_TRIGGER</td> |
| 673 | * <td align="center">FOCUSED_LOCKED</td> |
| 674 | * <td align="center">Eventual trans. once focus good, Lens now locked</td> |
| 675 | * </tr> |
| 676 | * <tr> |
| 677 | * <td align="center">PASSIVE_SCAN</td> |
| 678 | * <td align="center">AF_TRIGGER</td> |
| 679 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 680 | * <td align="center">Eventual trans. if cannot focus, Lens now locked</td> |
| 681 | * </tr> |
| 682 | * <tr> |
| 683 | * <td align="center">PASSIVE_SCAN</td> |
| 684 | * <td align="center">AF_CANCEL</td> |
| 685 | * <td align="center">INACTIVE</td> |
| 686 | * <td align="center">Reset lens position, Lens now locked</td> |
| 687 | * </tr> |
| 688 | * <tr> |
| 689 | * <td align="center">PASSIVE_FOCUSED</td> |
| 690 | * <td align="center">Camera device initiates new scan</td> |
| 691 | * <td align="center">PASSIVE_SCAN</td> |
| 692 | * <td align="center">Start AF scan, Lens now moving</td> |
| 693 | * </tr> |
| 694 | * <tr> |
| 695 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 696 | * <td align="center">Camera device initiates new scan</td> |
| 697 | * <td align="center">PASSIVE_SCAN</td> |
| 698 | * <td align="center">Start AF scan, Lens now moving</td> |
| 699 | * </tr> |
| 700 | * <tr> |
| 701 | * <td align="center">PASSIVE_FOCUSED</td> |
| 702 | * <td align="center">AF_TRIGGER</td> |
| 703 | * <td align="center">FOCUSED_LOCKED</td> |
| 704 | * <td align="center">Immediate trans. Lens now locked</td> |
| 705 | * </tr> |
| 706 | * <tr> |
| 707 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 708 | * <td align="center">AF_TRIGGER</td> |
| 709 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 710 | * <td align="center">Immediate trans. Lens now locked</td> |
| 711 | * </tr> |
| 712 | * <tr> |
| 713 | * <td align="center">FOCUSED_LOCKED</td> |
| 714 | * <td align="center">AF_TRIGGER</td> |
| 715 | * <td align="center">FOCUSED_LOCKED</td> |
| 716 | * <td align="center">No effect</td> |
| 717 | * </tr> |
| 718 | * <tr> |
| 719 | * <td align="center">FOCUSED_LOCKED</td> |
| 720 | * <td align="center">AF_CANCEL</td> |
| 721 | * <td align="center">INACTIVE</td> |
| 722 | * <td align="center">Restart AF scan</td> |
| 723 | * </tr> |
| 724 | * <tr> |
| 725 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 726 | * <td align="center">AF_TRIGGER</td> |
| 727 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 728 | * <td align="center">No effect</td> |
| 729 | * </tr> |
| 730 | * <tr> |
| 731 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 732 | * <td align="center">AF_CANCEL</td> |
| 733 | * <td align="center">INACTIVE</td> |
| 734 | * <td align="center">Restart AF scan</td> |
| 735 | * </tr> |
| 736 | * </tbody> |
| 737 | * </table> |
| 738 | * |
| 739 | * @see CaptureRequest#CONTROL_AF_MODE |
| 740 | * @see CaptureRequest#CONTROL_MODE |
| 741 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 742 | * @see #CONTROL_AF_STATE_INACTIVE |
| 743 | * @see #CONTROL_AF_STATE_PASSIVE_SCAN |
| 744 | * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED |
| 745 | * @see #CONTROL_AF_STATE_ACTIVE_SCAN |
| 746 | * @see #CONTROL_AF_STATE_FOCUSED_LOCKED |
| 747 | * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED |
Eino-Ville Talvala | 9f880f7 | 2013-09-20 17:50:41 -0700 | [diff] [blame] | 748 | * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 749 | */ |
| 750 | public static final Key<Integer> CONTROL_AF_STATE = |
| 751 | new Key<Integer>("android.control.afState", int.class); |
| 752 | |
| 753 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 754 | * <p>The ID sent with the latest |
| 755 | * CAMERA2_TRIGGER_AUTOFOCUS call</p> |
| 756 | * <p>Must be 0 if no CAMERA2_TRIGGER_AUTOFOCUS trigger |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 757 | * received yet by HAL. Always updated even if AF algorithm |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 758 | * ignores the trigger</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 759 | * @hide |
| 760 | */ |
| 761 | public static final Key<Integer> CONTROL_AF_TRIGGER_ID = |
| 762 | new Key<Integer>("android.control.afTriggerId", int.class); |
| 763 | |
| 764 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 765 | * <p>Whether AWB is currently setting the color |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 766 | * transform fields, and what its illumination target |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 767 | * is</p> |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 768 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p> |
| 769 | * <p>When set to the ON mode, the camera device's auto white balance |
| 770 | * routine is enabled, overriding the application's selected |
| 771 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 772 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
| 773 | * <p>When set to the OFF mode, the camera device's auto white balance |
| 774 | * routine is disabled. The applicantion manually controls the white |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 775 | * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 776 | * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
| 777 | * <p>When set to any other modes, the camera device's auto white balance |
| 778 | * routine is disabled. The camera device uses each particular illumination |
| 779 | * target for white balance adjustment.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 780 | * |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 781 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 782 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
| 783 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 784 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 785 | * @see #CONTROL_AWB_MODE_OFF |
| 786 | * @see #CONTROL_AWB_MODE_AUTO |
| 787 | * @see #CONTROL_AWB_MODE_INCANDESCENT |
| 788 | * @see #CONTROL_AWB_MODE_FLUORESCENT |
| 789 | * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT |
| 790 | * @see #CONTROL_AWB_MODE_DAYLIGHT |
| 791 | * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT |
| 792 | * @see #CONTROL_AWB_MODE_TWILIGHT |
| 793 | * @see #CONTROL_AWB_MODE_SHADE |
| 794 | */ |
| 795 | public static final Key<Integer> CONTROL_AWB_MODE = |
| 796 | new Key<Integer>("android.control.awbMode", int.class); |
| 797 | |
| 798 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 799 | * <p>List of areas to use for illuminant |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 800 | * estimation.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 801 | * <p>Only used in AUTO mode.</p> |
| 802 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 803 | * xmax, ymax, weight. The rectangle is defined to be inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 804 | * specified coordinates.</p> |
| 805 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 806 | * with (0,0) being the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 807 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 808 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 809 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 810 | * should be nonnegative.</p> |
| 811 | * <p>If all regions have 0 weight, then no specific metering area |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 812 | * needs to be used by the HAL. If the metering region is |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 813 | * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 814 | * should ignore the sections outside the region and output the |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 815 | * used sections in the frame metadata.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 816 | * |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 817 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 818 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 819 | */ |
| 820 | public static final Key<int[]> CONTROL_AWB_REGIONS = |
| 821 | new Key<int[]>("android.control.awbRegions", int[].class); |
| 822 | |
| 823 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 824 | * <p>Current state of AWB algorithm</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 825 | * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always |
| 826 | * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 827 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 828 | * the algorithm states to INACTIVE.</p> |
| 829 | * <p>The camera device can do several state transitions between two results, if it is |
| 830 | * allowed by the state transition table. So INACTIVE may never actually be seen in |
| 831 | * a result.</p> |
| 832 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 833 | * AWB state becomes CONVERGED, then the image data associated with this result should |
| 834 | * be good to use.</p> |
| 835 | * <p>Below are state transition tables for different AWB modes.</p> |
| 836 | * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p> |
| 837 | * <table> |
| 838 | * <thead> |
| 839 | * <tr> |
| 840 | * <th align="center">State</th> |
| 841 | * <th align="center">Transition Cause</th> |
| 842 | * <th align="center">New State</th> |
| 843 | * <th align="center">Notes</th> |
| 844 | * </tr> |
| 845 | * </thead> |
| 846 | * <tbody> |
| 847 | * <tr> |
| 848 | * <td align="center">INACTIVE</td> |
| 849 | * <td align="center"></td> |
| 850 | * <td align="center">INACTIVE</td> |
| 851 | * <td align="center">Camera device auto white balance algorithm is disabled</td> |
| 852 | * </tr> |
| 853 | * </tbody> |
| 854 | * </table> |
| 855 | * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p> |
| 856 | * <table> |
| 857 | * <thead> |
| 858 | * <tr> |
| 859 | * <th align="center">State</th> |
| 860 | * <th align="center">Transition Cause</th> |
| 861 | * <th align="center">New State</th> |
| 862 | * <th align="center">Notes</th> |
| 863 | * </tr> |
| 864 | * </thead> |
| 865 | * <tbody> |
| 866 | * <tr> |
| 867 | * <td align="center">INACTIVE</td> |
| 868 | * <td align="center">Camera device initiates AWB scan</td> |
| 869 | * <td align="center">SEARCHING</td> |
| 870 | * <td align="center">Values changing</td> |
| 871 | * </tr> |
| 872 | * <tr> |
| 873 | * <td align="center">INACTIVE</td> |
| 874 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 875 | * <td align="center">LOCKED</td> |
| 876 | * <td align="center">Values locked</td> |
| 877 | * </tr> |
| 878 | * <tr> |
| 879 | * <td align="center">SEARCHING</td> |
| 880 | * <td align="center">Camera device finishes AWB scan</td> |
| 881 | * <td align="center">CONVERGED</td> |
| 882 | * <td align="center">Good values, not changing</td> |
| 883 | * </tr> |
| 884 | * <tr> |
| 885 | * <td align="center">SEARCHING</td> |
| 886 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 887 | * <td align="center">LOCKED</td> |
| 888 | * <td align="center">Values locked</td> |
| 889 | * </tr> |
| 890 | * <tr> |
| 891 | * <td align="center">CONVERGED</td> |
| 892 | * <td align="center">Camera device initiates AWB scan</td> |
| 893 | * <td align="center">SEARCHING</td> |
| 894 | * <td align="center">Values changing</td> |
| 895 | * </tr> |
| 896 | * <tr> |
| 897 | * <td align="center">CONVERGED</td> |
| 898 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 899 | * <td align="center">LOCKED</td> |
| 900 | * <td align="center">Values locked</td> |
| 901 | * </tr> |
| 902 | * <tr> |
| 903 | * <td align="center">LOCKED</td> |
| 904 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> |
| 905 | * <td align="center">SEARCHING</td> |
| 906 | * <td align="center">Values not good after unlock</td> |
| 907 | * </tr> |
| 908 | * <tr> |
| 909 | * <td align="center">LOCKED</td> |
| 910 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> |
| 911 | * <td align="center">CONVERGED</td> |
| 912 | * <td align="center">Values good after unlock</td> |
| 913 | * </tr> |
| 914 | * </tbody> |
| 915 | * </table> |
| 916 | * |
| 917 | * @see CaptureRequest#CONTROL_AWB_LOCK |
| 918 | * @see CaptureRequest#CONTROL_AWB_MODE |
| 919 | * @see CaptureRequest#CONTROL_MODE |
| 920 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 921 | * @see #CONTROL_AWB_STATE_INACTIVE |
| 922 | * @see #CONTROL_AWB_STATE_SEARCHING |
| 923 | * @see #CONTROL_AWB_STATE_CONVERGED |
| 924 | * @see #CONTROL_AWB_STATE_LOCKED |
| 925 | */ |
| 926 | public static final Key<Integer> CONTROL_AWB_STATE = |
| 927 | new Key<Integer>("android.control.awbState", int.class); |
| 928 | |
| 929 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 930 | * <p>Overall mode of 3A control |
| 931 | * routines</p> |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 932 | * <p>High-level 3A control. When set to OFF, all 3A control |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 933 | * by the camera device is disabled. The application must set the fields for |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 934 | * capture parameters itself.</p> |
| 935 | * <p>When set to AUTO, the individual algorithm controls in |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 936 | * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 937 | * <p>When set to USE_SCENE_MODE, the individual controls in |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 938 | * android.control.* are mostly disabled, and the camera device implements |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 939 | * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 940 | * as it wishes. The camera device scene mode 3A settings are provided by |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 941 | * android.control.sceneModeOverrides.</p> |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 942 | * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference |
| 943 | * is that this frame will not be used by camera device background 3A statistics |
| 944 | * update, as if this frame is never captured. This mode can be used in the scenario |
| 945 | * where the application doesn't want a 3A manual control capture to affect |
| 946 | * the subsequent auto 3A capture results.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 947 | * |
| 948 | * @see CaptureRequest#CONTROL_AF_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 949 | * @see #CONTROL_MODE_OFF |
| 950 | * @see #CONTROL_MODE_AUTO |
| 951 | * @see #CONTROL_MODE_USE_SCENE_MODE |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 952 | * @see #CONTROL_MODE_OFF_KEEP_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 953 | */ |
| 954 | public static final Key<Integer> CONTROL_MODE = |
| 955 | new Key<Integer>("android.control.mode", int.class); |
| 956 | |
| 957 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 958 | * <p>Operation mode for edge |
| 959 | * enhancement</p> |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 960 | * <p>Edge/sharpness/detail enhancement. OFF means no |
| 961 | * enhancement will be applied by the HAL.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 962 | * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 963 | * will be applied. HIGH_QUALITY mode indicates that the |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 964 | * camera device will use the highest-quality enhancement algorithms, |
| 965 | * even if it slows down capture rate. FAST means the camera device will |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 966 | * not slow down capture rate when applying edge enhancement.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 967 | * @see #EDGE_MODE_OFF |
| 968 | * @see #EDGE_MODE_FAST |
| 969 | * @see #EDGE_MODE_HIGH_QUALITY |
| 970 | */ |
| 971 | public static final Key<Integer> EDGE_MODE = |
| 972 | new Key<Integer>("android.edge.mode", int.class); |
| 973 | |
| 974 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 975 | * <p>The desired mode for for the camera device's flash control.</p> |
| 976 | * <p>This control is only effective when flash unit is available |
Zhijun He | 153ac10 | 2014-02-03 12:25:12 -0800 | [diff] [blame] | 977 | * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p> |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 978 | * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. |
| 979 | * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, |
| 980 | * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> |
| 981 | * <p>When set to OFF, the camera device will not fire flash for this capture.</p> |
| 982 | * <p>When set to SINGLE, the camera device will fire flash regardless of the camera |
| 983 | * device's auto-exposure routine's result. When used in still capture case, this |
| 984 | * control should be used along with AE precapture metering sequence |
| 985 | * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> |
| 986 | * <p>When set to TORCH, the flash will be on continuously. This mode can be used |
| 987 | * for use cases such as preview, auto-focus assist, still capture, or video recording.</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 988 | * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p> |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 989 | * |
| 990 | * @see CaptureRequest#CONTROL_AE_MODE |
| 991 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 992 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 993 | * @see CaptureResult#FLASH_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 994 | * @see #FLASH_MODE_OFF |
| 995 | * @see #FLASH_MODE_SINGLE |
| 996 | * @see #FLASH_MODE_TORCH |
| 997 | */ |
| 998 | public static final Key<Integer> FLASH_MODE = |
| 999 | new Key<Integer>("android.flash.mode", int.class); |
| 1000 | |
| 1001 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1002 | * <p>Current state of the flash |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1003 | * unit.</p> |
| 1004 | * <p>When the camera device doesn't have flash unit |
| 1005 | * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE. |
| 1006 | * Other states indicate the current flash status.</p> |
| 1007 | * |
| 1008 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1009 | * @see #FLASH_STATE_UNAVAILABLE |
| 1010 | * @see #FLASH_STATE_CHARGING |
| 1011 | * @see #FLASH_STATE_READY |
| 1012 | * @see #FLASH_STATE_FIRED |
| 1013 | */ |
| 1014 | public static final Key<Integer> FLASH_STATE = |
| 1015 | new Key<Integer>("android.flash.state", int.class); |
| 1016 | |
| 1017 | /** |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1018 | * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the |
| 1019 | * sensor, where <code>(x, y)</code> lies between <code>(0, 0)</code>, which is the top-left |
| 1020 | * of the pixel array, and the width,height of the pixel array given in |
| 1021 | * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}. This may include hot pixels |
| 1022 | * that lie outside of the active array bounds given by |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1023 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1024 | * |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1025 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1026 | * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE |
| 1027 | */ |
| 1028 | public static final Key<int[]> HOT_PIXEL_MAP = |
| 1029 | new Key<int[]>("android.hotPixel.map", int[].class); |
| 1030 | |
| 1031 | /** |
| 1032 | * <p>Set operational mode for hot pixel correction.</p> |
| 1033 | * <p>Hotpixel correction interpolates out, or otherwise removes, pixels |
| 1034 | * that do not accurately encode the incoming light (i.e. pixels that |
| 1035 | * are stuck at an arbitrary value).</p> |
| 1036 | * @see #HOT_PIXEL_MODE_OFF |
| 1037 | * @see #HOT_PIXEL_MODE_FAST |
| 1038 | * @see #HOT_PIXEL_MODE_HIGH_QUALITY |
| 1039 | */ |
| 1040 | public static final Key<Integer> HOT_PIXEL_MODE = |
| 1041 | new Key<Integer>("android.hotPixel.mode", int.class); |
| 1042 | |
| 1043 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1044 | * <p>GPS coordinates to include in output JPEG |
| 1045 | * EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1046 | */ |
| 1047 | public static final Key<double[]> JPEG_GPS_COORDINATES = |
| 1048 | new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); |
| 1049 | |
| 1050 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1051 | * <p>32 characters describing GPS algorithm to |
| 1052 | * include in EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1053 | */ |
| 1054 | public static final Key<String> JPEG_GPS_PROCESSING_METHOD = |
| 1055 | new Key<String>("android.jpeg.gpsProcessingMethod", String.class); |
| 1056 | |
| 1057 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1058 | * <p>Time GPS fix was made to include in |
| 1059 | * EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1060 | */ |
| 1061 | public static final Key<Long> JPEG_GPS_TIMESTAMP = |
| 1062 | new Key<Long>("android.jpeg.gpsTimestamp", long.class); |
| 1063 | |
| 1064 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1065 | * <p>Orientation of JPEG image to |
| 1066 | * write</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1067 | */ |
| 1068 | public static final Key<Integer> JPEG_ORIENTATION = |
| 1069 | new Key<Integer>("android.jpeg.orientation", int.class); |
| 1070 | |
| 1071 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1072 | * <p>Compression quality of the final JPEG |
| 1073 | * image</p> |
| 1074 | * <p>85-95 is typical usage range</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1075 | */ |
| 1076 | public static final Key<Byte> JPEG_QUALITY = |
| 1077 | new Key<Byte>("android.jpeg.quality", byte.class); |
| 1078 | |
| 1079 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1080 | * <p>Compression quality of JPEG |
| 1081 | * thumbnail</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1082 | */ |
| 1083 | public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = |
| 1084 | new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); |
| 1085 | |
| 1086 | /** |
Zhijun He | 5a9ff37 | 2013-12-26 11:49:09 -0800 | [diff] [blame] | 1087 | * <p>Resolution of embedded JPEG thumbnail</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1088 | * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, |
| 1089 | * but the captured JPEG will still be a valid image.</p> |
Zhijun He | 5a9ff37 | 2013-12-26 11:49:09 -0800 | [diff] [blame] | 1090 | * <p>When a jpeg image capture is issued, the thumbnail size selected should have |
| 1091 | * the same aspect ratio as the jpeg image.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1092 | */ |
| 1093 | public static final Key<android.hardware.camera2.Size> JPEG_THUMBNAIL_SIZE = |
| 1094 | new Key<android.hardware.camera2.Size>("android.jpeg.thumbnailSize", android.hardware.camera2.Size.class); |
| 1095 | |
| 1096 | /** |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1097 | * <p>The ratio of lens focal length to the effective |
| 1098 | * aperture diameter.</p> |
| 1099 | * <p>This will only be supported on the camera devices that |
| 1100 | * have variable aperture lens. The aperture value can only be |
| 1101 | * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p> |
| 1102 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, |
| 1103 | * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1104 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1105 | * to achieve manual exposure control.</p> |
| 1106 | * <p>The requested aperture value may take several frames to reach the |
| 1107 | * requested value; the camera device will report the current (intermediate) |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1108 | * aperture size in capture result metadata while the aperture is changing. |
| 1109 | * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1110 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of |
| 1111 | * the ON modes, this will be overridden by the camera device |
| 1112 | * auto-exposure algorithm, the overridden values are then provided |
| 1113 | * back to the user in the corresponding result.</p> |
| 1114 | * |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1115 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1116 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1117 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1118 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1119 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1120 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1121 | */ |
| 1122 | public static final Key<Float> LENS_APERTURE = |
| 1123 | new Key<Float>("android.lens.aperture", float.class); |
| 1124 | |
| 1125 | /** |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 1126 | * <p>State of lens neutral density filter(s).</p> |
| 1127 | * <p>This will not be supported on most camera devices. On devices |
| 1128 | * where this is supported, this may only be set to one of the |
| 1129 | * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p> |
| 1130 | * <p>Lens filters are typically used to lower the amount of light the |
| 1131 | * sensor is exposed to (measured in steps of EV). As used here, an EV |
| 1132 | * step is the standard logarithmic representation, which are |
| 1133 | * non-negative, and inversely proportional to the amount of light |
| 1134 | * hitting the sensor. For example, setting this to 0 would result |
| 1135 | * in no reduction of the incoming light, and setting this to 2 would |
| 1136 | * mean that the filter is set to reduce incoming light by two stops |
| 1137 | * (allowing 1/4 of the prior amount of light to the sensor).</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1138 | * <p>It may take several frames before the lens filter density changes |
| 1139 | * to the requested value. While the filter density is still changing, |
| 1140 | * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 1141 | * |
| 1142 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1143 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1144 | */ |
| 1145 | public static final Key<Float> LENS_FILTER_DENSITY = |
| 1146 | new Key<Float>("android.lens.filterDensity", float.class); |
| 1147 | |
| 1148 | /** |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1149 | * <p>The current lens focal length; used for optical zoom.</p> |
| 1150 | * <p>This setting controls the physical focal length of the camera |
| 1151 | * device's lens. Changing the focal length changes the field of |
| 1152 | * view of the camera device, and is usually used for optical zoom.</p> |
| 1153 | * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this |
| 1154 | * setting won't be applied instantaneously, and it may take several |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1155 | * frames before the lens can change to the requested focal length. |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1156 | * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will |
| 1157 | * be set to MOVING.</p> |
| 1158 | * <p>This is expected not to be supported on most devices.</p> |
| 1159 | * |
| 1160 | * @see CaptureRequest#LENS_APERTURE |
| 1161 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
| 1162 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1163 | */ |
| 1164 | public static final Key<Float> LENS_FOCAL_LENGTH = |
| 1165 | new Key<Float>("android.lens.focalLength", float.class); |
| 1166 | |
| 1167 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1168 | * <p>Distance to plane of sharpest focus, |
| 1169 | * measured from frontmost surface of the lens</p> |
| 1170 | * <p>Should be zero for fixed-focus cameras</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1171 | */ |
| 1172 | public static final Key<Float> LENS_FOCUS_DISTANCE = |
| 1173 | new Key<Float>("android.lens.focusDistance", float.class); |
| 1174 | |
| 1175 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1176 | * <p>The range of scene distances that are in |
| 1177 | * sharp focus (depth of field)</p> |
| 1178 | * <p>If variable focus not supported, can still report |
| 1179 | * fixed depth of field range</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1180 | */ |
Zhijun He | c59b078 | 2013-09-26 10:39:36 -0700 | [diff] [blame] | 1181 | public static final Key<float[]> LENS_FOCUS_RANGE = |
| 1182 | new Key<float[]>("android.lens.focusRange", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1183 | |
| 1184 | /** |
Ruben Brunk | 00849b3 | 2014-01-17 18:30:23 -0800 | [diff] [blame] | 1185 | * <p>Sets whether the camera device uses optical image stabilization (OIS) |
| 1186 | * when capturing images.</p> |
| 1187 | * <p>OIS is used to compensate for motion blur due to small movements of |
| 1188 | * the camera during capture. Unlike digital image stabilization, OIS makes |
| 1189 | * use of mechanical elements to stabilize the camera sensor, and thus |
| 1190 | * allows for longer exposure times before camera shake becomes |
| 1191 | * apparent.</p> |
| 1192 | * <p>This is not expected to be supported on most devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1193 | * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF |
| 1194 | * @see #LENS_OPTICAL_STABILIZATION_MODE_ON |
| 1195 | */ |
| 1196 | public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = |
| 1197 | new Key<Integer>("android.lens.opticalStabilizationMode", int.class); |
| 1198 | |
| 1199 | /** |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1200 | * <p>Current lens status.</p> |
| 1201 | * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance}, |
| 1202 | * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested, |
| 1203 | * they may take several frames to reach the requested values. This state indicates |
| 1204 | * the current status of the lens parameters.</p> |
| 1205 | * <p>When the state is STATIONARY, the lens parameters are not changing. This could be |
| 1206 | * either because the parameters are all fixed, or because the lens has had enough |
| 1207 | * time to reach the most recently-requested values. |
| 1208 | * If all these lens parameters are not changable for a camera device, as listed below:</p> |
| 1209 | * <ul> |
| 1210 | * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means |
| 1211 | * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li> |
| 1212 | * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value), |
| 1213 | * which means the optical zoom is not supported.</li> |
| 1214 | * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li> |
| 1215 | * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li> |
| 1216 | * </ul> |
| 1217 | * <p>Then this state will always be STATIONARY.</p> |
| 1218 | * <p>When the state is MOVING, it indicates that at least one of the lens parameters |
| 1219 | * is changing.</p> |
| 1220 | * |
| 1221 | * @see CaptureRequest#LENS_APERTURE |
| 1222 | * @see CaptureRequest#LENS_FILTER_DENSITY |
| 1223 | * @see CaptureRequest#LENS_FOCAL_LENGTH |
| 1224 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
| 1225 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
| 1226 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
| 1227 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS |
| 1228 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1229 | * @see #LENS_STATE_STATIONARY |
Igor Murashkin | 9ea4ae6 | 2013-09-11 21:40:11 -0700 | [diff] [blame] | 1230 | * @see #LENS_STATE_MOVING |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1231 | */ |
| 1232 | public static final Key<Integer> LENS_STATE = |
| 1233 | new Key<Integer>("android.lens.state", int.class); |
| 1234 | |
| 1235 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1236 | * <p>Mode of operation for the noise reduction |
| 1237 | * algorithm</p> |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 1238 | * <p>Noise filtering control. OFF means no noise reduction |
| 1239 | * will be applied by the HAL.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1240 | * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering |
| 1241 | * will be applied. HIGH_QUALITY mode indicates that the camera device |
| 1242 | * will use the highest-quality noise filtering algorithms, |
| 1243 | * even if it slows down capture rate. FAST means the camera device should not |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 1244 | * slow down capture rate when applying noise filtering.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1245 | * @see #NOISE_REDUCTION_MODE_OFF |
| 1246 | * @see #NOISE_REDUCTION_MODE_FAST |
| 1247 | * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY |
| 1248 | */ |
| 1249 | public static final Key<Integer> NOISE_REDUCTION_MODE = |
| 1250 | new Key<Integer>("android.noiseReduction.mode", int.class); |
| 1251 | |
| 1252 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1253 | * <p>Whether a result given to the framework is the |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 1254 | * final one for the capture, or only a partial that contains a |
| 1255 | * subset of the full set of dynamic metadata |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1256 | * values.</p> |
| 1257 | * <p>The entries in the result metadata buffers for a |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 1258 | * single capture may not overlap, except for this entry. The |
| 1259 | * FINAL buffers must retain FIFO ordering relative to the |
| 1260 | * requests that generate them, so the FINAL buffer for frame 3 must |
| 1261 | * always be sent to the framework after the FINAL buffer for frame 2, and |
| 1262 | * before the FINAL buffer for frame 4. PARTIAL buffers may be returned |
| 1263 | * in any order relative to other frames, but all PARTIAL buffers for a given |
| 1264 | * capture must arrive before the FINAL buffer for that capture. This entry may |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1265 | * only be used by the HAL if quirks.usePartialResult is set to 1.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1266 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 1267 | * @hide |
| 1268 | */ |
| 1269 | public static final Key<Boolean> QUIRKS_PARTIAL_RESULT = |
| 1270 | new Key<Boolean>("android.quirks.partialResult", boolean.class); |
| 1271 | |
| 1272 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1273 | * <p>A frame counter set by the framework. This value monotonically |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 1274 | * increases with every new result (that is, each new result has a unique |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1275 | * frameCount value).</p> |
| 1276 | * <p>Reset on release()</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1277 | */ |
| 1278 | public static final Key<Integer> REQUEST_FRAME_COUNT = |
| 1279 | new Key<Integer>("android.request.frameCount", int.class); |
| 1280 | |
| 1281 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1282 | * <p>An application-specified ID for the current |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1283 | * request. Must be maintained unchanged in output |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1284 | * frame</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1285 | * @hide |
| 1286 | */ |
| 1287 | public static final Key<Integer> REQUEST_ID = |
| 1288 | new Key<Integer>("android.request.id", int.class); |
| 1289 | |
| 1290 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 1291 | * <p>Specifies the number of pipeline stages the frame went |
| 1292 | * through from when it was exposed to when the final completed result |
| 1293 | * was available to the framework.</p> |
| 1294 | * <p>Depending on what settings are used in the request, and |
| 1295 | * what streams are configured, the data may undergo less processing, |
| 1296 | * and some pipeline stages skipped.</p> |
| 1297 | * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p> |
| 1298 | * |
| 1299 | * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH |
| 1300 | */ |
| 1301 | public static final Key<Byte> REQUEST_PIPELINE_DEPTH = |
| 1302 | new Key<Byte>("android.request.pipelineDepth", byte.class); |
| 1303 | |
| 1304 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1305 | * <p>(x, y, width, height).</p> |
| 1306 | * <p>A rectangle with the top-level corner of (x,y) and size |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1307 | * (width, height). The region of the sensor that is used for |
| 1308 | * output. Each stream must use this rectangle to produce its |
| 1309 | * output, cropping to a smaller region if necessary to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1310 | * maintain the stream's aspect ratio.</p> |
| 1311 | * <p>HAL2.x uses only (x, y, width)</p> |
| 1312 | * <p>Any additional per-stream cropping must be done to |
| 1313 | * maximize the final pixel area of the stream.</p> |
| 1314 | * <p>For example, if the crop region is set to a 4:3 aspect |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1315 | * ratio, then 4:3 streams should use the exact crop |
| 1316 | * region. 16:9 streams should further crop vertically |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1317 | * (letterbox).</p> |
| 1318 | * <p>Conversely, if the crop region is set to a 16:9, then 4:3 |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1319 | * outputs should crop horizontally (pillarbox), and 16:9 |
| 1320 | * streams should match exactly. These additional crops must |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1321 | * be centered within the crop region.</p> |
| 1322 | * <p>The output streams must maintain square pixels at all |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1323 | * times, no matter what the relative aspect ratios of the |
| 1324 | * crop region and the stream are. Negative values for |
| 1325 | * corner are allowed for raw output if full pixel array is |
| 1326 | * larger than active pixel array. Width and height may be |
| 1327 | * rounded to nearest larger supportable width, especially |
| 1328 | * for raw output, where only a few fixed scales may be |
| 1329 | * possible. The width and height of the crop region cannot |
| 1330 | * be set to be smaller than floor( activeArraySize.width / |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1331 | * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} ) and floor( |
| 1332 | * activeArraySize.height / |
| 1333 | * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom}), respectively.</p> |
| 1334 | * |
| 1335 | * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1336 | */ |
| 1337 | public static final Key<android.graphics.Rect> SCALER_CROP_REGION = |
| 1338 | new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); |
| 1339 | |
| 1340 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1341 | * <p>Duration each pixel is exposed to |
| 1342 | * light.</p> |
| 1343 | * <p>If the sensor can't expose this exact duration, it should shorten the |
| 1344 | * duration exposed to the nearest possible value (rather than expose longer).</p> |
| 1345 | * <p>1/10000 - 30 sec range. No bulb mode</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1346 | */ |
| 1347 | public static final Key<Long> SENSOR_EXPOSURE_TIME = |
| 1348 | new Key<Long>("android.sensor.exposureTime", long.class); |
| 1349 | |
| 1350 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1351 | * <p>Duration from start of frame exposure to |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1352 | * start of next frame exposure.</p> |
| 1353 | * <p>The maximum frame rate that can be supported by a camera subsystem is |
| 1354 | * a function of many factors:</p> |
| 1355 | * <ul> |
| 1356 | * <li>Requested resolutions of output image streams</li> |
| 1357 | * <li>Availability of binning / skipping modes on the imager</li> |
| 1358 | * <li>The bandwidth of the imager interface</li> |
| 1359 | * <li>The bandwidth of the various ISP processing blocks</li> |
| 1360 | * </ul> |
| 1361 | * <p>Since these factors can vary greatly between different ISPs and |
| 1362 | * sensors, the camera abstraction tries to represent the bandwidth |
| 1363 | * restrictions with as simple a model as possible.</p> |
| 1364 | * <p>The model presented has the following characteristics:</p> |
| 1365 | * <ul> |
| 1366 | * <li>The image sensor is always configured to output the smallest |
| 1367 | * resolution possible given the application's requested output stream |
| 1368 | * sizes. The smallest resolution is defined as being at least as large |
| 1369 | * as the largest requested output stream size; the camera pipeline must |
| 1370 | * never digitally upsample sensor data when the crop region covers the |
| 1371 | * whole sensor. In general, this means that if only small output stream |
| 1372 | * resolutions are configured, the sensor can provide a higher frame |
| 1373 | * rate.</li> |
| 1374 | * <li>Since any request may use any or all the currently configured |
| 1375 | * output streams, the sensor and ISP must be configured to support |
| 1376 | * scaling a single capture to all the streams at the same time. This |
| 1377 | * means the camera pipeline must be ready to produce the largest |
| 1378 | * requested output size without any delay. Therefore, the overall |
| 1379 | * frame rate of a given configured stream set is governed only by the |
| 1380 | * largest requested stream resolution.</li> |
| 1381 | * <li>Using more than one output stream in a request does not affect the |
| 1382 | * frame duration.</li> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1383 | * <li>Certain format-streams may need to do additional background processing |
| 1384 | * before data is consumed/produced by that stream. These processors |
| 1385 | * can run concurrently to the rest of the camera pipeline, but |
| 1386 | * cannot process more than 1 capture at a time.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1387 | * </ul> |
| 1388 | * <p>The necessary information for the application, given the model above, |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1389 | * is provided via the {@link CameraCharacteristics#SCALER_AVAILABLE_MIN_FRAME_DURATIONS android.scaler.availableMinFrameDurations} field. |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1390 | * These are used to determine the maximum frame rate / minimum frame |
| 1391 | * duration that is possible for a given stream configuration.</p> |
| 1392 | * <p>Specifically, the application can use the following rules to |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1393 | * determine the minimum frame duration it can request from the camera |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1394 | * device:</p> |
| 1395 | * <ol> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1396 | * <li>Let the set of currently configured input/output streams |
| 1397 | * be called <code>S</code>.</li> |
| 1398 | * <li>Find the minimum frame durations for each stream in <code>S</code>, by |
| 1399 | * looking it up in {@link CameraCharacteristics#SCALER_AVAILABLE_MIN_FRAME_DURATIONS android.scaler.availableMinFrameDurations} (with |
| 1400 | * its respective size/format). Let this set of frame durations be called |
| 1401 | * <code>F</code>.</li> |
| 1402 | * <li>For any given request <code>R</code>, the minimum frame duration allowed |
| 1403 | * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams |
| 1404 | * used in <code>R</code> be called <code>S_r</code>.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1405 | * </ol> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1406 | * <p>If none of the streams in <code>S_r</code> have a stall time (listed in |
| 1407 | * {@link CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS android.scaler.availableStallDurations}), then the frame duration in |
| 1408 | * <code>F</code> determines the steady state frame rate that the application will |
| 1409 | * get if it uses <code>R</code> as a repeating request. Let this special kind |
| 1410 | * of request be called <code>Rsimple</code>.</p> |
| 1411 | * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved |
| 1412 | * by a single capture of a new request <code>Rstall</code> (which has at least |
| 1413 | * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the |
| 1414 | * same minimum frame duration this will not cause a frame rate loss |
| 1415 | * if all buffers from the previous <code>Rstall</code> have already been |
| 1416 | * delivered.</p> |
| 1417 | * <p>For more details about stalling, see |
| 1418 | * {@link CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS android.scaler.availableStallDurations}.</p> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1419 | * |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1420 | * @see CameraCharacteristics#SCALER_AVAILABLE_MIN_FRAME_DURATIONS |
| 1421 | * @see CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1422 | */ |
| 1423 | public static final Key<Long> SENSOR_FRAME_DURATION = |
| 1424 | new Key<Long>("android.sensor.frameDuration", long.class); |
| 1425 | |
| 1426 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1427 | * <p>Gain applied to image data. Must be |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1428 | * implemented through analog gain only if set to values |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1429 | * below 'maximum analog sensitivity'.</p> |
| 1430 | * <p>If the sensor can't apply this exact gain, it should lessen the |
| 1431 | * gain to the nearest possible value (rather than gain more).</p> |
| 1432 | * <p>ISO 12232:2006 REI method</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1433 | */ |
| 1434 | public static final Key<Integer> SENSOR_SENSITIVITY = |
| 1435 | new Key<Integer>("android.sensor.sensitivity", int.class); |
| 1436 | |
| 1437 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1438 | * <p>Time at start of exposure of first |
| 1439 | * row</p> |
| 1440 | * <p>Monotonic, should be synced to other timestamps in |
| 1441 | * system</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1442 | */ |
| 1443 | public static final Key<Long> SENSOR_TIMESTAMP = |
| 1444 | new Key<Long>("android.sensor.timestamp", long.class); |
| 1445 | |
| 1446 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1447 | * <p>The temperature of the sensor, sampled at the time |
| 1448 | * exposure began for this frame.</p> |
| 1449 | * <p>The thermal diode being queried should be inside the sensor PCB, or |
| 1450 | * somewhere close to it.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1451 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1452 | * <p><b>Full capability</b> - |
| 1453 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1454 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 1455 | * |
| 1456 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | d5ff06a | 2013-08-20 15:15:06 -0700 | [diff] [blame] | 1457 | */ |
| 1458 | public static final Key<Float> SENSOR_TEMPERATURE = |
| 1459 | new Key<Float>("android.sensor.temperature", float.class); |
| 1460 | |
| 1461 | /** |
Ruben Brunk | d5fdd1c | 2014-02-07 17:33:36 -0800 | [diff] [blame] | 1462 | * <p>A per-device calibration transform matrix to be applied after the |
| 1463 | * color space transform when rendering the raw image buffer.</p> |
| 1464 | * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and |
| 1465 | * contains a per-device calibration transform that maps colors |
| 1466 | * from reference camera color space (i.e. the "golden module" |
| 1467 | * colorspace) into this camera device's linear native sensor color |
| 1468 | * space for the current scene illumination and white balance choice.</p> |
| 1469 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1470 | */ |
| 1471 | public static final Key<Rational[]> SENSOR_CALIBRATION_TRANSFORM = |
| 1472 | new Key<Rational[]>("android.sensor.calibrationTransform", Rational[].class); |
| 1473 | |
| 1474 | /** |
| 1475 | * <p>A matrix that transforms color values from CIE XYZ color space to |
| 1476 | * reference camera color space when rendering the raw image buffer.</p> |
| 1477 | * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and |
| 1478 | * contains a color transform matrix that maps colors from the CIE |
| 1479 | * XYZ color space to the reference camera raw color space (i.e. the |
| 1480 | * "golden module" colorspace) for the current scene illumination and |
| 1481 | * white balance choice.</p> |
| 1482 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1483 | */ |
| 1484 | public static final Key<Rational[]> SENSOR_COLOR_TRANSFORM = |
| 1485 | new Key<Rational[]>("android.sensor.colorTransform", Rational[].class); |
| 1486 | |
| 1487 | /** |
| 1488 | * <p>A matrix that transforms white balanced camera colors to the CIE XYZ |
| 1489 | * colorspace with a D50 whitepoint.</p> |
| 1490 | * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains |
| 1491 | * a color transform matrix that maps a unit vector in the linear native |
| 1492 | * sensor color space to the D50 whitepoint in CIE XYZ color space.</p> |
| 1493 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1494 | */ |
| 1495 | public static final Key<Rational[]> SENSOR_FORWARD_MATRIX = |
| 1496 | new Key<Rational[]>("android.sensor.forwardMatrix", Rational[].class); |
| 1497 | |
| 1498 | /** |
Ruben Brunk | 20c76f6 | 2014-02-07 15:47:10 -0800 | [diff] [blame] | 1499 | * <p>The estimated white balance at the time of capture.</p> |
| 1500 | * <p>The estimated white balance encoded as the RGB values of the |
| 1501 | * perfectly neutral color point in the linear native sensor color space. |
| 1502 | * The order of the values is R, G, B; where R is in the lowest index.</p> |
| 1503 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1504 | */ |
| 1505 | public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT = |
| 1506 | new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class); |
| 1507 | |
| 1508 | /** |
Ruben Brunk | a9bfdbb | 2014-02-07 16:58:09 -0800 | [diff] [blame] | 1509 | * <p>A mapping containing a hue shift, saturation scale, and value scale |
| 1510 | * for each pixel.</p> |
| 1511 | * <p>hue_samples, saturation_samples, and value_samples are given in |
| 1512 | * {@link CameraCharacteristics#SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS android.sensor.profileHueSatMapDimensions}.</p> |
| 1513 | * <p>Each entry of this map contains three floats corresponding to the |
| 1514 | * hue shift, saturation scale, and value scale, respectively; where the |
| 1515 | * hue shift has the lowest index. The map entries are stored in the tag |
| 1516 | * in nested loop order, with the value divisions in the outer loop, the |
| 1517 | * hue divisions in the middle loop, and the saturation divisions in the |
| 1518 | * inner loop. All zero input saturation entries are required to have a |
| 1519 | * value scale factor of 1.0.</p> |
| 1520 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1521 | * |
| 1522 | * @see CameraCharacteristics#SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS |
| 1523 | */ |
| 1524 | public static final Key<float[]> SENSOR_PROFILE_HUE_SAT_MAP = |
| 1525 | new Key<float[]>("android.sensor.profileHueSatMap", float[].class); |
| 1526 | |
| 1527 | /** |
| 1528 | * <p>A list of x,y samples defining a tone-mapping curve for gamma adjustment.</p> |
| 1529 | * <p>This tag contains a default tone curve that can be applied while |
| 1530 | * processing the image as a starting point for user adjustments. |
| 1531 | * The curve is specified as a list of value pairs in linear gamma. |
| 1532 | * The curve is interpolated using a cubic spline.</p> |
| 1533 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1534 | */ |
| 1535 | public static final Key<float[]> SENSOR_PROFILE_TONE_CURVE = |
| 1536 | new Key<float[]>("android.sensor.profileToneCurve", float[].class); |
| 1537 | |
| 1538 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 1539 | * <p>When enabled, the sensor sends a test pattern instead of |
| 1540 | * doing a real exposure from the camera.</p> |
| 1541 | * <p>When a test pattern is enabled, all manual sensor controls specified |
| 1542 | * by android.sensor.* should be ignored. All other controls should |
| 1543 | * work as normal.</p> |
| 1544 | * <p>For example, if manual flash is enabled, flash firing should still |
| 1545 | * occur (and that the test pattern remain unmodified, since the flash |
| 1546 | * would not actually affect it).</p> |
| 1547 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1548 | * @see #SENSOR_TEST_PATTERN_MODE_OFF |
| 1549 | * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR |
| 1550 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS |
| 1551 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY |
| 1552 | * @see #SENSOR_TEST_PATTERN_MODE_PN9 |
| 1553 | * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 |
| 1554 | */ |
| 1555 | public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = |
| 1556 | new Key<Integer>("android.sensor.testPatternMode", int.class); |
| 1557 | |
| 1558 | /** |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 1559 | * <p>Quality of lens shading correction applied |
| 1560 | * to the image data.</p> |
| 1561 | * <p>When set to OFF mode, no lens shading correction will be applied by the |
| 1562 | * camera device, and an identity lens shading map data will be provided |
| 1563 | * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens |
| 1564 | * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>, |
| 1565 | * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map |
| 1566 | * shown below:</p> |
| 1567 | * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 1568 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 1569 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 1570 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 1571 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 1572 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] |
| 1573 | * </code></pre> |
| 1574 | * <p>When set to other modes, lens shading correction will be applied by the |
| 1575 | * camera device. Applications can request lens shading map data by setting |
| 1576 | * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide |
| 1577 | * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified |
| 1578 | * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p> |
| 1579 | * |
| 1580 | * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE |
| 1581 | * @see CaptureResult#STATISTICS_LENS_SHADING_MAP |
| 1582 | * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE |
| 1583 | * @see #SHADING_MODE_OFF |
| 1584 | * @see #SHADING_MODE_FAST |
| 1585 | * @see #SHADING_MODE_HIGH_QUALITY |
| 1586 | * @hide |
| 1587 | */ |
| 1588 | public static final Key<Integer> SHADING_MODE = |
| 1589 | new Key<Integer>("android.shading.mode", int.class); |
| 1590 | |
| 1591 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1592 | * <p>State of the face detector |
| 1593 | * unit</p> |
| 1594 | * <p>Whether face detection is enabled, and whether it |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1595 | * should output just the basic fields or the full set of |
| 1596 | * fields. Value must be one of the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1597 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p> |
| 1598 | * |
| 1599 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1600 | * @see #STATISTICS_FACE_DETECT_MODE_OFF |
| 1601 | * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE |
| 1602 | * @see #STATISTICS_FACE_DETECT_MODE_FULL |
| 1603 | */ |
| 1604 | public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = |
| 1605 | new Key<Integer>("android.statistics.faceDetectMode", int.class); |
| 1606 | |
| 1607 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1608 | * <p>List of unique IDs for detected |
| 1609 | * faces</p> |
| 1610 | * <p>Only available if faceDetectMode == FULL</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 1611 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1612 | */ |
| 1613 | public static final Key<int[]> STATISTICS_FACE_IDS = |
| 1614 | new Key<int[]>("android.statistics.faceIds", int[].class); |
| 1615 | |
| 1616 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1617 | * <p>List of landmarks for detected |
| 1618 | * faces</p> |
| 1619 | * <p>Only available if faceDetectMode == FULL</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 1620 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1621 | */ |
| 1622 | public static final Key<int[]> STATISTICS_FACE_LANDMARKS = |
| 1623 | new Key<int[]>("android.statistics.faceLandmarks", int[].class); |
| 1624 | |
| 1625 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1626 | * <p>List of the bounding rectangles for detected |
| 1627 | * faces</p> |
| 1628 | * <p>Only available if faceDetectMode != OFF</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 1629 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1630 | */ |
| 1631 | public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES = |
| 1632 | new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class); |
| 1633 | |
| 1634 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1635 | * <p>List of the face confidence scores for |
| 1636 | * detected faces</p> |
| 1637 | * <p>Only available if faceDetectMode != OFF. The value should be |
| 1638 | * meaningful (for example, setting 100 at all times is illegal).</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 1639 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1640 | */ |
| 1641 | public static final Key<byte[]> STATISTICS_FACE_SCORES = |
| 1642 | new Key<byte[]>("android.statistics.faceScores", byte[].class); |
| 1643 | |
| 1644 | /** |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 1645 | * <p>The shading map is a low-resolution floating-point map |
| 1646 | * that lists the coefficients used to correct for vignetting, for each |
| 1647 | * Bayer color channel.</p> |
| 1648 | * <p>The least shaded section of the image should have a gain factor |
| 1649 | * of 1; all other sections should have gains above 1.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1650 | * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1651 | * must take into account the colorCorrection settings.</p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 1652 | * <p>The shading map is for the entire active pixel array, and is not |
| 1653 | * affected by the crop region specified in the request. Each shading map |
| 1654 | * entry is the value of the shading compensation map over a specific |
| 1655 | * pixel on the sensor. Specifically, with a (N x M) resolution shading |
| 1656 | * map, and an active pixel array size (W x H), shading map entry |
| 1657 | * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at |
| 1658 | * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. |
| 1659 | * The map is assumed to be bilinearly interpolated between the sample points.</p> |
| 1660 | * <p>The channel order is [R, Geven, Godd, B], where Geven is the green |
| 1661 | * channel for the even rows of a Bayer pattern, and Godd is the odd rows. |
| 1662 | * The shading map is stored in a fully interleaved format, and its size |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1663 | * is provided in the camera static metadata by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 1664 | * <p>The shading map should have on the order of 30-40 rows and columns, |
| 1665 | * and must be smaller than 64x64.</p> |
| 1666 | * <p>As an example, given a very small map defined as:</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1667 | * <pre><code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ] |
| 1668 | * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} = |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 1669 | * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2, |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1670 | * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, |
| 1671 | * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, |
| 1672 | * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, |
| 1673 | * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, |
| 1674 | * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ] |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 1675 | * </code></pre> |
| 1676 | * <p>The low-resolution scaling map images for each channel are |
| 1677 | * (displayed using nearest-neighbor interpolation):</p> |
| 1678 | * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> |
| 1679 | * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> |
| 1680 | * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> |
| 1681 | * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> |
| 1682 | * <p>As a visualization only, inverting the full-color map to recover an |
| 1683 | * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p> |
| 1684 | * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1685 | * |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1686 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1687 | * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1688 | * @see CaptureResult#STATISTICS_LENS_SHADING_MAP |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1689 | */ |
| 1690 | public static final Key<float[]> STATISTICS_LENS_SHADING_MAP = |
| 1691 | new Key<float[]>("android.statistics.lensShadingMap", float[].class); |
| 1692 | |
| 1693 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1694 | * <p>The best-fit color channel gains calculated |
| 1695 | * by the HAL's statistics units for the current output frame</p> |
| 1696 | * <p>This may be different than the gains used for this frame, |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1697 | * since statistics processing on data from a new frame |
| 1698 | * typically completes after the transform has already been |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1699 | * applied to that frame.</p> |
| 1700 | * <p>The 4 channel gains are defined in Bayer domain, |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1701 | * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1702 | * <p>This value should always be calculated by the AWB block, |
| 1703 | * regardless of the android.control.* current values.</p> |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 1704 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1705 | * |
| 1706 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 1707 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1708 | */ |
| 1709 | public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS = |
| 1710 | new Key<float[]>("android.statistics.predictedColorGains", float[].class); |
| 1711 | |
| 1712 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1713 | * <p>The best-fit color transform matrix estimate |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1714 | * calculated by the HAL's statistics units for the current |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1715 | * output frame</p> |
| 1716 | * <p>The HAL must provide the estimate from its |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1717 | * statistics unit on the white balance transforms to use |
| 1718 | * for the next frame. These are the values the HAL believes |
| 1719 | * are the best fit for the current output frame. This may |
| 1720 | * be different than the transform used for this frame, since |
| 1721 | * statistics processing on data from a new frame typically |
| 1722 | * completes after the transform has already been applied to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1723 | * that frame.</p> |
| 1724 | * <p>These estimates must be provided for all frames, even if |
| 1725 | * capture settings and color transforms are set by the application.</p> |
| 1726 | * <p>This value should always be calculated by the AWB block, |
| 1727 | * regardless of the android.control.* current values.</p> |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 1728 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1729 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1730 | */ |
| 1731 | public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM = |
| 1732 | new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class); |
| 1733 | |
| 1734 | /** |
Zhijun He | 208fb6c | 2014-02-03 13:09:06 -0800 | [diff] [blame] | 1735 | * <p>The camera device estimated scene illumination lighting |
| 1736 | * frequency.</p> |
| 1737 | * <p>Many light sources, such as most fluorescent lights, flicker at a rate |
| 1738 | * that depends on the local utility power standards. This flicker must be |
| 1739 | * accounted for by auto-exposure routines to avoid artifacts in captured images. |
| 1740 | * The camera device uses this entry to tell the application what the scene |
| 1741 | * illuminant frequency is.</p> |
| 1742 | * <p>When manual exposure control is enabled |
| 1743 | * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == OFF</code>), |
| 1744 | * the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't do the antibanding, and the |
| 1745 | * application can ensure it selects exposure times that do not cause banding |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1746 | * issues by looking into this metadata field. See {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} |
Zhijun He | 208fb6c | 2014-02-03 13:09:06 -0800 | [diff] [blame] | 1747 | * for more details.</p> |
| 1748 | * <p>Report NONE if there doesn't appear to be flickering illumination.</p> |
| 1749 | * |
| 1750 | * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE |
| 1751 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1752 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1753 | * @see #STATISTICS_SCENE_FLICKER_NONE |
| 1754 | * @see #STATISTICS_SCENE_FLICKER_50HZ |
| 1755 | * @see #STATISTICS_SCENE_FLICKER_60HZ |
| 1756 | */ |
| 1757 | public static final Key<Integer> STATISTICS_SCENE_FLICKER = |
| 1758 | new Key<Integer>("android.statistics.sceneFlicker", int.class); |
| 1759 | |
| 1760 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1761 | * <p>Tonemapping / contrast / gamma curve for the blue |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 1762 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 1763 | * CONTRAST_CURVE.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1764 | * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> |
| 1765 | * |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1766 | * @see CaptureRequest#TONEMAP_CURVE_RED |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1767 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1768 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 1769 | public static final Key<float[]> TONEMAP_CURVE_BLUE = |
| 1770 | new Key<float[]>("android.tonemap.curveBlue", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1771 | |
| 1772 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1773 | * <p>Tonemapping / contrast / gamma curve for the green |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 1774 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 1775 | * CONTRAST_CURVE.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1776 | * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> |
| 1777 | * |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1778 | * @see CaptureRequest#TONEMAP_CURVE_RED |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1779 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1780 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 1781 | public static final Key<float[]> TONEMAP_CURVE_GREEN = |
| 1782 | new Key<float[]>("android.tonemap.curveGreen", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1783 | |
| 1784 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1785 | * <p>Tonemapping / contrast / gamma curve for the red |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 1786 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 1787 | * CONTRAST_CURVE.</p> |
| 1788 | * <p>Each channel's curve is defined by an array of control points:</p> |
| 1789 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = |
| 1790 | * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] |
Zhijun He | 870922b | 2014-02-15 21:47:51 -0800 | [diff] [blame^] | 1791 | * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 1792 | * <p>These are sorted in order of increasing <code>Pin</code>; it is always |
| 1793 | * guaranteed that input values 0.0 and 1.0 are included in the list to |
| 1794 | * define a complete mapping. For input values between control points, |
| 1795 | * the camera device must linearly interpolate between the control |
| 1796 | * points.</p> |
| 1797 | * <p>Each curve can have an independent number of points, and the number |
| 1798 | * of points can be less than max (that is, the request doesn't have to |
| 1799 | * always provide a curve with number of points equivalent to |
| 1800 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
| 1801 | * <p>A few examples, and their corresponding graphical mappings; these |
| 1802 | * only specify the red channel and the precision is limited to 4 |
| 1803 | * digits, for conciseness.</p> |
| 1804 | * <p>Linear mapping:</p> |
| 1805 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 0, 1.0, 1.0 ] |
| 1806 | * </code></pre> |
| 1807 | * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
| 1808 | * <p>Invert mapping:</p> |
| 1809 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 1.0, 1.0, 0 ] |
| 1810 | * </code></pre> |
| 1811 | * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
| 1812 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
| 1813 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ |
| 1814 | * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, |
| 1815 | * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, |
| 1816 | * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, |
| 1817 | * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ] |
| 1818 | * </code></pre> |
| 1819 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
| 1820 | * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> |
| 1821 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ |
| 1822 | * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, |
| 1823 | * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, |
| 1824 | * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, |
| 1825 | * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ] |
| 1826 | * </code></pre> |
| 1827 | * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1828 | * |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 1829 | * @see CaptureRequest#TONEMAP_CURVE_RED |
| 1830 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1831 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1832 | */ |
| 1833 | public static final Key<float[]> TONEMAP_CURVE_RED = |
| 1834 | new Key<float[]>("android.tonemap.curveRed", float[].class); |
| 1835 | |
| 1836 | /** |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 1837 | * <p>High-level global contrast/gamma/tonemapping control.</p> |
| 1838 | * <p>When switching to an application-defined contrast curve by setting |
| 1839 | * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined |
| 1840 | * per-channel with a set of <code>(in, out)</code> points that specify the |
| 1841 | * mapping from input high-bit-depth pixel value to the output |
| 1842 | * low-bit-depth value. Since the actual pixel ranges of both input |
| 1843 | * and output may change depending on the camera pipeline, the values |
| 1844 | * are specified by normalized floating-point numbers.</p> |
| 1845 | * <p>More-complex color mapping operations such as 3D color look-up |
| 1846 | * tables, selective chroma enhancement, or other non-linear color |
| 1847 | * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 1848 | * CONTRAST_CURVE.</p> |
| 1849 | * <p>When using either FAST or HIGH_QUALITY, the camera device will |
| 1850 | * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed}, |
| 1851 | * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, and {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}. |
| 1852 | * These values are always available, and as close as possible to the |
| 1853 | * actually used nonlinear/nonglobal transforms.</p> |
| 1854 | * <p>If a request is sent with TRANSFORM_MATRIX with the camera device's |
| 1855 | * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be |
| 1856 | * roughly the same.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1857 | * |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 1858 | * @see CaptureRequest#TONEMAP_CURVE_BLUE |
| 1859 | * @see CaptureRequest#TONEMAP_CURVE_GREEN |
| 1860 | * @see CaptureRequest#TONEMAP_CURVE_RED |
| 1861 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1862 | * @see #TONEMAP_MODE_CONTRAST_CURVE |
| 1863 | * @see #TONEMAP_MODE_FAST |
| 1864 | * @see #TONEMAP_MODE_HIGH_QUALITY |
| 1865 | */ |
| 1866 | public static final Key<Integer> TONEMAP_MODE = |
| 1867 | new Key<Integer>("android.tonemap.mode", int.class); |
| 1868 | |
| 1869 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1870 | * <p>This LED is nominally used to indicate to the user |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1871 | * that the camera is powered on and may be streaming images back to the |
| 1872 | * Application Processor. In certain rare circumstances, the OS may |
| 1873 | * disable this when video is processed locally and not transmitted to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1874 | * any untrusted applications.</p> |
| 1875 | * <p>In particular, the LED <em>must</em> always be on when the data could be |
| 1876 | * transmitted off the device. The LED <em>should</em> always be on whenever |
| 1877 | * data is stored locally on the device.</p> |
| 1878 | * <p>The LED <em>may</em> be off if a trusted application is using the data that |
| 1879 | * doesn't violate the above rules.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1880 | * @hide |
| 1881 | */ |
| 1882 | public static final Key<Boolean> LED_TRANSMIT = |
| 1883 | new Key<Boolean>("android.led.transmit", boolean.class); |
| 1884 | |
| 1885 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1886 | * <p>Whether black-level compensation is locked |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 1887 | * to its current values, or is free to vary.</p> |
| 1888 | * <p>Whether the black level offset was locked for this frame. Should be |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1889 | * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 1890 | * a change in other capture settings forced the camera device to |
| 1891 | * perform a black level reset.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1892 | * |
| 1893 | * @see CaptureRequest#BLACK_LEVEL_LOCK |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1894 | */ |
| 1895 | public static final Key<Boolean> BLACK_LEVEL_LOCK = |
| 1896 | new Key<Boolean>("android.blackLevel.lock", boolean.class); |
| 1897 | |
Igor Murashkin | 3865a84 | 2014-01-17 18:18:39 -0800 | [diff] [blame] | 1898 | /** |
| 1899 | * <p>The frame number corresponding to the last request |
| 1900 | * with which the output result (metadata + buffers) has been fully |
| 1901 | * synchronized.</p> |
| 1902 | * <p>When a request is submitted to the camera device, there is usually a |
| 1903 | * delay of several frames before the controls get applied. A camera |
| 1904 | * device may either choose to account for this delay by implementing a |
| 1905 | * pipeline and carefully submit well-timed atomic control updates, or |
| 1906 | * it may start streaming control changes that span over several frame |
| 1907 | * boundaries.</p> |
| 1908 | * <p>In the latter case, whenever a request's settings change relative to |
| 1909 | * the previous submitted request, the full set of changes may take |
| 1910 | * multiple frame durations to fully take effect. Some settings may |
| 1911 | * take effect sooner (in less frame durations) than others.</p> |
| 1912 | * <p>While a set of control changes are being propagated, this value |
| 1913 | * will be CONVERGING.</p> |
| 1914 | * <p>Once it is fully known that a set of control changes have been |
| 1915 | * finished propagating, and the resulting updated control settings |
| 1916 | * have been read back by the camera device, this value will be set |
| 1917 | * to a non-negative frame number (corresponding to the request to |
| 1918 | * which the results have synchronized to).</p> |
| 1919 | * <p>Older camera device implementations may not have a way to detect |
| 1920 | * when all camera controls have been applied, and will always set this |
| 1921 | * value to UNKNOWN.</p> |
| 1922 | * <p>FULL capability devices will always have this value set to the |
| 1923 | * frame number of the request corresponding to this result.</p> |
| 1924 | * <p><em>Further details</em>:</p> |
| 1925 | * <ul> |
| 1926 | * <li>Whenever a request differs from the last request, any future |
| 1927 | * results not yet returned may have this value set to CONVERGING (this |
| 1928 | * could include any in-progress captures not yet returned by the camera |
| 1929 | * device, for more details see pipeline considerations below).</li> |
| 1930 | * <li>Submitting a series of multiple requests that differ from the |
| 1931 | * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3) |
| 1932 | * moves the new synchronization frame to the last non-repeating |
| 1933 | * request (using the smallest frame number from the contiguous list of |
| 1934 | * repeating requests).</li> |
| 1935 | * <li>Submitting the same request repeatedly will not change this value |
| 1936 | * to CONVERGING, if it was already a non-negative value.</li> |
| 1937 | * <li>When this value changes to non-negative, that means that all of the |
| 1938 | * metadata controls from the request have been applied, all of the |
| 1939 | * metadata controls from the camera device have been read to the |
| 1940 | * updated values (into the result), and all of the graphics buffers |
| 1941 | * corresponding to this result are also synchronized to the request.</li> |
| 1942 | * </ul> |
| 1943 | * <p><em>Pipeline considerations</em>:</p> |
| 1944 | * <p>Submitting a request with updated controls relative to the previously |
| 1945 | * submitted requests may also invalidate the synchronization state |
| 1946 | * of all the results corresponding to currently in-flight requests.</p> |
| 1947 | * <p>In other words, results for this current request and up to |
| 1948 | * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their |
| 1949 | * android.sync.frameNumber change to CONVERGING.</p> |
| 1950 | * |
| 1951 | * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH |
| 1952 | * @see #SYNC_FRAME_NUMBER_CONVERGING |
| 1953 | * @see #SYNC_FRAME_NUMBER_UNKNOWN |
| 1954 | * @hide |
| 1955 | */ |
| 1956 | public static final Key<Integer> SYNC_FRAME_NUMBER = |
| 1957 | new Key<Integer>("android.sync.frameNumber", int.class); |
| 1958 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1959 | /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 1960 | * End generated code |
| 1961 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ |
Igor Murashkin | b779ac1 | 2013-09-05 12:40:19 -0700 | [diff] [blame] | 1962 | |
| 1963 | /** |
| 1964 | * <p> |
| 1965 | * List of the {@link Face Faces} detected through camera face detection |
| 1966 | * in this result. |
| 1967 | * </p> |
| 1968 | * <p> |
| 1969 | * Only available if {@link #STATISTICS_FACE_DETECT_MODE} {@code !=} |
| 1970 | * {@link CameraMetadata#STATISTICS_FACE_DETECT_MODE_OFF OFF}. |
| 1971 | * </p> |
| 1972 | * |
| 1973 | * @see Face |
| 1974 | */ |
| 1975 | public static final Key<Face[]> STATISTICS_FACES = |
| 1976 | new Key<Face[]>("android.statistics.faces", Face[].class); |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 1977 | } |