CaptureResult.java revision cc28a41b48bc687002a9e1fc436d00ca6f0c3692
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;
20
21/**
22 * <p>The results of a single image capture from the image sensor.</p>
23 *
24 * <p>Contains the final configuration for the capture hardware (sensor, lens,
25 * flash), the processing pipeline, the control algorithms, and the output
26 * buffers.</p>
27 *
28 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
29 * {@link CaptureRequest}. All properties listed for capture requests can also
30 * be queried on the capture result, to determine the final values used for
31 * capture. The result also includes additional metadata about the state of the
32 * camera device during the capture.</p>
33 *
34 */
35public final class CaptureResult extends CameraMetadata {
36
37    private final CameraMetadataNative mResults;
38    private final CaptureRequest mRequest;
39    private final int mSequenceId;
40
41    /**
42     * Takes ownership of the passed-in properties object
43     * @hide
44     */
45    public CaptureResult(CameraMetadataNative results, CaptureRequest parent, int sequenceId) {
46        if (results == null) {
47            throw new IllegalArgumentException("results was null");
48        }
49
50        if (parent == null) {
51            throw new IllegalArgumentException("parent was null");
52        }
53
54        mResults = results;
55        mRequest = parent;
56        mSequenceId = sequenceId;
57    }
58
59    @Override
60    public <T> T get(Key<T> key) {
61        return mResults.get(key);
62    }
63
64    /**
65     * Get the request associated with this result.
66     *
67     * <p>Whenever a request is successfully captured, with
68     * {@link CameraDevice.CaptureListener#onCaptureCompleted},
69     * the {@code result}'s {@code getRequest()} will return that {@code request}.
70     * </p>
71     *
72     * <p>In particular,
73     * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() {
74     *     {@literal @}Override
75     *     void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
76     *         assert(myResult.getRequest.equals(myRequest) == true);
77     *     }
78     * };
79     * </code></pre>
80     * </p>
81     *
82     * @return The request associated with this result. Never {@code null}.
83     */
84    public CaptureRequest getRequest() {
85        return mRequest;
86    }
87
88    /**
89     * Get the frame number associated with this result.
90     *
91     * <p>Whenever a request has been processed, regardless of failure or success,
92     * it gets a unique frame number assigned to its future result/failure.</p>
93     *
94     * <p>This value monotonically increments, starting with 0,
95     * for every new result or failure; and the scope is the lifetime of the
96     * {@link CameraDevice}.</p>
97     *
98     * @return int frame number
99     */
100    public int getFrameNumber() {
101        return get(REQUEST_FRAME_COUNT);
102    }
103
104    /**
105     * The sequence ID for this failure that was returned by the
106     * {@link CameraDevice#capture} family of functions.
107     *
108     * <p>The sequence ID is a unique monotonically increasing value starting from 0,
109     * incremented every time a new group of requests is submitted to the CameraDevice.</p>
110     *
111     * @return int The ID for the sequence of requests that this capture result is a part of
112     *
113     * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted
114     */
115    public int getSequenceId() {
116        return mSequenceId;
117    }
118
119    /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
120     * The key entries below this point are generated from metadata
121     * definitions in /system/media/camera/docs. Do not modify by hand or
122     * modify the comment blocks at the start or end.
123     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
124
125
126    /**
127     * <p>A color transform matrix to use to transform
128     * from sensor RGB color space to output linear sRGB color space</p>
129     * <p>This matrix is either set by the camera device when the request
130     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
131     * directly by the application in the request when the
132     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
133     * <p>In the latter case, the camera device may round the matrix to account
134     * for precision issues; the final rounded matrix should be reported back
135     * in this matrix result metadata. The transform should keep the magnitude
136     * of the output color values within <code>[0, 1.0]</code> (assuming input color
137     * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
138     *
139     * @see CaptureRequest#COLOR_CORRECTION_MODE
140     */
141    public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM =
142            new Key<Rational[]>("android.colorCorrection.transform", Rational[].class);
143
144    /**
145     * <p>Gains applying to Bayer raw color channels for
146     * white-balance.</p>
147     * <p>The 4-channel white-balance gains are defined in
148     * the order of <code>[R G_even G_odd B]</code>, where <code>G_even</code> is the gain
149     * for green pixels on even rows of the output, and <code>G_odd</code>
150     * is the gain for green pixels on the odd rows. if a HAL
151     * does not support a separate gain for even/odd green channels,
152     * it should use the <code>G_even</code> value, and write <code>G_odd</code> equal to
153     * <code>G_even</code> in the output result metadata.</p>
154     * <p>This array is either set by the camera device when the request
155     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
156     * directly by the application in the request when the
157     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
158     * <p>The output should be the gains actually applied by the camera device to
159     * the current frame.</p>
160     *
161     * @see CaptureRequest#COLOR_CORRECTION_MODE
162     */
163    public static final Key<float[]> COLOR_CORRECTION_GAINS =
164            new Key<float[]>("android.colorCorrection.gains", float[].class);
165
166    /**
167     * <p>The ID sent with the latest
168     * CAMERA2_TRIGGER_PRECAPTURE_METERING call</p>
169     * <p>Must be 0 if no
170     * CAMERA2_TRIGGER_PRECAPTURE_METERING trigger received yet
171     * by HAL. Always updated even if AE algorithm ignores the
172     * trigger</p>
173     * @hide
174     */
175    public static final Key<Integer> CONTROL_AE_PRECAPTURE_ID =
176            new Key<Integer>("android.control.aePrecaptureId", int.class);
177
178    /**
179     * <p>The desired mode for the camera device's
180     * auto-exposure routine.</p>
181     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
182     * AUTO.</p>
183     * <p>When set to any of the ON modes, the camera device's
184     * auto-exposure routine is enabled, overriding the
185     * application's selected exposure time, sensor sensitivity,
186     * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
187     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
188     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
189     * is selected, the camera device's flash unit controls are
190     * also overridden.</p>
191     * <p>The FLASH modes are only available if the camera device
192     * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
193     * <p>If flash TORCH mode is desired, this field must be set to
194     * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
195     * <p>When set to any of the ON modes, the values chosen by the
196     * camera device auto-exposure routine for the overridden
197     * fields for a given capture will be available in its
198     * CaptureResult.</p>
199     *
200     * @see CaptureRequest#CONTROL_MODE
201     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
202     * @see CaptureRequest#FLASH_MODE
203     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
204     * @see CaptureRequest#SENSOR_FRAME_DURATION
205     * @see CaptureRequest#SENSOR_SENSITIVITY
206     * @see #CONTROL_AE_MODE_OFF
207     * @see #CONTROL_AE_MODE_ON
208     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
209     * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
210     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
211     */
212    public static final Key<Integer> CONTROL_AE_MODE =
213            new Key<Integer>("android.control.aeMode", int.class);
214
215    /**
216     * <p>List of areas to use for
217     * metering.</p>
218     * <p>Each area is a rectangle plus weight: xmin, ymin,
219     * xmax, ymax, weight. The rectangle is defined to be inclusive of the
220     * specified coordinates.</p>
221     * <p>The coordinate system is based on the active pixel array,
222     * with (0,0) being the top-left pixel in the active pixel array, and
223     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
224     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
225     * bottom-right pixel in the active pixel array. The weight
226     * should be nonnegative.</p>
227     * <p>If all regions have 0 weight, then no specific metering area
228     * needs to be used by the camera device. If the metering region is
229     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
230     * will ignore the sections outside the region and output the
231     * used sections in the frame metadata.</p>
232     *
233     * @see CaptureRequest#SCALER_CROP_REGION
234     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
235     */
236    public static final Key<int[]> CONTROL_AE_REGIONS =
237            new Key<int[]>("android.control.aeRegions", int[].class);
238
239    /**
240     * <p>Current state of AE algorithm</p>
241     * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
242     * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
243     * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
244     * the algorithm states to INACTIVE.</p>
245     * <p>The camera device can do several state transitions between two results, if it is
246     * allowed by the state transition table. For example: INACTIVE may never actually be
247     * seen in a result.</p>
248     * <p>The state in the result is the state for this image (in sync with this image): if
249     * AE state becomes CONVERGED, then the image data associated with this result should
250     * be good to use.</p>
251     * <p>Below are state transition tables for different AE modes.</p>
252     * <table>
253     * <thead>
254     * <tr>
255     * <th align="center">State</th>
256     * <th align="center">Transition Cause</th>
257     * <th align="center">New State</th>
258     * <th align="center">Notes</th>
259     * </tr>
260     * </thead>
261     * <tbody>
262     * <tr>
263     * <td align="center">INACTIVE</td>
264     * <td align="center"></td>
265     * <td align="center">INACTIVE</td>
266     * <td align="center">Camera device auto exposure algorithm is disabled</td>
267     * </tr>
268     * </tbody>
269     * </table>
270     * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
271     * <table>
272     * <thead>
273     * <tr>
274     * <th align="center">State</th>
275     * <th align="center">Transition Cause</th>
276     * <th align="center">New State</th>
277     * <th align="center">Notes</th>
278     * </tr>
279     * </thead>
280     * <tbody>
281     * <tr>
282     * <td align="center">INACTIVE</td>
283     * <td align="center">Camera device initiates AE scan</td>
284     * <td align="center">SEARCHING</td>
285     * <td align="center">Values changing</td>
286     * </tr>
287     * <tr>
288     * <td align="center">INACTIVE</td>
289     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
290     * <td align="center">LOCKED</td>
291     * <td align="center">Values locked</td>
292     * </tr>
293     * <tr>
294     * <td align="center">SEARCHING</td>
295     * <td align="center">Camera device finishes AE scan</td>
296     * <td align="center">CONVERGED</td>
297     * <td align="center">Good values, not changing</td>
298     * </tr>
299     * <tr>
300     * <td align="center">SEARCHING</td>
301     * <td align="center">Camera device finishes AE scan</td>
302     * <td align="center">FLASH_REQUIRED</td>
303     * <td align="center">Converged but too dark w/o flash</td>
304     * </tr>
305     * <tr>
306     * <td align="center">SEARCHING</td>
307     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
308     * <td align="center">LOCKED</td>
309     * <td align="center">Values locked</td>
310     * </tr>
311     * <tr>
312     * <td align="center">CONVERGED</td>
313     * <td align="center">Camera device initiates AE scan</td>
314     * <td align="center">SEARCHING</td>
315     * <td align="center">Values changing</td>
316     * </tr>
317     * <tr>
318     * <td align="center">CONVERGED</td>
319     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
320     * <td align="center">LOCKED</td>
321     * <td align="center">Values locked</td>
322     * </tr>
323     * <tr>
324     * <td align="center">FLASH_REQUIRED</td>
325     * <td align="center">Camera device initiates AE scan</td>
326     * <td align="center">SEARCHING</td>
327     * <td align="center">Values changing</td>
328     * </tr>
329     * <tr>
330     * <td align="center">FLASH_REQUIRED</td>
331     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
332     * <td align="center">LOCKED</td>
333     * <td align="center">Values locked</td>
334     * </tr>
335     * <tr>
336     * <td align="center">LOCKED</td>
337     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
338     * <td align="center">SEARCHING</td>
339     * <td align="center">Values not good after unlock</td>
340     * </tr>
341     * <tr>
342     * <td align="center">LOCKED</td>
343     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
344     * <td align="center">CONVERGED</td>
345     * <td align="center">Values good after unlock</td>
346     * </tr>
347     * <tr>
348     * <td align="center">LOCKED</td>
349     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
350     * <td align="center">FLASH_REQUIRED</td>
351     * <td align="center">Exposure good, but too dark</td>
352     * </tr>
353     * <tr>
354     * <td align="center">PRECAPTURE</td>
355     * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
356     * <td align="center">CONVERGED</td>
357     * <td align="center">Ready for high-quality capture</td>
358     * </tr>
359     * <tr>
360     * <td align="center">PRECAPTURE</td>
361     * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
362     * <td align="center">LOCKED</td>
363     * <td align="center">Ready for high-quality capture</td>
364     * </tr>
365     * <tr>
366     * <td align="center">Any state</td>
367     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
368     * <td align="center">PRECAPTURE</td>
369     * <td align="center">Start AE precapture metering sequence</td>
370     * </tr>
371     * </tbody>
372     * </table>
373     * <p>For the above table, the camera device may skip reporting any state changes that happen
374     * without application intervention (i.e. mode switch, trigger, locking). Any state that
375     * can be skipped in that manner is called a transient state.</p>
376     * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
377     * listed in above table, it is also legal for the camera device to skip one or more
378     * transient states between two results. See below table for examples:</p>
379     * <table>
380     * <thead>
381     * <tr>
382     * <th align="center">State</th>
383     * <th align="center">Transition Cause</th>
384     * <th align="center">New State</th>
385     * <th align="center">Notes</th>
386     * </tr>
387     * </thead>
388     * <tbody>
389     * <tr>
390     * <td align="center">INACTIVE</td>
391     * <td align="center">Camera device finished AE scan</td>
392     * <td align="center">CONVERGED</td>
393     * <td align="center">Values are already good, transient states are skipped by camera device.</td>
394     * </tr>
395     * <tr>
396     * <td align="center">Any state</td>
397     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
398     * <td align="center">FLASH_REQUIRED</td>
399     * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
400     * </tr>
401     * <tr>
402     * <td align="center">Any state</td>
403     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
404     * <td align="center">CONVERGED</td>
405     * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
406     * </tr>
407     * <tr>
408     * <td align="center">CONVERGED</td>
409     * <td align="center">Camera device finished AE scan</td>
410     * <td align="center">FLASH_REQUIRED</td>
411     * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
412     * </tr>
413     * <tr>
414     * <td align="center">FLASH_REQUIRED</td>
415     * <td align="center">Camera device finished AE scan</td>
416     * <td align="center">CONVERGED</td>
417     * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
418     * </tr>
419     * </tbody>
420     * </table>
421     *
422     * @see CaptureRequest#CONTROL_AE_LOCK
423     * @see CaptureRequest#CONTROL_AE_MODE
424     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
425     * @see CaptureRequest#CONTROL_MODE
426     * @see CaptureRequest#CONTROL_SCENE_MODE
427     * @see #CONTROL_AE_STATE_INACTIVE
428     * @see #CONTROL_AE_STATE_SEARCHING
429     * @see #CONTROL_AE_STATE_CONVERGED
430     * @see #CONTROL_AE_STATE_LOCKED
431     * @see #CONTROL_AE_STATE_FLASH_REQUIRED
432     * @see #CONTROL_AE_STATE_PRECAPTURE
433     */
434    public static final Key<Integer> CONTROL_AE_STATE =
435            new Key<Integer>("android.control.aeState", int.class);
436
437    /**
438     * <p>Whether AF is currently enabled, and what
439     * mode it is set to</p>
440     * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
441     * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>).</p>
442     * <p>If the lens is controlled by the camera device auto-focus algorithm,
443     * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
444     * in result metadata.</p>
445     *
446     * @see CaptureResult#CONTROL_AF_STATE
447     * @see CaptureRequest#CONTROL_MODE
448     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
449     * @see #CONTROL_AF_MODE_OFF
450     * @see #CONTROL_AF_MODE_AUTO
451     * @see #CONTROL_AF_MODE_MACRO
452     * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
453     * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
454     * @see #CONTROL_AF_MODE_EDOF
455     */
456    public static final Key<Integer> CONTROL_AF_MODE =
457            new Key<Integer>("android.control.afMode", int.class);
458
459    /**
460     * <p>List of areas to use for focus
461     * estimation.</p>
462     * <p>Each area is a rectangle plus weight: xmin, ymin,
463     * xmax, ymax, weight. The rectangle is defined to be inclusive of the
464     * specified coordinates.</p>
465     * <p>The coordinate system is based on the active pixel array,
466     * with (0,0) being the top-left pixel in the active pixel array, and
467     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
468     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
469     * bottom-right pixel in the active pixel array. The weight
470     * should be nonnegative.</p>
471     * <p>If all regions have 0 weight, then no specific focus area
472     * needs to be used by the camera device. If the focusing region is
473     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
474     * will ignore the sections outside the region and output the
475     * used sections in the frame metadata.</p>
476     *
477     * @see CaptureRequest#SCALER_CROP_REGION
478     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
479     */
480    public static final Key<int[]> CONTROL_AF_REGIONS =
481            new Key<int[]>("android.control.afRegions", int[].class);
482
483    /**
484     * <p>Current state of AF algorithm.</p>
485     * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
486     * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
487     * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
488     * the algorithm states to INACTIVE.</p>
489     * <p>The camera device can do several state transitions between two results, if it is
490     * allowed by the state transition table. For example: INACTIVE may never actually be
491     * seen in a result.</p>
492     * <p>The state in the result is the state for this image (in sync with this image): if
493     * AF state becomes FOCUSED, then the image data associated with this result should
494     * be sharp.</p>
495     * <p>Below are state transition tables for different AF modes.</p>
496     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
497     * <table>
498     * <thead>
499     * <tr>
500     * <th align="center">State</th>
501     * <th align="center">Transition Cause</th>
502     * <th align="center">New State</th>
503     * <th align="center">Notes</th>
504     * </tr>
505     * </thead>
506     * <tbody>
507     * <tr>
508     * <td align="center">INACTIVE</td>
509     * <td align="center"></td>
510     * <td align="center">INACTIVE</td>
511     * <td align="center">Never changes</td>
512     * </tr>
513     * </tbody>
514     * </table>
515     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
516     * <table>
517     * <thead>
518     * <tr>
519     * <th align="center">State</th>
520     * <th align="center">Transition Cause</th>
521     * <th align="center">New State</th>
522     * <th align="center">Notes</th>
523     * </tr>
524     * </thead>
525     * <tbody>
526     * <tr>
527     * <td align="center">INACTIVE</td>
528     * <td align="center">AF_TRIGGER</td>
529     * <td align="center">ACTIVE_SCAN</td>
530     * <td align="center">Start AF sweep, Lens now moving</td>
531     * </tr>
532     * <tr>
533     * <td align="center">ACTIVE_SCAN</td>
534     * <td align="center">AF sweep done</td>
535     * <td align="center">FOCUSED_LOCKED</td>
536     * <td align="center">Focused, Lens now locked</td>
537     * </tr>
538     * <tr>
539     * <td align="center">ACTIVE_SCAN</td>
540     * <td align="center">AF sweep done</td>
541     * <td align="center">NOT_FOCUSED_LOCKED</td>
542     * <td align="center">Not focused, Lens now locked</td>
543     * </tr>
544     * <tr>
545     * <td align="center">ACTIVE_SCAN</td>
546     * <td align="center">AF_CANCEL</td>
547     * <td align="center">INACTIVE</td>
548     * <td align="center">Cancel/reset AF, Lens now locked</td>
549     * </tr>
550     * <tr>
551     * <td align="center">FOCUSED_LOCKED</td>
552     * <td align="center">AF_CANCEL</td>
553     * <td align="center">INACTIVE</td>
554     * <td align="center">Cancel/reset AF</td>
555     * </tr>
556     * <tr>
557     * <td align="center">FOCUSED_LOCKED</td>
558     * <td align="center">AF_TRIGGER</td>
559     * <td align="center">ACTIVE_SCAN</td>
560     * <td align="center">Start new sweep, Lens now moving</td>
561     * </tr>
562     * <tr>
563     * <td align="center">NOT_FOCUSED_LOCKED</td>
564     * <td align="center">AF_CANCEL</td>
565     * <td align="center">INACTIVE</td>
566     * <td align="center">Cancel/reset AF</td>
567     * </tr>
568     * <tr>
569     * <td align="center">NOT_FOCUSED_LOCKED</td>
570     * <td align="center">AF_TRIGGER</td>
571     * <td align="center">ACTIVE_SCAN</td>
572     * <td align="center">Start new sweep, Lens now moving</td>
573     * </tr>
574     * <tr>
575     * <td align="center">Any state</td>
576     * <td align="center">Mode change</td>
577     * <td align="center">INACTIVE</td>
578     * <td align="center"></td>
579     * </tr>
580     * </tbody>
581     * </table>
582     * <p>For the above table, the camera device may skip reporting any state changes that happen
583     * without application intervention (i.e. mode switch, trigger, locking). Any state that
584     * can be skipped in that manner is called a transient state.</p>
585     * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
586     * state transitions listed in above table, it is also legal for the camera device to skip
587     * one or more transient states between two results. See below table for examples:</p>
588     * <table>
589     * <thead>
590     * <tr>
591     * <th align="center">State</th>
592     * <th align="center">Transition Cause</th>
593     * <th align="center">New State</th>
594     * <th align="center">Notes</th>
595     * </tr>
596     * </thead>
597     * <tbody>
598     * <tr>
599     * <td align="center">INACTIVE</td>
600     * <td align="center">AF_TRIGGER</td>
601     * <td align="center">FOCUSED_LOCKED</td>
602     * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
603     * </tr>
604     * <tr>
605     * <td align="center">INACTIVE</td>
606     * <td align="center">AF_TRIGGER</td>
607     * <td align="center">NOT_FOCUSED_LOCKED</td>
608     * <td align="center">Focus failed after a scan, lens is now locked.</td>
609     * </tr>
610     * <tr>
611     * <td align="center">FOCUSED_LOCKED</td>
612     * <td align="center">AF_TRIGGER</td>
613     * <td align="center">FOCUSED_LOCKED</td>
614     * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
615     * </tr>
616     * <tr>
617     * <td align="center">NOT_FOCUSED_LOCKED</td>
618     * <td align="center">AF_TRIGGER</td>
619     * <td align="center">FOCUSED_LOCKED</td>
620     * <td align="center">Focus is good after a scan, lens is not locked.</td>
621     * </tr>
622     * </tbody>
623     * </table>
624     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
625     * <table>
626     * <thead>
627     * <tr>
628     * <th align="center">State</th>
629     * <th align="center">Transition Cause</th>
630     * <th align="center">New State</th>
631     * <th align="center">Notes</th>
632     * </tr>
633     * </thead>
634     * <tbody>
635     * <tr>
636     * <td align="center">INACTIVE</td>
637     * <td align="center">Camera device initiates new scan</td>
638     * <td align="center">PASSIVE_SCAN</td>
639     * <td align="center">Start AF scan, Lens now moving</td>
640     * </tr>
641     * <tr>
642     * <td align="center">INACTIVE</td>
643     * <td align="center">AF_TRIGGER</td>
644     * <td align="center">NOT_FOCUSED_LOCKED</td>
645     * <td align="center">AF state query, Lens now locked</td>
646     * </tr>
647     * <tr>
648     * <td align="center">PASSIVE_SCAN</td>
649     * <td align="center">Camera device completes current scan</td>
650     * <td align="center">PASSIVE_FOCUSED</td>
651     * <td align="center">End AF scan, Lens now locked</td>
652     * </tr>
653     * <tr>
654     * <td align="center">PASSIVE_SCAN</td>
655     * <td align="center">Camera device fails current scan</td>
656     * <td align="center">PASSIVE_UNFOCUSED</td>
657     * <td align="center">End AF scan, Lens now locked</td>
658     * </tr>
659     * <tr>
660     * <td align="center">PASSIVE_SCAN</td>
661     * <td align="center">AF_TRIGGER</td>
662     * <td align="center">FOCUSED_LOCKED</td>
663     * <td align="center">Immediate trans. If focus is good, Lens now locked</td>
664     * </tr>
665     * <tr>
666     * <td align="center">PASSIVE_SCAN</td>
667     * <td align="center">AF_TRIGGER</td>
668     * <td align="center">NOT_FOCUSED_LOCKED</td>
669     * <td align="center">Immediate trans. if focus is bad, Lens now locked</td>
670     * </tr>
671     * <tr>
672     * <td align="center">PASSIVE_SCAN</td>
673     * <td align="center">AF_CANCEL</td>
674     * <td align="center">INACTIVE</td>
675     * <td align="center">Reset lens position, Lens now locked</td>
676     * </tr>
677     * <tr>
678     * <td align="center">PASSIVE_FOCUSED</td>
679     * <td align="center">Camera device initiates new scan</td>
680     * <td align="center">PASSIVE_SCAN</td>
681     * <td align="center">Start AF scan, Lens now moving</td>
682     * </tr>
683     * <tr>
684     * <td align="center">PASSIVE_UNFOCUSED</td>
685     * <td align="center">Camera device initiates new scan</td>
686     * <td align="center">PASSIVE_SCAN</td>
687     * <td align="center">Start AF scan, Lens now moving</td>
688     * </tr>
689     * <tr>
690     * <td align="center">PASSIVE_FOCUSED</td>
691     * <td align="center">AF_TRIGGER</td>
692     * <td align="center">FOCUSED_LOCKED</td>
693     * <td align="center">Immediate trans. Lens now locked</td>
694     * </tr>
695     * <tr>
696     * <td align="center">PASSIVE_UNFOCUSED</td>
697     * <td align="center">AF_TRIGGER</td>
698     * <td align="center">NOT_FOCUSED_LOCKED</td>
699     * <td align="center">Immediate trans. Lens now locked</td>
700     * </tr>
701     * <tr>
702     * <td align="center">FOCUSED_LOCKED</td>
703     * <td align="center">AF_TRIGGER</td>
704     * <td align="center">FOCUSED_LOCKED</td>
705     * <td align="center">No effect</td>
706     * </tr>
707     * <tr>
708     * <td align="center">FOCUSED_LOCKED</td>
709     * <td align="center">AF_CANCEL</td>
710     * <td align="center">INACTIVE</td>
711     * <td align="center">Restart AF scan</td>
712     * </tr>
713     * <tr>
714     * <td align="center">NOT_FOCUSED_LOCKED</td>
715     * <td align="center">AF_TRIGGER</td>
716     * <td align="center">NOT_FOCUSED_LOCKED</td>
717     * <td align="center">No effect</td>
718     * </tr>
719     * <tr>
720     * <td align="center">NOT_FOCUSED_LOCKED</td>
721     * <td align="center">AF_CANCEL</td>
722     * <td align="center">INACTIVE</td>
723     * <td align="center">Restart AF scan</td>
724     * </tr>
725     * </tbody>
726     * </table>
727     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
728     * <table>
729     * <thead>
730     * <tr>
731     * <th align="center">State</th>
732     * <th align="center">Transition Cause</th>
733     * <th align="center">New State</th>
734     * <th align="center">Notes</th>
735     * </tr>
736     * </thead>
737     * <tbody>
738     * <tr>
739     * <td align="center">INACTIVE</td>
740     * <td align="center">Camera device initiates new scan</td>
741     * <td align="center">PASSIVE_SCAN</td>
742     * <td align="center">Start AF scan, Lens now moving</td>
743     * </tr>
744     * <tr>
745     * <td align="center">INACTIVE</td>
746     * <td align="center">AF_TRIGGER</td>
747     * <td align="center">NOT_FOCUSED_LOCKED</td>
748     * <td align="center">AF state query, Lens now locked</td>
749     * </tr>
750     * <tr>
751     * <td align="center">PASSIVE_SCAN</td>
752     * <td align="center">Camera device completes current scan</td>
753     * <td align="center">PASSIVE_FOCUSED</td>
754     * <td align="center">End AF scan, Lens now locked</td>
755     * </tr>
756     * <tr>
757     * <td align="center">PASSIVE_SCAN</td>
758     * <td align="center">Camera device fails current scan</td>
759     * <td align="center">PASSIVE_UNFOCUSED</td>
760     * <td align="center">End AF scan, Lens now locked</td>
761     * </tr>
762     * <tr>
763     * <td align="center">PASSIVE_SCAN</td>
764     * <td align="center">AF_TRIGGER</td>
765     * <td align="center">FOCUSED_LOCKED</td>
766     * <td align="center">Eventual trans. once focus good, Lens now locked</td>
767     * </tr>
768     * <tr>
769     * <td align="center">PASSIVE_SCAN</td>
770     * <td align="center">AF_TRIGGER</td>
771     * <td align="center">NOT_FOCUSED_LOCKED</td>
772     * <td align="center">Eventual trans. if cannot focus, Lens now locked</td>
773     * </tr>
774     * <tr>
775     * <td align="center">PASSIVE_SCAN</td>
776     * <td align="center">AF_CANCEL</td>
777     * <td align="center">INACTIVE</td>
778     * <td align="center">Reset lens position, Lens now locked</td>
779     * </tr>
780     * <tr>
781     * <td align="center">PASSIVE_FOCUSED</td>
782     * <td align="center">Camera device initiates new scan</td>
783     * <td align="center">PASSIVE_SCAN</td>
784     * <td align="center">Start AF scan, Lens now moving</td>
785     * </tr>
786     * <tr>
787     * <td align="center">PASSIVE_UNFOCUSED</td>
788     * <td align="center">Camera device initiates new scan</td>
789     * <td align="center">PASSIVE_SCAN</td>
790     * <td align="center">Start AF scan, Lens now moving</td>
791     * </tr>
792     * <tr>
793     * <td align="center">PASSIVE_FOCUSED</td>
794     * <td align="center">AF_TRIGGER</td>
795     * <td align="center">FOCUSED_LOCKED</td>
796     * <td align="center">Immediate trans. Lens now locked</td>
797     * </tr>
798     * <tr>
799     * <td align="center">PASSIVE_UNFOCUSED</td>
800     * <td align="center">AF_TRIGGER</td>
801     * <td align="center">NOT_FOCUSED_LOCKED</td>
802     * <td align="center">Immediate trans. Lens now locked</td>
803     * </tr>
804     * <tr>
805     * <td align="center">FOCUSED_LOCKED</td>
806     * <td align="center">AF_TRIGGER</td>
807     * <td align="center">FOCUSED_LOCKED</td>
808     * <td align="center">No effect</td>
809     * </tr>
810     * <tr>
811     * <td align="center">FOCUSED_LOCKED</td>
812     * <td align="center">AF_CANCEL</td>
813     * <td align="center">INACTIVE</td>
814     * <td align="center">Restart AF scan</td>
815     * </tr>
816     * <tr>
817     * <td align="center">NOT_FOCUSED_LOCKED</td>
818     * <td align="center">AF_TRIGGER</td>
819     * <td align="center">NOT_FOCUSED_LOCKED</td>
820     * <td align="center">No effect</td>
821     * </tr>
822     * <tr>
823     * <td align="center">NOT_FOCUSED_LOCKED</td>
824     * <td align="center">AF_CANCEL</td>
825     * <td align="center">INACTIVE</td>
826     * <td align="center">Restart AF scan</td>
827     * </tr>
828     * </tbody>
829     * </table>
830     * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
831     * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
832     * camera device. When a trigger is included in a mode switch request, the trigger
833     * will be evaluated in the context of the new mode in the request.
834     * See below table for examples:</p>
835     * <table>
836     * <thead>
837     * <tr>
838     * <th align="center">State</th>
839     * <th align="center">Transition Cause</th>
840     * <th align="center">New State</th>
841     * <th align="center">Notes</th>
842     * </tr>
843     * </thead>
844     * <tbody>
845     * <tr>
846     * <td align="center">any state</td>
847     * <td align="center">CAF--&gt;AUTO mode switch</td>
848     * <td align="center">INACTIVE</td>
849     * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
850     * </tr>
851     * <tr>
852     * <td align="center">any state</td>
853     * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
854     * <td align="center">trigger-reachable states from INACTIVE</td>
855     * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
856     * </tr>
857     * <tr>
858     * <td align="center">any state</td>
859     * <td align="center">AUTO--&gt;CAF mode switch</td>
860     * <td align="center">passively reachable states from INACTIVE</td>
861     * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
862     * </tr>
863     * </tbody>
864     * </table>
865     *
866     * @see CaptureRequest#CONTROL_AF_MODE
867     * @see CaptureRequest#CONTROL_MODE
868     * @see CaptureRequest#CONTROL_SCENE_MODE
869     * @see #CONTROL_AF_STATE_INACTIVE
870     * @see #CONTROL_AF_STATE_PASSIVE_SCAN
871     * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
872     * @see #CONTROL_AF_STATE_ACTIVE_SCAN
873     * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
874     * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
875     * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
876     */
877    public static final Key<Integer> CONTROL_AF_STATE =
878            new Key<Integer>("android.control.afState", int.class);
879
880    /**
881     * <p>The ID sent with the latest
882     * CAMERA2_TRIGGER_AUTOFOCUS call</p>
883     * <p>Must be 0 if no CAMERA2_TRIGGER_AUTOFOCUS trigger
884     * received yet by HAL. Always updated even if AF algorithm
885     * ignores the trigger</p>
886     * @hide
887     */
888    public static final Key<Integer> CONTROL_AF_TRIGGER_ID =
889            new Key<Integer>("android.control.afTriggerId", int.class);
890
891    /**
892     * <p>Whether AWB is currently setting the color
893     * transform fields, and what its illumination target
894     * is.</p>
895     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
896     * <p>When set to the ON mode, the camera device's auto white balance
897     * routine is enabled, overriding the application's selected
898     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
899     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
900     * <p>When set to the OFF mode, the camera device's auto white balance
901     * routine is disabled. The application manually controls the white
902     * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
903     * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
904     * <p>When set to any other modes, the camera device's auto white balance
905     * routine is disabled. The camera device uses each particular illumination
906     * target for white balance adjustment.</p>
907     *
908     * @see CaptureRequest#COLOR_CORRECTION_GAINS
909     * @see CaptureRequest#COLOR_CORRECTION_MODE
910     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
911     * @see CaptureRequest#CONTROL_MODE
912     * @see #CONTROL_AWB_MODE_OFF
913     * @see #CONTROL_AWB_MODE_AUTO
914     * @see #CONTROL_AWB_MODE_INCANDESCENT
915     * @see #CONTROL_AWB_MODE_FLUORESCENT
916     * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
917     * @see #CONTROL_AWB_MODE_DAYLIGHT
918     * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
919     * @see #CONTROL_AWB_MODE_TWILIGHT
920     * @see #CONTROL_AWB_MODE_SHADE
921     */
922    public static final Key<Integer> CONTROL_AWB_MODE =
923            new Key<Integer>("android.control.awbMode", int.class);
924
925    /**
926     * <p>List of areas to use for illuminant
927     * estimation.</p>
928     * <p>Only used in AUTO mode.</p>
929     * <p>Each area is a rectangle plus weight: xmin, ymin,
930     * xmax, ymax, weight. The rectangle is defined to be inclusive of the
931     * specified coordinates.</p>
932     * <p>The coordinate system is based on the active pixel array,
933     * with (0,0) being the top-left pixel in the active pixel array, and
934     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
935     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
936     * bottom-right pixel in the active pixel array. The weight
937     * should be nonnegative.</p>
938     * <p>If all regions have 0 weight, then no specific auto-white balance (AWB) area
939     * needs to be used by the camera device. If the AWB region is
940     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
941     * will ignore the sections outside the region and output the
942     * used sections in the frame metadata.</p>
943     *
944     * @see CaptureRequest#SCALER_CROP_REGION
945     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
946     */
947    public static final Key<int[]> CONTROL_AWB_REGIONS =
948            new Key<int[]>("android.control.awbRegions", int[].class);
949
950    /**
951     * <p>Current state of AWB algorithm</p>
952     * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
953     * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
954     * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
955     * the algorithm states to INACTIVE.</p>
956     * <p>The camera device can do several state transitions between two results, if it is
957     * allowed by the state transition table. So INACTIVE may never actually be seen in
958     * a result.</p>
959     * <p>The state in the result is the state for this image (in sync with this image): if
960     * AWB state becomes CONVERGED, then the image data associated with this result should
961     * be good to use.</p>
962     * <p>Below are state transition tables for different AWB modes.</p>
963     * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
964     * <table>
965     * <thead>
966     * <tr>
967     * <th align="center">State</th>
968     * <th align="center">Transition Cause</th>
969     * <th align="center">New State</th>
970     * <th align="center">Notes</th>
971     * </tr>
972     * </thead>
973     * <tbody>
974     * <tr>
975     * <td align="center">INACTIVE</td>
976     * <td align="center"></td>
977     * <td align="center">INACTIVE</td>
978     * <td align="center">Camera device auto white balance algorithm is disabled</td>
979     * </tr>
980     * </tbody>
981     * </table>
982     * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
983     * <table>
984     * <thead>
985     * <tr>
986     * <th align="center">State</th>
987     * <th align="center">Transition Cause</th>
988     * <th align="center">New State</th>
989     * <th align="center">Notes</th>
990     * </tr>
991     * </thead>
992     * <tbody>
993     * <tr>
994     * <td align="center">INACTIVE</td>
995     * <td align="center">Camera device initiates AWB scan</td>
996     * <td align="center">SEARCHING</td>
997     * <td align="center">Values changing</td>
998     * </tr>
999     * <tr>
1000     * <td align="center">INACTIVE</td>
1001     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1002     * <td align="center">LOCKED</td>
1003     * <td align="center">Values locked</td>
1004     * </tr>
1005     * <tr>
1006     * <td align="center">SEARCHING</td>
1007     * <td align="center">Camera device finishes AWB scan</td>
1008     * <td align="center">CONVERGED</td>
1009     * <td align="center">Good values, not changing</td>
1010     * </tr>
1011     * <tr>
1012     * <td align="center">SEARCHING</td>
1013     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1014     * <td align="center">LOCKED</td>
1015     * <td align="center">Values locked</td>
1016     * </tr>
1017     * <tr>
1018     * <td align="center">CONVERGED</td>
1019     * <td align="center">Camera device initiates AWB scan</td>
1020     * <td align="center">SEARCHING</td>
1021     * <td align="center">Values changing</td>
1022     * </tr>
1023     * <tr>
1024     * <td align="center">CONVERGED</td>
1025     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1026     * <td align="center">LOCKED</td>
1027     * <td align="center">Values locked</td>
1028     * </tr>
1029     * <tr>
1030     * <td align="center">LOCKED</td>
1031     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1032     * <td align="center">SEARCHING</td>
1033     * <td align="center">Values not good after unlock</td>
1034     * </tr>
1035     * </tbody>
1036     * </table>
1037     * <p>For the above table, the camera device may skip reporting any state changes that happen
1038     * without application intervention (i.e. mode switch, trigger, locking). Any state that
1039     * can be skipped in that manner is called a transient state.</p>
1040     * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1041     * listed in above table, it is also legal for the camera device to skip one or more
1042     * transient states between two results. See below table for examples:</p>
1043     * <table>
1044     * <thead>
1045     * <tr>
1046     * <th align="center">State</th>
1047     * <th align="center">Transition Cause</th>
1048     * <th align="center">New State</th>
1049     * <th align="center">Notes</th>
1050     * </tr>
1051     * </thead>
1052     * <tbody>
1053     * <tr>
1054     * <td align="center">INACTIVE</td>
1055     * <td align="center">Camera device finished AWB scan</td>
1056     * <td align="center">CONVERGED</td>
1057     * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1058     * </tr>
1059     * <tr>
1060     * <td align="center">LOCKED</td>
1061     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1062     * <td align="center">CONVERGED</td>
1063     * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
1064     * </tr>
1065     * </tbody>
1066     * </table>
1067     *
1068     * @see CaptureRequest#CONTROL_AWB_LOCK
1069     * @see CaptureRequest#CONTROL_AWB_MODE
1070     * @see CaptureRequest#CONTROL_MODE
1071     * @see CaptureRequest#CONTROL_SCENE_MODE
1072     * @see #CONTROL_AWB_STATE_INACTIVE
1073     * @see #CONTROL_AWB_STATE_SEARCHING
1074     * @see #CONTROL_AWB_STATE_CONVERGED
1075     * @see #CONTROL_AWB_STATE_LOCKED
1076     */
1077    public static final Key<Integer> CONTROL_AWB_STATE =
1078            new Key<Integer>("android.control.awbState", int.class);
1079
1080    /**
1081     * <p>Overall mode of 3A control
1082     * routines.</p>
1083     * <p>High-level 3A control. When set to OFF, all 3A control
1084     * by the camera device is disabled. The application must set the fields for
1085     * capture parameters itself.</p>
1086     * <p>When set to AUTO, the individual algorithm controls in
1087     * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
1088     * <p>When set to USE_SCENE_MODE, the individual controls in
1089     * android.control.* are mostly disabled, and the camera device implements
1090     * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
1091     * as it wishes. The camera device scene mode 3A settings are provided by
1092     * android.control.sceneModeOverrides.</p>
1093     * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1094     * is that this frame will not be used by camera device background 3A statistics
1095     * update, as if this frame is never captured. This mode can be used in the scenario
1096     * where the application doesn't want a 3A manual control capture to affect
1097     * the subsequent auto 3A capture results.</p>
1098     *
1099     * @see CaptureRequest#CONTROL_AF_MODE
1100     * @see #CONTROL_MODE_OFF
1101     * @see #CONTROL_MODE_AUTO
1102     * @see #CONTROL_MODE_USE_SCENE_MODE
1103     * @see #CONTROL_MODE_OFF_KEEP_STATE
1104     */
1105    public static final Key<Integer> CONTROL_MODE =
1106            new Key<Integer>("android.control.mode", int.class);
1107
1108    /**
1109     * <p>Operation mode for edge
1110     * enhancement.</p>
1111     * <p>Edge/sharpness/detail enhancement. OFF means no
1112     * enhancement will be applied by the camera device.</p>
1113     * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
1114     * will be applied. HIGH_QUALITY mode indicates that the
1115     * camera device will use the highest-quality enhancement algorithms,
1116     * even if it slows down capture rate. FAST means the camera device will
1117     * not slow down capture rate when applying edge enhancement.</p>
1118     * @see #EDGE_MODE_OFF
1119     * @see #EDGE_MODE_FAST
1120     * @see #EDGE_MODE_HIGH_QUALITY
1121     */
1122    public static final Key<Integer> EDGE_MODE =
1123            new Key<Integer>("android.edge.mode", int.class);
1124
1125    /**
1126     * <p>The desired mode for for the camera device's flash control.</p>
1127     * <p>This control is only effective when flash unit is available
1128     * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
1129     * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
1130     * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
1131     * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
1132     * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
1133     * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
1134     * device's auto-exposure routine's result. When used in still capture case, this
1135     * control should be used along with AE precapture metering sequence
1136     * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
1137     * <p>When set to TORCH, the flash will be on continuously. This mode can be used
1138     * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
1139     * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
1140     *
1141     * @see CaptureRequest#CONTROL_AE_MODE
1142     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1143     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
1144     * @see CaptureResult#FLASH_STATE
1145     * @see #FLASH_MODE_OFF
1146     * @see #FLASH_MODE_SINGLE
1147     * @see #FLASH_MODE_TORCH
1148     */
1149    public static final Key<Integer> FLASH_MODE =
1150            new Key<Integer>("android.flash.mode", int.class);
1151
1152    /**
1153     * <p>Current state of the flash
1154     * unit.</p>
1155     * <p>When the camera device doesn't have flash unit
1156     * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
1157     * Other states indicate the current flash status.</p>
1158     *
1159     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
1160     * @see #FLASH_STATE_UNAVAILABLE
1161     * @see #FLASH_STATE_CHARGING
1162     * @see #FLASH_STATE_READY
1163     * @see #FLASH_STATE_FIRED
1164     */
1165    public static final Key<Integer> FLASH_STATE =
1166            new Key<Integer>("android.flash.state", int.class);
1167
1168    /**
1169     * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the
1170     * sensor, where <code>(x, y)</code> lies between <code>(0, 0)</code>, which is the top-left
1171     * of the pixel array, and the width,height of the pixel array given in
1172     * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.  This may include hot pixels
1173     * that lie outside of the active array bounds given by
1174     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
1175     *
1176     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1177     * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
1178     */
1179    public static final Key<int[]> HOT_PIXEL_MAP =
1180            new Key<int[]>("android.hotPixel.map", int[].class);
1181
1182    /**
1183     * <p>Set operational mode for hot pixel correction.</p>
1184     * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
1185     * that do not accurately encode the incoming light (i.e. pixels that
1186     * are stuck at an arbitrary value).</p>
1187     * @see #HOT_PIXEL_MODE_OFF
1188     * @see #HOT_PIXEL_MODE_FAST
1189     * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1190     */
1191    public static final Key<Integer> HOT_PIXEL_MODE =
1192            new Key<Integer>("android.hotPixel.mode", int.class);
1193
1194    /**
1195     * <p>GPS coordinates to include in output JPEG
1196     * EXIF</p>
1197     */
1198    public static final Key<double[]> JPEG_GPS_COORDINATES =
1199            new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
1200
1201    /**
1202     * <p>32 characters describing GPS algorithm to
1203     * include in EXIF</p>
1204     */
1205    public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
1206            new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
1207
1208    /**
1209     * <p>Time GPS fix was made to include in
1210     * EXIF</p>
1211     */
1212    public static final Key<Long> JPEG_GPS_TIMESTAMP =
1213            new Key<Long>("android.jpeg.gpsTimestamp", long.class);
1214
1215    /**
1216     * <p>Orientation of JPEG image to
1217     * write</p>
1218     */
1219    public static final Key<Integer> JPEG_ORIENTATION =
1220            new Key<Integer>("android.jpeg.orientation", int.class);
1221
1222    /**
1223     * <p>Compression quality of the final JPEG
1224     * image</p>
1225     * <p>85-95 is typical usage range</p>
1226     */
1227    public static final Key<Byte> JPEG_QUALITY =
1228            new Key<Byte>("android.jpeg.quality", byte.class);
1229
1230    /**
1231     * <p>Compression quality of JPEG
1232     * thumbnail</p>
1233     */
1234    public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
1235            new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
1236
1237    /**
1238     * <p>Resolution of embedded JPEG thumbnail</p>
1239     * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
1240     * but the captured JPEG will still be a valid image.</p>
1241     * <p>When a jpeg image capture is issued, the thumbnail size selected should have
1242     * the same aspect ratio as the jpeg image.</p>
1243     */
1244    public static final Key<android.hardware.camera2.Size> JPEG_THUMBNAIL_SIZE =
1245            new Key<android.hardware.camera2.Size>("android.jpeg.thumbnailSize", android.hardware.camera2.Size.class);
1246
1247    /**
1248     * <p>The ratio of lens focal length to the effective
1249     * aperture diameter.</p>
1250     * <p>This will only be supported on the camera devices that
1251     * have variable aperture lens. The aperture value can only be
1252     * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
1253     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1254     * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
1255     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
1256     * to achieve manual exposure control.</p>
1257     * <p>The requested aperture value may take several frames to reach the
1258     * requested value; the camera device will report the current (intermediate)
1259     * aperture size in capture result metadata while the aperture is changing.
1260     * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
1261     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1262     * the ON modes, this will be overridden by the camera device
1263     * auto-exposure algorithm, the overridden values are then provided
1264     * back to the user in the corresponding result.</p>
1265     *
1266     * @see CaptureRequest#CONTROL_AE_MODE
1267     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1268     * @see CaptureResult#LENS_STATE
1269     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1270     * @see CaptureRequest#SENSOR_FRAME_DURATION
1271     * @see CaptureRequest#SENSOR_SENSITIVITY
1272     */
1273    public static final Key<Float> LENS_APERTURE =
1274            new Key<Float>("android.lens.aperture", float.class);
1275
1276    /**
1277     * <p>State of lens neutral density filter(s).</p>
1278     * <p>This will not be supported on most camera devices. On devices
1279     * where this is supported, this may only be set to one of the
1280     * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p>
1281     * <p>Lens filters are typically used to lower the amount of light the
1282     * sensor is exposed to (measured in steps of EV). As used here, an EV
1283     * step is the standard logarithmic representation, which are
1284     * non-negative, and inversely proportional to the amount of light
1285     * hitting the sensor.  For example, setting this to 0 would result
1286     * in no reduction of the incoming light, and setting this to 2 would
1287     * mean that the filter is set to reduce incoming light by two stops
1288     * (allowing 1/4 of the prior amount of light to the sensor).</p>
1289     * <p>It may take several frames before the lens filter density changes
1290     * to the requested value. While the filter density is still changing,
1291     * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
1292     *
1293     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1294     * @see CaptureResult#LENS_STATE
1295     */
1296    public static final Key<Float> LENS_FILTER_DENSITY =
1297            new Key<Float>("android.lens.filterDensity", float.class);
1298
1299    /**
1300     * <p>The current lens focal length; used for optical zoom.</p>
1301     * <p>This setting controls the physical focal length of the camera
1302     * device's lens. Changing the focal length changes the field of
1303     * view of the camera device, and is usually used for optical zoom.</p>
1304     * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1305     * setting won't be applied instantaneously, and it may take several
1306     * frames before the lens can change to the requested focal length.
1307     * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1308     * be set to MOVING.</p>
1309     * <p>This is expected not to be supported on most devices.</p>
1310     *
1311     * @see CaptureRequest#LENS_APERTURE
1312     * @see CaptureRequest#LENS_FOCUS_DISTANCE
1313     * @see CaptureResult#LENS_STATE
1314     */
1315    public static final Key<Float> LENS_FOCAL_LENGTH =
1316            new Key<Float>("android.lens.focalLength", float.class);
1317
1318    /**
1319     * <p>Distance to plane of sharpest focus,
1320     * measured from frontmost surface of the lens</p>
1321     * <p>Should be zero for fixed-focus cameras</p>
1322     */
1323    public static final Key<Float> LENS_FOCUS_DISTANCE =
1324            new Key<Float>("android.lens.focusDistance", float.class);
1325
1326    /**
1327     * <p>The range of scene distances that are in
1328     * sharp focus (depth of field)</p>
1329     * <p>If variable focus not supported, can still report
1330     * fixed depth of field range</p>
1331     */
1332    public static final Key<float[]> LENS_FOCUS_RANGE =
1333            new Key<float[]>("android.lens.focusRange", float[].class);
1334
1335    /**
1336     * <p>Sets whether the camera device uses optical image stabilization (OIS)
1337     * when capturing images.</p>
1338     * <p>OIS is used to compensate for motion blur due to small movements of
1339     * the camera during capture. Unlike digital image stabilization, OIS makes
1340     * use of mechanical elements to stabilize the camera sensor, and thus
1341     * allows for longer exposure times before camera shake becomes
1342     * apparent.</p>
1343     * <p>This is not expected to be supported on most devices.</p>
1344     * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
1345     * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
1346     */
1347    public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
1348            new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
1349
1350    /**
1351     * <p>Current lens status.</p>
1352     * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1353     * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
1354     * they may take several frames to reach the requested values. This state indicates
1355     * the current status of the lens parameters.</p>
1356     * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
1357     * either because the parameters are all fixed, or because the lens has had enough
1358     * time to reach the most recently-requested values.
1359     * If all these lens parameters are not changable for a camera device, as listed below:</p>
1360     * <ul>
1361     * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
1362     * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
1363     * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
1364     * which means the optical zoom is not supported.</li>
1365     * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
1366     * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
1367     * </ul>
1368     * <p>Then this state will always be STATIONARY.</p>
1369     * <p>When the state is MOVING, it indicates that at least one of the lens parameters
1370     * is changing.</p>
1371     *
1372     * @see CaptureRequest#LENS_APERTURE
1373     * @see CaptureRequest#LENS_FILTER_DENSITY
1374     * @see CaptureRequest#LENS_FOCAL_LENGTH
1375     * @see CaptureRequest#LENS_FOCUS_DISTANCE
1376     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1377     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1378     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
1379     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1380     * @see #LENS_STATE_STATIONARY
1381     * @see #LENS_STATE_MOVING
1382     */
1383    public static final Key<Integer> LENS_STATE =
1384            new Key<Integer>("android.lens.state", int.class);
1385
1386    /**
1387     * <p>Mode of operation for the noise reduction
1388     * algorithm</p>
1389     * <p>Noise filtering control. OFF means no noise reduction
1390     * will be applied by the camera device.</p>
1391     * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
1392     * will be applied. HIGH_QUALITY mode indicates that the camera device
1393     * will use the highest-quality noise filtering algorithms,
1394     * even if it slows down capture rate. FAST means the camera device should not
1395     * slow down capture rate when applying noise filtering.</p>
1396     * @see #NOISE_REDUCTION_MODE_OFF
1397     * @see #NOISE_REDUCTION_MODE_FAST
1398     * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
1399     */
1400    public static final Key<Integer> NOISE_REDUCTION_MODE =
1401            new Key<Integer>("android.noiseReduction.mode", int.class);
1402
1403    /**
1404     * <p>Whether a result given to the framework is the
1405     * final one for the capture, or only a partial that contains a
1406     * subset of the full set of dynamic metadata
1407     * values.</p>
1408     * <p>The entries in the result metadata buffers for a
1409     * single capture may not overlap, except for this entry. The
1410     * FINAL buffers must retain FIFO ordering relative to the
1411     * requests that generate them, so the FINAL buffer for frame 3 must
1412     * always be sent to the framework after the FINAL buffer for frame 2, and
1413     * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
1414     * in any order relative to other frames, but all PARTIAL buffers for a given
1415     * capture must arrive before the FINAL buffer for that capture. This entry may
1416     * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
1417     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1418     * @hide
1419     */
1420    public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
1421            new Key<Boolean>("android.quirks.partialResult", boolean.class);
1422
1423    /**
1424     * <p>A frame counter set by the framework. This value monotonically
1425     * increases with every new result (that is, each new result has a unique
1426     * frameCount value).</p>
1427     * <p>Reset on release()</p>
1428     */
1429    public static final Key<Integer> REQUEST_FRAME_COUNT =
1430            new Key<Integer>("android.request.frameCount", int.class);
1431
1432    /**
1433     * <p>An application-specified ID for the current
1434     * request. Must be maintained unchanged in output
1435     * frame</p>
1436     * @hide
1437     */
1438    public static final Key<Integer> REQUEST_ID =
1439            new Key<Integer>("android.request.id", int.class);
1440
1441    /**
1442     * <p>Specifies the number of pipeline stages the frame went
1443     * through from when it was exposed to when the final completed result
1444     * was available to the framework.</p>
1445     * <p>Depending on what settings are used in the request, and
1446     * what streams are configured, the data may undergo less processing,
1447     * and some pipeline stages skipped.</p>
1448     * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
1449     *
1450     * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
1451     */
1452    public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
1453            new Key<Byte>("android.request.pipelineDepth", byte.class);
1454
1455    /**
1456     * <p>(x, y, width, height).</p>
1457     * <p>A rectangle with the top-level corner of (x,y) and size
1458     * (width, height). The region of the sensor that is used for
1459     * output. Each stream must use this rectangle to produce its
1460     * output, cropping to a smaller region if necessary to
1461     * maintain the stream's aspect ratio.</p>
1462     * <p>HAL2.x uses only (x, y, width)</p>
1463     * <p>Any additional per-stream cropping must be done to
1464     * maximize the final pixel area of the stream.</p>
1465     * <p>For example, if the crop region is set to a 4:3 aspect
1466     * ratio, then 4:3 streams should use the exact crop
1467     * region. 16:9 streams should further crop vertically
1468     * (letterbox).</p>
1469     * <p>Conversely, if the crop region is set to a 16:9, then 4:3
1470     * outputs should crop horizontally (pillarbox), and 16:9
1471     * streams should match exactly. These additional crops must
1472     * be centered within the crop region.</p>
1473     * <p>The output streams must maintain square pixels at all
1474     * times, no matter what the relative aspect ratios of the
1475     * crop region and the stream are.  Negative values for
1476     * corner are allowed for raw output if full pixel array is
1477     * larger than active pixel array. Width and height may be
1478     * rounded to nearest larger supportable width, especially
1479     * for raw output, where only a few fixed scales may be
1480     * possible. The width and height of the crop region cannot
1481     * be set to be smaller than floor( activeArraySize.width /
1482     * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} ) and floor(
1483     * activeArraySize.height /
1484     * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom}), respectively.</p>
1485     *
1486     * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
1487     */
1488    public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
1489            new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
1490
1491    /**
1492     * <p>Duration each pixel is exposed to
1493     * light.</p>
1494     * <p>If the sensor can't expose this exact duration, it should shorten the
1495     * duration exposed to the nearest possible value (rather than expose longer).</p>
1496     * <p>1/10000 - 30 sec range. No bulb mode</p>
1497     */
1498    public static final Key<Long> SENSOR_EXPOSURE_TIME =
1499            new Key<Long>("android.sensor.exposureTime", long.class);
1500
1501    /**
1502     * <p>Duration from start of frame exposure to
1503     * start of next frame exposure.</p>
1504     * <p>The maximum frame rate that can be supported by a camera subsystem is
1505     * a function of many factors:</p>
1506     * <ul>
1507     * <li>Requested resolutions of output image streams</li>
1508     * <li>Availability of binning / skipping modes on the imager</li>
1509     * <li>The bandwidth of the imager interface</li>
1510     * <li>The bandwidth of the various ISP processing blocks</li>
1511     * </ul>
1512     * <p>Since these factors can vary greatly between different ISPs and
1513     * sensors, the camera abstraction tries to represent the bandwidth
1514     * restrictions with as simple a model as possible.</p>
1515     * <p>The model presented has the following characteristics:</p>
1516     * <ul>
1517     * <li>The image sensor is always configured to output the smallest
1518     * resolution possible given the application's requested output stream
1519     * sizes.  The smallest resolution is defined as being at least as large
1520     * as the largest requested output stream size; the camera pipeline must
1521     * never digitally upsample sensor data when the crop region covers the
1522     * whole sensor. In general, this means that if only small output stream
1523     * resolutions are configured, the sensor can provide a higher frame
1524     * rate.</li>
1525     * <li>Since any request may use any or all the currently configured
1526     * output streams, the sensor and ISP must be configured to support
1527     * scaling a single capture to all the streams at the same time.  This
1528     * means the camera pipeline must be ready to produce the largest
1529     * requested output size without any delay.  Therefore, the overall
1530     * frame rate of a given configured stream set is governed only by the
1531     * largest requested stream resolution.</li>
1532     * <li>Using more than one output stream in a request does not affect the
1533     * frame duration.</li>
1534     * <li>Certain format-streams may need to do additional background processing
1535     * before data is consumed/produced by that stream. These processors
1536     * can run concurrently to the rest of the camera pipeline, but
1537     * cannot process more than 1 capture at a time.</li>
1538     * </ul>
1539     * <p>The necessary information for the application, given the model above,
1540     * is provided via the {@link CameraCharacteristics#SCALER_AVAILABLE_MIN_FRAME_DURATIONS android.scaler.availableMinFrameDurations} field.
1541     * These are used to determine the maximum frame rate / minimum frame
1542     * duration that is possible for a given stream configuration.</p>
1543     * <p>Specifically, the application can use the following rules to
1544     * determine the minimum frame duration it can request from the camera
1545     * device:</p>
1546     * <ol>
1547     * <li>Let the set of currently configured input/output streams
1548     * be called <code>S</code>.</li>
1549     * <li>Find the minimum frame durations for each stream in <code>S</code>, by
1550     * looking it up in {@link CameraCharacteristics#SCALER_AVAILABLE_MIN_FRAME_DURATIONS android.scaler.availableMinFrameDurations} (with
1551     * its respective size/format). Let this set of frame durations be called
1552     * <code>F</code>.</li>
1553     * <li>For any given request <code>R</code>, the minimum frame duration allowed
1554     * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
1555     * used in <code>R</code> be called <code>S_r</code>.</li>
1556     * </ol>
1557     * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
1558     * {@link CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS android.scaler.availableStallDurations}), then the frame duration in
1559     * <code>F</code> determines the steady state frame rate that the application will
1560     * get if it uses <code>R</code> as a repeating request. Let this special kind
1561     * of request be called <code>Rsimple</code>.</p>
1562     * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
1563     * by a single capture of a new request <code>Rstall</code> (which has at least
1564     * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
1565     * same minimum frame duration this will not cause a frame rate loss
1566     * if all buffers from the previous <code>Rstall</code> have already been
1567     * delivered.</p>
1568     * <p>For more details about stalling, see
1569     * {@link CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS android.scaler.availableStallDurations}.</p>
1570     *
1571     * @see CameraCharacteristics#SCALER_AVAILABLE_MIN_FRAME_DURATIONS
1572     * @see CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS
1573     */
1574    public static final Key<Long> SENSOR_FRAME_DURATION =
1575            new Key<Long>("android.sensor.frameDuration", long.class);
1576
1577    /**
1578     * <p>Gain applied to image data. Must be
1579     * implemented through analog gain only if set to values
1580     * below 'maximum analog sensitivity'.</p>
1581     * <p>If the sensor can't apply this exact gain, it should lessen the
1582     * gain to the nearest possible value (rather than gain more).</p>
1583     * <p>ISO 12232:2006 REI method</p>
1584     */
1585    public static final Key<Integer> SENSOR_SENSITIVITY =
1586            new Key<Integer>("android.sensor.sensitivity", int.class);
1587
1588    /**
1589     * <p>Time at start of exposure of first
1590     * row</p>
1591     * <p>Monotonic, should be synced to other timestamps in
1592     * system</p>
1593     */
1594    public static final Key<Long> SENSOR_TIMESTAMP =
1595            new Key<Long>("android.sensor.timestamp", long.class);
1596
1597    /**
1598     * <p>The temperature of the sensor, sampled at the time
1599     * exposure began for this frame.</p>
1600     * <p>The thermal diode being queried should be inside the sensor PCB, or
1601     * somewhere close to it.</p>
1602     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1603     * <p><b>Full capability</b> -
1604     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1605     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1606     *
1607     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1608     */
1609    public static final Key<Float> SENSOR_TEMPERATURE =
1610            new Key<Float>("android.sensor.temperature", float.class);
1611
1612    /**
1613     * <p>A reference illumination source roughly matching the current scene
1614     * illumination, which is used to describe the sensor color space
1615     * transformations.</p>
1616     * <p>The values in this tag correspond to the values defined for the
1617     * EXIF LightSource tag. These illuminants are standard light sources
1618     * that are often used for calibrating camera devices.</p>
1619     * @see #SENSOR_REFERENCE_ILLUMINANT_DAYLIGHT
1620     * @see #SENSOR_REFERENCE_ILLUMINANT_FLUORESCENT
1621     * @see #SENSOR_REFERENCE_ILLUMINANT_TUNGSTEN
1622     * @see #SENSOR_REFERENCE_ILLUMINANT_FLASH
1623     * @see #SENSOR_REFERENCE_ILLUMINANT_FINE_WEATHER
1624     * @see #SENSOR_REFERENCE_ILLUMINANT_CLOUDY_WEATHER
1625     * @see #SENSOR_REFERENCE_ILLUMINANT_SHADE
1626     * @see #SENSOR_REFERENCE_ILLUMINANT_DAYLIGHT_FLUORESCENT
1627     * @see #SENSOR_REFERENCE_ILLUMINANT_DAY_WHITE_FLUORESCENT
1628     * @see #SENSOR_REFERENCE_ILLUMINANT_COOL_WHITE_FLUORESCENT
1629     * @see #SENSOR_REFERENCE_ILLUMINANT_WHITE_FLUORESCENT
1630     * @see #SENSOR_REFERENCE_ILLUMINANT_STANDARD_A
1631     * @see #SENSOR_REFERENCE_ILLUMINANT_STANDARD_B
1632     * @see #SENSOR_REFERENCE_ILLUMINANT_STANDARD_C
1633     * @see #SENSOR_REFERENCE_ILLUMINANT_D55
1634     * @see #SENSOR_REFERENCE_ILLUMINANT_D65
1635     * @see #SENSOR_REFERENCE_ILLUMINANT_D75
1636     * @see #SENSOR_REFERENCE_ILLUMINANT_D50
1637     * @see #SENSOR_REFERENCE_ILLUMINANT_ISO_STUDIO_TUNGSTEN
1638     */
1639    public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT =
1640            new Key<Integer>("android.sensor.referenceIlluminant", int.class);
1641
1642    /**
1643     * <p>A per-device calibration transform matrix to be applied after the
1644     * color space transform when rendering the raw image buffer.</p>
1645     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and
1646     * contains a per-device calibration transform that maps colors
1647     * from reference camera color space (i.e. the "golden module"
1648     * colorspace) into this camera device's linear native sensor color
1649     * space for the current scene illumination and white balance choice.</p>
1650     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1651     */
1652    public static final Key<Rational[]> SENSOR_CALIBRATION_TRANSFORM =
1653            new Key<Rational[]>("android.sensor.calibrationTransform", Rational[].class);
1654
1655    /**
1656     * <p>A matrix that transforms color values from CIE XYZ color space to
1657     * reference camera color space when rendering the raw image buffer.</p>
1658     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and
1659     * contains a color transform matrix that maps colors from the CIE
1660     * XYZ color space to the reference camera raw color space (i.e. the
1661     * "golden module" colorspace) for the current scene illumination and
1662     * white balance choice.</p>
1663     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1664     */
1665    public static final Key<Rational[]> SENSOR_COLOR_TRANSFORM =
1666            new Key<Rational[]>("android.sensor.colorTransform", Rational[].class);
1667
1668    /**
1669     * <p>A matrix that transforms white balanced camera colors to the CIE XYZ
1670     * colorspace with a D50 whitepoint.</p>
1671     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
1672     * a color transform matrix that maps a unit vector in the linear native
1673     * sensor color space to the D50 whitepoint in CIE XYZ color space.</p>
1674     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1675     */
1676    public static final Key<Rational[]> SENSOR_FORWARD_MATRIX =
1677            new Key<Rational[]>("android.sensor.forwardMatrix", Rational[].class);
1678
1679    /**
1680     * <p>The estimated white balance at the time of capture.</p>
1681     * <p>The estimated white balance encoded as the RGB values of the
1682     * perfectly neutral color point in the linear native sensor color space.
1683     * The order of the values is R, G, B; where R is in the lowest index.</p>
1684     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1685     */
1686    public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
1687            new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
1688
1689    /**
1690     * <p>A mapping containing a hue shift, saturation scale, and value scale
1691     * for each pixel.</p>
1692     * <p>hue_samples, saturation_samples, and value_samples are given in
1693     * {@link CameraCharacteristics#SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS android.sensor.profileHueSatMapDimensions}.</p>
1694     * <p>Each entry of this map contains three floats corresponding to the
1695     * hue shift, saturation scale, and value scale, respectively; where the
1696     * hue shift has the lowest index. The map entries are stored in the tag
1697     * in nested loop order, with the value divisions in the outer loop, the
1698     * hue divisions in the middle loop, and the saturation divisions in the
1699     * inner loop. All zero input saturation entries are required to have a
1700     * value scale factor of 1.0.</p>
1701     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1702     *
1703     * @see CameraCharacteristics#SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS
1704     */
1705    public static final Key<float[]> SENSOR_PROFILE_HUE_SAT_MAP =
1706            new Key<float[]>("android.sensor.profileHueSatMap", float[].class);
1707
1708    /**
1709     * <p>A list of x,y samples defining a tone-mapping curve for gamma adjustment.</p>
1710     * <p>This tag contains a default tone curve that can be applied while
1711     * processing the image as a starting point for user adjustments.
1712     * The curve is specified as a list of value pairs in linear gamma.
1713     * The curve is interpolated using a cubic spline.</p>
1714     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1715     */
1716    public static final Key<float[]> SENSOR_PROFILE_TONE_CURVE =
1717            new Key<float[]>("android.sensor.profileToneCurve", float[].class);
1718
1719    /**
1720     * <p>The worst-case divergence between Bayer green channels.</p>
1721     * <p>This value is an estimate of the worst case split between the
1722     * Bayer green channels in the red and blue rows in the sensor color
1723     * filter array.</p>
1724     * <p>The green split is calculated as follows:</p>
1725     * <ol>
1726     * <li>A representative 5x5 pixel window W within the active
1727     * sensor array is chosen.</li>
1728     * <li>The arithmetic mean of the green channels from the red
1729     * rows (mean_Gr) within W is computed.</li>
1730     * <li>The arithmetic mean of the green channels from the blue
1731     * rows (mean_Gb) within W is computed.</li>
1732     * <li>The maximum ratio R of the two means is computed as follows:
1733     * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
1734     * </ol>
1735     * <p>The ratio R is the green split divergence reported for this property,
1736     * which represents how much the green channels differ in the mosaic
1737     * pattern.  This value is typically used to determine the treatment of
1738     * the green mosaic channels when demosaicing.</p>
1739     * <p>The green split value can be roughly interpreted as follows:</p>
1740     * <ul>
1741     * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
1742     * <li>1.20 &lt;= R &gt;= 1.03 will require some software
1743     * correction to avoid demosaic errors (3-20% divergence).</li>
1744     * <li>R &gt; 1.20 will require strong software correction to produce
1745     * a usuable image (&gt;20% divergence).</li>
1746     * </ul>
1747     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1748     */
1749    public static final Key<Float> SENSOR_GREEN_SPLIT =
1750            new Key<Float>("android.sensor.greenSplit", float.class);
1751
1752    /**
1753     * <p>When enabled, the sensor sends a test pattern instead of
1754     * doing a real exposure from the camera.</p>
1755     * <p>When a test pattern is enabled, all manual sensor controls specified
1756     * by android.sensor.* should be ignored. All other controls should
1757     * work as normal.</p>
1758     * <p>For example, if manual flash is enabled, flash firing should still
1759     * occur (and that the test pattern remain unmodified, since the flash
1760     * would not actually affect it).</p>
1761     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1762     * @see #SENSOR_TEST_PATTERN_MODE_OFF
1763     * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
1764     * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
1765     * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
1766     * @see #SENSOR_TEST_PATTERN_MODE_PN9
1767     * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
1768     */
1769    public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
1770            new Key<Integer>("android.sensor.testPatternMode", int.class);
1771
1772    /**
1773     * <p>Quality of lens shading correction applied
1774     * to the image data.</p>
1775     * <p>When set to OFF mode, no lens shading correction will be applied by the
1776     * camera device, and an identity lens shading map data will be provided
1777     * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
1778     * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>,
1779     * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map
1780     * shown below:</p>
1781     * <pre><code>[ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
1782     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
1783     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
1784     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
1785     * 1.0, 1.0, 1.0, 1.0,   1.0, 1.0, 1.0, 1.0,
1786     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0 ]
1787     * </code></pre>
1788     * <p>When set to other modes, lens shading correction will be applied by the
1789     * camera device. Applications can request lens shading map data by setting
1790     * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide
1791     * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified
1792     * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p>
1793     *
1794     * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
1795     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
1796     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
1797     * @see #SHADING_MODE_OFF
1798     * @see #SHADING_MODE_FAST
1799     * @see #SHADING_MODE_HIGH_QUALITY
1800     * @hide
1801     */
1802    public static final Key<Integer> SHADING_MODE =
1803            new Key<Integer>("android.shading.mode", int.class);
1804
1805    /**
1806     * <p>State of the face detector
1807     * unit</p>
1808     * <p>Whether face detection is enabled, and whether it
1809     * should output just the basic fields or the full set of
1810     * fields. Value must be one of the
1811     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p>
1812     *
1813     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
1814     * @see #STATISTICS_FACE_DETECT_MODE_OFF
1815     * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
1816     * @see #STATISTICS_FACE_DETECT_MODE_FULL
1817     */
1818    public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
1819            new Key<Integer>("android.statistics.faceDetectMode", int.class);
1820
1821    /**
1822     * <p>List of unique IDs for detected
1823     * faces</p>
1824     * <p>Only available if faceDetectMode == FULL</p>
1825     * @hide
1826     */
1827    public static final Key<int[]> STATISTICS_FACE_IDS =
1828            new Key<int[]>("android.statistics.faceIds", int[].class);
1829
1830    /**
1831     * <p>List of landmarks for detected
1832     * faces</p>
1833     * <p>Only available if faceDetectMode == FULL</p>
1834     * @hide
1835     */
1836    public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
1837            new Key<int[]>("android.statistics.faceLandmarks", int[].class);
1838
1839    /**
1840     * <p>List of the bounding rectangles for detected
1841     * faces</p>
1842     * <p>Only available if faceDetectMode != OFF</p>
1843     * @hide
1844     */
1845    public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
1846            new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
1847
1848    /**
1849     * <p>List of the face confidence scores for
1850     * detected faces</p>
1851     * <p>Only available if faceDetectMode != OFF. The value should be
1852     * meaningful (for example, setting 100 at all times is illegal).</p>
1853     * @hide
1854     */
1855    public static final Key<byte[]> STATISTICS_FACE_SCORES =
1856            new Key<byte[]>("android.statistics.faceScores", byte[].class);
1857
1858    /**
1859     * <p>The shading map is a low-resolution floating-point map
1860     * that lists the coefficients used to correct for vignetting, for each
1861     * Bayer color channel.</p>
1862     * <p>The least shaded section of the image should have a gain factor
1863     * of 1; all other sections should have gains above 1.</p>
1864     * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
1865     * must take into account the colorCorrection settings.</p>
1866     * <p>The shading map is for the entire active pixel array, and is not
1867     * affected by the crop region specified in the request. Each shading map
1868     * entry is the value of the shading compensation map over a specific
1869     * pixel on the sensor.  Specifically, with a (N x M) resolution shading
1870     * map, and an active pixel array size (W x H), shading map entry
1871     * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
1872     * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
1873     * The map is assumed to be bilinearly interpolated between the sample points.</p>
1874     * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
1875     * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
1876     * The shading map is stored in a fully interleaved format, and its size
1877     * is provided in the camera static metadata by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p>
1878     * <p>The shading map should have on the order of 30-40 rows and columns,
1879     * and must be smaller than 64x64.</p>
1880     * <p>As an example, given a very small map defined as:</p>
1881     * <pre><code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]
1882     * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} =
1883     * [ 1.3, 1.2, 1.15, 1.2,  1.2, 1.2, 1.15, 1.2,
1884     * 1.1, 1.2, 1.2, 1.2,  1.3, 1.2, 1.3, 1.3,
1885     * 1.2, 1.2, 1.25, 1.1,  1.1, 1.1, 1.1, 1.0,
1886     * 1.0, 1.0, 1.0, 1.0,  1.2, 1.3, 1.25, 1.2,
1887     * 1.3, 1.2, 1.2, 1.3,   1.2, 1.15, 1.1, 1.2,
1888     * 1.2, 1.1, 1.0, 1.2,  1.3, 1.15, 1.2, 1.3 ]
1889     * </code></pre>
1890     * <p>The low-resolution scaling map images for each channel are
1891     * (displayed using nearest-neighbor interpolation):</p>
1892     * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
1893     * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
1894     * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
1895     * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
1896     * <p>As a visualization only, inverting the full-color map to recover an
1897     * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
1898     * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
1899     *
1900     * @see CaptureRequest#COLOR_CORRECTION_MODE
1901     * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
1902     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
1903     */
1904    public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
1905            new Key<float[]>("android.statistics.lensShadingMap", float[].class);
1906
1907    /**
1908     * <p>The best-fit color channel gains calculated
1909     * by the camera device's statistics units for the current output frame.</p>
1910     * <p>This may be different than the gains used for this frame,
1911     * since statistics processing on data from a new frame
1912     * typically completes after the transform has already been
1913     * applied to that frame.</p>
1914     * <p>The 4 channel gains are defined in Bayer domain,
1915     * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
1916     * <p>This value should always be calculated by the AWB block,
1917     * regardless of the android.control.* current values.</p>
1918     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1919     *
1920     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1921     * @hide
1922     */
1923    public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
1924            new Key<float[]>("android.statistics.predictedColorGains", float[].class);
1925
1926    /**
1927     * <p>The best-fit color transform matrix estimate
1928     * calculated by the camera device's statistics units for the current
1929     * output frame.</p>
1930     * <p>The camera device will provide the estimate from its
1931     * statistics unit on the white balance transforms to use
1932     * for the next frame. These are the values the camera device believes
1933     * are the best fit for the current output frame. This may
1934     * be different than the transform used for this frame, since
1935     * statistics processing on data from a new frame typically
1936     * completes after the transform has already been applied to
1937     * that frame.</p>
1938     * <p>These estimates must be provided for all frames, even if
1939     * capture settings and color transforms are set by the application.</p>
1940     * <p>This value should always be calculated by the AWB block,
1941     * regardless of the android.control.* current values.</p>
1942     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1943     * @hide
1944     */
1945    public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
1946            new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
1947
1948    /**
1949     * <p>The camera device estimated scene illumination lighting
1950     * frequency.</p>
1951     * <p>Many light sources, such as most fluorescent lights, flicker at a rate
1952     * that depends on the local utility power standards. This flicker must be
1953     * accounted for by auto-exposure routines to avoid artifacts in captured images.
1954     * The camera device uses this entry to tell the application what the scene
1955     * illuminant frequency is.</p>
1956     * <p>When manual exposure control is enabled
1957     * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == OFF</code>),
1958     * the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't do the antibanding, and the
1959     * application can ensure it selects exposure times that do not cause banding
1960     * issues by looking into this metadata field. See {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}
1961     * for more details.</p>
1962     * <p>Report NONE if there doesn't appear to be flickering illumination.</p>
1963     *
1964     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
1965     * @see CaptureRequest#CONTROL_AE_MODE
1966     * @see CaptureRequest#CONTROL_MODE
1967     * @see #STATISTICS_SCENE_FLICKER_NONE
1968     * @see #STATISTICS_SCENE_FLICKER_50HZ
1969     * @see #STATISTICS_SCENE_FLICKER_60HZ
1970     */
1971    public static final Key<Integer> STATISTICS_SCENE_FLICKER =
1972            new Key<Integer>("android.statistics.sceneFlicker", int.class);
1973
1974    /**
1975     * <p>Tonemapping / contrast / gamma curve for the blue
1976     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
1977     * CONTRAST_CURVE.</p>
1978     * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
1979     *
1980     * @see CaptureRequest#TONEMAP_CURVE_RED
1981     * @see CaptureRequest#TONEMAP_MODE
1982     */
1983    public static final Key<float[]> TONEMAP_CURVE_BLUE =
1984            new Key<float[]>("android.tonemap.curveBlue", float[].class);
1985
1986    /**
1987     * <p>Tonemapping / contrast / gamma curve for the green
1988     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
1989     * CONTRAST_CURVE.</p>
1990     * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
1991     *
1992     * @see CaptureRequest#TONEMAP_CURVE_RED
1993     * @see CaptureRequest#TONEMAP_MODE
1994     */
1995    public static final Key<float[]> TONEMAP_CURVE_GREEN =
1996            new Key<float[]>("android.tonemap.curveGreen", float[].class);
1997
1998    /**
1999     * <p>Tonemapping / contrast / gamma curve for the red
2000     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2001     * CONTRAST_CURVE.</p>
2002     * <p>Each channel's curve is defined by an array of control points:</p>
2003     * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} =
2004     * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
2005     * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
2006     * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2007     * guaranteed that input values 0.0 and 1.0 are included in the list to
2008     * define a complete mapping. For input values between control points,
2009     * the camera device must linearly interpolate between the control
2010     * points.</p>
2011     * <p>Each curve can have an independent number of points, and the number
2012     * of points can be less than max (that is, the request doesn't have to
2013     * always provide a curve with number of points equivalent to
2014     * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2015     * <p>A few examples, and their corresponding graphical mappings; these
2016     * only specify the red channel and the precision is limited to 4
2017     * digits, for conciseness.</p>
2018     * <p>Linear mapping:</p>
2019     * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 0, 1.0, 1.0 ]
2020     * </code></pre>
2021     * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2022     * <p>Invert mapping:</p>
2023     * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 1.0, 1.0, 0 ]
2024     * </code></pre>
2025     * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2026     * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2027     * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [
2028     * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2029     * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2030     * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2031     * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
2032     * </code></pre>
2033     * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2034     * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2035     * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [
2036     * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2037     * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2038     * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2039     * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
2040     * </code></pre>
2041     * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
2042     *
2043     * @see CaptureRequest#TONEMAP_CURVE_RED
2044     * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
2045     * @see CaptureRequest#TONEMAP_MODE
2046     */
2047    public static final Key<float[]> TONEMAP_CURVE_RED =
2048            new Key<float[]>("android.tonemap.curveRed", float[].class);
2049
2050    /**
2051     * <p>High-level global contrast/gamma/tonemapping control.</p>
2052     * <p>When switching to an application-defined contrast curve by setting
2053     * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2054     * per-channel with a set of <code>(in, out)</code> points that specify the
2055     * mapping from input high-bit-depth pixel value to the output
2056     * low-bit-depth value.  Since the actual pixel ranges of both input
2057     * and output may change depending on the camera pipeline, the values
2058     * are specified by normalized floating-point numbers.</p>
2059     * <p>More-complex color mapping operations such as 3D color look-up
2060     * tables, selective chroma enhancement, or other non-linear color
2061     * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2062     * CONTRAST_CURVE.</p>
2063     * <p>When using either FAST or HIGH_QUALITY, the camera device will
2064     * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed},
2065     * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, and {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}.
2066     * These values are always available, and as close as possible to the
2067     * actually used nonlinear/nonglobal transforms.</p>
2068     * <p>If a request is sent with TRANSFORM_MATRIX with the camera device's
2069     * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2070     * roughly the same.</p>
2071     *
2072     * @see CaptureRequest#TONEMAP_CURVE_BLUE
2073     * @see CaptureRequest#TONEMAP_CURVE_GREEN
2074     * @see CaptureRequest#TONEMAP_CURVE_RED
2075     * @see CaptureRequest#TONEMAP_MODE
2076     * @see #TONEMAP_MODE_CONTRAST_CURVE
2077     * @see #TONEMAP_MODE_FAST
2078     * @see #TONEMAP_MODE_HIGH_QUALITY
2079     */
2080    public static final Key<Integer> TONEMAP_MODE =
2081            new Key<Integer>("android.tonemap.mode", int.class);
2082
2083    /**
2084     * <p>This LED is nominally used to indicate to the user
2085     * that the camera is powered on and may be streaming images back to the
2086     * Application Processor. In certain rare circumstances, the OS may
2087     * disable this when video is processed locally and not transmitted to
2088     * any untrusted applications.</p>
2089     * <p>In particular, the LED <em>must</em> always be on when the data could be
2090     * transmitted off the device. The LED <em>should</em> always be on whenever
2091     * data is stored locally on the device.</p>
2092     * <p>The LED <em>may</em> be off if a trusted application is using the data that
2093     * doesn't violate the above rules.</p>
2094     * @hide
2095     */
2096    public static final Key<Boolean> LED_TRANSMIT =
2097            new Key<Boolean>("android.led.transmit", boolean.class);
2098
2099    /**
2100     * <p>Whether black-level compensation is locked
2101     * to its current values, or is free to vary.</p>
2102     * <p>Whether the black level offset was locked for this frame.  Should be
2103     * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless
2104     * a change in other capture settings forced the camera device to
2105     * perform a black level reset.</p>
2106     *
2107     * @see CaptureRequest#BLACK_LEVEL_LOCK
2108     */
2109    public static final Key<Boolean> BLACK_LEVEL_LOCK =
2110            new Key<Boolean>("android.blackLevel.lock", boolean.class);
2111
2112    /**
2113     * <p>The frame number corresponding to the last request
2114     * with which the output result (metadata + buffers) has been fully
2115     * synchronized.</p>
2116     * <p>When a request is submitted to the camera device, there is usually a
2117     * delay of several frames before the controls get applied. A camera
2118     * device may either choose to account for this delay by implementing a
2119     * pipeline and carefully submit well-timed atomic control updates, or
2120     * it may start streaming control changes that span over several frame
2121     * boundaries.</p>
2122     * <p>In the latter case, whenever a request's settings change relative to
2123     * the previous submitted request, the full set of changes may take
2124     * multiple frame durations to fully take effect. Some settings may
2125     * take effect sooner (in less frame durations) than others.</p>
2126     * <p>While a set of control changes are being propagated, this value
2127     * will be CONVERGING.</p>
2128     * <p>Once it is fully known that a set of control changes have been
2129     * finished propagating, and the resulting updated control settings
2130     * have been read back by the camera device, this value will be set
2131     * to a non-negative frame number (corresponding to the request to
2132     * which the results have synchronized to).</p>
2133     * <p>Older camera device implementations may not have a way to detect
2134     * when all camera controls have been applied, and will always set this
2135     * value to UNKNOWN.</p>
2136     * <p>FULL capability devices will always have this value set to the
2137     * frame number of the request corresponding to this result.</p>
2138     * <p><em>Further details</em>:</p>
2139     * <ul>
2140     * <li>Whenever a request differs from the last request, any future
2141     * results not yet returned may have this value set to CONVERGING (this
2142     * could include any in-progress captures not yet returned by the camera
2143     * device, for more details see pipeline considerations below).</li>
2144     * <li>Submitting a series of multiple requests that differ from the
2145     * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
2146     * moves the new synchronization frame to the last non-repeating
2147     * request (using the smallest frame number from the contiguous list of
2148     * repeating requests).</li>
2149     * <li>Submitting the same request repeatedly will not change this value
2150     * to CONVERGING, if it was already a non-negative value.</li>
2151     * <li>When this value changes to non-negative, that means that all of the
2152     * metadata controls from the request have been applied, all of the
2153     * metadata controls from the camera device have been read to the
2154     * updated values (into the result), and all of the graphics buffers
2155     * corresponding to this result are also synchronized to the request.</li>
2156     * </ul>
2157     * <p><em>Pipeline considerations</em>:</p>
2158     * <p>Submitting a request with updated controls relative to the previously
2159     * submitted requests may also invalidate the synchronization state
2160     * of all the results corresponding to currently in-flight requests.</p>
2161     * <p>In other words, results for this current request and up to
2162     * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
2163     * android.sync.frameNumber change to CONVERGING.</p>
2164     *
2165     * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2166     * @see #SYNC_FRAME_NUMBER_CONVERGING
2167     * @see #SYNC_FRAME_NUMBER_UNKNOWN
2168     * @hide
2169     */
2170    public static final Key<Integer> SYNC_FRAME_NUMBER =
2171            new Key<Integer>("android.sync.frameNumber", int.class);
2172
2173    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2174     * End generated code
2175     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
2176
2177    /**
2178     * <p>
2179     * List of the {@link Face Faces} detected through camera face detection
2180     * in this result.
2181     * </p>
2182     * <p>
2183     * Only available if {@link #STATISTICS_FACE_DETECT_MODE} {@code !=}
2184     * {@link CameraMetadata#STATISTICS_FACE_DETECT_MODE_OFF OFF}.
2185     * </p>
2186     *
2187     * @see Face
2188     */
2189    public static final Key<Face[]> STATISTICS_FACES =
2190            new Key<Face[]>("android.statistics.faces", Face[].class);
2191}
2192