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 17 package android.hardware.camera2; 18 19 import android.annotation.NonNull; 20 import android.annotation.Nullable; 21 import android.compat.annotation.UnsupportedAppUsage; 22 import android.hardware.camera2.impl.CameraMetadataNative; 23 import android.hardware.camera2.impl.CaptureResultExtras; 24 import android.hardware.camera2.impl.PublicKey; 25 import android.hardware.camera2.impl.SyntheticKey; 26 import android.hardware.camera2.utils.TypeReference; 27 import android.os.Build; 28 import android.util.Log; 29 import android.util.Rational; 30 31 import java.util.List; 32 33 /** 34 * <p>The subset of the results of a single image capture from the image sensor.</p> 35 * 36 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens, 37 * flash), the processing pipeline, the control algorithms, and the output 38 * buffers.</p> 39 * 40 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a 41 * {@link CaptureRequest}. All properties listed for capture requests can also 42 * be queried on the capture result, to determine the final values used for 43 * capture. The result also includes additional metadata about the state of the 44 * camera device during the capture.</p> 45 * 46 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()} 47 * are necessarily available. Some results are {@link CaptureResult partial} and will 48 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have 49 * every key available that was enabled by the request.</p> 50 * 51 * <p>{@link CaptureResult} objects are immutable.</p> 52 * 53 */ 54 public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { 55 56 private static final String TAG = "CaptureResult"; 57 private static final boolean VERBOSE = false; 58 59 /** 60 * A {@code Key} is used to do capture result field lookups with 61 * {@link CaptureResult#get}. 62 * 63 * <p>For example, to get the timestamp corresponding to the exposure of the first row: 64 * <code><pre> 65 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP); 66 * </pre></code> 67 * </p> 68 * 69 * <p>To enumerate over all possible keys for {@link CaptureResult}, see 70 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p> 71 * 72 * @see CaptureResult#get 73 * @see CameraCharacteristics#getAvailableCaptureResultKeys 74 */ 75 public final static class Key<T> { 76 private final CameraMetadataNative.Key<T> mKey; 77 78 /** 79 * Visible for testing and vendor extensions only. 80 * 81 * @hide 82 */ 83 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) Key(String name, Class<T> type, long vendorId)84 public Key(String name, Class<T> type, long vendorId) { 85 mKey = new CameraMetadataNative.Key<T>(name, type, vendorId); 86 } 87 88 /** 89 * Visible for testing and vendor extensions only. 90 * 91 * @hide 92 */ Key(String name, String fallbackName, Class<T> type)93 public Key(String name, String fallbackName, Class<T> type) { 94 mKey = new CameraMetadataNative.Key<T>(name, fallbackName, type); 95 } 96 97 /** 98 * Construct a new Key with a given name and type. 99 * 100 * <p>Normally, applications should use the existing Key definitions in 101 * {@link CaptureResult}, and not need to construct their own Key objects. However, they may 102 * be useful for testing purposes and for defining custom capture result fields.</p> 103 */ Key(@onNull String name, @NonNull Class<T> type)104 public Key(@NonNull String name, @NonNull Class<T> type) { 105 mKey = new CameraMetadataNative.Key<T>(name, type); 106 } 107 108 /** 109 * Visible for testing and vendor extensions only. 110 * 111 * @hide 112 */ 113 @UnsupportedAppUsage Key(String name, TypeReference<T> typeReference)114 public Key(String name, TypeReference<T> typeReference) { 115 mKey = new CameraMetadataNative.Key<T>(name, typeReference); 116 } 117 118 /** 119 * Return a camelCase, period separated name formatted like: 120 * {@code "root.section[.subsections].name"}. 121 * 122 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."}; 123 * keys that are device/platform-specific are prefixed with {@code "com."}.</p> 124 * 125 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would 126 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device 127 * specific key might look like {@code "com.google.nexus.data.private"}.</p> 128 * 129 * @return String representation of the key name 130 */ 131 @NonNull getName()132 public String getName() { 133 return mKey.getName(); 134 } 135 136 /** 137 * Return vendor tag id. 138 * 139 * @hide 140 */ getVendorId()141 public long getVendorId() { 142 return mKey.getVendorId(); 143 } 144 145 /** 146 * {@inheritDoc} 147 */ 148 @Override hashCode()149 public final int hashCode() { 150 return mKey.hashCode(); 151 } 152 153 /** 154 * {@inheritDoc} 155 */ 156 @SuppressWarnings("unchecked") 157 @Override equals(Object o)158 public final boolean equals(Object o) { 159 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey); 160 } 161 162 /** 163 * Return this {@link Key} as a string representation. 164 * 165 * <p>{@code "CaptureResult.Key(%s)"}, where {@code %s} represents 166 * the name of this key as returned by {@link #getName}.</p> 167 * 168 * @return string representation of {@link Key} 169 */ 170 @NonNull 171 @Override toString()172 public String toString() { 173 return String.format("CaptureResult.Key(%s)", mKey.getName()); 174 } 175 176 /** 177 * Visible for CameraMetadataNative implementation only; do not use. 178 * 179 * TODO: Make this private or remove it altogether. 180 * 181 * @hide 182 */ 183 @UnsupportedAppUsage getNativeKey()184 public CameraMetadataNative.Key<T> getNativeKey() { 185 return mKey; 186 } 187 188 @SuppressWarnings({ "unchecked" }) Key(CameraMetadataNative.Key<?> nativeKey)189 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) { 190 mKey = (CameraMetadataNative.Key<T>) nativeKey; 191 } 192 } 193 194 private final String mCameraId; 195 @UnsupportedAppUsage 196 private final CameraMetadataNative mResults; 197 private final CaptureRequest mRequest; 198 private final int mSequenceId; 199 private final long mFrameNumber; 200 201 /** 202 * Takes ownership of the passed-in properties object 203 * 204 * <p>For internal use only</p> 205 * @hide 206 */ CaptureResult(String cameraId, CameraMetadataNative results, CaptureRequest parent, CaptureResultExtras extras)207 public CaptureResult(String cameraId, CameraMetadataNative results, CaptureRequest parent, 208 CaptureResultExtras extras) { 209 if (results == null) { 210 throw new IllegalArgumentException("results was null"); 211 } 212 213 if (parent == null) { 214 throw new IllegalArgumentException("parent was null"); 215 } 216 217 if (extras == null) { 218 throw new IllegalArgumentException("extras was null"); 219 } 220 221 mResults = CameraMetadataNative.move(results); 222 if (mResults.isEmpty()) { 223 throw new AssertionError("Results must not be empty"); 224 } 225 setNativeInstance(mResults); 226 mCameraId = cameraId; 227 mRequest = parent; 228 mSequenceId = extras.getRequestId(); 229 mFrameNumber = extras.getFrameNumber(); 230 } 231 232 /** 233 * Takes ownership of the passed-in properties object 234 * 235 * <p>For internal use only</p> 236 * @hide 237 */ CaptureResult(String cameraId, CameraMetadataNative results, CaptureRequest parent, int requestId, long frameNumber)238 public CaptureResult(String cameraId, CameraMetadataNative results, CaptureRequest parent, 239 int requestId, long frameNumber) { 240 if (results == null) { 241 throw new IllegalArgumentException("results was null"); 242 } 243 244 if (parent == null) { 245 throw new IllegalArgumentException("parent was null"); 246 } 247 248 mResults = CameraMetadataNative.move(results); 249 if (mResults.isEmpty()) { 250 throw new AssertionError("Results must not be empty"); 251 } 252 setNativeInstance(mResults); 253 mCameraId = cameraId; 254 mRequest = parent; 255 mSequenceId = requestId; 256 mFrameNumber = frameNumber; 257 } 258 259 /** 260 * Returns a copy of the underlying {@link CameraMetadataNative}. 261 * @hide 262 */ getNativeCopy()263 public CameraMetadataNative getNativeCopy() { 264 return new CameraMetadataNative(mResults); 265 } 266 267 /** 268 * Creates a request-less result. 269 * 270 * <p><strong>For testing only.</strong></p> 271 * @hide 272 */ CaptureResult(CameraMetadataNative results, int sequenceId)273 public CaptureResult(CameraMetadataNative results, int sequenceId) { 274 if (results == null) { 275 throw new IllegalArgumentException("results was null"); 276 } 277 278 mResults = CameraMetadataNative.move(results); 279 if (mResults.isEmpty()) { 280 throw new AssertionError("Results must not be empty"); 281 } 282 283 setNativeInstance(mResults); 284 mCameraId = "none"; 285 mRequest = null; 286 mSequenceId = sequenceId; 287 mFrameNumber = -1; 288 } 289 290 /** 291 * Get the camera ID of the camera that produced this capture result. 292 * 293 * For a logical multi-camera, the ID may be the logical or the physical camera ID, depending on 294 * whether the capture result was obtained from 295 * {@link TotalCaptureResult#getPhysicalCameraResults} or not. 296 * 297 * @return The camera ID for the camera that produced this capture result. 298 */ 299 @NonNull getCameraId()300 public String getCameraId() { 301 return mCameraId; 302 } 303 304 /** 305 * Get a capture result field value. 306 * 307 * <p>The field definitions can be found in {@link CaptureResult}.</p> 308 * 309 * <p>Querying the value for the same key more than once will return a value 310 * which is equal to the previous queried value.</p> 311 * 312 * @throws IllegalArgumentException if the key was not valid 313 * 314 * @param key The result field to read. 315 * @return The value of that key, or {@code null} if the field is not set. 316 */ 317 @Nullable get(Key<T> key)318 public <T> T get(Key<T> key) { 319 T value = mResults.get(key); 320 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value); 321 return value; 322 } 323 324 /** 325 * {@inheritDoc} 326 * @hide 327 */ 328 @SuppressWarnings("unchecked") 329 @Override getProtected(Key<?> key)330 protected <T> T getProtected(Key<?> key) { 331 return (T) mResults.get(key); 332 } 333 334 /** 335 * {@inheritDoc} 336 * @hide 337 */ 338 @SuppressWarnings("unchecked") 339 @Override getKeyClass()340 protected Class<Key<?>> getKeyClass() { 341 Object thisClass = Key.class; 342 return (Class<Key<?>>)thisClass; 343 } 344 345 /** 346 * Dumps the native metadata contents to logcat. 347 * 348 * <p>Visibility for testing/debugging only. The results will not 349 * include any synthesized keys, as they are invisible to the native layer.</p> 350 * 351 * @hide 352 */ dumpToLog()353 public void dumpToLog() { 354 mResults.dumpToLog(); 355 } 356 357 /** 358 * {@inheritDoc} 359 */ 360 @Override 361 @NonNull getKeys()362 public List<Key<?>> getKeys() { 363 // Force the javadoc for this function to show up on the CaptureResult page 364 return super.getKeys(); 365 } 366 367 /** 368 * Get the request associated with this result. 369 * 370 * <p>Whenever a request has been fully or partially captured, with 371 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or 372 * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s 373 * {@code getRequest()} will return that {@code request}. 374 * </p> 375 * 376 * <p>For example, 377 * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() { 378 * {@literal @}Override 379 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) { 380 * assert(myResult.getRequest.equals(myRequest) == true); 381 * } 382 * }, null); 383 * </code></pre> 384 * </p> 385 * 386 * @return The request associated with this result. Never {@code null}. 387 */ 388 @NonNull getRequest()389 public CaptureRequest getRequest() { 390 return mRequest; 391 } 392 393 /** 394 * Get the frame number associated with this result. 395 * 396 * <p>Whenever a request has been processed, regardless of failure or success, 397 * it gets a unique frame number assigned to its future result/failure.</p> 398 * 399 * <p>For the same type of request (capturing from the camera device or reprocessing), this 400 * value monotonically increments, starting with 0, for every new result or failure and the 401 * scope is the lifetime of the {@link CameraDevice}. Between different types of requests, 402 * the frame number may not monotonically increment. For example, the frame number of a newer 403 * reprocess result may be smaller than the frame number of an older result of capturing new 404 * images from the camera device, but the frame number of a newer reprocess result will never be 405 * smaller than the frame number of an older reprocess result.</p> 406 * 407 * @return The frame number 408 * 409 * @see CameraDevice#createCaptureRequest 410 * @see CameraDevice#createReprocessCaptureRequest 411 */ getFrameNumber()412 public long getFrameNumber() { 413 return mFrameNumber; 414 } 415 416 /** 417 * The sequence ID for this failure that was returned by the 418 * {@link CameraCaptureSession#capture} family of functions. 419 * 420 * <p>The sequence ID is a unique monotonically increasing value starting from 0, 421 * incremented every time a new group of requests is submitted to the CameraDevice.</p> 422 * 423 * @return int The ID for the sequence of requests that this capture result is a part of 424 * 425 * @see CameraCaptureSession.CaptureCallback#onCaptureSequenceCompleted 426 * @see CameraCaptureSession.CaptureCallback#onCaptureSequenceAborted 427 */ getSequenceId()428 public int getSequenceId() { 429 return mSequenceId; 430 } 431 432 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 433 * The key entries below this point are generated from metadata 434 * definitions in /system/media/camera/docs. Do not modify by hand or 435 * modify the comment blocks at the start or end. 436 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ 437 438 /** 439 * <p>The mode control selects how the image data is converted from the 440 * sensor's native color into linear sRGB color.</p> 441 * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this 442 * control is overridden by the AWB routine. When AWB is disabled, the 443 * application controls how the color mapping is performed.</p> 444 * <p>We define the expected processing pipeline below. For consistency 445 * across devices, this is always the case with TRANSFORM_MATRIX.</p> 446 * <p>When either FAST or HIGH_QUALITY is used, the camera device may 447 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 448 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the 449 * camera device (in the results) and be roughly correct.</p> 450 * <p>Switching to TRANSFORM_MATRIX and using the data provided from 451 * FAST or HIGH_QUALITY will yield a picture with the same white point 452 * as what was produced by the camera device in the earlier frame.</p> 453 * <p>The expected processing pipeline is as follows:</p> 454 * <p><img alt="White balance processing pipeline" src="/reference/images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p> 455 * <p>The white balance is encoded by two values, a 4-channel white-balance 456 * gain vector (applied in the Bayer domain), and a 3x3 color transform 457 * matrix (applied after demosaic).</p> 458 * <p>The 4-channel white-balance gains are defined as:</p> 459 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ] 460 * </code></pre> 461 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the 462 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows. 463 * These may be identical for a given camera device implementation; if 464 * the camera device does not support a separate gain for even/odd green 465 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to 466 * <code>G_even</code> in the output result metadata.</p> 467 * <p>The matrices for color transforms are defined as a 9-entry vector:</p> 468 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ] 469 * </code></pre> 470 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>, 471 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p> 472 * <p>with colors as follows:</p> 473 * <pre><code>r' = I0r + I1g + I2b 474 * g' = I3r + I4g + I5b 475 * b' = I6r + I7g + I8b 476 * </code></pre> 477 * <p>Both the input and output value ranges must match. Overflow/underflow 478 * values are clipped to fit within the range.</p> 479 * <p><b>Possible values:</b></p> 480 * <ul> 481 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li> 482 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li> 483 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 484 * </ul> 485 * 486 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 487 * <p><b>Full capability</b> - 488 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 489 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 490 * 491 * @see CaptureRequest#COLOR_CORRECTION_GAINS 492 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 493 * @see CaptureRequest#CONTROL_AWB_MODE 494 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 495 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX 496 * @see #COLOR_CORRECTION_MODE_FAST 497 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY 498 */ 499 @PublicKey 500 @NonNull 501 public static final Key<Integer> COLOR_CORRECTION_MODE = 502 new Key<Integer>("android.colorCorrection.mode", int.class); 503 504 /** 505 * <p>A color transform matrix to use to transform 506 * from sensor RGB color space to output linear sRGB color space.</p> 507 * <p>This matrix is either set by the camera device when the request 508 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or 509 * directly by the application in the request when the 510 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> 511 * <p>In the latter case, the camera device may round the matrix to account 512 * for precision issues; the final rounded matrix should be reported back 513 * in this matrix result metadata. The transform should keep the magnitude 514 * of the output color values within <code>[0, 1.0]</code> (assuming input color 515 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p> 516 * <p>The valid range of each matrix element varies on different devices, but 517 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p> 518 * <p><b>Units</b>: Unitless scale factors</p> 519 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 520 * <p><b>Full capability</b> - 521 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 522 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 523 * 524 * @see CaptureRequest#COLOR_CORRECTION_MODE 525 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 526 */ 527 @PublicKey 528 @NonNull 529 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM = 530 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class); 531 532 /** 533 * <p>Gains applying to Bayer raw color channels for 534 * white-balance.</p> 535 * <p>These per-channel gains are either set by the camera device 536 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not 537 * TRANSFORM_MATRIX, or directly by the application in the 538 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is 539 * TRANSFORM_MATRIX.</p> 540 * <p>The gains in the result metadata are the gains actually 541 * applied by the camera device to the current frame.</p> 542 * <p>The valid range of gains varies on different devices, but gains 543 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given 544 * device allows gains below 1.0, this is usually not recommended because 545 * this can create color artifacts.</p> 546 * <p><b>Units</b>: Unitless gain factors</p> 547 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 548 * <p><b>Full capability</b> - 549 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 550 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 551 * 552 * @see CaptureRequest#COLOR_CORRECTION_MODE 553 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 554 */ 555 @PublicKey 556 @NonNull 557 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS = 558 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class); 559 560 /** 561 * <p>Mode of operation for the chromatic aberration correction algorithm.</p> 562 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light 563 * can not focus on the same point after exiting from the lens. This metadata defines 564 * the high level control of chromatic aberration correction algorithm, which aims to 565 * minimize the chromatic artifacts that may occur along the object boundaries in an 566 * image.</p> 567 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration 568 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will 569 * use the highest-quality aberration correction algorithms, even if it slows down 570 * capture rate. FAST means the camera device will not slow down capture rate when 571 * applying aberration correction.</p> 572 * <p>LEGACY devices will always be in FAST mode.</p> 573 * <p><b>Possible values:</b></p> 574 * <ul> 575 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li> 576 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li> 577 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 578 * </ul> 579 * 580 * <p><b>Available values for this device:</b><br> 581 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p> 582 * <p>This key is available on all devices.</p> 583 * 584 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES 585 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF 586 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST 587 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY 588 */ 589 @PublicKey 590 @NonNull 591 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE = 592 new Key<Integer>("android.colorCorrection.aberrationMode", int.class); 593 594 /** 595 * <p>The desired setting for the camera device's auto-exposure 596 * algorithm's antibanding compensation.</p> 597 * <p>Some kinds of lighting fixtures, such as some fluorescent 598 * lights, flicker at the rate of the power supply frequency 599 * (60Hz or 50Hz, depending on country). While this is 600 * typically not noticeable to a person, it can be visible to 601 * a camera device. If a camera sets its exposure time to the 602 * wrong value, the flicker may become visible in the 603 * viewfinder as flicker or in a final captured image, as a 604 * set of variable-brightness bands across the image.</p> 605 * <p>Therefore, the auto-exposure routines of camera devices 606 * include antibanding routines that ensure that the chosen 607 * exposure value will not cause such banding. The choice of 608 * exposure time depends on the rate of flicker, which the 609 * camera device can detect automatically, or the expected 610 * rate can be selected by the application using this 611 * control.</p> 612 * <p>A given camera device may not support all of the possible 613 * options for the antibanding mode. The 614 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains 615 * the available modes for a given camera device.</p> 616 * <p>AUTO mode is the default if it is available on given 617 * camera device. When AUTO mode is not available, the 618 * default will be either 50HZ or 60HZ, and both 50HZ 619 * and 60HZ will be available.</p> 620 * <p>If manual exposure control is enabled (by setting 621 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF), 622 * then this setting has no effect, and the application must 623 * ensure it selects exposure times that do not cause banding 624 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist 625 * the application in this.</p> 626 * <p><b>Possible values:</b></p> 627 * <ul> 628 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li> 629 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li> 630 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li> 631 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li> 632 * </ul> 633 * 634 * <p><b>Available values for this device:</b><br></p> 635 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p> 636 * <p>This key is available on all devices.</p> 637 * 638 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES 639 * @see CaptureRequest#CONTROL_AE_MODE 640 * @see CaptureRequest#CONTROL_MODE 641 * @see CaptureResult#STATISTICS_SCENE_FLICKER 642 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF 643 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ 644 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ 645 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO 646 */ 647 @PublicKey 648 @NonNull 649 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = 650 new Key<Integer>("android.control.aeAntibandingMode", int.class); 651 652 /** 653 * <p>Adjustment to auto-exposure (AE) target image 654 * brightness.</p> 655 * <p>The adjustment is measured as a count of steps, with the 656 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the 657 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p> 658 * <p>For example, if the exposure value (EV) step is 0.333, '6' 659 * will mean an exposure compensation of +2 EV; -3 will mean an 660 * exposure compensation of -1 EV. One EV represents a doubling 661 * of image brightness. Note that this control will only be 662 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control 663 * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p> 664 * <p>In the event of exposure compensation value being changed, camera device 665 * may take several frames to reach the newly requested exposure target. 666 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING 667 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will 668 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or 669 * FLASH_REQUIRED (if the scene is too dark for still capture).</p> 670 * <p><b>Units</b>: Compensation steps</p> 671 * <p><b>Range of valid values:</b><br> 672 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p> 673 * <p>This key is available on all devices.</p> 674 * 675 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE 676 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP 677 * @see CaptureRequest#CONTROL_AE_LOCK 678 * @see CaptureRequest#CONTROL_AE_MODE 679 * @see CaptureResult#CONTROL_AE_STATE 680 */ 681 @PublicKey 682 @NonNull 683 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = 684 new Key<Integer>("android.control.aeExposureCompensation", int.class); 685 686 /** 687 * <p>Whether auto-exposure (AE) is currently locked to its latest 688 * calculated values.</p> 689 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters, 690 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p> 691 * <p>Note that even when AE is locked, the flash may be fired if 692 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / 693 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p> 694 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock 695 * is ON, the camera device will still adjust its exposure value.</p> 696 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) 697 * when AE is already locked, the camera device will not change the exposure time 698 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}) 699 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} 700 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the 701 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed. 702 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p> 703 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock 704 * the AE if AE is locked by the camera device internally during precapture metering 705 * sequence In other words, submitting requests with AE unlock has no effect for an 706 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence 707 * will never succeed in a sequence of preview requests where AE lock is always set 708 * to <code>false</code>.</p> 709 * <p>Since the camera device has a pipeline of in-flight requests, the settings that 710 * get locked do not necessarily correspond to the settings that were present in the 711 * latest capture result received from the camera device, since additional captures 712 * and AE updates may have occurred even before the result was sent out. If an 713 * application is switching between automatic and manual control and wishes to eliminate 714 * any flicker during the switch, the following procedure is recommended:</p> 715 * <ol> 716 * <li>Starting in auto-AE mode:</li> 717 * <li>Lock AE</li> 718 * <li>Wait for the first result to be output that has the AE locked</li> 719 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li> 720 * <li>Submit the capture request, proceed to run manual AE as desired.</li> 721 * </ol> 722 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p> 723 * <p>This key is available on all devices.</p> 724 * 725 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION 726 * @see CaptureRequest#CONTROL_AE_MODE 727 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 728 * @see CaptureResult#CONTROL_AE_STATE 729 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 730 * @see CaptureRequest#SENSOR_SENSITIVITY 731 */ 732 @PublicKey 733 @NonNull 734 public static final Key<Boolean> CONTROL_AE_LOCK = 735 new Key<Boolean>("android.control.aeLock", boolean.class); 736 737 /** 738 * <p>The desired mode for the camera device's 739 * auto-exposure routine.</p> 740 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is 741 * AUTO.</p> 742 * <p>When set to any of the ON modes, the camera device's 743 * auto-exposure routine is enabled, overriding the 744 * application's selected exposure time, sensor sensitivity, 745 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 746 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and 747 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes 748 * is selected, the camera device's flash unit controls are 749 * also overridden.</p> 750 * <p>The FLASH modes are only available if the camera device 751 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> 752 * <p>If flash TORCH mode is desired, this field must be set to 753 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> 754 * <p>When set to any of the ON modes, the values chosen by the 755 * camera device auto-exposure routine for the overridden 756 * fields for a given capture will be available in its 757 * CaptureResult.</p> 758 * <p><b>Possible values:</b></p> 759 * <ul> 760 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li> 761 * <li>{@link #CONTROL_AE_MODE_ON ON}</li> 762 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li> 763 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li> 764 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li> 765 * <li>{@link #CONTROL_AE_MODE_ON_EXTERNAL_FLASH ON_EXTERNAL_FLASH}</li> 766 * </ul> 767 * 768 * <p><b>Available values for this device:</b><br> 769 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p> 770 * <p>This key is available on all devices.</p> 771 * 772 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES 773 * @see CaptureRequest#CONTROL_MODE 774 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 775 * @see CaptureRequest#FLASH_MODE 776 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 777 * @see CaptureRequest#SENSOR_FRAME_DURATION 778 * @see CaptureRequest#SENSOR_SENSITIVITY 779 * @see #CONTROL_AE_MODE_OFF 780 * @see #CONTROL_AE_MODE_ON 781 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH 782 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH 783 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE 784 * @see #CONTROL_AE_MODE_ON_EXTERNAL_FLASH 785 */ 786 @PublicKey 787 @NonNull 788 public static final Key<Integer> CONTROL_AE_MODE = 789 new Key<Integer>("android.control.aeMode", int.class); 790 791 /** 792 * <p>List of metering areas to use for auto-exposure adjustment.</p> 793 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0. 794 * Otherwise will always be present.</p> 795 * <p>The maximum number of regions supported by the device is determined by the value 796 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p> 797 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 798 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being 799 * the top-left pixel in the active pixel array, and 800 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 801 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the 802 * active pixel array.</p> 803 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 804 * system depends on the mode being set. 805 * When the distortion correction mode is OFF, the coordinate system follows 806 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with 807 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and 808 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1, 809 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right 810 * pixel in the pre-correction active pixel array. 811 * When the distortion correction mode is not OFF, the coordinate system follows 812 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with 813 * <code>(0, 0)</code> being the top-left pixel of the active array, and 814 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 815 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the 816 * active pixel array.</p> 817 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight 818 * for every pixel in the area. This means that a large metering area 819 * with the same weight as a smaller area will have more effect in 820 * the metering result. Metering areas can partially overlap and the 821 * camera device will add the weights in the overlap region.</p> 822 * <p>The weights are relative to weights of other exposure metering regions, so if only one 823 * region is used, all non-zero weights will have the same effect. A region with 0 824 * weight is ignored.</p> 825 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the 826 * camera device.</p> 827 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in 828 * capture result metadata, the camera device will ignore the sections outside the crop 829 * region and output only the intersection rectangle as the metering region in the result 830 * metadata. If the region is entirely outside the crop region, it will be ignored and 831 * not reported in the result metadata.</p> 832 * <p>When setting the AE metering regions, the application must consider the additional 833 * crop resulted from the aspect ratio differences between the preview stream and 834 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}. For example, if the {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} is the full 835 * active array size with 4:3 aspect ratio, and the preview stream is 16:9, 836 * the boundary of AE regions will be [0, y_crop] and 837 * [active_width, active_height - 2 * y_crop] rather than [0, 0] and 838 * [active_width, active_height], where y_crop is the additional crop due to aspect ratio 839 * mismatch.</p> 840 * <p>Starting from API level 30, the coordinate system of activeArraySize or 841 * preCorrectionActiveArraySize is used to represent post-zoomRatio field of view, not 842 * pre-zoom field of view. This means that the same aeRegions values at different 843 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} represent different parts of the scene. The aeRegions 844 * coordinates are relative to the activeArray/preCorrectionActiveArray representing the 845 * zoomed field of view. If {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} is set to 1.0 (default), the same 846 * aeRegions at different {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} still represent the same parts of the 847 * scene as they do before. See {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details. Whether to use 848 * activeArraySize or preCorrectionActiveArraySize still depends on distortion correction 849 * mode.</p> 850 * <p>For camera devices with the 851 * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR } 852 * capability, 853 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION android.sensor.info.activeArraySizeMaximumResolution} / 854 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION android.sensor.info.preCorrectionActiveArraySizeMaximumResolution} must be used as the 855 * coordinate system for requests where {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to 856 * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p> 857 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or 858 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on 859 * distortion correction capability and mode</p> 860 * <p><b>Range of valid values:</b><br> 861 * Coordinates must be between <code>[(0,0), (width, height))</code> of 862 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} 863 * depending on distortion correction capability and mode</p> 864 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 865 * 866 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE 867 * @see CaptureRequest#CONTROL_ZOOM_RATIO 868 * @see CaptureRequest#DISTORTION_CORRECTION_MODE 869 * @see CaptureRequest#SCALER_CROP_REGION 870 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 871 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION 872 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE 873 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION 874 * @see CaptureRequest#SENSOR_PIXEL_MODE 875 */ 876 @PublicKey 877 @NonNull 878 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS = 879 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class); 880 881 /** 882 * <p>Range over which the auto-exposure routine can 883 * adjust the capture frame rate to maintain good 884 * exposure.</p> 885 * <p>Only constrains auto-exposure (AE) algorithm, not 886 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and 887 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p> 888 * <p><b>Units</b>: Frames per second (FPS)</p> 889 * <p><b>Range of valid values:</b><br> 890 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p> 891 * <p>This key is available on all devices.</p> 892 * 893 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES 894 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 895 * @see CaptureRequest#SENSOR_FRAME_DURATION 896 */ 897 @PublicKey 898 @NonNull 899 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE = 900 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }}); 901 902 /** 903 * <p>Whether the camera device will trigger a precapture 904 * metering sequence when it processes this request.</p> 905 * <p>This entry is normally set to IDLE, or is not 906 * included at all in the request settings. When included and 907 * set to START, the camera device will trigger the auto-exposure (AE) 908 * precapture metering sequence.</p> 909 * <p>When set to CANCEL, the camera device will cancel any active 910 * precapture metering trigger, and return to its initial AE state. 911 * If a precapture metering sequence is already completed, and the camera 912 * device has implicitly locked the AE for subsequent still capture, the 913 * CANCEL trigger will unlock the AE and return to its initial AE state.</p> 914 * <p>The precapture sequence should be triggered before starting a 915 * high-quality still capture for final metering decisions to 916 * be made, and for firing pre-capture flash pulses to estimate 917 * scene brightness and required final capture flash power, when 918 * the flash is enabled.</p> 919 * <p>Normally, this entry should be set to START for only a 920 * single request, and the application should wait until the 921 * sequence completes before starting a new one.</p> 922 * <p>When a precapture metering sequence is finished, the camera device 923 * may lock the auto-exposure routine internally to be able to accurately expose the 924 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>). 925 * For this case, the AE may not resume normal scan if no subsequent still capture is 926 * submitted. To ensure that the AE routine restarts normal scan, the application should 927 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request 928 * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a 929 * still capture request after the precapture sequence completes. Alternatively, for 930 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device 931 * internally locked AE if the application doesn't submit a still capture request after 932 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not 933 * be used in devices that have earlier API levels.</p> 934 * <p>The exact effect of auto-exposure (AE) precapture trigger 935 * depends on the current AE mode and state; see 936 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition 937 * details.</p> 938 * <p>On LEGACY-level devices, the precapture trigger is not supported; 939 * capturing a high-resolution JPEG image will automatically trigger a 940 * precapture sequence before the high-resolution capture, including 941 * potentially firing a pre-capture flash.</p> 942 * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} 943 * simultaneously is allowed. However, since these triggers often require cooperation between 944 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a 945 * focus sweep), the camera device may delay acting on a later trigger until the previous 946 * trigger has been fully handled. This may lead to longer intervals between the trigger and 947 * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for 948 * example.</p> 949 * <p>If both the precapture and the auto-focus trigger are activated on the same request, then 950 * the camera device will complete them in the optimal order for that device.</p> 951 * <p><b>Possible values:</b></p> 952 * <ul> 953 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li> 954 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li> 955 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li> 956 * </ul> 957 * 958 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 959 * <p><b>Limited capability</b> - 960 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 961 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 962 * 963 * @see CaptureRequest#CONTROL_AE_LOCK 964 * @see CaptureResult#CONTROL_AE_STATE 965 * @see CaptureRequest#CONTROL_AF_TRIGGER 966 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 967 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 968 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE 969 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START 970 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL 971 */ 972 @PublicKey 973 @NonNull 974 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = 975 new Key<Integer>("android.control.aePrecaptureTrigger", int.class); 976 977 /** 978 * <p>Current state of the auto-exposure (AE) algorithm.</p> 979 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always 980 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, 981 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all 982 * the algorithm states to INACTIVE.</p> 983 * <p>The camera device can do several state transitions between two results, if it is 984 * allowed by the state transition table. For example: INACTIVE may never actually be 985 * seen in a result.</p> 986 * <p>The state in the result is the state for this image (in sync with this image): if 987 * AE state becomes CONVERGED, then the image data associated with this result should 988 * be good to use.</p> 989 * <p>Below are state transition tables for different AE modes.</p> 990 * <table> 991 * <thead> 992 * <tr> 993 * <th style="text-align: center;">State</th> 994 * <th style="text-align: center;">Transition Cause</th> 995 * <th style="text-align: center;">New State</th> 996 * <th style="text-align: center;">Notes</th> 997 * </tr> 998 * </thead> 999 * <tbody> 1000 * <tr> 1001 * <td style="text-align: center;">INACTIVE</td> 1002 * <td style="text-align: center;"></td> 1003 * <td style="text-align: center;">INACTIVE</td> 1004 * <td style="text-align: center;">Camera device auto exposure algorithm is disabled</td> 1005 * </tr> 1006 * </tbody> 1007 * </table> 1008 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON*:</p> 1009 * <table> 1010 * <thead> 1011 * <tr> 1012 * <th style="text-align: center;">State</th> 1013 * <th style="text-align: center;">Transition Cause</th> 1014 * <th style="text-align: center;">New State</th> 1015 * <th style="text-align: center;">Notes</th> 1016 * </tr> 1017 * </thead> 1018 * <tbody> 1019 * <tr> 1020 * <td style="text-align: center;">INACTIVE</td> 1021 * <td style="text-align: center;">Camera device initiates AE scan</td> 1022 * <td style="text-align: center;">SEARCHING</td> 1023 * <td style="text-align: center;">Values changing</td> 1024 * </tr> 1025 * <tr> 1026 * <td style="text-align: center;">INACTIVE</td> 1027 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> 1028 * <td style="text-align: center;">LOCKED</td> 1029 * <td style="text-align: center;">Values locked</td> 1030 * </tr> 1031 * <tr> 1032 * <td style="text-align: center;">SEARCHING</td> 1033 * <td style="text-align: center;">Camera device finishes AE scan</td> 1034 * <td style="text-align: center;">CONVERGED</td> 1035 * <td style="text-align: center;">Good values, not changing</td> 1036 * </tr> 1037 * <tr> 1038 * <td style="text-align: center;">SEARCHING</td> 1039 * <td style="text-align: center;">Camera device finishes AE scan</td> 1040 * <td style="text-align: center;">FLASH_REQUIRED</td> 1041 * <td style="text-align: center;">Converged but too dark w/o flash</td> 1042 * </tr> 1043 * <tr> 1044 * <td style="text-align: center;">SEARCHING</td> 1045 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> 1046 * <td style="text-align: center;">LOCKED</td> 1047 * <td style="text-align: center;">Values locked</td> 1048 * </tr> 1049 * <tr> 1050 * <td style="text-align: center;">CONVERGED</td> 1051 * <td style="text-align: center;">Camera device initiates AE scan</td> 1052 * <td style="text-align: center;">SEARCHING</td> 1053 * <td style="text-align: center;">Values changing</td> 1054 * </tr> 1055 * <tr> 1056 * <td style="text-align: center;">CONVERGED</td> 1057 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> 1058 * <td style="text-align: center;">LOCKED</td> 1059 * <td style="text-align: center;">Values locked</td> 1060 * </tr> 1061 * <tr> 1062 * <td style="text-align: center;">FLASH_REQUIRED</td> 1063 * <td style="text-align: center;">Camera device initiates AE scan</td> 1064 * <td style="text-align: center;">SEARCHING</td> 1065 * <td style="text-align: center;">Values changing</td> 1066 * </tr> 1067 * <tr> 1068 * <td style="text-align: center;">FLASH_REQUIRED</td> 1069 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> 1070 * <td style="text-align: center;">LOCKED</td> 1071 * <td style="text-align: center;">Values locked</td> 1072 * </tr> 1073 * <tr> 1074 * <td style="text-align: center;">LOCKED</td> 1075 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> 1076 * <td style="text-align: center;">SEARCHING</td> 1077 * <td style="text-align: center;">Values not good after unlock</td> 1078 * </tr> 1079 * <tr> 1080 * <td style="text-align: center;">LOCKED</td> 1081 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> 1082 * <td style="text-align: center;">CONVERGED</td> 1083 * <td style="text-align: center;">Values good after unlock</td> 1084 * </tr> 1085 * <tr> 1086 * <td style="text-align: center;">LOCKED</td> 1087 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> 1088 * <td style="text-align: center;">FLASH_REQUIRED</td> 1089 * <td style="text-align: center;">Exposure good, but too dark</td> 1090 * </tr> 1091 * <tr> 1092 * <td style="text-align: center;">PRECAPTURE</td> 1093 * <td style="text-align: center;">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> 1094 * <td style="text-align: center;">CONVERGED</td> 1095 * <td style="text-align: center;">Ready for high-quality capture</td> 1096 * </tr> 1097 * <tr> 1098 * <td style="text-align: center;">PRECAPTURE</td> 1099 * <td style="text-align: center;">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> 1100 * <td style="text-align: center;">LOCKED</td> 1101 * <td style="text-align: center;">Ready for high-quality capture</td> 1102 * </tr> 1103 * <tr> 1104 * <td style="text-align: center;">LOCKED</td> 1105 * <td style="text-align: center;">aeLock is ON and aePrecaptureTrigger is START</td> 1106 * <td style="text-align: center;">LOCKED</td> 1107 * <td style="text-align: center;">Precapture trigger is ignored when AE is already locked</td> 1108 * </tr> 1109 * <tr> 1110 * <td style="text-align: center;">LOCKED</td> 1111 * <td style="text-align: center;">aeLock is ON and aePrecaptureTrigger is CANCEL</td> 1112 * <td style="text-align: center;">LOCKED</td> 1113 * <td style="text-align: center;">Precapture trigger is ignored when AE is already locked</td> 1114 * </tr> 1115 * <tr> 1116 * <td style="text-align: center;">Any state (excluding LOCKED)</td> 1117 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td> 1118 * <td style="text-align: center;">PRECAPTURE</td> 1119 * <td style="text-align: center;">Start AE precapture metering sequence</td> 1120 * </tr> 1121 * <tr> 1122 * <td style="text-align: center;">Any state (excluding LOCKED)</td> 1123 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td> 1124 * <td style="text-align: center;">INACTIVE</td> 1125 * <td style="text-align: center;">Currently active precapture metering sequence is canceled</td> 1126 * </tr> 1127 * </tbody> 1128 * </table> 1129 * <p>If the camera device supports AE external flash mode (ON_EXTERNAL_FLASH is included in 1130 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}), {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} must be FLASH_REQUIRED after 1131 * the camera device finishes AE scan and it's too dark without flash.</p> 1132 * <p>For the above table, the camera device may skip reporting any state changes that happen 1133 * without application intervention (i.e. mode switch, trigger, locking). Any state that 1134 * can be skipped in that manner is called a transient state.</p> 1135 * <p>For example, for above AE modes (AE_MODE_ON*), in addition to the state transitions 1136 * listed in above table, it is also legal for the camera device to skip one or more 1137 * transient states between two results. See below table for examples:</p> 1138 * <table> 1139 * <thead> 1140 * <tr> 1141 * <th style="text-align: center;">State</th> 1142 * <th style="text-align: center;">Transition Cause</th> 1143 * <th style="text-align: center;">New State</th> 1144 * <th style="text-align: center;">Notes</th> 1145 * </tr> 1146 * </thead> 1147 * <tbody> 1148 * <tr> 1149 * <td style="text-align: center;">INACTIVE</td> 1150 * <td style="text-align: center;">Camera device finished AE scan</td> 1151 * <td style="text-align: center;">CONVERGED</td> 1152 * <td style="text-align: center;">Values are already good, transient states are skipped by camera device.</td> 1153 * </tr> 1154 * <tr> 1155 * <td style="text-align: center;">Any state (excluding LOCKED)</td> 1156 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td> 1157 * <td style="text-align: center;">FLASH_REQUIRED</td> 1158 * <td style="text-align: center;">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td> 1159 * </tr> 1160 * <tr> 1161 * <td style="text-align: center;">Any state (excluding LOCKED)</td> 1162 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td> 1163 * <td style="text-align: center;">CONVERGED</td> 1164 * <td style="text-align: center;">Converged after a precapture sequence, transient states are skipped by camera device.</td> 1165 * </tr> 1166 * <tr> 1167 * <td style="text-align: center;">Any state (excluding LOCKED)</td> 1168 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td> 1169 * <td style="text-align: center;">FLASH_REQUIRED</td> 1170 * <td style="text-align: center;">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td> 1171 * </tr> 1172 * <tr> 1173 * <td style="text-align: center;">Any state (excluding LOCKED)</td> 1174 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td> 1175 * <td style="text-align: center;">CONVERGED</td> 1176 * <td style="text-align: center;">Converged after a precapture sequences canceled, transient states are skipped by camera device.</td> 1177 * </tr> 1178 * <tr> 1179 * <td style="text-align: center;">CONVERGED</td> 1180 * <td style="text-align: center;">Camera device finished AE scan</td> 1181 * <td style="text-align: center;">FLASH_REQUIRED</td> 1182 * <td style="text-align: center;">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td> 1183 * </tr> 1184 * <tr> 1185 * <td style="text-align: center;">FLASH_REQUIRED</td> 1186 * <td style="text-align: center;">Camera device finished AE scan</td> 1187 * <td style="text-align: center;">CONVERGED</td> 1188 * <td style="text-align: center;">Converged after a new scan, transient states are skipped by camera device.</td> 1189 * </tr> 1190 * </tbody> 1191 * </table> 1192 * <p><b>Possible values:</b></p> 1193 * <ul> 1194 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li> 1195 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li> 1196 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li> 1197 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li> 1198 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li> 1199 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li> 1200 * </ul> 1201 * 1202 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 1203 * <p><b>Limited capability</b> - 1204 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 1205 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 1206 * 1207 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES 1208 * @see CaptureRequest#CONTROL_AE_LOCK 1209 * @see CaptureRequest#CONTROL_AE_MODE 1210 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 1211 * @see CaptureResult#CONTROL_AE_STATE 1212 * @see CaptureRequest#CONTROL_MODE 1213 * @see CaptureRequest#CONTROL_SCENE_MODE 1214 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 1215 * @see #CONTROL_AE_STATE_INACTIVE 1216 * @see #CONTROL_AE_STATE_SEARCHING 1217 * @see #CONTROL_AE_STATE_CONVERGED 1218 * @see #CONTROL_AE_STATE_LOCKED 1219 * @see #CONTROL_AE_STATE_FLASH_REQUIRED 1220 * @see #CONTROL_AE_STATE_PRECAPTURE 1221 */ 1222 @PublicKey 1223 @NonNull 1224 public static final Key<Integer> CONTROL_AE_STATE = 1225 new Key<Integer>("android.control.aeState", int.class); 1226 1227 /** 1228 * <p>Whether auto-focus (AF) is currently enabled, and what 1229 * mode it is set to.</p> 1230 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus 1231 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} > 0</code>). Also note that 1232 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device 1233 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before 1234 * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p> 1235 * <p>If the lens is controlled by the camera device auto-focus algorithm, 1236 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState} 1237 * in result metadata.</p> 1238 * <p><b>Possible values:</b></p> 1239 * <ul> 1240 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li> 1241 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li> 1242 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li> 1243 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li> 1244 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li> 1245 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li> 1246 * </ul> 1247 * 1248 * <p><b>Available values for this device:</b><br> 1249 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p> 1250 * <p>This key is available on all devices.</p> 1251 * 1252 * @see CaptureRequest#CONTROL_AE_MODE 1253 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES 1254 * @see CaptureResult#CONTROL_AF_STATE 1255 * @see CaptureRequest#CONTROL_AF_TRIGGER 1256 * @see CaptureRequest#CONTROL_MODE 1257 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE 1258 * @see #CONTROL_AF_MODE_OFF 1259 * @see #CONTROL_AF_MODE_AUTO 1260 * @see #CONTROL_AF_MODE_MACRO 1261 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO 1262 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE 1263 * @see #CONTROL_AF_MODE_EDOF 1264 */ 1265 @PublicKey 1266 @NonNull 1267 public static final Key<Integer> CONTROL_AF_MODE = 1268 new Key<Integer>("android.control.afMode", int.class); 1269 1270 /** 1271 * <p>List of metering areas to use for auto-focus.</p> 1272 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0. 1273 * Otherwise will always be present.</p> 1274 * <p>The maximum number of focus areas supported by the device is determined by the value 1275 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p> 1276 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 1277 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being 1278 * the top-left pixel in the active pixel array, and 1279 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 1280 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the 1281 * active pixel array.</p> 1282 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 1283 * system depends on the mode being set. 1284 * When the distortion correction mode is OFF, the coordinate system follows 1285 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with 1286 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and 1287 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1, 1288 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right 1289 * pixel in the pre-correction active pixel array. 1290 * When the distortion correction mode is not OFF, the coordinate system follows 1291 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with 1292 * <code>(0, 0)</code> being the top-left pixel of the active array, and 1293 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 1294 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the 1295 * active pixel array.</p> 1296 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight 1297 * for every pixel in the area. This means that a large metering area 1298 * with the same weight as a smaller area will have more effect in 1299 * the metering result. Metering areas can partially overlap and the 1300 * camera device will add the weights in the overlap region.</p> 1301 * <p>The weights are relative to weights of other metering regions, so if only one region 1302 * is used, all non-zero weights will have the same effect. A region with 0 weight is 1303 * ignored.</p> 1304 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the 1305 * camera device. The capture result will either be a zero weight region as well, or 1306 * the region selected by the camera device as the focus area of interest.</p> 1307 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in 1308 * capture result metadata, the camera device will ignore the sections outside the crop 1309 * region and output only the intersection rectangle as the metering region in the result 1310 * metadata. If the region is entirely outside the crop region, it will be ignored and 1311 * not reported in the result metadata.</p> 1312 * <p>When setting the AF metering regions, the application must consider the additional 1313 * crop resulted from the aspect ratio differences between the preview stream and 1314 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}. For example, if the {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} is the full 1315 * active array size with 4:3 aspect ratio, and the preview stream is 16:9, 1316 * the boundary of AF regions will be [0, y_crop] and 1317 * [active_width, active_height - 2 * y_crop] rather than [0, 0] and 1318 * [active_width, active_height], where y_crop is the additional crop due to aspect ratio 1319 * mismatch.</p> 1320 * <p>Starting from API level 30, the coordinate system of activeArraySize or 1321 * preCorrectionActiveArraySize is used to represent post-zoomRatio field of view, not 1322 * pre-zoom field of view. This means that the same afRegions values at different 1323 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} represent different parts of the scene. The afRegions 1324 * coordinates are relative to the activeArray/preCorrectionActiveArray representing the 1325 * zoomed field of view. If {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} is set to 1.0 (default), the same 1326 * afRegions at different {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} still represent the same parts of the 1327 * scene as they do before. See {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details. Whether to use 1328 * activeArraySize or preCorrectionActiveArraySize still depends on distortion correction 1329 * mode.</p> 1330 * <p>For camera devices with the 1331 * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR } 1332 * capability, {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION android.sensor.info.activeArraySizeMaximumResolution} / 1333 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION android.sensor.info.preCorrectionActiveArraySizeMaximumResolution} must be used as the 1334 * coordinate system for requests where {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to 1335 * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p> 1336 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or 1337 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on 1338 * distortion correction capability and mode</p> 1339 * <p><b>Range of valid values:</b><br> 1340 * Coordinates must be between <code>[(0,0), (width, height))</code> of 1341 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} 1342 * depending on distortion correction capability and mode</p> 1343 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 1344 * 1345 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF 1346 * @see CaptureRequest#CONTROL_ZOOM_RATIO 1347 * @see CaptureRequest#DISTORTION_CORRECTION_MODE 1348 * @see CaptureRequest#SCALER_CROP_REGION 1349 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 1350 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION 1351 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE 1352 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION 1353 * @see CaptureRequest#SENSOR_PIXEL_MODE 1354 */ 1355 @PublicKey 1356 @NonNull 1357 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS = 1358 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class); 1359 1360 /** 1361 * <p>Whether the camera device will trigger autofocus for this request.</p> 1362 * <p>This entry is normally set to IDLE, or is not 1363 * included at all in the request settings.</p> 1364 * <p>When included and set to START, the camera device will trigger the 1365 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p> 1366 * <p>When set to CANCEL, the camera device will cancel any active trigger, 1367 * and return to its initial AF state.</p> 1368 * <p>Generally, applications should set this entry to START or CANCEL for only a 1369 * single capture, and then return it to IDLE (or not set at all). Specifying 1370 * START for multiple captures in a row means restarting the AF operation over 1371 * and over again.</p> 1372 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p> 1373 * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} 1374 * simultaneously is allowed. However, since these triggers often require cooperation between 1375 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a 1376 * focus sweep), the camera device may delay acting on a later trigger until the previous 1377 * trigger has been fully handled. This may lead to longer intervals between the trigger and 1378 * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p> 1379 * <p><b>Possible values:</b></p> 1380 * <ul> 1381 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li> 1382 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li> 1383 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li> 1384 * </ul> 1385 * 1386 * <p>This key is available on all devices.</p> 1387 * 1388 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 1389 * @see CaptureResult#CONTROL_AF_STATE 1390 * @see #CONTROL_AF_TRIGGER_IDLE 1391 * @see #CONTROL_AF_TRIGGER_START 1392 * @see #CONTROL_AF_TRIGGER_CANCEL 1393 */ 1394 @PublicKey 1395 @NonNull 1396 public static final Key<Integer> CONTROL_AF_TRIGGER = 1397 new Key<Integer>("android.control.afTrigger", int.class); 1398 1399 /** 1400 * <p>Current state of auto-focus (AF) algorithm.</p> 1401 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always 1402 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, 1403 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all 1404 * the algorithm states to INACTIVE.</p> 1405 * <p>The camera device can do several state transitions between two results, if it is 1406 * allowed by the state transition table. For example: INACTIVE may never actually be 1407 * seen in a result.</p> 1408 * <p>The state in the result is the state for this image (in sync with this image): if 1409 * AF state becomes FOCUSED, then the image data associated with this result should 1410 * be sharp.</p> 1411 * <p>Below are state transition tables for different AF modes.</p> 1412 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p> 1413 * <table> 1414 * <thead> 1415 * <tr> 1416 * <th style="text-align: center;">State</th> 1417 * <th style="text-align: center;">Transition Cause</th> 1418 * <th style="text-align: center;">New State</th> 1419 * <th style="text-align: center;">Notes</th> 1420 * </tr> 1421 * </thead> 1422 * <tbody> 1423 * <tr> 1424 * <td style="text-align: center;">INACTIVE</td> 1425 * <td style="text-align: center;"></td> 1426 * <td style="text-align: center;">INACTIVE</td> 1427 * <td style="text-align: center;">Never changes</td> 1428 * </tr> 1429 * </tbody> 1430 * </table> 1431 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p> 1432 * <table> 1433 * <thead> 1434 * <tr> 1435 * <th style="text-align: center;">State</th> 1436 * <th style="text-align: center;">Transition Cause</th> 1437 * <th style="text-align: center;">New State</th> 1438 * <th style="text-align: center;">Notes</th> 1439 * </tr> 1440 * </thead> 1441 * <tbody> 1442 * <tr> 1443 * <td style="text-align: center;">INACTIVE</td> 1444 * <td style="text-align: center;">AF_TRIGGER</td> 1445 * <td style="text-align: center;">ACTIVE_SCAN</td> 1446 * <td style="text-align: center;">Start AF sweep, Lens now moving</td> 1447 * </tr> 1448 * <tr> 1449 * <td style="text-align: center;">ACTIVE_SCAN</td> 1450 * <td style="text-align: center;">AF sweep done</td> 1451 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1452 * <td style="text-align: center;">Focused, Lens now locked</td> 1453 * </tr> 1454 * <tr> 1455 * <td style="text-align: center;">ACTIVE_SCAN</td> 1456 * <td style="text-align: center;">AF sweep done</td> 1457 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1458 * <td style="text-align: center;">Not focused, Lens now locked</td> 1459 * </tr> 1460 * <tr> 1461 * <td style="text-align: center;">ACTIVE_SCAN</td> 1462 * <td style="text-align: center;">AF_CANCEL</td> 1463 * <td style="text-align: center;">INACTIVE</td> 1464 * <td style="text-align: center;">Cancel/reset AF, Lens now locked</td> 1465 * </tr> 1466 * <tr> 1467 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1468 * <td style="text-align: center;">AF_CANCEL</td> 1469 * <td style="text-align: center;">INACTIVE</td> 1470 * <td style="text-align: center;">Cancel/reset AF</td> 1471 * </tr> 1472 * <tr> 1473 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1474 * <td style="text-align: center;">AF_TRIGGER</td> 1475 * <td style="text-align: center;">ACTIVE_SCAN</td> 1476 * <td style="text-align: center;">Start new sweep, Lens now moving</td> 1477 * </tr> 1478 * <tr> 1479 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1480 * <td style="text-align: center;">AF_CANCEL</td> 1481 * <td style="text-align: center;">INACTIVE</td> 1482 * <td style="text-align: center;">Cancel/reset AF</td> 1483 * </tr> 1484 * <tr> 1485 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1486 * <td style="text-align: center;">AF_TRIGGER</td> 1487 * <td style="text-align: center;">ACTIVE_SCAN</td> 1488 * <td style="text-align: center;">Start new sweep, Lens now moving</td> 1489 * </tr> 1490 * <tr> 1491 * <td style="text-align: center;">Any state</td> 1492 * <td style="text-align: center;">Mode change</td> 1493 * <td style="text-align: center;">INACTIVE</td> 1494 * <td style="text-align: center;"></td> 1495 * </tr> 1496 * </tbody> 1497 * </table> 1498 * <p>For the above table, the camera device may skip reporting any state changes that happen 1499 * without application intervention (i.e. mode switch, trigger, locking). Any state that 1500 * can be skipped in that manner is called a transient state.</p> 1501 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the 1502 * state transitions listed in above table, it is also legal for the camera device to skip 1503 * one or more transient states between two results. See below table for examples:</p> 1504 * <table> 1505 * <thead> 1506 * <tr> 1507 * <th style="text-align: center;">State</th> 1508 * <th style="text-align: center;">Transition Cause</th> 1509 * <th style="text-align: center;">New State</th> 1510 * <th style="text-align: center;">Notes</th> 1511 * </tr> 1512 * </thead> 1513 * <tbody> 1514 * <tr> 1515 * <td style="text-align: center;">INACTIVE</td> 1516 * <td style="text-align: center;">AF_TRIGGER</td> 1517 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1518 * <td style="text-align: center;">Focus is already good or good after a scan, lens is now locked.</td> 1519 * </tr> 1520 * <tr> 1521 * <td style="text-align: center;">INACTIVE</td> 1522 * <td style="text-align: center;">AF_TRIGGER</td> 1523 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1524 * <td style="text-align: center;">Focus failed after a scan, lens is now locked.</td> 1525 * </tr> 1526 * <tr> 1527 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1528 * <td style="text-align: center;">AF_TRIGGER</td> 1529 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1530 * <td style="text-align: center;">Focus is already good or good after a scan, lens is now locked.</td> 1531 * </tr> 1532 * <tr> 1533 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1534 * <td style="text-align: center;">AF_TRIGGER</td> 1535 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1536 * <td style="text-align: center;">Focus is good after a scan, lens is not locked.</td> 1537 * </tr> 1538 * </tbody> 1539 * </table> 1540 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p> 1541 * <table> 1542 * <thead> 1543 * <tr> 1544 * <th style="text-align: center;">State</th> 1545 * <th style="text-align: center;">Transition Cause</th> 1546 * <th style="text-align: center;">New State</th> 1547 * <th style="text-align: center;">Notes</th> 1548 * </tr> 1549 * </thead> 1550 * <tbody> 1551 * <tr> 1552 * <td style="text-align: center;">INACTIVE</td> 1553 * <td style="text-align: center;">Camera device initiates new scan</td> 1554 * <td style="text-align: center;">PASSIVE_SCAN</td> 1555 * <td style="text-align: center;">Start AF scan, Lens now moving</td> 1556 * </tr> 1557 * <tr> 1558 * <td style="text-align: center;">INACTIVE</td> 1559 * <td style="text-align: center;">AF_TRIGGER</td> 1560 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1561 * <td style="text-align: center;">AF state query, Lens now locked</td> 1562 * </tr> 1563 * <tr> 1564 * <td style="text-align: center;">PASSIVE_SCAN</td> 1565 * <td style="text-align: center;">Camera device completes current scan</td> 1566 * <td style="text-align: center;">PASSIVE_FOCUSED</td> 1567 * <td style="text-align: center;">End AF scan, Lens now locked</td> 1568 * </tr> 1569 * <tr> 1570 * <td style="text-align: center;">PASSIVE_SCAN</td> 1571 * <td style="text-align: center;">Camera device fails current scan</td> 1572 * <td style="text-align: center;">PASSIVE_UNFOCUSED</td> 1573 * <td style="text-align: center;">End AF scan, Lens now locked</td> 1574 * </tr> 1575 * <tr> 1576 * <td style="text-align: center;">PASSIVE_SCAN</td> 1577 * <td style="text-align: center;">AF_TRIGGER</td> 1578 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1579 * <td style="text-align: center;">Immediate transition, if focus is good. Lens now locked</td> 1580 * </tr> 1581 * <tr> 1582 * <td style="text-align: center;">PASSIVE_SCAN</td> 1583 * <td style="text-align: center;">AF_TRIGGER</td> 1584 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1585 * <td style="text-align: center;">Immediate transition, if focus is bad. Lens now locked</td> 1586 * </tr> 1587 * <tr> 1588 * <td style="text-align: center;">PASSIVE_SCAN</td> 1589 * <td style="text-align: center;">AF_CANCEL</td> 1590 * <td style="text-align: center;">INACTIVE</td> 1591 * <td style="text-align: center;">Reset lens position, Lens now locked</td> 1592 * </tr> 1593 * <tr> 1594 * <td style="text-align: center;">PASSIVE_FOCUSED</td> 1595 * <td style="text-align: center;">Camera device initiates new scan</td> 1596 * <td style="text-align: center;">PASSIVE_SCAN</td> 1597 * <td style="text-align: center;">Start AF scan, Lens now moving</td> 1598 * </tr> 1599 * <tr> 1600 * <td style="text-align: center;">PASSIVE_UNFOCUSED</td> 1601 * <td style="text-align: center;">Camera device initiates new scan</td> 1602 * <td style="text-align: center;">PASSIVE_SCAN</td> 1603 * <td style="text-align: center;">Start AF scan, Lens now moving</td> 1604 * </tr> 1605 * <tr> 1606 * <td style="text-align: center;">PASSIVE_FOCUSED</td> 1607 * <td style="text-align: center;">AF_TRIGGER</td> 1608 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1609 * <td style="text-align: center;">Immediate transition, lens now locked</td> 1610 * </tr> 1611 * <tr> 1612 * <td style="text-align: center;">PASSIVE_UNFOCUSED</td> 1613 * <td style="text-align: center;">AF_TRIGGER</td> 1614 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1615 * <td style="text-align: center;">Immediate transition, lens now locked</td> 1616 * </tr> 1617 * <tr> 1618 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1619 * <td style="text-align: center;">AF_TRIGGER</td> 1620 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1621 * <td style="text-align: center;">No effect</td> 1622 * </tr> 1623 * <tr> 1624 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1625 * <td style="text-align: center;">AF_CANCEL</td> 1626 * <td style="text-align: center;">INACTIVE</td> 1627 * <td style="text-align: center;">Restart AF scan</td> 1628 * </tr> 1629 * <tr> 1630 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1631 * <td style="text-align: center;">AF_TRIGGER</td> 1632 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1633 * <td style="text-align: center;">No effect</td> 1634 * </tr> 1635 * <tr> 1636 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1637 * <td style="text-align: center;">AF_CANCEL</td> 1638 * <td style="text-align: center;">INACTIVE</td> 1639 * <td style="text-align: center;">Restart AF scan</td> 1640 * </tr> 1641 * </tbody> 1642 * </table> 1643 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p> 1644 * <table> 1645 * <thead> 1646 * <tr> 1647 * <th style="text-align: center;">State</th> 1648 * <th style="text-align: center;">Transition Cause</th> 1649 * <th style="text-align: center;">New State</th> 1650 * <th style="text-align: center;">Notes</th> 1651 * </tr> 1652 * </thead> 1653 * <tbody> 1654 * <tr> 1655 * <td style="text-align: center;">INACTIVE</td> 1656 * <td style="text-align: center;">Camera device initiates new scan</td> 1657 * <td style="text-align: center;">PASSIVE_SCAN</td> 1658 * <td style="text-align: center;">Start AF scan, Lens now moving</td> 1659 * </tr> 1660 * <tr> 1661 * <td style="text-align: center;">INACTIVE</td> 1662 * <td style="text-align: center;">AF_TRIGGER</td> 1663 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1664 * <td style="text-align: center;">AF state query, Lens now locked</td> 1665 * </tr> 1666 * <tr> 1667 * <td style="text-align: center;">PASSIVE_SCAN</td> 1668 * <td style="text-align: center;">Camera device completes current scan</td> 1669 * <td style="text-align: center;">PASSIVE_FOCUSED</td> 1670 * <td style="text-align: center;">End AF scan, Lens now locked</td> 1671 * </tr> 1672 * <tr> 1673 * <td style="text-align: center;">PASSIVE_SCAN</td> 1674 * <td style="text-align: center;">Camera device fails current scan</td> 1675 * <td style="text-align: center;">PASSIVE_UNFOCUSED</td> 1676 * <td style="text-align: center;">End AF scan, Lens now locked</td> 1677 * </tr> 1678 * <tr> 1679 * <td style="text-align: center;">PASSIVE_SCAN</td> 1680 * <td style="text-align: center;">AF_TRIGGER</td> 1681 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1682 * <td style="text-align: center;">Eventual transition once the focus is good. Lens now locked</td> 1683 * </tr> 1684 * <tr> 1685 * <td style="text-align: center;">PASSIVE_SCAN</td> 1686 * <td style="text-align: center;">AF_TRIGGER</td> 1687 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1688 * <td style="text-align: center;">Eventual transition if cannot find focus. Lens now locked</td> 1689 * </tr> 1690 * <tr> 1691 * <td style="text-align: center;">PASSIVE_SCAN</td> 1692 * <td style="text-align: center;">AF_CANCEL</td> 1693 * <td style="text-align: center;">INACTIVE</td> 1694 * <td style="text-align: center;">Reset lens position, Lens now locked</td> 1695 * </tr> 1696 * <tr> 1697 * <td style="text-align: center;">PASSIVE_FOCUSED</td> 1698 * <td style="text-align: center;">Camera device initiates new scan</td> 1699 * <td style="text-align: center;">PASSIVE_SCAN</td> 1700 * <td style="text-align: center;">Start AF scan, Lens now moving</td> 1701 * </tr> 1702 * <tr> 1703 * <td style="text-align: center;">PASSIVE_UNFOCUSED</td> 1704 * <td style="text-align: center;">Camera device initiates new scan</td> 1705 * <td style="text-align: center;">PASSIVE_SCAN</td> 1706 * <td style="text-align: center;">Start AF scan, Lens now moving</td> 1707 * </tr> 1708 * <tr> 1709 * <td style="text-align: center;">PASSIVE_FOCUSED</td> 1710 * <td style="text-align: center;">AF_TRIGGER</td> 1711 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1712 * <td style="text-align: center;">Immediate trans. Lens now locked</td> 1713 * </tr> 1714 * <tr> 1715 * <td style="text-align: center;">PASSIVE_UNFOCUSED</td> 1716 * <td style="text-align: center;">AF_TRIGGER</td> 1717 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1718 * <td style="text-align: center;">Immediate trans. Lens now locked</td> 1719 * </tr> 1720 * <tr> 1721 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1722 * <td style="text-align: center;">AF_TRIGGER</td> 1723 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1724 * <td style="text-align: center;">No effect</td> 1725 * </tr> 1726 * <tr> 1727 * <td style="text-align: center;">FOCUSED_LOCKED</td> 1728 * <td style="text-align: center;">AF_CANCEL</td> 1729 * <td style="text-align: center;">INACTIVE</td> 1730 * <td style="text-align: center;">Restart AF scan</td> 1731 * </tr> 1732 * <tr> 1733 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1734 * <td style="text-align: center;">AF_TRIGGER</td> 1735 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1736 * <td style="text-align: center;">No effect</td> 1737 * </tr> 1738 * <tr> 1739 * <td style="text-align: center;">NOT_FOCUSED_LOCKED</td> 1740 * <td style="text-align: center;">AF_CANCEL</td> 1741 * <td style="text-align: center;">INACTIVE</td> 1742 * <td style="text-align: center;">Restart AF scan</td> 1743 * </tr> 1744 * </tbody> 1745 * </table> 1746 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO 1747 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the 1748 * camera device. When a trigger is included in a mode switch request, the trigger 1749 * will be evaluated in the context of the new mode in the request. 1750 * See below table for examples:</p> 1751 * <table> 1752 * <thead> 1753 * <tr> 1754 * <th style="text-align: center;">State</th> 1755 * <th style="text-align: center;">Transition Cause</th> 1756 * <th style="text-align: center;">New State</th> 1757 * <th style="text-align: center;">Notes</th> 1758 * </tr> 1759 * </thead> 1760 * <tbody> 1761 * <tr> 1762 * <td style="text-align: center;">any state</td> 1763 * <td style="text-align: center;">CAF-->AUTO mode switch</td> 1764 * <td style="text-align: center;">INACTIVE</td> 1765 * <td style="text-align: center;">Mode switch without trigger, initial state must be INACTIVE</td> 1766 * </tr> 1767 * <tr> 1768 * <td style="text-align: center;">any state</td> 1769 * <td style="text-align: center;">CAF-->AUTO mode switch with AF_TRIGGER</td> 1770 * <td style="text-align: center;">trigger-reachable states from INACTIVE</td> 1771 * <td style="text-align: center;">Mode switch with trigger, INACTIVE is skipped</td> 1772 * </tr> 1773 * <tr> 1774 * <td style="text-align: center;">any state</td> 1775 * <td style="text-align: center;">AUTO-->CAF mode switch</td> 1776 * <td style="text-align: center;">passively reachable states from INACTIVE</td> 1777 * <td style="text-align: center;">Mode switch without trigger, passive transient state is skipped</td> 1778 * </tr> 1779 * </tbody> 1780 * </table> 1781 * <p><b>Possible values:</b></p> 1782 * <ul> 1783 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li> 1784 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li> 1785 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li> 1786 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li> 1787 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li> 1788 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li> 1789 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li> 1790 * </ul> 1791 * 1792 * <p>This key is available on all devices.</p> 1793 * 1794 * @see CaptureRequest#CONTROL_AF_MODE 1795 * @see CaptureRequest#CONTROL_MODE 1796 * @see CaptureRequest#CONTROL_SCENE_MODE 1797 * @see #CONTROL_AF_STATE_INACTIVE 1798 * @see #CONTROL_AF_STATE_PASSIVE_SCAN 1799 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED 1800 * @see #CONTROL_AF_STATE_ACTIVE_SCAN 1801 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED 1802 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED 1803 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED 1804 */ 1805 @PublicKey 1806 @NonNull 1807 public static final Key<Integer> CONTROL_AF_STATE = 1808 new Key<Integer>("android.control.afState", int.class); 1809 1810 /** 1811 * <p>Whether auto-white balance (AWB) is currently locked to its 1812 * latest calculated values.</p> 1813 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters, 1814 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p> 1815 * <p>Since the camera device has a pipeline of in-flight requests, the settings that 1816 * get locked do not necessarily correspond to the settings that were present in the 1817 * latest capture result received from the camera device, since additional captures 1818 * and AWB updates may have occurred even before the result was sent out. If an 1819 * application is switching between automatic and manual control and wishes to eliminate 1820 * any flicker during the switch, the following procedure is recommended:</p> 1821 * <ol> 1822 * <li>Starting in auto-AWB mode:</li> 1823 * <li>Lock AWB</li> 1824 * <li>Wait for the first result to be output that has the AWB locked</li> 1825 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li> 1826 * <li>Submit the capture request, proceed to run manual AWB as desired.</li> 1827 * </ol> 1828 * <p>Note that AWB lock is only meaningful when 1829 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes, 1830 * AWB is already fixed to a specific setting.</p> 1831 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p> 1832 * <p>This key is available on all devices.</p> 1833 * 1834 * @see CaptureRequest#CONTROL_AWB_MODE 1835 */ 1836 @PublicKey 1837 @NonNull 1838 public static final Key<Boolean> CONTROL_AWB_LOCK = 1839 new Key<Boolean>("android.control.awbLock", boolean.class); 1840 1841 /** 1842 * <p>Whether auto-white balance (AWB) is currently setting the color 1843 * transform fields, and what its illumination target 1844 * is.</p> 1845 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p> 1846 * <p>When set to the AUTO mode, the camera device's auto-white balance 1847 * routine is enabled, overriding the application's selected 1848 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 1849 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} 1850 * is OFF, the behavior of AWB is device dependent. It is recommended to 1851 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before 1852 * setting AE mode to OFF.</p> 1853 * <p>When set to the OFF mode, the camera device's auto-white balance 1854 * routine is disabled. The application manually controls the white 1855 * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} 1856 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> 1857 * <p>When set to any other modes, the camera device's auto-white 1858 * balance routine is disabled. The camera device uses each 1859 * particular illumination target for white balance 1860 * adjustment. The application's values for 1861 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, 1862 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 1863 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p> 1864 * <p><b>Possible values:</b></p> 1865 * <ul> 1866 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li> 1867 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li> 1868 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li> 1869 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li> 1870 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li> 1871 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li> 1872 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li> 1873 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li> 1874 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li> 1875 * </ul> 1876 * 1877 * <p><b>Available values for this device:</b><br> 1878 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p> 1879 * <p>This key is available on all devices.</p> 1880 * 1881 * @see CaptureRequest#COLOR_CORRECTION_GAINS 1882 * @see CaptureRequest#COLOR_CORRECTION_MODE 1883 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 1884 * @see CaptureRequest#CONTROL_AE_MODE 1885 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES 1886 * @see CaptureRequest#CONTROL_AWB_LOCK 1887 * @see CaptureRequest#CONTROL_MODE 1888 * @see #CONTROL_AWB_MODE_OFF 1889 * @see #CONTROL_AWB_MODE_AUTO 1890 * @see #CONTROL_AWB_MODE_INCANDESCENT 1891 * @see #CONTROL_AWB_MODE_FLUORESCENT 1892 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT 1893 * @see #CONTROL_AWB_MODE_DAYLIGHT 1894 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT 1895 * @see #CONTROL_AWB_MODE_TWILIGHT 1896 * @see #CONTROL_AWB_MODE_SHADE 1897 */ 1898 @PublicKey 1899 @NonNull 1900 public static final Key<Integer> CONTROL_AWB_MODE = 1901 new Key<Integer>("android.control.awbMode", int.class); 1902 1903 /** 1904 * <p>List of metering areas to use for auto-white-balance illuminant 1905 * estimation.</p> 1906 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0. 1907 * Otherwise will always be present.</p> 1908 * <p>The maximum number of regions supported by the device is determined by the value 1909 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p> 1910 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 1911 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being 1912 * the top-left pixel in the active pixel array, and 1913 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 1914 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the 1915 * active pixel array.</p> 1916 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 1917 * system depends on the mode being set. 1918 * When the distortion correction mode is OFF, the coordinate system follows 1919 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with 1920 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and 1921 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1, 1922 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right 1923 * pixel in the pre-correction active pixel array. 1924 * When the distortion correction mode is not OFF, the coordinate system follows 1925 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with 1926 * <code>(0, 0)</code> being the top-left pixel of the active array, and 1927 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 1928 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the 1929 * active pixel array.</p> 1930 * <p>The weight must range from 0 to 1000, and represents a weight 1931 * for every pixel in the area. This means that a large metering area 1932 * with the same weight as a smaller area will have more effect in 1933 * the metering result. Metering areas can partially overlap and the 1934 * camera device will add the weights in the overlap region.</p> 1935 * <p>The weights are relative to weights of other white balance metering regions, so if 1936 * only one region is used, all non-zero weights will have the same effect. A region with 1937 * 0 weight is ignored.</p> 1938 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the 1939 * camera device.</p> 1940 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in 1941 * capture result metadata, the camera device will ignore the sections outside the crop 1942 * region and output only the intersection rectangle as the metering region in the result 1943 * metadata. If the region is entirely outside the crop region, it will be ignored and 1944 * not reported in the result metadata.</p> 1945 * <p>When setting the AWB metering regions, the application must consider the additional 1946 * crop resulted from the aspect ratio differences between the preview stream and 1947 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}. For example, if the {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} is the full 1948 * active array size with 4:3 aspect ratio, and the preview stream is 16:9, 1949 * the boundary of AWB regions will be [0, y_crop] and 1950 * [active_width, active_height - 2 * y_crop] rather than [0, 0] and 1951 * [active_width, active_height], where y_crop is the additional crop due to aspect ratio 1952 * mismatch.</p> 1953 * <p>Starting from API level 30, the coordinate system of activeArraySize or 1954 * preCorrectionActiveArraySize is used to represent post-zoomRatio field of view, not 1955 * pre-zoom field of view. This means that the same awbRegions values at different 1956 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} represent different parts of the scene. The awbRegions 1957 * coordinates are relative to the activeArray/preCorrectionActiveArray representing the 1958 * zoomed field of view. If {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} is set to 1.0 (default), the same 1959 * awbRegions at different {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} still represent the same parts of 1960 * the scene as they do before. See {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details. Whether to use 1961 * activeArraySize or preCorrectionActiveArraySize still depends on distortion correction 1962 * mode.</p> 1963 * <p>For camera devices with the 1964 * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR } 1965 * capability, {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION android.sensor.info.activeArraySizeMaximumResolution} / 1966 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION android.sensor.info.preCorrectionActiveArraySizeMaximumResolution} must be used as the 1967 * coordinate system for requests where {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to 1968 * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p> 1969 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or 1970 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on 1971 * distortion correction capability and mode</p> 1972 * <p><b>Range of valid values:</b><br> 1973 * Coordinates must be between <code>[(0,0), (width, height))</code> of 1974 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} 1975 * depending on distortion correction capability and mode</p> 1976 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 1977 * 1978 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB 1979 * @see CaptureRequest#CONTROL_ZOOM_RATIO 1980 * @see CaptureRequest#DISTORTION_CORRECTION_MODE 1981 * @see CaptureRequest#SCALER_CROP_REGION 1982 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 1983 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION 1984 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE 1985 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION 1986 * @see CaptureRequest#SENSOR_PIXEL_MODE 1987 */ 1988 @PublicKey 1989 @NonNull 1990 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS = 1991 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class); 1992 1993 /** 1994 * <p>Information to the camera device 3A (auto-exposure, 1995 * auto-focus, auto-white balance) routines about the purpose 1996 * of this capture, to help the camera device to decide optimal 3A 1997 * strategy.</p> 1998 * <p>This control (except for MANUAL) is only effective if 1999 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p> 2000 * <p>All intents are supported by all devices, except that:</p> 2001 * <ul> 2002 * <li>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains 2003 * PRIVATE_REPROCESSING or YUV_REPROCESSING.</li> 2004 * <li>MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains 2005 * MANUAL_SENSOR.</li> 2006 * <li>MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains 2007 * MOTION_TRACKING.</li> 2008 * </ul> 2009 * <p><b>Possible values:</b></p> 2010 * <ul> 2011 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li> 2012 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li> 2013 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li> 2014 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li> 2015 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li> 2016 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> 2017 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li> 2018 * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li> 2019 * </ul> 2020 * 2021 * <p>This key is available on all devices.</p> 2022 * 2023 * @see CaptureRequest#CONTROL_MODE 2024 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES 2025 * @see #CONTROL_CAPTURE_INTENT_CUSTOM 2026 * @see #CONTROL_CAPTURE_INTENT_PREVIEW 2027 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE 2028 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD 2029 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT 2030 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG 2031 * @see #CONTROL_CAPTURE_INTENT_MANUAL 2032 * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING 2033 */ 2034 @PublicKey 2035 @NonNull 2036 public static final Key<Integer> CONTROL_CAPTURE_INTENT = 2037 new Key<Integer>("android.control.captureIntent", int.class); 2038 2039 /** 2040 * <p>Current state of auto-white balance (AWB) algorithm.</p> 2041 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always 2042 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, 2043 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all 2044 * the algorithm states to INACTIVE.</p> 2045 * <p>The camera device can do several state transitions between two results, if it is 2046 * allowed by the state transition table. So INACTIVE may never actually be seen in 2047 * a result.</p> 2048 * <p>The state in the result is the state for this image (in sync with this image): if 2049 * AWB state becomes CONVERGED, then the image data associated with this result should 2050 * be good to use.</p> 2051 * <p>Below are state transition tables for different AWB modes.</p> 2052 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p> 2053 * <table> 2054 * <thead> 2055 * <tr> 2056 * <th style="text-align: center;">State</th> 2057 * <th style="text-align: center;">Transition Cause</th> 2058 * <th style="text-align: center;">New State</th> 2059 * <th style="text-align: center;">Notes</th> 2060 * </tr> 2061 * </thead> 2062 * <tbody> 2063 * <tr> 2064 * <td style="text-align: center;">INACTIVE</td> 2065 * <td style="text-align: center;"></td> 2066 * <td style="text-align: center;">INACTIVE</td> 2067 * <td style="text-align: center;">Camera device auto white balance algorithm is disabled</td> 2068 * </tr> 2069 * </tbody> 2070 * </table> 2071 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p> 2072 * <table> 2073 * <thead> 2074 * <tr> 2075 * <th style="text-align: center;">State</th> 2076 * <th style="text-align: center;">Transition Cause</th> 2077 * <th style="text-align: center;">New State</th> 2078 * <th style="text-align: center;">Notes</th> 2079 * </tr> 2080 * </thead> 2081 * <tbody> 2082 * <tr> 2083 * <td style="text-align: center;">INACTIVE</td> 2084 * <td style="text-align: center;">Camera device initiates AWB scan</td> 2085 * <td style="text-align: center;">SEARCHING</td> 2086 * <td style="text-align: center;">Values changing</td> 2087 * </tr> 2088 * <tr> 2089 * <td style="text-align: center;">INACTIVE</td> 2090 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> 2091 * <td style="text-align: center;">LOCKED</td> 2092 * <td style="text-align: center;">Values locked</td> 2093 * </tr> 2094 * <tr> 2095 * <td style="text-align: center;">SEARCHING</td> 2096 * <td style="text-align: center;">Camera device finishes AWB scan</td> 2097 * <td style="text-align: center;">CONVERGED</td> 2098 * <td style="text-align: center;">Good values, not changing</td> 2099 * </tr> 2100 * <tr> 2101 * <td style="text-align: center;">SEARCHING</td> 2102 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> 2103 * <td style="text-align: center;">LOCKED</td> 2104 * <td style="text-align: center;">Values locked</td> 2105 * </tr> 2106 * <tr> 2107 * <td style="text-align: center;">CONVERGED</td> 2108 * <td style="text-align: center;">Camera device initiates AWB scan</td> 2109 * <td style="text-align: center;">SEARCHING</td> 2110 * <td style="text-align: center;">Values changing</td> 2111 * </tr> 2112 * <tr> 2113 * <td style="text-align: center;">CONVERGED</td> 2114 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> 2115 * <td style="text-align: center;">LOCKED</td> 2116 * <td style="text-align: center;">Values locked</td> 2117 * </tr> 2118 * <tr> 2119 * <td style="text-align: center;">LOCKED</td> 2120 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> 2121 * <td style="text-align: center;">SEARCHING</td> 2122 * <td style="text-align: center;">Values not good after unlock</td> 2123 * </tr> 2124 * </tbody> 2125 * </table> 2126 * <p>For the above table, the camera device may skip reporting any state changes that happen 2127 * without application intervention (i.e. mode switch, trigger, locking). Any state that 2128 * can be skipped in that manner is called a transient state.</p> 2129 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions 2130 * listed in above table, it is also legal for the camera device to skip one or more 2131 * transient states between two results. See below table for examples:</p> 2132 * <table> 2133 * <thead> 2134 * <tr> 2135 * <th style="text-align: center;">State</th> 2136 * <th style="text-align: center;">Transition Cause</th> 2137 * <th style="text-align: center;">New State</th> 2138 * <th style="text-align: center;">Notes</th> 2139 * </tr> 2140 * </thead> 2141 * <tbody> 2142 * <tr> 2143 * <td style="text-align: center;">INACTIVE</td> 2144 * <td style="text-align: center;">Camera device finished AWB scan</td> 2145 * <td style="text-align: center;">CONVERGED</td> 2146 * <td style="text-align: center;">Values are already good, transient states are skipped by camera device.</td> 2147 * </tr> 2148 * <tr> 2149 * <td style="text-align: center;">LOCKED</td> 2150 * <td style="text-align: center;">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> 2151 * <td style="text-align: center;">CONVERGED</td> 2152 * <td style="text-align: center;">Values good after unlock, transient states are skipped by camera device.</td> 2153 * </tr> 2154 * </tbody> 2155 * </table> 2156 * <p><b>Possible values:</b></p> 2157 * <ul> 2158 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li> 2159 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li> 2160 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li> 2161 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li> 2162 * </ul> 2163 * 2164 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 2165 * <p><b>Limited capability</b> - 2166 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 2167 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2168 * 2169 * @see CaptureRequest#CONTROL_AWB_LOCK 2170 * @see CaptureRequest#CONTROL_AWB_MODE 2171 * @see CaptureRequest#CONTROL_MODE 2172 * @see CaptureRequest#CONTROL_SCENE_MODE 2173 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2174 * @see #CONTROL_AWB_STATE_INACTIVE 2175 * @see #CONTROL_AWB_STATE_SEARCHING 2176 * @see #CONTROL_AWB_STATE_CONVERGED 2177 * @see #CONTROL_AWB_STATE_LOCKED 2178 */ 2179 @PublicKey 2180 @NonNull 2181 public static final Key<Integer> CONTROL_AWB_STATE = 2182 new Key<Integer>("android.control.awbState", int.class); 2183 2184 /** 2185 * <p>A special color effect to apply.</p> 2186 * <p>When this mode is set, a color effect will be applied 2187 * to images produced by the camera device. The interpretation 2188 * and implementation of these color effects is left to the 2189 * implementor of the camera device, and should not be 2190 * depended on to be consistent (or present) across all 2191 * devices.</p> 2192 * <p><b>Possible values:</b></p> 2193 * <ul> 2194 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li> 2195 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li> 2196 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li> 2197 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li> 2198 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li> 2199 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li> 2200 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li> 2201 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li> 2202 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li> 2203 * </ul> 2204 * 2205 * <p><b>Available values for this device:</b><br> 2206 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p> 2207 * <p>This key is available on all devices.</p> 2208 * 2209 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS 2210 * @see #CONTROL_EFFECT_MODE_OFF 2211 * @see #CONTROL_EFFECT_MODE_MONO 2212 * @see #CONTROL_EFFECT_MODE_NEGATIVE 2213 * @see #CONTROL_EFFECT_MODE_SOLARIZE 2214 * @see #CONTROL_EFFECT_MODE_SEPIA 2215 * @see #CONTROL_EFFECT_MODE_POSTERIZE 2216 * @see #CONTROL_EFFECT_MODE_WHITEBOARD 2217 * @see #CONTROL_EFFECT_MODE_BLACKBOARD 2218 * @see #CONTROL_EFFECT_MODE_AQUA 2219 */ 2220 @PublicKey 2221 @NonNull 2222 public static final Key<Integer> CONTROL_EFFECT_MODE = 2223 new Key<Integer>("android.control.effectMode", int.class); 2224 2225 /** 2226 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control 2227 * routines.</p> 2228 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control 2229 * by the camera device is disabled. The application must set the fields for 2230 * capture parameters itself.</p> 2231 * <p>When set to AUTO, the individual algorithm controls in 2232 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> 2233 * <p>When set to USE_SCENE_MODE or USE_EXTENDED_SCENE_MODE, the individual controls in 2234 * android.control.* are mostly disabled, and the camera device 2235 * implements one of the scene mode or extended scene mode settings (such as ACTION, 2236 * SUNSET, PARTY, or BOKEH) as it wishes. The camera device scene mode 2237 * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p> 2238 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference 2239 * is that this frame will not be used by camera device background 3A statistics 2240 * update, as if this frame is never captured. This mode can be used in the scenario 2241 * where the application doesn't want a 3A manual control capture to affect 2242 * the subsequent auto 3A capture results.</p> 2243 * <p><b>Possible values:</b></p> 2244 * <ul> 2245 * <li>{@link #CONTROL_MODE_OFF OFF}</li> 2246 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li> 2247 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li> 2248 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li> 2249 * <li>{@link #CONTROL_MODE_USE_EXTENDED_SCENE_MODE USE_EXTENDED_SCENE_MODE}</li> 2250 * </ul> 2251 * 2252 * <p><b>Available values for this device:</b><br> 2253 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p> 2254 * <p>This key is available on all devices.</p> 2255 * 2256 * @see CaptureRequest#CONTROL_AF_MODE 2257 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES 2258 * @see #CONTROL_MODE_OFF 2259 * @see #CONTROL_MODE_AUTO 2260 * @see #CONTROL_MODE_USE_SCENE_MODE 2261 * @see #CONTROL_MODE_OFF_KEEP_STATE 2262 * @see #CONTROL_MODE_USE_EXTENDED_SCENE_MODE 2263 */ 2264 @PublicKey 2265 @NonNull 2266 public static final Key<Integer> CONTROL_MODE = 2267 new Key<Integer>("android.control.mode", int.class); 2268 2269 /** 2270 * <p>Control for which scene mode is currently active.</p> 2271 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and 2272 * capture settings.</p> 2273 * <p>This is the mode that that is active when 2274 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will 2275 * disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} 2276 * while in use.</p> 2277 * <p>The interpretation and implementation of these scene modes is left 2278 * to the implementor of the camera device. Their behavior will not be 2279 * consistent across all devices, and any given device may only implement 2280 * a subset of these modes.</p> 2281 * <p><b>Possible values:</b></p> 2282 * <ul> 2283 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li> 2284 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li> 2285 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li> 2286 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li> 2287 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li> 2288 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li> 2289 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li> 2290 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li> 2291 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li> 2292 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li> 2293 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li> 2294 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li> 2295 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li> 2296 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li> 2297 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li> 2298 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li> 2299 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li> 2300 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li> 2301 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li> 2302 * </ul> 2303 * 2304 * <p><b>Available values for this device:</b><br> 2305 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p> 2306 * <p>This key is available on all devices.</p> 2307 * 2308 * @see CaptureRequest#CONTROL_AE_MODE 2309 * @see CaptureRequest#CONTROL_AF_MODE 2310 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES 2311 * @see CaptureRequest#CONTROL_AWB_MODE 2312 * @see CaptureRequest#CONTROL_MODE 2313 * @see #CONTROL_SCENE_MODE_DISABLED 2314 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY 2315 * @see #CONTROL_SCENE_MODE_ACTION 2316 * @see #CONTROL_SCENE_MODE_PORTRAIT 2317 * @see #CONTROL_SCENE_MODE_LANDSCAPE 2318 * @see #CONTROL_SCENE_MODE_NIGHT 2319 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT 2320 * @see #CONTROL_SCENE_MODE_THEATRE 2321 * @see #CONTROL_SCENE_MODE_BEACH 2322 * @see #CONTROL_SCENE_MODE_SNOW 2323 * @see #CONTROL_SCENE_MODE_SUNSET 2324 * @see #CONTROL_SCENE_MODE_STEADYPHOTO 2325 * @see #CONTROL_SCENE_MODE_FIREWORKS 2326 * @see #CONTROL_SCENE_MODE_SPORTS 2327 * @see #CONTROL_SCENE_MODE_PARTY 2328 * @see #CONTROL_SCENE_MODE_CANDLELIGHT 2329 * @see #CONTROL_SCENE_MODE_BARCODE 2330 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO 2331 * @see #CONTROL_SCENE_MODE_HDR 2332 */ 2333 @PublicKey 2334 @NonNull 2335 public static final Key<Integer> CONTROL_SCENE_MODE = 2336 new Key<Integer>("android.control.sceneMode", int.class); 2337 2338 /** 2339 * <p>Whether video stabilization is 2340 * active.</p> 2341 * <p>Video stabilization automatically warps images from 2342 * the camera in order to stabilize motion between consecutive frames.</p> 2343 * <p>If enabled, video stabilization can modify the 2344 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p> 2345 * <p>Switching between different video stabilization modes may take several 2346 * frames to initialize, the camera device will report the current mode 2347 * in capture result metadata. For example, When "ON" mode is requested, 2348 * the video stabilization modes in the first several capture results may 2349 * still be "OFF", and it will become "ON" when the initialization is 2350 * done.</p> 2351 * <p>In addition, not all recording sizes or frame rates may be supported for 2352 * stabilization by a device that reports stabilization support. It is guaranteed 2353 * that an output targeting a MediaRecorder or MediaCodec will be stabilized if 2354 * the recording resolution is less than or equal to 1920 x 1080 (width less than 2355 * or equal to 1920, height less than or equal to 1080), and the recording 2356 * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult 2357 * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return 2358 * OFF if the recording output is not stabilized, or if there are no output 2359 * Surface types that can be stabilized.</p> 2360 * <p>If a camera device supports both this mode and OIS 2361 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may 2362 * produce undesirable interaction, so it is recommended not to enable 2363 * both at the same time.</p> 2364 * <p>If video stabilization is set to "PREVIEW_STABILIZATION", 2365 * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} is overridden. The camera sub-system may choose 2366 * to turn on hardware based image stabilization in addition to software based stabilization 2367 * if it deems that appropriate. 2368 * This key may be a part of the available session keys, which camera clients may 2369 * query via 2370 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }. 2371 * If this is the case, changing this key over the life-time of a capture session may 2372 * cause delays / glitches.</p> 2373 * <p><b>Possible values:</b></p> 2374 * <ul> 2375 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li> 2376 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li> 2377 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION PREVIEW_STABILIZATION}</li> 2378 * </ul> 2379 * 2380 * <p>This key is available on all devices.</p> 2381 * 2382 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE 2383 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE 2384 * @see CaptureRequest#SCALER_CROP_REGION 2385 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF 2386 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON 2387 * @see #CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION 2388 */ 2389 @PublicKey 2390 @NonNull 2391 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = 2392 new Key<Integer>("android.control.videoStabilizationMode", int.class); 2393 2394 /** 2395 * <p>The amount of additional sensitivity boost applied to output images 2396 * after RAW sensor data is captured.</p> 2397 * <p>Some camera devices support additional digital sensitivity boosting in the 2398 * camera processing pipeline after sensor RAW image is captured. 2399 * Such a boost will be applied to YUV/JPEG format output images but will not 2400 * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p> 2401 * <p>This key will be <code>null</code> for devices that do not support any RAW format 2402 * outputs. For devices that do support RAW format outputs, this key will always 2403 * present, and if a device does not support post RAW sensitivity boost, it will 2404 * list <code>100</code> in this key.</p> 2405 * <p>If the camera device cannot apply the exact boost requested, it will reduce the 2406 * boost to the nearest supported value. 2407 * The final boost value used will be available in the output capture result.</p> 2408 * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images 2409 * of such device will have the total sensitivity of 2410 * <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} / 100</code> 2411 * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p> 2412 * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to 2413 * OFF; otherwise the auto-exposure algorithm will override this value.</p> 2414 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p> 2415 * <p><b>Range of valid values:</b><br> 2416 * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p> 2417 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 2418 * 2419 * @see CaptureRequest#CONTROL_AE_MODE 2420 * @see CaptureRequest#CONTROL_MODE 2421 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST 2422 * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE 2423 * @see CaptureRequest#SENSOR_SENSITIVITY 2424 */ 2425 @PublicKey 2426 @NonNull 2427 public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST = 2428 new Key<Integer>("android.control.postRawSensitivityBoost", int.class); 2429 2430 /** 2431 * <p>Allow camera device to enable zero-shutter-lag mode for requests with 2432 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p> 2433 * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with 2434 * STILL_CAPTURE capture intent. The camera device may use images captured in the past to 2435 * produce output images for a zero-shutter-lag request. The result metadata including the 2436 * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images. 2437 * Therefore, the contents of the output images and the result metadata may be out of order 2438 * compared to previous regular requests. enableZsl does not affect requests with other 2439 * capture intents.</p> 2440 * <p>For example, when requests are submitted in the following order: 2441 * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW 2442 * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p> 2443 * <p>The output images for request B may have contents captured before the output images for 2444 * request A, and the result metadata for request B may be older than the result metadata for 2445 * request A.</p> 2446 * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in 2447 * the past for requests with STILL_CAPTURE capture intent.</p> 2448 * <p>For applications targeting SDK versions O and newer, the value of enableZsl in 2449 * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always 2450 * <code>false</code> if present.</p> 2451 * <p>For applications targeting SDK versions older than O, the value of enableZsl in all 2452 * capture templates is always <code>false</code> if present.</p> 2453 * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p> 2454 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 2455 * 2456 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 2457 * @see CaptureResult#SENSOR_TIMESTAMP 2458 */ 2459 @PublicKey 2460 @NonNull 2461 public static final Key<Boolean> CONTROL_ENABLE_ZSL = 2462 new Key<Boolean>("android.control.enableZsl", boolean.class); 2463 2464 /** 2465 * <p>Whether a significant scene change is detected within the currently-set AF 2466 * region(s).</p> 2467 * <p>When the camera focus routine detects a change in the scene it is looking at, 2468 * such as a large shift in camera viewpoint, significant motion in the scene, or a 2469 * significant illumination change, this value will be set to DETECTED for a single capture 2470 * result. Otherwise the value will be NOT_DETECTED. The threshold for detection is similar 2471 * to what would trigger a new passive focus scan to begin in CONTINUOUS autofocus modes.</p> 2472 * <p>This key will be available if the camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p> 2473 * <p><b>Possible values:</b></p> 2474 * <ul> 2475 * <li>{@link #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED NOT_DETECTED}</li> 2476 * <li>{@link #CONTROL_AF_SCENE_CHANGE_DETECTED DETECTED}</li> 2477 * </ul> 2478 * 2479 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 2480 * @see #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED 2481 * @see #CONTROL_AF_SCENE_CHANGE_DETECTED 2482 */ 2483 @PublicKey 2484 @NonNull 2485 public static final Key<Integer> CONTROL_AF_SCENE_CHANGE = 2486 new Key<Integer>("android.control.afSceneChange", int.class); 2487 2488 /** 2489 * <p>Whether extended scene mode is enabled for a particular capture request.</p> 2490 * <p>With bokeh mode, the camera device may blur out the parts of scene that are not in 2491 * focus, creating a bokeh (or shallow depth of field) effect for people or objects.</p> 2492 * <p>When set to BOKEH_STILL_CAPTURE mode with STILL_CAPTURE capture intent, due to the extra 2493 * processing needed for high quality bokeh effect, the stall may be longer than when 2494 * capture intent is not STILL_CAPTURE.</p> 2495 * <p>When set to BOKEH_STILL_CAPTURE mode with PREVIEW capture intent,</p> 2496 * <ul> 2497 * <li>If the camera device has BURST_CAPTURE capability, the frame rate requirement of 2498 * BURST_CAPTURE must still be met.</li> 2499 * <li>All streams not larger than the maximum streaming dimension for BOKEH_STILL_CAPTURE mode 2500 * (queried via {@link android.hardware.camera2.CameraCharacteristics#CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES }) 2501 * will have preview bokeh effect applied.</li> 2502 * </ul> 2503 * <p>When set to BOKEH_CONTINUOUS mode, configured streams dimension should not exceed this mode's 2504 * maximum streaming dimension in order to have bokeh effect applied. Bokeh effect may not 2505 * be available for streams larger than the maximum streaming dimension.</p> 2506 * <p>Switching between different extended scene modes may involve reconfiguration of the camera 2507 * pipeline, resulting in long latency. The application should check this key against the 2508 * available session keys queried via 2509 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</p> 2510 * <p>For a logical multi-camera, bokeh may be implemented by stereo vision from sub-cameras 2511 * with different field of view. As a result, when bokeh mode is enabled, the camera device 2512 * may override {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} or {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, and the field of 2513 * view may be smaller than when bokeh mode is off.</p> 2514 * <p><b>Possible values:</b></p> 2515 * <ul> 2516 * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_DISABLED DISABLED}</li> 2517 * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE BOKEH_STILL_CAPTURE}</li> 2518 * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS BOKEH_CONTINUOUS}</li> 2519 * </ul> 2520 * 2521 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 2522 * 2523 * @see CaptureRequest#CONTROL_ZOOM_RATIO 2524 * @see CaptureRequest#SCALER_CROP_REGION 2525 * @see #CONTROL_EXTENDED_SCENE_MODE_DISABLED 2526 * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE 2527 * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS 2528 */ 2529 @PublicKey 2530 @NonNull 2531 public static final Key<Integer> CONTROL_EXTENDED_SCENE_MODE = 2532 new Key<Integer>("android.control.extendedSceneMode", int.class); 2533 2534 /** 2535 * <p>The desired zoom ratio</p> 2536 * <p>Instead of using {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} for zoom, the application can now choose to 2537 * use this tag to specify the desired zoom level.</p> 2538 * <p>By using this control, the application gains a simpler way to control zoom, which can 2539 * be a combination of optical and digital zoom. For example, a multi-camera system may 2540 * contain more than one lens with different focal lengths, and the user can use optical 2541 * zoom by switching between lenses. Using zoomRatio has benefits in the scenarios below:</p> 2542 * <ul> 2543 * <li>Zooming in from a wide-angle lens to a telephoto lens: A floating-point ratio provides 2544 * better precision compared to an integer value of {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</li> 2545 * <li>Zooming out from a wide lens to an ultrawide lens: zoomRatio supports zoom-out whereas 2546 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} doesn't.</li> 2547 * </ul> 2548 * <p>To illustrate, here are several scenarios of different zoom ratios, crop regions, 2549 * and output streams, for a hypothetical camera device with an active array of size 2550 * <code>(2000,1500)</code>.</p> 2551 * <ul> 2552 * <li>Camera Configuration:<ul> 2553 * <li>Active array size: <code>2000x1500</code> (3 MP, 4:3 aspect ratio)</li> 2554 * <li>Output stream #1: <code>640x480</code> (VGA, 4:3 aspect ratio)</li> 2555 * <li>Output stream #2: <code>1280x720</code> (720p, 16:9 aspect ratio)</li> 2556 * </ul> 2557 * </li> 2558 * <li>Case #1: 4:3 crop region with 2.0x zoom ratio<ul> 2559 * <li>Zoomed field of view: 1/4 of original field of view</li> 2560 * <li>Crop region: <code>Rect(0, 0, 2000, 1500) // (left, top, right, bottom)</code> (post zoom)</li> 2561 * </ul> 2562 * </li> 2563 * <li><img alt="4:3 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.control.zoomRatio/zoom-ratio-2-crop-43.png" /><ul> 2564 * <li><code>640x480</code> stream source area: <code>(0, 0, 2000, 1500)</code> (equal to crop region)</li> 2565 * <li><code>1280x720</code> stream source area: <code>(0, 187, 2000, 1312)</code> (letterboxed)</li> 2566 * </ul> 2567 * </li> 2568 * <li>Case #2: 16:9 crop region with 2.0x zoom.<ul> 2569 * <li>Zoomed field of view: 1/4 of original field of view</li> 2570 * <li>Crop region: <code>Rect(0, 187, 2000, 1312)</code></li> 2571 * <li><img alt="16:9 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.control.zoomRatio/zoom-ratio-2-crop-169.png" /></li> 2572 * <li><code>640x480</code> stream source area: <code>(250, 187, 1750, 1312)</code> (pillarboxed)</li> 2573 * <li><code>1280x720</code> stream source area: <code>(0, 187, 2000, 1312)</code> (equal to crop region)</li> 2574 * </ul> 2575 * </li> 2576 * <li>Case #3: 1:1 crop region with 0.5x zoom out to ultrawide lens.<ul> 2577 * <li>Zoomed field of view: 4x of original field of view (switched from wide lens to ultrawide lens)</li> 2578 * <li>Crop region: <code>Rect(250, 0, 1750, 1500)</code></li> 2579 * <li><img alt="1:1 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.control.zoomRatio/zoom-ratio-0.5-crop-11.png" /></li> 2580 * <li><code>640x480</code> stream source area: <code>(250, 187, 1750, 1312)</code> (letterboxed)</li> 2581 * <li><code>1280x720</code> stream source area: <code>(250, 328, 1750, 1172)</code> (letterboxed)</li> 2582 * </ul> 2583 * </li> 2584 * </ul> 2585 * <p>As seen from the graphs above, the coordinate system of cropRegion now changes to the 2586 * effective after-zoom field-of-view, and is represented by the rectangle of (0, 0, 2587 * activeArrayWith, activeArrayHeight). The same applies to AE/AWB/AF regions, and faces. 2588 * This coordinate system change isn't applicable to RAW capture and its related 2589 * metadata such as intrinsicCalibration and lensShadingMap.</p> 2590 * <p>Using the same hypothetical example above, and assuming output stream #1 (640x480) is 2591 * the viewfinder stream, the application can achieve 2.0x zoom in one of two ways:</p> 2592 * <ul> 2593 * <li>zoomRatio = 2.0, scaler.cropRegion = (0, 0, 2000, 1500)</li> 2594 * <li>zoomRatio = 1.0 (default), scaler.cropRegion = (500, 375, 1500, 1125)</li> 2595 * </ul> 2596 * <p>If the application intends to set aeRegions to be top-left quarter of the viewfinder 2597 * field-of-view, the {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions} should be set to (0, 0, 1000, 750) with 2598 * zoomRatio set to 2.0. Alternatively, the application can set aeRegions to the equivalent 2599 * region of (500, 375, 1000, 750) for zoomRatio of 1.0. If the application doesn't 2600 * explicitly set {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, its value defaults to 1.0.</p> 2601 * <p>One limitation of controlling zoom using zoomRatio is that the {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} 2602 * must only be used for letterboxing or pillarboxing of the sensor active array, and no 2603 * FREEFORM cropping can be used with {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} other than 1.0. If 2604 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} is not 1.0, and {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} is set to be 2605 * windowboxing, the camera framework will override the {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to be 2606 * the active array.</p> 2607 * <p>In the capture request, if the application sets {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to a 2608 * value != 1.0, the {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} tag in the capture result reflects the 2609 * effective zoom ratio achieved by the camera device, and the {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} 2610 * adjusts for additional crops that are not zoom related. Otherwise, if the application 2611 * sets {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to 1.0, or does not set it at all, the 2612 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} tag in the result metadata will also be 1.0.</p> 2613 * <p>When the application requests a physical stream for a logical multi-camera, the 2614 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} in the physical camera result metadata will be 1.0, and 2615 * the {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} tag reflects the amount of zoom and crop done by the 2616 * physical camera device.</p> 2617 * <p><b>Range of valid values:</b><br> 2618 * {@link CameraCharacteristics#CONTROL_ZOOM_RATIO_RANGE android.control.zoomRatioRange}</p> 2619 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 2620 * <p><b>Limited capability</b> - 2621 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 2622 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2623 * 2624 * @see CaptureRequest#CONTROL_AE_REGIONS 2625 * @see CaptureRequest#CONTROL_ZOOM_RATIO 2626 * @see CameraCharacteristics#CONTROL_ZOOM_RATIO_RANGE 2627 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2628 * @see CaptureRequest#SCALER_CROP_REGION 2629 */ 2630 @PublicKey 2631 @NonNull 2632 public static final Key<Float> CONTROL_ZOOM_RATIO = 2633 new Key<Float>("android.control.zoomRatio", float.class); 2634 2635 /** 2636 * <p>Operation mode for edge 2637 * enhancement.</p> 2638 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means 2639 * no enhancement will be applied by the camera device.</p> 2640 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement 2641 * will be applied. HIGH_QUALITY mode indicates that the 2642 * camera device will use the highest-quality enhancement algorithms, 2643 * even if it slows down capture rate. FAST means the camera device will 2644 * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if 2645 * edge enhancement will slow down capture rate. Every output stream will have a similar 2646 * amount of enhancement applied.</p> 2647 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular 2648 * buffer of high-resolution images during preview and reprocess image(s) from that buffer 2649 * into a final capture when triggered by the user. In this mode, the camera device applies 2650 * edge enhancement to low-resolution streams (below maximum recording resolution) to 2651 * maximize preview quality, but does not apply edge enhancement to high-resolution streams, 2652 * since those will be reprocessed later if necessary.</p> 2653 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera 2654 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively. 2655 * The camera device may adjust its internal edge enhancement parameters for best 2656 * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p> 2657 * <p><b>Possible values:</b></p> 2658 * <ul> 2659 * <li>{@link #EDGE_MODE_OFF OFF}</li> 2660 * <li>{@link #EDGE_MODE_FAST FAST}</li> 2661 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 2662 * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> 2663 * </ul> 2664 * 2665 * <p><b>Available values for this device:</b><br> 2666 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p> 2667 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 2668 * <p><b>Full capability</b> - 2669 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2670 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2671 * 2672 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES 2673 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2674 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR 2675 * @see #EDGE_MODE_OFF 2676 * @see #EDGE_MODE_FAST 2677 * @see #EDGE_MODE_HIGH_QUALITY 2678 * @see #EDGE_MODE_ZERO_SHUTTER_LAG 2679 */ 2680 @PublicKey 2681 @NonNull 2682 public static final Key<Integer> EDGE_MODE = 2683 new Key<Integer>("android.edge.mode", int.class); 2684 2685 /** 2686 * <p>The desired mode for for the camera device's flash control.</p> 2687 * <p>This control is only effective when flash unit is available 2688 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p> 2689 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. 2690 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, 2691 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> 2692 * <p>When set to OFF, the camera device will not fire flash for this capture.</p> 2693 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera 2694 * device's auto-exposure routine's result. When used in still capture case, this 2695 * control should be used along with auto-exposure (AE) precapture metering sequence 2696 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> 2697 * <p>When set to TORCH, the flash will be on continuously. This mode can be used 2698 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p> 2699 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p> 2700 * <p><b>Possible values:</b></p> 2701 * <ul> 2702 * <li>{@link #FLASH_MODE_OFF OFF}</li> 2703 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li> 2704 * <li>{@link #FLASH_MODE_TORCH TORCH}</li> 2705 * </ul> 2706 * 2707 * <p>This key is available on all devices.</p> 2708 * 2709 * @see CaptureRequest#CONTROL_AE_MODE 2710 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 2711 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 2712 * @see CaptureResult#FLASH_STATE 2713 * @see #FLASH_MODE_OFF 2714 * @see #FLASH_MODE_SINGLE 2715 * @see #FLASH_MODE_TORCH 2716 */ 2717 @PublicKey 2718 @NonNull 2719 public static final Key<Integer> FLASH_MODE = 2720 new Key<Integer>("android.flash.mode", int.class); 2721 2722 /** 2723 * <p>Current state of the flash 2724 * unit.</p> 2725 * <p>When the camera device doesn't have flash unit 2726 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE. 2727 * Other states indicate the current flash status.</p> 2728 * <p>In certain conditions, this will be available on LEGACY devices:</p> 2729 * <ul> 2730 * <li>Flash-less cameras always return UNAVAILABLE.</li> 2731 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH 2732 * will always return FIRED.</li> 2733 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH 2734 * will always return FIRED.</li> 2735 * </ul> 2736 * <p>In all other conditions the state will not be available on 2737 * LEGACY devices (i.e. it will be <code>null</code>).</p> 2738 * <p><b>Possible values:</b></p> 2739 * <ul> 2740 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li> 2741 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li> 2742 * <li>{@link #FLASH_STATE_READY READY}</li> 2743 * <li>{@link #FLASH_STATE_FIRED FIRED}</li> 2744 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li> 2745 * </ul> 2746 * 2747 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 2748 * <p><b>Limited capability</b> - 2749 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 2750 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2751 * 2752 * @see CaptureRequest#CONTROL_AE_MODE 2753 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 2754 * @see CaptureRequest#FLASH_MODE 2755 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2756 * @see #FLASH_STATE_UNAVAILABLE 2757 * @see #FLASH_STATE_CHARGING 2758 * @see #FLASH_STATE_READY 2759 * @see #FLASH_STATE_FIRED 2760 * @see #FLASH_STATE_PARTIAL 2761 */ 2762 @PublicKey 2763 @NonNull 2764 public static final Key<Integer> FLASH_STATE = 2765 new Key<Integer>("android.flash.state", int.class); 2766 2767 /** 2768 * <p>Operational mode for hot pixel correction.</p> 2769 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels 2770 * that do not accurately measure the incoming light (i.e. pixels that 2771 * are stuck at an arbitrary value or are oversensitive).</p> 2772 * <p><b>Possible values:</b></p> 2773 * <ul> 2774 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li> 2775 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li> 2776 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 2777 * </ul> 2778 * 2779 * <p><b>Available values for this device:</b><br> 2780 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p> 2781 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 2782 * 2783 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES 2784 * @see #HOT_PIXEL_MODE_OFF 2785 * @see #HOT_PIXEL_MODE_FAST 2786 * @see #HOT_PIXEL_MODE_HIGH_QUALITY 2787 */ 2788 @PublicKey 2789 @NonNull 2790 public static final Key<Integer> HOT_PIXEL_MODE = 2791 new Key<Integer>("android.hotPixel.mode", int.class); 2792 2793 /** 2794 * <p>A location object to use when generating image GPS metadata.</p> 2795 * <p>Setting a location object in a request will include the GPS coordinates of the location 2796 * into any JPEG images captured based on the request. These coordinates can then be 2797 * viewed by anyone who receives the JPEG image.</p> 2798 * <p>This tag is also used for HEIC image capture.</p> 2799 * <p>This key is available on all devices.</p> 2800 */ 2801 @PublicKey 2802 @NonNull 2803 @SyntheticKey 2804 public static final Key<android.location.Location> JPEG_GPS_LOCATION = 2805 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class); 2806 2807 /** 2808 * <p>GPS coordinates to include in output JPEG 2809 * EXIF.</p> 2810 * <p>This tag is also used for HEIC image capture.</p> 2811 * <p><b>Range of valid values:</b><br> 2812 * (-180 - 180], [-90,90], [-inf, inf]</p> 2813 * <p>This key is available on all devices.</p> 2814 * @hide 2815 */ 2816 public static final Key<double[]> JPEG_GPS_COORDINATES = 2817 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); 2818 2819 /** 2820 * <p>32 characters describing GPS algorithm to 2821 * include in EXIF.</p> 2822 * <p>This tag is also used for HEIC image capture.</p> 2823 * <p>This key is available on all devices.</p> 2824 * @hide 2825 */ 2826 public static final Key<String> JPEG_GPS_PROCESSING_METHOD = 2827 new Key<String>("android.jpeg.gpsProcessingMethod", String.class); 2828 2829 /** 2830 * <p>Time GPS fix was made to include in 2831 * EXIF.</p> 2832 * <p>This tag is also used for HEIC image capture.</p> 2833 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p> 2834 * <p>This key is available on all devices.</p> 2835 * @hide 2836 */ 2837 public static final Key<Long> JPEG_GPS_TIMESTAMP = 2838 new Key<Long>("android.jpeg.gpsTimestamp", long.class); 2839 2840 /** 2841 * <p>The orientation for a JPEG image.</p> 2842 * <p>The clockwise rotation angle in degrees, relative to the orientation 2843 * to the camera, that the JPEG picture needs to be rotated by, to be viewed 2844 * upright.</p> 2845 * <p>Camera devices may either encode this value into the JPEG EXIF header, or 2846 * rotate the image data to match this orientation. When the image data is rotated, 2847 * the thumbnail data will also be rotated.</p> 2848 * <p>Note that this orientation is relative to the orientation of the camera sensor, given 2849 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p> 2850 * <p>To translate from the device orientation given by the Android sensor APIs for camera 2851 * sensors which are not EXTERNAL, the following sample code may be used:</p> 2852 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) { 2853 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0; 2854 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION); 2855 * 2856 * // Round device orientation to a multiple of 90 2857 * deviceOrientation = (deviceOrientation + 45) / 90 * 90; 2858 * 2859 * // Reverse device orientation for front-facing cameras 2860 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT; 2861 * if (facingFront) deviceOrientation = -deviceOrientation; 2862 * 2863 * // Calculate desired JPEG orientation relative to camera orientation to make 2864 * // the image upright relative to the device orientation 2865 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360; 2866 * 2867 * return jpegOrientation; 2868 * } 2869 * </code></pre> 2870 * <p>For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will 2871 * also be set to EXTERNAL. The above code is not relevant in such case.</p> 2872 * <p>This tag is also used to describe the orientation of the HEIC image capture, in which 2873 * case the rotation is reflected by 2874 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}, and not by 2875 * rotating the image data itself.</p> 2876 * <p><b>Units</b>: Degrees in multiples of 90</p> 2877 * <p><b>Range of valid values:</b><br> 2878 * 0, 90, 180, 270</p> 2879 * <p>This key is available on all devices.</p> 2880 * 2881 * @see CameraCharacteristics#SENSOR_ORIENTATION 2882 */ 2883 @PublicKey 2884 @NonNull 2885 public static final Key<Integer> JPEG_ORIENTATION = 2886 new Key<Integer>("android.jpeg.orientation", int.class); 2887 2888 /** 2889 * <p>Compression quality of the final JPEG 2890 * image.</p> 2891 * <p>85-95 is typical usage range. This tag is also used to describe the quality 2892 * of the HEIC image capture.</p> 2893 * <p><b>Range of valid values:</b><br> 2894 * 1-100; larger is higher quality</p> 2895 * <p>This key is available on all devices.</p> 2896 */ 2897 @PublicKey 2898 @NonNull 2899 public static final Key<Byte> JPEG_QUALITY = 2900 new Key<Byte>("android.jpeg.quality", byte.class); 2901 2902 /** 2903 * <p>Compression quality of JPEG 2904 * thumbnail.</p> 2905 * <p>This tag is also used to describe the quality of the HEIC image capture.</p> 2906 * <p><b>Range of valid values:</b><br> 2907 * 1-100; larger is higher quality</p> 2908 * <p>This key is available on all devices.</p> 2909 */ 2910 @PublicKey 2911 @NonNull 2912 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = 2913 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); 2914 2915 /** 2916 * <p>Resolution of embedded JPEG thumbnail.</p> 2917 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, 2918 * but the captured JPEG will still be a valid image.</p> 2919 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected 2920 * should have the same aspect ratio as the main JPEG output.</p> 2921 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect 2922 * ratio, the camera device creates the thumbnail by cropping it from the primary image. 2923 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has 2924 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to 2925 * generate the thumbnail image. The thumbnail image will always have a smaller Field 2926 * Of View (FOV) than the primary image when aspect ratios differ.</p> 2927 * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested, 2928 * the camera device will handle thumbnail rotation in one of the following ways:</p> 2929 * <ul> 2930 * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag} 2931 * and keep jpeg and thumbnail image data unrotated.</li> 2932 * <li>Rotate the jpeg and thumbnail image data and not set 2933 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this 2934 * case, LIMITED or FULL hardware level devices will report rotated thumbnail size in 2935 * capture result, so the width and height will be interchanged if 90 or 270 degree 2936 * orientation is requested. LEGACY device will always report unrotated thumbnail 2937 * size.</li> 2938 * </ul> 2939 * <p>The tag is also used as thumbnail size for HEIC image format capture, in which case the 2940 * the thumbnail rotation is reflected by 2941 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}, and not by 2942 * rotating the thumbnail data itself.</p> 2943 * <p><b>Range of valid values:</b><br> 2944 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p> 2945 * <p>This key is available on all devices.</p> 2946 * 2947 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES 2948 * @see CaptureRequest#JPEG_ORIENTATION 2949 */ 2950 @PublicKey 2951 @NonNull 2952 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = 2953 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class); 2954 2955 /** 2956 * <p>The desired lens aperture size, as a ratio of lens focal length to the 2957 * effective aperture diameter.</p> 2958 * <p>Setting this value is only supported on the camera devices that have a variable 2959 * aperture lens.</p> 2960 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, 2961 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 2962 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} 2963 * to achieve manual exposure control.</p> 2964 * <p>The requested aperture value may take several frames to reach the 2965 * requested value; the camera device will report the current (intermediate) 2966 * aperture size in capture result metadata while the aperture is changing. 2967 * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> 2968 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of 2969 * the ON modes, this will be overridden by the camera device 2970 * auto-exposure algorithm, the overridden values are then provided 2971 * back to the user in the corresponding result.</p> 2972 * <p><b>Units</b>: The f-number (f/N)</p> 2973 * <p><b>Range of valid values:</b><br> 2974 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p> 2975 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 2976 * <p><b>Full capability</b> - 2977 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2978 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2979 * 2980 * @see CaptureRequest#CONTROL_AE_MODE 2981 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2982 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES 2983 * @see CaptureResult#LENS_STATE 2984 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 2985 * @see CaptureRequest#SENSOR_FRAME_DURATION 2986 * @see CaptureRequest#SENSOR_SENSITIVITY 2987 */ 2988 @PublicKey 2989 @NonNull 2990 public static final Key<Float> LENS_APERTURE = 2991 new Key<Float>("android.lens.aperture", float.class); 2992 2993 /** 2994 * <p>The desired setting for the lens neutral density filter(s).</p> 2995 * <p>This control will not be supported on most camera devices.</p> 2996 * <p>Lens filters are typically used to lower the amount of light the 2997 * sensor is exposed to (measured in steps of EV). As used here, an EV 2998 * step is the standard logarithmic representation, which are 2999 * non-negative, and inversely proportional to the amount of light 3000 * hitting the sensor. For example, setting this to 0 would result 3001 * in no reduction of the incoming light, and setting this to 2 would 3002 * mean that the filter is set to reduce incoming light by two stops 3003 * (allowing 1/4 of the prior amount of light to the sensor).</p> 3004 * <p>It may take several frames before the lens filter density changes 3005 * to the requested value. While the filter density is still changing, 3006 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> 3007 * <p><b>Units</b>: Exposure Value (EV)</p> 3008 * <p><b>Range of valid values:</b><br> 3009 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p> 3010 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3011 * <p><b>Full capability</b> - 3012 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 3013 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 3014 * 3015 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 3016 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES 3017 * @see CaptureResult#LENS_STATE 3018 */ 3019 @PublicKey 3020 @NonNull 3021 public static final Key<Float> LENS_FILTER_DENSITY = 3022 new Key<Float>("android.lens.filterDensity", float.class); 3023 3024 /** 3025 * <p>The desired lens focal length; used for optical zoom.</p> 3026 * <p>This setting controls the physical focal length of the camera 3027 * device's lens. Changing the focal length changes the field of 3028 * view of the camera device, and is usually used for optical zoom.</p> 3029 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this 3030 * setting won't be applied instantaneously, and it may take several 3031 * frames before the lens can change to the requested focal length. 3032 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will 3033 * be set to MOVING.</p> 3034 * <p>Optical zoom via this control will not be supported on most devices. Starting from API 3035 * level 30, the camera device may combine optical and digital zoom through the 3036 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} control.</p> 3037 * <p><b>Units</b>: Millimeters</p> 3038 * <p><b>Range of valid values:</b><br> 3039 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p> 3040 * <p>This key is available on all devices.</p> 3041 * 3042 * @see CaptureRequest#CONTROL_ZOOM_RATIO 3043 * @see CaptureRequest#LENS_APERTURE 3044 * @see CaptureRequest#LENS_FOCUS_DISTANCE 3045 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS 3046 * @see CaptureResult#LENS_STATE 3047 */ 3048 @PublicKey 3049 @NonNull 3050 public static final Key<Float> LENS_FOCAL_LENGTH = 3051 new Key<Float>("android.lens.focalLength", float.class); 3052 3053 /** 3054 * <p>Desired distance to plane of sharpest focus, 3055 * measured from frontmost surface of the lens.</p> 3056 * <p>Should be zero for fixed-focus cameras</p> 3057 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p> 3058 * <p><b>Range of valid values:</b><br> 3059 * >= 0</p> 3060 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3061 * <p><b>Full capability</b> - 3062 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 3063 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 3064 * 3065 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 3066 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION 3067 */ 3068 @PublicKey 3069 @NonNull 3070 public static final Key<Float> LENS_FOCUS_DISTANCE = 3071 new Key<Float>("android.lens.focusDistance", float.class); 3072 3073 /** 3074 * <p>The range of scene distances that are in 3075 * sharp focus (depth of field).</p> 3076 * <p>If variable focus not supported, can still report 3077 * fixed depth of field range</p> 3078 * <p><b>Units</b>: A pair of focus distances in diopters: (near, 3079 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p> 3080 * <p><b>Range of valid values:</b><br> 3081 * >=0</p> 3082 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3083 * <p><b>Limited capability</b> - 3084 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 3085 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 3086 * 3087 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 3088 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION 3089 */ 3090 @PublicKey 3091 @NonNull 3092 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE = 3093 new Key<android.util.Pair<Float,Float>>("android.lens.focusRange", new TypeReference<android.util.Pair<Float,Float>>() {{ }}); 3094 3095 /** 3096 * <p>Sets whether the camera device uses optical image stabilization (OIS) 3097 * when capturing images.</p> 3098 * <p>OIS is used to compensate for motion blur due to small 3099 * movements of the camera during capture. Unlike digital image 3100 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS 3101 * makes use of mechanical elements to stabilize the camera 3102 * sensor, and thus allows for longer exposure times before 3103 * camera shake becomes apparent.</p> 3104 * <p>Switching between different optical stabilization modes may take several 3105 * frames to initialize, the camera device will report the current mode in 3106 * capture result metadata. For example, When "ON" mode is requested, the 3107 * optical stabilization modes in the first several capture results may still 3108 * be "OFF", and it will become "ON" when the initialization is done.</p> 3109 * <p>If a camera device supports both OIS and digital image stabilization 3110 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable 3111 * interaction, so it is recommended not to enable both at the same time.</p> 3112 * <p>If {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} is set to "PREVIEW_STABILIZATION", 3113 * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} is overridden. The camera sub-system may choose 3114 * to turn on hardware based image stabilization in addition to software based stabilization 3115 * if it deems that appropriate. This key's value in the capture result will reflect which 3116 * OIS mode was chosen.</p> 3117 * <p>Not all devices will support OIS; see 3118 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for 3119 * available controls.</p> 3120 * <p><b>Possible values:</b></p> 3121 * <ul> 3122 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li> 3123 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li> 3124 * </ul> 3125 * 3126 * <p><b>Available values for this device:</b><br> 3127 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p> 3128 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3129 * <p><b>Limited capability</b> - 3130 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 3131 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 3132 * 3133 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE 3134 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 3135 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION 3136 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE 3137 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF 3138 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON 3139 */ 3140 @PublicKey 3141 @NonNull 3142 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = 3143 new Key<Integer>("android.lens.opticalStabilizationMode", int.class); 3144 3145 /** 3146 * <p>Current lens status.</p> 3147 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance}, 3148 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested, 3149 * they may take several frames to reach the requested values. This state indicates 3150 * the current status of the lens parameters.</p> 3151 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be 3152 * either because the parameters are all fixed, or because the lens has had enough 3153 * time to reach the most recently-requested values. 3154 * If all these lens parameters are not changeable for a camera device, as listed below:</p> 3155 * <ul> 3156 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means 3157 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li> 3158 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value), 3159 * which means the optical zoom is not supported.</li> 3160 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li> 3161 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li> 3162 * </ul> 3163 * <p>Then this state will always be STATIONARY.</p> 3164 * <p>When the state is MOVING, it indicates that at least one of the lens parameters 3165 * is changing.</p> 3166 * <p><b>Possible values:</b></p> 3167 * <ul> 3168 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li> 3169 * <li>{@link #LENS_STATE_MOVING MOVING}</li> 3170 * </ul> 3171 * 3172 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3173 * <p><b>Limited capability</b> - 3174 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 3175 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 3176 * 3177 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 3178 * @see CaptureRequest#LENS_APERTURE 3179 * @see CaptureRequest#LENS_FILTER_DENSITY 3180 * @see CaptureRequest#LENS_FOCAL_LENGTH 3181 * @see CaptureRequest#LENS_FOCUS_DISTANCE 3182 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES 3183 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES 3184 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS 3185 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE 3186 * @see #LENS_STATE_STATIONARY 3187 * @see #LENS_STATE_MOVING 3188 */ 3189 @PublicKey 3190 @NonNull 3191 public static final Key<Integer> LENS_STATE = 3192 new Key<Integer>("android.lens.state", int.class); 3193 3194 /** 3195 * <p>The orientation of the camera relative to the sensor 3196 * coordinate system.</p> 3197 * <p>The four coefficients that describe the quaternion 3198 * rotation from the Android sensor coordinate system to a 3199 * camera-aligned coordinate system where the X-axis is 3200 * aligned with the long side of the image sensor, the Y-axis 3201 * is aligned with the short side of the image sensor, and 3202 * the Z-axis is aligned with the optical axis of the sensor.</p> 3203 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code> 3204 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation 3205 * amount <code>theta</code>, the following formulas can be used:</p> 3206 * <pre><code> theta = 2 * acos(w) 3207 * a_x = x / sin(theta/2) 3208 * a_y = y / sin(theta/2) 3209 * a_z = z / sin(theta/2) 3210 * </code></pre> 3211 * <p>To create a 3x3 rotation matrix that applies the rotation 3212 * defined by this quaternion, the following matrix can be 3213 * used:</p> 3214 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw, 3215 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw, 3216 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ] 3217 * </code></pre> 3218 * <p>This matrix can then be used to apply the rotation to a 3219 * column vector point with</p> 3220 * <p><code>p' = Rp</code></p> 3221 * <p>where <code>p</code> is in the device sensor coordinate system, and 3222 * <code>p'</code> is in the camera-oriented coordinate system.</p> 3223 * <p>If {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, the quaternion rotation cannot 3224 * be accurately represented by the camera device, and will be represented by 3225 * default values matching its default facing.</p> 3226 * <p><b>Units</b>: 3227 * Quaternion coefficients</p> 3228 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3229 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p> 3230 * 3231 * @see CameraCharacteristics#LENS_POSE_REFERENCE 3232 */ 3233 @PublicKey 3234 @NonNull 3235 public static final Key<float[]> LENS_POSE_ROTATION = 3236 new Key<float[]>("android.lens.poseRotation", float[].class); 3237 3238 /** 3239 * <p>Position of the camera optical center.</p> 3240 * <p>The position of the camera device's lens optical center, 3241 * as a three-dimensional vector <code>(x,y,z)</code>.</p> 3242 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position 3243 * is relative to the optical center of the largest camera device facing in the same 3244 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor 3245 * coordinate axes}. Note that only the axis definitions are shared with the sensor 3246 * coordinate system, but not the origin.</p> 3247 * <p>If this device is the largest or only camera device with a given facing, then this 3248 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm 3249 * from the main sensor along the +X axis (to the right from the user's perspective) will 3250 * report <code>(0.03, 0, 0)</code>. Note that this means that, for many computer vision 3251 * applications, the position needs to be negated to convert it to a translation from the 3252 * camera to the origin.</p> 3253 * <p>To transform a pixel coordinates between two cameras facing the same direction, first 3254 * the source camera {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} must be corrected for. Then the source 3255 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the 3256 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera 3257 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination 3258 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination 3259 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel 3260 * coordinates.</p> 3261 * <p>To compare this against a real image from the destination camera, the destination camera 3262 * image then needs to be corrected for radial distortion before comparison or sampling.</p> 3263 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to 3264 * the center of the primary gyroscope on the device. The axis definitions are the same as 3265 * with PRIMARY_CAMERA.</p> 3266 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, this position cannot be accurately 3267 * represented by the camera device, and will be represented as <code>(0, 0, 0)</code>.</p> 3268 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is AUTOMOTIVE, then this position is relative to the 3269 * origin of the automotive sensor coordinate system, which is at the center of the rear 3270 * axle.</p> 3271 * <p><b>Units</b>: Meters</p> 3272 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3273 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p> 3274 * 3275 * @see CameraCharacteristics#LENS_DISTORTION 3276 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION 3277 * @see CameraCharacteristics#LENS_POSE_REFERENCE 3278 * @see CameraCharacteristics#LENS_POSE_ROTATION 3279 */ 3280 @PublicKey 3281 @NonNull 3282 public static final Key<float[]> LENS_POSE_TRANSLATION = 3283 new Key<float[]>("android.lens.poseTranslation", float[].class); 3284 3285 /** 3286 * <p>The parameters for this camera device's intrinsic 3287 * calibration.</p> 3288 * <p>The five calibration parameters that describe the 3289 * transform from camera-centric 3D coordinates to sensor 3290 * pixel coordinates:</p> 3291 * <pre><code>[f_x, f_y, c_x, c_y, s] 3292 * </code></pre> 3293 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical 3294 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical 3295 * axis, and <code>s</code> is a skew parameter for the sensor plane not 3296 * being aligned with the lens plane.</p> 3297 * <p>These are typically used within a transformation matrix K:</p> 3298 * <pre><code>K = [ f_x, s, c_x, 3299 * 0, f_y, c_y, 3300 * 0 0, 1 ] 3301 * </code></pre> 3302 * <p>which can then be combined with the camera pose rotation 3303 * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and 3304 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respectively) to calculate the 3305 * complete transform from world coordinates to pixel 3306 * coordinates:</p> 3307 * <pre><code>P = [ K 0 * [ R -Rt 3308 * 0 1 ] 0 1 ] 3309 * </code></pre> 3310 * <p>(Note the negation of poseTranslation when mapping from camera 3311 * to world coordinates, and multiplication by the rotation).</p> 3312 * <p>With <code>p_w</code> being a point in the world coordinate system 3313 * and <code>p_s</code> being a point in the camera active pixel array 3314 * coordinate system, and with the mapping including the 3315 * homogeneous division by z:</p> 3316 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w 3317 * p_s = p_h / z_h 3318 * </code></pre> 3319 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world 3320 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity 3321 * (depth) in pixel coordinates.</p> 3322 * <p>Note that the coordinate system for this transform is the 3323 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system, 3324 * where <code>(0,0)</code> is the top-left of the 3325 * preCorrectionActiveArraySize rectangle. Once the pose and 3326 * intrinsic calibration transforms have been applied to a 3327 * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} 3328 * transform needs to be applied, and the result adjusted to 3329 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate 3330 * system (where <code>(0, 0)</code> is the top-left of the 3331 * activeArraySize rectangle), to determine the final pixel 3332 * coordinate of the world point for processed (non-RAW) 3333 * output buffers.</p> 3334 * <p>For camera devices, the center of pixel <code>(x,y)</code> is located at 3335 * coordinate <code>(x + 0.5, y + 0.5)</code>. So on a device with a 3336 * precorrection active array of size <code>(10,10)</code>, the valid pixel 3337 * indices go from <code>(0,0)-(9,9)</code>, and an perfectly-built camera would 3338 * have an optical center at the exact center of the pixel grid, at 3339 * coordinates <code>(5.0, 5.0)</code>, which is the top-left corner of pixel 3340 * <code>(5,5)</code>.</p> 3341 * <p><b>Units</b>: 3342 * Pixels in the 3343 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} 3344 * coordinate system.</p> 3345 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3346 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p> 3347 * 3348 * @see CameraCharacteristics#LENS_DISTORTION 3349 * @see CameraCharacteristics#LENS_POSE_ROTATION 3350 * @see CameraCharacteristics#LENS_POSE_TRANSLATION 3351 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 3352 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE 3353 */ 3354 @PublicKey 3355 @NonNull 3356 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION = 3357 new Key<float[]>("android.lens.intrinsicCalibration", float[].class); 3358 3359 /** 3360 * <p>The correction coefficients to correct for this camera device's 3361 * radial and tangential lens distortion.</p> 3362 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2, 3363 * kappa_3]</code> and two tangential distortion coefficients 3364 * <code>[kappa_4, kappa_5]</code> that can be used to correct the 3365 * lens's geometric distortion with the mapping equations:</p> 3366 * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + 3367 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 ) 3368 * y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + 3369 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 ) 3370 * </code></pre> 3371 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the 3372 * input image that correspond to the pixel values in the 3373 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p> 3374 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage) 3375 * </code></pre> 3376 * <p>The pixel coordinates are defined in a normalized 3377 * coordinate system related to the 3378 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields. 3379 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the 3380 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes 3381 * of both x and y coordinates are normalized to be 1 at the 3382 * edge further from the optical center, so the range 3383 * for both dimensions is <code>-1 <= x <= 1</code>.</p> 3384 * <p>Finally, <code>r</code> represents the radial distance from the 3385 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude 3386 * is therefore no larger than <code>|r| <= sqrt(2)</code>.</p> 3387 * <p>The distortion model used is the Brown-Conrady model.</p> 3388 * <p><b>Units</b>: 3389 * Unitless coefficients.</p> 3390 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3391 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p> 3392 * 3393 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION 3394 * @deprecated 3395 * <p>This field was inconsistently defined in terms of its 3396 * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p> 3397 * 3398 * @see CameraCharacteristics#LENS_DISTORTION 3399 3400 */ 3401 @Deprecated 3402 @PublicKey 3403 @NonNull 3404 public static final Key<float[]> LENS_RADIAL_DISTORTION = 3405 new Key<float[]>("android.lens.radialDistortion", float[].class); 3406 3407 /** 3408 * <p>The correction coefficients to correct for this camera device's 3409 * radial and tangential lens distortion.</p> 3410 * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was 3411 * inconsistently defined.</p> 3412 * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2, 3413 * kappa_3]</code> and two tangential distortion coefficients 3414 * <code>[kappa_4, kappa_5]</code> that can be used to correct the 3415 * lens's geometric distortion with the mapping equations:</p> 3416 * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + 3417 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 ) 3418 * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + 3419 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 ) 3420 * </code></pre> 3421 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the 3422 * input image that correspond to the pixel values in the 3423 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p> 3424 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage) 3425 * </code></pre> 3426 * <p>The pixel coordinates are defined in a coordinate system 3427 * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} 3428 * calibration fields; see that entry for details of the mapping stages. 3429 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> 3430 * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and 3431 * the range of the coordinates depends on the focal length 3432 * terms of the intrinsic calibration.</p> 3433 * <p>Finally, <code>r</code> represents the radial distance from the 3434 * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p> 3435 * <p>The distortion model used is the Brown-Conrady model.</p> 3436 * <p><b>Units</b>: 3437 * Unitless coefficients.</p> 3438 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3439 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p> 3440 * 3441 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION 3442 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION 3443 */ 3444 @PublicKey 3445 @NonNull 3446 public static final Key<float[]> LENS_DISTORTION = 3447 new Key<float[]>("android.lens.distortion", float[].class); 3448 3449 /** 3450 * <p>Mode of operation for the noise reduction algorithm.</p> 3451 * <p>The noise reduction algorithm attempts to improve image quality by removing 3452 * excessive noise added by the capture process, especially in dark conditions.</p> 3453 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and 3454 * YUV domain.</p> 3455 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove 3456 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF. 3457 * This mode is optional, may not be support by all devices. The application should check 3458 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p> 3459 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering 3460 * will be applied. HIGH_QUALITY mode indicates that the camera device 3461 * will use the highest-quality noise filtering algorithms, 3462 * even if it slows down capture rate. FAST means the camera device will not 3463 * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if 3464 * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate. 3465 * Every output stream will have a similar amount of enhancement applied.</p> 3466 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular 3467 * buffer of high-resolution images during preview and reprocess image(s) from that buffer 3468 * into a final capture when triggered by the user. In this mode, the camera device applies 3469 * noise reduction to low-resolution streams (below maximum recording resolution) to maximize 3470 * preview quality, but does not apply noise reduction to high-resolution streams, since 3471 * those will be reprocessed later if necessary.</p> 3472 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device 3473 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device 3474 * may adjust the noise reduction parameters for best image quality based on the 3475 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p> 3476 * <p><b>Possible values:</b></p> 3477 * <ul> 3478 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li> 3479 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li> 3480 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 3481 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li> 3482 * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> 3483 * </ul> 3484 * 3485 * <p><b>Available values for this device:</b><br> 3486 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p> 3487 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3488 * <p><b>Full capability</b> - 3489 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 3490 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 3491 * 3492 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 3493 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES 3494 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR 3495 * @see #NOISE_REDUCTION_MODE_OFF 3496 * @see #NOISE_REDUCTION_MODE_FAST 3497 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY 3498 * @see #NOISE_REDUCTION_MODE_MINIMAL 3499 * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG 3500 */ 3501 @PublicKey 3502 @NonNull 3503 public static final Key<Integer> NOISE_REDUCTION_MODE = 3504 new Key<Integer>("android.noiseReduction.mode", int.class); 3505 3506 /** 3507 * <p>Whether a result given to the framework is the 3508 * final one for the capture, or only a partial that contains a 3509 * subset of the full set of dynamic metadata 3510 * values.</p> 3511 * <p>The entries in the result metadata buffers for a 3512 * single capture may not overlap, except for this entry. The 3513 * FINAL buffers must retain FIFO ordering relative to the 3514 * requests that generate them, so the FINAL buffer for frame 3 must 3515 * always be sent to the framework after the FINAL buffer for frame 2, and 3516 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned 3517 * in any order relative to other frames, but all PARTIAL buffers for a given 3518 * capture must arrive before the FINAL buffer for that capture. This entry may 3519 * only be used by the camera device if quirks.usePartialResult is set to 1.</p> 3520 * <p><b>Range of valid values:</b><br> 3521 * Optional. Default value is FINAL.</p> 3522 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3523 * @deprecated 3524 * <p>Not used in HALv3 or newer</p> 3525 3526 * @hide 3527 */ 3528 @Deprecated 3529 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT = 3530 new Key<Boolean>("android.quirks.partialResult", boolean.class); 3531 3532 /** 3533 * <p>A frame counter set by the framework. This value monotonically 3534 * increases with every new result (that is, each new result has a unique 3535 * frameCount value).</p> 3536 * <p>Reset on release()</p> 3537 * <p><b>Units</b>: count of frames</p> 3538 * <p><b>Range of valid values:</b><br> 3539 * > 0</p> 3540 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3541 * @deprecated 3542 * <p>Not used in HALv3 or newer</p> 3543 3544 * @hide 3545 */ 3546 @Deprecated 3547 public static final Key<Integer> REQUEST_FRAME_COUNT = 3548 new Key<Integer>("android.request.frameCount", int.class); 3549 3550 /** 3551 * <p>An application-specified ID for the current 3552 * request. Must be maintained unchanged in output 3553 * frame</p> 3554 * <p><b>Units</b>: arbitrary integer assigned by application</p> 3555 * <p><b>Range of valid values:</b><br> 3556 * Any int</p> 3557 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3558 * @hide 3559 */ 3560 public static final Key<Integer> REQUEST_ID = 3561 new Key<Integer>("android.request.id", int.class); 3562 3563 /** 3564 * <p>Specifies the number of pipeline stages the frame went 3565 * through from when it was exposed to when the final completed result 3566 * was available to the framework.</p> 3567 * <p>Depending on what settings are used in the request, and 3568 * what streams are configured, the data may undergo less processing, 3569 * and some pipeline stages skipped.</p> 3570 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p> 3571 * <p><b>Range of valid values:</b><br> 3572 * <= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p> 3573 * <p>This key is available on all devices.</p> 3574 * 3575 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH 3576 */ 3577 @PublicKey 3578 @NonNull 3579 public static final Key<Byte> REQUEST_PIPELINE_DEPTH = 3580 new Key<Byte>("android.request.pipelineDepth", byte.class); 3581 3582 /** 3583 * <p>The desired region of the sensor to read out for this capture.</p> 3584 * <p>This control can be used to implement digital zoom.</p> 3585 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 3586 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being 3587 * the top-left pixel of the active array.</p> 3588 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate system 3589 * depends on the mode being set. When the distortion correction mode is OFF, the 3590 * coordinate system follows {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with <code>(0, 3591 * 0)</code> being the top-left pixel of the pre-correction active array. When the distortion 3592 * correction mode is not OFF, the coordinate system follows 3593 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the top-left pixel of the 3594 * active array.</p> 3595 * <p>Output streams use this rectangle to produce their output, cropping to a smaller region 3596 * if necessary to maintain the stream's aspect ratio, then scaling the sensor input to 3597 * match the output's configured resolution.</p> 3598 * <p>The crop region is applied after the RAW to other color space (e.g. YUV) 3599 * conversion. Since raw streams (e.g. RAW16) don't have the conversion stage, they are not 3600 * croppable. The crop region will be ignored by raw streams.</p> 3601 * <p>For non-raw streams, any additional per-stream cropping will be done to maximize the 3602 * final pixel area of the stream.</p> 3603 * <p>For example, if the crop region is set to a 4:3 aspect ratio, then 4:3 streams will use 3604 * the exact crop region. 16:9 streams will further crop vertically (letterbox).</p> 3605 * <p>Conversely, if the crop region is set to a 16:9, then 4:3 outputs will crop horizontally 3606 * (pillarbox), and 16:9 streams will match exactly. These additional crops will be 3607 * centered within the crop region.</p> 3608 * <p>To illustrate, here are several scenarios of different crop regions and output streams, 3609 * for a hypothetical camera device with an active array of size <code>(2000,1500)</code>. Note that 3610 * several of these examples use non-centered crop regions for ease of illustration; such 3611 * regions are only supported on devices with FREEFORM capability 3612 * ({@link CameraCharacteristics#SCALER_CROPPING_TYPE android.scaler.croppingType} <code>== FREEFORM</code>), but this does not affect the way the crop 3613 * rules work otherwise.</p> 3614 * <ul> 3615 * <li>Camera Configuration:<ul> 3616 * <li>Active array size: <code>2000x1500</code> (3 MP, 4:3 aspect ratio)</li> 3617 * <li>Output stream #1: <code>640x480</code> (VGA, 4:3 aspect ratio)</li> 3618 * <li>Output stream #2: <code>1280x720</code> (720p, 16:9 aspect ratio)</li> 3619 * </ul> 3620 * </li> 3621 * <li>Case #1: 4:3 crop region with 2x digital zoom<ul> 3622 * <li>Crop region: <code>Rect(500, 375, 1500, 1125) // (left, top, right, bottom)</code></li> 3623 * <li><img alt="4:3 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.scaler.cropRegion/crop-region-43-ratio.png" /></li> 3624 * <li><code>640x480</code> stream source area: <code>(500, 375, 1500, 1125)</code> (equal to crop region)</li> 3625 * <li><code>1280x720</code> stream source area: <code>(500, 469, 1500, 1031)</code> (letterboxed)</li> 3626 * </ul> 3627 * </li> 3628 * <li>Case #2: 16:9 crop region with ~1.5x digital zoom.<ul> 3629 * <li>Crop region: <code>Rect(500, 375, 1833, 1125)</code></li> 3630 * <li><img alt="16:9 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.scaler.cropRegion/crop-region-169-ratio.png" /></li> 3631 * <li><code>640x480</code> stream source area: <code>(666, 375, 1666, 1125)</code> (pillarboxed)</li> 3632 * <li><code>1280x720</code> stream source area: <code>(500, 375, 1833, 1125)</code> (equal to crop region)</li> 3633 * </ul> 3634 * </li> 3635 * <li>Case #3: 1:1 crop region with ~2.6x digital zoom.<ul> 3636 * <li>Crop region: <code>Rect(500, 375, 1250, 1125)</code></li> 3637 * <li><img alt="1:1 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.scaler.cropRegion/crop-region-11-ratio.png" /></li> 3638 * <li><code>640x480</code> stream source area: <code>(500, 469, 1250, 1031)</code> (letterboxed)</li> 3639 * <li><code>1280x720</code> stream source area: <code>(500, 543, 1250, 957)</code> (letterboxed)</li> 3640 * </ul> 3641 * </li> 3642 * <li>Case #4: Replace <code>640x480</code> stream with <code>1024x1024</code> stream, with 4:3 crop region:<ul> 3643 * <li>Crop region: <code>Rect(500, 375, 1500, 1125)</code></li> 3644 * <li><img alt="Square output, 4:3 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.scaler.cropRegion/crop-region-43-square-ratio.png" /></li> 3645 * <li><code>1024x1024</code> stream source area: <code>(625, 375, 1375, 1125)</code> (pillarboxed)</li> 3646 * <li><code>1280x720</code> stream source area: <code>(500, 469, 1500, 1031)</code> (letterboxed)</li> 3647 * <li>Note that in this case, neither of the two outputs is a subset of the other, with 3648 * each containing image data the other doesn't have.</li> 3649 * </ul> 3650 * </li> 3651 * </ul> 3652 * <p>If the coordinate system is {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, the width and height 3653 * of the crop region cannot be set to be smaller than 3654 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and 3655 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p> 3656 * <p>If the coordinate system is {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, the width 3657 * and height of the crop region cannot be set to be smaller than 3658 * <code>floor( preCorrectionActiveArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> 3659 * and 3660 * <code>floor( preCorrectionActiveArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, 3661 * respectively.</p> 3662 * <p>The camera device may adjust the crop region to account for rounding and other hardware 3663 * requirements; the final crop region used will be included in the output capture result.</p> 3664 * <p>The camera sensor output aspect ratio depends on factors such as output stream 3665 * combination and {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange}, and shouldn't be adjusted by using 3666 * this control. And the camera device will treat different camera sensor output sizes 3667 * (potentially with in-sensor crop) as the same crop of 3668 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}. As a result, the application shouldn't assume the 3669 * maximum crop region always maps to the same aspect ratio or field of view for the 3670 * sensor output.</p> 3671 * <p>Starting from API level 30, it's strongly recommended to use {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} 3672 * to take advantage of better support for zoom with logical multi-camera. The benefits 3673 * include better precision with optical-digital zoom combination, and ability to do 3674 * zoom-out from 1.0x. When using {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for zoom, the crop region in 3675 * the capture request should be left as the default activeArray size. The 3676 * coordinate system is post-zoom, meaning that the activeArraySize or 3677 * preCorrectionActiveArraySize covers the camera device's field of view "after" zoom. See 3678 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details.</p> 3679 * <p>For camera devices with the 3680 * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR } 3681 * capability, {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION android.sensor.info.activeArraySizeMaximumResolution} / 3682 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION android.sensor.info.preCorrectionActiveArraySizeMaximumResolution} must be used as the 3683 * coordinate system for requests where {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to 3684 * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p> 3685 * <p><b>Units</b>: Pixel coordinates relative to 3686 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or 3687 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on distortion correction 3688 * capability and mode</p> 3689 * <p>This key is available on all devices.</p> 3690 * 3691 * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE 3692 * @see CaptureRequest#CONTROL_ZOOM_RATIO 3693 * @see CaptureRequest#DISTORTION_CORRECTION_MODE 3694 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM 3695 * @see CameraCharacteristics#SCALER_CROPPING_TYPE 3696 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 3697 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION 3698 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE 3699 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION 3700 * @see CaptureRequest#SENSOR_PIXEL_MODE 3701 */ 3702 @PublicKey 3703 @NonNull 3704 public static final Key<android.graphics.Rect> SCALER_CROP_REGION = 3705 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); 3706 3707 /** 3708 * <p>Whether a rotation-and-crop operation is applied to processed 3709 * outputs from the camera.</p> 3710 * <p>This control is primarily intended to help camera applications with no support for 3711 * multi-window modes to work correctly on devices where multi-window scenarios are 3712 * unavoidable, such as foldables or other devices with variable display geometry or more 3713 * free-form window placement (such as laptops, which often place portrait-orientation apps 3714 * in landscape with pillarboxing).</p> 3715 * <p>If supported, the default value is <code>ROTATE_AND_CROP_AUTO</code>, which allows the camera API 3716 * to enable backwards-compatibility support for applications that do not support resizing 3717 * / multi-window modes, when the device is in fact in a multi-window mode (such as inset 3718 * portrait on laptops, or on a foldable device in some fold states). In addition, 3719 * <code>ROTATE_AND_CROP_NONE</code> and <code>ROTATE_AND_CROP_90</code> will always be available if this control 3720 * is supported by the device. If not supported, devices API level 30 or higher will always 3721 * list only <code>ROTATE_AND_CROP_NONE</code>.</p> 3722 * <p>When <code>CROP_AUTO</code> is in use, and the camera API activates backward-compatibility mode, 3723 * several metadata fields will also be parsed differently to ensure that coordinates are 3724 * correctly handled for features like drawing face detection boxes or passing in 3725 * tap-to-focus coordinates. The camera API will convert positions in the active array 3726 * coordinate system to/from the cropped-and-rotated coordinate system to make the 3727 * operation transparent for applications. The following controls are affected:</p> 3728 * <ul> 3729 * <li>{@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}</li> 3730 * <li>{@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}</li> 3731 * <li>{@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}</li> 3732 * <li>{@link CaptureResult#STATISTICS_FACES android.statistics.faces}</li> 3733 * </ul> 3734 * <p>Capture results will contain the actual value selected by the API; 3735 * <code>ROTATE_AND_CROP_AUTO</code> will never be seen in a capture result.</p> 3736 * <p>Applications can also select their preferred cropping mode, either to opt out of the 3737 * backwards-compatibility treatment, or to use the cropping feature themselves as needed. 3738 * In this case, no coordinate translation will be done automatically, and all controls 3739 * will continue to use the normal active array coordinates.</p> 3740 * <p>Cropping and rotating is done after the application of digital zoom (via either 3741 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} or {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}), but before each individual 3742 * output is further cropped and scaled. It only affects processed outputs such as 3743 * YUV, PRIVATE, and JPEG. It has no effect on RAW outputs.</p> 3744 * <p>When <code>CROP_90</code> or <code>CROP_270</code> are selected, there is a significant loss to the field of 3745 * view. For example, with a 4:3 aspect ratio output of 1600x1200, <code>CROP_90</code> will still 3746 * produce 1600x1200 output, but these buffers are cropped from a vertical 3:4 slice at the 3747 * center of the 4:3 area, then rotated to be 4:3, and then upscaled to 1600x1200. Only 3748 * 56.25% of the original FOV is still visible. In general, for an aspect ratio of <code>w:h</code>, 3749 * the crop and rotate operation leaves <code>(h/w)^2</code> of the field of view visible. For 16:9, 3750 * this is ~31.6%.</p> 3751 * <p>As a visual example, the figure below shows the effect of <code>ROTATE_AND_CROP_90</code> on the 3752 * outputs for the following parameters:</p> 3753 * <ul> 3754 * <li>Sensor active array: <code>2000x1500</code></li> 3755 * <li>Crop region: top-left: <code>(500, 375)</code>, size: <code>(1000, 750)</code> (4:3 aspect ratio)</li> 3756 * <li>Output streams: YUV <code>640x480</code> and YUV <code>1280x720</code></li> 3757 * <li><code>ROTATE_AND_CROP_90</code></li> 3758 * </ul> 3759 * <p><img alt="Effect of ROTATE_AND_CROP_90" src="/reference/images/camera2/metadata/android.scaler.rotateAndCrop/crop-region-rotate-90-43-ratio.png" /></p> 3760 * <p>With these settings, the regions of the active array covered by the output streams are:</p> 3761 * <ul> 3762 * <li>640x480 stream crop: top-left: <code>(219, 375)</code>, size: <code>(562, 750)</code></li> 3763 * <li>1280x720 stream crop: top-left: <code>(289, 375)</code>, size: <code>(422, 750)</code></li> 3764 * </ul> 3765 * <p>Since the buffers are rotated, the buffers as seen by the application are:</p> 3766 * <ul> 3767 * <li>640x480 stream: top-left: <code>(781, 375)</code> on active array, size: <code>(640, 480)</code>, downscaled 1.17x from sensor pixels</li> 3768 * <li>1280x720 stream: top-left: <code>(711, 375)</code> on active array, size: <code>(1280, 720)</code>, upscaled 1.71x from sensor pixels</li> 3769 * </ul> 3770 * <p><b>Possible values:</b></p> 3771 * <ul> 3772 * <li>{@link #SCALER_ROTATE_AND_CROP_NONE NONE}</li> 3773 * <li>{@link #SCALER_ROTATE_AND_CROP_90 90}</li> 3774 * <li>{@link #SCALER_ROTATE_AND_CROP_180 180}</li> 3775 * <li>{@link #SCALER_ROTATE_AND_CROP_270 270}</li> 3776 * <li>{@link #SCALER_ROTATE_AND_CROP_AUTO AUTO}</li> 3777 * </ul> 3778 * 3779 * <p><b>Available values for this device:</b><br> 3780 * {@link CameraCharacteristics#SCALER_AVAILABLE_ROTATE_AND_CROP_MODES android.scaler.availableRotateAndCropModes}</p> 3781 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3782 * 3783 * @see CaptureRequest#CONTROL_AE_REGIONS 3784 * @see CaptureRequest#CONTROL_AF_REGIONS 3785 * @see CaptureRequest#CONTROL_AWB_REGIONS 3786 * @see CaptureRequest#CONTROL_ZOOM_RATIO 3787 * @see CameraCharacteristics#SCALER_AVAILABLE_ROTATE_AND_CROP_MODES 3788 * @see CaptureRequest#SCALER_CROP_REGION 3789 * @see CaptureResult#STATISTICS_FACES 3790 * @see #SCALER_ROTATE_AND_CROP_NONE 3791 * @see #SCALER_ROTATE_AND_CROP_90 3792 * @see #SCALER_ROTATE_AND_CROP_180 3793 * @see #SCALER_ROTATE_AND_CROP_270 3794 * @see #SCALER_ROTATE_AND_CROP_AUTO 3795 */ 3796 @PublicKey 3797 @NonNull 3798 public static final Key<Integer> SCALER_ROTATE_AND_CROP = 3799 new Key<Integer>("android.scaler.rotateAndCrop", int.class); 3800 3801 /** 3802 * <p>Duration each pixel is exposed to 3803 * light.</p> 3804 * <p>If the sensor can't expose this exact duration, it will shorten the 3805 * duration exposed to the nearest possible value (rather than expose longer). 3806 * The final exposure time used will be available in the output capture result.</p> 3807 * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to 3808 * OFF; otherwise the auto-exposure algorithm will override this value.</p> 3809 * <p><b>Units</b>: Nanoseconds</p> 3810 * <p><b>Range of valid values:</b><br> 3811 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p> 3812 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3813 * <p><b>Full capability</b> - 3814 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 3815 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 3816 * 3817 * @see CaptureRequest#CONTROL_AE_MODE 3818 * @see CaptureRequest#CONTROL_MODE 3819 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 3820 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE 3821 */ 3822 @PublicKey 3823 @NonNull 3824 public static final Key<Long> SENSOR_EXPOSURE_TIME = 3825 new Key<Long>("android.sensor.exposureTime", long.class); 3826 3827 /** 3828 * <p>Duration from start of frame exposure to 3829 * start of next frame exposure.</p> 3830 * <p>The maximum frame rate that can be supported by a camera subsystem is 3831 * a function of many factors:</p> 3832 * <ul> 3833 * <li>Requested resolutions of output image streams</li> 3834 * <li>Availability of binning / skipping modes on the imager</li> 3835 * <li>The bandwidth of the imager interface</li> 3836 * <li>The bandwidth of the various ISP processing blocks</li> 3837 * </ul> 3838 * <p>Since these factors can vary greatly between different ISPs and 3839 * sensors, the camera abstraction tries to represent the bandwidth 3840 * restrictions with as simple a model as possible.</p> 3841 * <p>The model presented has the following characteristics:</p> 3842 * <ul> 3843 * <li>The image sensor is always configured to output the smallest 3844 * resolution possible given the application's requested output stream 3845 * sizes. The smallest resolution is defined as being at least as large 3846 * as the largest requested output stream size; the camera pipeline must 3847 * never digitally upsample sensor data when the crop region covers the 3848 * whole sensor. In general, this means that if only small output stream 3849 * resolutions are configured, the sensor can provide a higher frame 3850 * rate.</li> 3851 * <li>Since any request may use any or all the currently configured 3852 * output streams, the sensor and ISP must be configured to support 3853 * scaling a single capture to all the streams at the same time. This 3854 * means the camera pipeline must be ready to produce the largest 3855 * requested output size without any delay. Therefore, the overall 3856 * frame rate of a given configured stream set is governed only by the 3857 * largest requested stream resolution.</li> 3858 * <li>Using more than one output stream in a request does not affect the 3859 * frame duration.</li> 3860 * <li>Certain format-streams may need to do additional background processing 3861 * before data is consumed/produced by that stream. These processors 3862 * can run concurrently to the rest of the camera pipeline, but 3863 * cannot process more than 1 capture at a time.</li> 3864 * </ul> 3865 * <p>The necessary information for the application, given the model above, is provided via 3866 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }. 3867 * These are used to determine the maximum frame rate / minimum frame duration that is 3868 * possible for a given stream configuration.</p> 3869 * <p>Specifically, the application can use the following rules to 3870 * determine the minimum frame duration it can request from the camera 3871 * device:</p> 3872 * <ol> 3873 * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li> 3874 * <li>Find the minimum frame durations for each stream in <code>S</code>, by looking it up in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration } 3875 * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li> 3876 * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum 3877 * out of all values in <code>F</code>. Let the streams used in <code>R</code> be called <code>S_r</code>.</li> 3878 * </ol> 3879 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } 3880 * using its respective size/format), then the frame duration in <code>F</code> determines the steady 3881 * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let 3882 * this special kind of request be called <code>Rsimple</code>.</p> 3883 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a 3884 * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if 3885 * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all 3886 * buffers from the previous <code>Rstall</code> have already been delivered.</p> 3887 * <p>For more details about stalling, see {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p> 3888 * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to 3889 * OFF; otherwise the auto-exposure algorithm will override this value.</p> 3890 * <p><b>Units</b>: Nanoseconds</p> 3891 * <p><b>Range of valid values:</b><br> 3892 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }. 3893 * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p> 3894 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3895 * <p><b>Full capability</b> - 3896 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 3897 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 3898 * 3899 * @see CaptureRequest#CONTROL_AE_MODE 3900 * @see CaptureRequest#CONTROL_MODE 3901 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 3902 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION 3903 */ 3904 @PublicKey 3905 @NonNull 3906 public static final Key<Long> SENSOR_FRAME_DURATION = 3907 new Key<Long>("android.sensor.frameDuration", long.class); 3908 3909 /** 3910 * <p>The amount of gain applied to sensor data 3911 * before processing.</p> 3912 * <p>The sensitivity is the standard ISO sensitivity value, 3913 * as defined in ISO 12232:2006.</p> 3914 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and 3915 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device 3916 * is guaranteed to use only analog amplification for applying the gain.</p> 3917 * <p>If the camera device cannot apply the exact sensitivity 3918 * requested, it will reduce the gain to the nearest supported 3919 * value. The final sensitivity used will be available in the 3920 * output capture result.</p> 3921 * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to 3922 * OFF; otherwise the auto-exposure algorithm will override this value.</p> 3923 * <p>Note that for devices supporting postRawSensitivityBoost, the total sensitivity applied 3924 * to the final processed image is the combination of {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} and 3925 * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost}. In case the application uses the sensor 3926 * sensitivity from last capture result of an auto request for a manual request, in order 3927 * to achieve the same brightness in the output image, the application should also 3928 * set postRawSensitivityBoost.</p> 3929 * <p><b>Units</b>: ISO arithmetic units</p> 3930 * <p><b>Range of valid values:</b><br> 3931 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p> 3932 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3933 * <p><b>Full capability</b> - 3934 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 3935 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 3936 * 3937 * @see CaptureRequest#CONTROL_AE_MODE 3938 * @see CaptureRequest#CONTROL_MODE 3939 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST 3940 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 3941 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE 3942 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY 3943 * @see CaptureRequest#SENSOR_SENSITIVITY 3944 */ 3945 @PublicKey 3946 @NonNull 3947 public static final Key<Integer> SENSOR_SENSITIVITY = 3948 new Key<Integer>("android.sensor.sensitivity", int.class); 3949 3950 /** 3951 * <p>Time at start of exposure of first 3952 * row of the image sensor active array, in nanoseconds.</p> 3953 * <p>The timestamps are also included in all image 3954 * buffers produced for the same capture, and will be identical 3955 * on all the outputs.</p> 3956 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN, 3957 * the timestamps measure time since an unspecified starting point, 3958 * and are monotonically increasing. They can be compared with the 3959 * timestamps for other captures from the same camera device, but are 3960 * not guaranteed to be comparable to any other time source.</p> 3961 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the 3962 * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can 3963 * be compared to other timestamps from other subsystems that 3964 * are using that base.</p> 3965 * <p>For reprocessing, the timestamp will match the start of exposure of 3966 * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the 3967 * timestamp} in the TotalCaptureResult that was used to create the 3968 * reprocess capture request.</p> 3969 * <p><b>Units</b>: Nanoseconds</p> 3970 * <p><b>Range of valid values:</b><br> 3971 * > 0</p> 3972 * <p>This key is available on all devices.</p> 3973 * 3974 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE 3975 */ 3976 @PublicKey 3977 @NonNull 3978 public static final Key<Long> SENSOR_TIMESTAMP = 3979 new Key<Long>("android.sensor.timestamp", long.class); 3980 3981 /** 3982 * <p>The estimated camera neutral color in the native sensor colorspace at 3983 * the time of capture.</p> 3984 * <p>This value gives the neutral color point encoded as an RGB value in the 3985 * native sensor color space. The neutral color point indicates the 3986 * currently estimated white point of the scene illumination. It can be 3987 * used to interpolate between the provided color transforms when 3988 * processing raw sensor data.</p> 3989 * <p>The order of the values is R, G, B; where R is in the lowest index.</p> 3990 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if 3991 * the camera device has RAW capability.</p> 3992 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 3993 */ 3994 @PublicKey 3995 @NonNull 3996 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT = 3997 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class); 3998 3999 /** 4000 * <p>Noise model coefficients for each CFA mosaic channel.</p> 4001 * <p>This key contains two noise model coefficients for each CFA channel 4002 * corresponding to the sensor amplification (S) and sensor readout 4003 * noise (O). These are given as pairs of coefficients for each channel 4004 * in the same order as channels listed for the CFA layout key 4005 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is 4006 * represented as an array of Pair<Double, Double>, where 4007 * the first member of the Pair at index n is the S coefficient and the 4008 * second member is the O coefficient for the nth color channel in the CFA.</p> 4009 * <p>These coefficients are used in a two parameter noise model to describe 4010 * the amount of noise present in the image for each CFA channel. The 4011 * noise model used here is:</p> 4012 * <p>N(x) = sqrt(Sx + O)</p> 4013 * <p>Where x represents the recorded signal of a CFA channel normalized to 4014 * the range [0, 1], and S and O are the noise model coefficients for 4015 * that channel.</p> 4016 * <p>A more detailed description of the noise model can be found in the 4017 * Adobe DNG specification for the NoiseProfile tag.</p> 4018 * <p>For a MONOCHROME camera, there is only one color channel. So the noise model coefficients 4019 * will only contain one S and one O.</p> 4020 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4021 * 4022 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT 4023 */ 4024 @PublicKey 4025 @NonNull 4026 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE = 4027 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }}); 4028 4029 /** 4030 * <p>The worst-case divergence between Bayer green channels.</p> 4031 * <p>This value is an estimate of the worst case split between the 4032 * Bayer green channels in the red and blue rows in the sensor color 4033 * filter array.</p> 4034 * <p>The green split is calculated as follows:</p> 4035 * <ol> 4036 * <li>A 5x5 pixel (or larger) window W within the active sensor array is 4037 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer 4038 * mosaic channels (R, Gr, Gb, B). The location and size of the window 4039 * chosen is implementation defined, and should be chosen to provide a 4040 * green split estimate that is both representative of the entire image 4041 * for this camera sensor, and can be calculated quickly.</li> 4042 * <li>The arithmetic mean of the green channels from the red 4043 * rows (mean_Gr) within W is computed.</li> 4044 * <li>The arithmetic mean of the green channels from the blue 4045 * rows (mean_Gb) within W is computed.</li> 4046 * <li>The maximum ratio R of the two means is computed as follows: 4047 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li> 4048 * </ol> 4049 * <p>The ratio R is the green split divergence reported for this property, 4050 * which represents how much the green channels differ in the mosaic 4051 * pattern. This value is typically used to determine the treatment of 4052 * the green mosaic channels when demosaicing.</p> 4053 * <p>The green split value can be roughly interpreted as follows:</p> 4054 * <ul> 4055 * <li>R < 1.03 is a negligible split (<3% divergence).</li> 4056 * <li>1.20 <= R >= 1.03 will require some software 4057 * correction to avoid demosaic errors (3-20% divergence).</li> 4058 * <li>R > 1.20 will require strong software correction to produce 4059 * a usable image (>20% divergence).</li> 4060 * </ul> 4061 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if 4062 * the camera device has RAW capability.</p> 4063 * <p><b>Range of valid values:</b><br></p> 4064 * <p>>= 0</p> 4065 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4066 */ 4067 @PublicKey 4068 @NonNull 4069 public static final Key<Float> SENSOR_GREEN_SPLIT = 4070 new Key<Float>("android.sensor.greenSplit", float.class); 4071 4072 /** 4073 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern 4074 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> 4075 * <p>Each color channel is treated as an unsigned 32-bit integer. 4076 * The camera device then uses the most significant X bits 4077 * that correspond to how many bits are in its Bayer raw sensor 4078 * output.</p> 4079 * <p>For example, a sensor with RAW10 Bayer output would use the 4080 * 10 most significant bits from each color channel.</p> 4081 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4082 * 4083 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE 4084 */ 4085 @PublicKey 4086 @NonNull 4087 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = 4088 new Key<int[]>("android.sensor.testPatternData", int[].class); 4089 4090 /** 4091 * <p>When enabled, the sensor sends a test pattern instead of 4092 * doing a real exposure from the camera.</p> 4093 * <p>When a test pattern is enabled, all manual sensor controls specified 4094 * by android.sensor.* will be ignored. All other controls should 4095 * work as normal.</p> 4096 * <p>For example, if manual flash is enabled, flash firing should still 4097 * occur (and that the test pattern remain unmodified, since the flash 4098 * would not actually affect it).</p> 4099 * <p>Defaults to OFF.</p> 4100 * <p><b>Possible values:</b></p> 4101 * <ul> 4102 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li> 4103 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li> 4104 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li> 4105 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li> 4106 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li> 4107 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li> 4108 * </ul> 4109 * 4110 * <p><b>Available values for this device:</b><br> 4111 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p> 4112 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4113 * 4114 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES 4115 * @see #SENSOR_TEST_PATTERN_MODE_OFF 4116 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR 4117 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS 4118 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY 4119 * @see #SENSOR_TEST_PATTERN_MODE_PN9 4120 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 4121 */ 4122 @PublicKey 4123 @NonNull 4124 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = 4125 new Key<Integer>("android.sensor.testPatternMode", int.class); 4126 4127 /** 4128 * <p>Duration between the start of exposure for the first row of the image sensor, 4129 * and the start of exposure for one past the last row of the image sensor.</p> 4130 * <p>This is the exposure time skew between the first and <code>(last+1)</code> row exposure start times. The 4131 * first row and the last row are the first and last rows inside of the 4132 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> 4133 * <p>For typical camera sensors that use rolling shutters, this is also equivalent to the frame 4134 * readout time.</p> 4135 * <p>If the image sensor is operating in a binned or cropped mode due to the current output 4136 * target resolutions, it's possible this skew is reported to be larger than the exposure 4137 * time, for example, since it is based on the full array even if a partial array is read 4138 * out. Be sure to scale the number to cover the section of the sensor actually being used 4139 * for the outputs you care about. So if your output covers N rows of the active array of 4140 * height H, scale this value by N/H to get the total skew for that viewport.</p> 4141 * <p><em>Note:</em> Prior to Android 11, this field was described as measuring duration from 4142 * first to last row of the image sensor, which is not equal to the frame readout time for a 4143 * rolling shutter sensor. Implementations generally reported the latter value, so to resolve 4144 * the inconsistency, the description has been updated to range from (first, last+1) row 4145 * exposure start, instead.</p> 4146 * <p><b>Units</b>: Nanoseconds</p> 4147 * <p><b>Range of valid values:</b><br> 4148 * >= 0 and < 4149 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p> 4150 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4151 * <p><b>Limited capability</b> - 4152 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 4153 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 4154 * 4155 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 4156 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 4157 */ 4158 @PublicKey 4159 @NonNull 4160 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW = 4161 new Key<Long>("android.sensor.rollingShutterSkew", long.class); 4162 4163 /** 4164 * <p>A per-frame dynamic black level offset for each of the color filter 4165 * arrangement (CFA) mosaic channels.</p> 4166 * <p>Camera sensor black levels may vary dramatically for different 4167 * capture settings (e.g. {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). The fixed black 4168 * level reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may be too 4169 * inaccurate to represent the actual value on a per-frame basis. The 4170 * camera device internal pipeline relies on reliable black level values 4171 * to process the raw images appropriately. To get the best image 4172 * quality, the camera device may choose to estimate the per frame black 4173 * level values either based on optically shielded black regions 4174 * ({@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}) or its internal model.</p> 4175 * <p>This key reports the camera device estimated per-frame zero light 4176 * value for each of the CFA mosaic channels in the camera sensor. The 4177 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may only represent a coarse 4178 * approximation of the actual black level values. This value is the 4179 * black level used in camera device internal image processing pipeline 4180 * and generally more accurate than the fixed black level values. 4181 * However, since they are estimated values by the camera device, they 4182 * may not be as accurate as the black level values calculated from the 4183 * optical black pixels reported by {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}.</p> 4184 * <p>The values are given in the same order as channels listed for the CFA 4185 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the 4186 * nth value given corresponds to the black level offset for the nth 4187 * color channel listed in the CFA.</p> 4188 * <p>For a MONOCHROME camera, all of the 2x2 channels must have the same values.</p> 4189 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is available or the 4190 * camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p> 4191 * <p><b>Range of valid values:</b><br> 4192 * >= 0 for each.</p> 4193 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4194 * 4195 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN 4196 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT 4197 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS 4198 * @see CaptureRequest#SENSOR_SENSITIVITY 4199 */ 4200 @PublicKey 4201 @NonNull 4202 public static final Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL = 4203 new Key<float[]>("android.sensor.dynamicBlackLevel", float[].class); 4204 4205 /** 4206 * <p>Maximum raw value output by sensor for this frame.</p> 4207 * <p>Since the {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may change for different 4208 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}), the white 4209 * level will change accordingly. This key is similar to 4210 * {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}, but specifies the camera device 4211 * estimated white level for each frame.</p> 4212 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is 4213 * available or the camera device advertises this key via 4214 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys }.</p> 4215 * <p><b>Range of valid values:</b><br> 4216 * >= 0</p> 4217 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4218 * 4219 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN 4220 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL 4221 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS 4222 * @see CaptureRequest#SENSOR_SENSITIVITY 4223 */ 4224 @PublicKey 4225 @NonNull 4226 public static final Key<Integer> SENSOR_DYNAMIC_WHITE_LEVEL = 4227 new Key<Integer>("android.sensor.dynamicWhiteLevel", int.class); 4228 4229 /** 4230 * <p>Switches sensor pixel mode between maximum resolution mode and default mode.</p> 4231 * <p>This key controls whether the camera sensor operates in 4232 * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION } 4233 * mode or not. By default, all camera devices operate in 4234 * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_DEFAULT } mode. 4235 * When operating in 4236 * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_DEFAULT } mode, sensors 4237 * with {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR } 4238 * capability would typically perform pixel binning in order to improve low light 4239 * performance, noise reduction etc. However, in 4240 * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION } 4241 * mode (supported only 4242 * by {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR } 4243 * sensors), sensors typically operate in unbinned mode allowing for a larger image size. 4244 * The stream configurations supported in 4245 * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION } 4246 * mode are also different from those of 4247 * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_DEFAULT } mode. 4248 * They can be queried through 4249 * {@link android.hardware.camera2.CameraCharacteristics#get } with 4250 * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION) }. 4251 * Unless reported by both 4252 * {@link android.hardware.camera2.params.StreamConfigurationMap }s, the outputs from 4253 * <code>{@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION android.scaler.streamConfigurationMapMaximumResolution}</code> and 4254 * <code>{@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}</code> 4255 * must not be mixed in the same CaptureRequest. In other words, these outputs are 4256 * exclusive to each other. 4257 * This key does not need to be set for reprocess requests.</p> 4258 * <p><b>Possible values:</b></p> 4259 * <ul> 4260 * <li>{@link #SENSOR_PIXEL_MODE_DEFAULT DEFAULT}</li> 4261 * <li>{@link #SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION MAXIMUM_RESOLUTION}</li> 4262 * </ul> 4263 * 4264 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4265 * 4266 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP 4267 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION 4268 * @see #SENSOR_PIXEL_MODE_DEFAULT 4269 * @see #SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION 4270 */ 4271 @PublicKey 4272 @NonNull 4273 public static final Key<Integer> SENSOR_PIXEL_MODE = 4274 new Key<Integer>("android.sensor.pixelMode", int.class); 4275 4276 /** 4277 * <p>Whether <code>RAW</code> images requested have their bayer pattern as described by 4278 * {@link CameraCharacteristics#SENSOR_INFO_BINNING_FACTOR android.sensor.info.binningFactor}.</p> 4279 * <p>This key will only be present in devices advertising the 4280 * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR } 4281 * capability which also advertise <code>REMOSAIC_REPROCESSING</code> capability. On all other devices 4282 * RAW targets will have a regular bayer pattern.</p> 4283 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4284 * 4285 * @see CameraCharacteristics#SENSOR_INFO_BINNING_FACTOR 4286 */ 4287 @PublicKey 4288 @NonNull 4289 public static final Key<Boolean> SENSOR_RAW_BINNING_FACTOR_USED = 4290 new Key<Boolean>("android.sensor.rawBinningFactorUsed", boolean.class); 4291 4292 /** 4293 * <p>Quality of lens shading correction applied 4294 * to the image data.</p> 4295 * <p>When set to OFF mode, no lens shading correction will be applied by the 4296 * camera device, and an identity lens shading map data will be provided 4297 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens 4298 * shading map with size of <code>[ 4, 3 ]</code>, 4299 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity 4300 * map shown below:</p> 4301 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 4302 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 4303 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 4304 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 4305 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 4306 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] 4307 * </code></pre> 4308 * <p>When set to other modes, lens shading correction will be applied by the camera 4309 * device. Applications can request lens shading map data by setting 4310 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens 4311 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map 4312 * data will be the one applied by the camera device for this capture request.</p> 4313 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore 4314 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and 4315 * AWB are in AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code> 4316 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB 4317 * to be converged before using the returned shading map data.</p> 4318 * <p><b>Possible values:</b></p> 4319 * <ul> 4320 * <li>{@link #SHADING_MODE_OFF OFF}</li> 4321 * <li>{@link #SHADING_MODE_FAST FAST}</li> 4322 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 4323 * </ul> 4324 * 4325 * <p><b>Available values for this device:</b><br> 4326 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p> 4327 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4328 * <p><b>Full capability</b> - 4329 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 4330 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 4331 * 4332 * @see CaptureRequest#CONTROL_AE_MODE 4333 * @see CaptureRequest#CONTROL_AWB_MODE 4334 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 4335 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES 4336 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP 4337 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE 4338 * @see #SHADING_MODE_OFF 4339 * @see #SHADING_MODE_FAST 4340 * @see #SHADING_MODE_HIGH_QUALITY 4341 */ 4342 @PublicKey 4343 @NonNull 4344 public static final Key<Integer> SHADING_MODE = 4345 new Key<Integer>("android.shading.mode", int.class); 4346 4347 /** 4348 * <p>Operating mode for the face detector 4349 * unit.</p> 4350 * <p>Whether face detection is enabled, and whether it 4351 * should output just the basic fields or the full set of 4352 * fields.</p> 4353 * <p><b>Possible values:</b></p> 4354 * <ul> 4355 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li> 4356 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li> 4357 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li> 4358 * </ul> 4359 * 4360 * <p><b>Available values for this device:</b><br> 4361 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p> 4362 * <p>This key is available on all devices.</p> 4363 * 4364 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES 4365 * @see #STATISTICS_FACE_DETECT_MODE_OFF 4366 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE 4367 * @see #STATISTICS_FACE_DETECT_MODE_FULL 4368 */ 4369 @PublicKey 4370 @NonNull 4371 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = 4372 new Key<Integer>("android.statistics.faceDetectMode", int.class); 4373 4374 /** 4375 * <p>List of unique IDs for detected faces.</p> 4376 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible 4377 * to the camera device. A face that leaves the field of view and later returns may be 4378 * assigned a new ID.</p> 4379 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL 4380 * This key is available on all devices.</p> 4381 * 4382 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE 4383 * @hide 4384 */ 4385 public static final Key<int[]> STATISTICS_FACE_IDS = 4386 new Key<int[]>("android.statistics.faceIds", int[].class); 4387 4388 /** 4389 * <p>List of landmarks for detected 4390 * faces.</p> 4391 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 4392 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being 4393 * the top-left pixel of the active array.</p> 4394 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 4395 * system depends on the mode being set. 4396 * When the distortion correction mode is OFF, the coordinate system follows 4397 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with 4398 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array. 4399 * When the distortion correction mode is not OFF, the coordinate system follows 4400 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with 4401 * <code>(0, 0)</code> being the top-left pixel of the active array.</p> 4402 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL.</p> 4403 * <p>Starting from API level 30, the coordinate system of activeArraySize or 4404 * preCorrectionActiveArraySize is used to represent post-zoomRatio field of view, not 4405 * pre-zoomRatio field of view. This means that if the relative position of faces and 4406 * the camera device doesn't change, when zooming in by increasing 4407 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, the face landmarks move farther away from the center of the 4408 * activeArray or preCorrectionActiveArray. If {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} is set to 1.0 4409 * (default), the face landmarks coordinates won't change as {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} 4410 * changes. See {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details. Whether to use activeArraySize or 4411 * preCorrectionActiveArraySize still depends on distortion correction mode.</p> 4412 * <p>This key is available on all devices.</p> 4413 * 4414 * @see CaptureRequest#CONTROL_ZOOM_RATIO 4415 * @see CaptureRequest#DISTORTION_CORRECTION_MODE 4416 * @see CaptureRequest#SCALER_CROP_REGION 4417 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 4418 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE 4419 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE 4420 * @hide 4421 */ 4422 public static final Key<int[]> STATISTICS_FACE_LANDMARKS = 4423 new Key<int[]>("android.statistics.faceLandmarks", int[].class); 4424 4425 /** 4426 * <p>List of the bounding rectangles for detected 4427 * faces.</p> 4428 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 4429 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being 4430 * the top-left pixel of the active array.</p> 4431 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate 4432 * system depends on the mode being set. 4433 * When the distortion correction mode is OFF, the coordinate system follows 4434 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with 4435 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array. 4436 * When the distortion correction mode is not OFF, the coordinate system follows 4437 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with 4438 * <code>(0, 0)</code> being the top-left pixel of the active array.</p> 4439 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p> 4440 * <p>Starting from API level 30, the coordinate system of activeArraySize or 4441 * preCorrectionActiveArraySize is used to represent post-zoomRatio field of view, not 4442 * pre-zoomRatio field of view. This means that if the relative position of faces and 4443 * the camera device doesn't change, when zooming in by increasing 4444 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, the face rectangles grow larger and move farther away from 4445 * the center of the activeArray or preCorrectionActiveArray. If {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} 4446 * is set to 1.0 (default), the face rectangles won't change as {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} 4447 * changes. See {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details. Whether to use activeArraySize or 4448 * preCorrectionActiveArraySize still depends on distortion correction mode.</p> 4449 * <p>This key is available on all devices.</p> 4450 * 4451 * @see CaptureRequest#CONTROL_ZOOM_RATIO 4452 * @see CaptureRequest#DISTORTION_CORRECTION_MODE 4453 * @see CaptureRequest#SCALER_CROP_REGION 4454 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 4455 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE 4456 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE 4457 * @hide 4458 */ 4459 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES = 4460 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class); 4461 4462 /** 4463 * <p>List of the face confidence scores for 4464 * detected faces</p> 4465 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p> 4466 * <p><b>Range of valid values:</b><br> 4467 * 1-100</p> 4468 * <p>This key is available on all devices.</p> 4469 * 4470 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE 4471 * @hide 4472 */ 4473 public static final Key<byte[]> STATISTICS_FACE_SCORES = 4474 new Key<byte[]>("android.statistics.faceScores", byte[].class); 4475 4476 /** 4477 * <p>List of the faces detected through camera face detection 4478 * in this capture.</p> 4479 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p> 4480 * <p>This key is available on all devices.</p> 4481 * 4482 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE 4483 */ 4484 @PublicKey 4485 @NonNull 4486 @SyntheticKey 4487 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES = 4488 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class); 4489 4490 /** 4491 * <p>The shading map is a low-resolution floating-point map 4492 * that lists the coefficients used to correct for vignetting, for each 4493 * Bayer color channel.</p> 4494 * <p>The map provided here is the same map that is used by the camera device to 4495 * correct both color shading and vignetting for output non-RAW images.</p> 4496 * <p>When there is no lens shading correction applied to RAW 4497 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code> 4498 * false), this map is the complete lens shading correction 4499 * map; when there is some lens shading correction applied to 4500 * the RAW output image ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}<code>==</code> true), this map reports the remaining lens shading 4501 * correction map that needs to be applied to get shading 4502 * corrected images that match the camera device's output for 4503 * non-RAW formats.</p> 4504 * <p>For a complete shading correction map, the least shaded 4505 * section of the image will have a gain factor of 1; all 4506 * other sections will have gains above 1.</p> 4507 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map 4508 * will take into account the colorCorrection settings.</p> 4509 * <p>The shading map is for the entire active pixel array, and is not 4510 * affected by the crop region specified in the request. Each shading map 4511 * entry is the value of the shading compensation map over a specific 4512 * pixel on the sensor. Specifically, with a (N x M) resolution shading 4513 * map, and an active pixel array size (W x H), shading map entry 4514 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at 4515 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. 4516 * The map is assumed to be bilinearly interpolated between the sample points.</p> 4517 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green 4518 * channel for the even rows of a Bayer pattern, and Godd is the odd rows. 4519 * The shading map is stored in a fully interleaved format.</p> 4520 * <p>The shading map will generally have on the order of 30-40 rows and columns, 4521 * and will be smaller than 64x64.</p> 4522 * <p>As an example, given a very small map defined as:</p> 4523 * <pre><code>width,height = [ 4, 3 ] 4524 * values = 4525 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2, 4526 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, 4527 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, 4528 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, 4529 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, 4530 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ] 4531 * </code></pre> 4532 * <p>The low-resolution scaling map images for each channel are 4533 * (displayed using nearest-neighbor interpolation):</p> 4534 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> 4535 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> 4536 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> 4537 * <img alt="Blue lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> 4538 * <p>As a visualization only, inverting the full-color map to recover an 4539 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p> 4540 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p> 4541 * <p>For a MONOCHROME camera, all of the 2x2 channels must have the same values. An example 4542 * shading map for such a camera is defined as:</p> 4543 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ] 4544 * android.statistics.lensShadingMap = 4545 * [ 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2, 4546 * 1.1, 1.1, 1.1, 1.1, 1.3, 1.3, 1.3, 1.3, 4547 * 1.2, 1.2, 1.2, 1.2, 1.1, 1.1, 1.1, 1.1, 4548 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.2, 1.2, 4549 * 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2, 4550 * 1.2, 1.2, 1.2, 1.2, 1.3, 1.3, 1.3, 1.3 ] 4551 * </code></pre> 4552 * <p><b>Range of valid values:</b><br> 4553 * Each gain factor is >= 1</p> 4554 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4555 * <p><b>Full capability</b> - 4556 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 4557 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 4558 * 4559 * @see CaptureRequest#COLOR_CORRECTION_MODE 4560 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 4561 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED 4562 */ 4563 @PublicKey 4564 @NonNull 4565 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP = 4566 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class); 4567 4568 /** 4569 * <p>The shading map is a low-resolution floating-point map 4570 * that lists the coefficients used to correct for vignetting and color shading, 4571 * for each Bayer color channel of RAW image data.</p> 4572 * <p>The map provided here is the same map that is used by the camera device to 4573 * correct both color shading and vignetting for output non-RAW images.</p> 4574 * <p>When there is no lens shading correction applied to RAW 4575 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code> 4576 * false), this map is the complete lens shading correction 4577 * map; when there is some lens shading correction applied to 4578 * the RAW output image ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}<code>==</code> true), this map reports the remaining lens shading 4579 * correction map that needs to be applied to get shading 4580 * corrected images that match the camera device's output for 4581 * non-RAW formats.</p> 4582 * <p>For a complete shading correction map, the least shaded 4583 * section of the image will have a gain factor of 1; all 4584 * other sections will have gains above 1.</p> 4585 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map 4586 * will take into account the colorCorrection settings.</p> 4587 * <p>The shading map is for the entire active pixel array, and is not 4588 * affected by the crop region specified in the request. Each shading map 4589 * entry is the value of the shading compensation map over a specific 4590 * pixel on the sensor. Specifically, with a (N x M) resolution shading 4591 * map, and an active pixel array size (W x H), shading map entry 4592 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at 4593 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. 4594 * The map is assumed to be bilinearly interpolated between the sample points.</p> 4595 * <p>For a Bayer camera, the channel order is [R, Geven, Godd, B], where Geven is 4596 * the green channel for the even rows of a Bayer pattern, and Godd is the odd rows. 4597 * The shading map is stored in a fully interleaved format, and its size 4598 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p> 4599 * <p>The shading map will generally have on the order of 30-40 rows and columns, 4600 * and will be smaller than 64x64.</p> 4601 * <p>As an example, given a very small map for a Bayer camera defined as:</p> 4602 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ] 4603 * android.statistics.lensShadingMap = 4604 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2, 4605 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, 4606 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, 4607 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, 4608 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, 4609 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ] 4610 * </code></pre> 4611 * <p>The low-resolution scaling map images for each channel are 4612 * (displayed using nearest-neighbor interpolation):</p> 4613 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> 4614 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> 4615 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> 4616 * <img alt="Blue lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> 4617 * <p>As a visualization only, inverting the full-color map to recover an 4618 * image of a gray wall (using bicubic interpolation for visual quality) 4619 * as captured by the sensor gives:</p> 4620 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p> 4621 * <p>For a MONOCHROME camera, all of the 2x2 channels must have the same values. An example 4622 * shading map for such a camera is defined as:</p> 4623 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ] 4624 * android.statistics.lensShadingMap = 4625 * [ 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2, 4626 * 1.1, 1.1, 1.1, 1.1, 1.3, 1.3, 1.3, 1.3, 4627 * 1.2, 1.2, 1.2, 1.2, 1.1, 1.1, 1.1, 1.1, 4628 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.2, 1.2, 4629 * 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2, 4630 * 1.2, 1.2, 1.2, 1.2, 1.3, 1.3, 1.3, 1.3 ] 4631 * </code></pre> 4632 * <p>Note that the RAW image data might be subject to lens shading 4633 * correction not reported on this map. Query 4634 * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject 4635 * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} 4636 * is TRUE, the RAW image data is subject to partial or full lens shading 4637 * correction. In the case full lens shading correction is applied to RAW 4638 * images, the gain factor map reported in this key will contain all 1.0 gains. 4639 * In other words, the map reported in this key is the remaining lens shading 4640 * that needs to be applied on the RAW image to get images without lens shading 4641 * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image 4642 * formats.</p> 4643 * <p><b>Range of valid values:</b><br> 4644 * Each gain factor is >= 1</p> 4645 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4646 * <p><b>Full capability</b> - 4647 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 4648 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 4649 * 4650 * @see CaptureRequest#COLOR_CORRECTION_MODE 4651 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 4652 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW 4653 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED 4654 * @hide 4655 */ 4656 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP = 4657 new Key<float[]>("android.statistics.lensShadingMap", float[].class); 4658 4659 /** 4660 * <p>The best-fit color channel gains calculated 4661 * by the camera device's statistics units for the current output frame.</p> 4662 * <p>This may be different than the gains used for this frame, 4663 * since statistics processing on data from a new frame 4664 * typically completes after the transform has already been 4665 * applied to that frame.</p> 4666 * <p>The 4 channel gains are defined in Bayer domain, 4667 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p> 4668 * <p>This value should always be calculated by the auto-white balance (AWB) block, 4669 * regardless of the android.control.* current values.</p> 4670 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4671 * 4672 * @see CaptureRequest#COLOR_CORRECTION_GAINS 4673 * @deprecated 4674 * <p>Never fully implemented or specified; do not use</p> 4675 4676 * @hide 4677 */ 4678 @Deprecated 4679 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS = 4680 new Key<float[]>("android.statistics.predictedColorGains", float[].class); 4681 4682 /** 4683 * <p>The best-fit color transform matrix estimate 4684 * calculated by the camera device's statistics units for the current 4685 * output frame.</p> 4686 * <p>The camera device will provide the estimate from its 4687 * statistics unit on the white balance transforms to use 4688 * for the next frame. These are the values the camera device believes 4689 * are the best fit for the current output frame. This may 4690 * be different than the transform used for this frame, since 4691 * statistics processing on data from a new frame typically 4692 * completes after the transform has already been applied to 4693 * that frame.</p> 4694 * <p>These estimates must be provided for all frames, even if 4695 * capture settings and color transforms are set by the application.</p> 4696 * <p>This value should always be calculated by the auto-white balance (AWB) block, 4697 * regardless of the android.control.* current values.</p> 4698 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4699 * @deprecated 4700 * <p>Never fully implemented or specified; do not use</p> 4701 4702 * @hide 4703 */ 4704 @Deprecated 4705 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM = 4706 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class); 4707 4708 /** 4709 * <p>The camera device estimated scene illumination lighting 4710 * frequency.</p> 4711 * <p>Many light sources, such as most fluorescent lights, flicker at a rate 4712 * that depends on the local utility power standards. This flicker must be 4713 * accounted for by auto-exposure routines to avoid artifacts in captured images. 4714 * The camera device uses this entry to tell the application what the scene 4715 * illuminant frequency is.</p> 4716 * <p>When manual exposure control is enabled 4717 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == 4718 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform 4719 * antibanding, and the application can ensure it selects 4720 * exposure times that do not cause banding issues by looking 4721 * into this metadata field. See 4722 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p> 4723 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p> 4724 * <p><b>Possible values:</b></p> 4725 * <ul> 4726 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li> 4727 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li> 4728 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li> 4729 * </ul> 4730 * 4731 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4732 * <p><b>Full capability</b> - 4733 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 4734 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 4735 * 4736 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE 4737 * @see CaptureRequest#CONTROL_AE_MODE 4738 * @see CaptureRequest#CONTROL_MODE 4739 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 4740 * @see #STATISTICS_SCENE_FLICKER_NONE 4741 * @see #STATISTICS_SCENE_FLICKER_50HZ 4742 * @see #STATISTICS_SCENE_FLICKER_60HZ 4743 */ 4744 @PublicKey 4745 @NonNull 4746 public static final Key<Integer> STATISTICS_SCENE_FLICKER = 4747 new Key<Integer>("android.statistics.sceneFlicker", int.class); 4748 4749 /** 4750 * <p>Operating mode for hot pixel map generation.</p> 4751 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}. 4752 * If set to <code>false</code>, no hot pixel map will be returned.</p> 4753 * <p><b>Range of valid values:</b><br> 4754 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p> 4755 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4756 * 4757 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP 4758 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES 4759 */ 4760 @PublicKey 4761 @NonNull 4762 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = 4763 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); 4764 4765 /** 4766 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p> 4767 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and 4768 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and 4769 * bottom-right of the pixel array, respectively. The width and 4770 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}. 4771 * This may include hot pixels that lie outside of the active array 4772 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> 4773 * <p><b>Range of valid values:</b><br></p> 4774 * <p>n <= number of pixels on the sensor. 4775 * The <code>(x, y)</code> coordinates must be bounded by 4776 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p> 4777 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4778 * 4779 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 4780 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE 4781 */ 4782 @PublicKey 4783 @NonNull 4784 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP = 4785 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class); 4786 4787 /** 4788 * <p>Whether the camera device will output the lens 4789 * shading map in output result metadata.</p> 4790 * <p>When set to ON, 4791 * android.statistics.lensShadingMap will be provided in 4792 * the output result metadata.</p> 4793 * <p>ON is always supported on devices with the RAW capability.</p> 4794 * <p><b>Possible values:</b></p> 4795 * <ul> 4796 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li> 4797 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li> 4798 * </ul> 4799 * 4800 * <p><b>Available values for this device:</b><br> 4801 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p> 4802 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4803 * <p><b>Full capability</b> - 4804 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 4805 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 4806 * 4807 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 4808 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES 4809 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF 4810 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON 4811 */ 4812 @PublicKey 4813 @NonNull 4814 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = 4815 new Key<Integer>("android.statistics.lensShadingMapMode", int.class); 4816 4817 /** 4818 * <p>A control for selecting whether optical stabilization (OIS) position 4819 * information is included in output result metadata.</p> 4820 * <p>Since optical image stabilization generally involves motion much faster than the duration 4821 * of individual image exposure, multiple OIS samples can be included for a single capture 4822 * result. For example, if the OIS reporting operates at 200 Hz, a typical camera operating 4823 * at 30fps may have 6-7 OIS samples per capture result. This information can be combined 4824 * with the rolling shutter skew to account for lens motion during image exposure in 4825 * post-processing algorithms.</p> 4826 * <p><b>Possible values:</b></p> 4827 * <ul> 4828 * <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li> 4829 * <li>{@link #STATISTICS_OIS_DATA_MODE_ON ON}</li> 4830 * </ul> 4831 * 4832 * <p><b>Available values for this device:</b><br> 4833 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES android.statistics.info.availableOisDataModes}</p> 4834 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4835 * 4836 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES 4837 * @see #STATISTICS_OIS_DATA_MODE_OFF 4838 * @see #STATISTICS_OIS_DATA_MODE_ON 4839 */ 4840 @PublicKey 4841 @NonNull 4842 public static final Key<Integer> STATISTICS_OIS_DATA_MODE = 4843 new Key<Integer>("android.statistics.oisDataMode", int.class); 4844 4845 /** 4846 * <p>An array of timestamps of OIS samples, in nanoseconds.</p> 4847 * <p>The array contains the timestamps of OIS samples. The timestamps are in the same 4848 * timebase as and comparable to {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp}.</p> 4849 * <p><b>Units</b>: nanoseconds</p> 4850 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4851 * 4852 * @see CaptureResult#SENSOR_TIMESTAMP 4853 * @hide 4854 */ 4855 public static final Key<long[]> STATISTICS_OIS_TIMESTAMPS = 4856 new Key<long[]>("android.statistics.oisTimestamps", long[].class); 4857 4858 /** 4859 * <p>An array of shifts of OIS samples, in x direction.</p> 4860 * <p>The array contains the amount of shifts in x direction, in pixels, based on OIS samples. 4861 * A positive value is a shift from left to right in the pre-correction active array 4862 * coordinate system. For example, if the optical center is (1000, 500) in pre-correction 4863 * active array coordinates, a shift of (3, 0) puts the new optical center at (1003, 500).</p> 4864 * <p>The number of shifts must match the number of timestamps in 4865 * android.statistics.oisTimestamps.</p> 4866 * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on 4867 * supporting devices). They are always reported in pre-correction active array coordinates, 4868 * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift 4869 * is needed.</p> 4870 * <p><b>Units</b>: Pixels in active array.</p> 4871 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4872 * @hide 4873 */ 4874 public static final Key<float[]> STATISTICS_OIS_X_SHIFTS = 4875 new Key<float[]>("android.statistics.oisXShifts", float[].class); 4876 4877 /** 4878 * <p>An array of shifts of OIS samples, in y direction.</p> 4879 * <p>The array contains the amount of shifts in y direction, in pixels, based on OIS samples. 4880 * A positive value is a shift from top to bottom in pre-correction active array coordinate 4881 * system. For example, if the optical center is (1000, 500) in active array coordinates, a 4882 * shift of (0, 5) puts the new optical center at (1000, 505).</p> 4883 * <p>The number of shifts must match the number of timestamps in 4884 * android.statistics.oisTimestamps.</p> 4885 * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on 4886 * supporting devices). They are always reported in pre-correction active array coordinates, 4887 * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift 4888 * is needed.</p> 4889 * <p><b>Units</b>: Pixels in active array.</p> 4890 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4891 * @hide 4892 */ 4893 public static final Key<float[]> STATISTICS_OIS_Y_SHIFTS = 4894 new Key<float[]>("android.statistics.oisYShifts", float[].class); 4895 4896 /** 4897 * <p>An array of optical stabilization (OIS) position samples.</p> 4898 * <p>Each OIS sample contains the timestamp and the amount of shifts in x and y direction, 4899 * in pixels, of the OIS sample.</p> 4900 * <p>A positive value for a shift in x direction is a shift from left to right in the 4901 * pre-correction active array coordinate system. For example, if the optical center is 4902 * (1000, 500) in pre-correction active array coordinates, a shift of (3, 0) puts the new 4903 * optical center at (1003, 500).</p> 4904 * <p>A positive value for a shift in y direction is a shift from top to bottom in 4905 * pre-correction active array coordinate system. For example, if the optical center is 4906 * (1000, 500) in active array coordinates, a shift of (0, 5) puts the new optical center at 4907 * (1000, 505).</p> 4908 * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on 4909 * supporting devices). They are always reported in pre-correction active array coordinates, 4910 * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift 4911 * is needed.</p> 4912 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4913 */ 4914 @PublicKey 4915 @NonNull 4916 @SyntheticKey 4917 public static final Key<android.hardware.camera2.params.OisSample[]> STATISTICS_OIS_SAMPLES = 4918 new Key<android.hardware.camera2.params.OisSample[]>("android.statistics.oisSamples", android.hardware.camera2.params.OisSample[].class); 4919 4920 /** 4921 * <p>Tonemapping / contrast / gamma curve for the blue 4922 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 4923 * CONTRAST_CURVE.</p> 4924 * <p>See android.tonemap.curveRed for more details.</p> 4925 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4926 * <p><b>Full capability</b> - 4927 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 4928 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 4929 * 4930 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 4931 * @see CaptureRequest#TONEMAP_MODE 4932 * @hide 4933 */ 4934 public static final Key<float[]> TONEMAP_CURVE_BLUE = 4935 new Key<float[]>("android.tonemap.curveBlue", float[].class); 4936 4937 /** 4938 * <p>Tonemapping / contrast / gamma curve for the green 4939 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 4940 * CONTRAST_CURVE.</p> 4941 * <p>See android.tonemap.curveRed for more details.</p> 4942 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 4943 * <p><b>Full capability</b> - 4944 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 4945 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 4946 * 4947 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 4948 * @see CaptureRequest#TONEMAP_MODE 4949 * @hide 4950 */ 4951 public static final Key<float[]> TONEMAP_CURVE_GREEN = 4952 new Key<float[]>("android.tonemap.curveGreen", float[].class); 4953 4954 /** 4955 * <p>Tonemapping / contrast / gamma curve for the red 4956 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 4957 * CONTRAST_CURVE.</p> 4958 * <p>Each channel's curve is defined by an array of control points:</p> 4959 * <pre><code>android.tonemap.curveRed = 4960 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] 4961 * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> 4962 * <p>These are sorted in order of increasing <code>Pin</code>; it is 4963 * required that input values 0.0 and 1.0 are included in the list to 4964 * define a complete mapping. For input values between control points, 4965 * the camera device must linearly interpolate between the control 4966 * points.</p> 4967 * <p>Each curve can have an independent number of points, and the number 4968 * of points can be less than max (that is, the request doesn't have to 4969 * always provide a curve with number of points equivalent to 4970 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> 4971 * <p>For devices with MONOCHROME capability, all three channels must have the same set of 4972 * control points.</p> 4973 * <p>A few examples, and their corresponding graphical mappings; these 4974 * only specify the red channel and the precision is limited to 4 4975 * digits, for conciseness.</p> 4976 * <p>Linear mapping:</p> 4977 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ] 4978 * </code></pre> 4979 * <p><img alt="Linear mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> 4980 * <p>Invert mapping:</p> 4981 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ] 4982 * </code></pre> 4983 * <p><img alt="Inverting mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> 4984 * <p>Gamma 1/2.2 mapping, with 16 control points:</p> 4985 * <pre><code>android.tonemap.curveRed = [ 4986 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, 4987 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, 4988 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, 4989 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ] 4990 * </code></pre> 4991 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> 4992 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> 4993 * <pre><code>android.tonemap.curveRed = [ 4994 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, 4995 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, 4996 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, 4997 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ] 4998 * </code></pre> 4999 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> 5000 * <p><b>Range of valid values:</b><br> 5001 * 0-1 on both input and output coordinates, normalized 5002 * as a floating-point value such that 0 == black and 1 == white.</p> 5003 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 5004 * <p><b>Full capability</b> - 5005 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 5006 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 5007 * 5008 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 5009 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS 5010 * @see CaptureRequest#TONEMAP_MODE 5011 * @hide 5012 */ 5013 public static final Key<float[]> TONEMAP_CURVE_RED = 5014 new Key<float[]>("android.tonemap.curveRed", float[].class); 5015 5016 /** 5017 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} 5018 * is CONTRAST_CURVE.</p> 5019 * <p>The tonemapCurve consist of three curves for each of red, green, and blue 5020 * channels respectively. The following example uses the red channel as an 5021 * example. The same logic applies to green and blue channel. 5022 * Each channel's curve is defined by an array of control points:</p> 5023 * <pre><code>curveRed = 5024 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ] 5025 * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> 5026 * <p>These are sorted in order of increasing <code>Pin</code>; it is always 5027 * guaranteed that input values 0.0 and 1.0 are included in the list to 5028 * define a complete mapping. For input values between control points, 5029 * the camera device must linearly interpolate between the control 5030 * points.</p> 5031 * <p>Each curve can have an independent number of points, and the number 5032 * of points can be less than max (that is, the request doesn't have to 5033 * always provide a curve with number of points equivalent to 5034 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> 5035 * <p>For devices with MONOCHROME capability, all three channels must have the same set of 5036 * control points.</p> 5037 * <p>A few examples, and their corresponding graphical mappings; these 5038 * only specify the red channel and the precision is limited to 4 5039 * digits, for conciseness.</p> 5040 * <p>Linear mapping:</p> 5041 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ] 5042 * </code></pre> 5043 * <p><img alt="Linear mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> 5044 * <p>Invert mapping:</p> 5045 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ] 5046 * </code></pre> 5047 * <p><img alt="Inverting mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> 5048 * <p>Gamma 1/2.2 mapping, with 16 control points:</p> 5049 * <pre><code>curveRed = [ 5050 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812), 5051 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072), 5052 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685), 5053 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ] 5054 * </code></pre> 5055 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> 5056 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> 5057 * <pre><code>curveRed = [ 5058 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845), 5059 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130), 5060 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721), 5061 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ] 5062 * </code></pre> 5063 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> 5064 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 5065 * <p><b>Full capability</b> - 5066 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 5067 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 5068 * 5069 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 5070 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS 5071 * @see CaptureRequest#TONEMAP_MODE 5072 */ 5073 @PublicKey 5074 @NonNull 5075 @SyntheticKey 5076 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE = 5077 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class); 5078 5079 /** 5080 * <p>High-level global contrast/gamma/tonemapping control.</p> 5081 * <p>When switching to an application-defined contrast curve by setting 5082 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined 5083 * per-channel with a set of <code>(in, out)</code> points that specify the 5084 * mapping from input high-bit-depth pixel value to the output 5085 * low-bit-depth value. Since the actual pixel ranges of both input 5086 * and output may change depending on the camera pipeline, the values 5087 * are specified by normalized floating-point numbers.</p> 5088 * <p>More-complex color mapping operations such as 3D color look-up 5089 * tables, selective chroma enhancement, or other non-linear color 5090 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 5091 * CONTRAST_CURVE.</p> 5092 * <p>When using either FAST or HIGH_QUALITY, the camera device will 5093 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}. 5094 * These values are always available, and as close as possible to the 5095 * actually used nonlinear/nonglobal transforms.</p> 5096 * <p>If a request is sent with CONTRAST_CURVE with the camera device's 5097 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be 5098 * roughly the same.</p> 5099 * <p><b>Possible values:</b></p> 5100 * <ul> 5101 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li> 5102 * <li>{@link #TONEMAP_MODE_FAST FAST}</li> 5103 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 5104 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li> 5105 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li> 5106 * </ul> 5107 * 5108 * <p><b>Available values for this device:</b><br> 5109 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p> 5110 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 5111 * <p><b>Full capability</b> - 5112 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 5113 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 5114 * 5115 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 5116 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES 5117 * @see CaptureRequest#TONEMAP_CURVE 5118 * @see CaptureRequest#TONEMAP_MODE 5119 * @see #TONEMAP_MODE_CONTRAST_CURVE 5120 * @see #TONEMAP_MODE_FAST 5121 * @see #TONEMAP_MODE_HIGH_QUALITY 5122 * @see #TONEMAP_MODE_GAMMA_VALUE 5123 * @see #TONEMAP_MODE_PRESET_CURVE 5124 */ 5125 @PublicKey 5126 @NonNull 5127 public static final Key<Integer> TONEMAP_MODE = 5128 new Key<Integer>("android.tonemap.mode", int.class); 5129 5130 /** 5131 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 5132 * GAMMA_VALUE</p> 5133 * <p>The tonemap curve will be defined the following formula:</p> 5134 * <ul> 5135 * <li>OUT = pow(IN, 1.0 / gamma)</li> 5136 * </ul> 5137 * <p>where IN and OUT is the input pixel value scaled to range [0.0, 1.0], 5138 * pow is the power function and gamma is the gamma value specified by this 5139 * key.</p> 5140 * <p>The same curve will be applied to all color channels. The camera device 5141 * may clip the input gamma value to its supported range. The actual applied 5142 * value will be returned in capture result.</p> 5143 * <p>The valid range of gamma value varies on different devices, but values 5144 * within [1.0, 5.0] are guaranteed not to be clipped.</p> 5145 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 5146 * 5147 * @see CaptureRequest#TONEMAP_MODE 5148 */ 5149 @PublicKey 5150 @NonNull 5151 public static final Key<Float> TONEMAP_GAMMA = 5152 new Key<Float>("android.tonemap.gamma", float.class); 5153 5154 /** 5155 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 5156 * PRESET_CURVE</p> 5157 * <p>The tonemap curve will be defined by specified standard.</p> 5158 * <p>sRGB (approximated by 16 control points):</p> 5159 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> 5160 * <p>Rec. 709 (approximated by 16 control points):</p> 5161 * <p><img alt="Rec. 709 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p> 5162 * <p>Note that above figures show a 16 control points approximation of preset 5163 * curves. Camera devices may apply a different approximation to the curve.</p> 5164 * <p><b>Possible values:</b></p> 5165 * <ul> 5166 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li> 5167 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li> 5168 * </ul> 5169 * 5170 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 5171 * 5172 * @see CaptureRequest#TONEMAP_MODE 5173 * @see #TONEMAP_PRESET_CURVE_SRGB 5174 * @see #TONEMAP_PRESET_CURVE_REC709 5175 */ 5176 @PublicKey 5177 @NonNull 5178 public static final Key<Integer> TONEMAP_PRESET_CURVE = 5179 new Key<Integer>("android.tonemap.presetCurve", int.class); 5180 5181 /** 5182 * <p>This LED is nominally used to indicate to the user 5183 * that the camera is powered on and may be streaming images back to the 5184 * Application Processor. In certain rare circumstances, the OS may 5185 * disable this when video is processed locally and not transmitted to 5186 * any untrusted applications.</p> 5187 * <p>In particular, the LED <em>must</em> always be on when the data could be 5188 * transmitted off the device. The LED <em>should</em> always be on whenever 5189 * data is stored locally on the device.</p> 5190 * <p>The LED <em>may</em> be off if a trusted application is using the data that 5191 * doesn't violate the above rules.</p> 5192 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 5193 * @hide 5194 */ 5195 public static final Key<Boolean> LED_TRANSMIT = 5196 new Key<Boolean>("android.led.transmit", boolean.class); 5197 5198 /** 5199 * <p>Whether black-level compensation is locked 5200 * to its current values, or is free to vary.</p> 5201 * <p>Whether the black level offset was locked for this frame. Should be 5202 * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless 5203 * a change in other capture settings forced the camera device to 5204 * perform a black level reset.</p> 5205 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 5206 * <p><b>Full capability</b> - 5207 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 5208 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 5209 * 5210 * @see CaptureRequest#BLACK_LEVEL_LOCK 5211 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 5212 */ 5213 @PublicKey 5214 @NonNull 5215 public static final Key<Boolean> BLACK_LEVEL_LOCK = 5216 new Key<Boolean>("android.blackLevel.lock", boolean.class); 5217 5218 /** 5219 * <p>The frame number corresponding to the last request 5220 * with which the output result (metadata + buffers) has been fully 5221 * synchronized.</p> 5222 * <p>When a request is submitted to the camera device, there is usually a 5223 * delay of several frames before the controls get applied. A camera 5224 * device may either choose to account for this delay by implementing a 5225 * pipeline and carefully submit well-timed atomic control updates, or 5226 * it may start streaming control changes that span over several frame 5227 * boundaries.</p> 5228 * <p>In the latter case, whenever a request's settings change relative to 5229 * the previous submitted request, the full set of changes may take 5230 * multiple frame durations to fully take effect. Some settings may 5231 * take effect sooner (in less frame durations) than others.</p> 5232 * <p>While a set of control changes are being propagated, this value 5233 * will be CONVERGING.</p> 5234 * <p>Once it is fully known that a set of control changes have been 5235 * finished propagating, and the resulting updated control settings 5236 * have been read back by the camera device, this value will be set 5237 * to a non-negative frame number (corresponding to the request to 5238 * which the results have synchronized to).</p> 5239 * <p>Older camera device implementations may not have a way to detect 5240 * when all camera controls have been applied, and will always set this 5241 * value to UNKNOWN.</p> 5242 * <p>FULL capability devices will always have this value set to the 5243 * frame number of the request corresponding to this result.</p> 5244 * <p><em>Further details</em>:</p> 5245 * <ul> 5246 * <li>Whenever a request differs from the last request, any future 5247 * results not yet returned may have this value set to CONVERGING (this 5248 * could include any in-progress captures not yet returned by the camera 5249 * device, for more details see pipeline considerations below).</li> 5250 * <li>Submitting a series of multiple requests that differ from the 5251 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3) 5252 * moves the new synchronization frame to the last non-repeating 5253 * request (using the smallest frame number from the contiguous list of 5254 * repeating requests).</li> 5255 * <li>Submitting the same request repeatedly will not change this value 5256 * to CONVERGING, if it was already a non-negative value.</li> 5257 * <li>When this value changes to non-negative, that means that all of the 5258 * metadata controls from the request have been applied, all of the 5259 * metadata controls from the camera device have been read to the 5260 * updated values (into the result), and all of the graphics buffers 5261 * corresponding to this result are also synchronized to the request.</li> 5262 * </ul> 5263 * <p><em>Pipeline considerations</em>:</p> 5264 * <p>Submitting a request with updated controls relative to the previously 5265 * submitted requests may also invalidate the synchronization state 5266 * of all the results corresponding to currently in-flight requests.</p> 5267 * <p>In other words, results for this current request and up to 5268 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their 5269 * android.sync.frameNumber change to CONVERGING.</p> 5270 * <p><b>Possible values:</b></p> 5271 * <ul> 5272 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li> 5273 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li> 5274 * </ul> 5275 * 5276 * <p><b>Available values for this device:</b><br> 5277 * Either a non-negative value corresponding to a 5278 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p> 5279 * <p>This key is available on all devices.</p> 5280 * 5281 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH 5282 * @see #SYNC_FRAME_NUMBER_CONVERGING 5283 * @see #SYNC_FRAME_NUMBER_UNKNOWN 5284 * @hide 5285 */ 5286 public static final Key<Long> SYNC_FRAME_NUMBER = 5287 new Key<Long>("android.sync.frameNumber", long.class); 5288 5289 /** 5290 * <p>The amount of exposure time increase factor applied to the original output 5291 * frame by the application processing before sending for reprocessing.</p> 5292 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING 5293 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p> 5294 * <p>For some YUV reprocessing use cases, the application may choose to filter the original 5295 * output frames to effectively reduce the noise to the same level as a frame that was 5296 * captured with longer exposure time. To be more specific, assuming the original captured 5297 * images were captured with a sensitivity of S and an exposure time of T, the model in 5298 * the camera device is that the amount of noise in the image would be approximately what 5299 * would be expected if the original capture parameters had been a sensitivity of 5300 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather 5301 * than S and T respectively. If the captured images were processed by the application 5302 * before being sent for reprocessing, then the application may have used image processing 5303 * algorithms and/or multi-frame image fusion to reduce the noise in the 5304 * application-processed images (input images). By using the effectiveExposureFactor 5305 * control, the application can communicate to the camera device the actual noise level 5306 * improvement in the application-processed image. With this information, the camera 5307 * device can select appropriate noise reduction and edge enhancement parameters to avoid 5308 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge 5309 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p> 5310 * <p>For example, for multi-frame image fusion use case, the application may fuse 5311 * multiple output frames together to a final frame for reprocessing. When N image are 5312 * fused into 1 image for reprocessing, the exposure time increase factor could be up to 5313 * square root of N (based on a simple photon shot noise model). The camera device will 5314 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to 5315 * produce the best quality images.</p> 5316 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input 5317 * buffer in a way that affects its effective exposure time.</p> 5318 * <p>This control is only effective for YUV reprocessing capture request. For noise 5319 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>. 5320 * Similarly, for edge enhancement reprocessing, it is only effective when 5321 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p> 5322 * <p><b>Units</b>: Relative exposure time increase factor.</p> 5323 * <p><b>Range of valid values:</b><br> 5324 * >= 1.0</p> 5325 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 5326 * <p><b>Limited capability</b> - 5327 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 5328 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 5329 * 5330 * @see CaptureRequest#EDGE_MODE 5331 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 5332 * @see CaptureRequest#NOISE_REDUCTION_MODE 5333 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES 5334 */ 5335 @PublicKey 5336 @NonNull 5337 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = 5338 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class); 5339 5340 /** 5341 * <p>String containing the ID of the underlying active physical camera.</p> 5342 * <p>The ID of the active physical camera that's backing the logical camera. All camera 5343 * streams and metadata that are not physical camera specific will be originating from this 5344 * physical camera.</p> 5345 * <p>For a logical camera made up of physical cameras where each camera's lenses have 5346 * different characteristics, the camera device may choose to switch between the physical 5347 * cameras when application changes FOCAL_LENGTH or SCALER_CROP_REGION. 5348 * At the time of lens switch, this result metadata reflects the new active physical camera 5349 * ID.</p> 5350 * <p>This key will be available if the camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }. 5351 * When available, this must be one of valid physical IDs backing this logical multi-camera. 5352 * If this key is not available for a logical multi-camera, the camera device implementation 5353 * may still switch between different active physical cameras based on use case, but the 5354 * current active physical camera information won't be available to the application.</p> 5355 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 5356 */ 5357 @PublicKey 5358 @NonNull 5359 public static final Key<String> LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID = 5360 new Key<String>("android.logicalMultiCamera.activePhysicalId", String.class); 5361 5362 /** 5363 * <p>Mode of operation for the lens distortion correction block.</p> 5364 * <p>The lens distortion correction block attempts to improve image quality by fixing 5365 * radial, tangential, or other geometric aberrations in the camera device's optics. If 5366 * available, the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} field documents the lens's distortion parameters.</p> 5367 * <p>OFF means no distortion correction is done.</p> 5368 * <p>FAST/HIGH_QUALITY both mean camera device determined distortion correction will be 5369 * applied. HIGH_QUALITY mode indicates that the camera device will use the highest-quality 5370 * correction algorithms, even if it slows down capture rate. FAST means the camera device 5371 * will not slow down capture rate when applying correction. FAST may be the same as OFF if 5372 * any correction at all would slow down capture rate. Every output stream will have a 5373 * similar amount of enhancement applied.</p> 5374 * <p>The correction only applies to processed outputs such as YUV, Y8, JPEG, or DEPTH16; it is 5375 * not applied to any RAW output.</p> 5376 * <p>This control will be on by default on devices that support this control. Applications 5377 * disabling distortion correction need to pay extra attention with the coordinate system of 5378 * metering regions, crop region, and face rectangles. When distortion correction is OFF, 5379 * metadata coordinates follow the coordinate system of 5380 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}. When distortion is not OFF, metadata 5381 * coordinates follow the coordinate system of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}. The 5382 * camera device will map these metadata fields to match the corrected image produced by the 5383 * camera device, for both capture requests and results. However, this mapping is not very 5384 * precise, since rectangles do not generally map to rectangles when corrected. Only linear 5385 * scaling between the active array and precorrection active array coordinates is 5386 * performed. Applications that require precise correction of metadata need to undo that 5387 * linear scaling, and apply a more complete correction that takes into the account the app's 5388 * own requirements.</p> 5389 * <p>The full list of metadata that is affected in this way by distortion correction is:</p> 5390 * <ul> 5391 * <li>{@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}</li> 5392 * <li>{@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}</li> 5393 * <li>{@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}</li> 5394 * <li>{@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}</li> 5395 * <li>{@link CaptureResult#STATISTICS_FACES android.statistics.faces}</li> 5396 * </ul> 5397 * <p><b>Possible values:</b></p> 5398 * <ul> 5399 * <li>{@link #DISTORTION_CORRECTION_MODE_OFF OFF}</li> 5400 * <li>{@link #DISTORTION_CORRECTION_MODE_FAST FAST}</li> 5401 * <li>{@link #DISTORTION_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 5402 * </ul> 5403 * 5404 * <p><b>Available values for this device:</b><br> 5405 * {@link CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES android.distortionCorrection.availableModes}</p> 5406 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> 5407 * 5408 * @see CaptureRequest#CONTROL_AE_REGIONS 5409 * @see CaptureRequest#CONTROL_AF_REGIONS 5410 * @see CaptureRequest#CONTROL_AWB_REGIONS 5411 * @see CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES 5412 * @see CameraCharacteristics#LENS_DISTORTION 5413 * @see CaptureRequest#SCALER_CROP_REGION 5414 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 5415 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE 5416 * @see CaptureResult#STATISTICS_FACES 5417 * @see #DISTORTION_CORRECTION_MODE_OFF 5418 * @see #DISTORTION_CORRECTION_MODE_FAST 5419 * @see #DISTORTION_CORRECTION_MODE_HIGH_QUALITY 5420 */ 5421 @PublicKey 5422 @NonNull 5423 public static final Key<Integer> DISTORTION_CORRECTION_MODE = 5424 new Key<Integer>("android.distortionCorrection.mode", int.class); 5425 5426 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 5427 * End generated code 5428 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ 5429 5430 5431 5432 5433 5434 5435 } 5436