CaptureRequest.java revision 855bae407d61b5cc6629248e7692927b4dacd92f
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.view.Surface;
23
24import java.util.HashSet;
25import java.util.Objects;
26
27
28/**
29 * <p>An immutable package of settings and outputs needed to capture a single
30 * image from the camera device.</p>
31 *
32 * <p>Contains the configuration for the capture hardware (sensor, lens, flash),
33 * the processing pipeline, the control algorithms, and the output buffers. Also
34 * contains the list of target Surfaces to send image data to for this
35 * capture.</p>
36 *
37 * <p>CaptureRequests can be created by using a {@link Builder} instance,
38 * obtained by calling {@link CameraDevice#createCaptureRequest}</p>
39 *
40 * <p>CaptureRequests are given to {@link CameraDevice#capture} or
41 * {@link CameraDevice#setRepeatingRequest} to capture images from a camera.</p>
42 *
43 * <p>Each request can specify a different subset of target Surfaces for the
44 * camera to send the captured data to. All the surfaces used in a request must
45 * be part of the surface list given to the last call to
46 * {@link CameraDevice#configureOutputs}, when the request is submitted to the
47 * camera device.</p>
48 *
49 * <p>For example, a request meant for repeating preview might only include the
50 * Surface for the preview SurfaceView or SurfaceTexture, while a
51 * high-resolution still capture would also include a Surface from a ImageReader
52 * configured for high-resolution JPEG images.</p>
53 *
54 * @see CameraDevice#capture
55 * @see CameraDevice#setRepeatingRequest
56 * @see CameraDevice#createCaptureRequest
57 */
58public final class CaptureRequest extends CameraMetadata implements Parcelable {
59
60    private final HashSet<Surface> mSurfaceSet;
61    private final CameraMetadataNative mSettings;
62
63    private Object mUserTag;
64
65    /**
66     * Construct empty request.
67     *
68     * Used by Binder to unparcel this object only.
69     */
70    private CaptureRequest() {
71        mSettings = new CameraMetadataNative();
72        mSurfaceSet = new HashSet<Surface>();
73    }
74
75    /**
76     * Clone from source capture request.
77     *
78     * Used by the Builder to create an immutable copy.
79     */
80    @SuppressWarnings("unchecked")
81    private CaptureRequest(CaptureRequest source) {
82        mSettings = new CameraMetadataNative(source.mSettings);
83        mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone();
84        mUserTag = source.mUserTag;
85    }
86
87    /**
88     * Take ownership of passed-in settings.
89     *
90     * Used by the Builder to create a mutable CaptureRequest.
91     */
92    private CaptureRequest(CameraMetadataNative settings) {
93        mSettings = settings;
94        mSurfaceSet = new HashSet<Surface>();
95    }
96
97    @SuppressWarnings("unchecked")
98    @Override
99    public <T> T get(Key<T> key) {
100        return mSettings.get(key);
101    }
102
103    /**
104     * Retrieve the tag for this request, if any.
105     *
106     * <p>This tag is not used for anything by the camera device, but can be
107     * used by an application to easily identify a CaptureRequest when it is
108     * returned by
109     * {@link CameraDevice.CaptureListener#onCaptureCompleted CaptureListener.onCaptureCompleted}
110     * </p>
111     *
112     * @return the last tag Object set on this request, or {@code null} if
113     *     no tag has been set.
114     * @see Builder#setTag
115     */
116    public Object getTag() {
117        return mUserTag;
118    }
119
120    /**
121     * Determine whether this CaptureRequest is equal to another CaptureRequest.
122     *
123     * <p>A request is considered equal to another is if it's set of key/values is equal, it's
124     * list of output surfaces is equal, and the user tag is equal.</p>
125     *
126     * @param other Another instance of CaptureRequest.
127     *
128     * @return True if the requests are the same, false otherwise.
129     */
130    @Override
131    public boolean equals(Object other) {
132        return other instanceof CaptureRequest
133                && equals((CaptureRequest)other);
134    }
135
136    private boolean equals(CaptureRequest other) {
137        return other != null
138                && Objects.equals(mUserTag, other.mUserTag)
139                && mSurfaceSet.equals(other.mSurfaceSet)
140                && mSettings.equals(other.mSettings);
141    }
142
143    @Override
144    public int hashCode() {
145        return mSettings.hashCode();
146    }
147
148    public static final Parcelable.Creator<CaptureRequest> CREATOR =
149            new Parcelable.Creator<CaptureRequest>() {
150        @Override
151        public CaptureRequest createFromParcel(Parcel in) {
152            CaptureRequest request = new CaptureRequest();
153            request.readFromParcel(in);
154
155            return request;
156        }
157
158        @Override
159        public CaptureRequest[] newArray(int size) {
160            return new CaptureRequest[size];
161        }
162    };
163
164    /**
165     * Expand this object from a Parcel.
166     * Hidden since this breaks the immutability of CaptureRequest, but is
167     * needed to receive CaptureRequests with aidl.
168     *
169     * @param in The parcel from which the object should be read
170     * @hide
171     */
172    public void readFromParcel(Parcel in) {
173        mSettings.readFromParcel(in);
174
175        mSurfaceSet.clear();
176
177        Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader());
178
179        if (parcelableArray == null) {
180            return;
181        }
182
183        for (Parcelable p : parcelableArray) {
184            Surface s = (Surface) p;
185            mSurfaceSet.add(s);
186        }
187    }
188
189    @Override
190    public int describeContents() {
191        return 0;
192    }
193
194    @Override
195    public void writeToParcel(Parcel dest, int flags) {
196        mSettings.writeToParcel(dest, flags);
197        dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags);
198    }
199
200    /**
201     * A builder for capture requests.
202     *
203     * <p>To obtain a builder instance, use the
204     * {@link CameraDevice#createCaptureRequest} method, which initializes the
205     * request fields to one of the templates defined in {@link CameraDevice}.
206     *
207     * @see CameraDevice#createCaptureRequest
208     * @see #TEMPLATE_PREVIEW
209     * @see #TEMPLATE_RECORD
210     * @see #TEMPLATE_STILL_CAPTURE
211     * @see #TEMPLATE_VIDEO_SNAPSHOT
212     * @see #TEMPLATE_MANUAL
213     */
214    public final static class Builder {
215
216        private final CaptureRequest mRequest;
217
218        /**
219         * Initialize the builder using the template; the request takes
220         * ownership of the template.
221         *
222         * @hide
223         */
224        public Builder(CameraMetadataNative template) {
225            mRequest = new CaptureRequest(template);
226        }
227
228        /**
229         * <p>Add a surface to the list of targets for this request</p>
230         *
231         * <p>The Surface added must be one of the surfaces included in the most
232         * recent call to {@link CameraDevice#configureOutputs}, when the
233         * request is given to the camera device.</p>
234         *
235         * <p>Adding a target more than once has no effect.</p>
236         *
237         * @param outputTarget Surface to use as an output target for this request
238         */
239        public void addTarget(Surface outputTarget) {
240            mRequest.mSurfaceSet.add(outputTarget);
241        }
242
243        /**
244         * <p>Remove a surface from the list of targets for this request.</p>
245         *
246         * <p>Removing a target that is not currently added has no effect.</p>
247         *
248         * @param outputTarget Surface to use as an output target for this request
249         */
250        public void removeTarget(Surface outputTarget) {
251            mRequest.mSurfaceSet.remove(outputTarget);
252        }
253
254        /**
255         * Set a capture request field to a value. The field definitions can be
256         * found in {@link CaptureRequest}.
257         *
258         * @param key The metadata field to write.
259         * @param value The value to set the field to, which must be of a matching
260         * type to the key.
261         */
262        public <T> void set(Key<T> key, T value) {
263            mRequest.mSettings.set(key, value);
264        }
265
266        /**
267         * Get a capture request field value. The field definitions can be
268         * found in {@link CaptureRequest}.
269         *
270         * @throws IllegalArgumentException if the key was not valid
271         *
272         * @param key The metadata field to read.
273         * @return The value of that key, or {@code null} if the field is not set.
274         */
275        public <T> T get(Key<T> key) {
276            return mRequest.mSettings.get(key);
277        }
278
279        /**
280         * Set a tag for this request.
281         *
282         * <p>This tag is not used for anything by the camera device, but can be
283         * used by an application to easily identify a CaptureRequest when it is
284         * returned by
285         * {@link CameraDevice.CaptureListener#onCaptureCompleted CaptureListener.onCaptureCompleted}
286         *
287         * @param tag an arbitrary Object to store with this request
288         * @see CaptureRequest#getTag
289         */
290        public void setTag(Object tag) {
291            mRequest.mUserTag = tag;
292        }
293
294        /**
295         * Build a request using the current target Surfaces and settings.
296         *
297         * @return A new capture request instance, ready for submission to the
298         * camera device.
299         */
300        public CaptureRequest build() {
301            return new CaptureRequest(mRequest);
302        }
303
304
305        /**
306         * @hide
307         */
308        public boolean isEmpty() {
309            return mRequest.mSettings.isEmpty();
310        }
311
312    }
313
314    /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
315     * The key entries below this point are generated from metadata
316     * definitions in /system/media/camera/docs. Do not modify by hand or
317     * modify the comment blocks at the start or end.
318     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
319
320
321    /**
322     * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is not OFF, TRANSFORM_MATRIX
323     * should be ignored.</p>
324     *
325     * @see CaptureRequest#CONTROL_AWB_MODE
326     * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
327     * @see #COLOR_CORRECTION_MODE_FAST
328     * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
329     */
330    public static final Key<Integer> COLOR_CORRECTION_MODE =
331            new Key<Integer>("android.colorCorrection.mode", int.class);
332
333    /**
334     * <p>A color transform matrix to use to transform
335     * from sensor RGB color space to output linear sRGB color space</p>
336     * <p>This matrix is either set by HAL when the request
337     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
338     * directly by the application in the request when the
339     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
340     * <p>In the latter case, the HAL may round the matrix to account
341     * for precision issues; the final rounded matrix should be
342     * reported back in this matrix result metadata.</p>
343     *
344     * @see CaptureRequest#COLOR_CORRECTION_MODE
345     */
346    public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM =
347            new Key<Rational[]>("android.colorCorrection.transform", Rational[].class);
348
349    /**
350     * <p>Gains applying to Bayer color channels for
351     * white-balance</p>
352     * <p>The 4-channel white-balance gains are defined in
353     * the order of [R G_even G_odd B], where G_even is the gain
354     * for green pixels on even rows of the output, and G_odd
355     * is the gain for greenpixels on the odd rows. if a HAL
356     * does not support a separate gain for even/odd green channels,
357     * it should use the G_even value,and write G_odd equal to
358     * G_even in the output result metadata.</p>
359     * <p>This array is either set by HAL when the request
360     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
361     * directly by the application in the request when the
362     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
363     * <p>The ouput should be the gains actually applied by the HAL to
364     * the current frame.</p>
365     *
366     * @see CaptureRequest#COLOR_CORRECTION_MODE
367     */
368    public static final Key<float[]> COLOR_CORRECTION_GAINS =
369            new Key<float[]>("android.colorCorrection.gains", float[].class);
370
371    /**
372     * <p>The desired setting for the camera device's auto-exposure
373     * algorithm's antibanding compensation.</p>
374     * <p>Some kinds of lighting fixtures, such as some fluorescent
375     * lights, flicker at the rate of the power supply frequency
376     * (60Hz or 50Hz, depending on country). While this is
377     * typically not noticeable to a person, it can be visible to
378     * a camera device. If a camera sets its exposure time to the
379     * wrong value, the flicker may become visible in the
380     * viewfinder as flicker or in a final captured image, as a
381     * set of variable-brightness bands across the image.</p>
382     * <p>Therefore, the auto-exposure routines of camera devices
383     * include antibanding routines that ensure that the chosen
384     * exposure value will not cause such banding. The choice of
385     * exposure time depends on the rate of flicker, which the
386     * camera device can detect automatically, or the expected
387     * rate can be selected by the application using this
388     * control.</p>
389     * <p>A given camera device may not support all of the possible
390     * options for the antibanding mode. The
391     * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
392     * the available modes for a given camera device.</p>
393     * <p>The default mode is AUTO, which must be supported by all
394     * camera devices.</p>
395     * <p>If manual exposure control is enabled (by setting
396     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
397     * then this setting has no effect, and the application must
398     * ensure it selects exposure times that do not cause banding
399     * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
400     * the application in this.</p>
401     *
402     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
403     * @see CaptureRequest#CONTROL_AE_MODE
404     * @see CaptureRequest#CONTROL_MODE
405     * @see CaptureResult#STATISTICS_SCENE_FLICKER
406     * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
407     * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
408     * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
409     * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
410     */
411    public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
412            new Key<Integer>("android.control.aeAntibandingMode", int.class);
413
414    /**
415     * <p>Adjustment to AE target image
416     * brightness</p>
417     * <p>For example, if EV step is 0.333, '6' will mean an
418     * exposure compensation of +2 EV; -3 will mean an exposure
419     * compensation of -1</p>
420     */
421    public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
422            new Key<Integer>("android.control.aeExposureCompensation", int.class);
423
424    /**
425     * <p>Whether AE is currently locked to its latest
426     * calculated values</p>
427     * <p>Note that even when AE is locked, the flash may be
428     * fired if the AE mode is ON_AUTO_FLASH / ON_ALWAYS_FLASH /
429     * ON_AUTO_FLASH_REDEYE.</p>
430     */
431    public static final Key<Boolean> CONTROL_AE_LOCK =
432            new Key<Boolean>("android.control.aeLock", boolean.class);
433
434    /**
435     * <p>The desired mode for the camera device's
436     * auto-exposure routine.</p>
437     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
438     * AUTO.</p>
439     * <p>When set to any of the ON modes, the camera device's
440     * auto-exposure routine is enabled, overriding the
441     * application's selected exposure time, sensor sensitivity,
442     * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
443     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
444     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
445     * is selected, the camera device's flash unit controls are
446     * also overridden.</p>
447     * <p>The FLASH modes are only available if the camera device
448     * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
449     * <p>If flash TORCH mode is desired, this field must be set to
450     * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
451     * <p>When set to any of the ON modes, the values chosen by the
452     * camera device auto-exposure routine for the overridden
453     * fields for a given capture will be available in its
454     * CaptureResult.</p>
455     *
456     * @see CaptureRequest#CONTROL_MODE
457     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
458     * @see CaptureRequest#FLASH_MODE
459     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
460     * @see CaptureRequest#SENSOR_FRAME_DURATION
461     * @see CaptureRequest#SENSOR_SENSITIVITY
462     * @see #CONTROL_AE_MODE_OFF
463     * @see #CONTROL_AE_MODE_ON
464     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
465     * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
466     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
467     */
468    public static final Key<Integer> CONTROL_AE_MODE =
469            new Key<Integer>("android.control.aeMode", int.class);
470
471    /**
472     * <p>List of areas to use for
473     * metering</p>
474     * <p>Each area is a rectangle plus weight: xmin, ymin,
475     * xmax, ymax, weight. The rectangle is defined inclusive of the
476     * specified coordinates.</p>
477     * <p>The coordinate system is based on the active pixel array,
478     * with (0,0) being the top-left pixel in the active pixel array, and
479     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
480     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
481     * bottom-right pixel in the active pixel array. The weight
482     * should be nonnegative.</p>
483     * <p>If all regions have 0 weight, then no specific metering area
484     * needs to be used by the HAL. If the metering region is
485     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL
486     * should ignore the sections outside the region and output the
487     * used sections in the frame metadata</p>
488     *
489     * @see CaptureRequest#SCALER_CROP_REGION
490     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
491     */
492    public static final Key<int[]> CONTROL_AE_REGIONS =
493            new Key<int[]>("android.control.aeRegions", int[].class);
494
495    /**
496     * <p>Range over which fps can be adjusted to
497     * maintain exposure</p>
498     * <p>Only constrains AE algorithm, not manual control
499     * of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p>
500     *
501     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
502     */
503    public static final Key<int[]> CONTROL_AE_TARGET_FPS_RANGE =
504            new Key<int[]>("android.control.aeTargetFpsRange", int[].class);
505
506    /**
507     * <p>Whether the camera device will trigger a precapture
508     * metering sequence when it processes this request.</p>
509     * <p>This entry is normally set to IDLE, or is not
510     * included at all in the request settings. When included and
511     * set to START, the camera device will trigger the autoexposure
512     * precapture metering sequence.</p>
513     * <p>The effect of AE precapture trigger depends on the current
514     * AE mode and state; see {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture
515     * state transition details.</p>
516     *
517     * @see CaptureResult#CONTROL_AE_STATE
518     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
519     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
520     */
521    public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
522            new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
523
524    /**
525     * <p>Whether AF is currently enabled, and what
526     * mode it is set to</p>
527     * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO.</p>
528     * <p>If the lens is controlled by the camera device auto-focus algorithm,
529     * the camera device will report the current AF status in android.control.afState
530     * in result metadata.</p>
531     *
532     * @see CaptureRequest#CONTROL_MODE
533     * @see #CONTROL_AF_MODE_OFF
534     * @see #CONTROL_AF_MODE_AUTO
535     * @see #CONTROL_AF_MODE_MACRO
536     * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
537     * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
538     * @see #CONTROL_AF_MODE_EDOF
539     */
540    public static final Key<Integer> CONTROL_AF_MODE =
541            new Key<Integer>("android.control.afMode", int.class);
542
543    /**
544     * <p>List of areas to use for focus
545     * estimation</p>
546     * <p>Each area is a rectangle plus weight: xmin, ymin,
547     * xmax, ymax, weight. The rectangle is defined inclusive of the
548     * specified coordinates.</p>
549     * <p>The coordinate system is based on the active pixel array,
550     * with (0,0) being the top-left pixel in the active pixel array, and
551     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
552     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
553     * bottom-right pixel in the active pixel array. The weight
554     * should be nonnegative.</p>
555     * <p>If all regions have 0 weight, then no specific focus area
556     * needs to be used by the HAL. If the focusing region is
557     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL
558     * should ignore the sections outside the region and output the
559     * used sections in the frame metadata</p>
560     *
561     * @see CaptureRequest#SCALER_CROP_REGION
562     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
563     */
564    public static final Key<int[]> CONTROL_AF_REGIONS =
565            new Key<int[]>("android.control.afRegions", int[].class);
566
567    /**
568     * <p>Whether the camera device will trigger autofocus for this request.</p>
569     * <p>This entry is normally set to IDLE, or is not
570     * included at all in the request settings.</p>
571     * <p>When included and set to START, the camera device will trigger the
572     * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
573     * <p>When set to CANCEL, the camera device will cancel any active trigger,
574     * and return to its initial AF state.</p>
575     * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what that means for each AF mode.</p>
576     *
577     * @see CaptureResult#CONTROL_AF_STATE
578     * @see #CONTROL_AF_TRIGGER_IDLE
579     * @see #CONTROL_AF_TRIGGER_START
580     * @see #CONTROL_AF_TRIGGER_CANCEL
581     */
582    public static final Key<Integer> CONTROL_AF_TRIGGER =
583            new Key<Integer>("android.control.afTrigger", int.class);
584
585    /**
586     * <p>Whether AWB is currently locked to its
587     * latest calculated values</p>
588     * <p>Note that AWB lock is only meaningful for AUTO
589     * mode; in other modes, AWB is already fixed to a specific
590     * setting</p>
591     */
592    public static final Key<Boolean> CONTROL_AWB_LOCK =
593            new Key<Boolean>("android.control.awbLock", boolean.class);
594
595    /**
596     * <p>Whether AWB is currently setting the color
597     * transform fields, and what its illumination target
598     * is</p>
599     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
600     * <p>When set to the ON mode, the camera device's auto white balance
601     * routine is enabled, overriding the application's selected
602     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
603     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
604     * <p>When set to the OFF mode, the camera device's auto white balance
605     * routine is disabled. The applicantion manually controls the white
606     * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, android.colorCorrection.gains
607     * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
608     * <p>When set to any other modes, the camera device's auto white balance
609     * routine is disabled. The camera device uses each particular illumination
610     * target for white balance adjustment.</p>
611     *
612     * @see CaptureRequest#COLOR_CORRECTION_GAINS
613     * @see CaptureRequest#COLOR_CORRECTION_MODE
614     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
615     * @see CaptureRequest#CONTROL_MODE
616     * @see #CONTROL_AWB_MODE_OFF
617     * @see #CONTROL_AWB_MODE_AUTO
618     * @see #CONTROL_AWB_MODE_INCANDESCENT
619     * @see #CONTROL_AWB_MODE_FLUORESCENT
620     * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
621     * @see #CONTROL_AWB_MODE_DAYLIGHT
622     * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
623     * @see #CONTROL_AWB_MODE_TWILIGHT
624     * @see #CONTROL_AWB_MODE_SHADE
625     */
626    public static final Key<Integer> CONTROL_AWB_MODE =
627            new Key<Integer>("android.control.awbMode", int.class);
628
629    /**
630     * <p>List of areas to use for illuminant
631     * estimation</p>
632     * <p>Only used in AUTO mode.</p>
633     * <p>Each area is a rectangle plus weight: xmin, ymin,
634     * xmax, ymax, weight. The rectangle is defined inclusive of the
635     * specified coordinates.</p>
636     * <p>The coordinate system is based on the active pixel array,
637     * with (0,0) being the top-left pixel in the active pixel array, and
638     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
639     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
640     * bottom-right pixel in the active pixel array. The weight
641     * should be nonnegative.</p>
642     * <p>If all regions have 0 weight, then no specific metering area
643     * needs to be used by the HAL. If the metering region is
644     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL
645     * should ignore the sections outside the region and output the
646     * used sections in the frame metadata</p>
647     *
648     * @see CaptureRequest#SCALER_CROP_REGION
649     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
650     */
651    public static final Key<int[]> CONTROL_AWB_REGIONS =
652            new Key<int[]>("android.control.awbRegions", int[].class);
653
654    /**
655     * <p>Information to the camera device 3A (auto-exposure,
656     * auto-focus, auto-white balance) routines about the purpose
657     * of this capture, to help the camera device to decide optimal 3A
658     * strategy.</p>
659     * <p>This control is only effective if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code>
660     * and any 3A routine is active.</p>
661     *
662     * @see CaptureRequest#CONTROL_MODE
663     * @see #CONTROL_CAPTURE_INTENT_CUSTOM
664     * @see #CONTROL_CAPTURE_INTENT_PREVIEW
665     * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
666     * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
667     * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
668     * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
669     */
670    public static final Key<Integer> CONTROL_CAPTURE_INTENT =
671            new Key<Integer>("android.control.captureIntent", int.class);
672
673    /**
674     * <p>Whether any special color effect is in use.
675     * Only used if {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</p>
676     *
677     * @see CaptureRequest#CONTROL_MODE
678     * @see #CONTROL_EFFECT_MODE_OFF
679     * @see #CONTROL_EFFECT_MODE_MONO
680     * @see #CONTROL_EFFECT_MODE_NEGATIVE
681     * @see #CONTROL_EFFECT_MODE_SOLARIZE
682     * @see #CONTROL_EFFECT_MODE_SEPIA
683     * @see #CONTROL_EFFECT_MODE_POSTERIZE
684     * @see #CONTROL_EFFECT_MODE_WHITEBOARD
685     * @see #CONTROL_EFFECT_MODE_BLACKBOARD
686     * @see #CONTROL_EFFECT_MODE_AQUA
687     */
688    public static final Key<Integer> CONTROL_EFFECT_MODE =
689            new Key<Integer>("android.control.effectMode", int.class);
690
691    /**
692     * <p>Overall mode of 3A control
693     * routines</p>
694     * <p>High-level 3A control. When set to OFF, all 3A control
695     * by the camera device is disabled. The application must set the fields for
696     * capture parameters itself.</p>
697     * <p>When set to AUTO, the individual algorithm controls in
698     * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
699     * <p>When set to USE_SCENE_MODE, the individual controls in
700     * android.control.* are mostly disabled, and the camera device implements
701     * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
702     * as it wishes. The camera device scene mode 3A settings are provided by
703     * android.control.sceneModeOverrides.</p>
704     *
705     * @see CaptureRequest#CONTROL_AF_MODE
706     * @see #CONTROL_MODE_OFF
707     * @see #CONTROL_MODE_AUTO
708     * @see #CONTROL_MODE_USE_SCENE_MODE
709     */
710    public static final Key<Integer> CONTROL_MODE =
711            new Key<Integer>("android.control.mode", int.class);
712
713    /**
714     * <p>Which scene mode is active when
715     * {@link CaptureRequest#CONTROL_MODE android.control.mode} = SCENE_MODE</p>
716     *
717     * @see CaptureRequest#CONTROL_MODE
718     * @see #CONTROL_SCENE_MODE_UNSUPPORTED
719     * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
720     * @see #CONTROL_SCENE_MODE_ACTION
721     * @see #CONTROL_SCENE_MODE_PORTRAIT
722     * @see #CONTROL_SCENE_MODE_LANDSCAPE
723     * @see #CONTROL_SCENE_MODE_NIGHT
724     * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
725     * @see #CONTROL_SCENE_MODE_THEATRE
726     * @see #CONTROL_SCENE_MODE_BEACH
727     * @see #CONTROL_SCENE_MODE_SNOW
728     * @see #CONTROL_SCENE_MODE_SUNSET
729     * @see #CONTROL_SCENE_MODE_STEADYPHOTO
730     * @see #CONTROL_SCENE_MODE_FIREWORKS
731     * @see #CONTROL_SCENE_MODE_SPORTS
732     * @see #CONTROL_SCENE_MODE_PARTY
733     * @see #CONTROL_SCENE_MODE_CANDLELIGHT
734     * @see #CONTROL_SCENE_MODE_BARCODE
735     */
736    public static final Key<Integer> CONTROL_SCENE_MODE =
737            new Key<Integer>("android.control.sceneMode", int.class);
738
739    /**
740     * <p>Whether video stabilization is
741     * active</p>
742     * <p>If enabled, video stabilization can modify the
743     * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream
744     * stabilized</p>
745     *
746     * @see CaptureRequest#SCALER_CROP_REGION
747     */
748    public static final Key<Boolean> CONTROL_VIDEO_STABILIZATION_MODE =
749            new Key<Boolean>("android.control.videoStabilizationMode", boolean.class);
750
751    /**
752     * <p>Operation mode for edge
753     * enhancement</p>
754     * <p>Edge/sharpness/detail enhancement. OFF means no
755     * enhancement will be applied by the HAL.</p>
756     * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
757     * will be applied. HIGH_QUALITY mode indicates that the
758     * camera device will use the highest-quality enhancement algorithms,
759     * even if it slows down capture rate. FAST means the camera device will
760     * not slow down capture rate when applying edge enhancement.</p>
761     * @see #EDGE_MODE_OFF
762     * @see #EDGE_MODE_FAST
763     * @see #EDGE_MODE_HIGH_QUALITY
764     */
765    public static final Key<Integer> EDGE_MODE =
766            new Key<Integer>("android.edge.mode", int.class);
767
768    /**
769     * <p>The desired mode for for the camera device's flash control.</p>
770     * <p>This control is only effective when flash unit is available
771     * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} != 0</code>).</p>
772     * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
773     * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
774     * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
775     * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
776     * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
777     * device's auto-exposure routine's result. When used in still capture case, this
778     * control should be used along with AE precapture metering sequence
779     * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
780     * <p>When set to TORCH, the flash will be on continuously. This mode can be used
781     * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
782     *
783     * @see CaptureRequest#CONTROL_AE_MODE
784     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
785     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
786     * @see #FLASH_MODE_OFF
787     * @see #FLASH_MODE_SINGLE
788     * @see #FLASH_MODE_TORCH
789     */
790    public static final Key<Integer> FLASH_MODE =
791            new Key<Integer>("android.flash.mode", int.class);
792
793    /**
794     * <p>GPS coordinates to include in output JPEG
795     * EXIF</p>
796     */
797    public static final Key<double[]> JPEG_GPS_COORDINATES =
798            new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
799
800    /**
801     * <p>32 characters describing GPS algorithm to
802     * include in EXIF</p>
803     */
804    public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
805            new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
806
807    /**
808     * <p>Time GPS fix was made to include in
809     * EXIF</p>
810     */
811    public static final Key<Long> JPEG_GPS_TIMESTAMP =
812            new Key<Long>("android.jpeg.gpsTimestamp", long.class);
813
814    /**
815     * <p>Orientation of JPEG image to
816     * write</p>
817     */
818    public static final Key<Integer> JPEG_ORIENTATION =
819            new Key<Integer>("android.jpeg.orientation", int.class);
820
821    /**
822     * <p>Compression quality of the final JPEG
823     * image</p>
824     * <p>85-95 is typical usage range</p>
825     */
826    public static final Key<Byte> JPEG_QUALITY =
827            new Key<Byte>("android.jpeg.quality", byte.class);
828
829    /**
830     * <p>Compression quality of JPEG
831     * thumbnail</p>
832     */
833    public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
834            new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
835
836    /**
837     * <p>Resolution of embedded JPEG thumbnail</p>
838     * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
839     * but the captured JPEG will still be a valid image.</p>
840     * <p>When a jpeg image capture is issued, the thumbnail size selected should have
841     * the same aspect ratio as the jpeg image.</p>
842     */
843    public static final Key<android.hardware.camera2.Size> JPEG_THUMBNAIL_SIZE =
844            new Key<android.hardware.camera2.Size>("android.jpeg.thumbnailSize", android.hardware.camera2.Size.class);
845
846    /**
847     * <p>The ratio of lens focal length to the effective
848     * aperture diameter.</p>
849     * <p>This will only be supported on the camera devices that
850     * have variable aperture lens. The aperture value can only be
851     * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
852     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
853     * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
854     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and android.sensor.frameDuration
855     * to achieve manual exposure control.</p>
856     * <p>The requested aperture value may take several frames to reach the
857     * requested value; the camera device will report the current (intermediate)
858     * aperture size in capture result metadata while the aperture is changing.</p>
859     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
860     * the ON modes, this will be overridden by the camera device
861     * auto-exposure algorithm, the overridden values are then provided
862     * back to the user in the corresponding result.</p>
863     *
864     * @see CaptureRequest#CONTROL_AE_MODE
865     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
866     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
867     * @see CaptureRequest#SENSOR_SENSITIVITY
868     */
869    public static final Key<Float> LENS_APERTURE =
870            new Key<Float>("android.lens.aperture", float.class);
871
872    /**
873     * <p>State of lens neutral density filter(s).</p>
874     * <p>This will not be supported on most camera devices. On devices
875     * where this is supported, this may only be set to one of the
876     * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p>
877     * <p>Lens filters are typically used to lower the amount of light the
878     * sensor is exposed to (measured in steps of EV). As used here, an EV
879     * step is the standard logarithmic representation, which are
880     * non-negative, and inversely proportional to the amount of light
881     * hitting the sensor.  For example, setting this to 0 would result
882     * in no reduction of the incoming light, and setting this to 2 would
883     * mean that the filter is set to reduce incoming light by two stops
884     * (allowing 1/4 of the prior amount of light to the sensor).</p>
885     *
886     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
887     */
888    public static final Key<Float> LENS_FILTER_DENSITY =
889            new Key<Float>("android.lens.filterDensity", float.class);
890
891    /**
892     * <p>Lens optical zoom setting</p>
893     * <p>Will not be supported on most devices.</p>
894     */
895    public static final Key<Float> LENS_FOCAL_LENGTH =
896            new Key<Float>("android.lens.focalLength", float.class);
897
898    /**
899     * <p>Distance to plane of sharpest focus,
900     * measured from frontmost surface of the lens</p>
901     * <p>0 = infinity focus. Used value should be clamped
902     * to (0,minimum focus distance)</p>
903     */
904    public static final Key<Float> LENS_FOCUS_DISTANCE =
905            new Key<Float>("android.lens.focusDistance", float.class);
906
907    /**
908     * <p>Whether optical image stabilization is
909     * enabled.</p>
910     * <p>Will not be supported on most devices.</p>
911     * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
912     * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
913     */
914    public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
915            new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
916
917    /**
918     * <p>Mode of operation for the noise reduction
919     * algorithm</p>
920     * <p>Noise filtering control. OFF means no noise reduction
921     * will be applied by the HAL.</p>
922     * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
923     * will be applied. HIGH_QUALITY mode indicates that the camera device
924     * will use the highest-quality noise filtering algorithms,
925     * even if it slows down capture rate. FAST means the camera device should not
926     * slow down capture rate when applying noise filtering.</p>
927     * @see #NOISE_REDUCTION_MODE_OFF
928     * @see #NOISE_REDUCTION_MODE_FAST
929     * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
930     */
931    public static final Key<Integer> NOISE_REDUCTION_MODE =
932            new Key<Integer>("android.noiseReduction.mode", int.class);
933
934    /**
935     * <p>An application-specified ID for the current
936     * request. Must be maintained unchanged in output
937     * frame</p>
938     * @hide
939     */
940    public static final Key<Integer> REQUEST_ID =
941            new Key<Integer>("android.request.id", int.class);
942
943    /**
944     * <p>(x, y, width, height).</p>
945     * <p>A rectangle with the top-level corner of (x,y) and size
946     * (width, height). The region of the sensor that is used for
947     * output. Each stream must use this rectangle to produce its
948     * output, cropping to a smaller region if necessary to
949     * maintain the stream's aspect ratio.</p>
950     * <p>HAL2.x uses only (x, y, width)</p>
951     * <p>Any additional per-stream cropping must be done to
952     * maximize the final pixel area of the stream.</p>
953     * <p>For example, if the crop region is set to a 4:3 aspect
954     * ratio, then 4:3 streams should use the exact crop
955     * region. 16:9 streams should further crop vertically
956     * (letterbox).</p>
957     * <p>Conversely, if the crop region is set to a 16:9, then 4:3
958     * outputs should crop horizontally (pillarbox), and 16:9
959     * streams should match exactly. These additional crops must
960     * be centered within the crop region.</p>
961     * <p>The output streams must maintain square pixels at all
962     * times, no matter what the relative aspect ratios of the
963     * crop region and the stream are.  Negative values for
964     * corner are allowed for raw output if full pixel array is
965     * larger than active pixel array. Width and height may be
966     * rounded to nearest larger supportable width, especially
967     * for raw output, where only a few fixed scales may be
968     * possible. The width and height of the crop region cannot
969     * be set to be smaller than floor( activeArraySize.width /
970     * android.scaler.maxDigitalZoom ) and floor(
971     * activeArraySize.height / android.scaler.maxDigitalZoom),
972     * respectively.</p>
973     */
974    public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
975            new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
976
977    /**
978     * <p>Duration each pixel is exposed to
979     * light.</p>
980     * <p>If the sensor can't expose this exact duration, it should shorten the
981     * duration exposed to the nearest possible value (rather than expose longer).</p>
982     * <p>1/10000 - 30 sec range. No bulb mode</p>
983     */
984    public static final Key<Long> SENSOR_EXPOSURE_TIME =
985            new Key<Long>("android.sensor.exposureTime", long.class);
986
987    /**
988     * <p>Duration from start of frame exposure to
989     * start of next frame exposure</p>
990     * <p>Exposure time has priority, so duration is set to
991     * max(duration, exposure time + overhead)</p>
992     */
993    public static final Key<Long> SENSOR_FRAME_DURATION =
994            new Key<Long>("android.sensor.frameDuration", long.class);
995
996    /**
997     * <p>Gain applied to image data. Must be
998     * implemented through analog gain only if set to values
999     * below 'maximum analog sensitivity'.</p>
1000     * <p>If the sensor can't apply this exact gain, it should lessen the
1001     * gain to the nearest possible value (rather than gain more).</p>
1002     * <p>ISO 12232:2006 REI method</p>
1003     */
1004    public static final Key<Integer> SENSOR_SENSITIVITY =
1005            new Key<Integer>("android.sensor.sensitivity", int.class);
1006
1007    /**
1008     * <p>State of the face detector
1009     * unit</p>
1010     * <p>Whether face detection is enabled, and whether it
1011     * should output just the basic fields or the full set of
1012     * fields. Value must be one of the
1013     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p>
1014     *
1015     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
1016     * @see #STATISTICS_FACE_DETECT_MODE_OFF
1017     * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
1018     * @see #STATISTICS_FACE_DETECT_MODE_FULL
1019     */
1020    public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
1021            new Key<Integer>("android.statistics.faceDetectMode", int.class);
1022
1023    /**
1024     * <p>Whether the HAL needs to output the lens
1025     * shading map in output result metadata</p>
1026     * <p>When set to ON,
1027     * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} must be provided in
1028     * the output result metadata.</p>
1029     *
1030     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
1031     * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
1032     * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
1033     */
1034    public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
1035            new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
1036
1037    /**
1038     * <p>Table mapping blue input values to output
1039     * values</p>
1040     * <p>Tonemapping / contrast / gamma curve for the blue
1041     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is CONTRAST_CURVE.</p>
1042     * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
1043     *
1044     * @see CaptureRequest#TONEMAP_CURVE_RED
1045     * @see CaptureRequest#TONEMAP_MODE
1046     */
1047    public static final Key<float[]> TONEMAP_CURVE_BLUE =
1048            new Key<float[]>("android.tonemap.curveBlue", float[].class);
1049
1050    /**
1051     * <p>Table mapping green input values to output
1052     * values</p>
1053     * <p>Tonemapping / contrast / gamma curve for the green
1054     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is CONTRAST_CURVE.</p>
1055     * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
1056     *
1057     * @see CaptureRequest#TONEMAP_CURVE_RED
1058     * @see CaptureRequest#TONEMAP_MODE
1059     */
1060    public static final Key<float[]> TONEMAP_CURVE_GREEN =
1061            new Key<float[]>("android.tonemap.curveGreen", float[].class);
1062
1063    /**
1064     * <p>Table mapping red input values to output
1065     * values</p>
1066     * <p>Tonemapping / contrast / gamma curve for the red
1067     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is CONTRAST_CURVE.</p>
1068     * <p>Since the input and output ranges may vary depending on
1069     * the camera pipeline, the input and output pixel values
1070     * are represented by normalized floating-point values
1071     * between 0 and 1, with 0 == black and 1 == white.</p>
1072     * <p>The curve should be linearly interpolated between the
1073     * defined points. The points will be listed in increasing
1074     * order of P_IN. For example, if the array is: [0.0, 0.0,
1075     * 0.3, 0.5, 1.0, 1.0], then the input-&gt;output mapping
1076     * for a few sample points would be: 0 -&gt; 0, 0.15 -&gt;
1077     * 0.25, 0.3 -&gt; 0.5, 0.5 -&gt; 0.64</p>
1078     *
1079     * @see CaptureRequest#TONEMAP_MODE
1080     */
1081    public static final Key<float[]> TONEMAP_CURVE_RED =
1082            new Key<float[]>("android.tonemap.curveRed", float[].class);
1083
1084    /**
1085     *
1086     * @see #TONEMAP_MODE_CONTRAST_CURVE
1087     * @see #TONEMAP_MODE_FAST
1088     * @see #TONEMAP_MODE_HIGH_QUALITY
1089     */
1090    public static final Key<Integer> TONEMAP_MODE =
1091            new Key<Integer>("android.tonemap.mode", int.class);
1092
1093    /**
1094     * <p>This LED is nominally used to indicate to the user
1095     * that the camera is powered on and may be streaming images back to the
1096     * Application Processor. In certain rare circumstances, the OS may
1097     * disable this when video is processed locally and not transmitted to
1098     * any untrusted applications.</p>
1099     * <p>In particular, the LED <em>must</em> always be on when the data could be
1100     * transmitted off the device. The LED <em>should</em> always be on whenever
1101     * data is stored locally on the device.</p>
1102     * <p>The LED <em>may</em> be off if a trusted application is using the data that
1103     * doesn't violate the above rules.</p>
1104     * @hide
1105     */
1106    public static final Key<Boolean> LED_TRANSMIT =
1107            new Key<Boolean>("android.led.transmit", boolean.class);
1108
1109    /**
1110     * <p>Whether black-level compensation is locked
1111     * to its current values, or is free to vary.</p>
1112     * <p>When set to ON, the values used for black-level
1113     * compensation will not change until the lock is set to
1114     * OFF.</p>
1115     * <p>Since changes to certain capture parameters (such as
1116     * exposure time) may require resetting of black level
1117     * compensation, the camera device must report whether setting
1118     * the black level lock was successful in the output result
1119     * metadata.</p>
1120     * <p>For example, if a sequence of requests is as follows:</p>
1121     * <ul>
1122     * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li>
1123     * <li>Request 2: Exposure = 10ms, Black level lock = ON</li>
1124     * <li>Request 3: Exposure = 10ms, Black level lock = ON</li>
1125     * <li>Request 4: Exposure = 20ms, Black level lock = ON</li>
1126     * <li>Request 5: Exposure = 20ms, Black level lock = ON</li>
1127     * <li>Request 6: Exposure = 20ms, Black level lock = ON</li>
1128     * </ul>
1129     * <p>And the exposure change in Request 4 requires the camera
1130     * device to reset the black level offsets, then the output
1131     * result metadata is expected to be:</p>
1132     * <ul>
1133     * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li>
1134     * <li>Result 2: Exposure = 10ms, Black level lock = ON</li>
1135     * <li>Result 3: Exposure = 10ms, Black level lock = ON</li>
1136     * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li>
1137     * <li>Result 5: Exposure = 20ms, Black level lock = ON</li>
1138     * <li>Result 6: Exposure = 20ms, Black level lock = ON</li>
1139     * </ul>
1140     * <p>This indicates to the application that on frame 4, black
1141     * levels were reset due to exposure value changes, and pixel
1142     * values may not be consistent across captures.</p>
1143     * <p>The camera device will maintain the lock to the extent
1144     * possible, only overriding the lock to OFF when changes to
1145     * other request parameters require a black level recalculation
1146     * or reset.</p>
1147     */
1148    public static final Key<Boolean> BLACK_LEVEL_LOCK =
1149            new Key<Boolean>("android.blackLevel.lock", boolean.class);
1150
1151    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
1152     * End generated code
1153     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
1154}
1155