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