CaptureRequest.java revision feb50af361e4305a25758966b6b5df2738c00259
1/*
2 * Copyright (C) 2013 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.os.Parcel;
21import android.os.Parcelable;
22import android.util.Rational;
23import android.view.Surface;
24
25import java.util.Collection;
26import java.util.Collections;
27import java.util.HashSet;
28import java.util.Objects;
29
30
31/**
32 * <p>An immutable package of settings and outputs needed to capture a single
33 * image from the camera device.</p>
34 *
35 * <p>Contains the configuration for the capture hardware (sensor, lens, flash),
36 * the processing pipeline, the control algorithms, and the output buffers. Also
37 * contains the list of target Surfaces to send image data to for this
38 * capture.</p>
39 *
40 * <p>CaptureRequests can be created by using a {@link Builder} instance,
41 * obtained by calling {@link CameraDevice#createCaptureRequest}</p>
42 *
43 * <p>CaptureRequests are given to {@link CameraDevice#capture} or
44 * {@link CameraDevice#setRepeatingRequest} to capture images from a camera.</p>
45 *
46 * <p>Each request can specify a different subset of target Surfaces for the
47 * camera to send the captured data to. All the surfaces used in a request must
48 * be part of the surface list given to the last call to
49 * {@link CameraDevice#configureOutputs}, when the request is submitted to the
50 * camera device.</p>
51 *
52 * <p>For example, a request meant for repeating preview might only include the
53 * Surface for the preview SurfaceView or SurfaceTexture, while a
54 * high-resolution still capture would also include a Surface from a ImageReader
55 * configured for high-resolution JPEG images.</p>
56 *
57 * @see CameraDevice#capture
58 * @see CameraDevice#setRepeatingRequest
59 * @see CameraDevice#createCaptureRequest
60 */
61public final class CaptureRequest extends CameraMetadata implements Parcelable {
62
63    private final HashSet<Surface> mSurfaceSet;
64    private final CameraMetadataNative mSettings;
65
66    private Object mUserTag;
67
68    /**
69     * Construct empty request.
70     *
71     * Used by Binder to unparcel this object only.
72     */
73    private CaptureRequest() {
74        mSettings = new CameraMetadataNative();
75        mSurfaceSet = new HashSet<Surface>();
76    }
77
78    /**
79     * Clone from source capture request.
80     *
81     * Used by the Builder to create an immutable copy.
82     */
83    @SuppressWarnings("unchecked")
84    private CaptureRequest(CaptureRequest source) {
85        mSettings = new CameraMetadataNative(source.mSettings);
86        mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone();
87        mUserTag = source.mUserTag;
88    }
89
90    /**
91     * Take ownership of passed-in settings.
92     *
93     * Used by the Builder to create a mutable CaptureRequest.
94     */
95    private CaptureRequest(CameraMetadataNative settings) {
96        mSettings = settings;
97        mSurfaceSet = new HashSet<Surface>();
98    }
99
100    @SuppressWarnings("unchecked")
101    @Override
102    public <T> T get(Key<T> key) {
103        return mSettings.get(key);
104    }
105
106    /**
107     * Retrieve the tag for this request, if any.
108     *
109     * <p>This tag is not used for anything by the camera device, but can be
110     * used by an application to easily identify a CaptureRequest when it is
111     * returned by
112     * {@link CameraDevice.CaptureListener#onCaptureCompleted CaptureListener.onCaptureCompleted}
113     * </p>
114     *
115     * @return the last tag Object set on this request, or {@code null} if
116     *     no tag has been set.
117     * @see Builder#setTag
118     */
119    public Object getTag() {
120        return mUserTag;
121    }
122
123    /**
124     * Determine whether this CaptureRequest is equal to another CaptureRequest.
125     *
126     * <p>A request is considered equal to another is if it's set of key/values is equal, it's
127     * list of output surfaces is equal, and the user tag is equal.</p>
128     *
129     * @param other Another instance of CaptureRequest.
130     *
131     * @return True if the requests are the same, false otherwise.
132     */
133    @Override
134    public boolean equals(Object other) {
135        return other instanceof CaptureRequest
136                && equals((CaptureRequest)other);
137    }
138
139    private boolean equals(CaptureRequest other) {
140        return other != null
141                && Objects.equals(mUserTag, other.mUserTag)
142                && mSurfaceSet.equals(other.mSurfaceSet)
143                && mSettings.equals(other.mSettings);
144    }
145
146    @Override
147    public int hashCode() {
148        return mSettings.hashCode();
149    }
150
151    public static final Parcelable.Creator<CaptureRequest> CREATOR =
152            new Parcelable.Creator<CaptureRequest>() {
153        @Override
154        public CaptureRequest createFromParcel(Parcel in) {
155            CaptureRequest request = new CaptureRequest();
156            request.readFromParcel(in);
157
158            return request;
159        }
160
161        @Override
162        public CaptureRequest[] newArray(int size) {
163            return new CaptureRequest[size];
164        }
165    };
166
167    /**
168     * Expand this object from a Parcel.
169     * Hidden since this breaks the immutability of CaptureRequest, but is
170     * needed to receive CaptureRequests with aidl.
171     *
172     * @param in The parcel from which the object should be read
173     * @hide
174     */
175    private void readFromParcel(Parcel in) {
176        mSettings.readFromParcel(in);
177
178        mSurfaceSet.clear();
179
180        Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader());
181
182        if (parcelableArray == null) {
183            return;
184        }
185
186        for (Parcelable p : parcelableArray) {
187            Surface s = (Surface) p;
188            mSurfaceSet.add(s);
189        }
190    }
191
192    @Override
193    public int describeContents() {
194        return 0;
195    }
196
197    @Override
198    public void writeToParcel(Parcel dest, int flags) {
199        mSettings.writeToParcel(dest, flags);
200        dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags);
201    }
202
203    /**
204     * @hide
205     */
206    public boolean containsTarget(Surface surface) {
207        return mSurfaceSet.contains(surface);
208    }
209
210    /**
211     * @hide
212     */
213    public Collection<Surface> getTargets() {
214        return Collections.unmodifiableCollection(mSurfaceSet);
215    }
216
217    /**
218     * A builder for capture requests.
219     *
220     * <p>To obtain a builder instance, use the
221     * {@link CameraDevice#createCaptureRequest} method, which initializes the
222     * request fields to one of the templates defined in {@link CameraDevice}.
223     *
224     * @see CameraDevice#createCaptureRequest
225     * @see #TEMPLATE_PREVIEW
226     * @see #TEMPLATE_RECORD
227     * @see #TEMPLATE_STILL_CAPTURE
228     * @see #TEMPLATE_VIDEO_SNAPSHOT
229     * @see #TEMPLATE_MANUAL
230     */
231    public final static class Builder {
232
233        private final CaptureRequest mRequest;
234
235        /**
236         * Initialize the builder using the template; the request takes
237         * ownership of the template.
238         *
239         * @hide
240         */
241        public Builder(CameraMetadataNative template) {
242            mRequest = new CaptureRequest(template);
243        }
244
245        /**
246         * <p>Add a surface to the list of targets for this request</p>
247         *
248         * <p>The Surface added must be one of the surfaces included in the most
249         * recent call to {@link CameraDevice#configureOutputs}, when the
250         * request is given to the camera device.</p>
251         *
252         * <p>Adding a target more than once has no effect.</p>
253         *
254         * @param outputTarget Surface to use as an output target for this request
255         */
256        public void addTarget(Surface outputTarget) {
257            mRequest.mSurfaceSet.add(outputTarget);
258        }
259
260        /**
261         * <p>Remove a surface from the list of targets for this request.</p>
262         *
263         * <p>Removing a target that is not currently added has no effect.</p>
264         *
265         * @param outputTarget Surface to use as an output target for this request
266         */
267        public void removeTarget(Surface outputTarget) {
268            mRequest.mSurfaceSet.remove(outputTarget);
269        }
270
271        /**
272         * Set a capture request field to a value. The field definitions can be
273         * found in {@link CaptureRequest}.
274         *
275         * @param key The metadata field to write.
276         * @param value The value to set the field to, which must be of a matching
277         * type to the key.
278         */
279        public <T> void set(Key<T> key, T value) {
280            mRequest.mSettings.set(key, value);
281        }
282
283        /**
284         * Get a capture request field value. The field definitions can be
285         * found in {@link CaptureRequest}.
286         *
287         * @throws IllegalArgumentException if the key was not valid
288         *
289         * @param key The metadata field to read.
290         * @return The value of that key, or {@code null} if the field is not set.
291         */
292        public <T> T get(Key<T> key) {
293            return mRequest.mSettings.get(key);
294        }
295
296        /**
297         * Set a tag for this request.
298         *
299         * <p>This tag is not used for anything by the camera device, but can be
300         * used by an application to easily identify a CaptureRequest when it is
301         * returned by
302         * {@link CameraDevice.CaptureListener#onCaptureCompleted CaptureListener.onCaptureCompleted}
303         *
304         * @param tag an arbitrary Object to store with this request
305         * @see CaptureRequest#getTag
306         */
307        public void setTag(Object tag) {
308            mRequest.mUserTag = tag;
309        }
310
311        /**
312         * Build a request using the current target Surfaces and settings.
313         *
314         * @return A new capture request instance, ready for submission to the
315         * camera device.
316         */
317        public CaptureRequest build() {
318            return new CaptureRequest(mRequest);
319        }
320
321
322        /**
323         * @hide
324         */
325        public boolean isEmpty() {
326            return mRequest.mSettings.isEmpty();
327        }
328
329    }
330
331    /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
332     * The key entries below this point are generated from metadata
333     * definitions in /system/media/camera/docs. Do not modify by hand or
334     * modify the comment blocks at the start or end.
335     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
336
337
338    /**
339     * <p>The mode control selects how the image data is converted from the
340     * sensor's native color into linear sRGB color.</p>
341     * <p>When auto-white balance is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this
342     * control is overridden by the AWB routine. When AWB is disabled, the
343     * application controls how the color mapping is performed.</p>
344     * <p>We define the expected processing pipeline below. For consistency
345     * across devices, this is always the case with TRANSFORM_MATRIX.</p>
346     * <p>When either FULL or HIGH_QUALITY is used, the camera device may
347     * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
348     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
349     * camera device (in the results) and be roughly correct.</p>
350     * <p>Switching to TRANSFORM_MATRIX and using the data provided from
351     * FAST or HIGH_QUALITY will yield a picture with the same white point
352     * as what was produced by the camera device in the earlier frame.</p>
353     * <p>The expected processing pipeline is as follows:</p>
354     * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
355     * <p>The white balance is encoded by two values, a 4-channel white-balance
356     * gain vector (applied in the Bayer domain), and a 3x3 color transform
357     * matrix (applied after demosaic).</p>
358     * <p>The 4-channel white-balance gains are defined as:</p>
359     * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
360     * </code></pre>
361     * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
362     * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
363     * These may be identical for a given camera device implementation; if
364     * the camera device does not support a separate gain for even/odd green
365     * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
366     * <code>G_even</code> in the output result metadata.</p>
367     * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
368     * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
369     * </code></pre>
370     * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
371     * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
372     * <p>with colors as follows:</p>
373     * <pre><code>r' = I0r + I1g + I2b
374     * g' = I3r + I4g + I5b
375     * b' = I6r + I7g + I8b
376     * </code></pre>
377     * <p>Both the input and output value ranges must match. Overflow/underflow
378     * values are clipped to fit within the range.</p>
379     *
380     * @see CaptureRequest#COLOR_CORRECTION_GAINS
381     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
382     * @see CaptureRequest#CONTROL_AWB_MODE
383     * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
384     * @see #COLOR_CORRECTION_MODE_FAST
385     * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
386     */
387    public static final Key<Integer> COLOR_CORRECTION_MODE =
388            new Key<Integer>("android.colorCorrection.mode", int.class);
389
390    /**
391     * <p>A color transform matrix to use to transform
392     * from sensor RGB color space to output linear sRGB color space</p>
393     * <p>This matrix is either set by the camera device when the request
394     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
395     * directly by the application in the request when the
396     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
397     * <p>In the latter case, the camera device may round the matrix to account
398     * for precision issues; the final rounded matrix should be reported back
399     * in this matrix result metadata. The transform should keep the magnitude
400     * of the output color values within <code>[0, 1.0]</code> (assuming input color
401     * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
402     *
403     * @see CaptureRequest#COLOR_CORRECTION_MODE
404     */
405    public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM =
406            new Key<Rational[]>("android.colorCorrection.transform", Rational[].class);
407
408    /**
409     * <p>Gains applying to Bayer raw color channels for
410     * white-balance.</p>
411     * <p>The 4-channel white-balance gains are defined in
412     * the order of <code>[R G_even G_odd B]</code>, where <code>G_even</code> is the gain
413     * for green pixels on even rows of the output, and <code>G_odd</code>
414     * is the gain for green pixels on the odd rows. if a HAL
415     * does not support a separate gain for even/odd green channels,
416     * it should use the <code>G_even</code> value, and write <code>G_odd</code> equal to
417     * <code>G_even</code> in the output result metadata.</p>
418     * <p>This array is either set by the camera device when the request
419     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
420     * directly by the application in the request when the
421     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
422     * <p>The output should be the gains actually applied by the camera device to
423     * the current frame.</p>
424     *
425     * @see CaptureRequest#COLOR_CORRECTION_MODE
426     */
427    public static final Key<float[]> COLOR_CORRECTION_GAINS =
428            new Key<float[]>("android.colorCorrection.gains", float[].class);
429
430    /**
431     * <p>The desired setting for the camera device's auto-exposure
432     * algorithm's antibanding compensation.</p>
433     * <p>Some kinds of lighting fixtures, such as some fluorescent
434     * lights, flicker at the rate of the power supply frequency
435     * (60Hz or 50Hz, depending on country). While this is
436     * typically not noticeable to a person, it can be visible to
437     * a camera device. If a camera sets its exposure time to the
438     * wrong value, the flicker may become visible in the
439     * viewfinder as flicker or in a final captured image, as a
440     * set of variable-brightness bands across the image.</p>
441     * <p>Therefore, the auto-exposure routines of camera devices
442     * include antibanding routines that ensure that the chosen
443     * exposure value will not cause such banding. The choice of
444     * exposure time depends on the rate of flicker, which the
445     * camera device can detect automatically, or the expected
446     * rate can be selected by the application using this
447     * control.</p>
448     * <p>A given camera device may not support all of the possible
449     * options for the antibanding mode. The
450     * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
451     * the available modes for a given camera device.</p>
452     * <p>The default mode is AUTO, which must be supported by all
453     * camera devices.</p>
454     * <p>If manual exposure control is enabled (by setting
455     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
456     * then this setting has no effect, and the application must
457     * ensure it selects exposure times that do not cause banding
458     * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
459     * the application in this.</p>
460     *
461     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
462     * @see CaptureRequest#CONTROL_AE_MODE
463     * @see CaptureRequest#CONTROL_MODE
464     * @see CaptureResult#STATISTICS_SCENE_FLICKER
465     * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
466     * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
467     * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
468     * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
469     */
470    public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
471            new Key<Integer>("android.control.aeAntibandingMode", int.class);
472
473    /**
474     * <p>Adjustment to AE target image
475     * brightness</p>
476     * <p>For example, if EV step is 0.333, '6' will mean an
477     * exposure compensation of +2 EV; -3 will mean an exposure
478     * compensation of -1 EV. Note that this control will only be effective
479     * if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control will take effect even when
480     * {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p>
481     * <p>In the event of exposure compensation value being changed, camera device
482     * may take several frames to reach the newly requested exposure target.
483     * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
484     * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
485     * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
486     * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
487     *
488     * @see CaptureRequest#CONTROL_AE_LOCK
489     * @see CaptureRequest#CONTROL_AE_MODE
490     * @see CaptureResult#CONTROL_AE_STATE
491     */
492    public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
493            new Key<Integer>("android.control.aeExposureCompensation", int.class);
494
495    /**
496     * <p>Whether AE is currently locked to its latest
497     * calculated values.</p>
498     * <p>Note that even when AE is locked, the flash may be
499     * fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / ON_ALWAYS_FLASH /
500     * ON_AUTO_FLASH_REDEYE.</p>
501     * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
502     * is ON, the camera device will still adjust its exposure value.</p>
503     * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
504     * when AE is already locked, the camera device will not change the exposure time
505     * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
506     * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
507     * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
508     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
509     * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
510     *
511     * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
512     * @see CaptureRequest#CONTROL_AE_MODE
513     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
514     * @see CaptureResult#CONTROL_AE_STATE
515     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
516     * @see CaptureRequest#SENSOR_SENSITIVITY
517     */
518    public static final Key<Boolean> CONTROL_AE_LOCK =
519            new Key<Boolean>("android.control.aeLock", boolean.class);
520
521    /**
522     * <p>The desired mode for the camera device's
523     * auto-exposure routine.</p>
524     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
525     * AUTO.</p>
526     * <p>When set to any of the ON modes, the camera device's
527     * auto-exposure routine is enabled, overriding the
528     * application's selected exposure time, sensor sensitivity,
529     * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
530     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
531     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
532     * is selected, the camera device's flash unit controls are
533     * also overridden.</p>
534     * <p>The FLASH modes are only available if the camera device
535     * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
536     * <p>If flash TORCH mode is desired, this field must be set to
537     * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
538     * <p>When set to any of the ON modes, the values chosen by the
539     * camera device auto-exposure routine for the overridden
540     * fields for a given capture will be available in its
541     * CaptureResult.</p>
542     *
543     * @see CaptureRequest#CONTROL_MODE
544     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
545     * @see CaptureRequest#FLASH_MODE
546     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
547     * @see CaptureRequest#SENSOR_FRAME_DURATION
548     * @see CaptureRequest#SENSOR_SENSITIVITY
549     * @see #CONTROL_AE_MODE_OFF
550     * @see #CONTROL_AE_MODE_ON
551     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
552     * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
553     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
554     */
555    public static final Key<Integer> CONTROL_AE_MODE =
556            new Key<Integer>("android.control.aeMode", int.class);
557
558    /**
559     * <p>List of areas to use for
560     * metering.</p>
561     * <p>Each area is a rectangle plus weight: xmin, ymin,
562     * xmax, ymax, weight. The rectangle is defined to be inclusive of the
563     * specified coordinates.</p>
564     * <p>The coordinate system is based on the active pixel array,
565     * with (0,0) being the top-left pixel in the active pixel array, and
566     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
567     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
568     * bottom-right pixel in the active pixel array. The weight
569     * should be nonnegative.</p>
570     * <p>If all regions have 0 weight, then no specific metering area
571     * needs to be used by the camera device. If the metering region is
572     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
573     * will ignore the sections outside the region and output the
574     * used sections in the frame metadata.</p>
575     *
576     * @see CaptureRequest#SCALER_CROP_REGION
577     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
578     */
579    public static final Key<int[]> CONTROL_AE_REGIONS =
580            new Key<int[]>("android.control.aeRegions", int[].class);
581
582    /**
583     * <p>Range over which fps can be adjusted to
584     * maintain exposure</p>
585     * <p>Only constrains AE algorithm, not manual control
586     * of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p>
587     *
588     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
589     */
590    public static final Key<int[]> CONTROL_AE_TARGET_FPS_RANGE =
591            new Key<int[]>("android.control.aeTargetFpsRange", int[].class);
592
593    /**
594     * <p>Whether the camera device will trigger a precapture
595     * metering sequence when it processes this request.</p>
596     * <p>This entry is normally set to IDLE, or is not
597     * included at all in the request settings. When included and
598     * set to START, the camera device will trigger the autoexposure
599     * precapture metering sequence.</p>
600     * <p>The effect of AE precapture trigger depends on the current
601     * AE mode and state; see {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture
602     * state transition details.</p>
603     *
604     * @see CaptureResult#CONTROL_AE_STATE
605     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
606     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
607     */
608    public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
609            new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
610
611    /**
612     * <p>Whether AF is currently enabled, and what
613     * mode it is set to</p>
614     * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
615     * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>).</p>
616     * <p>If the lens is controlled by the camera device auto-focus algorithm,
617     * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
618     * in result metadata.</p>
619     *
620     * @see CaptureResult#CONTROL_AF_STATE
621     * @see CaptureRequest#CONTROL_MODE
622     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
623     * @see #CONTROL_AF_MODE_OFF
624     * @see #CONTROL_AF_MODE_AUTO
625     * @see #CONTROL_AF_MODE_MACRO
626     * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
627     * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
628     * @see #CONTROL_AF_MODE_EDOF
629     */
630    public static final Key<Integer> CONTROL_AF_MODE =
631            new Key<Integer>("android.control.afMode", int.class);
632
633    /**
634     * <p>List of areas to use for focus
635     * estimation.</p>
636     * <p>Each area is a rectangle plus weight: xmin, ymin,
637     * xmax, ymax, weight. The rectangle is defined to be inclusive of the
638     * specified coordinates.</p>
639     * <p>The coordinate system is based on the active pixel array,
640     * with (0,0) being the top-left pixel in the active pixel array, and
641     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
642     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
643     * bottom-right pixel in the active pixel array. The weight
644     * should be nonnegative.</p>
645     * <p>If all regions have 0 weight, then no specific focus area
646     * needs to be used by the camera device. If the focusing region is
647     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
648     * will ignore the sections outside the region and output the
649     * used sections in the frame metadata.</p>
650     *
651     * @see CaptureRequest#SCALER_CROP_REGION
652     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
653     */
654    public static final Key<int[]> CONTROL_AF_REGIONS =
655            new Key<int[]>("android.control.afRegions", int[].class);
656
657    /**
658     * <p>Whether the camera device will trigger autofocus for this request.</p>
659     * <p>This entry is normally set to IDLE, or is not
660     * included at all in the request settings.</p>
661     * <p>When included and set to START, the camera device will trigger the
662     * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
663     * <p>When set to CANCEL, the camera device will cancel any active trigger,
664     * and return to its initial AF state.</p>
665     * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what that means for each AF mode.</p>
666     *
667     * @see CaptureResult#CONTROL_AF_STATE
668     * @see #CONTROL_AF_TRIGGER_IDLE
669     * @see #CONTROL_AF_TRIGGER_START
670     * @see #CONTROL_AF_TRIGGER_CANCEL
671     */
672    public static final Key<Integer> CONTROL_AF_TRIGGER =
673            new Key<Integer>("android.control.afTrigger", int.class);
674
675    /**
676     * <p>Whether AWB is currently locked to its
677     * latest calculated values.</p>
678     * <p>Note that AWB lock is only meaningful for AUTO
679     * mode; in other modes, AWB is already fixed to a specific
680     * setting.</p>
681     */
682    public static final Key<Boolean> CONTROL_AWB_LOCK =
683            new Key<Boolean>("android.control.awbLock", boolean.class);
684
685    /**
686     * <p>Whether AWB is currently setting the color
687     * transform fields, and what its illumination target
688     * is.</p>
689     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
690     * <p>When set to the ON mode, the camera device's auto white balance
691     * routine is enabled, overriding the application's selected
692     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
693     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
694     * <p>When set to the OFF mode, the camera device's auto white balance
695     * routine is disabled. The application manually controls the white
696     * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
697     * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
698     * <p>When set to any other modes, the camera device's auto white balance
699     * routine is disabled. The camera device uses each particular illumination
700     * target for white balance adjustment.</p>
701     *
702     * @see CaptureRequest#COLOR_CORRECTION_GAINS
703     * @see CaptureRequest#COLOR_CORRECTION_MODE
704     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
705     * @see CaptureRequest#CONTROL_MODE
706     * @see #CONTROL_AWB_MODE_OFF
707     * @see #CONTROL_AWB_MODE_AUTO
708     * @see #CONTROL_AWB_MODE_INCANDESCENT
709     * @see #CONTROL_AWB_MODE_FLUORESCENT
710     * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
711     * @see #CONTROL_AWB_MODE_DAYLIGHT
712     * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
713     * @see #CONTROL_AWB_MODE_TWILIGHT
714     * @see #CONTROL_AWB_MODE_SHADE
715     */
716    public static final Key<Integer> CONTROL_AWB_MODE =
717            new Key<Integer>("android.control.awbMode", int.class);
718
719    /**
720     * <p>List of areas to use for illuminant
721     * estimation.</p>
722     * <p>Only used in AUTO mode.</p>
723     * <p>Each area is a rectangle plus weight: xmin, ymin,
724     * xmax, ymax, weight. The rectangle is defined to be inclusive of the
725     * specified coordinates.</p>
726     * <p>The coordinate system is based on the active pixel array,
727     * with (0,0) being the top-left pixel in the active pixel array, and
728     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
729     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
730     * bottom-right pixel in the active pixel array. The weight
731     * should be nonnegative.</p>
732     * <p>If all regions have 0 weight, then no specific auto-white balance (AWB) area
733     * needs to be used by the camera device. If the AWB region is
734     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
735     * will ignore the sections outside the region and output the
736     * used sections in the frame metadata.</p>
737     *
738     * @see CaptureRequest#SCALER_CROP_REGION
739     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
740     */
741    public static final Key<int[]> CONTROL_AWB_REGIONS =
742            new Key<int[]>("android.control.awbRegions", int[].class);
743
744    /**
745     * <p>Information to the camera device 3A (auto-exposure,
746     * auto-focus, auto-white balance) routines about the purpose
747     * of this capture, to help the camera device to decide optimal 3A
748     * strategy.</p>
749     * <p>This control (except for MANUAL) is only effective if
750     * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
751     * <p>ZERO_SHUTTER_LAG must be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
752     * contains ZSL. MANUAL must be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
753     * contains MANUAL_SENSOR.</p>
754     *
755     * @see CaptureRequest#CONTROL_MODE
756     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
757     * @see #CONTROL_CAPTURE_INTENT_CUSTOM
758     * @see #CONTROL_CAPTURE_INTENT_PREVIEW
759     * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
760     * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
761     * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
762     * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
763     * @see #CONTROL_CAPTURE_INTENT_MANUAL
764     */
765    public static final Key<Integer> CONTROL_CAPTURE_INTENT =
766            new Key<Integer>("android.control.captureIntent", int.class);
767
768    /**
769     * <p>A special color effect to apply.</p>
770     * <p>When this mode is set, a color effect will be applied
771     * to images produced by the camera device. The interpretation
772     * and implementation of these color effects is left to the
773     * implementor of the camera device, and should not be
774     * depended on to be consistent (or present) across all
775     * devices.</p>
776     * <p>A color effect will only be applied if
777     * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p>
778     *
779     * @see CaptureRequest#CONTROL_MODE
780     * @see #CONTROL_EFFECT_MODE_OFF
781     * @see #CONTROL_EFFECT_MODE_MONO
782     * @see #CONTROL_EFFECT_MODE_NEGATIVE
783     * @see #CONTROL_EFFECT_MODE_SOLARIZE
784     * @see #CONTROL_EFFECT_MODE_SEPIA
785     * @see #CONTROL_EFFECT_MODE_POSTERIZE
786     * @see #CONTROL_EFFECT_MODE_WHITEBOARD
787     * @see #CONTROL_EFFECT_MODE_BLACKBOARD
788     * @see #CONTROL_EFFECT_MODE_AQUA
789     */
790    public static final Key<Integer> CONTROL_EFFECT_MODE =
791            new Key<Integer>("android.control.effectMode", int.class);
792
793    /**
794     * <p>Overall mode of 3A control
795     * routines.</p>
796     * <p>High-level 3A control. When set to OFF, all 3A control
797     * by the camera device is disabled. The application must set the fields for
798     * capture parameters itself.</p>
799     * <p>When set to AUTO, the individual algorithm controls in
800     * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
801     * <p>When set to USE_SCENE_MODE, the individual controls in
802     * android.control.* are mostly disabled, and the camera device implements
803     * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
804     * as it wishes. The camera device scene mode 3A settings are provided by
805     * android.control.sceneModeOverrides.</p>
806     * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
807     * is that this frame will not be used by camera device background 3A statistics
808     * update, as if this frame is never captured. This mode can be used in the scenario
809     * where the application doesn't want a 3A manual control capture to affect
810     * the subsequent auto 3A capture results.</p>
811     *
812     * @see CaptureRequest#CONTROL_AF_MODE
813     * @see #CONTROL_MODE_OFF
814     * @see #CONTROL_MODE_AUTO
815     * @see #CONTROL_MODE_USE_SCENE_MODE
816     * @see #CONTROL_MODE_OFF_KEEP_STATE
817     */
818    public static final Key<Integer> CONTROL_MODE =
819            new Key<Integer>("android.control.mode", int.class);
820
821    /**
822     * <p>A camera mode optimized for conditions typical in a particular
823     * capture setting.</p>
824     * <p>This is the mode that that is active when
825     * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
826     * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
827     * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p>
828     * <p>The interpretation and implementation of these scene modes is left
829     * to the implementor of the camera device. Their behavior will not be
830     * consistent across all devices, and any given device may only implement
831     * a subset of these modes.</p>
832     *
833     * @see CaptureRequest#CONTROL_AE_MODE
834     * @see CaptureRequest#CONTROL_AF_MODE
835     * @see CaptureRequest#CONTROL_AWB_MODE
836     * @see CaptureRequest#CONTROL_MODE
837     * @see #CONTROL_SCENE_MODE_DISABLED
838     * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
839     * @see #CONTROL_SCENE_MODE_ACTION
840     * @see #CONTROL_SCENE_MODE_PORTRAIT
841     * @see #CONTROL_SCENE_MODE_LANDSCAPE
842     * @see #CONTROL_SCENE_MODE_NIGHT
843     * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
844     * @see #CONTROL_SCENE_MODE_THEATRE
845     * @see #CONTROL_SCENE_MODE_BEACH
846     * @see #CONTROL_SCENE_MODE_SNOW
847     * @see #CONTROL_SCENE_MODE_SUNSET
848     * @see #CONTROL_SCENE_MODE_STEADYPHOTO
849     * @see #CONTROL_SCENE_MODE_FIREWORKS
850     * @see #CONTROL_SCENE_MODE_SPORTS
851     * @see #CONTROL_SCENE_MODE_PARTY
852     * @see #CONTROL_SCENE_MODE_CANDLELIGHT
853     * @see #CONTROL_SCENE_MODE_BARCODE
854     */
855    public static final Key<Integer> CONTROL_SCENE_MODE =
856            new Key<Integer>("android.control.sceneMode", int.class);
857
858    /**
859     * <p>Whether video stabilization is
860     * active</p>
861     * <p>If enabled, video stabilization can modify the
862     * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream
863     * stabilized</p>
864     *
865     * @see CaptureRequest#SCALER_CROP_REGION
866     * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
867     * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
868     */
869    public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
870            new Key<Integer>("android.control.videoStabilizationMode", int.class);
871
872    /**
873     * <p>Operation mode for edge
874     * enhancement.</p>
875     * <p>Edge/sharpness/detail enhancement. OFF means no
876     * enhancement will be applied by the camera device.</p>
877     * <p>This must be set to one of the modes listed in {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}.</p>
878     * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
879     * will be applied. HIGH_QUALITY mode indicates that the
880     * camera device will use the highest-quality enhancement algorithms,
881     * even if it slows down capture rate. FAST means the camera device will
882     * not slow down capture rate when applying edge enhancement.</p>
883     *
884     * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
885     * @see #EDGE_MODE_OFF
886     * @see #EDGE_MODE_FAST
887     * @see #EDGE_MODE_HIGH_QUALITY
888     */
889    public static final Key<Integer> EDGE_MODE =
890            new Key<Integer>("android.edge.mode", int.class);
891
892    /**
893     * <p>The desired mode for for the camera device's flash control.</p>
894     * <p>This control is only effective when flash unit is available
895     * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
896     * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
897     * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
898     * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
899     * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
900     * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
901     * device's auto-exposure routine's result. When used in still capture case, this
902     * control should be used along with AE precapture metering sequence
903     * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
904     * <p>When set to TORCH, the flash will be on continuously. This mode can be used
905     * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
906     * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
907     *
908     * @see CaptureRequest#CONTROL_AE_MODE
909     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
910     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
911     * @see CaptureResult#FLASH_STATE
912     * @see #FLASH_MODE_OFF
913     * @see #FLASH_MODE_SINGLE
914     * @see #FLASH_MODE_TORCH
915     */
916    public static final Key<Integer> FLASH_MODE =
917            new Key<Integer>("android.flash.mode", int.class);
918
919    /**
920     * <p>Set operational mode for hot pixel correction.</p>
921     * <p>Valid modes for this camera device are listed in
922     * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p>
923     * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
924     * that do not accurately encode the incoming light (i.e. pixels that
925     * are stuck at an arbitrary value).</p>
926     *
927     * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
928     * @see #HOT_PIXEL_MODE_OFF
929     * @see #HOT_PIXEL_MODE_FAST
930     * @see #HOT_PIXEL_MODE_HIGH_QUALITY
931     */
932    public static final Key<Integer> HOT_PIXEL_MODE =
933            new Key<Integer>("android.hotPixel.mode", int.class);
934
935    /**
936     * <p>GPS coordinates to include in output JPEG
937     * EXIF</p>
938     */
939    public static final Key<double[]> JPEG_GPS_COORDINATES =
940            new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
941
942    /**
943     * <p>32 characters describing GPS algorithm to
944     * include in EXIF</p>
945     */
946    public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
947            new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
948
949    /**
950     * <p>Time GPS fix was made to include in
951     * EXIF</p>
952     */
953    public static final Key<Long> JPEG_GPS_TIMESTAMP =
954            new Key<Long>("android.jpeg.gpsTimestamp", long.class);
955
956    /**
957     * <p>Orientation of JPEG image to
958     * write</p>
959     */
960    public static final Key<Integer> JPEG_ORIENTATION =
961            new Key<Integer>("android.jpeg.orientation", int.class);
962
963    /**
964     * <p>Compression quality of the final JPEG
965     * image</p>
966     * <p>85-95 is typical usage range</p>
967     */
968    public static final Key<Byte> JPEG_QUALITY =
969            new Key<Byte>("android.jpeg.quality", byte.class);
970
971    /**
972     * <p>Compression quality of JPEG
973     * thumbnail</p>
974     */
975    public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
976            new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
977
978    /**
979     * <p>Resolution of embedded JPEG thumbnail</p>
980     * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
981     * but the captured JPEG will still be a valid image.</p>
982     * <p>When a jpeg image capture is issued, the thumbnail size selected should have
983     * the same aspect ratio as the jpeg image.</p>
984     */
985    public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
986            new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
987
988    /**
989     * <p>The ratio of lens focal length to the effective
990     * aperture diameter.</p>
991     * <p>This will only be supported on the camera devices that
992     * have variable aperture lens. The aperture value can only be
993     * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
994     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
995     * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
996     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
997     * to achieve manual exposure control.</p>
998     * <p>The requested aperture value may take several frames to reach the
999     * requested value; the camera device will report the current (intermediate)
1000     * aperture size in capture result metadata while the aperture is changing.
1001     * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
1002     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1003     * the ON modes, this will be overridden by the camera device
1004     * auto-exposure algorithm, the overridden values are then provided
1005     * back to the user in the corresponding result.</p>
1006     *
1007     * @see CaptureRequest#CONTROL_AE_MODE
1008     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1009     * @see CaptureResult#LENS_STATE
1010     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1011     * @see CaptureRequest#SENSOR_FRAME_DURATION
1012     * @see CaptureRequest#SENSOR_SENSITIVITY
1013     */
1014    public static final Key<Float> LENS_APERTURE =
1015            new Key<Float>("android.lens.aperture", float.class);
1016
1017    /**
1018     * <p>State of lens neutral density filter(s).</p>
1019     * <p>This will not be supported on most camera devices. On devices
1020     * where this is supported, this may only be set to one of the
1021     * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p>
1022     * <p>Lens filters are typically used to lower the amount of light the
1023     * sensor is exposed to (measured in steps of EV). As used here, an EV
1024     * step is the standard logarithmic representation, which are
1025     * non-negative, and inversely proportional to the amount of light
1026     * hitting the sensor.  For example, setting this to 0 would result
1027     * in no reduction of the incoming light, and setting this to 2 would
1028     * mean that the filter is set to reduce incoming light by two stops
1029     * (allowing 1/4 of the prior amount of light to the sensor).</p>
1030     * <p>It may take several frames before the lens filter density changes
1031     * to the requested value. While the filter density is still changing,
1032     * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
1033     *
1034     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1035     * @see CaptureResult#LENS_STATE
1036     */
1037    public static final Key<Float> LENS_FILTER_DENSITY =
1038            new Key<Float>("android.lens.filterDensity", float.class);
1039
1040    /**
1041     * <p>The current lens focal length; used for optical zoom.</p>
1042     * <p>This setting controls the physical focal length of the camera
1043     * device's lens. Changing the focal length changes the field of
1044     * view of the camera device, and is usually used for optical zoom.</p>
1045     * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1046     * setting won't be applied instantaneously, and it may take several
1047     * frames before the lens can change to the requested focal length.
1048     * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1049     * be set to MOVING.</p>
1050     * <p>This is expected not to be supported on most devices.</p>
1051     *
1052     * @see CaptureRequest#LENS_APERTURE
1053     * @see CaptureRequest#LENS_FOCUS_DISTANCE
1054     * @see CaptureResult#LENS_STATE
1055     */
1056    public static final Key<Float> LENS_FOCAL_LENGTH =
1057            new Key<Float>("android.lens.focalLength", float.class);
1058
1059    /**
1060     * <p>Distance to plane of sharpest focus,
1061     * measured from frontmost surface of the lens</p>
1062     * <p>0 means infinity focus. Used value will be clamped
1063     * to [0, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}].</p>
1064     * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied
1065     * instantaneously, and it may take several frames before the lens
1066     * can move to the requested focus distance. While the lens is still moving,
1067     * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
1068     *
1069     * @see CaptureRequest#LENS_FOCAL_LENGTH
1070     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1071     * @see CaptureResult#LENS_STATE
1072     */
1073    public static final Key<Float> LENS_FOCUS_DISTANCE =
1074            new Key<Float>("android.lens.focusDistance", float.class);
1075
1076    /**
1077     * <p>Sets whether the camera device uses optical image stabilization (OIS)
1078     * when capturing images.</p>
1079     * <p>OIS is used to compensate for motion blur due to small movements of
1080     * the camera during capture. Unlike digital image stabilization, OIS makes
1081     * use of mechanical elements to stabilize the camera sensor, and thus
1082     * allows for longer exposure times before camera shake becomes
1083     * apparent.</p>
1084     * <p>This is not expected to be supported on most devices.</p>
1085     * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
1086     * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
1087     */
1088    public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
1089            new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
1090
1091    /**
1092     * <p>Mode of operation for the noise reduction
1093     * algorithm</p>
1094     * <p>Noise filtering control. OFF means no noise reduction
1095     * will be applied by the camera device.</p>
1096     * <p>This must be set to a valid mode in
1097     * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p>
1098     * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
1099     * will be applied. HIGH_QUALITY mode indicates that the camera device
1100     * will use the highest-quality noise filtering algorithms,
1101     * even if it slows down capture rate. FAST means the camera device should not
1102     * slow down capture rate when applying noise filtering.</p>
1103     *
1104     * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
1105     * @see #NOISE_REDUCTION_MODE_OFF
1106     * @see #NOISE_REDUCTION_MODE_FAST
1107     * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
1108     */
1109    public static final Key<Integer> NOISE_REDUCTION_MODE =
1110            new Key<Integer>("android.noiseReduction.mode", int.class);
1111
1112    /**
1113     * <p>An application-specified ID for the current
1114     * request. Must be maintained unchanged in output
1115     * frame</p>
1116     * @hide
1117     */
1118    public static final Key<Integer> REQUEST_ID =
1119            new Key<Integer>("android.request.id", int.class);
1120
1121    /**
1122     * <p>(x, y, width, height).</p>
1123     * <p>A rectangle with the top-level corner of (x,y) and size
1124     * (width, height). The region of the sensor that is used for
1125     * output. Each stream must use this rectangle to produce its
1126     * output, cropping to a smaller region if necessary to
1127     * maintain the stream's aspect ratio.</p>
1128     * <p>HAL2.x uses only (x, y, width)</p>
1129     * <p>Any additional per-stream cropping must be done to
1130     * maximize the final pixel area of the stream.</p>
1131     * <p>For example, if the crop region is set to a 4:3 aspect
1132     * ratio, then 4:3 streams should use the exact crop
1133     * region. 16:9 streams should further crop vertically
1134     * (letterbox).</p>
1135     * <p>Conversely, if the crop region is set to a 16:9, then 4:3
1136     * outputs should crop horizontally (pillarbox), and 16:9
1137     * streams should match exactly. These additional crops must
1138     * be centered within the crop region.</p>
1139     * <p>The output streams must maintain square pixels at all
1140     * times, no matter what the relative aspect ratios of the
1141     * crop region and the stream are.  Negative values for
1142     * corner are allowed for raw output if full pixel array is
1143     * larger than active pixel array. Width and height may be
1144     * rounded to nearest larger supportable width, especially
1145     * for raw output, where only a few fixed scales may be
1146     * possible. The width and height of the crop region cannot
1147     * be set to be smaller than floor( activeArraySize.width /
1148     * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} ) and floor(
1149     * activeArraySize.height /
1150     * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom}), respectively.</p>
1151     *
1152     * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
1153     */
1154    public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
1155            new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
1156
1157    /**
1158     * <p>Duration each pixel is exposed to
1159     * light.</p>
1160     * <p>If the sensor can't expose this exact duration, it should shorten the
1161     * duration exposed to the nearest possible value (rather than expose longer).</p>
1162     */
1163    public static final Key<Long> SENSOR_EXPOSURE_TIME =
1164            new Key<Long>("android.sensor.exposureTime", long.class);
1165
1166    /**
1167     * <p>Duration from start of frame exposure to
1168     * start of next frame exposure.</p>
1169     * <p>The maximum frame rate that can be supported by a camera subsystem is
1170     * a function of many factors:</p>
1171     * <ul>
1172     * <li>Requested resolutions of output image streams</li>
1173     * <li>Availability of binning / skipping modes on the imager</li>
1174     * <li>The bandwidth of the imager interface</li>
1175     * <li>The bandwidth of the various ISP processing blocks</li>
1176     * </ul>
1177     * <p>Since these factors can vary greatly between different ISPs and
1178     * sensors, the camera abstraction tries to represent the bandwidth
1179     * restrictions with as simple a model as possible.</p>
1180     * <p>The model presented has the following characteristics:</p>
1181     * <ul>
1182     * <li>The image sensor is always configured to output the smallest
1183     * resolution possible given the application's requested output stream
1184     * sizes.  The smallest resolution is defined as being at least as large
1185     * as the largest requested output stream size; the camera pipeline must
1186     * never digitally upsample sensor data when the crop region covers the
1187     * whole sensor. In general, this means that if only small output stream
1188     * resolutions are configured, the sensor can provide a higher frame
1189     * rate.</li>
1190     * <li>Since any request may use any or all the currently configured
1191     * output streams, the sensor and ISP must be configured to support
1192     * scaling a single capture to all the streams at the same time.  This
1193     * means the camera pipeline must be ready to produce the largest
1194     * requested output size without any delay.  Therefore, the overall
1195     * frame rate of a given configured stream set is governed only by the
1196     * largest requested stream resolution.</li>
1197     * <li>Using more than one output stream in a request does not affect the
1198     * frame duration.</li>
1199     * <li>Certain format-streams may need to do additional background processing
1200     * before data is consumed/produced by that stream. These processors
1201     * can run concurrently to the rest of the camera pipeline, but
1202     * cannot process more than 1 capture at a time.</li>
1203     * </ul>
1204     * <p>The necessary information for the application, given the model above,
1205     * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
1206     * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
1207     * These are used to determine the maximum frame rate / minimum frame
1208     * duration that is possible for a given stream configuration.</p>
1209     * <p>Specifically, the application can use the following rules to
1210     * determine the minimum frame duration it can request from the camera
1211     * device:</p>
1212     * <ol>
1213     * <li>Let the set of currently configured input/output streams
1214     * be called <code>S</code>.</li>
1215     * <li>Find the minimum frame durations for each stream in <code>S</code>, by
1216     * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
1217     * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
1218     * its respective size/format). Let this set of frame durations be called
1219     * <code>F</code>.</li>
1220     * <li>For any given request <code>R</code>, the minimum frame duration allowed
1221     * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
1222     * used in <code>R</code> be called <code>S_r</code>.</li>
1223     * </ol>
1224     * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
1225     * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
1226     * respective size/format), then the frame duration in
1227     * <code>F</code> determines the steady state frame rate that the application will
1228     * get if it uses <code>R</code> as a repeating request. Let this special kind
1229     * of request be called <code>Rsimple</code>.</p>
1230     * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
1231     * by a single capture of a new request <code>Rstall</code> (which has at least
1232     * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
1233     * same minimum frame duration this will not cause a frame rate loss
1234     * if all buffers from the previous <code>Rstall</code> have already been
1235     * delivered.</p>
1236     * <p>For more details about stalling, see
1237     * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
1238     *
1239     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1240     */
1241    public static final Key<Long> SENSOR_FRAME_DURATION =
1242            new Key<Long>("android.sensor.frameDuration", long.class);
1243
1244    /**
1245     * <p>Gain applied to image data. Must be
1246     * implemented through analog gain only if set to values
1247     * below 'maximum analog sensitivity'.</p>
1248     * <p>If the sensor can't apply this exact gain, it should lessen the
1249     * gain to the nearest possible value (rather than gain more).</p>
1250     * <p>ISO 12232:2006 REI method</p>
1251     */
1252    public static final Key<Integer> SENSOR_SENSITIVITY =
1253            new Key<Integer>("android.sensor.sensitivity", int.class);
1254
1255    /**
1256     * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
1257     * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
1258     * <p>Each color channel is treated as an unsigned 32-bit integer.
1259     * The camera device then uses the most significant X bits
1260     * that correspond to how many bits are in its Bayer raw sensor
1261     * output.</p>
1262     * <p>For example, a sensor with RAW10 Bayer output would use the
1263     * 10 most significant bits from each color channel.</p>
1264     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1265     *
1266     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
1267     */
1268    public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
1269            new Key<int[]>("android.sensor.testPatternData", int[].class);
1270
1271    /**
1272     * <p>When enabled, the sensor sends a test pattern instead of
1273     * doing a real exposure from the camera.</p>
1274     * <p>When a test pattern is enabled, all manual sensor controls specified
1275     * by android.sensor.* should be ignored. All other controls should
1276     * work as normal.</p>
1277     * <p>For example, if manual flash is enabled, flash firing should still
1278     * occur (and that the test pattern remain unmodified, since the flash
1279     * would not actually affect it).</p>
1280     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1281     * @see #SENSOR_TEST_PATTERN_MODE_OFF
1282     * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
1283     * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
1284     * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
1285     * @see #SENSOR_TEST_PATTERN_MODE_PN9
1286     * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
1287     */
1288    public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
1289            new Key<Integer>("android.sensor.testPatternMode", int.class);
1290
1291    /**
1292     * <p>Quality of lens shading correction applied
1293     * to the image data.</p>
1294     * <p>When set to OFF mode, no lens shading correction will be applied by the
1295     * camera device, and an identity lens shading map data will be provided
1296     * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
1297     * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>,
1298     * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map
1299     * shown below:</p>
1300     * <pre><code>[ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
1301     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
1302     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
1303     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
1304     * 1.0, 1.0, 1.0, 1.0,   1.0, 1.0, 1.0, 1.0,
1305     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0 ]
1306     * </code></pre>
1307     * <p>When set to other modes, lens shading correction will be applied by the
1308     * camera device. Applications can request lens shading map data by setting
1309     * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide
1310     * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified
1311     * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p>
1312     *
1313     * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
1314     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
1315     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
1316     * @see #SHADING_MODE_OFF
1317     * @see #SHADING_MODE_FAST
1318     * @see #SHADING_MODE_HIGH_QUALITY
1319     */
1320    public static final Key<Integer> SHADING_MODE =
1321            new Key<Integer>("android.shading.mode", int.class);
1322
1323    /**
1324     * <p>State of the face detector
1325     * unit</p>
1326     * <p>Whether face detection is enabled, and whether it
1327     * should output just the basic fields or the full set of
1328     * fields. Value must be one of the
1329     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p>
1330     *
1331     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
1332     * @see #STATISTICS_FACE_DETECT_MODE_OFF
1333     * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
1334     * @see #STATISTICS_FACE_DETECT_MODE_FULL
1335     */
1336    public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
1337            new Key<Integer>("android.statistics.faceDetectMode", int.class);
1338
1339    /**
1340     * <p>Operating mode for hotpixel map generation.</p>
1341     * <p>If set to ON, a hotpixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
1342     * If set to OFF, no hotpixel map should be returned.</p>
1343     * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p>
1344     *
1345     * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
1346     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
1347     */
1348    public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
1349            new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
1350
1351    /**
1352     * <p>Whether the camera device will output the lens
1353     * shading map in output result metadata.</p>
1354     * <p>When set to ON,
1355     * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} must be provided in
1356     * the output result metadata.</p>
1357     *
1358     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
1359     * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
1360     * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
1361     */
1362    public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
1363            new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
1364
1365    /**
1366     * <p>Tonemapping / contrast / gamma curve for the blue
1367     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
1368     * CONTRAST_CURVE.</p>
1369     * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
1370     *
1371     * @see CaptureRequest#TONEMAP_CURVE_RED
1372     * @see CaptureRequest#TONEMAP_MODE
1373     */
1374    public static final Key<float[]> TONEMAP_CURVE_BLUE =
1375            new Key<float[]>("android.tonemap.curveBlue", float[].class);
1376
1377    /**
1378     * <p>Tonemapping / contrast / gamma curve for the green
1379     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
1380     * CONTRAST_CURVE.</p>
1381     * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
1382     *
1383     * @see CaptureRequest#TONEMAP_CURVE_RED
1384     * @see CaptureRequest#TONEMAP_MODE
1385     */
1386    public static final Key<float[]> TONEMAP_CURVE_GREEN =
1387            new Key<float[]>("android.tonemap.curveGreen", float[].class);
1388
1389    /**
1390     * <p>Tonemapping / contrast / gamma curve for the red
1391     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
1392     * CONTRAST_CURVE.</p>
1393     * <p>Each channel's curve is defined by an array of control points:</p>
1394     * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} =
1395     * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
1396     * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
1397     * <p>These are sorted in order of increasing <code>Pin</code>; it is always
1398     * guaranteed that input values 0.0 and 1.0 are included in the list to
1399     * define a complete mapping. For input values between control points,
1400     * the camera device must linearly interpolate between the control
1401     * points.</p>
1402     * <p>Each curve can have an independent number of points, and the number
1403     * of points can be less than max (that is, the request doesn't have to
1404     * always provide a curve with number of points equivalent to
1405     * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
1406     * <p>A few examples, and their corresponding graphical mappings; these
1407     * only specify the red channel and the precision is limited to 4
1408     * digits, for conciseness.</p>
1409     * <p>Linear mapping:</p>
1410     * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 0, 1.0, 1.0 ]
1411     * </code></pre>
1412     * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
1413     * <p>Invert mapping:</p>
1414     * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 1.0, 1.0, 0 ]
1415     * </code></pre>
1416     * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
1417     * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
1418     * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [
1419     * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
1420     * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
1421     * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
1422     * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
1423     * </code></pre>
1424     * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
1425     * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
1426     * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [
1427     * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
1428     * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
1429     * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
1430     * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
1431     * </code></pre>
1432     * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
1433     *
1434     * @see CaptureRequest#TONEMAP_CURVE_RED
1435     * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
1436     * @see CaptureRequest#TONEMAP_MODE
1437     */
1438    public static final Key<float[]> TONEMAP_CURVE_RED =
1439            new Key<float[]>("android.tonemap.curveRed", float[].class);
1440
1441    /**
1442     * <p>High-level global contrast/gamma/tonemapping control.</p>
1443     * <p>When switching to an application-defined contrast curve by setting
1444     * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
1445     * per-channel with a set of <code>(in, out)</code> points that specify the
1446     * mapping from input high-bit-depth pixel value to the output
1447     * low-bit-depth value.  Since the actual pixel ranges of both input
1448     * and output may change depending on the camera pipeline, the values
1449     * are specified by normalized floating-point numbers.</p>
1450     * <p>More-complex color mapping operations such as 3D color look-up
1451     * tables, selective chroma enhancement, or other non-linear color
1452     * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
1453     * CONTRAST_CURVE.</p>
1454     * <p>This must be set to a valid mode in
1455     * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p>
1456     * <p>When using either FAST or HIGH_QUALITY, the camera device will
1457     * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed},
1458     * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, and {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}.
1459     * These values are always available, and as close as possible to the
1460     * actually used nonlinear/nonglobal transforms.</p>
1461     * <p>If a request is sent with TRANSFORM_MATRIX with the camera device's
1462     * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
1463     * roughly the same.</p>
1464     *
1465     * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
1466     * @see CaptureRequest#TONEMAP_CURVE_BLUE
1467     * @see CaptureRequest#TONEMAP_CURVE_GREEN
1468     * @see CaptureRequest#TONEMAP_CURVE_RED
1469     * @see CaptureRequest#TONEMAP_MODE
1470     * @see #TONEMAP_MODE_CONTRAST_CURVE
1471     * @see #TONEMAP_MODE_FAST
1472     * @see #TONEMAP_MODE_HIGH_QUALITY
1473     */
1474    public static final Key<Integer> TONEMAP_MODE =
1475            new Key<Integer>("android.tonemap.mode", int.class);
1476
1477    /**
1478     * <p>This LED is nominally used to indicate to the user
1479     * that the camera is powered on and may be streaming images back to the
1480     * Application Processor. In certain rare circumstances, the OS may
1481     * disable this when video is processed locally and not transmitted to
1482     * any untrusted applications.</p>
1483     * <p>In particular, the LED <em>must</em> always be on when the data could be
1484     * transmitted off the device. The LED <em>should</em> always be on whenever
1485     * data is stored locally on the device.</p>
1486     * <p>The LED <em>may</em> be off if a trusted application is using the data that
1487     * doesn't violate the above rules.</p>
1488     * @hide
1489     */
1490    public static final Key<Boolean> LED_TRANSMIT =
1491            new Key<Boolean>("android.led.transmit", boolean.class);
1492
1493    /**
1494     * <p>Whether black-level compensation is locked
1495     * to its current values, or is free to vary.</p>
1496     * <p>When set to ON, the values used for black-level
1497     * compensation will not change until the lock is set to
1498     * OFF.</p>
1499     * <p>Since changes to certain capture parameters (such as
1500     * exposure time) may require resetting of black level
1501     * compensation, the camera device must report whether setting
1502     * the black level lock was successful in the output result
1503     * metadata.</p>
1504     * <p>For example, if a sequence of requests is as follows:</p>
1505     * <ul>
1506     * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li>
1507     * <li>Request 2: Exposure = 10ms, Black level lock = ON</li>
1508     * <li>Request 3: Exposure = 10ms, Black level lock = ON</li>
1509     * <li>Request 4: Exposure = 20ms, Black level lock = ON</li>
1510     * <li>Request 5: Exposure = 20ms, Black level lock = ON</li>
1511     * <li>Request 6: Exposure = 20ms, Black level lock = ON</li>
1512     * </ul>
1513     * <p>And the exposure change in Request 4 requires the camera
1514     * device to reset the black level offsets, then the output
1515     * result metadata is expected to be:</p>
1516     * <ul>
1517     * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li>
1518     * <li>Result 2: Exposure = 10ms, Black level lock = ON</li>
1519     * <li>Result 3: Exposure = 10ms, Black level lock = ON</li>
1520     * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li>
1521     * <li>Result 5: Exposure = 20ms, Black level lock = ON</li>
1522     * <li>Result 6: Exposure = 20ms, Black level lock = ON</li>
1523     * </ul>
1524     * <p>This indicates to the application that on frame 4, black
1525     * levels were reset due to exposure value changes, and pixel
1526     * values may not be consistent across captures.</p>
1527     * <p>The camera device will maintain the lock to the extent
1528     * possible, only overriding the lock to OFF when changes to
1529     * other request parameters require a black level recalculation
1530     * or reset.</p>
1531     */
1532    public static final Key<Boolean> BLACK_LEVEL_LOCK =
1533            new Key<Boolean>("android.blackLevel.lock", boolean.class);
1534
1535    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
1536     * End generated code
1537     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
1538}
1539