CaptureResult.java revision 7144b5d2cf445ed245cfd9b09c7897966d01b5ff
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
17package android.hardware.camera2;
18
19import android.hardware.camera2.impl.CameraMetadataNative;
20import android.hardware.camera2.impl.CaptureResultExtras;
21import android.hardware.camera2.impl.PublicKey;
22import android.hardware.camera2.impl.SyntheticKey;
23import android.hardware.camera2.utils.TypeReference;
24import android.util.Log;
25import android.util.Rational;
26
27import java.util.List;
28
29/**
30 * <p>The subset of the results of a single image capture from the image sensor.</p>
31 *
32 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
33 * flash), the processing pipeline, the control algorithms, and the output
34 * buffers.</p>
35 *
36 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
37 * {@link CaptureRequest}. All properties listed for capture requests can also
38 * be queried on the capture result, to determine the final values used for
39 * capture. The result also includes additional metadata about the state of the
40 * camera device during the capture.</p>
41 *
42 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
43 * are necessarily available. Some results are {@link CaptureResult partial} and will
44 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
45 * every key available that was enabled by the request.</p>
46 *
47 * <p>{@link CaptureResult} objects are immutable.</p>
48 *
49 */
50public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
51
52    private static final String TAG = "CaptureResult";
53    private static final boolean VERBOSE = false;
54
55    /**
56     * A {@code Key} is used to do capture result field lookups with
57     * {@link CaptureResult#get}.
58     *
59     * <p>For example, to get the timestamp corresponding to the exposure of the first row:
60     * <code><pre>
61     * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
62     * </pre></code>
63     * </p>
64     *
65     * <p>To enumerate over all possible keys for {@link CaptureResult}, see
66     * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
67     *
68     * @see CaptureResult#get
69     * @see CameraCharacteristics#getAvailableCaptureResultKeys
70     */
71    public final static class Key<T> {
72        private final CameraMetadataNative.Key<T> mKey;
73
74        /**
75         * Visible for testing and vendor extensions only.
76         *
77         * @hide
78         */
79        public Key(String name, Class<T> type) {
80            mKey = new CameraMetadataNative.Key<T>(name, type);
81        }
82
83        /**
84         * Visible for testing and vendor extensions only.
85         *
86         * @hide
87         */
88        public Key(String name, TypeReference<T> typeReference) {
89            mKey = new CameraMetadataNative.Key<T>(name, typeReference);
90        }
91
92        /**
93         * Return a camelCase, period separated name formatted like:
94         * {@code "root.section[.subsections].name"}.
95         *
96         * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
97         * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
98         *
99         * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
100         * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
101         * specific key might look like {@code "com.google.nexus.data.private"}.</p>
102         *
103         * @return String representation of the key name
104         */
105        public String getName() {
106            return mKey.getName();
107        }
108
109        /**
110         * {@inheritDoc}
111         */
112        @Override
113        public final int hashCode() {
114            return mKey.hashCode();
115        }
116
117        /**
118         * {@inheritDoc}
119         */
120        @SuppressWarnings("unchecked")
121        @Override
122        public final boolean equals(Object o) {
123            return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
124        }
125
126        /**
127         * Visible for CameraMetadataNative implementation only; do not use.
128         *
129         * TODO: Make this private or remove it altogether.
130         *
131         * @hide
132         */
133        public CameraMetadataNative.Key<T> getNativeKey() {
134            return mKey;
135        }
136
137        @SuppressWarnings({ "unchecked" })
138        /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
139            mKey = (CameraMetadataNative.Key<T>) nativeKey;
140        }
141    }
142
143    private final CameraMetadataNative mResults;
144    private final CaptureRequest mRequest;
145    private final int mSequenceId;
146    private final long mFrameNumber;
147
148    /**
149     * Takes ownership of the passed-in properties object
150     *
151     * <p>For internal use only</p>
152     * @hide
153     */
154    public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
155            CaptureResultExtras extras) {
156        if (results == null) {
157            throw new IllegalArgumentException("results was null");
158        }
159
160        if (parent == null) {
161            throw new IllegalArgumentException("parent was null");
162        }
163
164        if (extras == null) {
165            throw new IllegalArgumentException("extras was null");
166        }
167
168        mResults = CameraMetadataNative.move(results);
169        if (mResults.isEmpty()) {
170            throw new AssertionError("Results must not be empty");
171        }
172        mRequest = parent;
173        mSequenceId = extras.getRequestId();
174        mFrameNumber = extras.getFrameNumber();
175    }
176
177    /**
178     * Returns a copy of the underlying {@link CameraMetadataNative}.
179     * @hide
180     */
181    public CameraMetadataNative getNativeCopy() {
182        return new CameraMetadataNative(mResults);
183    }
184
185    /**
186     * Creates a request-less result.
187     *
188     * <p><strong>For testing only.</strong></p>
189     * @hide
190     */
191    public CaptureResult(CameraMetadataNative results, int sequenceId) {
192        if (results == null) {
193            throw new IllegalArgumentException("results was null");
194        }
195
196        mResults = CameraMetadataNative.move(results);
197        if (mResults.isEmpty()) {
198            throw new AssertionError("Results must not be empty");
199        }
200
201        mRequest = null;
202        mSequenceId = sequenceId;
203        mFrameNumber = -1;
204    }
205
206    /**
207     * Get a capture result field value.
208     *
209     * <p>The field definitions can be found in {@link CaptureResult}.</p>
210     *
211     * <p>Querying the value for the same key more than once will return a value
212     * which is equal to the previous queried value.</p>
213     *
214     * @throws IllegalArgumentException if the key was not valid
215     *
216     * @param key The result field to read.
217     * @return The value of that key, or {@code null} if the field is not set.
218     */
219    public <T> T get(Key<T> key) {
220        T value = mResults.get(key);
221        if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
222        return value;
223    }
224
225    /**
226     * {@inheritDoc}
227     * @hide
228     */
229    @SuppressWarnings("unchecked")
230    @Override
231    protected <T> T getProtected(Key<?> key) {
232        return (T) mResults.get(key);
233    }
234
235    /**
236     * {@inheritDoc}
237     * @hide
238     */
239    @SuppressWarnings("unchecked")
240    @Override
241    protected Class<Key<?>> getKeyClass() {
242        Object thisClass = Key.class;
243        return (Class<Key<?>>)thisClass;
244    }
245
246    /**
247     * Dumps the native metadata contents to logcat.
248     *
249     * <p>Visibility for testing/debugging only. The results will not
250     * include any synthesized keys, as they are invisible to the native layer.</p>
251     *
252     * @hide
253     */
254    public void dumpToLog() {
255        mResults.dumpToLog();
256    }
257
258    /**
259     * {@inheritDoc}
260     */
261    @Override
262    public List<Key<?>> getKeys() {
263        // Force the javadoc for this function to show up on the CaptureResult page
264        return super.getKeys();
265    }
266
267    /**
268     * Get the request associated with this result.
269     *
270     * <p>Whenever a request has been fully or partially captured, with
271     * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or
272     * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s
273     * {@code getRequest()} will return that {@code request}.
274     * </p>
275     *
276     * <p>For example,
277     * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() {
278     *     {@literal @}Override
279     *     void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
280     *         assert(myResult.getRequest.equals(myRequest) == true);
281     *     }
282     * }, null);
283     * </code></pre>
284     * </p>
285     *
286     * @return The request associated with this result. Never {@code null}.
287     */
288    public CaptureRequest getRequest() {
289        return mRequest;
290    }
291
292    /**
293     * Get the frame number associated with this result.
294     *
295     * <p>Whenever a request has been processed, regardless of failure or success,
296     * it gets a unique frame number assigned to its future result/failure.</p>
297     *
298     * <p>This value monotonically increments, starting with 0,
299     * for every new result or failure; and the scope is the lifetime of the
300     * {@link CameraDevice}.</p>
301     *
302     * @return The frame number
303     */
304    public long getFrameNumber() {
305        return mFrameNumber;
306    }
307
308    /**
309     * The sequence ID for this failure that was returned by the
310     * {@link CameraCaptureSession#capture} family of functions.
311     *
312     * <p>The sequence ID is a unique monotonically increasing value starting from 0,
313     * incremented every time a new group of requests is submitted to the CameraDevice.</p>
314     *
315     * @return int The ID for the sequence of requests that this capture result is a part of
316     *
317     * @see CameraDevice.CaptureCallback#onCaptureSequenceCompleted
318     * @see CameraDevice.CaptureCallback#onCaptureSequenceAborted
319     */
320    public int getSequenceId() {
321        return mSequenceId;
322    }
323
324    /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
325     * The key entries below this point are generated from metadata
326     * definitions in /system/media/camera/docs. Do not modify by hand or
327     * modify the comment blocks at the start or end.
328     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
329
330    /**
331     * <p>The mode control selects how the image data is converted from the
332     * sensor's native color into linear sRGB color.</p>
333     * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this
334     * control is overridden by the AWB routine. When AWB is disabled, the
335     * application controls how the color mapping is performed.</p>
336     * <p>We define the expected processing pipeline below. For consistency
337     * across devices, this is always the case with TRANSFORM_MATRIX.</p>
338     * <p>When either FULL or HIGH_QUALITY is used, the camera device may
339     * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
340     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
341     * camera device (in the results) and be roughly correct.</p>
342     * <p>Switching to TRANSFORM_MATRIX and using the data provided from
343     * FAST or HIGH_QUALITY will yield a picture with the same white point
344     * as what was produced by the camera device in the earlier frame.</p>
345     * <p>The expected processing pipeline is as follows:</p>
346     * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
347     * <p>The white balance is encoded by two values, a 4-channel white-balance
348     * gain vector (applied in the Bayer domain), and a 3x3 color transform
349     * matrix (applied after demosaic).</p>
350     * <p>The 4-channel white-balance gains are defined as:</p>
351     * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
352     * </code></pre>
353     * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
354     * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
355     * These may be identical for a given camera device implementation; if
356     * the camera device does not support a separate gain for even/odd green
357     * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
358     * <code>G_even</code> in the output result metadata.</p>
359     * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
360     * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
361     * </code></pre>
362     * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
363     * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
364     * <p>with colors as follows:</p>
365     * <pre><code>r' = I0r + I1g + I2b
366     * g' = I3r + I4g + I5b
367     * b' = I6r + I7g + I8b
368     * </code></pre>
369     * <p>Both the input and output value ranges must match. Overflow/underflow
370     * values are clipped to fit within the range.</p>
371     * <p><b>Possible values:</b>
372     * <ul>
373     *   <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
374     *   <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
375     *   <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
376     * </ul></p>
377     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
378     * <p><b>Full capability</b> -
379     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
380     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
381     *
382     * @see CaptureRequest#COLOR_CORRECTION_GAINS
383     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
384     * @see CaptureRequest#CONTROL_AWB_MODE
385     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
386     * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
387     * @see #COLOR_CORRECTION_MODE_FAST
388     * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
389     */
390    @PublicKey
391    public static final Key<Integer> COLOR_CORRECTION_MODE =
392            new Key<Integer>("android.colorCorrection.mode", int.class);
393
394    /**
395     * <p>A color transform matrix to use to transform
396     * from sensor RGB color space to output linear sRGB color space.</p>
397     * <p>This matrix is either set by the camera device when the request
398     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
399     * directly by the application in the request when the
400     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
401     * <p>In the latter case, the camera device may round the matrix to account
402     * for precision issues; the final rounded matrix should be reported back
403     * in this matrix result metadata. The transform should keep the magnitude
404     * of the output color values within <code>[0, 1.0]</code> (assuming input color
405     * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
406     * <p><b>Units</b>: Unitless scale factors</p>
407     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
408     * <p><b>Full capability</b> -
409     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
410     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
411     *
412     * @see CaptureRequest#COLOR_CORRECTION_MODE
413     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
414     */
415    @PublicKey
416    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
417            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
418
419    /**
420     * <p>Gains applying to Bayer raw color channels for
421     * white-balance.</p>
422     * <p>These per-channel gains are either set by the camera device
423     * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
424     * TRANSFORM_MATRIX, or directly by the application in the
425     * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
426     * TRANSFORM_MATRIX.</p>
427     * <p>The gains in the result metadata are the gains actually
428     * applied by the camera device to the current frame.</p>
429     * <p><b>Units</b>: Unitless gain factors</p>
430     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
431     * <p><b>Full capability</b> -
432     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
433     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
434     *
435     * @see CaptureRequest#COLOR_CORRECTION_MODE
436     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
437     */
438    @PublicKey
439    public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
440            new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
441
442    /**
443     * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
444     * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
445     * can not focus on the same point after exiting from the lens. This metadata defines
446     * the high level control of chromatic aberration correction algorithm, which aims to
447     * minimize the chromatic artifacts that may occur along the object boundaries in an
448     * image.</p>
449     * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
450     * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
451     * use the highest-quality aberration correction algorithms, even if it slows down
452     * capture rate. FAST means the camera device will not slow down capture rate when
453     * applying aberration correction.</p>
454     * <p>LEGACY devices will always be in FAST mode.</p>
455     * <p><b>Possible values:</b>
456     * <ul>
457     *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
458     *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
459     *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
460     * </ul></p>
461     * <p><b>Available values for this device:</b><br>
462     * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
463     * <p>This key is available on all devices.</p>
464     *
465     * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
466     * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
467     * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
468     * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
469     */
470    @PublicKey
471    public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
472            new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
473
474    /**
475     * <p>The desired setting for the camera device's auto-exposure
476     * algorithm's antibanding compensation.</p>
477     * <p>Some kinds of lighting fixtures, such as some fluorescent
478     * lights, flicker at the rate of the power supply frequency
479     * (60Hz or 50Hz, depending on country). While this is
480     * typically not noticeable to a person, it can be visible to
481     * a camera device. If a camera sets its exposure time to the
482     * wrong value, the flicker may become visible in the
483     * viewfinder as flicker or in a final captured image, as a
484     * set of variable-brightness bands across the image.</p>
485     * <p>Therefore, the auto-exposure routines of camera devices
486     * include antibanding routines that ensure that the chosen
487     * exposure value will not cause such banding. The choice of
488     * exposure time depends on the rate of flicker, which the
489     * camera device can detect automatically, or the expected
490     * rate can be selected by the application using this
491     * control.</p>
492     * <p>A given camera device may not support all of the possible
493     * options for the antibanding mode. The
494     * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
495     * the available modes for a given camera device.</p>
496     * <p>The default mode is AUTO, which is supported by all
497     * camera devices.</p>
498     * <p>If manual exposure control is enabled (by setting
499     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
500     * then this setting has no effect, and the application must
501     * ensure it selects exposure times that do not cause banding
502     * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
503     * the application in this.</p>
504     * <p><b>Possible values:</b>
505     * <ul>
506     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
507     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
508     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
509     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
510     * </ul></p>
511     * <p><b>Available values for this device:</b><br></p>
512     * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
513     * <p>This key is available on all devices.</p>
514     *
515     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
516     * @see CaptureRequest#CONTROL_AE_MODE
517     * @see CaptureRequest#CONTROL_MODE
518     * @see CaptureResult#STATISTICS_SCENE_FLICKER
519     * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
520     * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
521     * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
522     * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
523     */
524    @PublicKey
525    public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
526            new Key<Integer>("android.control.aeAntibandingMode", int.class);
527
528    /**
529     * <p>Adjustment to auto-exposure (AE) target image
530     * brightness.</p>
531     * <p>The adjustment is measured as a count of steps, with the
532     * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
533     * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
534     * <p>For example, if the exposure value (EV) step is 0.333, '6'
535     * will mean an exposure compensation of +2 EV; -3 will mean an
536     * exposure compensation of -1 EV. One EV represents a doubling
537     * of image brightness. Note that this control will only be
538     * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
539     * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p>
540     * <p>In the event of exposure compensation value being changed, camera device
541     * may take several frames to reach the newly requested exposure target.
542     * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
543     * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
544     * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
545     * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
546     * <p><b>Units</b>: Compensation steps</p>
547     * <p><b>Range of valid values:</b><br>
548     * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
549     * <p>This key is available on all devices.</p>
550     *
551     * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
552     * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
553     * @see CaptureRequest#CONTROL_AE_LOCK
554     * @see CaptureRequest#CONTROL_AE_MODE
555     * @see CaptureResult#CONTROL_AE_STATE
556     */
557    @PublicKey
558    public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
559            new Key<Integer>("android.control.aeExposureCompensation", int.class);
560
561    /**
562     * <p>Whether auto-exposure (AE) is currently locked to its latest
563     * calculated values.</p>
564     * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
565     * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
566     * <p>Note that even when AE is locked, the flash may be fired if
567     * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
568     * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
569     * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
570     * is ON, the camera device will still adjust its exposure value.</p>
571     * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
572     * when AE is already locked, the camera device will not change the exposure time
573     * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
574     * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
575     * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
576     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
577     * <p>Since the camera device has a pipeline of in-flight requests, the settings that
578     * get locked do not necessarily correspond to the settings that were present in the
579     * latest capture result received from the camera device, since additional captures
580     * and AE updates may have occurred even before the result was sent out. If an
581     * application is switching between automatic and manual control and wishes to eliminate
582     * any flicker during the switch, the following procedure is recommended:</p>
583     * <ol>
584     * <li>Starting in auto-AE mode:</li>
585     * <li>Lock AE</li>
586     * <li>Wait for the first result to be output that has the AE locked</li>
587     * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
588     * <li>Submit the capture request, proceed to run manual AE as desired.</li>
589     * </ol>
590     * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
591     * <p>This key is available on all devices.</p>
592     *
593     * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
594     * @see CaptureRequest#CONTROL_AE_MODE
595     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
596     * @see CaptureResult#CONTROL_AE_STATE
597     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
598     * @see CaptureRequest#SENSOR_SENSITIVITY
599     */
600    @PublicKey
601    public static final Key<Boolean> CONTROL_AE_LOCK =
602            new Key<Boolean>("android.control.aeLock", boolean.class);
603
604    /**
605     * <p>The desired mode for the camera device's
606     * auto-exposure routine.</p>
607     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
608     * AUTO.</p>
609     * <p>When set to any of the ON modes, the camera device's
610     * auto-exposure routine is enabled, overriding the
611     * application's selected exposure time, sensor sensitivity,
612     * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
613     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
614     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
615     * is selected, the camera device's flash unit controls are
616     * also overridden.</p>
617     * <p>The FLASH modes are only available if the camera device
618     * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
619     * <p>If flash TORCH mode is desired, this field must be set to
620     * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
621     * <p>When set to any of the ON modes, the values chosen by the
622     * camera device auto-exposure routine for the overridden
623     * fields for a given capture will be available in its
624     * CaptureResult.</p>
625     * <p><b>Possible values:</b>
626     * <ul>
627     *   <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
628     *   <li>{@link #CONTROL_AE_MODE_ON ON}</li>
629     *   <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
630     *   <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
631     *   <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
632     * </ul></p>
633     * <p><b>Available values for this device:</b><br>
634     * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
635     * <p>This key is available on all devices.</p>
636     *
637     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
638     * @see CaptureRequest#CONTROL_MODE
639     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
640     * @see CaptureRequest#FLASH_MODE
641     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
642     * @see CaptureRequest#SENSOR_FRAME_DURATION
643     * @see CaptureRequest#SENSOR_SENSITIVITY
644     * @see #CONTROL_AE_MODE_OFF
645     * @see #CONTROL_AE_MODE_ON
646     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
647     * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
648     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
649     */
650    @PublicKey
651    public static final Key<Integer> CONTROL_AE_MODE =
652            new Key<Integer>("android.control.aeMode", int.class);
653
654    /**
655     * <p>List of metering areas to use for auto-exposure adjustment.</p>
656     * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
657     * Otherwise will always be present.</p>
658     * <p>The maximum number of regions supported by the device is determined by the value
659     * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
660     * <p>The coordinate system is based on the active pixel array,
661     * with (0,0) being the top-left pixel in the active pixel array, and
662     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
663     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
664     * bottom-right pixel in the active pixel array.</p>
665     * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
666     * for every pixel in the area. This means that a large metering area
667     * with the same weight as a smaller area will have more effect in
668     * the metering result. Metering areas can partially overlap and the
669     * camera device will add the weights in the overlap region.</p>
670     * <p>The weights are relative to weights of other exposure metering regions, so if only one
671     * region is used, all non-zero weights will have the same effect. A region with 0
672     * weight is ignored.</p>
673     * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
674     * camera device.</p>
675     * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
676     * capture result metadata, the camera device will ignore the sections outside the crop
677     * region and output only the intersection rectangle as the metering region in the result
678     * metadata.  If the region is entirely outside the crop region, it will be ignored and
679     * not reported in the result metadata.</p>
680     * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
681     * <p><b>Range of valid values:</b><br>
682     * Coordinates must be between <code>[(0,0), (width, height))</code> of
683     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
684     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
685     *
686     * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
687     * @see CaptureRequest#SCALER_CROP_REGION
688     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
689     */
690    @PublicKey
691    public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
692            new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
693
694    /**
695     * <p>Range over which the auto-exposure routine can
696     * adjust the capture frame rate to maintain good
697     * exposure.</p>
698     * <p>Only constrains auto-exposure (AE) algorithm, not
699     * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
700     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
701     * <p><b>Units</b>: Frames per second (FPS)</p>
702     * <p><b>Range of valid values:</b><br>
703     * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
704     * <p>This key is available on all devices.</p>
705     *
706     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
707     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
708     * @see CaptureRequest#SENSOR_FRAME_DURATION
709     */
710    @PublicKey
711    public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
712            new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
713
714    /**
715     * <p>Whether the camera device will trigger a precapture
716     * metering sequence when it processes this request.</p>
717     * <p>This entry is normally set to IDLE, or is not
718     * included at all in the request settings. When included and
719     * set to START, the camera device will trigger the autoexposure
720     * precapture metering sequence.</p>
721     * <p>The precapture sequence should triggered before starting a
722     * high-quality still capture for final metering decisions to
723     * be made, and for firing pre-capture flash pulses to estimate
724     * scene brightness and required final capture flash power, when
725     * the flash is enabled.</p>
726     * <p>Normally, this entry should be set to START for only a
727     * single request, and the application should wait until the
728     * sequence completes before starting a new one.</p>
729     * <p>The exact effect of auto-exposure (AE) precapture trigger
730     * depends on the current AE mode and state; see
731     * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
732     * details.</p>
733     * <p>On LEGACY-level devices, the precapture trigger is not supported;
734     * capturing a high-resolution JPEG image will automatically trigger a
735     * precapture sequence before the high-resolution capture, including
736     * potentially firing a pre-capture flash.</p>
737     * <p><b>Possible values:</b>
738     * <ul>
739     *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
740     *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
741     * </ul></p>
742     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
743     * <p><b>Limited capability</b> -
744     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
745     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
746     *
747     * @see CaptureResult#CONTROL_AE_STATE
748     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
749     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
750     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
751     */
752    @PublicKey
753    public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
754            new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
755
756    /**
757     * <p>Current state of the auto-exposure (AE) algorithm.</p>
758     * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
759     * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
760     * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
761     * the algorithm states to INACTIVE.</p>
762     * <p>The camera device can do several state transitions between two results, if it is
763     * allowed by the state transition table. For example: INACTIVE may never actually be
764     * seen in a result.</p>
765     * <p>The state in the result is the state for this image (in sync with this image): if
766     * AE state becomes CONVERGED, then the image data associated with this result should
767     * be good to use.</p>
768     * <p>Below are state transition tables for different AE modes.</p>
769     * <table>
770     * <thead>
771     * <tr>
772     * <th align="center">State</th>
773     * <th align="center">Transition Cause</th>
774     * <th align="center">New State</th>
775     * <th align="center">Notes</th>
776     * </tr>
777     * </thead>
778     * <tbody>
779     * <tr>
780     * <td align="center">INACTIVE</td>
781     * <td align="center"></td>
782     * <td align="center">INACTIVE</td>
783     * <td align="center">Camera device auto exposure algorithm is disabled</td>
784     * </tr>
785     * </tbody>
786     * </table>
787     * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
788     * <table>
789     * <thead>
790     * <tr>
791     * <th align="center">State</th>
792     * <th align="center">Transition Cause</th>
793     * <th align="center">New State</th>
794     * <th align="center">Notes</th>
795     * </tr>
796     * </thead>
797     * <tbody>
798     * <tr>
799     * <td align="center">INACTIVE</td>
800     * <td align="center">Camera device initiates AE scan</td>
801     * <td align="center">SEARCHING</td>
802     * <td align="center">Values changing</td>
803     * </tr>
804     * <tr>
805     * <td align="center">INACTIVE</td>
806     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
807     * <td align="center">LOCKED</td>
808     * <td align="center">Values locked</td>
809     * </tr>
810     * <tr>
811     * <td align="center">SEARCHING</td>
812     * <td align="center">Camera device finishes AE scan</td>
813     * <td align="center">CONVERGED</td>
814     * <td align="center">Good values, not changing</td>
815     * </tr>
816     * <tr>
817     * <td align="center">SEARCHING</td>
818     * <td align="center">Camera device finishes AE scan</td>
819     * <td align="center">FLASH_REQUIRED</td>
820     * <td align="center">Converged but too dark w/o flash</td>
821     * </tr>
822     * <tr>
823     * <td align="center">SEARCHING</td>
824     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
825     * <td align="center">LOCKED</td>
826     * <td align="center">Values locked</td>
827     * </tr>
828     * <tr>
829     * <td align="center">CONVERGED</td>
830     * <td align="center">Camera device initiates AE scan</td>
831     * <td align="center">SEARCHING</td>
832     * <td align="center">Values changing</td>
833     * </tr>
834     * <tr>
835     * <td align="center">CONVERGED</td>
836     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
837     * <td align="center">LOCKED</td>
838     * <td align="center">Values locked</td>
839     * </tr>
840     * <tr>
841     * <td align="center">FLASH_REQUIRED</td>
842     * <td align="center">Camera device initiates AE scan</td>
843     * <td align="center">SEARCHING</td>
844     * <td align="center">Values changing</td>
845     * </tr>
846     * <tr>
847     * <td align="center">FLASH_REQUIRED</td>
848     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
849     * <td align="center">LOCKED</td>
850     * <td align="center">Values locked</td>
851     * </tr>
852     * <tr>
853     * <td align="center">LOCKED</td>
854     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
855     * <td align="center">SEARCHING</td>
856     * <td align="center">Values not good after unlock</td>
857     * </tr>
858     * <tr>
859     * <td align="center">LOCKED</td>
860     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
861     * <td align="center">CONVERGED</td>
862     * <td align="center">Values good after unlock</td>
863     * </tr>
864     * <tr>
865     * <td align="center">LOCKED</td>
866     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
867     * <td align="center">FLASH_REQUIRED</td>
868     * <td align="center">Exposure good, but too dark</td>
869     * </tr>
870     * <tr>
871     * <td align="center">PRECAPTURE</td>
872     * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
873     * <td align="center">CONVERGED</td>
874     * <td align="center">Ready for high-quality capture</td>
875     * </tr>
876     * <tr>
877     * <td align="center">PRECAPTURE</td>
878     * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
879     * <td align="center">LOCKED</td>
880     * <td align="center">Ready for high-quality capture</td>
881     * </tr>
882     * <tr>
883     * <td align="center">Any state</td>
884     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
885     * <td align="center">PRECAPTURE</td>
886     * <td align="center">Start AE precapture metering sequence</td>
887     * </tr>
888     * </tbody>
889     * </table>
890     * <p>For the above table, the camera device may skip reporting any state changes that happen
891     * without application intervention (i.e. mode switch, trigger, locking). Any state that
892     * can be skipped in that manner is called a transient state.</p>
893     * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
894     * listed in above table, it is also legal for the camera device to skip one or more
895     * transient states between two results. See below table for examples:</p>
896     * <table>
897     * <thead>
898     * <tr>
899     * <th align="center">State</th>
900     * <th align="center">Transition Cause</th>
901     * <th align="center">New State</th>
902     * <th align="center">Notes</th>
903     * </tr>
904     * </thead>
905     * <tbody>
906     * <tr>
907     * <td align="center">INACTIVE</td>
908     * <td align="center">Camera device finished AE scan</td>
909     * <td align="center">CONVERGED</td>
910     * <td align="center">Values are already good, transient states are skipped by camera device.</td>
911     * </tr>
912     * <tr>
913     * <td align="center">Any state</td>
914     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
915     * <td align="center">FLASH_REQUIRED</td>
916     * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
917     * </tr>
918     * <tr>
919     * <td align="center">Any state</td>
920     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
921     * <td align="center">CONVERGED</td>
922     * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
923     * </tr>
924     * <tr>
925     * <td align="center">CONVERGED</td>
926     * <td align="center">Camera device finished AE scan</td>
927     * <td align="center">FLASH_REQUIRED</td>
928     * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
929     * </tr>
930     * <tr>
931     * <td align="center">FLASH_REQUIRED</td>
932     * <td align="center">Camera device finished AE scan</td>
933     * <td align="center">CONVERGED</td>
934     * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
935     * </tr>
936     * </tbody>
937     * </table>
938     * <p><b>Possible values:</b>
939     * <ul>
940     *   <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
941     *   <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
942     *   <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
943     *   <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
944     *   <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
945     *   <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
946     * </ul></p>
947     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
948     * <p><b>Limited capability</b> -
949     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
950     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
951     *
952     * @see CaptureRequest#CONTROL_AE_LOCK
953     * @see CaptureRequest#CONTROL_AE_MODE
954     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
955     * @see CaptureRequest#CONTROL_MODE
956     * @see CaptureRequest#CONTROL_SCENE_MODE
957     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
958     * @see #CONTROL_AE_STATE_INACTIVE
959     * @see #CONTROL_AE_STATE_SEARCHING
960     * @see #CONTROL_AE_STATE_CONVERGED
961     * @see #CONTROL_AE_STATE_LOCKED
962     * @see #CONTROL_AE_STATE_FLASH_REQUIRED
963     * @see #CONTROL_AE_STATE_PRECAPTURE
964     */
965    @PublicKey
966    public static final Key<Integer> CONTROL_AE_STATE =
967            new Key<Integer>("android.control.aeState", int.class);
968
969    /**
970     * <p>Whether auto-focus (AF) is currently enabled, and what
971     * mode it is set to.</p>
972     * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
973     * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
974     * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
975     * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
976     * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p>
977     * <p>If the lens is controlled by the camera device auto-focus algorithm,
978     * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
979     * in result metadata.</p>
980     * <p><b>Possible values:</b>
981     * <ul>
982     *   <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
983     *   <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
984     *   <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
985     *   <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
986     *   <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
987     *   <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
988     * </ul></p>
989     * <p><b>Available values for this device:</b><br>
990     * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
991     * <p>This key is available on all devices.</p>
992     *
993     * @see CaptureRequest#CONTROL_AE_MODE
994     * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
995     * @see CaptureResult#CONTROL_AF_STATE
996     * @see CaptureRequest#CONTROL_AF_TRIGGER
997     * @see CaptureRequest#CONTROL_MODE
998     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
999     * @see #CONTROL_AF_MODE_OFF
1000     * @see #CONTROL_AF_MODE_AUTO
1001     * @see #CONTROL_AF_MODE_MACRO
1002     * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1003     * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1004     * @see #CONTROL_AF_MODE_EDOF
1005     */
1006    @PublicKey
1007    public static final Key<Integer> CONTROL_AF_MODE =
1008            new Key<Integer>("android.control.afMode", int.class);
1009
1010    /**
1011     * <p>List of metering areas to use for auto-focus.</p>
1012     * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
1013     * Otherwise will always be present.</p>
1014     * <p>The maximum number of focus areas supported by the device is determined by the value
1015     * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
1016     * <p>The coordinate system is based on the active pixel array,
1017     * with (0,0) being the top-left pixel in the active pixel array, and
1018     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1019     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
1020     * bottom-right pixel in the active pixel array.</p>
1021     * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
1022     * for every pixel in the area. This means that a large metering area
1023     * with the same weight as a smaller area will have more effect in
1024     * the metering result. Metering areas can partially overlap and the
1025     * camera device will add the weights in the overlap region.</p>
1026     * <p>The weights are relative to weights of other metering regions, so if only one region
1027     * is used, all non-zero weights will have the same effect. A region with 0 weight is
1028     * ignored.</p>
1029     * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1030     * camera device.</p>
1031     * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1032     * capture result metadata, the camera device will ignore the sections outside the crop
1033     * region and output only the intersection rectangle as the metering region in the result
1034     * metadata. If the region is entirely outside the crop region, it will be ignored and
1035     * not reported in the result metadata.</p>
1036     * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1037     * <p><b>Range of valid values:</b><br>
1038     * Coordinates must be between <code>[(0,0), (width, height))</code> of
1039     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1040     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1041     *
1042     * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
1043     * @see CaptureRequest#SCALER_CROP_REGION
1044     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1045     */
1046    @PublicKey
1047    public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1048            new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
1049
1050    /**
1051     * <p>Whether the camera device will trigger autofocus for this request.</p>
1052     * <p>This entry is normally set to IDLE, or is not
1053     * included at all in the request settings.</p>
1054     * <p>When included and set to START, the camera device will trigger the
1055     * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1056     * <p>When set to CANCEL, the camera device will cancel any active trigger,
1057     * and return to its initial AF state.</p>
1058     * <p>Generally, applications should set this entry to START or CANCEL for only a
1059     * single capture, and then return it to IDLE (or not set at all). Specifying
1060     * START for multiple captures in a row means restarting the AF operation over
1061     * and over again.</p>
1062     * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
1063     * <p><b>Possible values:</b>
1064     * <ul>
1065     *   <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1066     *   <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1067     *   <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1068     * </ul></p>
1069     * <p>This key is available on all devices.</p>
1070     *
1071     * @see CaptureResult#CONTROL_AF_STATE
1072     * @see #CONTROL_AF_TRIGGER_IDLE
1073     * @see #CONTROL_AF_TRIGGER_START
1074     * @see #CONTROL_AF_TRIGGER_CANCEL
1075     */
1076    @PublicKey
1077    public static final Key<Integer> CONTROL_AF_TRIGGER =
1078            new Key<Integer>("android.control.afTrigger", int.class);
1079
1080    /**
1081     * <p>Current state of auto-focus (AF) algorithm.</p>
1082     * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1083     * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1084     * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1085     * the algorithm states to INACTIVE.</p>
1086     * <p>The camera device can do several state transitions between two results, if it is
1087     * allowed by the state transition table. For example: INACTIVE may never actually be
1088     * seen in a result.</p>
1089     * <p>The state in the result is the state for this image (in sync with this image): if
1090     * AF state becomes FOCUSED, then the image data associated with this result should
1091     * be sharp.</p>
1092     * <p>Below are state transition tables for different AF modes.</p>
1093     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1094     * <table>
1095     * <thead>
1096     * <tr>
1097     * <th align="center">State</th>
1098     * <th align="center">Transition Cause</th>
1099     * <th align="center">New State</th>
1100     * <th align="center">Notes</th>
1101     * </tr>
1102     * </thead>
1103     * <tbody>
1104     * <tr>
1105     * <td align="center">INACTIVE</td>
1106     * <td align="center"></td>
1107     * <td align="center">INACTIVE</td>
1108     * <td align="center">Never changes</td>
1109     * </tr>
1110     * </tbody>
1111     * </table>
1112     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1113     * <table>
1114     * <thead>
1115     * <tr>
1116     * <th align="center">State</th>
1117     * <th align="center">Transition Cause</th>
1118     * <th align="center">New State</th>
1119     * <th align="center">Notes</th>
1120     * </tr>
1121     * </thead>
1122     * <tbody>
1123     * <tr>
1124     * <td align="center">INACTIVE</td>
1125     * <td align="center">AF_TRIGGER</td>
1126     * <td align="center">ACTIVE_SCAN</td>
1127     * <td align="center">Start AF sweep, Lens now moving</td>
1128     * </tr>
1129     * <tr>
1130     * <td align="center">ACTIVE_SCAN</td>
1131     * <td align="center">AF sweep done</td>
1132     * <td align="center">FOCUSED_LOCKED</td>
1133     * <td align="center">Focused, Lens now locked</td>
1134     * </tr>
1135     * <tr>
1136     * <td align="center">ACTIVE_SCAN</td>
1137     * <td align="center">AF sweep done</td>
1138     * <td align="center">NOT_FOCUSED_LOCKED</td>
1139     * <td align="center">Not focused, Lens now locked</td>
1140     * </tr>
1141     * <tr>
1142     * <td align="center">ACTIVE_SCAN</td>
1143     * <td align="center">AF_CANCEL</td>
1144     * <td align="center">INACTIVE</td>
1145     * <td align="center">Cancel/reset AF, Lens now locked</td>
1146     * </tr>
1147     * <tr>
1148     * <td align="center">FOCUSED_LOCKED</td>
1149     * <td align="center">AF_CANCEL</td>
1150     * <td align="center">INACTIVE</td>
1151     * <td align="center">Cancel/reset AF</td>
1152     * </tr>
1153     * <tr>
1154     * <td align="center">FOCUSED_LOCKED</td>
1155     * <td align="center">AF_TRIGGER</td>
1156     * <td align="center">ACTIVE_SCAN</td>
1157     * <td align="center">Start new sweep, Lens now moving</td>
1158     * </tr>
1159     * <tr>
1160     * <td align="center">NOT_FOCUSED_LOCKED</td>
1161     * <td align="center">AF_CANCEL</td>
1162     * <td align="center">INACTIVE</td>
1163     * <td align="center">Cancel/reset AF</td>
1164     * </tr>
1165     * <tr>
1166     * <td align="center">NOT_FOCUSED_LOCKED</td>
1167     * <td align="center">AF_TRIGGER</td>
1168     * <td align="center">ACTIVE_SCAN</td>
1169     * <td align="center">Start new sweep, Lens now moving</td>
1170     * </tr>
1171     * <tr>
1172     * <td align="center">Any state</td>
1173     * <td align="center">Mode change</td>
1174     * <td align="center">INACTIVE</td>
1175     * <td align="center"></td>
1176     * </tr>
1177     * </tbody>
1178     * </table>
1179     * <p>For the above table, the camera device may skip reporting any state changes that happen
1180     * without application intervention (i.e. mode switch, trigger, locking). Any state that
1181     * can be skipped in that manner is called a transient state.</p>
1182     * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1183     * state transitions listed in above table, it is also legal for the camera device to skip
1184     * one or more transient states between two results. See below table for examples:</p>
1185     * <table>
1186     * <thead>
1187     * <tr>
1188     * <th align="center">State</th>
1189     * <th align="center">Transition Cause</th>
1190     * <th align="center">New State</th>
1191     * <th align="center">Notes</th>
1192     * </tr>
1193     * </thead>
1194     * <tbody>
1195     * <tr>
1196     * <td align="center">INACTIVE</td>
1197     * <td align="center">AF_TRIGGER</td>
1198     * <td align="center">FOCUSED_LOCKED</td>
1199     * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1200     * </tr>
1201     * <tr>
1202     * <td align="center">INACTIVE</td>
1203     * <td align="center">AF_TRIGGER</td>
1204     * <td align="center">NOT_FOCUSED_LOCKED</td>
1205     * <td align="center">Focus failed after a scan, lens is now locked.</td>
1206     * </tr>
1207     * <tr>
1208     * <td align="center">FOCUSED_LOCKED</td>
1209     * <td align="center">AF_TRIGGER</td>
1210     * <td align="center">FOCUSED_LOCKED</td>
1211     * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1212     * </tr>
1213     * <tr>
1214     * <td align="center">NOT_FOCUSED_LOCKED</td>
1215     * <td align="center">AF_TRIGGER</td>
1216     * <td align="center">FOCUSED_LOCKED</td>
1217     * <td align="center">Focus is good after a scan, lens is not locked.</td>
1218     * </tr>
1219     * </tbody>
1220     * </table>
1221     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1222     * <table>
1223     * <thead>
1224     * <tr>
1225     * <th align="center">State</th>
1226     * <th align="center">Transition Cause</th>
1227     * <th align="center">New State</th>
1228     * <th align="center">Notes</th>
1229     * </tr>
1230     * </thead>
1231     * <tbody>
1232     * <tr>
1233     * <td align="center">INACTIVE</td>
1234     * <td align="center">Camera device initiates new scan</td>
1235     * <td align="center">PASSIVE_SCAN</td>
1236     * <td align="center">Start AF scan, Lens now moving</td>
1237     * </tr>
1238     * <tr>
1239     * <td align="center">INACTIVE</td>
1240     * <td align="center">AF_TRIGGER</td>
1241     * <td align="center">NOT_FOCUSED_LOCKED</td>
1242     * <td align="center">AF state query, Lens now locked</td>
1243     * </tr>
1244     * <tr>
1245     * <td align="center">PASSIVE_SCAN</td>
1246     * <td align="center">Camera device completes current scan</td>
1247     * <td align="center">PASSIVE_FOCUSED</td>
1248     * <td align="center">End AF scan, Lens now locked</td>
1249     * </tr>
1250     * <tr>
1251     * <td align="center">PASSIVE_SCAN</td>
1252     * <td align="center">Camera device fails current scan</td>
1253     * <td align="center">PASSIVE_UNFOCUSED</td>
1254     * <td align="center">End AF scan, Lens now locked</td>
1255     * </tr>
1256     * <tr>
1257     * <td align="center">PASSIVE_SCAN</td>
1258     * <td align="center">AF_TRIGGER</td>
1259     * <td align="center">FOCUSED_LOCKED</td>
1260     * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
1261     * </tr>
1262     * <tr>
1263     * <td align="center">PASSIVE_SCAN</td>
1264     * <td align="center">AF_TRIGGER</td>
1265     * <td align="center">NOT_FOCUSED_LOCKED</td>
1266     * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
1267     * </tr>
1268     * <tr>
1269     * <td align="center">PASSIVE_SCAN</td>
1270     * <td align="center">AF_CANCEL</td>
1271     * <td align="center">INACTIVE</td>
1272     * <td align="center">Reset lens position, Lens now locked</td>
1273     * </tr>
1274     * <tr>
1275     * <td align="center">PASSIVE_FOCUSED</td>
1276     * <td align="center">Camera device initiates new scan</td>
1277     * <td align="center">PASSIVE_SCAN</td>
1278     * <td align="center">Start AF scan, Lens now moving</td>
1279     * </tr>
1280     * <tr>
1281     * <td align="center">PASSIVE_UNFOCUSED</td>
1282     * <td align="center">Camera device initiates new scan</td>
1283     * <td align="center">PASSIVE_SCAN</td>
1284     * <td align="center">Start AF scan, Lens now moving</td>
1285     * </tr>
1286     * <tr>
1287     * <td align="center">PASSIVE_FOCUSED</td>
1288     * <td align="center">AF_TRIGGER</td>
1289     * <td align="center">FOCUSED_LOCKED</td>
1290     * <td align="center">Immediate transition, lens now locked</td>
1291     * </tr>
1292     * <tr>
1293     * <td align="center">PASSIVE_UNFOCUSED</td>
1294     * <td align="center">AF_TRIGGER</td>
1295     * <td align="center">NOT_FOCUSED_LOCKED</td>
1296     * <td align="center">Immediate transition, lens now locked</td>
1297     * </tr>
1298     * <tr>
1299     * <td align="center">FOCUSED_LOCKED</td>
1300     * <td align="center">AF_TRIGGER</td>
1301     * <td align="center">FOCUSED_LOCKED</td>
1302     * <td align="center">No effect</td>
1303     * </tr>
1304     * <tr>
1305     * <td align="center">FOCUSED_LOCKED</td>
1306     * <td align="center">AF_CANCEL</td>
1307     * <td align="center">INACTIVE</td>
1308     * <td align="center">Restart AF scan</td>
1309     * </tr>
1310     * <tr>
1311     * <td align="center">NOT_FOCUSED_LOCKED</td>
1312     * <td align="center">AF_TRIGGER</td>
1313     * <td align="center">NOT_FOCUSED_LOCKED</td>
1314     * <td align="center">No effect</td>
1315     * </tr>
1316     * <tr>
1317     * <td align="center">NOT_FOCUSED_LOCKED</td>
1318     * <td align="center">AF_CANCEL</td>
1319     * <td align="center">INACTIVE</td>
1320     * <td align="center">Restart AF scan</td>
1321     * </tr>
1322     * </tbody>
1323     * </table>
1324     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1325     * <table>
1326     * <thead>
1327     * <tr>
1328     * <th align="center">State</th>
1329     * <th align="center">Transition Cause</th>
1330     * <th align="center">New State</th>
1331     * <th align="center">Notes</th>
1332     * </tr>
1333     * </thead>
1334     * <tbody>
1335     * <tr>
1336     * <td align="center">INACTIVE</td>
1337     * <td align="center">Camera device initiates new scan</td>
1338     * <td align="center">PASSIVE_SCAN</td>
1339     * <td align="center">Start AF scan, Lens now moving</td>
1340     * </tr>
1341     * <tr>
1342     * <td align="center">INACTIVE</td>
1343     * <td align="center">AF_TRIGGER</td>
1344     * <td align="center">NOT_FOCUSED_LOCKED</td>
1345     * <td align="center">AF state query, Lens now locked</td>
1346     * </tr>
1347     * <tr>
1348     * <td align="center">PASSIVE_SCAN</td>
1349     * <td align="center">Camera device completes current scan</td>
1350     * <td align="center">PASSIVE_FOCUSED</td>
1351     * <td align="center">End AF scan, Lens now locked</td>
1352     * </tr>
1353     * <tr>
1354     * <td align="center">PASSIVE_SCAN</td>
1355     * <td align="center">Camera device fails current scan</td>
1356     * <td align="center">PASSIVE_UNFOCUSED</td>
1357     * <td align="center">End AF scan, Lens now locked</td>
1358     * </tr>
1359     * <tr>
1360     * <td align="center">PASSIVE_SCAN</td>
1361     * <td align="center">AF_TRIGGER</td>
1362     * <td align="center">FOCUSED_LOCKED</td>
1363     * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
1364     * </tr>
1365     * <tr>
1366     * <td align="center">PASSIVE_SCAN</td>
1367     * <td align="center">AF_TRIGGER</td>
1368     * <td align="center">NOT_FOCUSED_LOCKED</td>
1369     * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
1370     * </tr>
1371     * <tr>
1372     * <td align="center">PASSIVE_SCAN</td>
1373     * <td align="center">AF_CANCEL</td>
1374     * <td align="center">INACTIVE</td>
1375     * <td align="center">Reset lens position, Lens now locked</td>
1376     * </tr>
1377     * <tr>
1378     * <td align="center">PASSIVE_FOCUSED</td>
1379     * <td align="center">Camera device initiates new scan</td>
1380     * <td align="center">PASSIVE_SCAN</td>
1381     * <td align="center">Start AF scan, Lens now moving</td>
1382     * </tr>
1383     * <tr>
1384     * <td align="center">PASSIVE_UNFOCUSED</td>
1385     * <td align="center">Camera device initiates new scan</td>
1386     * <td align="center">PASSIVE_SCAN</td>
1387     * <td align="center">Start AF scan, Lens now moving</td>
1388     * </tr>
1389     * <tr>
1390     * <td align="center">PASSIVE_FOCUSED</td>
1391     * <td align="center">AF_TRIGGER</td>
1392     * <td align="center">FOCUSED_LOCKED</td>
1393     * <td align="center">Immediate trans. Lens now locked</td>
1394     * </tr>
1395     * <tr>
1396     * <td align="center">PASSIVE_UNFOCUSED</td>
1397     * <td align="center">AF_TRIGGER</td>
1398     * <td align="center">NOT_FOCUSED_LOCKED</td>
1399     * <td align="center">Immediate trans. Lens now locked</td>
1400     * </tr>
1401     * <tr>
1402     * <td align="center">FOCUSED_LOCKED</td>
1403     * <td align="center">AF_TRIGGER</td>
1404     * <td align="center">FOCUSED_LOCKED</td>
1405     * <td align="center">No effect</td>
1406     * </tr>
1407     * <tr>
1408     * <td align="center">FOCUSED_LOCKED</td>
1409     * <td align="center">AF_CANCEL</td>
1410     * <td align="center">INACTIVE</td>
1411     * <td align="center">Restart AF scan</td>
1412     * </tr>
1413     * <tr>
1414     * <td align="center">NOT_FOCUSED_LOCKED</td>
1415     * <td align="center">AF_TRIGGER</td>
1416     * <td align="center">NOT_FOCUSED_LOCKED</td>
1417     * <td align="center">No effect</td>
1418     * </tr>
1419     * <tr>
1420     * <td align="center">NOT_FOCUSED_LOCKED</td>
1421     * <td align="center">AF_CANCEL</td>
1422     * <td align="center">INACTIVE</td>
1423     * <td align="center">Restart AF scan</td>
1424     * </tr>
1425     * </tbody>
1426     * </table>
1427     * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1428     * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1429     * camera device. When a trigger is included in a mode switch request, the trigger
1430     * will be evaluated in the context of the new mode in the request.
1431     * See below table for examples:</p>
1432     * <table>
1433     * <thead>
1434     * <tr>
1435     * <th align="center">State</th>
1436     * <th align="center">Transition Cause</th>
1437     * <th align="center">New State</th>
1438     * <th align="center">Notes</th>
1439     * </tr>
1440     * </thead>
1441     * <tbody>
1442     * <tr>
1443     * <td align="center">any state</td>
1444     * <td align="center">CAF--&gt;AUTO mode switch</td>
1445     * <td align="center">INACTIVE</td>
1446     * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1447     * </tr>
1448     * <tr>
1449     * <td align="center">any state</td>
1450     * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1451     * <td align="center">trigger-reachable states from INACTIVE</td>
1452     * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1453     * </tr>
1454     * <tr>
1455     * <td align="center">any state</td>
1456     * <td align="center">AUTO--&gt;CAF mode switch</td>
1457     * <td align="center">passively reachable states from INACTIVE</td>
1458     * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1459     * </tr>
1460     * </tbody>
1461     * </table>
1462     * <p><b>Possible values:</b>
1463     * <ul>
1464     *   <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1465     *   <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1466     *   <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1467     *   <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1468     *   <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1469     *   <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1470     *   <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1471     * </ul></p>
1472     * <p>This key is available on all devices.</p>
1473     *
1474     * @see CaptureRequest#CONTROL_AF_MODE
1475     * @see CaptureRequest#CONTROL_MODE
1476     * @see CaptureRequest#CONTROL_SCENE_MODE
1477     * @see #CONTROL_AF_STATE_INACTIVE
1478     * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1479     * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1480     * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1481     * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1482     * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
1483     * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
1484     */
1485    @PublicKey
1486    public static final Key<Integer> CONTROL_AF_STATE =
1487            new Key<Integer>("android.control.afState", int.class);
1488
1489    /**
1490     * <p>Whether auto-white balance (AWB) is currently locked to its
1491     * latest calculated values.</p>
1492     * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1493     * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1494     * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1495     * get locked do not necessarily correspond to the settings that were present in the
1496     * latest capture result received from the camera device, since additional captures
1497     * and AWB updates may have occurred even before the result was sent out. If an
1498     * application is switching between automatic and manual control and wishes to eliminate
1499     * any flicker during the switch, the following procedure is recommended:</p>
1500     * <ol>
1501     * <li>Starting in auto-AWB mode:</li>
1502     * <li>Lock AWB</li>
1503     * <li>Wait for the first result to be output that has the AWB locked</li>
1504     * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1505     * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1506     * </ol>
1507     * <p>Note that AWB lock is only meaningful when
1508     * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1509     * AWB is already fixed to a specific setting.</p>
1510     * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1511     * <p>This key is available on all devices.</p>
1512     *
1513     * @see CaptureRequest#CONTROL_AWB_MODE
1514     */
1515    @PublicKey
1516    public static final Key<Boolean> CONTROL_AWB_LOCK =
1517            new Key<Boolean>("android.control.awbLock", boolean.class);
1518
1519    /**
1520     * <p>Whether auto-white balance (AWB) is currently setting the color
1521     * transform fields, and what its illumination target
1522     * is.</p>
1523     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
1524     * <p>When set to the ON mode, the camera device's auto-white balance
1525     * routine is enabled, overriding the application's selected
1526     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1527     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1528     * is OFF, the behavior of AWB is device dependent. It is recommened to
1529     * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1530     * setting AE mode to OFF.</p>
1531     * <p>When set to the OFF mode, the camera device's auto-white balance
1532     * routine is disabled. The application manually controls the white
1533     * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
1534     * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
1535     * <p>When set to any other modes, the camera device's auto-white
1536     * balance routine is disabled. The camera device uses each
1537     * particular illumination target for white balance
1538     * adjustment. The application's values for
1539     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1540     * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1541     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
1542     * <p><b>Possible values:</b>
1543     * <ul>
1544     *   <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1545     *   <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1546     *   <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1547     *   <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1548     *   <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1549     *   <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1550     *   <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1551     *   <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1552     *   <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1553     * </ul></p>
1554     * <p><b>Available values for this device:</b><br>
1555     * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
1556     * <p>This key is available on all devices.</p>
1557     *
1558     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1559     * @see CaptureRequest#COLOR_CORRECTION_MODE
1560     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1561     * @see CaptureRequest#CONTROL_AE_MODE
1562     * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
1563     * @see CaptureRequest#CONTROL_AWB_LOCK
1564     * @see CaptureRequest#CONTROL_MODE
1565     * @see #CONTROL_AWB_MODE_OFF
1566     * @see #CONTROL_AWB_MODE_AUTO
1567     * @see #CONTROL_AWB_MODE_INCANDESCENT
1568     * @see #CONTROL_AWB_MODE_FLUORESCENT
1569     * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1570     * @see #CONTROL_AWB_MODE_DAYLIGHT
1571     * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1572     * @see #CONTROL_AWB_MODE_TWILIGHT
1573     * @see #CONTROL_AWB_MODE_SHADE
1574     */
1575    @PublicKey
1576    public static final Key<Integer> CONTROL_AWB_MODE =
1577            new Key<Integer>("android.control.awbMode", int.class);
1578
1579    /**
1580     * <p>List of metering areas to use for auto-white-balance illuminant
1581     * estimation.</p>
1582     * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
1583     * Otherwise will always be present.</p>
1584     * <p>The maximum number of regions supported by the device is determined by the value
1585     * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
1586     * <p>The coordinate system is based on the active pixel array,
1587     * with (0,0) being the top-left pixel in the active pixel array, and
1588     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1589     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
1590     * bottom-right pixel in the active pixel array.</p>
1591     * <p>The weight must range from 0 to 1000, and represents a weight
1592     * for every pixel in the area. This means that a large metering area
1593     * with the same weight as a smaller area will have more effect in
1594     * the metering result. Metering areas can partially overlap and the
1595     * camera device will add the weights in the overlap region.</p>
1596     * <p>The weights are relative to weights of other white balance metering regions, so if
1597     * only one region is used, all non-zero weights will have the same effect. A region with
1598     * 0 weight is ignored.</p>
1599     * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1600     * camera device.</p>
1601     * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1602     * capture result metadata, the camera device will ignore the sections outside the crop
1603     * region and output only the intersection rectangle as the metering region in the result
1604     * metadata.  If the region is entirely outside the crop region, it will be ignored and
1605     * not reported in the result metadata.</p>
1606     * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1607     * <p><b>Range of valid values:</b><br>
1608     * Coordinates must be between <code>[(0,0), (width, height))</code> of
1609     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1610     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1611     *
1612     * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
1613     * @see CaptureRequest#SCALER_CROP_REGION
1614     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1615     */
1616    @PublicKey
1617    public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1618            new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
1619
1620    /**
1621     * <p>Information to the camera device 3A (auto-exposure,
1622     * auto-focus, auto-white balance) routines about the purpose
1623     * of this capture, to help the camera device to decide optimal 3A
1624     * strategy.</p>
1625     * <p>This control (except for MANUAL) is only effective if
1626     * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
1627     * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1628     * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1629     * contains MANUAL_SENSOR. Other intent values are always supported.</p>
1630     * <p><b>Possible values:</b>
1631     * <ul>
1632     *   <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1633     *   <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1634     *   <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1635     *   <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1636     *   <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1637     *   <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1638     *   <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1639     * </ul></p>
1640     * <p>This key is available on all devices.</p>
1641     *
1642     * @see CaptureRequest#CONTROL_MODE
1643     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1644     * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1645     * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1646     * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1647     * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1648     * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1649     * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1650     * @see #CONTROL_CAPTURE_INTENT_MANUAL
1651     */
1652    @PublicKey
1653    public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1654            new Key<Integer>("android.control.captureIntent", int.class);
1655
1656    /**
1657     * <p>Current state of auto-white balance (AWB) algorithm.</p>
1658     * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1659     * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1660     * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1661     * the algorithm states to INACTIVE.</p>
1662     * <p>The camera device can do several state transitions between two results, if it is
1663     * allowed by the state transition table. So INACTIVE may never actually be seen in
1664     * a result.</p>
1665     * <p>The state in the result is the state for this image (in sync with this image): if
1666     * AWB state becomes CONVERGED, then the image data associated with this result should
1667     * be good to use.</p>
1668     * <p>Below are state transition tables for different AWB modes.</p>
1669     * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1670     * <table>
1671     * <thead>
1672     * <tr>
1673     * <th align="center">State</th>
1674     * <th align="center">Transition Cause</th>
1675     * <th align="center">New State</th>
1676     * <th align="center">Notes</th>
1677     * </tr>
1678     * </thead>
1679     * <tbody>
1680     * <tr>
1681     * <td align="center">INACTIVE</td>
1682     * <td align="center"></td>
1683     * <td align="center">INACTIVE</td>
1684     * <td align="center">Camera device auto white balance algorithm is disabled</td>
1685     * </tr>
1686     * </tbody>
1687     * </table>
1688     * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1689     * <table>
1690     * <thead>
1691     * <tr>
1692     * <th align="center">State</th>
1693     * <th align="center">Transition Cause</th>
1694     * <th align="center">New State</th>
1695     * <th align="center">Notes</th>
1696     * </tr>
1697     * </thead>
1698     * <tbody>
1699     * <tr>
1700     * <td align="center">INACTIVE</td>
1701     * <td align="center">Camera device initiates AWB scan</td>
1702     * <td align="center">SEARCHING</td>
1703     * <td align="center">Values changing</td>
1704     * </tr>
1705     * <tr>
1706     * <td align="center">INACTIVE</td>
1707     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1708     * <td align="center">LOCKED</td>
1709     * <td align="center">Values locked</td>
1710     * </tr>
1711     * <tr>
1712     * <td align="center">SEARCHING</td>
1713     * <td align="center">Camera device finishes AWB scan</td>
1714     * <td align="center">CONVERGED</td>
1715     * <td align="center">Good values, not changing</td>
1716     * </tr>
1717     * <tr>
1718     * <td align="center">SEARCHING</td>
1719     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1720     * <td align="center">LOCKED</td>
1721     * <td align="center">Values locked</td>
1722     * </tr>
1723     * <tr>
1724     * <td align="center">CONVERGED</td>
1725     * <td align="center">Camera device initiates AWB scan</td>
1726     * <td align="center">SEARCHING</td>
1727     * <td align="center">Values changing</td>
1728     * </tr>
1729     * <tr>
1730     * <td align="center">CONVERGED</td>
1731     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1732     * <td align="center">LOCKED</td>
1733     * <td align="center">Values locked</td>
1734     * </tr>
1735     * <tr>
1736     * <td align="center">LOCKED</td>
1737     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1738     * <td align="center">SEARCHING</td>
1739     * <td align="center">Values not good after unlock</td>
1740     * </tr>
1741     * </tbody>
1742     * </table>
1743     * <p>For the above table, the camera device may skip reporting any state changes that happen
1744     * without application intervention (i.e. mode switch, trigger, locking). Any state that
1745     * can be skipped in that manner is called a transient state.</p>
1746     * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1747     * listed in above table, it is also legal for the camera device to skip one or more
1748     * transient states between two results. See below table for examples:</p>
1749     * <table>
1750     * <thead>
1751     * <tr>
1752     * <th align="center">State</th>
1753     * <th align="center">Transition Cause</th>
1754     * <th align="center">New State</th>
1755     * <th align="center">Notes</th>
1756     * </tr>
1757     * </thead>
1758     * <tbody>
1759     * <tr>
1760     * <td align="center">INACTIVE</td>
1761     * <td align="center">Camera device finished AWB scan</td>
1762     * <td align="center">CONVERGED</td>
1763     * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1764     * </tr>
1765     * <tr>
1766     * <td align="center">LOCKED</td>
1767     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1768     * <td align="center">CONVERGED</td>
1769     * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
1770     * </tr>
1771     * </tbody>
1772     * </table>
1773     * <p><b>Possible values:</b>
1774     * <ul>
1775     *   <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1776     *   <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1777     *   <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1778     *   <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1779     * </ul></p>
1780     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1781     * <p><b>Limited capability</b> -
1782     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1783     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1784     *
1785     * @see CaptureRequest#CONTROL_AWB_LOCK
1786     * @see CaptureRequest#CONTROL_AWB_MODE
1787     * @see CaptureRequest#CONTROL_MODE
1788     * @see CaptureRequest#CONTROL_SCENE_MODE
1789     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1790     * @see #CONTROL_AWB_STATE_INACTIVE
1791     * @see #CONTROL_AWB_STATE_SEARCHING
1792     * @see #CONTROL_AWB_STATE_CONVERGED
1793     * @see #CONTROL_AWB_STATE_LOCKED
1794     */
1795    @PublicKey
1796    public static final Key<Integer> CONTROL_AWB_STATE =
1797            new Key<Integer>("android.control.awbState", int.class);
1798
1799    /**
1800     * <p>A special color effect to apply.</p>
1801     * <p>When this mode is set, a color effect will be applied
1802     * to images produced by the camera device. The interpretation
1803     * and implementation of these color effects is left to the
1804     * implementor of the camera device, and should not be
1805     * depended on to be consistent (or present) across all
1806     * devices.</p>
1807     * <p><b>Possible values:</b>
1808     * <ul>
1809     *   <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1810     *   <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1811     *   <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1812     *   <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1813     *   <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1814     *   <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1815     *   <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1816     *   <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1817     *   <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1818     * </ul></p>
1819     * <p><b>Available values for this device:</b><br>
1820     * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
1821     * <p>This key is available on all devices.</p>
1822     *
1823     * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
1824     * @see #CONTROL_EFFECT_MODE_OFF
1825     * @see #CONTROL_EFFECT_MODE_MONO
1826     * @see #CONTROL_EFFECT_MODE_NEGATIVE
1827     * @see #CONTROL_EFFECT_MODE_SOLARIZE
1828     * @see #CONTROL_EFFECT_MODE_SEPIA
1829     * @see #CONTROL_EFFECT_MODE_POSTERIZE
1830     * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1831     * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1832     * @see #CONTROL_EFFECT_MODE_AQUA
1833     */
1834    @PublicKey
1835    public static final Key<Integer> CONTROL_EFFECT_MODE =
1836            new Key<Integer>("android.control.effectMode", int.class);
1837
1838    /**
1839     * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
1840     * routines.</p>
1841     * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
1842     * by the camera device is disabled. The application must set the fields for
1843     * capture parameters itself.</p>
1844     * <p>When set to AUTO, the individual algorithm controls in
1845     * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
1846     * <p>When set to USE_SCENE_MODE, the individual controls in
1847     * android.control.* are mostly disabled, and the camera device implements
1848     * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
1849     * as it wishes. The camera device scene mode 3A settings are provided by
1850     * android.control.sceneModeOverrides.</p>
1851     * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1852     * is that this frame will not be used by camera device background 3A statistics
1853     * update, as if this frame is never captured. This mode can be used in the scenario
1854     * where the application doesn't want a 3A manual control capture to affect
1855     * the subsequent auto 3A capture results.</p>
1856     * <p>LEGACY mode devices will only support AUTO and USE_SCENE_MODE modes.
1857     * LIMITED mode devices will only support OFF and OFF_KEEP_STATE if they
1858     * support the MANUAL_SENSOR and MANUAL_POST_PROCSESING capabilities.
1859     * FULL mode devices will always support OFF and OFF_KEEP_STATE.</p>
1860     * <p><b>Possible values:</b>
1861     * <ul>
1862     *   <li>{@link #CONTROL_MODE_OFF OFF}</li>
1863     *   <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1864     *   <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1865     *   <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1866     * </ul></p>
1867     * <p>This key is available on all devices.</p>
1868     *
1869     * @see CaptureRequest#CONTROL_AF_MODE
1870     * @see #CONTROL_MODE_OFF
1871     * @see #CONTROL_MODE_AUTO
1872     * @see #CONTROL_MODE_USE_SCENE_MODE
1873     * @see #CONTROL_MODE_OFF_KEEP_STATE
1874     */
1875    @PublicKey
1876    public static final Key<Integer> CONTROL_MODE =
1877            new Key<Integer>("android.control.mode", int.class);
1878
1879    /**
1880     * <p>Control for which scene mode is currently active.</p>
1881     * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1882     * capture settings.</p>
1883     * <p>This is the mode that that is active when
1884     * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1885     * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
1886     * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p>
1887     * <p>The interpretation and implementation of these scene modes is left
1888     * to the implementor of the camera device. Their behavior will not be
1889     * consistent across all devices, and any given device may only implement
1890     * a subset of these modes.</p>
1891     * <p><b>Possible values:</b>
1892     * <ul>
1893     *   <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1894     *   <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1895     *   <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1896     *   <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1897     *   <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1898     *   <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1899     *   <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1900     *   <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1901     *   <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1902     *   <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1903     *   <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1904     *   <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1905     *   <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1906     *   <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1907     *   <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1908     *   <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1909     *   <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1910     *   <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
1911     * </ul></p>
1912     * <p><b>Available values for this device:</b><br>
1913     * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
1914     * <p>This key is available on all devices.</p>
1915     *
1916     * @see CaptureRequest#CONTROL_AE_MODE
1917     * @see CaptureRequest#CONTROL_AF_MODE
1918     * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
1919     * @see CaptureRequest#CONTROL_AWB_MODE
1920     * @see CaptureRequest#CONTROL_MODE
1921     * @see #CONTROL_SCENE_MODE_DISABLED
1922     * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1923     * @see #CONTROL_SCENE_MODE_ACTION
1924     * @see #CONTROL_SCENE_MODE_PORTRAIT
1925     * @see #CONTROL_SCENE_MODE_LANDSCAPE
1926     * @see #CONTROL_SCENE_MODE_NIGHT
1927     * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1928     * @see #CONTROL_SCENE_MODE_THEATRE
1929     * @see #CONTROL_SCENE_MODE_BEACH
1930     * @see #CONTROL_SCENE_MODE_SNOW
1931     * @see #CONTROL_SCENE_MODE_SUNSET
1932     * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1933     * @see #CONTROL_SCENE_MODE_FIREWORKS
1934     * @see #CONTROL_SCENE_MODE_SPORTS
1935     * @see #CONTROL_SCENE_MODE_PARTY
1936     * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1937     * @see #CONTROL_SCENE_MODE_BARCODE
1938     * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
1939     */
1940    @PublicKey
1941    public static final Key<Integer> CONTROL_SCENE_MODE =
1942            new Key<Integer>("android.control.sceneMode", int.class);
1943
1944    /**
1945     * <p>Whether video stabilization is
1946     * active.</p>
1947     * <p>Video stabilization automatically translates and scales images from
1948     * the camera in order to stabilize motion between consecutive frames.</p>
1949     * <p>If enabled, video stabilization can modify the
1950     * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
1951     * <p>Switching between different video stabilization modes may take several
1952     * frames to initialize, the camera device will report the current mode
1953     * in capture result metadata. For example, When "ON" mode is requested,
1954     * the video stabilization modes in the first several capture results may
1955     * still be "OFF", and it will become "ON" when the initialization is
1956     * done.</p>
1957     * <p>If a camera device supports both this mode and OIS
1958     * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
1959     * produce undesirable interaction, so it is recommended not to enable
1960     * both at the same time.</p>
1961     * <p><b>Possible values:</b>
1962     * <ul>
1963     *   <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
1964     *   <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
1965     * </ul></p>
1966     * <p>This key is available on all devices.</p>
1967     *
1968     * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
1969     * @see CaptureRequest#SCALER_CROP_REGION
1970     * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1971     * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1972     */
1973    @PublicKey
1974    public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1975            new Key<Integer>("android.control.videoStabilizationMode", int.class);
1976
1977    /**
1978     * <p>Operation mode for edge
1979     * enhancement.</p>
1980     * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
1981     * no enhancement will be applied by the camera device.</p>
1982     * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
1983     * will be applied. HIGH_QUALITY mode indicates that the
1984     * camera device will use the highest-quality enhancement algorithms,
1985     * even if it slows down capture rate. FAST means the camera device will
1986     * not slow down capture rate when applying edge enhancement.</p>
1987     * <p><b>Possible values:</b>
1988     * <ul>
1989     *   <li>{@link #EDGE_MODE_OFF OFF}</li>
1990     *   <li>{@link #EDGE_MODE_FAST FAST}</li>
1991     *   <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
1992     * </ul></p>
1993     * <p><b>Available values for this device:</b><br>
1994     * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
1995     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1996     * <p><b>Full capability</b> -
1997     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1998     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1999     *
2000     * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
2001     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2002     * @see #EDGE_MODE_OFF
2003     * @see #EDGE_MODE_FAST
2004     * @see #EDGE_MODE_HIGH_QUALITY
2005     */
2006    @PublicKey
2007    public static final Key<Integer> EDGE_MODE =
2008            new Key<Integer>("android.edge.mode", int.class);
2009
2010    /**
2011     * <p>The desired mode for for the camera device's flash control.</p>
2012     * <p>This control is only effective when flash unit is available
2013     * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
2014     * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2015     * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2016     * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2017     * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2018     * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2019     * device's auto-exposure routine's result. When used in still capture case, this
2020     * control should be used along with auto-exposure (AE) precapture metering sequence
2021     * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2022     * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2023     * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
2024     * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
2025     * <p><b>Possible values:</b>
2026     * <ul>
2027     *   <li>{@link #FLASH_MODE_OFF OFF}</li>
2028     *   <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2029     *   <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2030     * </ul></p>
2031     * <p>This key is available on all devices.</p>
2032     *
2033     * @see CaptureRequest#CONTROL_AE_MODE
2034     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2035     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
2036     * @see CaptureResult#FLASH_STATE
2037     * @see #FLASH_MODE_OFF
2038     * @see #FLASH_MODE_SINGLE
2039     * @see #FLASH_MODE_TORCH
2040     */
2041    @PublicKey
2042    public static final Key<Integer> FLASH_MODE =
2043            new Key<Integer>("android.flash.mode", int.class);
2044
2045    /**
2046     * <p>Current state of the flash
2047     * unit.</p>
2048     * <p>When the camera device doesn't have flash unit
2049     * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2050     * Other states indicate the current flash status.</p>
2051     * <p>In certain conditions, this will be available on LEGACY devices:</p>
2052     * <ul>
2053     * <li>Flash-less cameras always return UNAVAILABLE.</li>
2054     * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
2055     *    will always return FIRED.</li>
2056     * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
2057     *    will always return FIRED.</li>
2058     * </ul>
2059     * <p>In all other conditions the state will not be available on
2060     * LEGACY devices (i.e. it will be <code>null</code>).</p>
2061     * <p><b>Possible values:</b>
2062     * <ul>
2063     *   <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2064     *   <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2065     *   <li>{@link #FLASH_STATE_READY READY}</li>
2066     *   <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2067     *   <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2068     * </ul></p>
2069     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2070     * <p><b>Limited capability</b> -
2071     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2072     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2073     *
2074     * @see CaptureRequest#CONTROL_AE_MODE
2075     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
2076     * @see CaptureRequest#FLASH_MODE
2077     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2078     * @see #FLASH_STATE_UNAVAILABLE
2079     * @see #FLASH_STATE_CHARGING
2080     * @see #FLASH_STATE_READY
2081     * @see #FLASH_STATE_FIRED
2082     * @see #FLASH_STATE_PARTIAL
2083     */
2084    @PublicKey
2085    public static final Key<Integer> FLASH_STATE =
2086            new Key<Integer>("android.flash.state", int.class);
2087
2088    /**
2089     * <p>Operational mode for hot pixel correction.</p>
2090     * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
2091     * that do not accurately measure the incoming light (i.e. pixels that
2092     * are stuck at an arbitrary value or are oversensitive).</p>
2093     * <p><b>Possible values:</b>
2094     * <ul>
2095     *   <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2096     *   <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2097     *   <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2098     * </ul></p>
2099     * <p><b>Available values for this device:</b><br>
2100     * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
2101     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2102     *
2103     * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
2104     * @see #HOT_PIXEL_MODE_OFF
2105     * @see #HOT_PIXEL_MODE_FAST
2106     * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2107     */
2108    @PublicKey
2109    public static final Key<Integer> HOT_PIXEL_MODE =
2110            new Key<Integer>("android.hotPixel.mode", int.class);
2111
2112    /**
2113     * <p>A location object to use when generating image GPS metadata.</p>
2114     * <p>Setting a location object in a request will include the GPS coordinates of the location
2115     * into any JPEG images captured based on the request. These coordinates can then be
2116     * viewed by anyone who receives the JPEG image.</p>
2117     * <p>This key is available on all devices.</p>
2118     */
2119    @PublicKey
2120    @SyntheticKey
2121    public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2122            new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2123
2124    /**
2125     * <p>GPS coordinates to include in output JPEG
2126     * EXIF.</p>
2127     * <p><b>Range of valid values:</b><br>
2128     * (-180 - 180], [-90,90], [-inf, inf]</p>
2129     * <p>This key is available on all devices.</p>
2130     * @hide
2131     */
2132    public static final Key<double[]> JPEG_GPS_COORDINATES =
2133            new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2134
2135    /**
2136     * <p>32 characters describing GPS algorithm to
2137     * include in EXIF.</p>
2138     * <p><b>Units</b>: UTF-8 null-terminated string</p>
2139     * <p>This key is available on all devices.</p>
2140     * @hide
2141     */
2142    public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2143            new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2144
2145    /**
2146     * <p>Time GPS fix was made to include in
2147     * EXIF.</p>
2148     * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
2149     * <p>This key is available on all devices.</p>
2150     * @hide
2151     */
2152    public static final Key<Long> JPEG_GPS_TIMESTAMP =
2153            new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2154
2155    /**
2156     * <p>The orientation for a JPEG image.</p>
2157     * <p>The clockwise rotation angle in degrees, relative to the orientation
2158     * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2159     * upright.</p>
2160     * <p>Camera devices may either encode this value into the JPEG EXIF header, or
2161     * rotate the image data to match this orientation.</p>
2162     * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2163     * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
2164     * <p>To translate from the device orientation given by the Android sensor APIs, the following
2165     * sample code may be used:</p>
2166     * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2167     *     if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2168     *     int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2169     *
2170     *     // Round device orientation to a multiple of 90
2171     *     deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2172     *
2173     *     // Reverse device orientation for front-facing cameras
2174     *     boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2175     *     if (facingFront) deviceOrientation = -deviceOrientation;
2176     *
2177     *     // Calculate desired JPEG orientation relative to camera orientation to make
2178     *     // the image upright relative to the device orientation
2179     *     int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2180     *
2181     *     return jpegOrientation;
2182     * }
2183     * </code></pre>
2184     * <p><b>Units</b>: Degrees in multiples of 90</p>
2185     * <p><b>Range of valid values:</b><br>
2186     * 0, 90, 180, 270</p>
2187     * <p>This key is available on all devices.</p>
2188     *
2189     * @see CameraCharacteristics#SENSOR_ORIENTATION
2190     */
2191    @PublicKey
2192    public static final Key<Integer> JPEG_ORIENTATION =
2193            new Key<Integer>("android.jpeg.orientation", int.class);
2194
2195    /**
2196     * <p>Compression quality of the final JPEG
2197     * image.</p>
2198     * <p>85-95 is typical usage range.</p>
2199     * <p><b>Range of valid values:</b><br>
2200     * 1-100; larger is higher quality</p>
2201     * <p>This key is available on all devices.</p>
2202     */
2203    @PublicKey
2204    public static final Key<Byte> JPEG_QUALITY =
2205            new Key<Byte>("android.jpeg.quality", byte.class);
2206
2207    /**
2208     * <p>Compression quality of JPEG
2209     * thumbnail.</p>
2210     * <p><b>Range of valid values:</b><br>
2211     * 1-100; larger is higher quality</p>
2212     * <p>This key is available on all devices.</p>
2213     */
2214    @PublicKey
2215    public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2216            new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2217
2218    /**
2219     * <p>Resolution of embedded JPEG thumbnail.</p>
2220     * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2221     * but the captured JPEG will still be a valid image.</p>
2222     * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2223     * should have the same aspect ratio as the main JPEG output.</p>
2224     * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2225     * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2226     * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2227     * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2228     * generate the thumbnail image. The thumbnail image will always have a smaller Field
2229     * Of View (FOV) than the primary image when aspect ratios differ.</p>
2230     * <p><b>Range of valid values:</b><br>
2231     * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
2232     * <p>This key is available on all devices.</p>
2233     *
2234     * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
2235     */
2236    @PublicKey
2237    public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2238            new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
2239
2240    /**
2241     * <p>The desired lens aperture size, as a ratio of lens focal length to the
2242     * effective aperture diameter.</p>
2243     * <p>Setting this value is only supported on the camera devices that have a variable
2244     * aperture lens.</p>
2245     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2246     * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
2247     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
2248     * to achieve manual exposure control.</p>
2249     * <p>The requested aperture value may take several frames to reach the
2250     * requested value; the camera device will report the current (intermediate)
2251     * aperture size in capture result metadata while the aperture is changing.
2252     * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
2253     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2254     * the ON modes, this will be overridden by the camera device
2255     * auto-exposure algorithm, the overridden values are then provided
2256     * back to the user in the corresponding result.</p>
2257     * <p><b>Units</b>: The f-number (f/N)</p>
2258     * <p><b>Range of valid values:</b><br>
2259     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
2260     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2261     * <p><b>Full capability</b> -
2262     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2263     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2264     *
2265     * @see CaptureRequest#CONTROL_AE_MODE
2266     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2267     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2268     * @see CaptureResult#LENS_STATE
2269     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
2270     * @see CaptureRequest#SENSOR_FRAME_DURATION
2271     * @see CaptureRequest#SENSOR_SENSITIVITY
2272     */
2273    @PublicKey
2274    public static final Key<Float> LENS_APERTURE =
2275            new Key<Float>("android.lens.aperture", float.class);
2276
2277    /**
2278     * <p>The desired setting for the lens neutral density filter(s).</p>
2279     * <p>This control will not be supported on most camera devices.</p>
2280     * <p>Lens filters are typically used to lower the amount of light the
2281     * sensor is exposed to (measured in steps of EV). As used here, an EV
2282     * step is the standard logarithmic representation, which are
2283     * non-negative, and inversely proportional to the amount of light
2284     * hitting the sensor.  For example, setting this to 0 would result
2285     * in no reduction of the incoming light, and setting this to 2 would
2286     * mean that the filter is set to reduce incoming light by two stops
2287     * (allowing 1/4 of the prior amount of light to the sensor).</p>
2288     * <p>It may take several frames before the lens filter density changes
2289     * to the requested value. While the filter density is still changing,
2290     * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
2291     * <p><b>Units</b>: Exposure Value (EV)</p>
2292     * <p><b>Range of valid values:</b><br>
2293     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
2294     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2295     * <p><b>Full capability</b> -
2296     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2297     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2298     *
2299     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2300     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2301     * @see CaptureResult#LENS_STATE
2302     */
2303    @PublicKey
2304    public static final Key<Float> LENS_FILTER_DENSITY =
2305            new Key<Float>("android.lens.filterDensity", float.class);
2306
2307    /**
2308     * <p>The desired lens focal length; used for optical zoom.</p>
2309     * <p>This setting controls the physical focal length of the camera
2310     * device's lens. Changing the focal length changes the field of
2311     * view of the camera device, and is usually used for optical zoom.</p>
2312     * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2313     * setting won't be applied instantaneously, and it may take several
2314     * frames before the lens can change to the requested focal length.
2315     * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2316     * be set to MOVING.</p>
2317     * <p>Optical zoom will not be supported on most devices.</p>
2318     * <p><b>Units</b>: Millimeters</p>
2319     * <p><b>Range of valid values:</b><br>
2320     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
2321     * <p>This key is available on all devices.</p>
2322     *
2323     * @see CaptureRequest#LENS_APERTURE
2324     * @see CaptureRequest#LENS_FOCUS_DISTANCE
2325     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2326     * @see CaptureResult#LENS_STATE
2327     */
2328    @PublicKey
2329    public static final Key<Float> LENS_FOCAL_LENGTH =
2330            new Key<Float>("android.lens.focalLength", float.class);
2331
2332    /**
2333     * <p>Desired distance to plane of sharpest focus,
2334     * measured from frontmost surface of the lens.</p>
2335     * <p>Should be zero for fixed-focus cameras</p>
2336     * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2337     * <p><b>Range of valid values:</b><br>
2338     * &gt;= 0</p>
2339     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2340     * <p><b>Full capability</b> -
2341     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2342     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2343     *
2344     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2345     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
2346     */
2347    @PublicKey
2348    public static final Key<Float> LENS_FOCUS_DISTANCE =
2349            new Key<Float>("android.lens.focusDistance", float.class);
2350
2351    /**
2352     * <p>The range of scene distances that are in
2353     * sharp focus (depth of field).</p>
2354     * <p>If variable focus not supported, can still report
2355     * fixed depth of field range</p>
2356     * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2357     * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2358     * <p><b>Range of valid values:</b><br>
2359     * &gt;=0</p>
2360     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2361     * <p><b>Limited capability</b> -
2362     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2363     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2364     *
2365     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2366     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
2367     */
2368    @PublicKey
2369    public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2370            new Key<android.util.Pair<Float,Float>>("android.lens.focusRange", new TypeReference<android.util.Pair<Float,Float>>() {{ }});
2371
2372    /**
2373     * <p>Sets whether the camera device uses optical image stabilization (OIS)
2374     * when capturing images.</p>
2375     * <p>OIS is used to compensate for motion blur due to small
2376     * movements of the camera during capture. Unlike digital image
2377     * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2378     * makes use of mechanical elements to stabilize the camera
2379     * sensor, and thus allows for longer exposure times before
2380     * camera shake becomes apparent.</p>
2381     * <p>Switching between different optical stabilization modes may take several
2382     * frames to initialize, the camera device will report the current mode in
2383     * capture result metadata. For example, When "ON" mode is requested, the
2384     * optical stabilization modes in the first several capture results may still
2385     * be "OFF", and it will become "ON" when the initialization is done.</p>
2386     * <p>If a camera device supports both OIS and digital image stabilization
2387     * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2388     * interaction, so it is recommended not to enable both at the same time.</p>
2389     * <p>Not all devices will support OIS; see
2390     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2391     * available controls.</p>
2392     * <p><b>Possible values:</b>
2393     * <ul>
2394     *   <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2395     *   <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2396     * </ul></p>
2397     * <p><b>Available values for this device:</b><br>
2398     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
2399     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2400     * <p><b>Limited capability</b> -
2401     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2402     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2403     *
2404     * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
2405     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2406     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
2407     * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2408     * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2409     */
2410    @PublicKey
2411    public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2412            new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2413
2414    /**
2415     * <p>Current lens status.</p>
2416     * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2417     * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2418     * they may take several frames to reach the requested values. This state indicates
2419     * the current status of the lens parameters.</p>
2420     * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2421     * either because the parameters are all fixed, or because the lens has had enough
2422     * time to reach the most recently-requested values.
2423     * If all these lens parameters are not changable for a camera device, as listed below:</p>
2424     * <ul>
2425     * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2426     * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2427     * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2428     * which means the optical zoom is not supported.</li>
2429     * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2430     * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2431     * </ul>
2432     * <p>Then this state will always be STATIONARY.</p>
2433     * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2434     * is changing.</p>
2435     * <p><b>Possible values:</b>
2436     * <ul>
2437     *   <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2438     *   <li>{@link #LENS_STATE_MOVING MOVING}</li>
2439     * </ul></p>
2440     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2441     * <p><b>Limited capability</b> -
2442     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2443     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2444     *
2445     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2446     * @see CaptureRequest#LENS_APERTURE
2447     * @see CaptureRequest#LENS_FILTER_DENSITY
2448     * @see CaptureRequest#LENS_FOCAL_LENGTH
2449     * @see CaptureRequest#LENS_FOCUS_DISTANCE
2450     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2451     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2452     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2453     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
2454     * @see #LENS_STATE_STATIONARY
2455     * @see #LENS_STATE_MOVING
2456     */
2457    @PublicKey
2458    public static final Key<Integer> LENS_STATE =
2459            new Key<Integer>("android.lens.state", int.class);
2460
2461    /**
2462     * <p>Mode of operation for the noise reduction algorithm.</p>
2463     * <p>The noise reduction algorithm attempts to improve image quality by removing
2464     * excessive noise added by the capture process, especially in dark conditions.
2465     * OFF means no noise reduction will be applied by the camera device.</p>
2466     * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2467     * will be applied. HIGH_QUALITY mode indicates that the camera device
2468     * will use the highest-quality noise filtering algorithms,
2469     * even if it slows down capture rate. FAST means the camera device will not
2470     * slow down capture rate when applying noise filtering.</p>
2471     * <p><b>Possible values:</b>
2472     * <ul>
2473     *   <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2474     *   <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2475     *   <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2476     * </ul></p>
2477     * <p><b>Available values for this device:</b><br>
2478     * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
2479     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2480     * <p><b>Full capability</b> -
2481     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2482     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2483     *
2484     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2485     * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
2486     * @see #NOISE_REDUCTION_MODE_OFF
2487     * @see #NOISE_REDUCTION_MODE_FAST
2488     * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
2489     */
2490    @PublicKey
2491    public static final Key<Integer> NOISE_REDUCTION_MODE =
2492            new Key<Integer>("android.noiseReduction.mode", int.class);
2493
2494    /**
2495     * <p>Whether a result given to the framework is the
2496     * final one for the capture, or only a partial that contains a
2497     * subset of the full set of dynamic metadata
2498     * values.</p>
2499     * <p>The entries in the result metadata buffers for a
2500     * single capture may not overlap, except for this entry. The
2501     * FINAL buffers must retain FIFO ordering relative to the
2502     * requests that generate them, so the FINAL buffer for frame 3 must
2503     * always be sent to the framework after the FINAL buffer for frame 2, and
2504     * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2505     * in any order relative to other frames, but all PARTIAL buffers for a given
2506     * capture must arrive before the FINAL buffer for that capture. This entry may
2507     * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
2508     * <p><b>Range of valid values:</b><br>
2509     * Optional. Default value is FINAL.</p>
2510     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2511     * @deprecated
2512     * @hide
2513     */
2514    @Deprecated
2515    public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2516            new Key<Boolean>("android.quirks.partialResult", boolean.class);
2517
2518    /**
2519     * <p>A frame counter set by the framework. This value monotonically
2520     * increases with every new result (that is, each new result has a unique
2521     * frameCount value).</p>
2522     * <p>Reset on release()</p>
2523     * <p><b>Units</b>: count of frames</p>
2524     * <p><b>Range of valid values:</b><br>
2525     * &gt; 0</p>
2526     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2527     * @deprecated
2528     * @hide
2529     */
2530    @Deprecated
2531    public static final Key<Integer> REQUEST_FRAME_COUNT =
2532            new Key<Integer>("android.request.frameCount", int.class);
2533
2534    /**
2535     * <p>An application-specified ID for the current
2536     * request. Must be maintained unchanged in output
2537     * frame</p>
2538     * <p><b>Units</b>: arbitrary integer assigned by application</p>
2539     * <p><b>Range of valid values:</b><br>
2540     * Any int</p>
2541     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2542     * @hide
2543     */
2544    public static final Key<Integer> REQUEST_ID =
2545            new Key<Integer>("android.request.id", int.class);
2546
2547    /**
2548     * <p>Specifies the number of pipeline stages the frame went
2549     * through from when it was exposed to when the final completed result
2550     * was available to the framework.</p>
2551     * <p>Depending on what settings are used in the request, and
2552     * what streams are configured, the data may undergo less processing,
2553     * and some pipeline stages skipped.</p>
2554     * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
2555     * <p><b>Range of valid values:</b><br>
2556     * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
2557     * <p>This key is available on all devices.</p>
2558     *
2559     * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2560     */
2561    @PublicKey
2562    public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2563            new Key<Byte>("android.request.pipelineDepth", byte.class);
2564
2565    /**
2566     * <p>The desired region of the sensor to read out for this capture.</p>
2567     * <p>This control can be used to implement digital zoom.</p>
2568     * <p>The crop region coordinate system is based off
2569     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2570     * top-left corner of the sensor active array.</p>
2571     * <p>Output streams use this rectangle to produce their output,
2572     * cropping to a smaller region if necessary to maintain the
2573     * stream's aspect ratio, then scaling the sensor input to
2574     * match the output's configured resolution.</p>
2575     * <p>The crop region is applied after the RAW to other color
2576     * space (e.g. YUV) conversion. Since raw streams
2577     * (e.g. RAW16) don't have the conversion stage, they are not
2578     * croppable. The crop region will be ignored by raw streams.</p>
2579     * <p>For non-raw streams, any additional per-stream cropping will
2580     * be done to maximize the final pixel area of the stream.</p>
2581     * <p>For example, if the crop region is set to a 4:3 aspect
2582     * ratio, then 4:3 streams will use the exact crop
2583     * region. 16:9 streams will further crop vertically
2584     * (letterbox).</p>
2585     * <p>Conversely, if the crop region is set to a 16:9, then 4:3
2586     * outputs will crop horizontally (pillarbox), and 16:9
2587     * streams will match exactly. These additional crops will
2588     * be centered within the crop region.</p>
2589     * <p>The width and height of the crop region cannot
2590     * be set to be smaller than
2591     * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2592     * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2593     * <p>The camera device may adjust the crop region to account
2594     * for rounding and other hardware requirements; the final
2595     * crop region used will be included in the output capture
2596     * result.</p>
2597     * <p><b>Units</b>: Pixel coordinates relative to
2598     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
2599     * <p>This key is available on all devices.</p>
2600     *
2601     * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
2602     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2603     */
2604    @PublicKey
2605    public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2606            new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2607
2608    /**
2609     * <p>Duration each pixel is exposed to
2610     * light.</p>
2611     * <p>If the sensor can't expose this exact duration, it will shorten the
2612     * duration exposed to the nearest possible value (rather than expose longer).
2613     * The final exposure time used will be available in the output capture result.</p>
2614     * <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
2615     * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2616     * <p><b>Units</b>: Nanoseconds</p>
2617     * <p><b>Range of valid values:</b><br>
2618     * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
2619     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2620     * <p><b>Full capability</b> -
2621     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2622     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2623     *
2624     * @see CaptureRequest#CONTROL_AE_MODE
2625     * @see CaptureRequest#CONTROL_MODE
2626     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2627     * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
2628     */
2629    @PublicKey
2630    public static final Key<Long> SENSOR_EXPOSURE_TIME =
2631            new Key<Long>("android.sensor.exposureTime", long.class);
2632
2633    /**
2634     * <p>Duration from start of frame exposure to
2635     * start of next frame exposure.</p>
2636     * <p>The maximum frame rate that can be supported by a camera subsystem is
2637     * a function of many factors:</p>
2638     * <ul>
2639     * <li>Requested resolutions of output image streams</li>
2640     * <li>Availability of binning / skipping modes on the imager</li>
2641     * <li>The bandwidth of the imager interface</li>
2642     * <li>The bandwidth of the various ISP processing blocks</li>
2643     * </ul>
2644     * <p>Since these factors can vary greatly between different ISPs and
2645     * sensors, the camera abstraction tries to represent the bandwidth
2646     * restrictions with as simple a model as possible.</p>
2647     * <p>The model presented has the following characteristics:</p>
2648     * <ul>
2649     * <li>The image sensor is always configured to output the smallest
2650     * resolution possible given the application's requested output stream
2651     * sizes.  The smallest resolution is defined as being at least as large
2652     * as the largest requested output stream size; the camera pipeline must
2653     * never digitally upsample sensor data when the crop region covers the
2654     * whole sensor. In general, this means that if only small output stream
2655     * resolutions are configured, the sensor can provide a higher frame
2656     * rate.</li>
2657     * <li>Since any request may use any or all the currently configured
2658     * output streams, the sensor and ISP must be configured to support
2659     * scaling a single capture to all the streams at the same time.  This
2660     * means the camera pipeline must be ready to produce the largest
2661     * requested output size without any delay.  Therefore, the overall
2662     * frame rate of a given configured stream set is governed only by the
2663     * largest requested stream resolution.</li>
2664     * <li>Using more than one output stream in a request does not affect the
2665     * frame duration.</li>
2666     * <li>Certain format-streams may need to do additional background processing
2667     * before data is consumed/produced by that stream. These processors
2668     * can run concurrently to the rest of the camera pipeline, but
2669     * cannot process more than 1 capture at a time.</li>
2670     * </ul>
2671     * <p>The necessary information for the application, given the model above,
2672     * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2673     * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
2674     * These are used to determine the maximum frame rate / minimum frame
2675     * duration that is possible for a given stream configuration.</p>
2676     * <p>Specifically, the application can use the following rules to
2677     * determine the minimum frame duration it can request from the camera
2678     * device:</p>
2679     * <ol>
2680     * <li>Let the set of currently configured input/output streams
2681     * be called <code>S</code>.</li>
2682     * <li>Find the minimum frame durations for each stream in <code>S</code>, by
2683     * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2684     * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
2685     * its respective size/format). Let this set of frame durations be called
2686     * <code>F</code>.</li>
2687     * <li>For any given request <code>R</code>, the minimum frame duration allowed
2688     * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2689     * used in <code>R</code> be called <code>S_r</code>.</li>
2690     * </ol>
2691     * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
2692     * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2693     * respective size/format), then the frame duration in
2694     * <code>F</code> determines the steady state frame rate that the application will
2695     * get if it uses <code>R</code> as a repeating request. Let this special kind
2696     * of request be called <code>Rsimple</code>.</p>
2697     * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2698     * by a single capture of a new request <code>Rstall</code> (which has at least
2699     * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2700     * same minimum frame duration this will not cause a frame rate loss
2701     * if all buffers from the previous <code>Rstall</code> have already been
2702     * delivered.</p>
2703     * <p>For more details about stalling, see
2704     * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
2705     * <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
2706     * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2707     * <p><b>Units</b>: Nanoseconds</p>
2708     * <p><b>Range of valid values:</b><br>
2709     * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
2710     * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
2711     * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
2712     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2713     * <p><b>Full capability</b> -
2714     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2715     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2716     *
2717     * @see CaptureRequest#CONTROL_AE_MODE
2718     * @see CaptureRequest#CONTROL_MODE
2719     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2720     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
2721     * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
2722     */
2723    @PublicKey
2724    public static final Key<Long> SENSOR_FRAME_DURATION =
2725            new Key<Long>("android.sensor.frameDuration", long.class);
2726
2727    /**
2728     * <p>The amount of gain applied to sensor data
2729     * before processing.</p>
2730     * <p>The sensitivity is the standard ISO sensitivity value,
2731     * as defined in ISO 12232:2006.</p>
2732     * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2733     * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2734     * is guaranteed to use only analog amplification for applying the gain.</p>
2735     * <p>If the camera device cannot apply the exact sensitivity
2736     * requested, it will reduce the gain to the nearest supported
2737     * value. The final sensitivity used will be available in the
2738     * output capture result.</p>
2739     * <p><b>Units</b>: ISO arithmetic units</p>
2740     * <p><b>Range of valid values:</b><br>
2741     * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
2742     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2743     * <p><b>Full capability</b> -
2744     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2745     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2746     *
2747     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2748     * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2749     * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
2750     */
2751    @PublicKey
2752    public static final Key<Integer> SENSOR_SENSITIVITY =
2753            new Key<Integer>("android.sensor.sensitivity", int.class);
2754
2755    /**
2756     * <p>Time at start of exposure of first
2757     * row of the image sensor active array, in nanoseconds.</p>
2758     * <p>The timestamps are also included in all image
2759     * buffers produced for the same capture, and will be identical
2760     * on all the outputs.</p>
2761     * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
2762     * the timestamps measure time since an unspecified starting point,
2763     * and are monotonically increasing. They can be compared with the
2764     * timestamps for other captures from the same camera device, but are
2765     * not guaranteed to be comparable to any other time source.</p>
2766     * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME,
2767     * the timestamps measure time in the same timebase as
2768     * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2769     * compared to other timestamps from other subsystems that are using
2770     * that base.</p>
2771     * <p><b>Units</b>: Nanoseconds</p>
2772     * <p><b>Range of valid values:</b><br>
2773     * &gt; 0</p>
2774     * <p>This key is available on all devices.</p>
2775     *
2776     * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
2777     */
2778    @PublicKey
2779    public static final Key<Long> SENSOR_TIMESTAMP =
2780            new Key<Long>("android.sensor.timestamp", long.class);
2781
2782    /**
2783     * <p>The estimated camera neutral color in the native sensor colorspace at
2784     * the time of capture.</p>
2785     * <p>This value gives the neutral color point encoded as an RGB value in the
2786     * native sensor color space.  The neutral color point indicates the
2787     * currently estimated white point of the scene illumination.  It can be
2788     * used to interpolate between the provided color transforms when
2789     * processing raw sensor data.</p>
2790     * <p>The order of the values is R, G, B; where R is in the lowest index.</p>
2791     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2792     */
2793    @PublicKey
2794    public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2795            new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2796
2797    /**
2798     * <p>Noise model coefficients for each CFA mosaic channel.</p>
2799     * <p>This key contains two noise model coefficients for each CFA channel
2800     * corresponding to the sensor amplification (S) and sensor readout
2801     * noise (O).  These are given as pairs of coefficients for each channel
2802     * in the same order as channels listed for the CFA layout key
2803     * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}).  This is
2804     * represented as an array of Pair&lt;Double, Double&gt;, where
2805     * the first member of the Pair at index n is the S coefficient and the
2806     * second member is the O coefficient for the nth color channel in the CFA.</p>
2807     * <p>These coefficients are used in a two parameter noise model to describe
2808     * the amount of noise present in the image for each CFA channel.  The
2809     * noise model used here is:</p>
2810     * <p>N(x) = sqrt(Sx + O)</p>
2811     * <p>Where x represents the recorded signal of a CFA channel normalized to
2812     * the range [0, 1], and S and O are the noise model coeffiecients for
2813     * that channel.</p>
2814     * <p>A more detailed description of the noise model can be found in the
2815     * Adobe DNG specification for the NoiseProfile tag.</p>
2816     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2817     *
2818     * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2819     */
2820    @PublicKey
2821    public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
2822            new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
2823
2824    /**
2825     * <p>The worst-case divergence between Bayer green channels.</p>
2826     * <p>This value is an estimate of the worst case split between the
2827     * Bayer green channels in the red and blue rows in the sensor color
2828     * filter array.</p>
2829     * <p>The green split is calculated as follows:</p>
2830     * <ol>
2831     * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2832     * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2833     * mosaic channels (R, Gr, Gb, B).  The location and size of the window
2834     * chosen is implementation defined, and should be chosen to provide a
2835     * green split estimate that is both representative of the entire image
2836     * for this camera sensor, and can be calculated quickly.</li>
2837     * <li>The arithmetic mean of the green channels from the red
2838     * rows (mean_Gr) within W is computed.</li>
2839     * <li>The arithmetic mean of the green channels from the blue
2840     * rows (mean_Gb) within W is computed.</li>
2841     * <li>The maximum ratio R of the two means is computed as follows:
2842     * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2843     * </ol>
2844     * <p>The ratio R is the green split divergence reported for this property,
2845     * which represents how much the green channels differ in the mosaic
2846     * pattern.  This value is typically used to determine the treatment of
2847     * the green mosaic channels when demosaicing.</p>
2848     * <p>The green split value can be roughly interpreted as follows:</p>
2849     * <ul>
2850     * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2851     * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2852     * correction to avoid demosaic errors (3-20% divergence).</li>
2853     * <li>R &gt; 1.20 will require strong software correction to produce
2854     * a usuable image (&gt;20% divergence).</li>
2855     * </ul>
2856     * <p><b>Range of valid values:</b><br></p>
2857     * <p>&gt;= 0</p>
2858     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2859     */
2860    @PublicKey
2861    public static final Key<Float> SENSOR_GREEN_SPLIT =
2862            new Key<Float>("android.sensor.greenSplit", float.class);
2863
2864    /**
2865     * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2866     * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2867     * <p>Each color channel is treated as an unsigned 32-bit integer.
2868     * The camera device then uses the most significant X bits
2869     * that correspond to how many bits are in its Bayer raw sensor
2870     * output.</p>
2871     * <p>For example, a sensor with RAW10 Bayer output would use the
2872     * 10 most significant bits from each color channel.</p>
2873     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2874     *
2875     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2876     */
2877    @PublicKey
2878    public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2879            new Key<int[]>("android.sensor.testPatternData", int[].class);
2880
2881    /**
2882     * <p>When enabled, the sensor sends a test pattern instead of
2883     * doing a real exposure from the camera.</p>
2884     * <p>When a test pattern is enabled, all manual sensor controls specified
2885     * by android.sensor.* will be ignored. All other controls should
2886     * work as normal.</p>
2887     * <p>For example, if manual flash is enabled, flash firing should still
2888     * occur (and that the test pattern remain unmodified, since the flash
2889     * would not actually affect it).</p>
2890     * <p>Defaults to OFF.</p>
2891     * <p><b>Possible values:</b>
2892     * <ul>
2893     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
2894     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
2895     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
2896     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
2897     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
2898     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
2899     * </ul></p>
2900     * <p><b>Available values for this device:</b><br>
2901     * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
2902     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2903     *
2904     * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
2905     * @see #SENSOR_TEST_PATTERN_MODE_OFF
2906     * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2907     * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2908     * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2909     * @see #SENSOR_TEST_PATTERN_MODE_PN9
2910     * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2911     */
2912    @PublicKey
2913    public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2914            new Key<Integer>("android.sensor.testPatternMode", int.class);
2915
2916    /**
2917     * <p>Duration between the start of first row exposure
2918     * and the start of last row exposure.</p>
2919     * <p>This is the exposure time skew between the first and last
2920     * row exposure start times. The first row and the last row are
2921     * the first and last rows inside of the
2922     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2923     * <p>For typical camera sensors that use rolling shutters, this is also equivalent
2924     * to the frame readout time.</p>
2925     * <p><b>Units</b>: Nanoseconds</p>
2926     * <p><b>Range of valid values:</b><br>
2927     * &gt;= 0 and &lt;
2928     * StreamConfigurationMap#getOutputMinFrameDuration(int, Size).</p>
2929     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2930     * <p><b>Limited capability</b> -
2931     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2932     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2933     *
2934     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2935     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2936     */
2937    @PublicKey
2938    public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
2939            new Key<Long>("android.sensor.rollingShutterSkew", long.class);
2940
2941    /**
2942     * <p>Quality of lens shading correction applied
2943     * to the image data.</p>
2944     * <p>When set to OFF mode, no lens shading correction will be applied by the
2945     * camera device, and an identity lens shading map data will be provided
2946     * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
2947     * shading map with size of <code>[ 4, 3 ]</code>,
2948     * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
2949     * map shown below:</p>
2950     * <pre><code>[ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2951     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2952     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2953     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2954     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2955     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0 ]
2956     * </code></pre>
2957     * <p>When set to other modes, lens shading correction will be applied by the camera
2958     * device. Applications can request lens shading map data by setting
2959     * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
2960     * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
2961     * data will be the one applied by the camera device for this capture request.</p>
2962     * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
2963     * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
2964     * 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>
2965     * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
2966     * to be converged before using the returned shading map data.</p>
2967     * <p><b>Possible values:</b>
2968     * <ul>
2969     *   <li>{@link #SHADING_MODE_OFF OFF}</li>
2970     *   <li>{@link #SHADING_MODE_FAST FAST}</li>
2971     *   <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2972     * </ul></p>
2973     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2974     * <p><b>Full capability</b> -
2975     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2976     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2977     *
2978     * @see CaptureRequest#CONTROL_AE_MODE
2979     * @see CaptureRequest#CONTROL_AWB_MODE
2980     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2981     * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
2982     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2983     * @see #SHADING_MODE_OFF
2984     * @see #SHADING_MODE_FAST
2985     * @see #SHADING_MODE_HIGH_QUALITY
2986     */
2987    @PublicKey
2988    public static final Key<Integer> SHADING_MODE =
2989            new Key<Integer>("android.shading.mode", int.class);
2990
2991    /**
2992     * <p>Operating mode for the face detector
2993     * unit.</p>
2994     * <p>Whether face detection is enabled, and whether it
2995     * should output just the basic fields or the full set of
2996     * fields.</p>
2997     * <p><b>Possible values:</b>
2998     * <ul>
2999     *   <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3000     *   <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3001     *   <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3002     * </ul></p>
3003     * <p><b>Available values for this device:</b><br>
3004     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3005     * <p>This key is available on all devices.</p>
3006     *
3007     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
3008     * @see #STATISTICS_FACE_DETECT_MODE_OFF
3009     * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3010     * @see #STATISTICS_FACE_DETECT_MODE_FULL
3011     */
3012    @PublicKey
3013    public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3014            new Key<Integer>("android.statistics.faceDetectMode", int.class);
3015
3016    /**
3017     * <p>List of unique IDs for detected faces.</p>
3018     * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3019     * to the camera device.  A face that leaves the field of view and later returns may be
3020     * assigned a new ID.</p>
3021     * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3022     * This key is available on all devices.</p>
3023     *
3024     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3025     * @hide
3026     */
3027    public static final Key<int[]> STATISTICS_FACE_IDS =
3028            new Key<int[]>("android.statistics.faceIds", int[].class);
3029
3030    /**
3031     * <p>List of landmarks for detected
3032     * faces.</p>
3033     * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3034     * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
3035     * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3036     * This key is available on all devices.</p>
3037     *
3038     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3039     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3040     * @hide
3041     */
3042    public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3043            new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3044
3045    /**
3046     * <p>List of the bounding rectangles for detected
3047     * faces.</p>
3048     * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3049     * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
3050     * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3051     * This key is available on all devices.</p>
3052     *
3053     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3054     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3055     * @hide
3056     */
3057    public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3058            new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3059
3060    /**
3061     * <p>List of the face confidence scores for
3062     * detected faces</p>
3063     * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
3064     * <p><b>Range of valid values:</b><br>
3065     * 1-100</p>
3066     * <p>This key is available on all devices.</p>
3067     *
3068     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3069     * @hide
3070     */
3071    public static final Key<byte[]> STATISTICS_FACE_SCORES =
3072            new Key<byte[]>("android.statistics.faceScores", byte[].class);
3073
3074    /**
3075     * <p>List of the faces detected through camera face detection
3076     * in this capture.</p>
3077     * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
3078     * <p>This key is available on all devices.</p>
3079     *
3080     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3081     */
3082    @PublicKey
3083    @SyntheticKey
3084    public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3085            new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3086
3087    /**
3088     * <p>The shading map is a low-resolution floating-point map
3089     * that lists the coefficients used to correct for vignetting, for each
3090     * Bayer color channel.</p>
3091     * <p>The least shaded section of the image should have a gain factor
3092     * of 1; all other sections should have gains above 1.</p>
3093     * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
3094     * must take into account the colorCorrection settings.</p>
3095     * <p>The shading map is for the entire active pixel array, and is not
3096     * affected by the crop region specified in the request. Each shading map
3097     * entry is the value of the shading compensation map over a specific
3098     * pixel on the sensor.  Specifically, with a (N x M) resolution shading
3099     * map, and an active pixel array size (W x H), shading map entry
3100     * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3101     * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3102     * The map is assumed to be bilinearly interpolated between the sample points.</p>
3103     * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3104     * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3105     * The shading map is stored in a fully interleaved format.</p>
3106     * <p>The shading map should have on the order of 30-40 rows and columns,
3107     * and must be smaller than 64x64.</p>
3108     * <p>As an example, given a very small map defined as:</p>
3109     * <pre><code>width,height = [ 4, 3 ]
3110     * values =
3111     * [ 1.3, 1.2, 1.15, 1.2,  1.2, 1.2, 1.15, 1.2,
3112     *     1.1, 1.2, 1.2, 1.2,  1.3, 1.2, 1.3, 1.3,
3113     *   1.2, 1.2, 1.25, 1.1,  1.1, 1.1, 1.1, 1.0,
3114     *     1.0, 1.0, 1.0, 1.0,  1.2, 1.3, 1.25, 1.2,
3115     *   1.3, 1.2, 1.2, 1.3,   1.2, 1.15, 1.1, 1.2,
3116     *     1.2, 1.1, 1.0, 1.2,  1.3, 1.15, 1.2, 1.3 ]
3117     * </code></pre>
3118     * <p>The low-resolution scaling map images for each channel are
3119     * (displayed using nearest-neighbor interpolation):</p>
3120     * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3121     * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3122     * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3123     * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3124     * <p>As a visualization only, inverting the full-color map to recover an
3125     * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3126     * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
3127     * <p><b>Range of valid values:</b><br>
3128     * Each gain factor is &gt;= 1</p>
3129     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3130     * <p><b>Full capability</b> -
3131     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3132     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3133     *
3134     * @see CaptureRequest#COLOR_CORRECTION_MODE
3135     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3136     */
3137    @PublicKey
3138    public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3139            new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3140
3141    /**
3142     * <p>The shading map is a low-resolution floating-point map
3143     * that lists the coefficients used to correct for vignetting, for each
3144     * Bayer color channel.</p>
3145     * <p>The least shaded section of the image should have a gain factor
3146     * of 1; all other sections should have gains above 1.</p>
3147     * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
3148     * must take into account the colorCorrection settings.</p>
3149     * <p>The shading map is for the entire active pixel array, and is not
3150     * affected by the crop region specified in the request. Each shading map
3151     * entry is the value of the shading compensation map over a specific
3152     * pixel on the sensor.  Specifically, with a (N x M) resolution shading
3153     * map, and an active pixel array size (W x H), shading map entry
3154     * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3155     * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3156     * The map is assumed to be bilinearly interpolated between the sample points.</p>
3157     * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3158     * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3159     * The shading map is stored in a fully interleaved format, and its size
3160     * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
3161     * <p>The shading map should have on the order of 30-40 rows and columns,
3162     * and must be smaller than 64x64.</p>
3163     * <p>As an example, given a very small map defined as:</p>
3164     * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3165     * android.statistics.lensShadingMap =
3166     * [ 1.3, 1.2, 1.15, 1.2,  1.2, 1.2, 1.15, 1.2,
3167     *     1.1, 1.2, 1.2, 1.2,  1.3, 1.2, 1.3, 1.3,
3168     *   1.2, 1.2, 1.25, 1.1,  1.1, 1.1, 1.1, 1.0,
3169     *     1.0, 1.0, 1.0, 1.0,  1.2, 1.3, 1.25, 1.2,
3170     *   1.3, 1.2, 1.2, 1.3,   1.2, 1.15, 1.1, 1.2,
3171     *     1.2, 1.1, 1.0, 1.2,  1.3, 1.15, 1.2, 1.3 ]
3172     * </code></pre>
3173     * <p>The low-resolution scaling map images for each channel are
3174     * (displayed using nearest-neighbor interpolation):</p>
3175     * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3176     * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3177     * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3178     * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3179     * <p>As a visualization only, inverting the full-color map to recover an
3180     * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3181     * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
3182     * <p><b>Range of valid values:</b><br>
3183     * Each gain factor is &gt;= 1</p>
3184     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3185     * <p><b>Full capability</b> -
3186     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3187     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3188     *
3189     * @see CaptureRequest#COLOR_CORRECTION_MODE
3190     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3191     * @hide
3192     */
3193    public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3194            new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3195
3196    /**
3197     * <p>The best-fit color channel gains calculated
3198     * by the camera device's statistics units for the current output frame.</p>
3199     * <p>This may be different than the gains used for this frame,
3200     * since statistics processing on data from a new frame
3201     * typically completes after the transform has already been
3202     * applied to that frame.</p>
3203     * <p>The 4 channel gains are defined in Bayer domain,
3204     * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
3205     * <p>This value should always be calculated by the auto-white balance (AWB) block,
3206     * regardless of the android.control.* current values.</p>
3207     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3208     *
3209     * @see CaptureRequest#COLOR_CORRECTION_GAINS
3210     * @deprecated
3211     * @hide
3212     */
3213    @Deprecated
3214    public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3215            new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3216
3217    /**
3218     * <p>The best-fit color transform matrix estimate
3219     * calculated by the camera device's statistics units for the current
3220     * output frame.</p>
3221     * <p>The camera device will provide the estimate from its
3222     * statistics unit on the white balance transforms to use
3223     * for the next frame. These are the values the camera device believes
3224     * are the best fit for the current output frame. This may
3225     * be different than the transform used for this frame, since
3226     * statistics processing on data from a new frame typically
3227     * completes after the transform has already been applied to
3228     * that frame.</p>
3229     * <p>These estimates must be provided for all frames, even if
3230     * capture settings and color transforms are set by the application.</p>
3231     * <p>This value should always be calculated by the auto-white balance (AWB) block,
3232     * regardless of the android.control.* current values.</p>
3233     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3234     * @deprecated
3235     * @hide
3236     */
3237    @Deprecated
3238    public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3239            new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3240
3241    /**
3242     * <p>The camera device estimated scene illumination lighting
3243     * frequency.</p>
3244     * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3245     * that depends on the local utility power standards. This flicker must be
3246     * accounted for by auto-exposure routines to avoid artifacts in captured images.
3247     * The camera device uses this entry to tell the application what the scene
3248     * illuminant frequency is.</p>
3249     * <p>When manual exposure control is enabled
3250     * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3251     * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3252     * antibanding, and the application can ensure it selects
3253     * exposure times that do not cause banding issues by looking
3254     * into this metadata field. See
3255     * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3256     * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
3257     * <p><b>Possible values:</b>
3258     * <ul>
3259     *   <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3260     *   <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3261     *   <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3262     * </ul></p>
3263     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3264     * <p><b>Full capability</b> -
3265     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3266     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3267     *
3268     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3269     * @see CaptureRequest#CONTROL_AE_MODE
3270     * @see CaptureRequest#CONTROL_MODE
3271     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3272     * @see #STATISTICS_SCENE_FLICKER_NONE
3273     * @see #STATISTICS_SCENE_FLICKER_50HZ
3274     * @see #STATISTICS_SCENE_FLICKER_60HZ
3275     */
3276    @PublicKey
3277    public static final Key<Integer> STATISTICS_SCENE_FLICKER =
3278            new Key<Integer>("android.statistics.sceneFlicker", int.class);
3279
3280    /**
3281     * <p>Operating mode for hot pixel map generation.</p>
3282     * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
3283     * If set to <code>false</code>, no hot pixel map will be returned.</p>
3284     * <p><b>Range of valid values:</b><br>
3285     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
3286     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3287     *
3288     * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
3289     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
3290     */
3291    @PublicKey
3292    public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
3293            new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
3294
3295    /**
3296     * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
3297     * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
3298     * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
3299     * bottom-right of the pixel array, respectively. The width and
3300     * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
3301     * This may include hot pixels that lie outside of the active array
3302     * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
3303     * <p><b>Range of valid values:</b><br></p>
3304     * <p>n &lt;= number of pixels on the sensor.
3305     * The <code>(x, y)</code> coordinates must be bounded by
3306     * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
3307     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3308     *
3309     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3310     * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3311     */
3312    @PublicKey
3313    public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
3314            new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
3315
3316    /**
3317     * <p>Whether the camera device will output the lens
3318     * shading map in output result metadata.</p>
3319     * <p>When set to ON,
3320     * android.statistics.lensShadingMap will be provided in
3321     * the output result metadata.</p>
3322     * <p>ON is always supported on devices with the RAW capability.</p>
3323     * <p><b>Possible values:</b>
3324     * <ul>
3325     *   <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3326     *   <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3327     * </ul></p>
3328     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3329     * <p><b>Full capability</b> -
3330     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3331     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3332     *
3333     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3334     * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3335     * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3336     */
3337    @PublicKey
3338    public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3339            new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3340
3341    /**
3342     * <p>Tonemapping / contrast / gamma curve for the blue
3343     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3344     * CONTRAST_CURVE.</p>
3345     * <p>See android.tonemap.curveRed for more details.</p>
3346     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3347     * <p><b>Full capability</b> -
3348     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3349     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3350     *
3351     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3352     * @see CaptureRequest#TONEMAP_MODE
3353     * @hide
3354     */
3355    public static final Key<float[]> TONEMAP_CURVE_BLUE =
3356            new Key<float[]>("android.tonemap.curveBlue", float[].class);
3357
3358    /**
3359     * <p>Tonemapping / contrast / gamma curve for the green
3360     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3361     * CONTRAST_CURVE.</p>
3362     * <p>See android.tonemap.curveRed for more details.</p>
3363     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3364     * <p><b>Full capability</b> -
3365     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3366     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3367     *
3368     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3369     * @see CaptureRequest#TONEMAP_MODE
3370     * @hide
3371     */
3372    public static final Key<float[]> TONEMAP_CURVE_GREEN =
3373            new Key<float[]>("android.tonemap.curveGreen", float[].class);
3374
3375    /**
3376     * <p>Tonemapping / contrast / gamma curve for the red
3377     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3378     * CONTRAST_CURVE.</p>
3379     * <p>Each channel's curve is defined by an array of control points:</p>
3380     * <pre><code>android.tonemap.curveRed =
3381     *   [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
3382     * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3383     * <p>These are sorted in order of increasing <code>Pin</code>; it is
3384     * required that input values 0.0 and 1.0 are included in the list to
3385     * define a complete mapping. For input values between control points,
3386     * the camera device must linearly interpolate between the control
3387     * points.</p>
3388     * <p>Each curve can have an independent number of points, and the number
3389     * of points can be less than max (that is, the request doesn't have to
3390     * always provide a curve with number of points equivalent to
3391     * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3392     * <p>A few examples, and their corresponding graphical mappings; these
3393     * only specify the red channel and the precision is limited to 4
3394     * digits, for conciseness.</p>
3395     * <p>Linear mapping:</p>
3396     * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
3397     * </code></pre>
3398     * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3399     * <p>Invert mapping:</p>
3400     * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
3401     * </code></pre>
3402     * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3403     * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
3404     * <pre><code>android.tonemap.curveRed = [
3405     *   0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
3406     *   0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
3407     *   0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
3408     *   0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
3409     * </code></pre>
3410     * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3411     * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
3412     * <pre><code>android.tonemap.curveRed = [
3413     *   0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
3414     *   0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
3415     *   0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
3416     *   0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
3417     * </code></pre>
3418     * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
3419     * <p><b>Range of valid values:</b><br>
3420     * 0-1 on both input and output coordinates, normalized
3421     * as a floating-point value such that 0 == black and 1 == white.</p>
3422     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3423     * <p><b>Full capability</b> -
3424     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3425     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3426     *
3427     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3428     * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
3429     * @see CaptureRequest#TONEMAP_MODE
3430     * @hide
3431     */
3432    public static final Key<float[]> TONEMAP_CURVE_RED =
3433            new Key<float[]>("android.tonemap.curveRed", float[].class);
3434
3435    /**
3436     * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
3437     * is CONTRAST_CURVE.</p>
3438     * <p>The tonemapCurve consist of three curves for each of red, green, and blue
3439     * channels respectively. The following example uses the red channel as an
3440     * example. The same logic applies to green and blue channel.
3441     * Each channel's curve is defined by an array of control points:</p>
3442     * <pre><code>curveRed =
3443     *   [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
3444     * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3445     * <p>These are sorted in order of increasing <code>Pin</code>; it is always
3446     * guaranteed that input values 0.0 and 1.0 are included in the list to
3447     * define a complete mapping. For input values between control points,
3448     * the camera device must linearly interpolate between the control
3449     * points.</p>
3450     * <p>Each curve can have an independent number of points, and the number
3451     * of points can be less than max (that is, the request doesn't have to
3452     * always provide a curve with number of points equivalent to
3453     * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3454     * <p>A few examples, and their corresponding graphical mappings; these
3455     * only specify the red channel and the precision is limited to 4
3456     * digits, for conciseness.</p>
3457     * <p>Linear mapping:</p>
3458     * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
3459     * </code></pre>
3460     * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3461     * <p>Invert mapping:</p>
3462     * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
3463     * </code></pre>
3464     * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3465     * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
3466     * <pre><code>curveRed = [
3467     *   (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
3468     *   (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
3469     *   (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
3470     *   (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
3471     * </code></pre>
3472     * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3473     * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
3474     * <pre><code>curveRed = [
3475     *   (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
3476     *   (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
3477     *   (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
3478     *   (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
3479     * </code></pre>
3480     * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
3481     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3482     * <p><b>Full capability</b> -
3483     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3484     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3485     *
3486     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3487     * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
3488     * @see CaptureRequest#TONEMAP_MODE
3489     */
3490    @PublicKey
3491    @SyntheticKey
3492    public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
3493            new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
3494
3495    /**
3496     * <p>High-level global contrast/gamma/tonemapping control.</p>
3497     * <p>When switching to an application-defined contrast curve by setting
3498     * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
3499     * per-channel with a set of <code>(in, out)</code> points that specify the
3500     * mapping from input high-bit-depth pixel value to the output
3501     * low-bit-depth value.  Since the actual pixel ranges of both input
3502     * and output may change depending on the camera pipeline, the values
3503     * are specified by normalized floating-point numbers.</p>
3504     * <p>More-complex color mapping operations such as 3D color look-up
3505     * tables, selective chroma enhancement, or other non-linear color
3506     * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3507     * CONTRAST_CURVE.</p>
3508     * <p>When using either FAST or HIGH_QUALITY, the camera device will
3509     * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
3510     * These values are always available, and as close as possible to the
3511     * actually used nonlinear/nonglobal transforms.</p>
3512     * <p>If a request is sent with CONTRAST_CURVE with the camera device's
3513     * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
3514     * roughly the same.</p>
3515     * <p><b>Possible values:</b>
3516     * <ul>
3517     *   <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
3518     *   <li>{@link #TONEMAP_MODE_FAST FAST}</li>
3519     *   <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3520     * </ul></p>
3521     * <p><b>Available values for this device:</b><br>
3522     * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
3523     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3524     * <p><b>Full capability</b> -
3525     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3526     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3527     *
3528     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3529     * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
3530     * @see CaptureRequest#TONEMAP_CURVE
3531     * @see CaptureRequest#TONEMAP_MODE
3532     * @see #TONEMAP_MODE_CONTRAST_CURVE
3533     * @see #TONEMAP_MODE_FAST
3534     * @see #TONEMAP_MODE_HIGH_QUALITY
3535     */
3536    @PublicKey
3537    public static final Key<Integer> TONEMAP_MODE =
3538            new Key<Integer>("android.tonemap.mode", int.class);
3539
3540    /**
3541     * <p>This LED is nominally used to indicate to the user
3542     * that the camera is powered on and may be streaming images back to the
3543     * Application Processor. In certain rare circumstances, the OS may
3544     * disable this when video is processed locally and not transmitted to
3545     * any untrusted applications.</p>
3546     * <p>In particular, the LED <em>must</em> always be on when the data could be
3547     * transmitted off the device. The LED <em>should</em> always be on whenever
3548     * data is stored locally on the device.</p>
3549     * <p>The LED <em>may</em> be off if a trusted application is using the data that
3550     * doesn't violate the above rules.</p>
3551     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3552     * @hide
3553     */
3554    public static final Key<Boolean> LED_TRANSMIT =
3555            new Key<Boolean>("android.led.transmit", boolean.class);
3556
3557    /**
3558     * <p>Whether black-level compensation is locked
3559     * to its current values, or is free to vary.</p>
3560     * <p>Whether the black level offset was locked for this frame.  Should be
3561     * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless
3562     * a change in other capture settings forced the camera device to
3563     * perform a black level reset.</p>
3564     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3565     * <p><b>Full capability</b> -
3566     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3567     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3568     *
3569     * @see CaptureRequest#BLACK_LEVEL_LOCK
3570     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3571     */
3572    @PublicKey
3573    public static final Key<Boolean> BLACK_LEVEL_LOCK =
3574            new Key<Boolean>("android.blackLevel.lock", boolean.class);
3575
3576    /**
3577     * <p>The frame number corresponding to the last request
3578     * with which the output result (metadata + buffers) has been fully
3579     * synchronized.</p>
3580     * <p>When a request is submitted to the camera device, there is usually a
3581     * delay of several frames before the controls get applied. A camera
3582     * device may either choose to account for this delay by implementing a
3583     * pipeline and carefully submit well-timed atomic control updates, or
3584     * it may start streaming control changes that span over several frame
3585     * boundaries.</p>
3586     * <p>In the latter case, whenever a request's settings change relative to
3587     * the previous submitted request, the full set of changes may take
3588     * multiple frame durations to fully take effect. Some settings may
3589     * take effect sooner (in less frame durations) than others.</p>
3590     * <p>While a set of control changes are being propagated, this value
3591     * will be CONVERGING.</p>
3592     * <p>Once it is fully known that a set of control changes have been
3593     * finished propagating, and the resulting updated control settings
3594     * have been read back by the camera device, this value will be set
3595     * to a non-negative frame number (corresponding to the request to
3596     * which the results have synchronized to).</p>
3597     * <p>Older camera device implementations may not have a way to detect
3598     * when all camera controls have been applied, and will always set this
3599     * value to UNKNOWN.</p>
3600     * <p>FULL capability devices will always have this value set to the
3601     * frame number of the request corresponding to this result.</p>
3602     * <p><em>Further details</em>:</p>
3603     * <ul>
3604     * <li>Whenever a request differs from the last request, any future
3605     * results not yet returned may have this value set to CONVERGING (this
3606     * could include any in-progress captures not yet returned by the camera
3607     * device, for more details see pipeline considerations below).</li>
3608     * <li>Submitting a series of multiple requests that differ from the
3609     * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
3610     * moves the new synchronization frame to the last non-repeating
3611     * request (using the smallest frame number from the contiguous list of
3612     * repeating requests).</li>
3613     * <li>Submitting the same request repeatedly will not change this value
3614     * to CONVERGING, if it was already a non-negative value.</li>
3615     * <li>When this value changes to non-negative, that means that all of the
3616     * metadata controls from the request have been applied, all of the
3617     * metadata controls from the camera device have been read to the
3618     * updated values (into the result), and all of the graphics buffers
3619     * corresponding to this result are also synchronized to the request.</li>
3620     * </ul>
3621     * <p><em>Pipeline considerations</em>:</p>
3622     * <p>Submitting a request with updated controls relative to the previously
3623     * submitted requests may also invalidate the synchronization state
3624     * of all the results corresponding to currently in-flight requests.</p>
3625     * <p>In other words, results for this current request and up to
3626     * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
3627     * android.sync.frameNumber change to CONVERGING.</p>
3628     * <p><b>Possible values:</b>
3629     * <ul>
3630     *   <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
3631     *   <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
3632     * </ul></p>
3633     * <p><b>Available values for this device:</b><br>
3634     * Either a non-negative value corresponding to a
3635     * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
3636     * <p>This key is available on all devices.</p>
3637     *
3638     * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3639     * @see #SYNC_FRAME_NUMBER_CONVERGING
3640     * @see #SYNC_FRAME_NUMBER_UNKNOWN
3641     * @hide
3642     */
3643    public static final Key<Long> SYNC_FRAME_NUMBER =
3644            new Key<Long>("android.sync.frameNumber", long.class);
3645
3646    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3647     * End generated code
3648     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
3649
3650
3651
3652}
3653