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