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