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