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