CaptureResult.java revision 8949225294479d6152b3bd0f56f9520e700f84b7
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 17package android.hardware.camera2; 18 19import android.hardware.camera2.impl.CameraMetadataNative; 20import android.hardware.camera2.utils.TypeReference; 21import android.util.Log; 22import android.util.Rational; 23 24import java.util.List; 25 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 * 39 * <p>{@link CameraCharacteristics} objects are immutable.</p> 40 * 41 */ 42public 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 } 134 135 private final CameraMetadataNative mResults; 136 private final CaptureRequest mRequest; 137 private final int mSequenceId; 138 139 /** 140 * Takes ownership of the passed-in properties object 141 * @hide 142 */ 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 152 mResults = CameraMetadataNative.move(results); 153 if (mResults.isEmpty()) { 154 throw new AssertionError("Results must not be empty"); 155 } 156 mRequest = parent; 157 mSequenceId = sequenceId; 158 } 159 160 /** 161 * Returns a copy of the underlying {@link CameraMetadataNative}. 162 * @hide 163 */ 164 public CameraMetadataNative getNativeCopy() { 165 return new CameraMetadataNative(mResults); 166 } 167 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 */ 201 public <T> T get(Key<T> key) { 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(); 247 } 248 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() { 286 // TODO: @hide REQUEST_FRAME_COUNT 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 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 311 312 /** 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 /** 365 * <p>A color transform matrix to use to transform 366 * from sensor RGB color space to output linear sRGB color space</p> 367 * <p>This matrix is either set by the camera device when the request 368 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or 369 * directly by the application in the request when the 370 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> 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> 376 * 377 * @see CaptureRequest#COLOR_CORRECTION_MODE 378 */ 379 public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM = 380 new Key<Rational[]>("android.colorCorrection.transform", Rational[].class); 381 382 /** 383 * <p>Gains applying to Bayer raw color channels for 384 * white-balance.</p> 385 * <p>The 4-channel white-balance gains are defined in 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 389 * does not support a separate gain for even/odd green channels, 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> 392 * <p>This array is either set by the camera device when the request 393 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or 394 * directly by the application in the request when the 395 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> 396 * <p>The output should be the gains actually applied by the camera device to 397 * the current frame.</p> 398 * 399 * @see CaptureRequest#COLOR_CORRECTION_MODE 400 */ 401 public static final Key<float[]> COLOR_CORRECTION_GAINS = 402 new Key<float[]>("android.colorCorrection.gains", float[].class); 403 404 /** 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 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 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> 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> 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 * 485 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION 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 /** 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 * 517 * @see CaptureRequest#CONTROL_MODE 518 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 519 * @see CaptureRequest#FLASH_MODE 520 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 521 * @see CaptureRequest#SENSOR_FRAME_DURATION 522 * @see CaptureRequest#SENSOR_SENSITIVITY 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 /** 533 * <p>List of areas to use for 534 * metering.</p> 535 * <p>Each area is a rectangle plus weight: xmin, ymin, 536 * xmax, ymax, weight. The rectangle is defined to be inclusive of the 537 * specified coordinates.</p> 538 * <p>The coordinate system is based on the active pixel array, 539 * with (0,0) being the top-left pixel in the active pixel array, and 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 542 * bottom-right pixel in the active pixel array. The weight 543 * should be nonnegative.</p> 544 * <p>If all regions have 0 weight, then no specific metering area 545 * needs to be used by the camera device. If the metering region is 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> 549 * 550 * @see CaptureRequest#SCALER_CROP_REGION 551 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 552 */ 553 public static final Key<int[]> CONTROL_AE_REGIONS = 554 new Key<int[]>("android.control.aeRegions", int[].class); 555 556 /** 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 /** 586 * <p>Current state of AE algorithm</p> 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> 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> 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 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 /** 784 * <p>Whether AF is currently enabled, and what 785 * mode it is set to</p> 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> 788 * <p>If the lens is controlled by the camera device auto-focus algorithm, 789 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState} 790 * in result metadata.</p> 791 * 792 * @see CaptureResult#CONTROL_AF_STATE 793 * @see CaptureRequest#CONTROL_MODE 794 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE 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 /** 806 * <p>List of areas to use for focus 807 * estimation.</p> 808 * <p>Each area is a rectangle plus weight: xmin, ymin, 809 * xmax, ymax, weight. The rectangle is defined to be inclusive of the 810 * specified coordinates.</p> 811 * <p>The coordinate system is based on the active pixel array, 812 * with (0,0) being the top-left pixel in the active pixel array, and 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 815 * bottom-right pixel in the active pixel array. The weight 816 * should be nonnegative.</p> 817 * <p>If all regions have 0 weight, then no specific focus area 818 * needs to be used by the camera device. If the focusing region is 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> 822 * 823 * @see CaptureRequest#SCALER_CROP_REGION 824 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 825 */ 826 public static final Key<int[]> CONTROL_AF_REGIONS = 827 new Key<int[]>("android.control.afRegions", int[].class); 828 829 /** 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 /** 848 * <p>Current state of AF algorithm.</p> 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> 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> 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> 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> 1229 * 1230 * @see CaptureRequest#CONTROL_AF_MODE 1231 * @see CaptureRequest#CONTROL_MODE 1232 * @see CaptureRequest#CONTROL_SCENE_MODE 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 1239 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED 1240 */ 1241 public static final Key<Integer> CONTROL_AF_STATE = 1242 new Key<Integer>("android.control.afState", int.class); 1243 1244 /** 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 /** 1255 * <p>Whether AWB is currently setting the color 1256 * transform fields, and what its illumination target 1257 * is.</p> 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 1264 * routine is disabled. The application manually controls the white 1265 * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} 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> 1270 * 1271 * @see CaptureRequest#COLOR_CORRECTION_GAINS 1272 * @see CaptureRequest#COLOR_CORRECTION_MODE 1273 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 1274 * @see CaptureRequest#CONTROL_MODE 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 /** 1289 * <p>List of areas to use for illuminant 1290 * estimation.</p> 1291 * <p>Only used in AUTO mode.</p> 1292 * <p>Each area is a rectangle plus weight: xmin, ymin, 1293 * xmax, ymax, weight. The rectangle is defined to be inclusive of the 1294 * specified coordinates.</p> 1295 * <p>The coordinate system is based on the active pixel array, 1296 * with (0,0) being the top-left pixel in the active pixel array, and 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 1299 * bottom-right pixel in the active pixel array. The weight 1300 * should be nonnegative.</p> 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 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> 1306 * 1307 * @see CaptureRequest#SCALER_CROP_REGION 1308 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 1309 */ 1310 public static final Key<int[]> CONTROL_AWB_REGIONS = 1311 new Key<int[]>("android.control.awbRegions", int[].class); 1312 1313 /** 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 /** 1338 * <p>Current state of AWB algorithm</p> 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> 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> 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> 1450 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td> 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 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 /** 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 /** 1493 * <p>Overall mode of 3A control 1494 * routines.</p> 1495 * <p>High-level 3A control. When set to OFF, all 3A control 1496 * by the camera device is disabled. The application must set the fields for 1497 * capture parameters itself.</p> 1498 * <p>When set to AUTO, the individual algorithm controls in 1499 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> 1500 * <p>When set to USE_SCENE_MODE, the individual controls in 1501 * android.control.* are mostly disabled, and the camera device implements 1502 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) 1503 * as it wishes. The camera device scene mode 3A settings are provided by 1504 * android.control.sceneModeOverrides.</p> 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> 1510 * 1511 * @see CaptureRequest#CONTROL_AF_MODE 1512 * @see #CONTROL_MODE_OFF 1513 * @see #CONTROL_MODE_AUTO 1514 * @see #CONTROL_MODE_USE_SCENE_MODE 1515 * @see #CONTROL_MODE_OFF_KEEP_STATE 1516 */ 1517 public static final Key<Integer> CONTROL_MODE = 1518 new Key<Integer>("android.control.mode", int.class); 1519 1520 /** 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 /** 1572 * <p>Operation mode for edge 1573 * enhancement.</p> 1574 * <p>Edge/sharpness/detail enhancement. OFF means no 1575 * enhancement will be applied by the camera device.</p> 1576 * <p>This must be set to one of the modes listed in {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}.</p> 1577 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement 1578 * will be applied. HIGH_QUALITY mode indicates that the 1579 * camera device will use the highest-quality enhancement algorithms, 1580 * even if it slows down capture rate. FAST means the camera device will 1581 * not slow down capture rate when applying edge enhancement.</p> 1582 * 1583 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES 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 /** 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 1594 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p> 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> 1605 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p> 1606 * 1607 * @see CaptureRequest#CONTROL_AE_MODE 1608 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 1609 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 1610 * @see CaptureResult#FLASH_STATE 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 /** 1619 * <p>Current state of the flash 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 1626 * @see #FLASH_STATE_UNAVAILABLE 1627 * @see #FLASH_STATE_CHARGING 1628 * @see #FLASH_STATE_READY 1629 * @see #FLASH_STATE_FIRED 1630 * @see #FLASH_STATE_PARTIAL 1631 */ 1632 public static final Key<Integer> FLASH_STATE = 1633 new Key<Integer>("android.flash.state", int.class); 1634 1635 /** 1636 * <p>Set operational mode for hot pixel correction.</p> 1637 * <p>Valid modes for this camera device are listed in 1638 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p> 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> 1642 * 1643 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES 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 /** 1652 * <p>GPS coordinates to include in output JPEG 1653 * EXIF</p> 1654 */ 1655 public static final Key<double[]> JPEG_GPS_COORDINATES = 1656 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); 1657 1658 /** 1659 * <p>32 characters describing GPS algorithm to 1660 * include in EXIF</p> 1661 */ 1662 public static final Key<String> JPEG_GPS_PROCESSING_METHOD = 1663 new Key<String>("android.jpeg.gpsProcessingMethod", String.class); 1664 1665 /** 1666 * <p>Time GPS fix was made to include in 1667 * EXIF</p> 1668 */ 1669 public static final Key<Long> JPEG_GPS_TIMESTAMP = 1670 new Key<Long>("android.jpeg.gpsTimestamp", long.class); 1671 1672 /** 1673 * <p>Orientation of JPEG image to 1674 * write</p> 1675 */ 1676 public static final Key<Integer> JPEG_ORIENTATION = 1677 new Key<Integer>("android.jpeg.orientation", int.class); 1678 1679 /** 1680 * <p>Compression quality of the final JPEG 1681 * image</p> 1682 * <p>85-95 is typical usage range</p> 1683 */ 1684 public static final Key<Byte> JPEG_QUALITY = 1685 new Key<Byte>("android.jpeg.quality", byte.class); 1686 1687 /** 1688 * <p>Compression quality of JPEG 1689 * thumbnail</p> 1690 */ 1691 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = 1692 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); 1693 1694 /** 1695 * <p>Resolution of embedded JPEG thumbnail</p> 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> 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> 1700 */ 1701 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = 1702 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class); 1703 1704 /** 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}, 1712 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} 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) 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> 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 * 1723 * @see CaptureRequest#CONTROL_AE_MODE 1724 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES 1725 * @see CaptureResult#LENS_STATE 1726 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 1727 * @see CaptureRequest#SENSOR_FRAME_DURATION 1728 * @see CaptureRequest#SENSOR_SENSITIVITY 1729 */ 1730 public static final Key<Float> LENS_APERTURE = 1731 new Key<Float>("android.lens.aperture", float.class); 1732 1733 /** 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> 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> 1749 * 1750 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES 1751 * @see CaptureResult#LENS_STATE 1752 */ 1753 public static final Key<Float> LENS_FILTER_DENSITY = 1754 new Key<Float>("android.lens.filterDensity", float.class); 1755 1756 /** 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 1763 * frames before the lens can change to the requested focal length. 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 1771 */ 1772 public static final Key<Float> LENS_FOCAL_LENGTH = 1773 new Key<Float>("android.lens.focalLength", float.class); 1774 1775 /** 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> 1779 */ 1780 public static final Key<Float> LENS_FOCUS_DISTANCE = 1781 new Key<Float>("android.lens.focusDistance", float.class); 1782 1783 /** 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> 1788 */ 1789 public static final Key<float[]> LENS_FOCUS_RANGE = 1790 new Key<float[]>("android.lens.focusRange", float[].class); 1791 1792 /** 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> 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 /** 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 1837 * @see #LENS_STATE_STATIONARY 1838 * @see #LENS_STATE_MOVING 1839 */ 1840 public static final Key<Integer> LENS_STATE = 1841 new Key<Integer>("android.lens.state", int.class); 1842 1843 /** 1844 * <p>Mode of operation for the noise reduction 1845 * algorithm</p> 1846 * <p>Noise filtering control. OFF means no noise reduction 1847 * will be applied by the camera device.</p> 1848 * <p>This must be set to a valid mode in 1849 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p> 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 1854 * slow down capture rate when applying noise filtering.</p> 1855 * 1856 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES 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 /** 1865 * <p>Whether a result given to the framework is the 1866 * final one for the capture, or only a partial that contains a 1867 * subset of the full set of dynamic metadata 1868 * values.</p> 1869 * <p>The entries in the result metadata buffers for a 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 1877 * only be used by the camera device if quirks.usePartialResult is set to 1.</p> 1878 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1879 * @deprecated 1880 * @hide 1881 */ 1882 @Deprecated 1883 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT = 1884 new Key<Boolean>("android.quirks.partialResult", boolean.class); 1885 1886 /** 1887 * <p>A frame counter set by the framework. This value monotonically 1888 * increases with every new result (that is, each new result has a unique 1889 * frameCount value).</p> 1890 * <p>Reset on release()</p> 1891 */ 1892 public static final Key<Integer> REQUEST_FRAME_COUNT = 1893 new Key<Integer>("android.request.frameCount", int.class); 1894 1895 /** 1896 * <p>An application-specified ID for the current 1897 * request. Must be maintained unchanged in output 1898 * frame</p> 1899 * @hide 1900 */ 1901 public static final Key<Integer> REQUEST_ID = 1902 new Key<Integer>("android.request.id", int.class); 1903 1904 /** 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 /** 1919 * <p>(x, y, width, height).</p> 1920 * <p>A rectangle with the top-level corner of (x,y) and size 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 1924 * maintain the stream's aspect ratio.</p> 1925 * <p>HAL2.x uses only (x, y, width)</p> 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> 1931 * <p>For example, if the crop region is set to a 4:3 aspect 1932 * ratio, then 4:3 streams should use the exact crop 1933 * region. 16:9 streams should further crop vertically 1934 * (letterbox).</p> 1935 * <p>Conversely, if the crop region is set to a 16:9, then 4:3 1936 * outputs should crop horizontally (pillarbox), and 16:9 1937 * streams should match exactly. These additional crops must 1938 * be centered within the crop region.</p> 1939 * <p>The output streams must maintain square pixels at all 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 / 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 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 /** 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> 1962 */ 1963 public static final Key<Long> SENSOR_EXPOSURE_TIME = 1964 new Key<Long>("android.sensor.exposureTime", long.class); 1965 1966 /** 1967 * <p>Duration from start of frame exposure to 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> 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> 2003 * </ul> 2004 * <p>The necessary information for the application, given the model above, 2005 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field 2006 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size). 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 2010 * determine the minimum frame duration it can request from the camera 2011 * device:</p> 2012 * <ol> 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 2016 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using 2017 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with 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> 2023 * </ol> 2024 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in 2025 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its 2026 * respective size/format), then the frame duration in 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 2037 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p> 2038 * 2039 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP 2040 */ 2041 public static final Key<Long> SENSOR_FRAME_DURATION = 2042 new Key<Long>("android.sensor.frameDuration", long.class); 2043 2044 /** 2045 * <p>Gain applied to image data. Must be 2046 * implemented through analog gain only if set to values 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> 2051 */ 2052 public static final Key<Integer> SENSOR_SENSITIVITY = 2053 new Key<Integer>("android.sensor.sensitivity", int.class); 2054 2055 /** 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> 2060 */ 2061 public static final Key<Long> SENSOR_TIMESTAMP = 2062 new Key<Long>("android.sensor.timestamp", long.class); 2063 2064 /** 2065 * <p>The estimated camera neutral color in the native sensor colorspace at 2066 * the time of capture.</p> 2067 * <p>This value gives the neutral color point encoded as an RGB value in the 2068 * native sensor color space. The neutral color point indicates the 2069 * currently estimated white point of the scene illumination. It can be 2070 * used to interpolate between the provided color transforms when 2071 * processing raw sensor data.</p> 2072 * <p>The order of the values is R, G, B; where R is in the lowest index.</p> 2073 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2074 */ 2075 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT = 2076 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class); 2077 2078 /** 2079 * <p>The worst-case divergence between Bayer green channels.</p> 2080 * <p>This value is an estimate of the worst case split between the 2081 * Bayer green channels in the red and blue rows in the sensor color 2082 * filter array.</p> 2083 * <p>The green split is calculated as follows:</p> 2084 * <ol> 2085 * <li>A 5x5 pixel (or larger) window W within the active sensor array is 2086 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer 2087 * mosaic channels (R, Gr, Gb, B). The location and size of the window 2088 * chosen is implementation defined, and should be chosen to provide a 2089 * green split estimate that is both representative of the entire image 2090 * for this camera sensor, and can be calculated quickly.</li> 2091 * <li>The arithmetic mean of the green channels from the red 2092 * rows (mean_Gr) within W is computed.</li> 2093 * <li>The arithmetic mean of the green channels from the blue 2094 * rows (mean_Gb) within W is computed.</li> 2095 * <li>The maximum ratio R of the two means is computed as follows: 2096 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li> 2097 * </ol> 2098 * <p>The ratio R is the green split divergence reported for this property, 2099 * which represents how much the green channels differ in the mosaic 2100 * pattern. This value is typically used to determine the treatment of 2101 * the green mosaic channels when demosaicing.</p> 2102 * <p>The green split value can be roughly interpreted as follows:</p> 2103 * <ul> 2104 * <li>R < 1.03 is a negligible split (<3% divergence).</li> 2105 * <li>1.20 <= R >= 1.03 will require some software 2106 * correction to avoid demosaic errors (3-20% divergence).</li> 2107 * <li>R > 1.20 will require strong software correction to produce 2108 * a usuable image (>20% divergence).</li> 2109 * </ul> 2110 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2111 */ 2112 public static final Key<Float> SENSOR_GREEN_SPLIT = 2113 new Key<Float>("android.sensor.greenSplit", float.class); 2114 2115 /** 2116 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern 2117 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> 2118 * <p>Each color channel is treated as an unsigned 32-bit integer. 2119 * The camera device then uses the most significant X bits 2120 * that correspond to how many bits are in its Bayer raw sensor 2121 * output.</p> 2122 * <p>For example, a sensor with RAW10 Bayer output would use the 2123 * 10 most significant bits from each color channel.</p> 2124 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2125 * 2126 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE 2127 */ 2128 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = 2129 new Key<int[]>("android.sensor.testPatternData", int[].class); 2130 2131 /** 2132 * <p>When enabled, the sensor sends a test pattern instead of 2133 * doing a real exposure from the camera.</p> 2134 * <p>When a test pattern is enabled, all manual sensor controls specified 2135 * by android.sensor.* should be ignored. All other controls should 2136 * work as normal.</p> 2137 * <p>For example, if manual flash is enabled, flash firing should still 2138 * occur (and that the test pattern remain unmodified, since the flash 2139 * would not actually affect it).</p> 2140 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2141 * @see #SENSOR_TEST_PATTERN_MODE_OFF 2142 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR 2143 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS 2144 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY 2145 * @see #SENSOR_TEST_PATTERN_MODE_PN9 2146 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 2147 */ 2148 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = 2149 new Key<Integer>("android.sensor.testPatternMode", int.class); 2150 2151 /** 2152 * <p>Quality of lens shading correction applied 2153 * to the image data.</p> 2154 * <p>When set to OFF mode, no lens shading correction will be applied by the 2155 * camera device, and an identity lens shading map data will be provided 2156 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens 2157 * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>, 2158 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map 2159 * shown below:</p> 2160 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2161 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2162 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2163 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2164 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2165 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] 2166 * </code></pre> 2167 * <p>When set to other modes, lens shading correction will be applied by the 2168 * camera device. Applications can request lens shading map data by setting 2169 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide 2170 * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified 2171 * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}; the returned shading map data will be the one 2172 * applied by the camera device for this capture request.</p> 2173 * <p>The shading map data may depend on the AE and AWB statistics, therefore the reliability 2174 * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in 2175 * 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), 2176 * to get best results, it is recommended that the applications wait for the AE and AWB to 2177 * be converged before using the returned shading map data.</p> 2178 * 2179 * @see CaptureRequest#CONTROL_AE_MODE 2180 * @see CaptureRequest#CONTROL_AWB_MODE 2181 * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE 2182 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP 2183 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE 2184 * @see #SHADING_MODE_OFF 2185 * @see #SHADING_MODE_FAST 2186 * @see #SHADING_MODE_HIGH_QUALITY 2187 */ 2188 public static final Key<Integer> SHADING_MODE = 2189 new Key<Integer>("android.shading.mode", int.class); 2190 2191 /** 2192 * <p>State of the face detector 2193 * unit</p> 2194 * <p>Whether face detection is enabled, and whether it 2195 * should output just the basic fields or the full set of 2196 * fields. Value must be one of the 2197 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p> 2198 * 2199 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES 2200 * @see #STATISTICS_FACE_DETECT_MODE_OFF 2201 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE 2202 * @see #STATISTICS_FACE_DETECT_MODE_FULL 2203 */ 2204 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = 2205 new Key<Integer>("android.statistics.faceDetectMode", int.class); 2206 2207 /** 2208 * <p>List of unique IDs for detected 2209 * faces</p> 2210 * <p>Only available if faceDetectMode == FULL</p> 2211 * @hide 2212 */ 2213 public static final Key<int[]> STATISTICS_FACE_IDS = 2214 new Key<int[]>("android.statistics.faceIds", int[].class); 2215 2216 /** 2217 * <p>List of landmarks for detected 2218 * faces</p> 2219 * <p>Only available if faceDetectMode == FULL</p> 2220 * @hide 2221 */ 2222 public static final Key<int[]> STATISTICS_FACE_LANDMARKS = 2223 new Key<int[]>("android.statistics.faceLandmarks", int[].class); 2224 2225 /** 2226 * <p>List of the bounding rectangles for detected 2227 * faces</p> 2228 * <p>Only available if faceDetectMode != OFF</p> 2229 * @hide 2230 */ 2231 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES = 2232 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class); 2233 2234 /** 2235 * <p>List of the face confidence scores for 2236 * detected faces</p> 2237 * <p>Only available if faceDetectMode != OFF. The value should be 2238 * meaningful (for example, setting 100 at all times is illegal).</p> 2239 * @hide 2240 */ 2241 public static final Key<byte[]> STATISTICS_FACE_SCORES = 2242 new Key<byte[]>("android.statistics.faceScores", byte[].class); 2243 2244 /** 2245 * <p>List of the faces detected through camera face detection 2246 * in this result.</p> 2247 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p> 2248 * 2249 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE 2250 */ 2251 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES = 2252 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class); 2253 2254 /** 2255 * <p>The shading map is a low-resolution floating-point map 2256 * that lists the coefficients used to correct for vignetting, for each 2257 * Bayer color channel.</p> 2258 * <p>The least shaded section of the image should have a gain factor 2259 * of 1; all other sections should have gains above 1.</p> 2260 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map 2261 * must take into account the colorCorrection settings.</p> 2262 * <p>The shading map is for the entire active pixel array, and is not 2263 * affected by the crop region specified in the request. Each shading map 2264 * entry is the value of the shading compensation map over a specific 2265 * pixel on the sensor. Specifically, with a (N x M) resolution shading 2266 * map, and an active pixel array size (W x H), shading map entry 2267 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at 2268 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. 2269 * The map is assumed to be bilinearly interpolated between the sample points.</p> 2270 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green 2271 * channel for the even rows of a Bayer pattern, and Godd is the odd rows. 2272 * The shading map is stored in a fully interleaved format, and its size 2273 * is provided in the camera static metadata by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p> 2274 * <p>The shading map should have on the order of 30-40 rows and columns, 2275 * and must be smaller than 64x64.</p> 2276 * <p>As an example, given a very small map defined as:</p> 2277 * <pre><code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ] 2278 * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} = 2279 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2, 2280 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, 2281 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, 2282 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, 2283 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, 2284 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ] 2285 * </code></pre> 2286 * <p>The low-resolution scaling map images for each channel are 2287 * (displayed using nearest-neighbor interpolation):</p> 2288 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> 2289 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> 2290 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> 2291 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> 2292 * <p>As a visualization only, inverting the full-color map to recover an 2293 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p> 2294 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p> 2295 * 2296 * @see CaptureRequest#COLOR_CORRECTION_MODE 2297 * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE 2298 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP 2299 */ 2300 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP = 2301 new Key<float[]>("android.statistics.lensShadingMap", float[].class); 2302 2303 /** 2304 * <p>The best-fit color channel gains calculated 2305 * by the camera device's statistics units for the current output frame.</p> 2306 * <p>This may be different than the gains used for this frame, 2307 * since statistics processing on data from a new frame 2308 * typically completes after the transform has already been 2309 * applied to that frame.</p> 2310 * <p>The 4 channel gains are defined in Bayer domain, 2311 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p> 2312 * <p>This value should always be calculated by the AWB block, 2313 * regardless of the android.control.* current values.</p> 2314 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2315 * 2316 * @see CaptureRequest#COLOR_CORRECTION_GAINS 2317 * @deprecated 2318 * @hide 2319 */ 2320 @Deprecated 2321 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS = 2322 new Key<float[]>("android.statistics.predictedColorGains", float[].class); 2323 2324 /** 2325 * <p>The best-fit color transform matrix estimate 2326 * calculated by the camera device's statistics units for the current 2327 * output frame.</p> 2328 * <p>The camera device will provide the estimate from its 2329 * statistics unit on the white balance transforms to use 2330 * for the next frame. These are the values the camera device believes 2331 * are the best fit for the current output frame. This may 2332 * be different than the transform used for this frame, since 2333 * statistics processing on data from a new frame typically 2334 * completes after the transform has already been applied to 2335 * that frame.</p> 2336 * <p>These estimates must be provided for all frames, even if 2337 * capture settings and color transforms are set by the application.</p> 2338 * <p>This value should always be calculated by the AWB block, 2339 * regardless of the android.control.* current values.</p> 2340 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2341 * @deprecated 2342 * @hide 2343 */ 2344 @Deprecated 2345 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM = 2346 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class); 2347 2348 /** 2349 * <p>The camera device estimated scene illumination lighting 2350 * frequency.</p> 2351 * <p>Many light sources, such as most fluorescent lights, flicker at a rate 2352 * that depends on the local utility power standards. This flicker must be 2353 * accounted for by auto-exposure routines to avoid artifacts in captured images. 2354 * The camera device uses this entry to tell the application what the scene 2355 * illuminant frequency is.</p> 2356 * <p>When manual exposure control is enabled 2357 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == OFF</code>), 2358 * the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't do the antibanding, and the 2359 * application can ensure it selects exposure times that do not cause banding 2360 * issues by looking into this metadata field. See {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} 2361 * for more details.</p> 2362 * <p>Report NONE if there doesn't appear to be flickering illumination.</p> 2363 * 2364 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE 2365 * @see CaptureRequest#CONTROL_AE_MODE 2366 * @see CaptureRequest#CONTROL_MODE 2367 * @see #STATISTICS_SCENE_FLICKER_NONE 2368 * @see #STATISTICS_SCENE_FLICKER_50HZ 2369 * @see #STATISTICS_SCENE_FLICKER_60HZ 2370 */ 2371 public static final Key<Integer> STATISTICS_SCENE_FLICKER = 2372 new Key<Integer>("android.statistics.sceneFlicker", int.class); 2373 2374 /** 2375 * <p>Operating mode for hotpixel map generation.</p> 2376 * <p>If set to ON, a hotpixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}. 2377 * If set to OFF, no hotpixel map should be returned.</p> 2378 * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p> 2379 * 2380 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP 2381 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES 2382 */ 2383 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = 2384 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); 2385 2386 /** 2387 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p> 2388 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and 2389 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and 2390 * bottom-right of the pixel array, respectively. The width and 2391 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}. 2392 * This may include hot pixels that lie outside of the active array 2393 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> 2394 * 2395 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 2396 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE 2397 */ 2398 public static final Key<int[]> STATISTICS_HOT_PIXEL_MAP = 2399 new Key<int[]>("android.statistics.hotPixelMap", int[].class); 2400 2401 /** 2402 * <p>Whether the camera device will output the lens 2403 * shading map in output result metadata.</p> 2404 * <p>When set to ON, 2405 * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} must be provided in 2406 * the output result metadata.</p> 2407 * 2408 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP 2409 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF 2410 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON 2411 */ 2412 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = 2413 new Key<Integer>("android.statistics.lensShadingMapMode", int.class); 2414 2415 /** 2416 * <p>Tonemapping / contrast / gamma curve for the blue 2417 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 2418 * CONTRAST_CURVE.</p> 2419 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> 2420 * 2421 * @see CaptureRequest#TONEMAP_CURVE_RED 2422 * @see CaptureRequest#TONEMAP_MODE 2423 */ 2424 public static final Key<float[]> TONEMAP_CURVE_BLUE = 2425 new Key<float[]>("android.tonemap.curveBlue", float[].class); 2426 2427 /** 2428 * <p>Tonemapping / contrast / gamma curve for the green 2429 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 2430 * CONTRAST_CURVE.</p> 2431 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> 2432 * 2433 * @see CaptureRequest#TONEMAP_CURVE_RED 2434 * @see CaptureRequest#TONEMAP_MODE 2435 */ 2436 public static final Key<float[]> TONEMAP_CURVE_GREEN = 2437 new Key<float[]>("android.tonemap.curveGreen", float[].class); 2438 2439 /** 2440 * <p>Tonemapping / contrast / gamma curve for the red 2441 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 2442 * CONTRAST_CURVE.</p> 2443 * <p>Each channel's curve is defined by an array of control points:</p> 2444 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = 2445 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] 2446 * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> 2447 * <p>These are sorted in order of increasing <code>Pin</code>; it is always 2448 * guaranteed that input values 0.0 and 1.0 are included in the list to 2449 * define a complete mapping. For input values between control points, 2450 * the camera device must linearly interpolate between the control 2451 * points.</p> 2452 * <p>Each curve can have an independent number of points, and the number 2453 * of points can be less than max (that is, the request doesn't have to 2454 * always provide a curve with number of points equivalent to 2455 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> 2456 * <p>A few examples, and their corresponding graphical mappings; these 2457 * only specify the red channel and the precision is limited to 4 2458 * digits, for conciseness.</p> 2459 * <p>Linear mapping:</p> 2460 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 0, 1.0, 1.0 ] 2461 * </code></pre> 2462 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> 2463 * <p>Invert mapping:</p> 2464 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 1.0, 1.0, 0 ] 2465 * </code></pre> 2466 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> 2467 * <p>Gamma 1/2.2 mapping, with 16 control points:</p> 2468 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 2469 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, 2470 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, 2471 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, 2472 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ] 2473 * </code></pre> 2474 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> 2475 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> 2476 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 2477 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, 2478 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, 2479 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, 2480 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ] 2481 * </code></pre> 2482 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> 2483 * 2484 * @see CaptureRequest#TONEMAP_CURVE_RED 2485 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS 2486 * @see CaptureRequest#TONEMAP_MODE 2487 */ 2488 public static final Key<float[]> TONEMAP_CURVE_RED = 2489 new Key<float[]>("android.tonemap.curveRed", float[].class); 2490 2491 /** 2492 * <p>High-level global contrast/gamma/tonemapping control.</p> 2493 * <p>When switching to an application-defined contrast curve by setting 2494 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined 2495 * per-channel with a set of <code>(in, out)</code> points that specify the 2496 * mapping from input high-bit-depth pixel value to the output 2497 * low-bit-depth value. Since the actual pixel ranges of both input 2498 * and output may change depending on the camera pipeline, the values 2499 * are specified by normalized floating-point numbers.</p> 2500 * <p>More-complex color mapping operations such as 3D color look-up 2501 * tables, selective chroma enhancement, or other non-linear color 2502 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 2503 * CONTRAST_CURVE.</p> 2504 * <p>This must be set to a valid mode in 2505 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p> 2506 * <p>When using either FAST or HIGH_QUALITY, the camera device will 2507 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed}, 2508 * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, and {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}. 2509 * These values are always available, and as close as possible to the 2510 * actually used nonlinear/nonglobal transforms.</p> 2511 * <p>If a request is sent with CONTRAST_CURVE with the camera device's 2512 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be 2513 * roughly the same.</p> 2514 * 2515 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES 2516 * @see CaptureRequest#TONEMAP_CURVE_BLUE 2517 * @see CaptureRequest#TONEMAP_CURVE_GREEN 2518 * @see CaptureRequest#TONEMAP_CURVE_RED 2519 * @see CaptureRequest#TONEMAP_MODE 2520 * @see #TONEMAP_MODE_CONTRAST_CURVE 2521 * @see #TONEMAP_MODE_FAST 2522 * @see #TONEMAP_MODE_HIGH_QUALITY 2523 */ 2524 public static final Key<Integer> TONEMAP_MODE = 2525 new Key<Integer>("android.tonemap.mode", int.class); 2526 2527 /** 2528 * <p>This LED is nominally used to indicate to the user 2529 * that the camera is powered on and may be streaming images back to the 2530 * Application Processor. In certain rare circumstances, the OS may 2531 * disable this when video is processed locally and not transmitted to 2532 * any untrusted applications.</p> 2533 * <p>In particular, the LED <em>must</em> always be on when the data could be 2534 * transmitted off the device. The LED <em>should</em> always be on whenever 2535 * data is stored locally on the device.</p> 2536 * <p>The LED <em>may</em> be off if a trusted application is using the data that 2537 * doesn't violate the above rules.</p> 2538 * @hide 2539 */ 2540 public static final Key<Boolean> LED_TRANSMIT = 2541 new Key<Boolean>("android.led.transmit", boolean.class); 2542 2543 /** 2544 * <p>Whether black-level compensation is locked 2545 * to its current values, or is free to vary.</p> 2546 * <p>Whether the black level offset was locked for this frame. Should be 2547 * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless 2548 * a change in other capture settings forced the camera device to 2549 * perform a black level reset.</p> 2550 * 2551 * @see CaptureRequest#BLACK_LEVEL_LOCK 2552 */ 2553 public static final Key<Boolean> BLACK_LEVEL_LOCK = 2554 new Key<Boolean>("android.blackLevel.lock", boolean.class); 2555 2556 /** 2557 * <p>The frame number corresponding to the last request 2558 * with which the output result (metadata + buffers) has been fully 2559 * synchronized.</p> 2560 * <p>When a request is submitted to the camera device, there is usually a 2561 * delay of several frames before the controls get applied. A camera 2562 * device may either choose to account for this delay by implementing a 2563 * pipeline and carefully submit well-timed atomic control updates, or 2564 * it may start streaming control changes that span over several frame 2565 * boundaries.</p> 2566 * <p>In the latter case, whenever a request's settings change relative to 2567 * the previous submitted request, the full set of changes may take 2568 * multiple frame durations to fully take effect. Some settings may 2569 * take effect sooner (in less frame durations) than others.</p> 2570 * <p>While a set of control changes are being propagated, this value 2571 * will be CONVERGING.</p> 2572 * <p>Once it is fully known that a set of control changes have been 2573 * finished propagating, and the resulting updated control settings 2574 * have been read back by the camera device, this value will be set 2575 * to a non-negative frame number (corresponding to the request to 2576 * which the results have synchronized to).</p> 2577 * <p>Older camera device implementations may not have a way to detect 2578 * when all camera controls have been applied, and will always set this 2579 * value to UNKNOWN.</p> 2580 * <p>FULL capability devices will always have this value set to the 2581 * frame number of the request corresponding to this result.</p> 2582 * <p><em>Further details</em>:</p> 2583 * <ul> 2584 * <li>Whenever a request differs from the last request, any future 2585 * results not yet returned may have this value set to CONVERGING (this 2586 * could include any in-progress captures not yet returned by the camera 2587 * device, for more details see pipeline considerations below).</li> 2588 * <li>Submitting a series of multiple requests that differ from the 2589 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3) 2590 * moves the new synchronization frame to the last non-repeating 2591 * request (using the smallest frame number from the contiguous list of 2592 * repeating requests).</li> 2593 * <li>Submitting the same request repeatedly will not change this value 2594 * to CONVERGING, if it was already a non-negative value.</li> 2595 * <li>When this value changes to non-negative, that means that all of the 2596 * metadata controls from the request have been applied, all of the 2597 * metadata controls from the camera device have been read to the 2598 * updated values (into the result), and all of the graphics buffers 2599 * corresponding to this result are also synchronized to the request.</li> 2600 * </ul> 2601 * <p><em>Pipeline considerations</em>:</p> 2602 * <p>Submitting a request with updated controls relative to the previously 2603 * submitted requests may also invalidate the synchronization state 2604 * of all the results corresponding to currently in-flight requests.</p> 2605 * <p>In other words, results for this current request and up to 2606 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their 2607 * android.sync.frameNumber change to CONVERGING.</p> 2608 * 2609 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH 2610 * @see #SYNC_FRAME_NUMBER_CONVERGING 2611 * @see #SYNC_FRAME_NUMBER_UNKNOWN 2612 * @hide 2613 */ 2614 public static final Key<Long> SYNC_FRAME_NUMBER = 2615 new Key<Long>("android.sync.frameNumber", long.class); 2616 2617 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 2618 * End generated code 2619 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ 2620} 2621