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