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