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