CaptureRequest.java revision d49ebcc3ad3d37d9c37e638db5d308c9c22c30fb
1/* 2 * Copyright (C) 2013 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.hardware.camera2; 18 19import android.hardware.camera2.impl.CameraMetadataNative; 20import android.hardware.camera2.impl.PublicKey; 21import android.hardware.camera2.impl.SyntheticKey; 22import android.hardware.camera2.utils.HashCodeHelpers; 23import android.hardware.camera2.utils.TypeReference; 24import android.os.Parcel; 25import android.os.Parcelable; 26import android.view.Surface; 27 28import java.util.Collection; 29import java.util.Collections; 30import java.util.HashSet; 31import java.util.List; 32import java.util.Objects; 33 34 35/** 36 * <p>An immutable package of settings and outputs needed to capture a single 37 * image from the camera device.</p> 38 * 39 * <p>Contains the configuration for the capture hardware (sensor, lens, flash), 40 * the processing pipeline, the control algorithms, and the output buffers. Also 41 * contains the list of target Surfaces to send image data to for this 42 * capture.</p> 43 * 44 * <p>CaptureRequests can be created by using a {@link Builder} instance, 45 * obtained by calling {@link CameraDevice#createCaptureRequest}</p> 46 * 47 * <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or 48 * {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p> 49 * 50 * <p>Each request can specify a different subset of target Surfaces for the 51 * camera to send the captured data to. All the surfaces used in a request must 52 * be part of the surface list given to the last call to 53 * {@link CameraDevice#createCaptureSession}, when the request is submitted to the 54 * session.</p> 55 * 56 * <p>For example, a request meant for repeating preview might only include the 57 * Surface for the preview SurfaceView or SurfaceTexture, while a 58 * high-resolution still capture would also include a Surface from a ImageReader 59 * configured for high-resolution JPEG images.</p> 60 * 61 * @see CameraDevice#capture 62 * @see CameraDevice#setRepeatingRequest 63 * @see CameraDevice#createCaptureRequest 64 */ 65public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> 66 implements Parcelable { 67 68 /** 69 * A {@code Key} is used to do capture request field lookups with 70 * {@link CaptureResult#get} or to set fields with 71 * {@link CaptureRequest.Builder#set(Key, Object)}. 72 * 73 * <p>For example, to set the crop rectangle for the next capture: 74 * <code><pre> 75 * Rect cropRectangle = new Rect(0, 0, 640, 480); 76 * captureRequestBuilder.set(SCALER_CROP_REGION, cropRectangle); 77 * </pre></code> 78 * </p> 79 * 80 * <p>To enumerate over all possible keys for {@link CaptureResult}, see 81 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p> 82 * 83 * @see CaptureResult#get 84 * @see CameraCharacteristics#getAvailableCaptureResultKeys 85 */ 86 public final static class Key<T> { 87 private final CameraMetadataNative.Key<T> mKey; 88 89 /** 90 * Visible for testing and vendor extensions only. 91 * 92 * @hide 93 */ 94 public Key(String name, Class<T> type) { 95 mKey = new CameraMetadataNative.Key<T>(name, type); 96 } 97 98 /** 99 * Visible for testing and vendor extensions only. 100 * 101 * @hide 102 */ 103 public Key(String name, TypeReference<T> typeReference) { 104 mKey = new CameraMetadataNative.Key<T>(name, typeReference); 105 } 106 107 /** 108 * Return a camelCase, period separated name formatted like: 109 * {@code "root.section[.subsections].name"}. 110 * 111 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."}; 112 * keys that are device/platform-specific are prefixed with {@code "com."}.</p> 113 * 114 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would 115 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device 116 * specific key might look like {@code "com.google.nexus.data.private"}.</p> 117 * 118 * @return String representation of the key name 119 */ 120 public String getName() { 121 return mKey.getName(); 122 } 123 124 /** 125 * {@inheritDoc} 126 */ 127 @Override 128 public final int hashCode() { 129 return mKey.hashCode(); 130 } 131 132 /** 133 * {@inheritDoc} 134 */ 135 @SuppressWarnings("unchecked") 136 @Override 137 public final boolean equals(Object o) { 138 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey); 139 } 140 141 /** 142 * Visible for CameraMetadataNative implementation only; do not use. 143 * 144 * TODO: Make this private or remove it altogether. 145 * 146 * @hide 147 */ 148 public CameraMetadataNative.Key<T> getNativeKey() { 149 return mKey; 150 } 151 152 @SuppressWarnings({ "unchecked" }) 153 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) { 154 mKey = (CameraMetadataNative.Key<T>) nativeKey; 155 } 156 } 157 158 private final HashSet<Surface> mSurfaceSet; 159 private final CameraMetadataNative mSettings; 160 161 private Object mUserTag; 162 163 /** 164 * Construct empty request. 165 * 166 * Used by Binder to unparcel this object only. 167 */ 168 private CaptureRequest() { 169 mSettings = new CameraMetadataNative(); 170 mSurfaceSet = new HashSet<Surface>(); 171 } 172 173 /** 174 * Clone from source capture request. 175 * 176 * Used by the Builder to create an immutable copy. 177 */ 178 @SuppressWarnings("unchecked") 179 private CaptureRequest(CaptureRequest source) { 180 mSettings = new CameraMetadataNative(source.mSettings); 181 mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone(); 182 mUserTag = source.mUserTag; 183 } 184 185 /** 186 * Take ownership of passed-in settings. 187 * 188 * Used by the Builder to create a mutable CaptureRequest. 189 */ 190 private CaptureRequest(CameraMetadataNative settings) { 191 mSettings = CameraMetadataNative.move(settings); 192 mSurfaceSet = new HashSet<Surface>(); 193 } 194 195 /** 196 * Get a capture request field value. 197 * 198 * <p>The field definitions can be found in {@link CaptureRequest}.</p> 199 * 200 * <p>Querying the value for the same key more than once will return a value 201 * which is equal to the previous queried value.</p> 202 * 203 * @throws IllegalArgumentException if the key was not valid 204 * 205 * @param key The result field to read. 206 * @return The value of that key, or {@code null} if the field is not set. 207 */ 208 public <T> T get(Key<T> key) { 209 return mSettings.get(key); 210 } 211 212 /** 213 * {@inheritDoc} 214 * @hide 215 */ 216 @SuppressWarnings("unchecked") 217 @Override 218 protected <T> T getProtected(Key<?> key) { 219 return (T) mSettings.get(key); 220 } 221 222 /** 223 * {@inheritDoc} 224 * @hide 225 */ 226 @SuppressWarnings("unchecked") 227 @Override 228 protected Class<Key<?>> getKeyClass() { 229 Object thisClass = Key.class; 230 return (Class<Key<?>>)thisClass; 231 } 232 233 /** 234 * {@inheritDoc} 235 */ 236 @Override 237 public List<Key<?>> getKeys() { 238 // Force the javadoc for this function to show up on the CaptureRequest page 239 return super.getKeys(); 240 } 241 242 /** 243 * Retrieve the tag for this request, if any. 244 * 245 * <p>This tag is not used for anything by the camera device, but can be 246 * used by an application to easily identify a CaptureRequest when it is 247 * returned by 248 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted} 249 * </p> 250 * 251 * @return the last tag Object set on this request, or {@code null} if 252 * no tag has been set. 253 * @see Builder#setTag 254 */ 255 public Object getTag() { 256 return mUserTag; 257 } 258 259 /** 260 * Determine whether this CaptureRequest is equal to another CaptureRequest. 261 * 262 * <p>A request is considered equal to another is if it's set of key/values is equal, it's 263 * list of output surfaces is equal, and the user tag is equal.</p> 264 * 265 * @param other Another instance of CaptureRequest. 266 * 267 * @return True if the requests are the same, false otherwise. 268 */ 269 @Override 270 public boolean equals(Object other) { 271 return other instanceof CaptureRequest 272 && equals((CaptureRequest)other); 273 } 274 275 private boolean equals(CaptureRequest other) { 276 return other != null 277 && Objects.equals(mUserTag, other.mUserTag) 278 && mSurfaceSet.equals(other.mSurfaceSet) 279 && mSettings.equals(other.mSettings); 280 } 281 282 @Override 283 public int hashCode() { 284 return HashCodeHelpers.hashCode(mSettings, mSurfaceSet, mUserTag); 285 } 286 287 public static final Parcelable.Creator<CaptureRequest> CREATOR = 288 new Parcelable.Creator<CaptureRequest>() { 289 @Override 290 public CaptureRequest createFromParcel(Parcel in) { 291 CaptureRequest request = new CaptureRequest(); 292 request.readFromParcel(in); 293 294 return request; 295 } 296 297 @Override 298 public CaptureRequest[] newArray(int size) { 299 return new CaptureRequest[size]; 300 } 301 }; 302 303 /** 304 * Expand this object from a Parcel. 305 * Hidden since this breaks the immutability of CaptureRequest, but is 306 * needed to receive CaptureRequests with aidl. 307 * 308 * @param in The parcel from which the object should be read 309 * @hide 310 */ 311 private void readFromParcel(Parcel in) { 312 mSettings.readFromParcel(in); 313 314 mSurfaceSet.clear(); 315 316 Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader()); 317 318 if (parcelableArray == null) { 319 return; 320 } 321 322 for (Parcelable p : parcelableArray) { 323 Surface s = (Surface) p; 324 mSurfaceSet.add(s); 325 } 326 } 327 328 @Override 329 public int describeContents() { 330 return 0; 331 } 332 333 @Override 334 public void writeToParcel(Parcel dest, int flags) { 335 mSettings.writeToParcel(dest, flags); 336 dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags); 337 } 338 339 /** 340 * @hide 341 */ 342 public boolean containsTarget(Surface surface) { 343 return mSurfaceSet.contains(surface); 344 } 345 346 /** 347 * @hide 348 */ 349 public Collection<Surface> getTargets() { 350 return Collections.unmodifiableCollection(mSurfaceSet); 351 } 352 353 /** 354 * A builder for capture requests. 355 * 356 * <p>To obtain a builder instance, use the 357 * {@link CameraDevice#createCaptureRequest} method, which initializes the 358 * request fields to one of the templates defined in {@link CameraDevice}. 359 * 360 * @see CameraDevice#createCaptureRequest 361 * @see CameraDevice#TEMPLATE_PREVIEW 362 * @see CameraDevice#TEMPLATE_RECORD 363 * @see CameraDevice#TEMPLATE_STILL_CAPTURE 364 * @see CameraDevice#TEMPLATE_VIDEO_SNAPSHOT 365 * @see CameraDevice#TEMPLATE_MANUAL 366 */ 367 public final static class Builder { 368 369 private final CaptureRequest mRequest; 370 371 /** 372 * Initialize the builder using the template; the request takes 373 * ownership of the template. 374 * 375 * @hide 376 */ 377 public Builder(CameraMetadataNative template) { 378 mRequest = new CaptureRequest(template); 379 } 380 381 /** 382 * <p>Add a surface to the list of targets for this request</p> 383 * 384 * <p>The Surface added must be one of the surfaces included in the most 385 * recent call to {@link CameraDevice#createCaptureSession}, when the 386 * request is given to the camera device.</p> 387 * 388 * <p>Adding a target more than once has no effect.</p> 389 * 390 * @param outputTarget Surface to use as an output target for this request 391 */ 392 public void addTarget(Surface outputTarget) { 393 mRequest.mSurfaceSet.add(outputTarget); 394 } 395 396 /** 397 * <p>Remove a surface from the list of targets for this request.</p> 398 * 399 * <p>Removing a target that is not currently added has no effect.</p> 400 * 401 * @param outputTarget Surface to use as an output target for this request 402 */ 403 public void removeTarget(Surface outputTarget) { 404 mRequest.mSurfaceSet.remove(outputTarget); 405 } 406 407 /** 408 * Set a capture request field to a value. The field definitions can be 409 * found in {@link CaptureRequest}. 410 * 411 * @param key The metadata field to write. 412 * @param value The value to set the field to, which must be of a matching 413 * type to the key. 414 */ 415 public <T> void set(Key<T> key, T value) { 416 mRequest.mSettings.set(key, value); 417 } 418 419 /** 420 * Get a capture request field value. The field definitions can be 421 * found in {@link CaptureRequest}. 422 * 423 * @throws IllegalArgumentException if the key was not valid 424 * 425 * @param key The metadata field to read. 426 * @return The value of that key, or {@code null} if the field is not set. 427 */ 428 public <T> T get(Key<T> key) { 429 return mRequest.mSettings.get(key); 430 } 431 432 /** 433 * Set a tag for this request. 434 * 435 * <p>This tag is not used for anything by the camera device, but can be 436 * used by an application to easily identify a CaptureRequest when it is 437 * returned by 438 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted} 439 * 440 * @param tag an arbitrary Object to store with this request 441 * @see CaptureRequest#getTag 442 */ 443 public void setTag(Object tag) { 444 mRequest.mUserTag = tag; 445 } 446 447 /** 448 * Build a request using the current target Surfaces and settings. 449 * <p>Note that, although it is possible to create a {@code CaptureRequest} with no target 450 * {@link Surface}s, passing such a request into {@link CameraCaptureSession#capture}, 451 * {@link CameraCaptureSession#captureBurst}, 452 * {@link CameraCaptureSession#setRepeatingBurst}, or 453 * {@link CameraCaptureSession#setRepeatingRequest} will cause that method to throw an 454 * {@link IllegalArgumentException}.</p> 455 * 456 * @return A new capture request instance, ready for submission to the 457 * camera device. 458 */ 459 public CaptureRequest build() { 460 return new CaptureRequest(mRequest); 461 } 462 463 464 /** 465 * @hide 466 */ 467 public boolean isEmpty() { 468 return mRequest.mSettings.isEmpty(); 469 } 470 471 } 472 473 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 474 * The key entries below this point are generated from metadata 475 * definitions in /system/media/camera/docs. Do not modify by hand or 476 * modify the comment blocks at the start or end. 477 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ 478 479 /** 480 * <p>The mode control selects how the image data is converted from the 481 * sensor's native color into linear sRGB color.</p> 482 * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this 483 * control is overridden by the AWB routine. When AWB is disabled, the 484 * application controls how the color mapping is performed.</p> 485 * <p>We define the expected processing pipeline below. For consistency 486 * across devices, this is always the case with TRANSFORM_MATRIX.</p> 487 * <p>When either FULL or HIGH_QUALITY is used, the camera device may 488 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 489 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the 490 * camera device (in the results) and be roughly correct.</p> 491 * <p>Switching to TRANSFORM_MATRIX and using the data provided from 492 * FAST or HIGH_QUALITY will yield a picture with the same white point 493 * as what was produced by the camera device in the earlier frame.</p> 494 * <p>The expected processing pipeline is as follows:</p> 495 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p> 496 * <p>The white balance is encoded by two values, a 4-channel white-balance 497 * gain vector (applied in the Bayer domain), and a 3x3 color transform 498 * matrix (applied after demosaic).</p> 499 * <p>The 4-channel white-balance gains are defined as:</p> 500 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ] 501 * </code></pre> 502 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the 503 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows. 504 * These may be identical for a given camera device implementation; if 505 * the camera device does not support a separate gain for even/odd green 506 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to 507 * <code>G_even</code> in the output result metadata.</p> 508 * <p>The matrices for color transforms are defined as a 9-entry vector:</p> 509 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ] 510 * </code></pre> 511 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>, 512 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p> 513 * <p>with colors as follows:</p> 514 * <pre><code>r' = I0r + I1g + I2b 515 * g' = I3r + I4g + I5b 516 * b' = I6r + I7g + I8b 517 * </code></pre> 518 * <p>Both the input and output value ranges must match. Overflow/underflow 519 * values are clipped to fit within the range.</p> 520 * <p><b>Possible values:</b> 521 * <ul> 522 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li> 523 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li> 524 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 525 * </ul></p> 526 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 527 * <p><b>Full capability</b> - 528 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 529 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 530 * 531 * @see CaptureRequest#COLOR_CORRECTION_GAINS 532 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 533 * @see CaptureRequest#CONTROL_AWB_MODE 534 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 535 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX 536 * @see #COLOR_CORRECTION_MODE_FAST 537 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY 538 */ 539 @PublicKey 540 public static final Key<Integer> COLOR_CORRECTION_MODE = 541 new Key<Integer>("android.colorCorrection.mode", int.class); 542 543 /** 544 * <p>A color transform matrix to use to transform 545 * from sensor RGB color space to output linear sRGB color space.</p> 546 * <p>This matrix is either set by the camera device when the request 547 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or 548 * directly by the application in the request when the 549 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> 550 * <p>In the latter case, the camera device may round the matrix to account 551 * for precision issues; the final rounded matrix should be reported back 552 * in this matrix result metadata. The transform should keep the magnitude 553 * of the output color values within <code>[0, 1.0]</code> (assuming input color 554 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p> 555 * <p>The valid range of each matrix element varies on different devices, but 556 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p> 557 * <p><b>Units</b>: Unitless scale factors</p> 558 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 559 * <p><b>Full capability</b> - 560 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 561 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 562 * 563 * @see CaptureRequest#COLOR_CORRECTION_MODE 564 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 565 */ 566 @PublicKey 567 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM = 568 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class); 569 570 /** 571 * <p>Gains applying to Bayer raw color channels for 572 * white-balance.</p> 573 * <p>These per-channel gains are either set by the camera device 574 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not 575 * TRANSFORM_MATRIX, or directly by the application in the 576 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is 577 * TRANSFORM_MATRIX.</p> 578 * <p>The gains in the result metadata are the gains actually 579 * applied by the camera device to the current frame.</p> 580 * <p>The valid range of gains varies on different devices, but gains 581 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given 582 * device allows gains below 1.0, this is usually not recommended because 583 * this can create color artifacts.</p> 584 * <p><b>Units</b>: Unitless gain factors</p> 585 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 586 * <p><b>Full capability</b> - 587 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 588 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 589 * 590 * @see CaptureRequest#COLOR_CORRECTION_MODE 591 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 592 */ 593 @PublicKey 594 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS = 595 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class); 596 597 /** 598 * <p>Mode of operation for the chromatic aberration correction algorithm.</p> 599 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light 600 * can not focus on the same point after exiting from the lens. This metadata defines 601 * the high level control of chromatic aberration correction algorithm, which aims to 602 * minimize the chromatic artifacts that may occur along the object boundaries in an 603 * image.</p> 604 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration 605 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will 606 * use the highest-quality aberration correction algorithms, even if it slows down 607 * capture rate. FAST means the camera device will not slow down capture rate when 608 * applying aberration correction.</p> 609 * <p>LEGACY devices will always be in FAST mode.</p> 610 * <p><b>Possible values:</b> 611 * <ul> 612 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li> 613 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li> 614 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 615 * </ul></p> 616 * <p><b>Available values for this device:</b><br> 617 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p> 618 * <p>This key is available on all devices.</p> 619 * 620 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES 621 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF 622 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST 623 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY 624 */ 625 @PublicKey 626 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE = 627 new Key<Integer>("android.colorCorrection.aberrationMode", int.class); 628 629 /** 630 * <p>The desired setting for the camera device's auto-exposure 631 * algorithm's antibanding compensation.</p> 632 * <p>Some kinds of lighting fixtures, such as some fluorescent 633 * lights, flicker at the rate of the power supply frequency 634 * (60Hz or 50Hz, depending on country). While this is 635 * typically not noticeable to a person, it can be visible to 636 * a camera device. If a camera sets its exposure time to the 637 * wrong value, the flicker may become visible in the 638 * viewfinder as flicker or in a final captured image, as a 639 * set of variable-brightness bands across the image.</p> 640 * <p>Therefore, the auto-exposure routines of camera devices 641 * include antibanding routines that ensure that the chosen 642 * exposure value will not cause such banding. The choice of 643 * exposure time depends on the rate of flicker, which the 644 * camera device can detect automatically, or the expected 645 * rate can be selected by the application using this 646 * control.</p> 647 * <p>A given camera device may not support all of the possible 648 * options for the antibanding mode. The 649 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains 650 * the available modes for a given camera device.</p> 651 * <p>AUTO mode is the default if it is available on given 652 * camera device. When AUTO mode is not available, the 653 * default will be either 50HZ or 60HZ, and both 50HZ 654 * and 60HZ will be available.</p> 655 * <p>If manual exposure control is enabled (by setting 656 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF), 657 * then this setting has no effect, and the application must 658 * ensure it selects exposure times that do not cause banding 659 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist 660 * the application in this.</p> 661 * <p><b>Possible values:</b> 662 * <ul> 663 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li> 664 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li> 665 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li> 666 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li> 667 * </ul></p> 668 * <p><b>Available values for this device:</b><br></p> 669 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p> 670 * <p>This key is available on all devices.</p> 671 * 672 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES 673 * @see CaptureRequest#CONTROL_AE_MODE 674 * @see CaptureRequest#CONTROL_MODE 675 * @see CaptureResult#STATISTICS_SCENE_FLICKER 676 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF 677 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ 678 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ 679 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO 680 */ 681 @PublicKey 682 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = 683 new Key<Integer>("android.control.aeAntibandingMode", int.class); 684 685 /** 686 * <p>Adjustment to auto-exposure (AE) target image 687 * brightness.</p> 688 * <p>The adjustment is measured as a count of steps, with the 689 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the 690 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p> 691 * <p>For example, if the exposure value (EV) step is 0.333, '6' 692 * will mean an exposure compensation of +2 EV; -3 will mean an 693 * exposure compensation of -1 EV. One EV represents a doubling 694 * of image brightness. Note that this control will only be 695 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control 696 * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p> 697 * <p>In the event of exposure compensation value being changed, camera device 698 * may take several frames to reach the newly requested exposure target. 699 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING 700 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will 701 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or 702 * FLASH_REQUIRED (if the scene is too dark for still capture).</p> 703 * <p><b>Units</b>: Compensation steps</p> 704 * <p><b>Range of valid values:</b><br> 705 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p> 706 * <p>This key is available on all devices.</p> 707 * 708 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE 709 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP 710 * @see CaptureRequest#CONTROL_AE_LOCK 711 * @see CaptureRequest#CONTROL_AE_MODE 712 * @see CaptureResult#CONTROL_AE_STATE 713 */ 714 @PublicKey 715 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = 716 new Key<Integer>("android.control.aeExposureCompensation", int.class); 717 718 /** 719 * <p>Whether auto-exposure (AE) is currently locked to its latest 720 * calculated values.</p> 721 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters, 722 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p> 723 * <p>Note that even when AE is locked, the flash may be fired if 724 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / 725 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p> 726 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock 727 * is ON, the camera device will still adjust its exposure value.</p> 728 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) 729 * when AE is already locked, the camera device will not change the exposure time 730 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}) 731 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} 732 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the 733 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed. 734 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p> 735 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock 736 * the AE if AE is locked by the camera device internally during precapture metering 737 * sequence In other words, submitting requests with AE unlock has no effect for an 738 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence 739 * will never succeed in a sequence of preview requests where AE lock is always set 740 * to <code>false</code>.</p> 741 * <p>Since the camera device has a pipeline of in-flight requests, the settings that 742 * get locked do not necessarily correspond to the settings that were present in the 743 * latest capture result received from the camera device, since additional captures 744 * and AE updates may have occurred even before the result was sent out. If an 745 * application is switching between automatic and manual control and wishes to eliminate 746 * any flicker during the switch, the following procedure is recommended:</p> 747 * <ol> 748 * <li>Starting in auto-AE mode:</li> 749 * <li>Lock AE</li> 750 * <li>Wait for the first result to be output that has the AE locked</li> 751 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li> 752 * <li>Submit the capture request, proceed to run manual AE as desired.</li> 753 * </ol> 754 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p> 755 * <p>This key is available on all devices.</p> 756 * 757 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION 758 * @see CaptureRequest#CONTROL_AE_MODE 759 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 760 * @see CaptureResult#CONTROL_AE_STATE 761 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 762 * @see CaptureRequest#SENSOR_SENSITIVITY 763 */ 764 @PublicKey 765 public static final Key<Boolean> CONTROL_AE_LOCK = 766 new Key<Boolean>("android.control.aeLock", boolean.class); 767 768 /** 769 * <p>The desired mode for the camera device's 770 * auto-exposure routine.</p> 771 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is 772 * AUTO.</p> 773 * <p>When set to any of the ON modes, the camera device's 774 * auto-exposure routine is enabled, overriding the 775 * application's selected exposure time, sensor sensitivity, 776 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 777 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and 778 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes 779 * is selected, the camera device's flash unit controls are 780 * also overridden.</p> 781 * <p>The FLASH modes are only available if the camera device 782 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> 783 * <p>If flash TORCH mode is desired, this field must be set to 784 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> 785 * <p>When set to any of the ON modes, the values chosen by the 786 * camera device auto-exposure routine for the overridden 787 * fields for a given capture will be available in its 788 * CaptureResult.</p> 789 * <p><b>Possible values:</b> 790 * <ul> 791 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li> 792 * <li>{@link #CONTROL_AE_MODE_ON ON}</li> 793 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li> 794 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li> 795 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li> 796 * </ul></p> 797 * <p><b>Available values for this device:</b><br> 798 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p> 799 * <p>This key is available on all devices.</p> 800 * 801 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES 802 * @see CaptureRequest#CONTROL_MODE 803 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 804 * @see CaptureRequest#FLASH_MODE 805 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 806 * @see CaptureRequest#SENSOR_FRAME_DURATION 807 * @see CaptureRequest#SENSOR_SENSITIVITY 808 * @see #CONTROL_AE_MODE_OFF 809 * @see #CONTROL_AE_MODE_ON 810 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH 811 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH 812 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE 813 */ 814 @PublicKey 815 public static final Key<Integer> CONTROL_AE_MODE = 816 new Key<Integer>("android.control.aeMode", int.class); 817 818 /** 819 * <p>List of metering areas to use for auto-exposure adjustment.</p> 820 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0. 821 * Otherwise will always be present.</p> 822 * <p>The maximum number of regions supported by the device is determined by the value 823 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p> 824 * <p>The coordinate system is based on the active pixel array, 825 * with (0,0) being the top-left pixel in the active pixel array, and 826 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 827 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 828 * bottom-right pixel in the active pixel array.</p> 829 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight 830 * for every pixel in the area. This means that a large metering area 831 * with the same weight as a smaller area will have more effect in 832 * the metering result. Metering areas can partially overlap and the 833 * camera device will add the weights in the overlap region.</p> 834 * <p>The weights are relative to weights of other exposure metering regions, so if only one 835 * region is used, all non-zero weights will have the same effect. A region with 0 836 * weight is ignored.</p> 837 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the 838 * camera device.</p> 839 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in 840 * capture result metadata, the camera device will ignore the sections outside the crop 841 * region and output only the intersection rectangle as the metering region in the result 842 * metadata. If the region is entirely outside the crop region, it will be ignored and 843 * not reported in the result metadata.</p> 844 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> 845 * <p><b>Range of valid values:</b><br> 846 * Coordinates must be between <code>[(0,0), (width, height))</code> of 847 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> 848 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 849 * 850 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE 851 * @see CaptureRequest#SCALER_CROP_REGION 852 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 853 */ 854 @PublicKey 855 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS = 856 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class); 857 858 /** 859 * <p>Range over which the auto-exposure routine can 860 * adjust the capture frame rate to maintain good 861 * exposure.</p> 862 * <p>Only constrains auto-exposure (AE) algorithm, not 863 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and 864 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p> 865 * <p><b>Units</b>: Frames per second (FPS)</p> 866 * <p><b>Range of valid values:</b><br> 867 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p> 868 * <p>This key is available on all devices.</p> 869 * 870 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES 871 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 872 * @see CaptureRequest#SENSOR_FRAME_DURATION 873 */ 874 @PublicKey 875 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE = 876 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }}); 877 878 /** 879 * <p>Whether the camera device will trigger a precapture 880 * metering sequence when it processes this request.</p> 881 * <p>This entry is normally set to IDLE, or is not 882 * included at all in the request settings. When included and 883 * set to START, the camera device will trigger the auto-exposure (AE) 884 * precapture metering sequence.</p> 885 * <p>When set to CANCEL, the camera device will cancel any active 886 * precapture metering trigger, and return to its initial AE state. 887 * If a precapture metering sequence is already completed, and the camera 888 * device has implicitly locked the AE for subsequent still capture, the 889 * CANCEL trigger will unlock the AE and return to its initial AE state.</p> 890 * <p>The precapture sequence should be triggered before starting a 891 * high-quality still capture for final metering decisions to 892 * be made, and for firing pre-capture flash pulses to estimate 893 * scene brightness and required final capture flash power, when 894 * the flash is enabled.</p> 895 * <p>Normally, this entry should be set to START for only a 896 * single request, and the application should wait until the 897 * sequence completes before starting a new one.</p> 898 * <p>When a precapture metering sequence is finished, the camera device 899 * may lock the auto-exposure routine internally to be able to accurately expose the 900 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>). 901 * For this case, the AE may not resume normal scan if no subsequent still capture is 902 * submitted. To ensure that the AE routine restarts normal scan, the application should 903 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request 904 * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a 905 * still capture request after the precapture sequence completes. Alternatively, for 906 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device 907 * internally locked AE if the application doesn't submit a still capture request after 908 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not 909 * be used in devices that have earlier API levels.</p> 910 * <p>The exact effect of auto-exposure (AE) precapture trigger 911 * depends on the current AE mode and state; see 912 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition 913 * details.</p> 914 * <p>On LEGACY-level devices, the precapture trigger is not supported; 915 * capturing a high-resolution JPEG image will automatically trigger a 916 * precapture sequence before the high-resolution capture, including 917 * potentially firing a pre-capture flash.</p> 918 * <p><b>Possible values:</b> 919 * <ul> 920 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li> 921 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li> 922 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li> 923 * </ul></p> 924 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 925 * <p><b>Limited capability</b> - 926 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 927 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 928 * 929 * @see CaptureRequest#CONTROL_AE_LOCK 930 * @see CaptureResult#CONTROL_AE_STATE 931 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 932 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 933 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE 934 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START 935 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL 936 */ 937 @PublicKey 938 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = 939 new Key<Integer>("android.control.aePrecaptureTrigger", int.class); 940 941 /** 942 * <p>Whether auto-focus (AF) is currently enabled, and what 943 * mode it is set to.</p> 944 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus 945 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} > 0</code>). Also note that 946 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device 947 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before 948 * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p> 949 * <p>If the lens is controlled by the camera device auto-focus algorithm, 950 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState} 951 * in result metadata.</p> 952 * <p><b>Possible values:</b> 953 * <ul> 954 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li> 955 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li> 956 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li> 957 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li> 958 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li> 959 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li> 960 * </ul></p> 961 * <p><b>Available values for this device:</b><br> 962 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p> 963 * <p>This key is available on all devices.</p> 964 * 965 * @see CaptureRequest#CONTROL_AE_MODE 966 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES 967 * @see CaptureResult#CONTROL_AF_STATE 968 * @see CaptureRequest#CONTROL_AF_TRIGGER 969 * @see CaptureRequest#CONTROL_MODE 970 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE 971 * @see #CONTROL_AF_MODE_OFF 972 * @see #CONTROL_AF_MODE_AUTO 973 * @see #CONTROL_AF_MODE_MACRO 974 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO 975 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE 976 * @see #CONTROL_AF_MODE_EDOF 977 */ 978 @PublicKey 979 public static final Key<Integer> CONTROL_AF_MODE = 980 new Key<Integer>("android.control.afMode", int.class); 981 982 /** 983 * <p>List of metering areas to use for auto-focus.</p> 984 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0. 985 * Otherwise will always be present.</p> 986 * <p>The maximum number of focus areas supported by the device is determined by the value 987 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p> 988 * <p>The coordinate system is based on the active pixel array, 989 * with (0,0) being the top-left pixel in the active pixel array, and 990 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 991 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 992 * bottom-right pixel in the active pixel array.</p> 993 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight 994 * for every pixel in the area. This means that a large metering area 995 * with the same weight as a smaller area will have more effect in 996 * the metering result. Metering areas can partially overlap and the 997 * camera device will add the weights in the overlap region.</p> 998 * <p>The weights are relative to weights of other metering regions, so if only one region 999 * is used, all non-zero weights will have the same effect. A region with 0 weight is 1000 * ignored.</p> 1001 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the 1002 * camera device.</p> 1003 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in 1004 * capture result metadata, the camera device will ignore the sections outside the crop 1005 * region and output only the intersection rectangle as the metering region in the result 1006 * metadata. If the region is entirely outside the crop region, it will be ignored and 1007 * not reported in the result metadata.</p> 1008 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> 1009 * <p><b>Range of valid values:</b><br> 1010 * Coordinates must be between <code>[(0,0), (width, height))</code> of 1011 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> 1012 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1013 * 1014 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF 1015 * @see CaptureRequest#SCALER_CROP_REGION 1016 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 1017 */ 1018 @PublicKey 1019 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS = 1020 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class); 1021 1022 /** 1023 * <p>Whether the camera device will trigger autofocus for this request.</p> 1024 * <p>This entry is normally set to IDLE, or is not 1025 * included at all in the request settings.</p> 1026 * <p>When included and set to START, the camera device will trigger the 1027 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p> 1028 * <p>When set to CANCEL, the camera device will cancel any active trigger, 1029 * and return to its initial AF state.</p> 1030 * <p>Generally, applications should set this entry to START or CANCEL for only a 1031 * single capture, and then return it to IDLE (or not set at all). Specifying 1032 * START for multiple captures in a row means restarting the AF operation over 1033 * and over again.</p> 1034 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p> 1035 * <p><b>Possible values:</b> 1036 * <ul> 1037 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li> 1038 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li> 1039 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li> 1040 * </ul></p> 1041 * <p>This key is available on all devices.</p> 1042 * 1043 * @see CaptureResult#CONTROL_AF_STATE 1044 * @see #CONTROL_AF_TRIGGER_IDLE 1045 * @see #CONTROL_AF_TRIGGER_START 1046 * @see #CONTROL_AF_TRIGGER_CANCEL 1047 */ 1048 @PublicKey 1049 public static final Key<Integer> CONTROL_AF_TRIGGER = 1050 new Key<Integer>("android.control.afTrigger", int.class); 1051 1052 /** 1053 * <p>Whether auto-white balance (AWB) is currently locked to its 1054 * latest calculated values.</p> 1055 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters, 1056 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p> 1057 * <p>Since the camera device has a pipeline of in-flight requests, the settings that 1058 * get locked do not necessarily correspond to the settings that were present in the 1059 * latest capture result received from the camera device, since additional captures 1060 * and AWB updates may have occurred even before the result was sent out. If an 1061 * application is switching between automatic and manual control and wishes to eliminate 1062 * any flicker during the switch, the following procedure is recommended:</p> 1063 * <ol> 1064 * <li>Starting in auto-AWB mode:</li> 1065 * <li>Lock AWB</li> 1066 * <li>Wait for the first result to be output that has the AWB locked</li> 1067 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li> 1068 * <li>Submit the capture request, proceed to run manual AWB as desired.</li> 1069 * </ol> 1070 * <p>Note that AWB lock is only meaningful when 1071 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes, 1072 * AWB is already fixed to a specific setting.</p> 1073 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p> 1074 * <p>This key is available on all devices.</p> 1075 * 1076 * @see CaptureRequest#CONTROL_AWB_MODE 1077 */ 1078 @PublicKey 1079 public static final Key<Boolean> CONTROL_AWB_LOCK = 1080 new Key<Boolean>("android.control.awbLock", boolean.class); 1081 1082 /** 1083 * <p>Whether auto-white balance (AWB) is currently setting the color 1084 * transform fields, and what its illumination target 1085 * is.</p> 1086 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p> 1087 * <p>When set to the ON mode, the camera device's auto-white balance 1088 * routine is enabled, overriding the application's selected 1089 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 1090 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} 1091 * is OFF, the behavior of AWB is device dependent. It is recommened to 1092 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before 1093 * setting AE mode to OFF.</p> 1094 * <p>When set to the OFF mode, the camera device's auto-white balance 1095 * routine is disabled. The application manually controls the white 1096 * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} 1097 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> 1098 * <p>When set to any other modes, the camera device's auto-white 1099 * balance routine is disabled. The camera device uses each 1100 * particular illumination target for white balance 1101 * adjustment. The application's values for 1102 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, 1103 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 1104 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p> 1105 * <p><b>Possible values:</b> 1106 * <ul> 1107 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li> 1108 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li> 1109 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li> 1110 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li> 1111 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li> 1112 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li> 1113 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li> 1114 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li> 1115 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li> 1116 * </ul></p> 1117 * <p><b>Available values for this device:</b><br> 1118 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p> 1119 * <p>This key is available on all devices.</p> 1120 * 1121 * @see CaptureRequest#COLOR_CORRECTION_GAINS 1122 * @see CaptureRequest#COLOR_CORRECTION_MODE 1123 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 1124 * @see CaptureRequest#CONTROL_AE_MODE 1125 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES 1126 * @see CaptureRequest#CONTROL_AWB_LOCK 1127 * @see CaptureRequest#CONTROL_MODE 1128 * @see #CONTROL_AWB_MODE_OFF 1129 * @see #CONTROL_AWB_MODE_AUTO 1130 * @see #CONTROL_AWB_MODE_INCANDESCENT 1131 * @see #CONTROL_AWB_MODE_FLUORESCENT 1132 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT 1133 * @see #CONTROL_AWB_MODE_DAYLIGHT 1134 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT 1135 * @see #CONTROL_AWB_MODE_TWILIGHT 1136 * @see #CONTROL_AWB_MODE_SHADE 1137 */ 1138 @PublicKey 1139 public static final Key<Integer> CONTROL_AWB_MODE = 1140 new Key<Integer>("android.control.awbMode", int.class); 1141 1142 /** 1143 * <p>List of metering areas to use for auto-white-balance illuminant 1144 * estimation.</p> 1145 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0. 1146 * Otherwise will always be present.</p> 1147 * <p>The maximum number of regions supported by the device is determined by the value 1148 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p> 1149 * <p>The coordinate system is based on the active pixel array, 1150 * with (0,0) being the top-left pixel in the active pixel array, and 1151 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 1152 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 1153 * bottom-right pixel in the active pixel array.</p> 1154 * <p>The weight must range from 0 to 1000, and represents a weight 1155 * for every pixel in the area. This means that a large metering area 1156 * with the same weight as a smaller area will have more effect in 1157 * the metering result. Metering areas can partially overlap and the 1158 * camera device will add the weights in the overlap region.</p> 1159 * <p>The weights are relative to weights of other white balance metering regions, so if 1160 * only one region is used, all non-zero weights will have the same effect. A region with 1161 * 0 weight is ignored.</p> 1162 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the 1163 * camera device.</p> 1164 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in 1165 * capture result metadata, the camera device will ignore the sections outside the crop 1166 * region and output only the intersection rectangle as the metering region in the result 1167 * metadata. If the region is entirely outside the crop region, it will be ignored and 1168 * not reported in the result metadata.</p> 1169 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> 1170 * <p><b>Range of valid values:</b><br> 1171 * Coordinates must be between <code>[(0,0), (width, height))</code> of 1172 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> 1173 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1174 * 1175 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB 1176 * @see CaptureRequest#SCALER_CROP_REGION 1177 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 1178 */ 1179 @PublicKey 1180 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS = 1181 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class); 1182 1183 /** 1184 * <p>Information to the camera device 3A (auto-exposure, 1185 * auto-focus, auto-white balance) routines about the purpose 1186 * of this capture, to help the camera device to decide optimal 3A 1187 * strategy.</p> 1188 * <p>This control (except for MANUAL) is only effective if 1189 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p> 1190 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} 1191 * contains OPAQUE_REPROCESSING. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} 1192 * contains MANUAL_SENSOR. Other intent values are always supported.</p> 1193 * <p><b>Possible values:</b> 1194 * <ul> 1195 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li> 1196 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li> 1197 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li> 1198 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li> 1199 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li> 1200 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> 1201 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li> 1202 * </ul></p> 1203 * <p>This key is available on all devices.</p> 1204 * 1205 * @see CaptureRequest#CONTROL_MODE 1206 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES 1207 * @see #CONTROL_CAPTURE_INTENT_CUSTOM 1208 * @see #CONTROL_CAPTURE_INTENT_PREVIEW 1209 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE 1210 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD 1211 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT 1212 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG 1213 * @see #CONTROL_CAPTURE_INTENT_MANUAL 1214 */ 1215 @PublicKey 1216 public static final Key<Integer> CONTROL_CAPTURE_INTENT = 1217 new Key<Integer>("android.control.captureIntent", int.class); 1218 1219 /** 1220 * <p>A special color effect to apply.</p> 1221 * <p>When this mode is set, a color effect will be applied 1222 * to images produced by the camera device. The interpretation 1223 * and implementation of these color effects is left to the 1224 * implementor of the camera device, and should not be 1225 * depended on to be consistent (or present) across all 1226 * devices.</p> 1227 * <p><b>Possible values:</b> 1228 * <ul> 1229 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li> 1230 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li> 1231 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li> 1232 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li> 1233 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li> 1234 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li> 1235 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li> 1236 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li> 1237 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li> 1238 * </ul></p> 1239 * <p><b>Available values for this device:</b><br> 1240 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p> 1241 * <p>This key is available on all devices.</p> 1242 * 1243 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS 1244 * @see #CONTROL_EFFECT_MODE_OFF 1245 * @see #CONTROL_EFFECT_MODE_MONO 1246 * @see #CONTROL_EFFECT_MODE_NEGATIVE 1247 * @see #CONTROL_EFFECT_MODE_SOLARIZE 1248 * @see #CONTROL_EFFECT_MODE_SEPIA 1249 * @see #CONTROL_EFFECT_MODE_POSTERIZE 1250 * @see #CONTROL_EFFECT_MODE_WHITEBOARD 1251 * @see #CONTROL_EFFECT_MODE_BLACKBOARD 1252 * @see #CONTROL_EFFECT_MODE_AQUA 1253 */ 1254 @PublicKey 1255 public static final Key<Integer> CONTROL_EFFECT_MODE = 1256 new Key<Integer>("android.control.effectMode", int.class); 1257 1258 /** 1259 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control 1260 * routines.</p> 1261 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control 1262 * by the camera device is disabled. The application must set the fields for 1263 * capture parameters itself.</p> 1264 * <p>When set to AUTO, the individual algorithm controls in 1265 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> 1266 * <p>When set to USE_SCENE_MODE, the individual controls in 1267 * android.control.* are mostly disabled, and the camera device implements 1268 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) 1269 * as it wishes. The camera device scene mode 3A settings are provided by 1270 * android.control.sceneModeOverrides.</p> 1271 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference 1272 * is that this frame will not be used by camera device background 3A statistics 1273 * update, as if this frame is never captured. This mode can be used in the scenario 1274 * where the application doesn't want a 3A manual control capture to affect 1275 * the subsequent auto 3A capture results.</p> 1276 * <p><b>Possible values:</b> 1277 * <ul> 1278 * <li>{@link #CONTROL_MODE_OFF OFF}</li> 1279 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li> 1280 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li> 1281 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li> 1282 * </ul></p> 1283 * <p><b>Available values for this device:</b><br> 1284 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p> 1285 * <p>This key is available on all devices.</p> 1286 * 1287 * @see CaptureRequest#CONTROL_AF_MODE 1288 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES 1289 * @see #CONTROL_MODE_OFF 1290 * @see #CONTROL_MODE_AUTO 1291 * @see #CONTROL_MODE_USE_SCENE_MODE 1292 * @see #CONTROL_MODE_OFF_KEEP_STATE 1293 */ 1294 @PublicKey 1295 public static final Key<Integer> CONTROL_MODE = 1296 new Key<Integer>("android.control.mode", int.class); 1297 1298 /** 1299 * <p>Control for which scene mode is currently active.</p> 1300 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and 1301 * capture settings.</p> 1302 * <p>This is the mode that that is active when 1303 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, 1304 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, 1305 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p> 1306 * <p>The interpretation and implementation of these scene modes is left 1307 * to the implementor of the camera device. Their behavior will not be 1308 * consistent across all devices, and any given device may only implement 1309 * a subset of these modes.</p> 1310 * <p><b>Possible values:</b> 1311 * <ul> 1312 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li> 1313 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li> 1314 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li> 1315 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li> 1316 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li> 1317 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li> 1318 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li> 1319 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li> 1320 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li> 1321 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li> 1322 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li> 1323 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li> 1324 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li> 1325 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li> 1326 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li> 1327 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li> 1328 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li> 1329 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li> 1330 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li> 1331 * </ul></p> 1332 * <p><b>Available values for this device:</b><br> 1333 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p> 1334 * <p>This key is available on all devices.</p> 1335 * 1336 * @see CaptureRequest#CONTROL_AE_MODE 1337 * @see CaptureRequest#CONTROL_AF_MODE 1338 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES 1339 * @see CaptureRequest#CONTROL_AWB_MODE 1340 * @see CaptureRequest#CONTROL_MODE 1341 * @see #CONTROL_SCENE_MODE_DISABLED 1342 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY 1343 * @see #CONTROL_SCENE_MODE_ACTION 1344 * @see #CONTROL_SCENE_MODE_PORTRAIT 1345 * @see #CONTROL_SCENE_MODE_LANDSCAPE 1346 * @see #CONTROL_SCENE_MODE_NIGHT 1347 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT 1348 * @see #CONTROL_SCENE_MODE_THEATRE 1349 * @see #CONTROL_SCENE_MODE_BEACH 1350 * @see #CONTROL_SCENE_MODE_SNOW 1351 * @see #CONTROL_SCENE_MODE_SUNSET 1352 * @see #CONTROL_SCENE_MODE_STEADYPHOTO 1353 * @see #CONTROL_SCENE_MODE_FIREWORKS 1354 * @see #CONTROL_SCENE_MODE_SPORTS 1355 * @see #CONTROL_SCENE_MODE_PARTY 1356 * @see #CONTROL_SCENE_MODE_CANDLELIGHT 1357 * @see #CONTROL_SCENE_MODE_BARCODE 1358 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO 1359 * @see #CONTROL_SCENE_MODE_HDR 1360 */ 1361 @PublicKey 1362 public static final Key<Integer> CONTROL_SCENE_MODE = 1363 new Key<Integer>("android.control.sceneMode", int.class); 1364 1365 /** 1366 * <p>Whether video stabilization is 1367 * active.</p> 1368 * <p>Video stabilization automatically translates and scales images from 1369 * the camera in order to stabilize motion between consecutive frames.</p> 1370 * <p>If enabled, video stabilization can modify the 1371 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p> 1372 * <p>Switching between different video stabilization modes may take several 1373 * frames to initialize, the camera device will report the current mode 1374 * in capture result metadata. For example, When "ON" mode is requested, 1375 * the video stabilization modes in the first several capture results may 1376 * still be "OFF", and it will become "ON" when the initialization is 1377 * done.</p> 1378 * <p>If a camera device supports both this mode and OIS 1379 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may 1380 * produce undesirable interaction, so it is recommended not to enable 1381 * both at the same time.</p> 1382 * <p><b>Possible values:</b> 1383 * <ul> 1384 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li> 1385 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li> 1386 * </ul></p> 1387 * <p>This key is available on all devices.</p> 1388 * 1389 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE 1390 * @see CaptureRequest#SCALER_CROP_REGION 1391 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF 1392 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON 1393 */ 1394 @PublicKey 1395 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = 1396 new Key<Integer>("android.control.videoStabilizationMode", int.class); 1397 1398 /** 1399 * <p>Operation mode for edge 1400 * enhancement.</p> 1401 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means 1402 * no enhancement will be applied by the camera device.</p> 1403 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement 1404 * will be applied. HIGH_QUALITY mode indicates that the 1405 * camera device will use the highest-quality enhancement algorithms, 1406 * even if it slows down capture rate. FAST means the camera device will 1407 * not slow down capture rate when applying edge enhancement.</p> 1408 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera 1409 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively. 1410 * The camera device may adjust its internal noise reduction parameters for best 1411 * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p> 1412 * <p><b>Possible values:</b> 1413 * <ul> 1414 * <li>{@link #EDGE_MODE_OFF OFF}</li> 1415 * <li>{@link #EDGE_MODE_FAST FAST}</li> 1416 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 1417 * </ul></p> 1418 * <p><b>Available values for this device:</b><br> 1419 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p> 1420 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1421 * <p><b>Full capability</b> - 1422 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 1423 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 1424 * 1425 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES 1426 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 1427 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR 1428 * @see #EDGE_MODE_OFF 1429 * @see #EDGE_MODE_FAST 1430 * @see #EDGE_MODE_HIGH_QUALITY 1431 */ 1432 @PublicKey 1433 public static final Key<Integer> EDGE_MODE = 1434 new Key<Integer>("android.edge.mode", int.class); 1435 1436 /** 1437 * <p>The desired mode for for the camera device's flash control.</p> 1438 * <p>This control is only effective when flash unit is available 1439 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p> 1440 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. 1441 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, 1442 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> 1443 * <p>When set to OFF, the camera device will not fire flash for this capture.</p> 1444 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera 1445 * device's auto-exposure routine's result. When used in still capture case, this 1446 * control should be used along with auto-exposure (AE) precapture metering sequence 1447 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> 1448 * <p>When set to TORCH, the flash will be on continuously. This mode can be used 1449 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p> 1450 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p> 1451 * <p><b>Possible values:</b> 1452 * <ul> 1453 * <li>{@link #FLASH_MODE_OFF OFF}</li> 1454 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li> 1455 * <li>{@link #FLASH_MODE_TORCH TORCH}</li> 1456 * </ul></p> 1457 * <p>This key is available on all devices.</p> 1458 * 1459 * @see CaptureRequest#CONTROL_AE_MODE 1460 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 1461 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 1462 * @see CaptureResult#FLASH_STATE 1463 * @see #FLASH_MODE_OFF 1464 * @see #FLASH_MODE_SINGLE 1465 * @see #FLASH_MODE_TORCH 1466 */ 1467 @PublicKey 1468 public static final Key<Integer> FLASH_MODE = 1469 new Key<Integer>("android.flash.mode", int.class); 1470 1471 /** 1472 * <p>Operational mode for hot pixel correction.</p> 1473 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels 1474 * that do not accurately measure the incoming light (i.e. pixels that 1475 * are stuck at an arbitrary value or are oversensitive).</p> 1476 * <p><b>Possible values:</b> 1477 * <ul> 1478 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li> 1479 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li> 1480 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 1481 * </ul></p> 1482 * <p><b>Available values for this device:</b><br> 1483 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p> 1484 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1485 * 1486 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES 1487 * @see #HOT_PIXEL_MODE_OFF 1488 * @see #HOT_PIXEL_MODE_FAST 1489 * @see #HOT_PIXEL_MODE_HIGH_QUALITY 1490 */ 1491 @PublicKey 1492 public static final Key<Integer> HOT_PIXEL_MODE = 1493 new Key<Integer>("android.hotPixel.mode", int.class); 1494 1495 /** 1496 * <p>A location object to use when generating image GPS metadata.</p> 1497 * <p>Setting a location object in a request will include the GPS coordinates of the location 1498 * into any JPEG images captured based on the request. These coordinates can then be 1499 * viewed by anyone who receives the JPEG image.</p> 1500 * <p>This key is available on all devices.</p> 1501 */ 1502 @PublicKey 1503 @SyntheticKey 1504 public static final Key<android.location.Location> JPEG_GPS_LOCATION = 1505 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class); 1506 1507 /** 1508 * <p>GPS coordinates to include in output JPEG 1509 * EXIF.</p> 1510 * <p><b>Range of valid values:</b><br> 1511 * (-180 - 180], [-90,90], [-inf, inf]</p> 1512 * <p>This key is available on all devices.</p> 1513 * @hide 1514 */ 1515 public static final Key<double[]> JPEG_GPS_COORDINATES = 1516 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); 1517 1518 /** 1519 * <p>32 characters describing GPS algorithm to 1520 * include in EXIF.</p> 1521 * <p><b>Units</b>: UTF-8 null-terminated string</p> 1522 * <p>This key is available on all devices.</p> 1523 * @hide 1524 */ 1525 public static final Key<String> JPEG_GPS_PROCESSING_METHOD = 1526 new Key<String>("android.jpeg.gpsProcessingMethod", String.class); 1527 1528 /** 1529 * <p>Time GPS fix was made to include in 1530 * EXIF.</p> 1531 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p> 1532 * <p>This key is available on all devices.</p> 1533 * @hide 1534 */ 1535 public static final Key<Long> JPEG_GPS_TIMESTAMP = 1536 new Key<Long>("android.jpeg.gpsTimestamp", long.class); 1537 1538 /** 1539 * <p>The orientation for a JPEG image.</p> 1540 * <p>The clockwise rotation angle in degrees, relative to the orientation 1541 * to the camera, that the JPEG picture needs to be rotated by, to be viewed 1542 * upright.</p> 1543 * <p>Camera devices may either encode this value into the JPEG EXIF header, or 1544 * rotate the image data to match this orientation. When the image data is rotated, 1545 * the thumbnail data will also be rotated.</p> 1546 * <p>Note that this orientation is relative to the orientation of the camera sensor, given 1547 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p> 1548 * <p>To translate from the device orientation given by the Android sensor APIs, the following 1549 * sample code may be used:</p> 1550 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) { 1551 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0; 1552 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION); 1553 * 1554 * // Round device orientation to a multiple of 90 1555 * deviceOrientation = (deviceOrientation + 45) / 90 * 90; 1556 * 1557 * // Reverse device orientation for front-facing cameras 1558 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT; 1559 * if (facingFront) deviceOrientation = -deviceOrientation; 1560 * 1561 * // Calculate desired JPEG orientation relative to camera orientation to make 1562 * // the image upright relative to the device orientation 1563 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360; 1564 * 1565 * return jpegOrientation; 1566 * } 1567 * </code></pre> 1568 * <p><b>Units</b>: Degrees in multiples of 90</p> 1569 * <p><b>Range of valid values:</b><br> 1570 * 0, 90, 180, 270</p> 1571 * <p>This key is available on all devices.</p> 1572 * 1573 * @see CameraCharacteristics#SENSOR_ORIENTATION 1574 */ 1575 @PublicKey 1576 public static final Key<Integer> JPEG_ORIENTATION = 1577 new Key<Integer>("android.jpeg.orientation", int.class); 1578 1579 /** 1580 * <p>Compression quality of the final JPEG 1581 * image.</p> 1582 * <p>85-95 is typical usage range.</p> 1583 * <p><b>Range of valid values:</b><br> 1584 * 1-100; larger is higher quality</p> 1585 * <p>This key is available on all devices.</p> 1586 */ 1587 @PublicKey 1588 public static final Key<Byte> JPEG_QUALITY = 1589 new Key<Byte>("android.jpeg.quality", byte.class); 1590 1591 /** 1592 * <p>Compression quality of JPEG 1593 * thumbnail.</p> 1594 * <p><b>Range of valid values:</b><br> 1595 * 1-100; larger is higher quality</p> 1596 * <p>This key is available on all devices.</p> 1597 */ 1598 @PublicKey 1599 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = 1600 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); 1601 1602 /** 1603 * <p>Resolution of embedded JPEG thumbnail.</p> 1604 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, 1605 * but the captured JPEG will still be a valid image.</p> 1606 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected 1607 * should have the same aspect ratio as the main JPEG output.</p> 1608 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect 1609 * ratio, the camera device creates the thumbnail by cropping it from the primary image. 1610 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has 1611 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to 1612 * generate the thumbnail image. The thumbnail image will always have a smaller Field 1613 * Of View (FOV) than the primary image when aspect ratios differ.</p> 1614 * <p><b>Range of valid values:</b><br> 1615 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p> 1616 * <p>This key is available on all devices.</p> 1617 * 1618 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES 1619 */ 1620 @PublicKey 1621 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = 1622 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class); 1623 1624 /** 1625 * <p>The desired lens aperture size, as a ratio of lens focal length to the 1626 * effective aperture diameter.</p> 1627 * <p>Setting this value is only supported on the camera devices that have a variable 1628 * aperture lens.</p> 1629 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, 1630 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 1631 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} 1632 * to achieve manual exposure control.</p> 1633 * <p>The requested aperture value may take several frames to reach the 1634 * requested value; the camera device will report the current (intermediate) 1635 * aperture size in capture result metadata while the aperture is changing. 1636 * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> 1637 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of 1638 * the ON modes, this will be overridden by the camera device 1639 * auto-exposure algorithm, the overridden values are then provided 1640 * back to the user in the corresponding result.</p> 1641 * <p><b>Units</b>: The f-number (f/N)</p> 1642 * <p><b>Range of valid values:</b><br> 1643 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p> 1644 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1645 * <p><b>Full capability</b> - 1646 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 1647 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 1648 * 1649 * @see CaptureRequest#CONTROL_AE_MODE 1650 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 1651 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES 1652 * @see CaptureResult#LENS_STATE 1653 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 1654 * @see CaptureRequest#SENSOR_FRAME_DURATION 1655 * @see CaptureRequest#SENSOR_SENSITIVITY 1656 */ 1657 @PublicKey 1658 public static final Key<Float> LENS_APERTURE = 1659 new Key<Float>("android.lens.aperture", float.class); 1660 1661 /** 1662 * <p>The desired setting for the lens neutral density filter(s).</p> 1663 * <p>This control will not be supported on most camera devices.</p> 1664 * <p>Lens filters are typically used to lower the amount of light the 1665 * sensor is exposed to (measured in steps of EV). As used here, an EV 1666 * step is the standard logarithmic representation, which are 1667 * non-negative, and inversely proportional to the amount of light 1668 * hitting the sensor. For example, setting this to 0 would result 1669 * in no reduction of the incoming light, and setting this to 2 would 1670 * mean that the filter is set to reduce incoming light by two stops 1671 * (allowing 1/4 of the prior amount of light to the sensor).</p> 1672 * <p>It may take several frames before the lens filter density changes 1673 * to the requested value. While the filter density is still changing, 1674 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> 1675 * <p><b>Units</b>: Exposure Value (EV)</p> 1676 * <p><b>Range of valid values:</b><br> 1677 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p> 1678 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1679 * <p><b>Full capability</b> - 1680 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 1681 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 1682 * 1683 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 1684 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES 1685 * @see CaptureResult#LENS_STATE 1686 */ 1687 @PublicKey 1688 public static final Key<Float> LENS_FILTER_DENSITY = 1689 new Key<Float>("android.lens.filterDensity", float.class); 1690 1691 /** 1692 * <p>The desired lens focal length; used for optical zoom.</p> 1693 * <p>This setting controls the physical focal length of the camera 1694 * device's lens. Changing the focal length changes the field of 1695 * view of the camera device, and is usually used for optical zoom.</p> 1696 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this 1697 * setting won't be applied instantaneously, and it may take several 1698 * frames before the lens can change to the requested focal length. 1699 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will 1700 * be set to MOVING.</p> 1701 * <p>Optical zoom will not be supported on most devices.</p> 1702 * <p><b>Units</b>: Millimeters</p> 1703 * <p><b>Range of valid values:</b><br> 1704 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p> 1705 * <p>This key is available on all devices.</p> 1706 * 1707 * @see CaptureRequest#LENS_APERTURE 1708 * @see CaptureRequest#LENS_FOCUS_DISTANCE 1709 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS 1710 * @see CaptureResult#LENS_STATE 1711 */ 1712 @PublicKey 1713 public static final Key<Float> LENS_FOCAL_LENGTH = 1714 new Key<Float>("android.lens.focalLength", float.class); 1715 1716 /** 1717 * <p>Desired distance to plane of sharpest focus, 1718 * measured from frontmost surface of the lens.</p> 1719 * <p>This control can be used for setting manual focus, on devices that support 1720 * the MANUAL_SENSOR capability and have a variable-focus lens (see 1721 * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}).</p> 1722 * <p>A value of <code>0.0f</code> means infinity focus. The value set will be clamped to 1723 * <code>[0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>.</p> 1724 * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied 1725 * instantaneously, and it may take several frames before the lens 1726 * can move to the requested focus distance. While the lens is still moving, 1727 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> 1728 * <p>LEGACY devices support at most setting this to <code>0.0f</code> 1729 * for infinity focus.</p> 1730 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p> 1731 * <p><b>Range of valid values:</b><br> 1732 * >= 0</p> 1733 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1734 * <p><b>Full capability</b> - 1735 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 1736 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 1737 * 1738 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 1739 * @see CaptureRequest#LENS_FOCAL_LENGTH 1740 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION 1741 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE 1742 * @see CaptureResult#LENS_STATE 1743 */ 1744 @PublicKey 1745 public static final Key<Float> LENS_FOCUS_DISTANCE = 1746 new Key<Float>("android.lens.focusDistance", float.class); 1747 1748 /** 1749 * <p>Sets whether the camera device uses optical image stabilization (OIS) 1750 * when capturing images.</p> 1751 * <p>OIS is used to compensate for motion blur due to small 1752 * movements of the camera during capture. Unlike digital image 1753 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS 1754 * makes use of mechanical elements to stabilize the camera 1755 * sensor, and thus allows for longer exposure times before 1756 * camera shake becomes apparent.</p> 1757 * <p>Switching between different optical stabilization modes may take several 1758 * frames to initialize, the camera device will report the current mode in 1759 * capture result metadata. For example, When "ON" mode is requested, the 1760 * optical stabilization modes in the first several capture results may still 1761 * be "OFF", and it will become "ON" when the initialization is done.</p> 1762 * <p>If a camera device supports both OIS and digital image stabilization 1763 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable 1764 * interaction, so it is recommended not to enable both at the same time.</p> 1765 * <p>Not all devices will support OIS; see 1766 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for 1767 * available controls.</p> 1768 * <p><b>Possible values:</b> 1769 * <ul> 1770 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li> 1771 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li> 1772 * </ul></p> 1773 * <p><b>Available values for this device:</b><br> 1774 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p> 1775 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1776 * <p><b>Limited capability</b> - 1777 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the 1778 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 1779 * 1780 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE 1781 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 1782 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION 1783 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF 1784 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON 1785 */ 1786 @PublicKey 1787 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = 1788 new Key<Integer>("android.lens.opticalStabilizationMode", int.class); 1789 1790 /** 1791 * <p>Mode of operation for the noise reduction algorithm.</p> 1792 * <p>The noise reduction algorithm attempts to improve image quality by removing 1793 * excessive noise added by the capture process, especially in dark conditions.</p> 1794 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and 1795 * YUV domain.</p> 1796 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove 1797 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF. 1798 * This mode is optional, may not be support by all devices. The application should check 1799 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p> 1800 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering 1801 * will be applied. HIGH_QUALITY mode indicates that the camera device 1802 * will use the highest-quality noise filtering algorithms, 1803 * even if it slows down capture rate. FAST means the camera device will not 1804 * slow down capture rate when applying noise filtering.</p> 1805 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device 1806 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device 1807 * may adjust the noise reduction parameters for best image quality based on the 1808 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p> 1809 * <p><b>Possible values:</b> 1810 * <ul> 1811 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li> 1812 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li> 1813 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 1814 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li> 1815 * </ul></p> 1816 * <p><b>Available values for this device:</b><br> 1817 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p> 1818 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1819 * <p><b>Full capability</b> - 1820 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 1821 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 1822 * 1823 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 1824 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES 1825 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR 1826 * @see #NOISE_REDUCTION_MODE_OFF 1827 * @see #NOISE_REDUCTION_MODE_FAST 1828 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY 1829 * @see #NOISE_REDUCTION_MODE_MINIMAL 1830 */ 1831 @PublicKey 1832 public static final Key<Integer> NOISE_REDUCTION_MODE = 1833 new Key<Integer>("android.noiseReduction.mode", int.class); 1834 1835 /** 1836 * <p>An application-specified ID for the current 1837 * request. Must be maintained unchanged in output 1838 * frame</p> 1839 * <p><b>Units</b>: arbitrary integer assigned by application</p> 1840 * <p><b>Range of valid values:</b><br> 1841 * Any int</p> 1842 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1843 * @hide 1844 */ 1845 public static final Key<Integer> REQUEST_ID = 1846 new Key<Integer>("android.request.id", int.class); 1847 1848 /** 1849 * <p>The desired region of the sensor to read out for this capture.</p> 1850 * <p>This control can be used to implement digital zoom.</p> 1851 * <p>The crop region coordinate system is based off 1852 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the 1853 * top-left corner of the sensor active array.</p> 1854 * <p>Output streams use this rectangle to produce their output, 1855 * cropping to a smaller region if necessary to maintain the 1856 * stream's aspect ratio, then scaling the sensor input to 1857 * match the output's configured resolution.</p> 1858 * <p>The crop region is applied after the RAW to other color 1859 * space (e.g. YUV) conversion. Since raw streams 1860 * (e.g. RAW16) don't have the conversion stage, they are not 1861 * croppable. The crop region will be ignored by raw streams.</p> 1862 * <p>For non-raw streams, any additional per-stream cropping will 1863 * be done to maximize the final pixel area of the stream.</p> 1864 * <p>For example, if the crop region is set to a 4:3 aspect 1865 * ratio, then 4:3 streams will use the exact crop 1866 * region. 16:9 streams will further crop vertically 1867 * (letterbox).</p> 1868 * <p>Conversely, if the crop region is set to a 16:9, then 4:3 1869 * outputs will crop horizontally (pillarbox), and 16:9 1870 * streams will match exactly. These additional crops will 1871 * be centered within the crop region.</p> 1872 * <p>The width and height of the crop region cannot 1873 * be set to be smaller than 1874 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and 1875 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p> 1876 * <p>The camera device may adjust the crop region to account 1877 * for rounding and other hardware requirements; the final 1878 * crop region used will be included in the output capture 1879 * result.</p> 1880 * <p><b>Units</b>: Pixel coordinates relative to 1881 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> 1882 * <p>This key is available on all devices.</p> 1883 * 1884 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM 1885 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 1886 */ 1887 @PublicKey 1888 public static final Key<android.graphics.Rect> SCALER_CROP_REGION = 1889 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); 1890 1891 /** 1892 * <p>Duration each pixel is exposed to 1893 * light.</p> 1894 * <p>If the sensor can't expose this exact duration, it will shorten the 1895 * duration exposed to the nearest possible value (rather than expose longer). 1896 * The final exposure time used will be available in the output capture result.</p> 1897 * <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 1898 * OFF; otherwise the auto-exposure algorithm will override this value.</p> 1899 * <p><b>Units</b>: Nanoseconds</p> 1900 * <p><b>Range of valid values:</b><br> 1901 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p> 1902 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1903 * <p><b>Full capability</b> - 1904 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 1905 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 1906 * 1907 * @see CaptureRequest#CONTROL_AE_MODE 1908 * @see CaptureRequest#CONTROL_MODE 1909 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 1910 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE 1911 */ 1912 @PublicKey 1913 public static final Key<Long> SENSOR_EXPOSURE_TIME = 1914 new Key<Long>("android.sensor.exposureTime", long.class); 1915 1916 /** 1917 * <p>Duration from start of frame exposure to 1918 * start of next frame exposure.</p> 1919 * <p>The maximum frame rate that can be supported by a camera subsystem is 1920 * a function of many factors:</p> 1921 * <ul> 1922 * <li>Requested resolutions of output image streams</li> 1923 * <li>Availability of binning / skipping modes on the imager</li> 1924 * <li>The bandwidth of the imager interface</li> 1925 * <li>The bandwidth of the various ISP processing blocks</li> 1926 * </ul> 1927 * <p>Since these factors can vary greatly between different ISPs and 1928 * sensors, the camera abstraction tries to represent the bandwidth 1929 * restrictions with as simple a model as possible.</p> 1930 * <p>The model presented has the following characteristics:</p> 1931 * <ul> 1932 * <li>The image sensor is always configured to output the smallest 1933 * resolution possible given the application's requested output stream 1934 * sizes. The smallest resolution is defined as being at least as large 1935 * as the largest requested output stream size; the camera pipeline must 1936 * never digitally upsample sensor data when the crop region covers the 1937 * whole sensor. In general, this means that if only small output stream 1938 * resolutions are configured, the sensor can provide a higher frame 1939 * rate.</li> 1940 * <li>Since any request may use any or all the currently configured 1941 * output streams, the sensor and ISP must be configured to support 1942 * scaling a single capture to all the streams at the same time. This 1943 * means the camera pipeline must be ready to produce the largest 1944 * requested output size without any delay. Therefore, the overall 1945 * frame rate of a given configured stream set is governed only by the 1946 * largest requested stream resolution.</li> 1947 * <li>Using more than one output stream in a request does not affect the 1948 * frame duration.</li> 1949 * <li>Certain format-streams may need to do additional background processing 1950 * before data is consumed/produced by that stream. These processors 1951 * can run concurrently to the rest of the camera pipeline, but 1952 * cannot process more than 1 capture at a time.</li> 1953 * </ul> 1954 * <p>The necessary information for the application, given the model above, 1955 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field 1956 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size). 1957 * These are used to determine the maximum frame rate / minimum frame 1958 * duration that is possible for a given stream configuration.</p> 1959 * <p>Specifically, the application can use the following rules to 1960 * determine the minimum frame duration it can request from the camera 1961 * device:</p> 1962 * <ol> 1963 * <li>Let the set of currently configured input/output streams 1964 * be called <code>S</code>.</li> 1965 * <li>Find the minimum frame durations for each stream in <code>S</code>, by 1966 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using 1967 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with 1968 * its respective size/format). Let this set of frame durations be called 1969 * <code>F</code>.</li> 1970 * <li>For any given request <code>R</code>, the minimum frame duration allowed 1971 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams 1972 * used in <code>R</code> be called <code>S_r</code>.</li> 1973 * </ol> 1974 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in 1975 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its 1976 * respective size/format), then the frame duration in 1977 * <code>F</code> determines the steady state frame rate that the application will 1978 * get if it uses <code>R</code> as a repeating request. Let this special kind 1979 * of request be called <code>Rsimple</code>.</p> 1980 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved 1981 * by a single capture of a new request <code>Rstall</code> (which has at least 1982 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the 1983 * same minimum frame duration this will not cause a frame rate loss 1984 * if all buffers from the previous <code>Rstall</code> have already been 1985 * delivered.</p> 1986 * <p>For more details about stalling, see 1987 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p> 1988 * <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 1989 * OFF; otherwise the auto-exposure algorithm will override this value.</p> 1990 * <p><b>Units</b>: Nanoseconds</p> 1991 * <p><b>Range of valid values:</b><br> 1992 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, 1993 * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration 1994 * is capped to <code>max(duration, exposureTime + overhead)</code>.</p> 1995 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1996 * <p><b>Full capability</b> - 1997 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 1998 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 1999 * 2000 * @see CaptureRequest#CONTROL_AE_MODE 2001 * @see CaptureRequest#CONTROL_MODE 2002 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2003 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP 2004 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION 2005 */ 2006 @PublicKey 2007 public static final Key<Long> SENSOR_FRAME_DURATION = 2008 new Key<Long>("android.sensor.frameDuration", long.class); 2009 2010 /** 2011 * <p>The amount of gain applied to sensor data 2012 * before processing.</p> 2013 * <p>The sensitivity is the standard ISO sensitivity value, 2014 * as defined in ISO 12232:2006.</p> 2015 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and 2016 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device 2017 * is guaranteed to use only analog amplification for applying the gain.</p> 2018 * <p>If the camera device cannot apply the exact sensitivity 2019 * requested, it will reduce the gain to the nearest supported 2020 * value. The final sensitivity used will be available in the 2021 * output capture result.</p> 2022 * <p><b>Units</b>: ISO arithmetic units</p> 2023 * <p><b>Range of valid values:</b><br> 2024 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p> 2025 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2026 * <p><b>Full capability</b> - 2027 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2028 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2029 * 2030 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2031 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE 2032 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY 2033 */ 2034 @PublicKey 2035 public static final Key<Integer> SENSOR_SENSITIVITY = 2036 new Key<Integer>("android.sensor.sensitivity", int.class); 2037 2038 /** 2039 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern 2040 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> 2041 * <p>Each color channel is treated as an unsigned 32-bit integer. 2042 * The camera device then uses the most significant X bits 2043 * that correspond to how many bits are in its Bayer raw sensor 2044 * output.</p> 2045 * <p>For example, a sensor with RAW10 Bayer output would use the 2046 * 10 most significant bits from each color channel.</p> 2047 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2048 * 2049 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE 2050 */ 2051 @PublicKey 2052 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = 2053 new Key<int[]>("android.sensor.testPatternData", int[].class); 2054 2055 /** 2056 * <p>When enabled, the sensor sends a test pattern instead of 2057 * doing a real exposure from the camera.</p> 2058 * <p>When a test pattern is enabled, all manual sensor controls specified 2059 * by android.sensor.* will be ignored. All other controls should 2060 * work as normal.</p> 2061 * <p>For example, if manual flash is enabled, flash firing should still 2062 * occur (and that the test pattern remain unmodified, since the flash 2063 * would not actually affect it).</p> 2064 * <p>Defaults to OFF.</p> 2065 * <p><b>Possible values:</b> 2066 * <ul> 2067 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li> 2068 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li> 2069 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li> 2070 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li> 2071 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li> 2072 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li> 2073 * </ul></p> 2074 * <p><b>Available values for this device:</b><br> 2075 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p> 2076 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2077 * 2078 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES 2079 * @see #SENSOR_TEST_PATTERN_MODE_OFF 2080 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR 2081 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS 2082 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY 2083 * @see #SENSOR_TEST_PATTERN_MODE_PN9 2084 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 2085 */ 2086 @PublicKey 2087 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = 2088 new Key<Integer>("android.sensor.testPatternMode", int.class); 2089 2090 /** 2091 * <p>Quality of lens shading correction applied 2092 * to the image data.</p> 2093 * <p>When set to OFF mode, no lens shading correction will be applied by the 2094 * camera device, and an identity lens shading map data will be provided 2095 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens 2096 * shading map with size of <code>[ 4, 3 ]</code>, 2097 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity 2098 * map shown below:</p> 2099 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2100 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2101 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2102 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2103 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2104 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] 2105 * </code></pre> 2106 * <p>When set to other modes, lens shading correction will be applied by the camera 2107 * device. Applications can request lens shading map data by setting 2108 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens 2109 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map 2110 * data will be the one applied by the camera device for this capture request.</p> 2111 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore 2112 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and 2113 * 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> 2114 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB 2115 * to be converged before using the returned shading map data.</p> 2116 * <p><b>Possible values:</b> 2117 * <ul> 2118 * <li>{@link #SHADING_MODE_OFF OFF}</li> 2119 * <li>{@link #SHADING_MODE_FAST FAST}</li> 2120 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 2121 * </ul></p> 2122 * <p><b>Available values for this device:</b><br> 2123 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p> 2124 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2125 * <p><b>Full capability</b> - 2126 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2127 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2128 * 2129 * @see CaptureRequest#CONTROL_AE_MODE 2130 * @see CaptureRequest#CONTROL_AWB_MODE 2131 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2132 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES 2133 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP 2134 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE 2135 * @see #SHADING_MODE_OFF 2136 * @see #SHADING_MODE_FAST 2137 * @see #SHADING_MODE_HIGH_QUALITY 2138 */ 2139 @PublicKey 2140 public static final Key<Integer> SHADING_MODE = 2141 new Key<Integer>("android.shading.mode", int.class); 2142 2143 /** 2144 * <p>Operating mode for the face detector 2145 * unit.</p> 2146 * <p>Whether face detection is enabled, and whether it 2147 * should output just the basic fields or the full set of 2148 * fields.</p> 2149 * <p><b>Possible values:</b> 2150 * <ul> 2151 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li> 2152 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li> 2153 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li> 2154 * </ul></p> 2155 * <p><b>Available values for this device:</b><br> 2156 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p> 2157 * <p>This key is available on all devices.</p> 2158 * 2159 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES 2160 * @see #STATISTICS_FACE_DETECT_MODE_OFF 2161 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE 2162 * @see #STATISTICS_FACE_DETECT_MODE_FULL 2163 */ 2164 @PublicKey 2165 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = 2166 new Key<Integer>("android.statistics.faceDetectMode", int.class); 2167 2168 /** 2169 * <p>Operating mode for hot pixel map generation.</p> 2170 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}. 2171 * If set to <code>false</code>, no hot pixel map will be returned.</p> 2172 * <p><b>Range of valid values:</b><br> 2173 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p> 2174 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2175 * 2176 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP 2177 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES 2178 */ 2179 @PublicKey 2180 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = 2181 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); 2182 2183 /** 2184 * <p>Whether the camera device will output the lens 2185 * shading map in output result metadata.</p> 2186 * <p>When set to ON, 2187 * android.statistics.lensShadingMap will be provided in 2188 * the output result metadata.</p> 2189 * <p>ON is always supported on devices with the RAW capability.</p> 2190 * <p><b>Possible values:</b> 2191 * <ul> 2192 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li> 2193 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li> 2194 * </ul></p> 2195 * <p><b>Available values for this device:</b><br> 2196 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p> 2197 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2198 * <p><b>Full capability</b> - 2199 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2200 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2201 * 2202 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2203 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES 2204 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF 2205 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON 2206 */ 2207 @PublicKey 2208 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = 2209 new Key<Integer>("android.statistics.lensShadingMapMode", int.class); 2210 2211 /** 2212 * <p>Tonemapping / contrast / gamma curve for the blue 2213 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 2214 * CONTRAST_CURVE.</p> 2215 * <p>See android.tonemap.curveRed for more details.</p> 2216 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2217 * <p><b>Full capability</b> - 2218 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2219 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2220 * 2221 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2222 * @see CaptureRequest#TONEMAP_MODE 2223 * @hide 2224 */ 2225 public static final Key<float[]> TONEMAP_CURVE_BLUE = 2226 new Key<float[]>("android.tonemap.curveBlue", float[].class); 2227 2228 /** 2229 * <p>Tonemapping / contrast / gamma curve for the green 2230 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 2231 * CONTRAST_CURVE.</p> 2232 * <p>See android.tonemap.curveRed for more details.</p> 2233 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2234 * <p><b>Full capability</b> - 2235 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2236 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2237 * 2238 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2239 * @see CaptureRequest#TONEMAP_MODE 2240 * @hide 2241 */ 2242 public static final Key<float[]> TONEMAP_CURVE_GREEN = 2243 new Key<float[]>("android.tonemap.curveGreen", float[].class); 2244 2245 /** 2246 * <p>Tonemapping / contrast / gamma curve for the red 2247 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 2248 * CONTRAST_CURVE.</p> 2249 * <p>Each channel's curve is defined by an array of control points:</p> 2250 * <pre><code>android.tonemap.curveRed = 2251 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] 2252 * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> 2253 * <p>These are sorted in order of increasing <code>Pin</code>; it is 2254 * required that input values 0.0 and 1.0 are included in the list to 2255 * define a complete mapping. For input values between control points, 2256 * the camera device must linearly interpolate between the control 2257 * points.</p> 2258 * <p>Each curve can have an independent number of points, and the number 2259 * of points can be less than max (that is, the request doesn't have to 2260 * always provide a curve with number of points equivalent to 2261 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> 2262 * <p>A few examples, and their corresponding graphical mappings; these 2263 * only specify the red channel and the precision is limited to 4 2264 * digits, for conciseness.</p> 2265 * <p>Linear mapping:</p> 2266 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ] 2267 * </code></pre> 2268 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> 2269 * <p>Invert mapping:</p> 2270 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ] 2271 * </code></pre> 2272 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> 2273 * <p>Gamma 1/2.2 mapping, with 16 control points:</p> 2274 * <pre><code>android.tonemap.curveRed = [ 2275 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, 2276 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, 2277 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, 2278 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ] 2279 * </code></pre> 2280 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> 2281 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> 2282 * <pre><code>android.tonemap.curveRed = [ 2283 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, 2284 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, 2285 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, 2286 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ] 2287 * </code></pre> 2288 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> 2289 * <p><b>Range of valid values:</b><br> 2290 * 0-1 on both input and output coordinates, normalized 2291 * as a floating-point value such that 0 == black and 1 == white.</p> 2292 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2293 * <p><b>Full capability</b> - 2294 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2295 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2296 * 2297 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2298 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS 2299 * @see CaptureRequest#TONEMAP_MODE 2300 * @hide 2301 */ 2302 public static final Key<float[]> TONEMAP_CURVE_RED = 2303 new Key<float[]>("android.tonemap.curveRed", float[].class); 2304 2305 /** 2306 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} 2307 * is CONTRAST_CURVE.</p> 2308 * <p>The tonemapCurve consist of three curves for each of red, green, and blue 2309 * channels respectively. The following example uses the red channel as an 2310 * example. The same logic applies to green and blue channel. 2311 * Each channel's curve is defined by an array of control points:</p> 2312 * <pre><code>curveRed = 2313 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ] 2314 * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> 2315 * <p>These are sorted in order of increasing <code>Pin</code>; it is always 2316 * guaranteed that input values 0.0 and 1.0 are included in the list to 2317 * define a complete mapping. For input values between control points, 2318 * the camera device must linearly interpolate between the control 2319 * points.</p> 2320 * <p>Each curve can have an independent number of points, and the number 2321 * of points can be less than max (that is, the request doesn't have to 2322 * always provide a curve with number of points equivalent to 2323 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> 2324 * <p>A few examples, and their corresponding graphical mappings; these 2325 * only specify the red channel and the precision is limited to 4 2326 * digits, for conciseness.</p> 2327 * <p>Linear mapping:</p> 2328 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ] 2329 * </code></pre> 2330 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> 2331 * <p>Invert mapping:</p> 2332 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ] 2333 * </code></pre> 2334 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> 2335 * <p>Gamma 1/2.2 mapping, with 16 control points:</p> 2336 * <pre><code>curveRed = [ 2337 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812), 2338 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072), 2339 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685), 2340 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ] 2341 * </code></pre> 2342 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> 2343 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> 2344 * <pre><code>curveRed = [ 2345 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845), 2346 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130), 2347 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721), 2348 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ] 2349 * </code></pre> 2350 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> 2351 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2352 * <p><b>Full capability</b> - 2353 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2354 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2355 * 2356 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2357 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS 2358 * @see CaptureRequest#TONEMAP_MODE 2359 */ 2360 @PublicKey 2361 @SyntheticKey 2362 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE = 2363 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class); 2364 2365 /** 2366 * <p>High-level global contrast/gamma/tonemapping control.</p> 2367 * <p>When switching to an application-defined contrast curve by setting 2368 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined 2369 * per-channel with a set of <code>(in, out)</code> points that specify the 2370 * mapping from input high-bit-depth pixel value to the output 2371 * low-bit-depth value. Since the actual pixel ranges of both input 2372 * and output may change depending on the camera pipeline, the values 2373 * are specified by normalized floating-point numbers.</p> 2374 * <p>More-complex color mapping operations such as 3D color look-up 2375 * tables, selective chroma enhancement, or other non-linear color 2376 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 2377 * CONTRAST_CURVE.</p> 2378 * <p>When using either FAST or HIGH_QUALITY, the camera device will 2379 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}. 2380 * These values are always available, and as close as possible to the 2381 * actually used nonlinear/nonglobal transforms.</p> 2382 * <p>If a request is sent with CONTRAST_CURVE with the camera device's 2383 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be 2384 * roughly the same.</p> 2385 * <p><b>Possible values:</b> 2386 * <ul> 2387 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li> 2388 * <li>{@link #TONEMAP_MODE_FAST FAST}</li> 2389 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li> 2390 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li> 2391 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li> 2392 * </ul></p> 2393 * <p><b>Available values for this device:</b><br> 2394 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p> 2395 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2396 * <p><b>Full capability</b> - 2397 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2398 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2399 * 2400 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2401 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES 2402 * @see CaptureRequest#TONEMAP_CURVE 2403 * @see CaptureRequest#TONEMAP_MODE 2404 * @see #TONEMAP_MODE_CONTRAST_CURVE 2405 * @see #TONEMAP_MODE_FAST 2406 * @see #TONEMAP_MODE_HIGH_QUALITY 2407 * @see #TONEMAP_MODE_GAMMA_VALUE 2408 * @see #TONEMAP_MODE_PRESET_CURVE 2409 */ 2410 @PublicKey 2411 public static final Key<Integer> TONEMAP_MODE = 2412 new Key<Integer>("android.tonemap.mode", int.class); 2413 2414 /** 2415 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 2416 * GAMMA_VALUE</p> 2417 * <p>The tonemap curve will be defined the following formula: 2418 * * OUT = pow(IN, 1.0 / gamma) 2419 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0], 2420 * pow is the power function and gamma is the gamma value specified by this 2421 * key.</p> 2422 * <p>The same curve will be applied to all color channels. The camera device 2423 * may clip the input gamma value to its supported range. The actual applied 2424 * value will be returned in capture result.</p> 2425 * <p>The valid range of gamma value varies on different devices, but values 2426 * within [1.0, 5.0] are guaranteed not to be clipped.</p> 2427 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2428 * 2429 * @see CaptureRequest#TONEMAP_MODE 2430 */ 2431 @PublicKey 2432 public static final Key<Float> TONEMAP_GAMMA = 2433 new Key<Float>("android.tonemap.gamma", float.class); 2434 2435 /** 2436 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 2437 * PRESET_CURVE</p> 2438 * <p>The tonemap curve will be defined by specified standard.</p> 2439 * <p>sRGB (approximated by 16 control points):</p> 2440 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> 2441 * <p>Rec. 709 (approximated by 16 control points):</p> 2442 * <p><img alt="Rec. 709 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p> 2443 * <p>Note that above figures show a 16 control points approximation of preset 2444 * curves. Camera devices may apply a different approximation to the curve.</p> 2445 * <p><b>Possible values:</b> 2446 * <ul> 2447 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li> 2448 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li> 2449 * </ul></p> 2450 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2451 * 2452 * @see CaptureRequest#TONEMAP_MODE 2453 * @see #TONEMAP_PRESET_CURVE_SRGB 2454 * @see #TONEMAP_PRESET_CURVE_REC709 2455 */ 2456 @PublicKey 2457 public static final Key<Integer> TONEMAP_PRESET_CURVE = 2458 new Key<Integer>("android.tonemap.presetCurve", int.class); 2459 2460 /** 2461 * <p>This LED is nominally used to indicate to the user 2462 * that the camera is powered on and may be streaming images back to the 2463 * Application Processor. In certain rare circumstances, the OS may 2464 * disable this when video is processed locally and not transmitted to 2465 * any untrusted applications.</p> 2466 * <p>In particular, the LED <em>must</em> always be on when the data could be 2467 * transmitted off the device. The LED <em>should</em> always be on whenever 2468 * data is stored locally on the device.</p> 2469 * <p>The LED <em>may</em> be off if a trusted application is using the data that 2470 * doesn't violate the above rules.</p> 2471 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2472 * @hide 2473 */ 2474 public static final Key<Boolean> LED_TRANSMIT = 2475 new Key<Boolean>("android.led.transmit", boolean.class); 2476 2477 /** 2478 * <p>Whether black-level compensation is locked 2479 * to its current values, or is free to vary.</p> 2480 * <p>When set to <code>true</code> (ON), the values used for black-level 2481 * compensation will not change until the lock is set to 2482 * <code>false</code> (OFF).</p> 2483 * <p>Since changes to certain capture parameters (such as 2484 * exposure time) may require resetting of black level 2485 * compensation, the camera device must report whether setting 2486 * the black level lock was successful in the output result 2487 * metadata.</p> 2488 * <p>For example, if a sequence of requests is as follows:</p> 2489 * <ul> 2490 * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li> 2491 * <li>Request 2: Exposure = 10ms, Black level lock = ON</li> 2492 * <li>Request 3: Exposure = 10ms, Black level lock = ON</li> 2493 * <li>Request 4: Exposure = 20ms, Black level lock = ON</li> 2494 * <li>Request 5: Exposure = 20ms, Black level lock = ON</li> 2495 * <li>Request 6: Exposure = 20ms, Black level lock = ON</li> 2496 * </ul> 2497 * <p>And the exposure change in Request 4 requires the camera 2498 * device to reset the black level offsets, then the output 2499 * result metadata is expected to be:</p> 2500 * <ul> 2501 * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li> 2502 * <li>Result 2: Exposure = 10ms, Black level lock = ON</li> 2503 * <li>Result 3: Exposure = 10ms, Black level lock = ON</li> 2504 * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li> 2505 * <li>Result 5: Exposure = 20ms, Black level lock = ON</li> 2506 * <li>Result 6: Exposure = 20ms, Black level lock = ON</li> 2507 * </ul> 2508 * <p>This indicates to the application that on frame 4, black 2509 * levels were reset due to exposure value changes, and pixel 2510 * values may not be consistent across captures.</p> 2511 * <p>The camera device will maintain the lock to the extent 2512 * possible, only overriding the lock to OFF when changes to 2513 * other request parameters require a black level recalculation 2514 * or reset.</p> 2515 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2516 * <p><b>Full capability</b> - 2517 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the 2518 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> 2519 * 2520 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 2521 */ 2522 @PublicKey 2523 public static final Key<Boolean> BLACK_LEVEL_LOCK = 2524 new Key<Boolean>("android.blackLevel.lock", boolean.class); 2525 2526 /** 2527 * <p>The amount of exposure time increase factor applied to the original output 2528 * frame by the application processing before sending for reprocessing.</p> 2529 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING 2530 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p> 2531 * <p>For some YUV reprocessing use cases, the application may choose to filter the original 2532 * output frames to effectively reduce the noise to the same level as a frame that was 2533 * captured with longer exposure time. To be more specific, assuming the original captured 2534 * images were captured with a sensitivity of S and an exposure time of T, the model in 2535 * the camera device is that the amount of noise in the image would be approximately what 2536 * would be expected if the original capture parameters had been a sensitivity of 2537 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather 2538 * than S and T respectively. If the captured images were processed by the application 2539 * before being sent for reprocessing, then the application may have used image processing 2540 * algorithms and/or multi-frame image fusion to reduce the noise in the 2541 * application-processed images (input images). By using the effectiveExposureFactor 2542 * control, the application can communicate to the camera device the actual noise level 2543 * improvement in the application-processed image. With this information, the camera 2544 * device can select appropriate noise reduction and edge enhancement parameters to avoid 2545 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge 2546 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p> 2547 * <p>For example, for multi-frame image fusion use case, the application may fuse 2548 * multiple output frames together to a final frame for reprocessing. When N image are 2549 * fused into 1 image for reprocessing, the exposure time increase factor could be up to 2550 * square root of N (based on a simple photon shot noise model). The camera device will 2551 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to 2552 * produce the best quality images.</p> 2553 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input 2554 * buffer in a way that affects its effective exposure time.</p> 2555 * <p>This control is only effective for YUV reprocessing capture request. For noise 2556 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>. 2557 * Similarly, for edge enhancement reprocessing, it is only effective when 2558 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p> 2559 * <p><b>Units</b>: Relative exposure time increase factor.</p> 2560 * <p><b>Range of valid values:</b><br> 2561 * >= 1.0</p> 2562 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 2563 * 2564 * @see CaptureRequest#EDGE_MODE 2565 * @see CaptureRequest#NOISE_REDUCTION_MODE 2566 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES 2567 */ 2568 @PublicKey 2569 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = 2570 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class); 2571 2572 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 2573 * End generated code 2574 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ 2575 2576 2577 2578} 2579