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; |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame^] | 20 | import android.hardware.camera2.utils.TypeReference; |
| 21 | import android.util.Log; |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 22 | import android.util.Rational; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 23 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame^] | 24 | import java.util.List; |
| 25 | |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 26 | /** |
| 27 | * <p>The results of a single image capture from the image sensor.</p> |
| 28 | * |
| 29 | * <p>Contains the final configuration for the capture hardware (sensor, lens, |
| 30 | * flash), the processing pipeline, the control algorithms, and the output |
| 31 | * buffers.</p> |
| 32 | * |
| 33 | * <p>CaptureResults are produced by a {@link CameraDevice} after processing a |
| 34 | * {@link CaptureRequest}. All properties listed for capture requests can also |
| 35 | * be queried on the capture result, to determine the final values used for |
| 36 | * capture. The result also includes additional metadata about the state of the |
| 37 | * camera device during the capture.</p> |
| 38 | * |
Ruben Brunk | f967a54 | 2014-04-28 16:31:11 -0700 | [diff] [blame] | 39 | * <p>{@link CameraCharacteristics} objects are immutable.</p> |
| 40 | * |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 41 | */ |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame^] | 42 | public final class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { |
| 43 | |
| 44 | private static final String TAG = "CaptureResult"; |
| 45 | private static final boolean VERBOSE = false; |
| 46 | |
| 47 | /** |
| 48 | * A {@code Key} is used to do capture result field lookups with |
| 49 | * {@link CaptureResult#get}. |
| 50 | * |
| 51 | * <p>For example, to get the timestamp corresponding to the exposure of the first row: |
| 52 | * <code><pre> |
| 53 | * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP); |
| 54 | * </pre></code> |
| 55 | * </p> |
| 56 | * |
| 57 | * <p>To enumerate over all possible keys for {@link CaptureResult}, see |
| 58 | * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p> |
| 59 | * |
| 60 | * @see CaptureResult#get |
| 61 | * @see CameraCharacteristics#getAvailableCaptureResultKeys |
| 62 | */ |
| 63 | public final static class Key<T> { |
| 64 | private final CameraMetadataNative.Key<T> mKey; |
| 65 | |
| 66 | /** |
| 67 | * Visible for testing and vendor extensions only. |
| 68 | * |
| 69 | * @hide |
| 70 | */ |
| 71 | public Key(String name, Class<T> type) { |
| 72 | mKey = new CameraMetadataNative.Key<T>(name, type); |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Visible for testing and vendor extensions only. |
| 77 | * |
| 78 | * @hide |
| 79 | */ |
| 80 | public Key(String name, TypeReference<T> typeReference) { |
| 81 | mKey = new CameraMetadataNative.Key<T>(name, typeReference); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Return a camelCase, period separated name formatted like: |
| 86 | * {@code "root.section[.subsections].name"}. |
| 87 | * |
| 88 | * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."}; |
| 89 | * keys that are device/platform-specific are prefixed with {@code "com."}.</p> |
| 90 | * |
| 91 | * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would |
| 92 | * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device |
| 93 | * specific key might look like {@code "com.google.nexus.data.private"}.</p> |
| 94 | * |
| 95 | * @return String representation of the key name |
| 96 | */ |
| 97 | public String getName() { |
| 98 | return mKey.getName(); |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * {@inheritDoc} |
| 103 | */ |
| 104 | @Override |
| 105 | public final int hashCode() { |
| 106 | return mKey.hashCode(); |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * {@inheritDoc} |
| 111 | */ |
| 112 | @SuppressWarnings("unchecked") |
| 113 | @Override |
| 114 | public final boolean equals(Object o) { |
| 115 | return o instanceof Key && ((Key<T>)o).mKey.equals(mKey); |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Visible for CameraMetadataNative implementation only; do not use. |
| 120 | * |
| 121 | * TODO: Make this private or remove it altogether. |
| 122 | * |
| 123 | * @hide |
| 124 | */ |
| 125 | public CameraMetadataNative.Key<T> getNativeKey() { |
| 126 | return mKey; |
| 127 | } |
| 128 | |
| 129 | @SuppressWarnings({ "unchecked" }) |
| 130 | /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) { |
| 131 | mKey = (CameraMetadataNative.Key<T>) nativeKey; |
| 132 | } |
| 133 | } |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 134 | |
| 135 | private final CameraMetadataNative mResults; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 136 | private final CaptureRequest mRequest; |
| 137 | private final int mSequenceId; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 138 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 139 | /** |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 140 | * Takes ownership of the passed-in properties object |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 141 | * @hide |
| 142 | */ |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 143 | public CaptureResult(CameraMetadataNative results, CaptureRequest parent, int sequenceId) { |
| 144 | if (results == null) { |
| 145 | throw new IllegalArgumentException("results was null"); |
| 146 | } |
| 147 | |
| 148 | if (parent == null) { |
| 149 | throw new IllegalArgumentException("parent was null"); |
| 150 | } |
| 151 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame^] | 152 | mResults = CameraMetadataNative.move(results); |
| 153 | if (mResults.isEmpty()) { |
| 154 | throw new AssertionError("Results must not be empty"); |
| 155 | } |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 156 | mRequest = parent; |
| 157 | mSequenceId = sequenceId; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 158 | } |
| 159 | |
Ruben Brunk | f967a54 | 2014-04-28 16:31:11 -0700 | [diff] [blame] | 160 | /** |
| 161 | * Returns a copy of the underlying {@link CameraMetadataNative}. |
| 162 | * @hide |
| 163 | */ |
| 164 | public CameraMetadataNative getNativeCopy() { |
| 165 | return new CameraMetadataNative(mResults); |
| 166 | } |
| 167 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame^] | 168 | /** |
| 169 | * Creates a request-less result. |
| 170 | * |
| 171 | * <p><strong>For testing only.</strong></p> |
| 172 | * @hide |
| 173 | */ |
| 174 | public CaptureResult(CameraMetadataNative results, int sequenceId) { |
| 175 | if (results == null) { |
| 176 | throw new IllegalArgumentException("results was null"); |
| 177 | } |
| 178 | |
| 179 | mResults = CameraMetadataNative.move(results); |
| 180 | if (mResults.isEmpty()) { |
| 181 | throw new AssertionError("Results must not be empty"); |
| 182 | } |
| 183 | |
| 184 | mRequest = null; |
| 185 | mSequenceId = sequenceId; |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * Get a capture result field value. |
| 190 | * |
| 191 | * <p>The field definitions can be found in {@link CaptureResult}.</p> |
| 192 | * |
| 193 | * <p>Querying the value for the same key more than once will return a value |
| 194 | * which is equal to the previous queried value.</p> |
| 195 | * |
| 196 | * @throws IllegalArgumentException if the key was not valid |
| 197 | * |
| 198 | * @param key The result field to read. |
| 199 | * @return The value of that key, or {@code null} if the field is not set. |
| 200 | */ |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 201 | public <T> T get(Key<T> key) { |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame^] | 202 | T value = mResults.get(key); |
| 203 | if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value); |
| 204 | return value; |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * {@inheritDoc} |
| 209 | * @hide |
| 210 | */ |
| 211 | @SuppressWarnings("unchecked") |
| 212 | @Override |
| 213 | protected <T> T getProtected(Key<?> key) { |
| 214 | return (T) mResults.get(key); |
| 215 | } |
| 216 | |
| 217 | /** |
| 218 | * {@inheritDoc} |
| 219 | * @hide |
| 220 | */ |
| 221 | @SuppressWarnings("unchecked") |
| 222 | @Override |
| 223 | protected Class<Key<?>> getKeyClass() { |
| 224 | Object thisClass = Key.class; |
| 225 | return (Class<Key<?>>)thisClass; |
| 226 | } |
| 227 | |
| 228 | /** |
| 229 | * Dumps the native metadata contents to logcat. |
| 230 | * |
| 231 | * <p>Visibility for testing/debugging only. The results will not |
| 232 | * include any synthesized keys, as they are invisible to the native layer.</p> |
| 233 | * |
| 234 | * @hide |
| 235 | */ |
| 236 | public void dumpToLog() { |
| 237 | mResults.dumpToLog(); |
| 238 | } |
| 239 | |
| 240 | /** |
| 241 | * {@inheritDoc} |
| 242 | */ |
| 243 | @Override |
| 244 | public List<Key<?>> getKeys() { |
| 245 | // Force the javadoc for this function to show up on the CaptureResult page |
| 246 | return super.getKeys(); |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 247 | } |
| 248 | |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 249 | /** |
| 250 | * Get the request associated with this result. |
| 251 | * |
| 252 | * <p>Whenever a request is successfully captured, with |
| 253 | * {@link CameraDevice.CaptureListener#onCaptureCompleted}, |
| 254 | * the {@code result}'s {@code getRequest()} will return that {@code request}. |
| 255 | * </p> |
| 256 | * |
| 257 | * <p>In particular, |
| 258 | * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() { |
| 259 | * {@literal @}Override |
| 260 | * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) { |
| 261 | * assert(myResult.getRequest.equals(myRequest) == true); |
| 262 | * } |
| 263 | * }; |
| 264 | * </code></pre> |
| 265 | * </p> |
| 266 | * |
| 267 | * @return The request associated with this result. Never {@code null}. |
| 268 | */ |
| 269 | public CaptureRequest getRequest() { |
| 270 | return mRequest; |
| 271 | } |
| 272 | |
| 273 | /** |
| 274 | * Get the frame number associated with this result. |
| 275 | * |
| 276 | * <p>Whenever a request has been processed, regardless of failure or success, |
| 277 | * it gets a unique frame number assigned to its future result/failure.</p> |
| 278 | * |
| 279 | * <p>This value monotonically increments, starting with 0, |
| 280 | * for every new result or failure; and the scope is the lifetime of the |
| 281 | * {@link CameraDevice}.</p> |
| 282 | * |
| 283 | * @return int frame number |
| 284 | */ |
| 285 | public int getFrameNumber() { |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame^] | 286 | // TODO: @hide REQUEST_FRAME_COUNT |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 287 | return get(REQUEST_FRAME_COUNT); |
| 288 | } |
| 289 | |
| 290 | /** |
| 291 | * The sequence ID for this failure that was returned by the |
| 292 | * {@link CameraDevice#capture} family of functions. |
| 293 | * |
| 294 | * <p>The sequence ID is a unique monotonically increasing value starting from 0, |
| 295 | * incremented every time a new group of requests is submitted to the CameraDevice.</p> |
| 296 | * |
| 297 | * @return int The ID for the sequence of requests that this capture result is a part of |
| 298 | * |
| 299 | * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted |
| 300 | */ |
| 301 | public int getSequenceId() { |
| 302 | return mSequenceId; |
| 303 | } |
| 304 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 305 | /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 306 | * The key entries below this point are generated from metadata |
| 307 | * definitions in /system/media/camera/docs. Do not modify by hand or |
| 308 | * modify the comment blocks at the start or end. |
| 309 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ |
| 310 | |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 311 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 312 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 313 | * <p>The mode control selects how the image data is converted from the |
| 314 | * sensor's native color into linear sRGB color.</p> |
| 315 | * <p>When auto-white balance is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this |
| 316 | * control is overridden by the AWB routine. When AWB is disabled, the |
| 317 | * application controls how the color mapping is performed.</p> |
| 318 | * <p>We define the expected processing pipeline below. For consistency |
| 319 | * across devices, this is always the case with TRANSFORM_MATRIX.</p> |
| 320 | * <p>When either FULL or HIGH_QUALITY is used, the camera device may |
| 321 | * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 322 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the |
| 323 | * camera device (in the results) and be roughly correct.</p> |
| 324 | * <p>Switching to TRANSFORM_MATRIX and using the data provided from |
| 325 | * FAST or HIGH_QUALITY will yield a picture with the same white point |
| 326 | * as what was produced by the camera device in the earlier frame.</p> |
| 327 | * <p>The expected processing pipeline is as follows:</p> |
| 328 | * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p> |
| 329 | * <p>The white balance is encoded by two values, a 4-channel white-balance |
| 330 | * gain vector (applied in the Bayer domain), and a 3x3 color transform |
| 331 | * matrix (applied after demosaic).</p> |
| 332 | * <p>The 4-channel white-balance gains are defined as:</p> |
| 333 | * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ] |
| 334 | * </code></pre> |
| 335 | * <p>where <code>G_even</code> is the gain for green pixels on even rows of the |
| 336 | * output, and <code>G_odd</code> is the gain for green pixels on the odd rows. |
| 337 | * These may be identical for a given camera device implementation; if |
| 338 | * the camera device does not support a separate gain for even/odd green |
| 339 | * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to |
| 340 | * <code>G_even</code> in the output result metadata.</p> |
| 341 | * <p>The matrices for color transforms are defined as a 9-entry vector:</p> |
| 342 | * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ] |
| 343 | * </code></pre> |
| 344 | * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>, |
| 345 | * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p> |
| 346 | * <p>with colors as follows:</p> |
| 347 | * <pre><code>r' = I0r + I1g + I2b |
| 348 | * g' = I3r + I4g + I5b |
| 349 | * b' = I6r + I7g + I8b |
| 350 | * </code></pre> |
| 351 | * <p>Both the input and output value ranges must match. Overflow/underflow |
| 352 | * values are clipped to fit within the range.</p> |
| 353 | * |
| 354 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
| 355 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
| 356 | * @see CaptureRequest#CONTROL_AWB_MODE |
| 357 | * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX |
| 358 | * @see #COLOR_CORRECTION_MODE_FAST |
| 359 | * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY |
| 360 | */ |
| 361 | public static final Key<Integer> COLOR_CORRECTION_MODE = |
| 362 | new Key<Integer>("android.colorCorrection.mode", int.class); |
| 363 | |
| 364 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 365 | * <p>A color transform matrix to use to transform |
| 366 | * from sensor RGB color space to output linear sRGB color space</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 367 | * <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] | 368 | * {@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] | 369 | * directly by the application in the request when the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 370 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 371 | * <p>In the latter case, the camera device may round the matrix to account |
| 372 | * for precision issues; the final rounded matrix should be reported back |
| 373 | * in this matrix result metadata. The transform should keep the magnitude |
| 374 | * of the output color values within <code>[0, 1.0]</code> (assuming input color |
| 375 | * 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] | 376 | * |
| 377 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 378 | */ |
| 379 | public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM = |
| 380 | new Key<Rational[]>("android.colorCorrection.transform", Rational[].class); |
| 381 | |
| 382 | /** |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 383 | * <p>Gains applying to Bayer raw color channels for |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 384 | * white-balance.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 385 | * <p>The 4-channel white-balance gains are defined in |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 386 | * the order of <code>[R G_even G_odd B]</code>, where <code>G_even</code> is the gain |
| 387 | * for green pixels on even rows of the output, and <code>G_odd</code> |
| 388 | * 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] | 389 | * does not support a separate gain for even/odd green channels, |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 390 | * it should use the <code>G_even</code> value, and write <code>G_odd</code> equal to |
| 391 | * <code>G_even</code> in the output result metadata.</p> |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 392 | * <p>This array is either set by the camera device when the request |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 393 | * {@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] | 394 | * directly by the application in the request when the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 395 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 396 | * <p>The output should be the gains actually applied by the camera device to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 397 | * the current frame.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 398 | * |
| 399 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 400 | */ |
| 401 | public static final Key<float[]> COLOR_CORRECTION_GAINS = |
| 402 | new Key<float[]>("android.colorCorrection.gains", float[].class); |
| 403 | |
| 404 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 405 | * <p>The desired setting for the camera device's auto-exposure |
| 406 | * algorithm's antibanding compensation.</p> |
| 407 | * <p>Some kinds of lighting fixtures, such as some fluorescent |
| 408 | * lights, flicker at the rate of the power supply frequency |
| 409 | * (60Hz or 50Hz, depending on country). While this is |
| 410 | * typically not noticeable to a person, it can be visible to |
| 411 | * a camera device. If a camera sets its exposure time to the |
| 412 | * wrong value, the flicker may become visible in the |
| 413 | * viewfinder as flicker or in a final captured image, as a |
| 414 | * set of variable-brightness bands across the image.</p> |
| 415 | * <p>Therefore, the auto-exposure routines of camera devices |
| 416 | * include antibanding routines that ensure that the chosen |
| 417 | * exposure value will not cause such banding. The choice of |
| 418 | * exposure time depends on the rate of flicker, which the |
| 419 | * camera device can detect automatically, or the expected |
| 420 | * rate can be selected by the application using this |
| 421 | * control.</p> |
| 422 | * <p>A given camera device may not support all of the possible |
| 423 | * options for the antibanding mode. The |
| 424 | * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains |
| 425 | * the available modes for a given camera device.</p> |
| 426 | * <p>The default mode is AUTO, which must be supported by all |
| 427 | * camera devices.</p> |
| 428 | * <p>If manual exposure control is enabled (by setting |
| 429 | * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF), |
| 430 | * then this setting has no effect, and the application must |
| 431 | * ensure it selects exposure times that do not cause banding |
| 432 | * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist |
| 433 | * the application in this.</p> |
| 434 | * |
| 435 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES |
| 436 | * @see CaptureRequest#CONTROL_AE_MODE |
| 437 | * @see CaptureRequest#CONTROL_MODE |
| 438 | * @see CaptureResult#STATISTICS_SCENE_FLICKER |
| 439 | * @see #CONTROL_AE_ANTIBANDING_MODE_OFF |
| 440 | * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ |
| 441 | * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ |
| 442 | * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO |
| 443 | */ |
| 444 | public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = |
| 445 | new Key<Integer>("android.control.aeAntibandingMode", int.class); |
| 446 | |
| 447 | /** |
| 448 | * <p>Adjustment to AE target image |
| 449 | * brightness</p> |
| 450 | * <p>For example, if EV step is 0.333, '6' will mean an |
| 451 | * exposure compensation of +2 EV; -3 will mean an exposure |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 452 | * compensation of -1 EV. Note that this control will only be effective |
| 453 | * if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control will take effect even when |
| 454 | * {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p> |
| 455 | * <p>In the event of exposure compensation value being changed, camera device |
| 456 | * may take several frames to reach the newly requested exposure target. |
| 457 | * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING |
| 458 | * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will |
| 459 | * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or |
| 460 | * FLASH_REQUIRED (if the scene is too dark for still capture).</p> |
| 461 | * |
| 462 | * @see CaptureRequest#CONTROL_AE_LOCK |
| 463 | * @see CaptureRequest#CONTROL_AE_MODE |
| 464 | * @see CaptureResult#CONTROL_AE_STATE |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 465 | */ |
| 466 | public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = |
| 467 | new Key<Integer>("android.control.aeExposureCompensation", int.class); |
| 468 | |
| 469 | /** |
| 470 | * <p>Whether AE is currently locked to its latest |
| 471 | * calculated values.</p> |
| 472 | * <p>Note that even when AE is locked, the flash may be |
| 473 | * fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / ON_ALWAYS_FLASH / |
| 474 | * ON_AUTO_FLASH_REDEYE.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 475 | * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock |
| 476 | * is ON, the camera device will still adjust its exposure value.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 477 | * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) |
| 478 | * when AE is already locked, the camera device will not change the exposure time |
| 479 | * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}) |
| 480 | * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} |
| 481 | * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the |
| 482 | * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p> |
| 483 | * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p> |
| 484 | * |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 485 | * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 486 | * @see CaptureRequest#CONTROL_AE_MODE |
| 487 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 488 | * @see CaptureResult#CONTROL_AE_STATE |
| 489 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 490 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 491 | */ |
| 492 | public static final Key<Boolean> CONTROL_AE_LOCK = |
| 493 | new Key<Boolean>("android.control.aeLock", boolean.class); |
| 494 | |
| 495 | /** |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 496 | * <p>The desired mode for the camera device's |
| 497 | * auto-exposure routine.</p> |
| 498 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is |
| 499 | * AUTO.</p> |
| 500 | * <p>When set to any of the ON modes, the camera device's |
| 501 | * auto-exposure routine is enabled, overriding the |
| 502 | * application's selected exposure time, sensor sensitivity, |
| 503 | * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
| 504 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and |
| 505 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes |
| 506 | * is selected, the camera device's flash unit controls are |
| 507 | * also overridden.</p> |
| 508 | * <p>The FLASH modes are only available if the camera device |
| 509 | * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> |
| 510 | * <p>If flash TORCH mode is desired, this field must be set to |
| 511 | * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> |
| 512 | * <p>When set to any of the ON modes, the values chosen by the |
| 513 | * camera device auto-exposure routine for the overridden |
| 514 | * fields for a given capture will be available in its |
| 515 | * CaptureResult.</p> |
| 516 | * |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 517 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 518 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
| 519 | * @see CaptureRequest#FLASH_MODE |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 520 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 521 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 522 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 523 | * @see #CONTROL_AE_MODE_OFF |
| 524 | * @see #CONTROL_AE_MODE_ON |
| 525 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH |
| 526 | * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH |
| 527 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE |
| 528 | */ |
| 529 | public static final Key<Integer> CONTROL_AE_MODE = |
| 530 | new Key<Integer>("android.control.aeMode", int.class); |
| 531 | |
| 532 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 533 | * <p>List of areas to use for |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 534 | * metering.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 535 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 536 | * xmax, ymax, weight. The rectangle is defined to be inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 537 | * specified coordinates.</p> |
| 538 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 539 | * 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] | 540 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 541 | * {@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] | 542 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 543 | * should be nonnegative.</p> |
| 544 | * <p>If all regions have 0 weight, then no specific metering area |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 545 | * needs to be used by the camera device. If the metering region is |
Zhijun He | 1498615 | 2014-05-22 21:17:37 -0700 | [diff] [blame] | 546 | * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata, |
| 547 | * the camera device will ignore the sections outside the region and output the |
| 548 | * used sections in the result metadata.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 549 | * |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 550 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 551 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 552 | */ |
| 553 | public static final Key<int[]> CONTROL_AE_REGIONS = |
| 554 | new Key<int[]>("android.control.aeRegions", int[].class); |
| 555 | |
| 556 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 557 | * <p>Range over which fps can be adjusted to |
| 558 | * maintain exposure</p> |
| 559 | * <p>Only constrains AE algorithm, not manual control |
| 560 | * of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p> |
| 561 | * |
| 562 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 563 | */ |
| 564 | public static final Key<int[]> CONTROL_AE_TARGET_FPS_RANGE = |
| 565 | new Key<int[]>("android.control.aeTargetFpsRange", int[].class); |
| 566 | |
| 567 | /** |
| 568 | * <p>Whether the camera device will trigger a precapture |
| 569 | * metering sequence when it processes this request.</p> |
| 570 | * <p>This entry is normally set to IDLE, or is not |
| 571 | * included at all in the request settings. When included and |
| 572 | * set to START, the camera device will trigger the autoexposure |
| 573 | * precapture metering sequence.</p> |
| 574 | * <p>The effect of AE precapture trigger depends on the current |
| 575 | * AE mode and state; see {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture |
| 576 | * state transition details.</p> |
| 577 | * |
| 578 | * @see CaptureResult#CONTROL_AE_STATE |
| 579 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE |
| 580 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START |
| 581 | */ |
| 582 | public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = |
| 583 | new Key<Integer>("android.control.aePrecaptureTrigger", int.class); |
| 584 | |
| 585 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 586 | * <p>Current state of AE algorithm</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 587 | * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always |
| 588 | * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 589 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 590 | * the algorithm states to INACTIVE.</p> |
| 591 | * <p>The camera device can do several state transitions between two results, if it is |
| 592 | * allowed by the state transition table. For example: INACTIVE may never actually be |
| 593 | * seen in a result.</p> |
| 594 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 595 | * AE state becomes CONVERGED, then the image data associated with this result should |
| 596 | * be good to use.</p> |
| 597 | * <p>Below are state transition tables for different AE modes.</p> |
| 598 | * <table> |
| 599 | * <thead> |
| 600 | * <tr> |
| 601 | * <th align="center">State</th> |
| 602 | * <th align="center">Transition Cause</th> |
| 603 | * <th align="center">New State</th> |
| 604 | * <th align="center">Notes</th> |
| 605 | * </tr> |
| 606 | * </thead> |
| 607 | * <tbody> |
| 608 | * <tr> |
| 609 | * <td align="center">INACTIVE</td> |
| 610 | * <td align="center"></td> |
| 611 | * <td align="center">INACTIVE</td> |
| 612 | * <td align="center">Camera device auto exposure algorithm is disabled</td> |
| 613 | * </tr> |
| 614 | * </tbody> |
| 615 | * </table> |
| 616 | * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p> |
| 617 | * <table> |
| 618 | * <thead> |
| 619 | * <tr> |
| 620 | * <th align="center">State</th> |
| 621 | * <th align="center">Transition Cause</th> |
| 622 | * <th align="center">New State</th> |
| 623 | * <th align="center">Notes</th> |
| 624 | * </tr> |
| 625 | * </thead> |
| 626 | * <tbody> |
| 627 | * <tr> |
| 628 | * <td align="center">INACTIVE</td> |
| 629 | * <td align="center">Camera device initiates AE scan</td> |
| 630 | * <td align="center">SEARCHING</td> |
| 631 | * <td align="center">Values changing</td> |
| 632 | * </tr> |
| 633 | * <tr> |
| 634 | * <td align="center">INACTIVE</td> |
| 635 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 636 | * <td align="center">LOCKED</td> |
| 637 | * <td align="center">Values locked</td> |
| 638 | * </tr> |
| 639 | * <tr> |
| 640 | * <td align="center">SEARCHING</td> |
| 641 | * <td align="center">Camera device finishes AE scan</td> |
| 642 | * <td align="center">CONVERGED</td> |
| 643 | * <td align="center">Good values, not changing</td> |
| 644 | * </tr> |
| 645 | * <tr> |
| 646 | * <td align="center">SEARCHING</td> |
| 647 | * <td align="center">Camera device finishes AE scan</td> |
| 648 | * <td align="center">FLASH_REQUIRED</td> |
| 649 | * <td align="center">Converged but too dark w/o flash</td> |
| 650 | * </tr> |
| 651 | * <tr> |
| 652 | * <td align="center">SEARCHING</td> |
| 653 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 654 | * <td align="center">LOCKED</td> |
| 655 | * <td align="center">Values locked</td> |
| 656 | * </tr> |
| 657 | * <tr> |
| 658 | * <td align="center">CONVERGED</td> |
| 659 | * <td align="center">Camera device initiates AE scan</td> |
| 660 | * <td align="center">SEARCHING</td> |
| 661 | * <td align="center">Values changing</td> |
| 662 | * </tr> |
| 663 | * <tr> |
| 664 | * <td align="center">CONVERGED</td> |
| 665 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 666 | * <td align="center">LOCKED</td> |
| 667 | * <td align="center">Values locked</td> |
| 668 | * </tr> |
| 669 | * <tr> |
| 670 | * <td align="center">FLASH_REQUIRED</td> |
| 671 | * <td align="center">Camera device initiates AE scan</td> |
| 672 | * <td align="center">SEARCHING</td> |
| 673 | * <td align="center">Values changing</td> |
| 674 | * </tr> |
| 675 | * <tr> |
| 676 | * <td align="center">FLASH_REQUIRED</td> |
| 677 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 678 | * <td align="center">LOCKED</td> |
| 679 | * <td align="center">Values locked</td> |
| 680 | * </tr> |
| 681 | * <tr> |
| 682 | * <td align="center">LOCKED</td> |
| 683 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 684 | * <td align="center">SEARCHING</td> |
| 685 | * <td align="center">Values not good after unlock</td> |
| 686 | * </tr> |
| 687 | * <tr> |
| 688 | * <td align="center">LOCKED</td> |
| 689 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 690 | * <td align="center">CONVERGED</td> |
| 691 | * <td align="center">Values good after unlock</td> |
| 692 | * </tr> |
| 693 | * <tr> |
| 694 | * <td align="center">LOCKED</td> |
| 695 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 696 | * <td align="center">FLASH_REQUIRED</td> |
| 697 | * <td align="center">Exposure good, but too dark</td> |
| 698 | * </tr> |
| 699 | * <tr> |
| 700 | * <td align="center">PRECAPTURE</td> |
| 701 | * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 702 | * <td align="center">CONVERGED</td> |
| 703 | * <td align="center">Ready for high-quality capture</td> |
| 704 | * </tr> |
| 705 | * <tr> |
| 706 | * <td align="center">PRECAPTURE</td> |
| 707 | * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 708 | * <td align="center">LOCKED</td> |
| 709 | * <td align="center">Ready for high-quality capture</td> |
| 710 | * </tr> |
| 711 | * <tr> |
| 712 | * <td align="center">Any state</td> |
| 713 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td> |
| 714 | * <td align="center">PRECAPTURE</td> |
| 715 | * <td align="center">Start AE precapture metering sequence</td> |
| 716 | * </tr> |
| 717 | * </tbody> |
| 718 | * </table> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 719 | * <p>For the above table, the camera device may skip reporting any state changes that happen |
| 720 | * without application intervention (i.e. mode switch, trigger, locking). Any state that |
| 721 | * can be skipped in that manner is called a transient state.</p> |
| 722 | * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions |
| 723 | * listed in above table, it is also legal for the camera device to skip one or more |
| 724 | * transient states between two results. See below table for examples:</p> |
| 725 | * <table> |
| 726 | * <thead> |
| 727 | * <tr> |
| 728 | * <th align="center">State</th> |
| 729 | * <th align="center">Transition Cause</th> |
| 730 | * <th align="center">New State</th> |
| 731 | * <th align="center">Notes</th> |
| 732 | * </tr> |
| 733 | * </thead> |
| 734 | * <tbody> |
| 735 | * <tr> |
| 736 | * <td align="center">INACTIVE</td> |
| 737 | * <td align="center">Camera device finished AE scan</td> |
| 738 | * <td align="center">CONVERGED</td> |
| 739 | * <td align="center">Values are already good, transient states are skipped by camera device.</td> |
| 740 | * </tr> |
| 741 | * <tr> |
| 742 | * <td align="center">Any state</td> |
| 743 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td> |
| 744 | * <td align="center">FLASH_REQUIRED</td> |
| 745 | * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td> |
| 746 | * </tr> |
| 747 | * <tr> |
| 748 | * <td align="center">Any state</td> |
| 749 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td> |
| 750 | * <td align="center">CONVERGED</td> |
| 751 | * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td> |
| 752 | * </tr> |
| 753 | * <tr> |
| 754 | * <td align="center">CONVERGED</td> |
| 755 | * <td align="center">Camera device finished AE scan</td> |
| 756 | * <td align="center">FLASH_REQUIRED</td> |
| 757 | * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td> |
| 758 | * </tr> |
| 759 | * <tr> |
| 760 | * <td align="center">FLASH_REQUIRED</td> |
| 761 | * <td align="center">Camera device finished AE scan</td> |
| 762 | * <td align="center">CONVERGED</td> |
| 763 | * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td> |
| 764 | * </tr> |
| 765 | * </tbody> |
| 766 | * </table> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 767 | * |
| 768 | * @see CaptureRequest#CONTROL_AE_LOCK |
| 769 | * @see CaptureRequest#CONTROL_AE_MODE |
| 770 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 771 | * @see CaptureRequest#CONTROL_MODE |
| 772 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 773 | * @see #CONTROL_AE_STATE_INACTIVE |
| 774 | * @see #CONTROL_AE_STATE_SEARCHING |
| 775 | * @see #CONTROL_AE_STATE_CONVERGED |
| 776 | * @see #CONTROL_AE_STATE_LOCKED |
| 777 | * @see #CONTROL_AE_STATE_FLASH_REQUIRED |
| 778 | * @see #CONTROL_AE_STATE_PRECAPTURE |
| 779 | */ |
| 780 | public static final Key<Integer> CONTROL_AE_STATE = |
| 781 | new Key<Integer>("android.control.aeState", int.class); |
| 782 | |
| 783 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 784 | * <p>Whether AF is currently enabled, and what |
| 785 | * mode it is set to</p> |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 786 | * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus |
| 787 | * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} > 0</code>).</p> |
Zhijun He | 78146ec | 2014-01-14 18:12:13 -0800 | [diff] [blame] | 788 | * <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] | 789 | * 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] | 790 | * in result metadata.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 791 | * |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 792 | * @see CaptureResult#CONTROL_AF_STATE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 793 | * @see CaptureRequest#CONTROL_MODE |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 794 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 795 | * @see #CONTROL_AF_MODE_OFF |
| 796 | * @see #CONTROL_AF_MODE_AUTO |
| 797 | * @see #CONTROL_AF_MODE_MACRO |
| 798 | * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO |
| 799 | * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE |
| 800 | * @see #CONTROL_AF_MODE_EDOF |
| 801 | */ |
| 802 | public static final Key<Integer> CONTROL_AF_MODE = |
| 803 | new Key<Integer>("android.control.afMode", int.class); |
| 804 | |
| 805 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 806 | * <p>List of areas to use for focus |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 807 | * estimation.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 808 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 809 | * xmax, ymax, weight. The rectangle is defined to be inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 810 | * specified coordinates.</p> |
| 811 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 812 | * 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] | 813 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 814 | * {@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] | 815 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 816 | * should be nonnegative.</p> |
| 817 | * <p>If all regions have 0 weight, then no specific focus area |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 818 | * needs to be used by the camera device. If the focusing region is |
Zhijun He | 1498615 | 2014-05-22 21:17:37 -0700 | [diff] [blame] | 819 | * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture |
| 820 | * result metadata, the camera device will ignore the sections outside |
| 821 | * the region and output the used sections in the result metadata.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 822 | * |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 823 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 824 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 825 | */ |
| 826 | public static final Key<int[]> CONTROL_AF_REGIONS = |
| 827 | new Key<int[]>("android.control.afRegions", int[].class); |
| 828 | |
| 829 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 830 | * <p>Whether the camera device will trigger autofocus for this request.</p> |
| 831 | * <p>This entry is normally set to IDLE, or is not |
| 832 | * included at all in the request settings.</p> |
| 833 | * <p>When included and set to START, the camera device will trigger the |
| 834 | * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p> |
| 835 | * <p>When set to CANCEL, the camera device will cancel any active trigger, |
| 836 | * and return to its initial AF state.</p> |
| 837 | * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what that means for each AF mode.</p> |
| 838 | * |
| 839 | * @see CaptureResult#CONTROL_AF_STATE |
| 840 | * @see #CONTROL_AF_TRIGGER_IDLE |
| 841 | * @see #CONTROL_AF_TRIGGER_START |
| 842 | * @see #CONTROL_AF_TRIGGER_CANCEL |
| 843 | */ |
| 844 | public static final Key<Integer> CONTROL_AF_TRIGGER = |
| 845 | new Key<Integer>("android.control.afTrigger", int.class); |
| 846 | |
| 847 | /** |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 848 | * <p>Current state of AF algorithm.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 849 | * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always |
| 850 | * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 851 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 852 | * the algorithm states to INACTIVE.</p> |
| 853 | * <p>The camera device can do several state transitions between two results, if it is |
| 854 | * allowed by the state transition table. For example: INACTIVE may never actually be |
| 855 | * seen in a result.</p> |
| 856 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 857 | * AF state becomes FOCUSED, then the image data associated with this result should |
| 858 | * be sharp.</p> |
| 859 | * <p>Below are state transition tables for different AF modes.</p> |
| 860 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p> |
| 861 | * <table> |
| 862 | * <thead> |
| 863 | * <tr> |
| 864 | * <th align="center">State</th> |
| 865 | * <th align="center">Transition Cause</th> |
| 866 | * <th align="center">New State</th> |
| 867 | * <th align="center">Notes</th> |
| 868 | * </tr> |
| 869 | * </thead> |
| 870 | * <tbody> |
| 871 | * <tr> |
| 872 | * <td align="center">INACTIVE</td> |
| 873 | * <td align="center"></td> |
| 874 | * <td align="center">INACTIVE</td> |
| 875 | * <td align="center">Never changes</td> |
| 876 | * </tr> |
| 877 | * </tbody> |
| 878 | * </table> |
| 879 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p> |
| 880 | * <table> |
| 881 | * <thead> |
| 882 | * <tr> |
| 883 | * <th align="center">State</th> |
| 884 | * <th align="center">Transition Cause</th> |
| 885 | * <th align="center">New State</th> |
| 886 | * <th align="center">Notes</th> |
| 887 | * </tr> |
| 888 | * </thead> |
| 889 | * <tbody> |
| 890 | * <tr> |
| 891 | * <td align="center">INACTIVE</td> |
| 892 | * <td align="center">AF_TRIGGER</td> |
| 893 | * <td align="center">ACTIVE_SCAN</td> |
| 894 | * <td align="center">Start AF sweep, Lens now moving</td> |
| 895 | * </tr> |
| 896 | * <tr> |
| 897 | * <td align="center">ACTIVE_SCAN</td> |
| 898 | * <td align="center">AF sweep done</td> |
| 899 | * <td align="center">FOCUSED_LOCKED</td> |
| 900 | * <td align="center">Focused, Lens now locked</td> |
| 901 | * </tr> |
| 902 | * <tr> |
| 903 | * <td align="center">ACTIVE_SCAN</td> |
| 904 | * <td align="center">AF sweep done</td> |
| 905 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 906 | * <td align="center">Not focused, Lens now locked</td> |
| 907 | * </tr> |
| 908 | * <tr> |
| 909 | * <td align="center">ACTIVE_SCAN</td> |
| 910 | * <td align="center">AF_CANCEL</td> |
| 911 | * <td align="center">INACTIVE</td> |
| 912 | * <td align="center">Cancel/reset AF, Lens now locked</td> |
| 913 | * </tr> |
| 914 | * <tr> |
| 915 | * <td align="center">FOCUSED_LOCKED</td> |
| 916 | * <td align="center">AF_CANCEL</td> |
| 917 | * <td align="center">INACTIVE</td> |
| 918 | * <td align="center">Cancel/reset AF</td> |
| 919 | * </tr> |
| 920 | * <tr> |
| 921 | * <td align="center">FOCUSED_LOCKED</td> |
| 922 | * <td align="center">AF_TRIGGER</td> |
| 923 | * <td align="center">ACTIVE_SCAN</td> |
| 924 | * <td align="center">Start new sweep, Lens now moving</td> |
| 925 | * </tr> |
| 926 | * <tr> |
| 927 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 928 | * <td align="center">AF_CANCEL</td> |
| 929 | * <td align="center">INACTIVE</td> |
| 930 | * <td align="center">Cancel/reset AF</td> |
| 931 | * </tr> |
| 932 | * <tr> |
| 933 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 934 | * <td align="center">AF_TRIGGER</td> |
| 935 | * <td align="center">ACTIVE_SCAN</td> |
| 936 | * <td align="center">Start new sweep, Lens now moving</td> |
| 937 | * </tr> |
| 938 | * <tr> |
| 939 | * <td align="center">Any state</td> |
| 940 | * <td align="center">Mode change</td> |
| 941 | * <td align="center">INACTIVE</td> |
| 942 | * <td align="center"></td> |
| 943 | * </tr> |
| 944 | * </tbody> |
| 945 | * </table> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 946 | * <p>For the above table, the camera device may skip reporting any state changes that happen |
| 947 | * without application intervention (i.e. mode switch, trigger, locking). Any state that |
| 948 | * can be skipped in that manner is called a transient state.</p> |
| 949 | * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the |
| 950 | * state transitions listed in above table, it is also legal for the camera device to skip |
| 951 | * one or more transient states between two results. See below table for examples:</p> |
| 952 | * <table> |
| 953 | * <thead> |
| 954 | * <tr> |
| 955 | * <th align="center">State</th> |
| 956 | * <th align="center">Transition Cause</th> |
| 957 | * <th align="center">New State</th> |
| 958 | * <th align="center">Notes</th> |
| 959 | * </tr> |
| 960 | * </thead> |
| 961 | * <tbody> |
| 962 | * <tr> |
| 963 | * <td align="center">INACTIVE</td> |
| 964 | * <td align="center">AF_TRIGGER</td> |
| 965 | * <td align="center">FOCUSED_LOCKED</td> |
| 966 | * <td align="center">Focus is already good or good after a scan, lens is now locked.</td> |
| 967 | * </tr> |
| 968 | * <tr> |
| 969 | * <td align="center">INACTIVE</td> |
| 970 | * <td align="center">AF_TRIGGER</td> |
| 971 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 972 | * <td align="center">Focus failed after a scan, lens is now locked.</td> |
| 973 | * </tr> |
| 974 | * <tr> |
| 975 | * <td align="center">FOCUSED_LOCKED</td> |
| 976 | * <td align="center">AF_TRIGGER</td> |
| 977 | * <td align="center">FOCUSED_LOCKED</td> |
| 978 | * <td align="center">Focus is already good or good after a scan, lens is now locked.</td> |
| 979 | * </tr> |
| 980 | * <tr> |
| 981 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 982 | * <td align="center">AF_TRIGGER</td> |
| 983 | * <td align="center">FOCUSED_LOCKED</td> |
| 984 | * <td align="center">Focus is good after a scan, lens is not locked.</td> |
| 985 | * </tr> |
| 986 | * </tbody> |
| 987 | * </table> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 988 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p> |
| 989 | * <table> |
| 990 | * <thead> |
| 991 | * <tr> |
| 992 | * <th align="center">State</th> |
| 993 | * <th align="center">Transition Cause</th> |
| 994 | * <th align="center">New State</th> |
| 995 | * <th align="center">Notes</th> |
| 996 | * </tr> |
| 997 | * </thead> |
| 998 | * <tbody> |
| 999 | * <tr> |
| 1000 | * <td align="center">INACTIVE</td> |
| 1001 | * <td align="center">Camera device initiates new scan</td> |
| 1002 | * <td align="center">PASSIVE_SCAN</td> |
| 1003 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1004 | * </tr> |
| 1005 | * <tr> |
| 1006 | * <td align="center">INACTIVE</td> |
| 1007 | * <td align="center">AF_TRIGGER</td> |
| 1008 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1009 | * <td align="center">AF state query, Lens now locked</td> |
| 1010 | * </tr> |
| 1011 | * <tr> |
| 1012 | * <td align="center">PASSIVE_SCAN</td> |
| 1013 | * <td align="center">Camera device completes current scan</td> |
| 1014 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1015 | * <td align="center">End AF scan, Lens now locked</td> |
| 1016 | * </tr> |
| 1017 | * <tr> |
| 1018 | * <td align="center">PASSIVE_SCAN</td> |
| 1019 | * <td align="center">Camera device fails current scan</td> |
| 1020 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1021 | * <td align="center">End AF scan, Lens now locked</td> |
| 1022 | * </tr> |
| 1023 | * <tr> |
| 1024 | * <td align="center">PASSIVE_SCAN</td> |
| 1025 | * <td align="center">AF_TRIGGER</td> |
| 1026 | * <td align="center">FOCUSED_LOCKED</td> |
| 1027 | * <td align="center">Immediate trans. If focus is good, Lens now locked</td> |
| 1028 | * </tr> |
| 1029 | * <tr> |
| 1030 | * <td align="center">PASSIVE_SCAN</td> |
| 1031 | * <td align="center">AF_TRIGGER</td> |
| 1032 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1033 | * <td align="center">Immediate trans. if focus is bad, Lens now locked</td> |
| 1034 | * </tr> |
| 1035 | * <tr> |
| 1036 | * <td align="center">PASSIVE_SCAN</td> |
| 1037 | * <td align="center">AF_CANCEL</td> |
| 1038 | * <td align="center">INACTIVE</td> |
| 1039 | * <td align="center">Reset lens position, Lens now locked</td> |
| 1040 | * </tr> |
| 1041 | * <tr> |
| 1042 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1043 | * <td align="center">Camera device initiates new scan</td> |
| 1044 | * <td align="center">PASSIVE_SCAN</td> |
| 1045 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1046 | * </tr> |
| 1047 | * <tr> |
| 1048 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1049 | * <td align="center">Camera device initiates new scan</td> |
| 1050 | * <td align="center">PASSIVE_SCAN</td> |
| 1051 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1052 | * </tr> |
| 1053 | * <tr> |
| 1054 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1055 | * <td align="center">AF_TRIGGER</td> |
| 1056 | * <td align="center">FOCUSED_LOCKED</td> |
| 1057 | * <td align="center">Immediate trans. Lens now locked</td> |
| 1058 | * </tr> |
| 1059 | * <tr> |
| 1060 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1061 | * <td align="center">AF_TRIGGER</td> |
| 1062 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1063 | * <td align="center">Immediate trans. Lens now locked</td> |
| 1064 | * </tr> |
| 1065 | * <tr> |
| 1066 | * <td align="center">FOCUSED_LOCKED</td> |
| 1067 | * <td align="center">AF_TRIGGER</td> |
| 1068 | * <td align="center">FOCUSED_LOCKED</td> |
| 1069 | * <td align="center">No effect</td> |
| 1070 | * </tr> |
| 1071 | * <tr> |
| 1072 | * <td align="center">FOCUSED_LOCKED</td> |
| 1073 | * <td align="center">AF_CANCEL</td> |
| 1074 | * <td align="center">INACTIVE</td> |
| 1075 | * <td align="center">Restart AF scan</td> |
| 1076 | * </tr> |
| 1077 | * <tr> |
| 1078 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1079 | * <td align="center">AF_TRIGGER</td> |
| 1080 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1081 | * <td align="center">No effect</td> |
| 1082 | * </tr> |
| 1083 | * <tr> |
| 1084 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1085 | * <td align="center">AF_CANCEL</td> |
| 1086 | * <td align="center">INACTIVE</td> |
| 1087 | * <td align="center">Restart AF scan</td> |
| 1088 | * </tr> |
| 1089 | * </tbody> |
| 1090 | * </table> |
| 1091 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p> |
| 1092 | * <table> |
| 1093 | * <thead> |
| 1094 | * <tr> |
| 1095 | * <th align="center">State</th> |
| 1096 | * <th align="center">Transition Cause</th> |
| 1097 | * <th align="center">New State</th> |
| 1098 | * <th align="center">Notes</th> |
| 1099 | * </tr> |
| 1100 | * </thead> |
| 1101 | * <tbody> |
| 1102 | * <tr> |
| 1103 | * <td align="center">INACTIVE</td> |
| 1104 | * <td align="center">Camera device initiates new scan</td> |
| 1105 | * <td align="center">PASSIVE_SCAN</td> |
| 1106 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1107 | * </tr> |
| 1108 | * <tr> |
| 1109 | * <td align="center">INACTIVE</td> |
| 1110 | * <td align="center">AF_TRIGGER</td> |
| 1111 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1112 | * <td align="center">AF state query, Lens now locked</td> |
| 1113 | * </tr> |
| 1114 | * <tr> |
| 1115 | * <td align="center">PASSIVE_SCAN</td> |
| 1116 | * <td align="center">Camera device completes current scan</td> |
| 1117 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1118 | * <td align="center">End AF scan, Lens now locked</td> |
| 1119 | * </tr> |
| 1120 | * <tr> |
| 1121 | * <td align="center">PASSIVE_SCAN</td> |
| 1122 | * <td align="center">Camera device fails current scan</td> |
| 1123 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1124 | * <td align="center">End AF scan, Lens now locked</td> |
| 1125 | * </tr> |
| 1126 | * <tr> |
| 1127 | * <td align="center">PASSIVE_SCAN</td> |
| 1128 | * <td align="center">AF_TRIGGER</td> |
| 1129 | * <td align="center">FOCUSED_LOCKED</td> |
| 1130 | * <td align="center">Eventual trans. once focus good, Lens now locked</td> |
| 1131 | * </tr> |
| 1132 | * <tr> |
| 1133 | * <td align="center">PASSIVE_SCAN</td> |
| 1134 | * <td align="center">AF_TRIGGER</td> |
| 1135 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1136 | * <td align="center">Eventual trans. if cannot focus, Lens now locked</td> |
| 1137 | * </tr> |
| 1138 | * <tr> |
| 1139 | * <td align="center">PASSIVE_SCAN</td> |
| 1140 | * <td align="center">AF_CANCEL</td> |
| 1141 | * <td align="center">INACTIVE</td> |
| 1142 | * <td align="center">Reset lens position, Lens now locked</td> |
| 1143 | * </tr> |
| 1144 | * <tr> |
| 1145 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1146 | * <td align="center">Camera device initiates new scan</td> |
| 1147 | * <td align="center">PASSIVE_SCAN</td> |
| 1148 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1149 | * </tr> |
| 1150 | * <tr> |
| 1151 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1152 | * <td align="center">Camera device initiates new scan</td> |
| 1153 | * <td align="center">PASSIVE_SCAN</td> |
| 1154 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1155 | * </tr> |
| 1156 | * <tr> |
| 1157 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1158 | * <td align="center">AF_TRIGGER</td> |
| 1159 | * <td align="center">FOCUSED_LOCKED</td> |
| 1160 | * <td align="center">Immediate trans. Lens now locked</td> |
| 1161 | * </tr> |
| 1162 | * <tr> |
| 1163 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1164 | * <td align="center">AF_TRIGGER</td> |
| 1165 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1166 | * <td align="center">Immediate trans. Lens now locked</td> |
| 1167 | * </tr> |
| 1168 | * <tr> |
| 1169 | * <td align="center">FOCUSED_LOCKED</td> |
| 1170 | * <td align="center">AF_TRIGGER</td> |
| 1171 | * <td align="center">FOCUSED_LOCKED</td> |
| 1172 | * <td align="center">No effect</td> |
| 1173 | * </tr> |
| 1174 | * <tr> |
| 1175 | * <td align="center">FOCUSED_LOCKED</td> |
| 1176 | * <td align="center">AF_CANCEL</td> |
| 1177 | * <td align="center">INACTIVE</td> |
| 1178 | * <td align="center">Restart AF scan</td> |
| 1179 | * </tr> |
| 1180 | * <tr> |
| 1181 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1182 | * <td align="center">AF_TRIGGER</td> |
| 1183 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1184 | * <td align="center">No effect</td> |
| 1185 | * </tr> |
| 1186 | * <tr> |
| 1187 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1188 | * <td align="center">AF_CANCEL</td> |
| 1189 | * <td align="center">INACTIVE</td> |
| 1190 | * <td align="center">Restart AF scan</td> |
| 1191 | * </tr> |
| 1192 | * </tbody> |
| 1193 | * </table> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1194 | * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO |
| 1195 | * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the |
| 1196 | * camera device. When a trigger is included in a mode switch request, the trigger |
| 1197 | * will be evaluated in the context of the new mode in the request. |
| 1198 | * See below table for examples:</p> |
| 1199 | * <table> |
| 1200 | * <thead> |
| 1201 | * <tr> |
| 1202 | * <th align="center">State</th> |
| 1203 | * <th align="center">Transition Cause</th> |
| 1204 | * <th align="center">New State</th> |
| 1205 | * <th align="center">Notes</th> |
| 1206 | * </tr> |
| 1207 | * </thead> |
| 1208 | * <tbody> |
| 1209 | * <tr> |
| 1210 | * <td align="center">any state</td> |
| 1211 | * <td align="center">CAF-->AUTO mode switch</td> |
| 1212 | * <td align="center">INACTIVE</td> |
| 1213 | * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td> |
| 1214 | * </tr> |
| 1215 | * <tr> |
| 1216 | * <td align="center">any state</td> |
| 1217 | * <td align="center">CAF-->AUTO mode switch with AF_TRIGGER</td> |
| 1218 | * <td align="center">trigger-reachable states from INACTIVE</td> |
| 1219 | * <td align="center">Mode switch with trigger, INACTIVE is skipped</td> |
| 1220 | * </tr> |
| 1221 | * <tr> |
| 1222 | * <td align="center">any state</td> |
| 1223 | * <td align="center">AUTO-->CAF mode switch</td> |
| 1224 | * <td align="center">passively reachable states from INACTIVE</td> |
| 1225 | * <td align="center">Mode switch without trigger, passive transient state is skipped</td> |
| 1226 | * </tr> |
| 1227 | * </tbody> |
| 1228 | * </table> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1229 | * |
| 1230 | * @see CaptureRequest#CONTROL_AF_MODE |
| 1231 | * @see CaptureRequest#CONTROL_MODE |
| 1232 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1233 | * @see #CONTROL_AF_STATE_INACTIVE |
| 1234 | * @see #CONTROL_AF_STATE_PASSIVE_SCAN |
| 1235 | * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED |
| 1236 | * @see #CONTROL_AF_STATE_ACTIVE_SCAN |
| 1237 | * @see #CONTROL_AF_STATE_FOCUSED_LOCKED |
| 1238 | * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED |
Eino-Ville Talvala | 9f880f7 | 2013-09-20 17:50:41 -0700 | [diff] [blame] | 1239 | * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1240 | */ |
| 1241 | public static final Key<Integer> CONTROL_AF_STATE = |
| 1242 | new Key<Integer>("android.control.afState", int.class); |
| 1243 | |
| 1244 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1245 | * <p>Whether AWB is currently locked to its |
| 1246 | * latest calculated values.</p> |
| 1247 | * <p>Note that AWB lock is only meaningful for AUTO |
| 1248 | * mode; in other modes, AWB is already fixed to a specific |
| 1249 | * setting.</p> |
| 1250 | */ |
| 1251 | public static final Key<Boolean> CONTROL_AWB_LOCK = |
| 1252 | new Key<Boolean>("android.control.awbLock", boolean.class); |
| 1253 | |
| 1254 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1255 | * <p>Whether AWB is currently setting the color |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1256 | * transform fields, and what its illumination target |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1257 | * is.</p> |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1258 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p> |
| 1259 | * <p>When set to the ON mode, the camera device's auto white balance |
| 1260 | * routine is enabled, overriding the application's selected |
| 1261 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 1262 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
| 1263 | * <p>When set to the OFF mode, the camera device's auto white balance |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1264 | * routine is disabled. The application manually controls the white |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1265 | * 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] | 1266 | * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
| 1267 | * <p>When set to any other modes, the camera device's auto white balance |
| 1268 | * routine is disabled. The camera device uses each particular illumination |
| 1269 | * target for white balance adjustment.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1270 | * |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1271 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1272 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
| 1273 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1274 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1275 | * @see #CONTROL_AWB_MODE_OFF |
| 1276 | * @see #CONTROL_AWB_MODE_AUTO |
| 1277 | * @see #CONTROL_AWB_MODE_INCANDESCENT |
| 1278 | * @see #CONTROL_AWB_MODE_FLUORESCENT |
| 1279 | * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT |
| 1280 | * @see #CONTROL_AWB_MODE_DAYLIGHT |
| 1281 | * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT |
| 1282 | * @see #CONTROL_AWB_MODE_TWILIGHT |
| 1283 | * @see #CONTROL_AWB_MODE_SHADE |
| 1284 | */ |
| 1285 | public static final Key<Integer> CONTROL_AWB_MODE = |
| 1286 | new Key<Integer>("android.control.awbMode", int.class); |
| 1287 | |
| 1288 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1289 | * <p>List of areas to use for illuminant |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 1290 | * estimation.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1291 | * <p>Only used in AUTO mode.</p> |
| 1292 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 1293 | * xmax, ymax, weight. The rectangle is defined to be inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1294 | * specified coordinates.</p> |
| 1295 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 1296 | * 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] | 1297 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 1298 | * {@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] | 1299 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1300 | * should be nonnegative.</p> |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1301 | * <p>If all regions have 0 weight, then no specific auto-white balance (AWB) area |
| 1302 | * needs to be used by the camera device. If the AWB region is |
Zhijun He | 1498615 | 2014-05-22 21:17:37 -0700 | [diff] [blame] | 1303 | * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata, |
| 1304 | * the camera device will ignore the sections outside the region and output the |
| 1305 | * used sections in the result metadata.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1306 | * |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1307 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1308 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1309 | */ |
| 1310 | public static final Key<int[]> CONTROL_AWB_REGIONS = |
| 1311 | new Key<int[]>("android.control.awbRegions", int[].class); |
| 1312 | |
| 1313 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1314 | * <p>Information to the camera device 3A (auto-exposure, |
| 1315 | * auto-focus, auto-white balance) routines about the purpose |
| 1316 | * of this capture, to help the camera device to decide optimal 3A |
| 1317 | * strategy.</p> |
| 1318 | * <p>This control (except for MANUAL) is only effective if |
| 1319 | * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p> |
| 1320 | * <p>ZERO_SHUTTER_LAG must be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} |
| 1321 | * contains ZSL. MANUAL must be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} |
| 1322 | * contains MANUAL_SENSOR.</p> |
| 1323 | * |
| 1324 | * @see CaptureRequest#CONTROL_MODE |
| 1325 | * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES |
| 1326 | * @see #CONTROL_CAPTURE_INTENT_CUSTOM |
| 1327 | * @see #CONTROL_CAPTURE_INTENT_PREVIEW |
| 1328 | * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE |
| 1329 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD |
| 1330 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT |
| 1331 | * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG |
| 1332 | * @see #CONTROL_CAPTURE_INTENT_MANUAL |
| 1333 | */ |
| 1334 | public static final Key<Integer> CONTROL_CAPTURE_INTENT = |
| 1335 | new Key<Integer>("android.control.captureIntent", int.class); |
| 1336 | |
| 1337 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1338 | * <p>Current state of AWB algorithm</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1339 | * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always |
| 1340 | * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 1341 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 1342 | * the algorithm states to INACTIVE.</p> |
| 1343 | * <p>The camera device can do several state transitions between two results, if it is |
| 1344 | * allowed by the state transition table. So INACTIVE may never actually be seen in |
| 1345 | * a result.</p> |
| 1346 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 1347 | * AWB state becomes CONVERGED, then the image data associated with this result should |
| 1348 | * be good to use.</p> |
| 1349 | * <p>Below are state transition tables for different AWB modes.</p> |
| 1350 | * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p> |
| 1351 | * <table> |
| 1352 | * <thead> |
| 1353 | * <tr> |
| 1354 | * <th align="center">State</th> |
| 1355 | * <th align="center">Transition Cause</th> |
| 1356 | * <th align="center">New State</th> |
| 1357 | * <th align="center">Notes</th> |
| 1358 | * </tr> |
| 1359 | * </thead> |
| 1360 | * <tbody> |
| 1361 | * <tr> |
| 1362 | * <td align="center">INACTIVE</td> |
| 1363 | * <td align="center"></td> |
| 1364 | * <td align="center">INACTIVE</td> |
| 1365 | * <td align="center">Camera device auto white balance algorithm is disabled</td> |
| 1366 | * </tr> |
| 1367 | * </tbody> |
| 1368 | * </table> |
| 1369 | * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p> |
| 1370 | * <table> |
| 1371 | * <thead> |
| 1372 | * <tr> |
| 1373 | * <th align="center">State</th> |
| 1374 | * <th align="center">Transition Cause</th> |
| 1375 | * <th align="center">New State</th> |
| 1376 | * <th align="center">Notes</th> |
| 1377 | * </tr> |
| 1378 | * </thead> |
| 1379 | * <tbody> |
| 1380 | * <tr> |
| 1381 | * <td align="center">INACTIVE</td> |
| 1382 | * <td align="center">Camera device initiates AWB scan</td> |
| 1383 | * <td align="center">SEARCHING</td> |
| 1384 | * <td align="center">Values changing</td> |
| 1385 | * </tr> |
| 1386 | * <tr> |
| 1387 | * <td align="center">INACTIVE</td> |
| 1388 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 1389 | * <td align="center">LOCKED</td> |
| 1390 | * <td align="center">Values locked</td> |
| 1391 | * </tr> |
| 1392 | * <tr> |
| 1393 | * <td align="center">SEARCHING</td> |
| 1394 | * <td align="center">Camera device finishes AWB scan</td> |
| 1395 | * <td align="center">CONVERGED</td> |
| 1396 | * <td align="center">Good values, not changing</td> |
| 1397 | * </tr> |
| 1398 | * <tr> |
| 1399 | * <td align="center">SEARCHING</td> |
| 1400 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 1401 | * <td align="center">LOCKED</td> |
| 1402 | * <td align="center">Values locked</td> |
| 1403 | * </tr> |
| 1404 | * <tr> |
| 1405 | * <td align="center">CONVERGED</td> |
| 1406 | * <td align="center">Camera device initiates AWB scan</td> |
| 1407 | * <td align="center">SEARCHING</td> |
| 1408 | * <td align="center">Values changing</td> |
| 1409 | * </tr> |
| 1410 | * <tr> |
| 1411 | * <td align="center">CONVERGED</td> |
| 1412 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 1413 | * <td align="center">LOCKED</td> |
| 1414 | * <td align="center">Values locked</td> |
| 1415 | * </tr> |
| 1416 | * <tr> |
| 1417 | * <td align="center">LOCKED</td> |
| 1418 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> |
| 1419 | * <td align="center">SEARCHING</td> |
| 1420 | * <td align="center">Values not good after unlock</td> |
| 1421 | * </tr> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1422 | * </tbody> |
| 1423 | * </table> |
| 1424 | * <p>For the above table, the camera device may skip reporting any state changes that happen |
| 1425 | * without application intervention (i.e. mode switch, trigger, locking). Any state that |
| 1426 | * can be skipped in that manner is called a transient state.</p> |
| 1427 | * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions |
| 1428 | * listed in above table, it is also legal for the camera device to skip one or more |
| 1429 | * transient states between two results. See below table for examples:</p> |
| 1430 | * <table> |
| 1431 | * <thead> |
| 1432 | * <tr> |
| 1433 | * <th align="center">State</th> |
| 1434 | * <th align="center">Transition Cause</th> |
| 1435 | * <th align="center">New State</th> |
| 1436 | * <th align="center">Notes</th> |
| 1437 | * </tr> |
| 1438 | * </thead> |
| 1439 | * <tbody> |
| 1440 | * <tr> |
| 1441 | * <td align="center">INACTIVE</td> |
| 1442 | * <td align="center">Camera device finished AWB scan</td> |
| 1443 | * <td align="center">CONVERGED</td> |
| 1444 | * <td align="center">Values are already good, transient states are skipped by camera device.</td> |
| 1445 | * </tr> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1446 | * <tr> |
| 1447 | * <td align="center">LOCKED</td> |
| 1448 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> |
| 1449 | * <td align="center">CONVERGED</td> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1450 | * <td align="center">Values good after unlock, transient states are skipped by camera device.</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1451 | * </tr> |
| 1452 | * </tbody> |
| 1453 | * </table> |
| 1454 | * |
| 1455 | * @see CaptureRequest#CONTROL_AWB_LOCK |
| 1456 | * @see CaptureRequest#CONTROL_AWB_MODE |
| 1457 | * @see CaptureRequest#CONTROL_MODE |
| 1458 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1459 | * @see #CONTROL_AWB_STATE_INACTIVE |
| 1460 | * @see #CONTROL_AWB_STATE_SEARCHING |
| 1461 | * @see #CONTROL_AWB_STATE_CONVERGED |
| 1462 | * @see #CONTROL_AWB_STATE_LOCKED |
| 1463 | */ |
| 1464 | public static final Key<Integer> CONTROL_AWB_STATE = |
| 1465 | new Key<Integer>("android.control.awbState", int.class); |
| 1466 | |
| 1467 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1468 | * <p>A special color effect to apply.</p> |
| 1469 | * <p>When this mode is set, a color effect will be applied |
| 1470 | * to images produced by the camera device. The interpretation |
| 1471 | * and implementation of these color effects is left to the |
| 1472 | * implementor of the camera device, and should not be |
| 1473 | * depended on to be consistent (or present) across all |
| 1474 | * devices.</p> |
| 1475 | * <p>A color effect will only be applied if |
| 1476 | * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p> |
| 1477 | * |
| 1478 | * @see CaptureRequest#CONTROL_MODE |
| 1479 | * @see #CONTROL_EFFECT_MODE_OFF |
| 1480 | * @see #CONTROL_EFFECT_MODE_MONO |
| 1481 | * @see #CONTROL_EFFECT_MODE_NEGATIVE |
| 1482 | * @see #CONTROL_EFFECT_MODE_SOLARIZE |
| 1483 | * @see #CONTROL_EFFECT_MODE_SEPIA |
| 1484 | * @see #CONTROL_EFFECT_MODE_POSTERIZE |
| 1485 | * @see #CONTROL_EFFECT_MODE_WHITEBOARD |
| 1486 | * @see #CONTROL_EFFECT_MODE_BLACKBOARD |
| 1487 | * @see #CONTROL_EFFECT_MODE_AQUA |
| 1488 | */ |
| 1489 | public static final Key<Integer> CONTROL_EFFECT_MODE = |
| 1490 | new Key<Integer>("android.control.effectMode", int.class); |
| 1491 | |
| 1492 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1493 | * <p>Overall mode of 3A control |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1494 | * routines.</p> |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 1495 | * <p>High-level 3A control. When set to OFF, all 3A control |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1496 | * 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] | 1497 | * capture parameters itself.</p> |
| 1498 | * <p>When set to AUTO, the individual algorithm controls in |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1499 | * 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] | 1500 | * <p>When set to USE_SCENE_MODE, the individual controls in |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1501 | * android.control.* are mostly disabled, and the camera device implements |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 1502 | * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1503 | * 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] | 1504 | * android.control.sceneModeOverrides.</p> |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1505 | * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference |
| 1506 | * is that this frame will not be used by camera device background 3A statistics |
| 1507 | * update, as if this frame is never captured. This mode can be used in the scenario |
| 1508 | * where the application doesn't want a 3A manual control capture to affect |
| 1509 | * the subsequent auto 3A capture results.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1510 | * |
| 1511 | * @see CaptureRequest#CONTROL_AF_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1512 | * @see #CONTROL_MODE_OFF |
| 1513 | * @see #CONTROL_MODE_AUTO |
| 1514 | * @see #CONTROL_MODE_USE_SCENE_MODE |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1515 | * @see #CONTROL_MODE_OFF_KEEP_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1516 | */ |
| 1517 | public static final Key<Integer> CONTROL_MODE = |
| 1518 | new Key<Integer>("android.control.mode", int.class); |
| 1519 | |
| 1520 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1521 | * <p>A camera mode optimized for conditions typical in a particular |
| 1522 | * capture setting.</p> |
| 1523 | * <p>This is the mode that that is active when |
| 1524 | * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, |
| 1525 | * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, |
| 1526 | * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p> |
| 1527 | * <p>The interpretation and implementation of these scene modes is left |
| 1528 | * to the implementor of the camera device. Their behavior will not be |
| 1529 | * consistent across all devices, and any given device may only implement |
| 1530 | * a subset of these modes.</p> |
| 1531 | * |
| 1532 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1533 | * @see CaptureRequest#CONTROL_AF_MODE |
| 1534 | * @see CaptureRequest#CONTROL_AWB_MODE |
| 1535 | * @see CaptureRequest#CONTROL_MODE |
| 1536 | * @see #CONTROL_SCENE_MODE_DISABLED |
| 1537 | * @see #CONTROL_SCENE_MODE_FACE_PRIORITY |
| 1538 | * @see #CONTROL_SCENE_MODE_ACTION |
| 1539 | * @see #CONTROL_SCENE_MODE_PORTRAIT |
| 1540 | * @see #CONTROL_SCENE_MODE_LANDSCAPE |
| 1541 | * @see #CONTROL_SCENE_MODE_NIGHT |
| 1542 | * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT |
| 1543 | * @see #CONTROL_SCENE_MODE_THEATRE |
| 1544 | * @see #CONTROL_SCENE_MODE_BEACH |
| 1545 | * @see #CONTROL_SCENE_MODE_SNOW |
| 1546 | * @see #CONTROL_SCENE_MODE_SUNSET |
| 1547 | * @see #CONTROL_SCENE_MODE_STEADYPHOTO |
| 1548 | * @see #CONTROL_SCENE_MODE_FIREWORKS |
| 1549 | * @see #CONTROL_SCENE_MODE_SPORTS |
| 1550 | * @see #CONTROL_SCENE_MODE_PARTY |
| 1551 | * @see #CONTROL_SCENE_MODE_CANDLELIGHT |
| 1552 | * @see #CONTROL_SCENE_MODE_BARCODE |
| 1553 | */ |
| 1554 | public static final Key<Integer> CONTROL_SCENE_MODE = |
| 1555 | new Key<Integer>("android.control.sceneMode", int.class); |
| 1556 | |
| 1557 | /** |
| 1558 | * <p>Whether video stabilization is |
| 1559 | * active</p> |
| 1560 | * <p>If enabled, video stabilization can modify the |
| 1561 | * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream |
| 1562 | * stabilized</p> |
| 1563 | * |
| 1564 | * @see CaptureRequest#SCALER_CROP_REGION |
| 1565 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF |
| 1566 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON |
| 1567 | */ |
| 1568 | public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = |
| 1569 | new Key<Integer>("android.control.videoStabilizationMode", int.class); |
| 1570 | |
| 1571 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1572 | * <p>Operation mode for edge |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1573 | * enhancement.</p> |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 1574 | * <p>Edge/sharpness/detail enhancement. OFF means no |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1575 | * enhancement will be applied by the camera device.</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 1576 | * <p>This must be set to one of the modes listed in {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1577 | * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 1578 | * will be applied. HIGH_QUALITY mode indicates that the |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1579 | * camera device will use the highest-quality enhancement algorithms, |
| 1580 | * 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] | 1581 | * not slow down capture rate when applying edge enhancement.</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 1582 | * |
| 1583 | * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1584 | * @see #EDGE_MODE_OFF |
| 1585 | * @see #EDGE_MODE_FAST |
| 1586 | * @see #EDGE_MODE_HIGH_QUALITY |
| 1587 | */ |
| 1588 | public static final Key<Integer> EDGE_MODE = |
| 1589 | new Key<Integer>("android.edge.mode", int.class); |
| 1590 | |
| 1591 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1592 | * <p>The desired mode for for the camera device's flash control.</p> |
| 1593 | * <p>This control is only effective when flash unit is available |
Zhijun He | 153ac10 | 2014-02-03 12:25:12 -0800 | [diff] [blame] | 1594 | * (<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] | 1595 | * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. |
| 1596 | * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, |
| 1597 | * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> |
| 1598 | * <p>When set to OFF, the camera device will not fire flash for this capture.</p> |
| 1599 | * <p>When set to SINGLE, the camera device will fire flash regardless of the camera |
| 1600 | * device's auto-exposure routine's result. When used in still capture case, this |
| 1601 | * control should be used along with AE precapture metering sequence |
| 1602 | * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> |
| 1603 | * <p>When set to TORCH, the flash will be on continuously. This mode can be used |
| 1604 | * 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] | 1605 | * <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] | 1606 | * |
| 1607 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1608 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 1609 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1610 | * @see CaptureResult#FLASH_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1611 | * @see #FLASH_MODE_OFF |
| 1612 | * @see #FLASH_MODE_SINGLE |
| 1613 | * @see #FLASH_MODE_TORCH |
| 1614 | */ |
| 1615 | public static final Key<Integer> FLASH_MODE = |
| 1616 | new Key<Integer>("android.flash.mode", int.class); |
| 1617 | |
| 1618 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1619 | * <p>Current state of the flash |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1620 | * unit.</p> |
| 1621 | * <p>When the camera device doesn't have flash unit |
| 1622 | * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE. |
| 1623 | * Other states indicate the current flash status.</p> |
| 1624 | * |
| 1625 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1626 | * @see #FLASH_STATE_UNAVAILABLE |
| 1627 | * @see #FLASH_STATE_CHARGING |
| 1628 | * @see #FLASH_STATE_READY |
| 1629 | * @see #FLASH_STATE_FIRED |
Zhijun He | 8dda727 | 2014-03-25 13:49:30 -0700 | [diff] [blame] | 1630 | * @see #FLASH_STATE_PARTIAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1631 | */ |
| 1632 | public static final Key<Integer> FLASH_STATE = |
| 1633 | new Key<Integer>("android.flash.state", int.class); |
| 1634 | |
| 1635 | /** |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1636 | * <p>Set operational mode for hot pixel correction.</p> |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 1637 | * <p>Valid modes for this camera device are listed in |
| 1638 | * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p> |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1639 | * <p>Hotpixel correction interpolates out, or otherwise removes, pixels |
| 1640 | * that do not accurately encode the incoming light (i.e. pixels that |
| 1641 | * are stuck at an arbitrary value).</p> |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 1642 | * |
| 1643 | * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1644 | * @see #HOT_PIXEL_MODE_OFF |
| 1645 | * @see #HOT_PIXEL_MODE_FAST |
| 1646 | * @see #HOT_PIXEL_MODE_HIGH_QUALITY |
| 1647 | */ |
| 1648 | public static final Key<Integer> HOT_PIXEL_MODE = |
| 1649 | new Key<Integer>("android.hotPixel.mode", int.class); |
| 1650 | |
| 1651 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1652 | * <p>GPS coordinates to include in output JPEG |
| 1653 | * EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1654 | */ |
| 1655 | public static final Key<double[]> JPEG_GPS_COORDINATES = |
| 1656 | new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); |
| 1657 | |
| 1658 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1659 | * <p>32 characters describing GPS algorithm to |
| 1660 | * include in EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1661 | */ |
| 1662 | public static final Key<String> JPEG_GPS_PROCESSING_METHOD = |
| 1663 | new Key<String>("android.jpeg.gpsProcessingMethod", String.class); |
| 1664 | |
| 1665 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1666 | * <p>Time GPS fix was made to include in |
| 1667 | * EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1668 | */ |
| 1669 | public static final Key<Long> JPEG_GPS_TIMESTAMP = |
| 1670 | new Key<Long>("android.jpeg.gpsTimestamp", long.class); |
| 1671 | |
| 1672 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1673 | * <p>Orientation of JPEG image to |
| 1674 | * write</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1675 | */ |
| 1676 | public static final Key<Integer> JPEG_ORIENTATION = |
| 1677 | new Key<Integer>("android.jpeg.orientation", int.class); |
| 1678 | |
| 1679 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1680 | * <p>Compression quality of the final JPEG |
| 1681 | * image</p> |
| 1682 | * <p>85-95 is typical usage range</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1683 | */ |
| 1684 | public static final Key<Byte> JPEG_QUALITY = |
| 1685 | new Key<Byte>("android.jpeg.quality", byte.class); |
| 1686 | |
| 1687 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1688 | * <p>Compression quality of JPEG |
| 1689 | * thumbnail</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1690 | */ |
| 1691 | public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = |
| 1692 | new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); |
| 1693 | |
| 1694 | /** |
Zhijun He | 5a9ff37 | 2013-12-26 11:49:09 -0800 | [diff] [blame] | 1695 | * <p>Resolution of embedded JPEG thumbnail</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1696 | * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, |
| 1697 | * but the captured JPEG will still be a valid image.</p> |
Zhijun He | 5a9ff37 | 2013-12-26 11:49:09 -0800 | [diff] [blame] | 1698 | * <p>When a jpeg image capture is issued, the thumbnail size selected should have |
| 1699 | * the same aspect ratio as the jpeg image.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1700 | */ |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 1701 | public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = |
| 1702 | new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1703 | |
| 1704 | /** |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1705 | * <p>The ratio of lens focal length to the effective |
| 1706 | * aperture diameter.</p> |
| 1707 | * <p>This will only be supported on the camera devices that |
| 1708 | * have variable aperture lens. The aperture value can only be |
| 1709 | * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p> |
| 1710 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, |
| 1711 | * 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] | 1712 | * {@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] | 1713 | * to achieve manual exposure control.</p> |
| 1714 | * <p>The requested aperture value may take several frames to reach the |
| 1715 | * requested value; the camera device will report the current (intermediate) |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1716 | * aperture size in capture result metadata while the aperture is changing. |
| 1717 | * 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] | 1718 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of |
| 1719 | * the ON modes, this will be overridden by the camera device |
| 1720 | * auto-exposure algorithm, the overridden values are then provided |
| 1721 | * back to the user in the corresponding result.</p> |
| 1722 | * |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1723 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1724 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1725 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1726 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1727 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1728 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1729 | */ |
| 1730 | public static final Key<Float> LENS_APERTURE = |
| 1731 | new Key<Float>("android.lens.aperture", float.class); |
| 1732 | |
| 1733 | /** |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 1734 | * <p>State of lens neutral density filter(s).</p> |
| 1735 | * <p>This will not be supported on most camera devices. On devices |
| 1736 | * where this is supported, this may only be set to one of the |
| 1737 | * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p> |
| 1738 | * <p>Lens filters are typically used to lower the amount of light the |
| 1739 | * sensor is exposed to (measured in steps of EV). As used here, an EV |
| 1740 | * step is the standard logarithmic representation, which are |
| 1741 | * non-negative, and inversely proportional to the amount of light |
| 1742 | * hitting the sensor. For example, setting this to 0 would result |
| 1743 | * in no reduction of the incoming light, and setting this to 2 would |
| 1744 | * mean that the filter is set to reduce incoming light by two stops |
| 1745 | * (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] | 1746 | * <p>It may take several frames before the lens filter density changes |
| 1747 | * to the requested value. While the filter density is still changing, |
| 1748 | * {@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] | 1749 | * |
| 1750 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1751 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1752 | */ |
| 1753 | public static final Key<Float> LENS_FILTER_DENSITY = |
| 1754 | new Key<Float>("android.lens.filterDensity", float.class); |
| 1755 | |
| 1756 | /** |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1757 | * <p>The current lens focal length; used for optical zoom.</p> |
| 1758 | * <p>This setting controls the physical focal length of the camera |
| 1759 | * device's lens. Changing the focal length changes the field of |
| 1760 | * view of the camera device, and is usually used for optical zoom.</p> |
| 1761 | * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this |
| 1762 | * setting won't be applied instantaneously, and it may take several |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1763 | * frames before the lens can change to the requested focal length. |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1764 | * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will |
| 1765 | * be set to MOVING.</p> |
| 1766 | * <p>This is expected not to be supported on most devices.</p> |
| 1767 | * |
| 1768 | * @see CaptureRequest#LENS_APERTURE |
| 1769 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
| 1770 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1771 | */ |
| 1772 | public static final Key<Float> LENS_FOCAL_LENGTH = |
| 1773 | new Key<Float>("android.lens.focalLength", float.class); |
| 1774 | |
| 1775 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1776 | * <p>Distance to plane of sharpest focus, |
| 1777 | * measured from frontmost surface of the lens</p> |
| 1778 | * <p>Should be zero for fixed-focus cameras</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1779 | */ |
| 1780 | public static final Key<Float> LENS_FOCUS_DISTANCE = |
| 1781 | new Key<Float>("android.lens.focusDistance", float.class); |
| 1782 | |
| 1783 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1784 | * <p>The range of scene distances that are in |
| 1785 | * sharp focus (depth of field)</p> |
| 1786 | * <p>If variable focus not supported, can still report |
| 1787 | * fixed depth of field range</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1788 | */ |
Zhijun He | c59b078 | 2013-09-26 10:39:36 -0700 | [diff] [blame] | 1789 | public static final Key<float[]> LENS_FOCUS_RANGE = |
| 1790 | new Key<float[]>("android.lens.focusRange", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1791 | |
| 1792 | /** |
Ruben Brunk | 00849b3 | 2014-01-17 18:30:23 -0800 | [diff] [blame] | 1793 | * <p>Sets whether the camera device uses optical image stabilization (OIS) |
| 1794 | * when capturing images.</p> |
| 1795 | * <p>OIS is used to compensate for motion blur due to small movements of |
| 1796 | * the camera during capture. Unlike digital image stabilization, OIS makes |
| 1797 | * use of mechanical elements to stabilize the camera sensor, and thus |
| 1798 | * allows for longer exposure times before camera shake becomes |
| 1799 | * apparent.</p> |
| 1800 | * <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] | 1801 | * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF |
| 1802 | * @see #LENS_OPTICAL_STABILIZATION_MODE_ON |
| 1803 | */ |
| 1804 | public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = |
| 1805 | new Key<Integer>("android.lens.opticalStabilizationMode", int.class); |
| 1806 | |
| 1807 | /** |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1808 | * <p>Current lens status.</p> |
| 1809 | * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance}, |
| 1810 | * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested, |
| 1811 | * they may take several frames to reach the requested values. This state indicates |
| 1812 | * the current status of the lens parameters.</p> |
| 1813 | * <p>When the state is STATIONARY, the lens parameters are not changing. This could be |
| 1814 | * either because the parameters are all fixed, or because the lens has had enough |
| 1815 | * time to reach the most recently-requested values. |
| 1816 | * If all these lens parameters are not changable for a camera device, as listed below:</p> |
| 1817 | * <ul> |
| 1818 | * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means |
| 1819 | * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li> |
| 1820 | * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value), |
| 1821 | * which means the optical zoom is not supported.</li> |
| 1822 | * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li> |
| 1823 | * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li> |
| 1824 | * </ul> |
| 1825 | * <p>Then this state will always be STATIONARY.</p> |
| 1826 | * <p>When the state is MOVING, it indicates that at least one of the lens parameters |
| 1827 | * is changing.</p> |
| 1828 | * |
| 1829 | * @see CaptureRequest#LENS_APERTURE |
| 1830 | * @see CaptureRequest#LENS_FILTER_DENSITY |
| 1831 | * @see CaptureRequest#LENS_FOCAL_LENGTH |
| 1832 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
| 1833 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
| 1834 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
| 1835 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS |
| 1836 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1837 | * @see #LENS_STATE_STATIONARY |
Igor Murashkin | 9ea4ae6 | 2013-09-11 21:40:11 -0700 | [diff] [blame] | 1838 | * @see #LENS_STATE_MOVING |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1839 | */ |
| 1840 | public static final Key<Integer> LENS_STATE = |
| 1841 | new Key<Integer>("android.lens.state", int.class); |
| 1842 | |
| 1843 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1844 | * <p>Mode of operation for the noise reduction |
| 1845 | * algorithm</p> |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 1846 | * <p>Noise filtering control. OFF means no noise reduction |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1847 | * will be applied by the camera device.</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 1848 | * <p>This must be set to a valid mode in |
| 1849 | * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1850 | * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering |
| 1851 | * will be applied. HIGH_QUALITY mode indicates that the camera device |
| 1852 | * will use the highest-quality noise filtering algorithms, |
| 1853 | * 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] | 1854 | * slow down capture rate when applying noise filtering.</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 1855 | * |
| 1856 | * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1857 | * @see #NOISE_REDUCTION_MODE_OFF |
| 1858 | * @see #NOISE_REDUCTION_MODE_FAST |
| 1859 | * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY |
| 1860 | */ |
| 1861 | public static final Key<Integer> NOISE_REDUCTION_MODE = |
| 1862 | new Key<Integer>("android.noiseReduction.mode", int.class); |
| 1863 | |
| 1864 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1865 | * <p>Whether a result given to the framework is the |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 1866 | * final one for the capture, or only a partial that contains a |
| 1867 | * subset of the full set of dynamic metadata |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1868 | * values.</p> |
| 1869 | * <p>The entries in the result metadata buffers for a |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 1870 | * single capture may not overlap, except for this entry. The |
| 1871 | * FINAL buffers must retain FIFO ordering relative to the |
| 1872 | * requests that generate them, so the FINAL buffer for frame 3 must |
| 1873 | * always be sent to the framework after the FINAL buffer for frame 2, and |
| 1874 | * before the FINAL buffer for frame 4. PARTIAL buffers may be returned |
| 1875 | * in any order relative to other frames, but all PARTIAL buffers for a given |
| 1876 | * capture must arrive before the FINAL buffer for that capture. This entry may |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1877 | * only be used by the camera device if quirks.usePartialResult is set to 1.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1878 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 1879 | * @deprecated |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 1880 | * @hide |
| 1881 | */ |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 1882 | @Deprecated |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 1883 | public static final Key<Boolean> QUIRKS_PARTIAL_RESULT = |
| 1884 | new Key<Boolean>("android.quirks.partialResult", boolean.class); |
| 1885 | |
| 1886 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1887 | * <p>A frame counter set by the framework. This value monotonically |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 1888 | * 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] | 1889 | * frameCount value).</p> |
| 1890 | * <p>Reset on release()</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1891 | */ |
| 1892 | public static final Key<Integer> REQUEST_FRAME_COUNT = |
| 1893 | new Key<Integer>("android.request.frameCount", int.class); |
| 1894 | |
| 1895 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1896 | * <p>An application-specified ID for the current |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1897 | * request. Must be maintained unchanged in output |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1898 | * frame</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1899 | * @hide |
| 1900 | */ |
| 1901 | public static final Key<Integer> REQUEST_ID = |
| 1902 | new Key<Integer>("android.request.id", int.class); |
| 1903 | |
| 1904 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 1905 | * <p>Specifies the number of pipeline stages the frame went |
| 1906 | * through from when it was exposed to when the final completed result |
| 1907 | * was available to the framework.</p> |
| 1908 | * <p>Depending on what settings are used in the request, and |
| 1909 | * what streams are configured, the data may undergo less processing, |
| 1910 | * and some pipeline stages skipped.</p> |
| 1911 | * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p> |
| 1912 | * |
| 1913 | * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH |
| 1914 | */ |
| 1915 | public static final Key<Byte> REQUEST_PIPELINE_DEPTH = |
| 1916 | new Key<Byte>("android.request.pipelineDepth", byte.class); |
| 1917 | |
| 1918 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1919 | * <p>(x, y, width, height).</p> |
| 1920 | * <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] | 1921 | * (width, height). The region of the sensor that is used for |
| 1922 | * output. Each stream must use this rectangle to produce its |
| 1923 | * output, cropping to a smaller region if necessary to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1924 | * maintain the stream's aspect ratio.</p> |
| 1925 | * <p>HAL2.x uses only (x, y, width)</p> |
Zhijun He | 9e6d188 | 2014-05-22 16:47:35 -0700 | [diff] [blame] | 1926 | * <p>The crop region is applied after the RAW to other color space (e.g. YUV) |
| 1927 | * conversion. Since raw streams (e.g. RAW16) don't have the conversion stage, |
| 1928 | * it is not croppable. The crop region will be ignored by raw streams.</p> |
| 1929 | * <p>For non-raw streams, any additional per-stream cropping will |
| 1930 | * be done to maximize the final pixel area of the stream.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1931 | * <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] | 1932 | * ratio, then 4:3 streams should use the exact crop |
| 1933 | * region. 16:9 streams should further crop vertically |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1934 | * (letterbox).</p> |
| 1935 | * <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] | 1936 | * outputs should crop horizontally (pillarbox), and 16:9 |
| 1937 | * streams should match exactly. These additional crops must |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1938 | * be centered within the crop region.</p> |
| 1939 | * <p>The output streams must maintain square pixels at all |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1940 | * times, no matter what the relative aspect ratios of the |
| 1941 | * crop region and the stream are. Negative values for |
| 1942 | * corner are allowed for raw output if full pixel array is |
| 1943 | * larger than active pixel array. Width and height may be |
| 1944 | * rounded to nearest larger supportable width, especially |
| 1945 | * for raw output, where only a few fixed scales may be |
| 1946 | * possible. The width and height of the crop region cannot |
| 1947 | * be set to be smaller than floor( activeArraySize.width / |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1948 | * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} ) and floor( |
| 1949 | * activeArraySize.height / |
| 1950 | * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom}), respectively.</p> |
| 1951 | * |
| 1952 | * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1953 | */ |
| 1954 | public static final Key<android.graphics.Rect> SCALER_CROP_REGION = |
| 1955 | new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); |
| 1956 | |
| 1957 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1958 | * <p>Duration each pixel is exposed to |
| 1959 | * light.</p> |
| 1960 | * <p>If the sensor can't expose this exact duration, it should shorten the |
| 1961 | * duration exposed to the nearest possible value (rather than expose longer).</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1962 | */ |
| 1963 | public static final Key<Long> SENSOR_EXPOSURE_TIME = |
| 1964 | new Key<Long>("android.sensor.exposureTime", long.class); |
| 1965 | |
| 1966 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1967 | * <p>Duration from start of frame exposure to |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1968 | * start of next frame exposure.</p> |
| 1969 | * <p>The maximum frame rate that can be supported by a camera subsystem is |
| 1970 | * a function of many factors:</p> |
| 1971 | * <ul> |
| 1972 | * <li>Requested resolutions of output image streams</li> |
| 1973 | * <li>Availability of binning / skipping modes on the imager</li> |
| 1974 | * <li>The bandwidth of the imager interface</li> |
| 1975 | * <li>The bandwidth of the various ISP processing blocks</li> |
| 1976 | * </ul> |
| 1977 | * <p>Since these factors can vary greatly between different ISPs and |
| 1978 | * sensors, the camera abstraction tries to represent the bandwidth |
| 1979 | * restrictions with as simple a model as possible.</p> |
| 1980 | * <p>The model presented has the following characteristics:</p> |
| 1981 | * <ul> |
| 1982 | * <li>The image sensor is always configured to output the smallest |
| 1983 | * resolution possible given the application's requested output stream |
| 1984 | * sizes. The smallest resolution is defined as being at least as large |
| 1985 | * as the largest requested output stream size; the camera pipeline must |
| 1986 | * never digitally upsample sensor data when the crop region covers the |
| 1987 | * whole sensor. In general, this means that if only small output stream |
| 1988 | * resolutions are configured, the sensor can provide a higher frame |
| 1989 | * rate.</li> |
| 1990 | * <li>Since any request may use any or all the currently configured |
| 1991 | * output streams, the sensor and ISP must be configured to support |
| 1992 | * scaling a single capture to all the streams at the same time. This |
| 1993 | * means the camera pipeline must be ready to produce the largest |
| 1994 | * requested output size without any delay. Therefore, the overall |
| 1995 | * frame rate of a given configured stream set is governed only by the |
| 1996 | * largest requested stream resolution.</li> |
| 1997 | * <li>Using more than one output stream in a request does not affect the |
| 1998 | * frame duration.</li> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1999 | * <li>Certain format-streams may need to do additional background processing |
| 2000 | * before data is consumed/produced by that stream. These processors |
| 2001 | * can run concurrently to the rest of the camera pipeline, but |
| 2002 | * cannot process more than 1 capture at a time.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2003 | * </ul> |
| 2004 | * <p>The necessary information for the application, given the model above, |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2005 | * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field |
| 2006 | * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size). |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2007 | * These are used to determine the maximum frame rate / minimum frame |
| 2008 | * duration that is possible for a given stream configuration.</p> |
| 2009 | * <p>Specifically, the application can use the following rules to |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2010 | * determine the minimum frame duration it can request from the camera |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2011 | * device:</p> |
| 2012 | * <ol> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2013 | * <li>Let the set of currently configured input/output streams |
| 2014 | * be called <code>S</code>.</li> |
| 2015 | * <li>Find the minimum frame durations for each stream in <code>S</code>, by |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2016 | * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using |
| 2017 | * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2018 | * its respective size/format). Let this set of frame durations be called |
| 2019 | * <code>F</code>.</li> |
| 2020 | * <li>For any given request <code>R</code>, the minimum frame duration allowed |
| 2021 | * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams |
| 2022 | * used in <code>R</code> be called <code>S_r</code>.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2023 | * </ol> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2024 | * <p>If none of the streams in <code>S_r</code> have a stall time (listed in |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2025 | * StreamConfigurationMap#getOutputStallDuration(int,Size) using its |
| 2026 | * respective size/format), then the frame duration in |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2027 | * <code>F</code> determines the steady state frame rate that the application will |
| 2028 | * get if it uses <code>R</code> as a repeating request. Let this special kind |
| 2029 | * of request be called <code>Rsimple</code>.</p> |
| 2030 | * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved |
| 2031 | * by a single capture of a new request <code>Rstall</code> (which has at least |
| 2032 | * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the |
| 2033 | * same minimum frame duration this will not cause a frame rate loss |
| 2034 | * if all buffers from the previous <code>Rstall</code> have already been |
| 2035 | * delivered.</p> |
| 2036 | * <p>For more details about stalling, see |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2037 | * StreamConfigurationMap#getOutputStallDuration(int,Size).</p> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2038 | * |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2039 | * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2040 | */ |
| 2041 | public static final Key<Long> SENSOR_FRAME_DURATION = |
| 2042 | new Key<Long>("android.sensor.frameDuration", long.class); |
| 2043 | |
| 2044 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2045 | * <p>Gain applied to image data. Must be |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2046 | * implemented through analog gain only if set to values |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2047 | * below 'maximum analog sensitivity'.</p> |
| 2048 | * <p>If the sensor can't apply this exact gain, it should lessen the |
| 2049 | * gain to the nearest possible value (rather than gain more).</p> |
| 2050 | * <p>ISO 12232:2006 REI method</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2051 | */ |
| 2052 | public static final Key<Integer> SENSOR_SENSITIVITY = |
| 2053 | new Key<Integer>("android.sensor.sensitivity", int.class); |
| 2054 | |
| 2055 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2056 | * <p>Time at start of exposure of first |
| 2057 | * row</p> |
| 2058 | * <p>Monotonic, should be synced to other timestamps in |
| 2059 | * system</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2060 | */ |
| 2061 | public static final Key<Long> SENSOR_TIMESTAMP = |
| 2062 | new Key<Long>("android.sensor.timestamp", long.class); |
| 2063 | |
| 2064 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2065 | * <p>The temperature of the sensor, sampled at the time |
| 2066 | * exposure began for this frame.</p> |
| 2067 | * <p>The thermal diode being queried should be inside the sensor PCB, or |
| 2068 | * somewhere close to it.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 2069 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2070 | * <p><b>Full capability</b> - |
| 2071 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2072 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2073 | * |
| 2074 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | d5ff06a | 2013-08-20 15:15:06 -0700 | [diff] [blame] | 2075 | */ |
| 2076 | public static final Key<Float> SENSOR_TEMPERATURE = |
| 2077 | new Key<Float>("android.sensor.temperature", float.class); |
| 2078 | |
| 2079 | /** |
Ruben Brunk | 7c06236 | 2014-04-15 23:53:53 -0700 | [diff] [blame] | 2080 | * <p>The estimated camera neutral color in the native sensor colorspace at |
| 2081 | * the time of capture.</p> |
| 2082 | * <p>This value gives the neutral color point encoded as an RGB value in the |
| 2083 | * native sensor color space. The neutral color point indicates the |
| 2084 | * currently estimated white point of the scene illumination. It can be |
| 2085 | * used to interpolate between the provided color transforms when |
| 2086 | * processing raw sensor data.</p> |
| 2087 | * <p>The order of the values is R, G, B; where R is in the lowest index.</p> |
Ruben Brunk | 20c76f6 | 2014-02-07 15:47:10 -0800 | [diff] [blame] | 2088 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2089 | */ |
| 2090 | public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT = |
| 2091 | new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class); |
| 2092 | |
| 2093 | /** |
Ruben Brunk | 987d9f7 | 2014-02-11 18:00:24 -0800 | [diff] [blame] | 2094 | * <p>The worst-case divergence between Bayer green channels.</p> |
| 2095 | * <p>This value is an estimate of the worst case split between the |
| 2096 | * Bayer green channels in the red and blue rows in the sensor color |
| 2097 | * filter array.</p> |
| 2098 | * <p>The green split is calculated as follows:</p> |
| 2099 | * <ol> |
Ruben Brunk | e89b120 | 2014-03-24 17:10:35 -0700 | [diff] [blame] | 2100 | * <li>A 5x5 pixel (or larger) window W within the active sensor array is |
| 2101 | * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer |
| 2102 | * mosaic channels (R, Gr, Gb, B). The location and size of the window |
| 2103 | * chosen is implementation defined, and should be chosen to provide a |
| 2104 | * green split estimate that is both representative of the entire image |
| 2105 | * for this camera sensor, and can be calculated quickly.</li> |
Ruben Brunk | 987d9f7 | 2014-02-11 18:00:24 -0800 | [diff] [blame] | 2106 | * <li>The arithmetic mean of the green channels from the red |
| 2107 | * rows (mean_Gr) within W is computed.</li> |
| 2108 | * <li>The arithmetic mean of the green channels from the blue |
| 2109 | * rows (mean_Gb) within W is computed.</li> |
| 2110 | * <li>The maximum ratio R of the two means is computed as follows: |
| 2111 | * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li> |
| 2112 | * </ol> |
| 2113 | * <p>The ratio R is the green split divergence reported for this property, |
| 2114 | * which represents how much the green channels differ in the mosaic |
| 2115 | * pattern. This value is typically used to determine the treatment of |
| 2116 | * the green mosaic channels when demosaicing.</p> |
| 2117 | * <p>The green split value can be roughly interpreted as follows:</p> |
| 2118 | * <ul> |
| 2119 | * <li>R < 1.03 is a negligible split (<3% divergence).</li> |
| 2120 | * <li>1.20 <= R >= 1.03 will require some software |
| 2121 | * correction to avoid demosaic errors (3-20% divergence).</li> |
| 2122 | * <li>R > 1.20 will require strong software correction to produce |
| 2123 | * a usuable image (>20% divergence).</li> |
| 2124 | * </ul> |
| 2125 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2126 | */ |
| 2127 | public static final Key<Float> SENSOR_GREEN_SPLIT = |
| 2128 | new Key<Float>("android.sensor.greenSplit", float.class); |
| 2129 | |
| 2130 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2131 | * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern |
| 2132 | * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> |
| 2133 | * <p>Each color channel is treated as an unsigned 32-bit integer. |
| 2134 | * The camera device then uses the most significant X bits |
| 2135 | * that correspond to how many bits are in its Bayer raw sensor |
| 2136 | * output.</p> |
| 2137 | * <p>For example, a sensor with RAW10 Bayer output would use the |
| 2138 | * 10 most significant bits from each color channel.</p> |
| 2139 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2140 | * |
| 2141 | * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE |
| 2142 | */ |
| 2143 | public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = |
| 2144 | new Key<int[]>("android.sensor.testPatternData", int[].class); |
| 2145 | |
| 2146 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2147 | * <p>When enabled, the sensor sends a test pattern instead of |
| 2148 | * doing a real exposure from the camera.</p> |
| 2149 | * <p>When a test pattern is enabled, all manual sensor controls specified |
| 2150 | * by android.sensor.* should be ignored. All other controls should |
| 2151 | * work as normal.</p> |
| 2152 | * <p>For example, if manual flash is enabled, flash firing should still |
| 2153 | * occur (and that the test pattern remain unmodified, since the flash |
| 2154 | * would not actually affect it).</p> |
| 2155 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2156 | * @see #SENSOR_TEST_PATTERN_MODE_OFF |
| 2157 | * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR |
| 2158 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS |
| 2159 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY |
| 2160 | * @see #SENSOR_TEST_PATTERN_MODE_PN9 |
| 2161 | * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 |
| 2162 | */ |
| 2163 | public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = |
| 2164 | new Key<Integer>("android.sensor.testPatternMode", int.class); |
| 2165 | |
| 2166 | /** |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2167 | * <p>Quality of lens shading correction applied |
| 2168 | * to the image data.</p> |
| 2169 | * <p>When set to OFF mode, no lens shading correction will be applied by the |
| 2170 | * camera device, and an identity lens shading map data will be provided |
| 2171 | * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens |
| 2172 | * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>, |
| 2173 | * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map |
| 2174 | * shown below:</p> |
| 2175 | * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2176 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2177 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2178 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2179 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2180 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] |
| 2181 | * </code></pre> |
| 2182 | * <p>When set to other modes, lens shading correction will be applied by the |
| 2183 | * camera device. Applications can request lens shading map data by setting |
| 2184 | * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide |
| 2185 | * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 2186 | * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}; the returned shading map data will be the one |
| 2187 | * applied by the camera device for this capture request.</p> |
| 2188 | * <p>The shading map data may depend on the AE and AWB statistics, therefore the reliability |
| 2189 | * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in |
| 2190 | * AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code> OFF), |
| 2191 | * to get best results, it is recommended that the applications wait for the AE and AWB to |
| 2192 | * be converged before using the returned shading map data.</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2193 | * |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 2194 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2195 | * @see CaptureRequest#CONTROL_AWB_MODE |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2196 | * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE |
| 2197 | * @see CaptureResult#STATISTICS_LENS_SHADING_MAP |
| 2198 | * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE |
| 2199 | * @see #SHADING_MODE_OFF |
| 2200 | * @see #SHADING_MODE_FAST |
| 2201 | * @see #SHADING_MODE_HIGH_QUALITY |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2202 | */ |
| 2203 | public static final Key<Integer> SHADING_MODE = |
| 2204 | new Key<Integer>("android.shading.mode", int.class); |
| 2205 | |
| 2206 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2207 | * <p>State of the face detector |
| 2208 | * unit</p> |
| 2209 | * <p>Whether face detection is enabled, and whether it |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2210 | * should output just the basic fields or the full set of |
| 2211 | * fields. Value must be one of the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2212 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p> |
| 2213 | * |
| 2214 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2215 | * @see #STATISTICS_FACE_DETECT_MODE_OFF |
| 2216 | * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE |
| 2217 | * @see #STATISTICS_FACE_DETECT_MODE_FULL |
| 2218 | */ |
| 2219 | public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = |
| 2220 | new Key<Integer>("android.statistics.faceDetectMode", int.class); |
| 2221 | |
| 2222 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2223 | * <p>List of unique IDs for detected |
| 2224 | * faces</p> |
| 2225 | * <p>Only available if faceDetectMode == FULL</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 2226 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2227 | */ |
| 2228 | public static final Key<int[]> STATISTICS_FACE_IDS = |
| 2229 | new Key<int[]>("android.statistics.faceIds", int[].class); |
| 2230 | |
| 2231 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2232 | * <p>List of landmarks for detected |
| 2233 | * faces</p> |
| 2234 | * <p>Only available if faceDetectMode == FULL</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 2235 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2236 | */ |
| 2237 | public static final Key<int[]> STATISTICS_FACE_LANDMARKS = |
| 2238 | new Key<int[]>("android.statistics.faceLandmarks", int[].class); |
| 2239 | |
| 2240 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2241 | * <p>List of the bounding rectangles for detected |
| 2242 | * faces</p> |
| 2243 | * <p>Only available if faceDetectMode != OFF</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 2244 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2245 | */ |
| 2246 | public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES = |
| 2247 | new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class); |
| 2248 | |
| 2249 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2250 | * <p>List of the face confidence scores for |
| 2251 | * detected faces</p> |
| 2252 | * <p>Only available if faceDetectMode != OFF. The value should be |
| 2253 | * meaningful (for example, setting 100 at all times is illegal).</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 2254 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2255 | */ |
| 2256 | public static final Key<byte[]> STATISTICS_FACE_SCORES = |
| 2257 | new Key<byte[]>("android.statistics.faceScores", byte[].class); |
| 2258 | |
| 2259 | /** |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 2260 | * <p>List of the faces detected through camera face detection |
| 2261 | * in this result.</p> |
| 2262 | * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p> |
| 2263 | * |
| 2264 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
| 2265 | */ |
| 2266 | public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES = |
| 2267 | new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class); |
| 2268 | |
| 2269 | /** |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 2270 | * <p>The shading map is a low-resolution floating-point map |
| 2271 | * that lists the coefficients used to correct for vignetting, for each |
| 2272 | * Bayer color channel.</p> |
| 2273 | * <p>The least shaded section of the image should have a gain factor |
| 2274 | * of 1; all other sections should have gains above 1.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2275 | * <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] | 2276 | * must take into account the colorCorrection settings.</p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 2277 | * <p>The shading map is for the entire active pixel array, and is not |
| 2278 | * affected by the crop region specified in the request. Each shading map |
| 2279 | * entry is the value of the shading compensation map over a specific |
| 2280 | * pixel on the sensor. Specifically, with a (N x M) resolution shading |
| 2281 | * map, and an active pixel array size (W x H), shading map entry |
| 2282 | * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at |
| 2283 | * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. |
| 2284 | * The map is assumed to be bilinearly interpolated between the sample points.</p> |
| 2285 | * <p>The channel order is [R, Geven, Godd, B], where Geven is the green |
| 2286 | * channel for the even rows of a Bayer pattern, and Godd is the odd rows. |
| 2287 | * 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] | 2288 | * 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] | 2289 | * <p>The shading map should have on the order of 30-40 rows and columns, |
| 2290 | * and must be smaller than 64x64.</p> |
| 2291 | * <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] | 2292 | * <pre><code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ] |
| 2293 | * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} = |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 2294 | * [ 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] | 2295 | * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, |
| 2296 | * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, |
| 2297 | * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, |
| 2298 | * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, |
| 2299 | * 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] | 2300 | * </code></pre> |
| 2301 | * <p>The low-resolution scaling map images for each channel are |
| 2302 | * (displayed using nearest-neighbor interpolation):</p> |
| 2303 | * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> |
| 2304 | * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> |
| 2305 | * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> |
| 2306 | * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> |
| 2307 | * <p>As a visualization only, inverting the full-color map to recover an |
| 2308 | * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p> |
| 2309 | * <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] | 2310 | * |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2311 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2312 | * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 2313 | * @see CaptureResult#STATISTICS_LENS_SHADING_MAP |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2314 | */ |
| 2315 | public static final Key<float[]> STATISTICS_LENS_SHADING_MAP = |
| 2316 | new Key<float[]>("android.statistics.lensShadingMap", float[].class); |
| 2317 | |
| 2318 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2319 | * <p>The best-fit color channel gains calculated |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 2320 | * by the camera device's statistics units for the current output frame.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2321 | * <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] | 2322 | * since statistics processing on data from a new frame |
| 2323 | * typically completes after the transform has already been |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2324 | * applied to that frame.</p> |
| 2325 | * <p>The 4 channel gains are defined in Bayer domain, |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2326 | * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2327 | * <p>This value should always be calculated by the AWB block, |
| 2328 | * regardless of the android.control.* current values.</p> |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 2329 | * <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] | 2330 | * |
| 2331 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2332 | * @deprecated |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 2333 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2334 | */ |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2335 | @Deprecated |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2336 | public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS = |
| 2337 | new Key<float[]>("android.statistics.predictedColorGains", float[].class); |
| 2338 | |
| 2339 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2340 | * <p>The best-fit color transform matrix estimate |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 2341 | * calculated by the camera device's statistics units for the current |
| 2342 | * output frame.</p> |
| 2343 | * <p>The camera device will provide the estimate from its |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2344 | * statistics unit on the white balance transforms to use |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 2345 | * for the next frame. These are the values the camera device believes |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2346 | * are the best fit for the current output frame. This may |
| 2347 | * be different than the transform used for this frame, since |
| 2348 | * statistics processing on data from a new frame typically |
| 2349 | * completes after the transform has already been applied to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2350 | * that frame.</p> |
| 2351 | * <p>These estimates must be provided for all frames, even if |
| 2352 | * capture settings and color transforms are set by the application.</p> |
| 2353 | * <p>This value should always be calculated by the AWB block, |
| 2354 | * regardless of the android.control.* current values.</p> |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 2355 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2356 | * @deprecated |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 2357 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2358 | */ |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2359 | @Deprecated |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2360 | public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM = |
| 2361 | new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class); |
| 2362 | |
| 2363 | /** |
Zhijun He | 208fb6c | 2014-02-03 13:09:06 -0800 | [diff] [blame] | 2364 | * <p>The camera device estimated scene illumination lighting |
| 2365 | * frequency.</p> |
| 2366 | * <p>Many light sources, such as most fluorescent lights, flicker at a rate |
| 2367 | * that depends on the local utility power standards. This flicker must be |
| 2368 | * accounted for by auto-exposure routines to avoid artifacts in captured images. |
| 2369 | * The camera device uses this entry to tell the application what the scene |
| 2370 | * illuminant frequency is.</p> |
| 2371 | * <p>When manual exposure control is enabled |
| 2372 | * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == OFF</code>), |
| 2373 | * the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't do the antibanding, and the |
| 2374 | * 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] | 2375 | * 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] | 2376 | * for more details.</p> |
| 2377 | * <p>Report NONE if there doesn't appear to be flickering illumination.</p> |
| 2378 | * |
| 2379 | * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE |
| 2380 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2381 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2382 | * @see #STATISTICS_SCENE_FLICKER_NONE |
| 2383 | * @see #STATISTICS_SCENE_FLICKER_50HZ |
| 2384 | * @see #STATISTICS_SCENE_FLICKER_60HZ |
| 2385 | */ |
| 2386 | public static final Key<Integer> STATISTICS_SCENE_FLICKER = |
| 2387 | new Key<Integer>("android.statistics.sceneFlicker", int.class); |
| 2388 | |
| 2389 | /** |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 2390 | * <p>Operating mode for hotpixel map generation.</p> |
| 2391 | * <p>If set to ON, a hotpixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}. |
| 2392 | * If set to OFF, no hotpixel map should be returned.</p> |
| 2393 | * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p> |
| 2394 | * |
| 2395 | * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP |
| 2396 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES |
| 2397 | */ |
| 2398 | public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = |
| 2399 | new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); |
| 2400 | |
| 2401 | /** |
| 2402 | * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p> |
| 2403 | * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and |
| 2404 | * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and |
| 2405 | * bottom-right of the pixel array, respectively. The width and |
| 2406 | * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}. |
| 2407 | * This may include hot pixels that lie outside of the active array |
| 2408 | * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> |
| 2409 | * |
| 2410 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
| 2411 | * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE |
| 2412 | */ |
| 2413 | public static final Key<int[]> STATISTICS_HOT_PIXEL_MAP = |
| 2414 | new Key<int[]>("android.statistics.hotPixelMap", int[].class); |
| 2415 | |
| 2416 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2417 | * <p>Whether the camera device will output the lens |
| 2418 | * shading map in output result metadata.</p> |
| 2419 | * <p>When set to ON, |
| 2420 | * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} must be provided in |
| 2421 | * the output result metadata.</p> |
| 2422 | * |
| 2423 | * @see CaptureResult#STATISTICS_LENS_SHADING_MAP |
| 2424 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF |
| 2425 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON |
| 2426 | */ |
| 2427 | public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = |
| 2428 | new Key<Integer>("android.statistics.lensShadingMapMode", int.class); |
| 2429 | |
| 2430 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2431 | * <p>Tonemapping / contrast / gamma curve for the blue |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2432 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2433 | * CONTRAST_CURVE.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2434 | * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> |
| 2435 | * |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 2436 | * @see CaptureRequest#TONEMAP_CURVE_RED |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2437 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2438 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 2439 | public static final Key<float[]> TONEMAP_CURVE_BLUE = |
| 2440 | new Key<float[]>("android.tonemap.curveBlue", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2441 | |
| 2442 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2443 | * <p>Tonemapping / contrast / gamma curve for the green |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2444 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2445 | * CONTRAST_CURVE.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2446 | * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> |
| 2447 | * |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 2448 | * @see CaptureRequest#TONEMAP_CURVE_RED |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2449 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2450 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 2451 | public static final Key<float[]> TONEMAP_CURVE_GREEN = |
| 2452 | new Key<float[]>("android.tonemap.curveGreen", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2453 | |
| 2454 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2455 | * <p>Tonemapping / contrast / gamma curve for the red |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2456 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2457 | * CONTRAST_CURVE.</p> |
| 2458 | * <p>Each channel's curve is defined by an array of control points:</p> |
| 2459 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = |
| 2460 | * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] |
Zhijun He | 870922b | 2014-02-15 21:47:51 -0800 | [diff] [blame] | 2461 | * 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] | 2462 | * <p>These are sorted in order of increasing <code>Pin</code>; it is always |
| 2463 | * guaranteed that input values 0.0 and 1.0 are included in the list to |
| 2464 | * define a complete mapping. For input values between control points, |
| 2465 | * the camera device must linearly interpolate between the control |
| 2466 | * points.</p> |
| 2467 | * <p>Each curve can have an independent number of points, and the number |
| 2468 | * of points can be less than max (that is, the request doesn't have to |
| 2469 | * always provide a curve with number of points equivalent to |
| 2470 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
| 2471 | * <p>A few examples, and their corresponding graphical mappings; these |
| 2472 | * only specify the red channel and the precision is limited to 4 |
| 2473 | * digits, for conciseness.</p> |
| 2474 | * <p>Linear mapping:</p> |
| 2475 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 0, 1.0, 1.0 ] |
| 2476 | * </code></pre> |
| 2477 | * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
| 2478 | * <p>Invert mapping:</p> |
| 2479 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 1.0, 1.0, 0 ] |
| 2480 | * </code></pre> |
| 2481 | * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
| 2482 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
| 2483 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ |
| 2484 | * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, |
| 2485 | * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, |
| 2486 | * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, |
| 2487 | * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ] |
| 2488 | * </code></pre> |
| 2489 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
| 2490 | * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> |
| 2491 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ |
| 2492 | * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, |
| 2493 | * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, |
| 2494 | * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, |
| 2495 | * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ] |
| 2496 | * </code></pre> |
| 2497 | * <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] | 2498 | * |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2499 | * @see CaptureRequest#TONEMAP_CURVE_RED |
| 2500 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2501 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2502 | */ |
| 2503 | public static final Key<float[]> TONEMAP_CURVE_RED = |
| 2504 | new Key<float[]>("android.tonemap.curveRed", float[].class); |
| 2505 | |
| 2506 | /** |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2507 | * <p>High-level global contrast/gamma/tonemapping control.</p> |
| 2508 | * <p>When switching to an application-defined contrast curve by setting |
| 2509 | * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined |
| 2510 | * per-channel with a set of <code>(in, out)</code> points that specify the |
| 2511 | * mapping from input high-bit-depth pixel value to the output |
| 2512 | * low-bit-depth value. Since the actual pixel ranges of both input |
| 2513 | * and output may change depending on the camera pipeline, the values |
| 2514 | * are specified by normalized floating-point numbers.</p> |
| 2515 | * <p>More-complex color mapping operations such as 3D color look-up |
| 2516 | * tables, selective chroma enhancement, or other non-linear color |
| 2517 | * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2518 | * CONTRAST_CURVE.</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2519 | * <p>This must be set to a valid mode in |
| 2520 | * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p> |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2521 | * <p>When using either FAST or HIGH_QUALITY, the camera device will |
| 2522 | * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed}, |
| 2523 | * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, and {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}. |
| 2524 | * These values are always available, and as close as possible to the |
| 2525 | * actually used nonlinear/nonglobal transforms.</p> |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 2526 | * <p>If a request is sent with CONTRAST_CURVE with the camera device's |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2527 | * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be |
| 2528 | * roughly the same.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 2529 | * |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2530 | * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2531 | * @see CaptureRequest#TONEMAP_CURVE_BLUE |
| 2532 | * @see CaptureRequest#TONEMAP_CURVE_GREEN |
| 2533 | * @see CaptureRequest#TONEMAP_CURVE_RED |
| 2534 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2535 | * @see #TONEMAP_MODE_CONTRAST_CURVE |
| 2536 | * @see #TONEMAP_MODE_FAST |
| 2537 | * @see #TONEMAP_MODE_HIGH_QUALITY |
| 2538 | */ |
| 2539 | public static final Key<Integer> TONEMAP_MODE = |
| 2540 | new Key<Integer>("android.tonemap.mode", int.class); |
| 2541 | |
| 2542 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2543 | * <p>This LED is nominally used to indicate to the user |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2544 | * that the camera is powered on and may be streaming images back to the |
| 2545 | * Application Processor. In certain rare circumstances, the OS may |
| 2546 | * disable this when video is processed locally and not transmitted to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2547 | * any untrusted applications.</p> |
| 2548 | * <p>In particular, the LED <em>must</em> always be on when the data could be |
| 2549 | * transmitted off the device. The LED <em>should</em> always be on whenever |
| 2550 | * data is stored locally on the device.</p> |
| 2551 | * <p>The LED <em>may</em> be off if a trusted application is using the data that |
| 2552 | * doesn't violate the above rules.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2553 | * @hide |
| 2554 | */ |
| 2555 | public static final Key<Boolean> LED_TRANSMIT = |
| 2556 | new Key<Boolean>("android.led.transmit", boolean.class); |
| 2557 | |
| 2558 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2559 | * <p>Whether black-level compensation is locked |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2560 | * to its current values, or is free to vary.</p> |
| 2561 | * <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] | 2562 | * 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] | 2563 | * a change in other capture settings forced the camera device to |
| 2564 | * perform a black level reset.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2565 | * |
| 2566 | * @see CaptureRequest#BLACK_LEVEL_LOCK |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2567 | */ |
| 2568 | public static final Key<Boolean> BLACK_LEVEL_LOCK = |
| 2569 | new Key<Boolean>("android.blackLevel.lock", boolean.class); |
| 2570 | |
Igor Murashkin | 3865a84 | 2014-01-17 18:18:39 -0800 | [diff] [blame] | 2571 | /** |
| 2572 | * <p>The frame number corresponding to the last request |
| 2573 | * with which the output result (metadata + buffers) has been fully |
| 2574 | * synchronized.</p> |
| 2575 | * <p>When a request is submitted to the camera device, there is usually a |
| 2576 | * delay of several frames before the controls get applied. A camera |
| 2577 | * device may either choose to account for this delay by implementing a |
| 2578 | * pipeline and carefully submit well-timed atomic control updates, or |
| 2579 | * it may start streaming control changes that span over several frame |
| 2580 | * boundaries.</p> |
| 2581 | * <p>In the latter case, whenever a request's settings change relative to |
| 2582 | * the previous submitted request, the full set of changes may take |
| 2583 | * multiple frame durations to fully take effect. Some settings may |
| 2584 | * take effect sooner (in less frame durations) than others.</p> |
| 2585 | * <p>While a set of control changes are being propagated, this value |
| 2586 | * will be CONVERGING.</p> |
| 2587 | * <p>Once it is fully known that a set of control changes have been |
| 2588 | * finished propagating, and the resulting updated control settings |
| 2589 | * have been read back by the camera device, this value will be set |
| 2590 | * to a non-negative frame number (corresponding to the request to |
| 2591 | * which the results have synchronized to).</p> |
| 2592 | * <p>Older camera device implementations may not have a way to detect |
| 2593 | * when all camera controls have been applied, and will always set this |
| 2594 | * value to UNKNOWN.</p> |
| 2595 | * <p>FULL capability devices will always have this value set to the |
| 2596 | * frame number of the request corresponding to this result.</p> |
| 2597 | * <p><em>Further details</em>:</p> |
| 2598 | * <ul> |
| 2599 | * <li>Whenever a request differs from the last request, any future |
| 2600 | * results not yet returned may have this value set to CONVERGING (this |
| 2601 | * could include any in-progress captures not yet returned by the camera |
| 2602 | * device, for more details see pipeline considerations below).</li> |
| 2603 | * <li>Submitting a series of multiple requests that differ from the |
| 2604 | * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3) |
| 2605 | * moves the new synchronization frame to the last non-repeating |
| 2606 | * request (using the smallest frame number from the contiguous list of |
| 2607 | * repeating requests).</li> |
| 2608 | * <li>Submitting the same request repeatedly will not change this value |
| 2609 | * to CONVERGING, if it was already a non-negative value.</li> |
| 2610 | * <li>When this value changes to non-negative, that means that all of the |
| 2611 | * metadata controls from the request have been applied, all of the |
| 2612 | * metadata controls from the camera device have been read to the |
| 2613 | * updated values (into the result), and all of the graphics buffers |
| 2614 | * corresponding to this result are also synchronized to the request.</li> |
| 2615 | * </ul> |
| 2616 | * <p><em>Pipeline considerations</em>:</p> |
| 2617 | * <p>Submitting a request with updated controls relative to the previously |
| 2618 | * submitted requests may also invalidate the synchronization state |
| 2619 | * of all the results corresponding to currently in-flight requests.</p> |
| 2620 | * <p>In other words, results for this current request and up to |
| 2621 | * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their |
| 2622 | * android.sync.frameNumber change to CONVERGING.</p> |
| 2623 | * |
| 2624 | * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH |
| 2625 | * @see #SYNC_FRAME_NUMBER_CONVERGING |
| 2626 | * @see #SYNC_FRAME_NUMBER_UNKNOWN |
| 2627 | * @hide |
| 2628 | */ |
Zhijun He | 4f91e2a | 2014-04-17 13:20:21 -0700 | [diff] [blame] | 2629 | public static final Key<Long> SYNC_FRAME_NUMBER = |
| 2630 | new Key<Long>("android.sync.frameNumber", long.class); |
Igor Murashkin | 3865a84 | 2014-01-17 18:18:39 -0800 | [diff] [blame] | 2631 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2632 | /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 2633 | * End generated code |
| 2634 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 2635 | } |