OSDN Git Service

Docs only change: update build version docs.
[android-x86/frameworks-base.git] / core / java / android / hardware / camera2 / CaptureRequest.java
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
17 package android.hardware.camera2;
18
19 import android.annotation.NonNull;
20 import android.annotation.Nullable;
21 import android.hardware.camera2.impl.CameraMetadataNative;
22 import android.hardware.camera2.impl.PublicKey;
23 import android.hardware.camera2.impl.SyntheticKey;
24 import android.hardware.camera2.utils.HashCodeHelpers;
25 import android.hardware.camera2.utils.TypeReference;
26 import android.os.Parcel;
27 import android.os.Parcelable;
28 import android.view.Surface;
29
30 import java.util.Collection;
31 import java.util.Collections;
32 import java.util.HashSet;
33 import java.util.List;
34 import java.util.Objects;
35
36
37 /**
38  * <p>An immutable package of settings and outputs needed to capture a single
39  * image from the camera device.</p>
40  *
41  * <p>Contains the configuration for the capture hardware (sensor, lens, flash),
42  * the processing pipeline, the control algorithms, and the output buffers. Also
43  * contains the list of target Surfaces to send image data to for this
44  * capture.</p>
45  *
46  * <p>CaptureRequests can be created by using a {@link Builder} instance,
47  * obtained by calling {@link CameraDevice#createCaptureRequest}</p>
48  *
49  * <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or
50  * {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p>
51  *
52  * <p>Each request can specify a different subset of target Surfaces for the
53  * camera to send the captured data to. All the surfaces used in a request must
54  * be part of the surface list given to the last call to
55  * {@link CameraDevice#createCaptureSession}, when the request is submitted to the
56  * session.</p>
57  *
58  * <p>For example, a request meant for repeating preview might only include the
59  * Surface for the preview SurfaceView or SurfaceTexture, while a
60  * high-resolution still capture would also include a Surface from a ImageReader
61  * configured for high-resolution JPEG images.</p>
62  *
63  * <p>A reprocess capture request allows a previously-captured image from the camera device to be
64  * sent back to the device for further processing. It can be created with
65  * {@link CameraDevice#createReprocessCaptureRequest}, and used with a reprocessable capture session
66  * created with {@link CameraDevice#createReprocessableCaptureSession}.</p>
67  *
68  * @see CameraCaptureSession#capture
69  * @see CameraCaptureSession#setRepeatingRequest
70  * @see CameraCaptureSession#captureBurst
71  * @see CameraCaptureSession#setRepeatingBurst
72  * @see CameraDevice#createCaptureRequest
73  * @see CameraDevice#createReprocessCaptureRequest
74  */
75 public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
76         implements Parcelable {
77
78     /**
79      * A {@code Key} is used to do capture request field lookups with
80      * {@link CaptureResult#get} or to set fields with
81      * {@link CaptureRequest.Builder#set(Key, Object)}.
82      *
83      * <p>For example, to set the crop rectangle for the next capture:
84      * <code><pre>
85      * Rect cropRectangle = new Rect(0, 0, 640, 480);
86      * captureRequestBuilder.set(SCALER_CROP_REGION, cropRectangle);
87      * </pre></code>
88      * </p>
89      *
90      * <p>To enumerate over all possible keys for {@link CaptureResult}, see
91      * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
92      *
93      * @see CaptureResult#get
94      * @see CameraCharacteristics#getAvailableCaptureResultKeys
95      */
96     public final static class Key<T> {
97         private final CameraMetadataNative.Key<T> mKey;
98
99         /**
100          * Visible for testing and vendor extensions only.
101          *
102          * @hide
103          */
104         public Key(String name, Class<T> type) {
105             mKey = new CameraMetadataNative.Key<T>(name, type);
106         }
107
108         /**
109          * Visible for testing and vendor extensions only.
110          *
111          * @hide
112          */
113         public Key(String name, TypeReference<T> typeReference) {
114             mKey = new CameraMetadataNative.Key<T>(name, typeReference);
115         }
116
117         /**
118          * Return a camelCase, period separated name formatted like:
119          * {@code "root.section[.subsections].name"}.
120          *
121          * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
122          * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
123          *
124          * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
125          * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
126          * specific key might look like {@code "com.google.nexus.data.private"}.</p>
127          *
128          * @return String representation of the key name
129          */
130         @NonNull
131         public String getName() {
132             return mKey.getName();
133         }
134
135         /**
136          * {@inheritDoc}
137          */
138         @Override
139         public final int hashCode() {
140             return mKey.hashCode();
141         }
142
143         /**
144          * {@inheritDoc}
145          */
146         @SuppressWarnings("unchecked")
147         @Override
148         public final boolean equals(Object o) {
149             return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
150         }
151
152         /**
153          * Return this {@link Key} as a string representation.
154          *
155          * <p>{@code "CaptureRequest.Key(%s)"}, where {@code %s} represents
156          * the name of this key as returned by {@link #getName}.</p>
157          *
158          * @return string representation of {@link Key}
159          */
160         @NonNull
161         @Override
162         public String toString() {
163             return String.format("CaptureRequest.Key(%s)", mKey.getName());
164         }
165
166         /**
167          * Visible for CameraMetadataNative implementation only; do not use.
168          *
169          * TODO: Make this private or remove it altogether.
170          *
171          * @hide
172          */
173         public CameraMetadataNative.Key<T> getNativeKey() {
174             return mKey;
175         }
176
177         @SuppressWarnings({ "unchecked" })
178         /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
179             mKey = (CameraMetadataNative.Key<T>) nativeKey;
180         }
181     }
182
183     private final HashSet<Surface> mSurfaceSet;
184     private final CameraMetadataNative mSettings;
185     private boolean mIsReprocess;
186     // If this request is part of constrained high speed request list that was created by
187     // {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}
188     private boolean mIsPartOfCHSRequestList = false;
189     // Each reprocess request must be tied to a reprocessable session ID.
190     // Valid only for reprocess requests (mIsReprocess == true).
191     private int mReprocessableSessionId;
192
193     private Object mUserTag;
194
195     /**
196      * Construct empty request.
197      *
198      * Used by Binder to unparcel this object only.
199      */
200     private CaptureRequest() {
201         mSettings = new CameraMetadataNative();
202         mSurfaceSet = new HashSet<Surface>();
203         mIsReprocess = false;
204         mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
205     }
206
207     /**
208      * Clone from source capture request.
209      *
210      * Used by the Builder to create an immutable copy.
211      */
212     @SuppressWarnings("unchecked")
213     private CaptureRequest(CaptureRequest source) {
214         mSettings = new CameraMetadataNative(source.mSettings);
215         mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone();
216         mIsReprocess = source.mIsReprocess;
217         mIsPartOfCHSRequestList = source.mIsPartOfCHSRequestList;
218         mReprocessableSessionId = source.mReprocessableSessionId;
219         mUserTag = source.mUserTag;
220     }
221
222     /**
223      * Take ownership of passed-in settings.
224      *
225      * Used by the Builder to create a mutable CaptureRequest.
226      *
227      * @param settings Settings for this capture request.
228      * @param isReprocess Indicates whether to create a reprocess capture request. {@code true}
229      *                    to create a reprocess capture request. {@code false} to create a regular
230      *                    capture request.
231      * @param reprocessableSessionId The ID of the camera capture session this capture is created
232      *                               for. This is used to validate if the application submits a
233      *                               reprocess capture request to the same session where
234      *                               the {@link TotalCaptureResult}, used to create the reprocess
235      *                               capture, came from.
236      *
237      * @throws IllegalArgumentException If creating a reprocess capture request with an invalid
238      *                                  reprocessableSessionId.
239      *
240      * @see CameraDevice#createReprocessCaptureRequest
241      */
242     private CaptureRequest(CameraMetadataNative settings, boolean isReprocess,
243             int reprocessableSessionId) {
244         mSettings = CameraMetadataNative.move(settings);
245         mSurfaceSet = new HashSet<Surface>();
246         mIsReprocess = isReprocess;
247         if (isReprocess) {
248             if (reprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) {
249                 throw new IllegalArgumentException("Create a reprocess capture request with an " +
250                         "invalid session ID: " + reprocessableSessionId);
251             }
252             mReprocessableSessionId = reprocessableSessionId;
253         } else {
254             mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
255         }
256     }
257
258     /**
259      * Get a capture request field value.
260      *
261      * <p>The field definitions can be found in {@link CaptureRequest}.</p>
262      *
263      * <p>Querying the value for the same key more than once will return a value
264      * which is equal to the previous queried value.</p>
265      *
266      * @throws IllegalArgumentException if the key was not valid
267      *
268      * @param key The result field to read.
269      * @return The value of that key, or {@code null} if the field is not set.
270      */
271     @Nullable
272     public <T> T get(Key<T> key) {
273         return mSettings.get(key);
274     }
275
276     /**
277      * {@inheritDoc}
278      * @hide
279      */
280     @SuppressWarnings("unchecked")
281     @Override
282     protected <T> T getProtected(Key<?> key) {
283         return (T) mSettings.get(key);
284     }
285
286     /**
287      * {@inheritDoc}
288      * @hide
289      */
290     @SuppressWarnings("unchecked")
291     @Override
292     protected Class<Key<?>> getKeyClass() {
293         Object thisClass = Key.class;
294         return (Class<Key<?>>)thisClass;
295     }
296
297     /**
298      * {@inheritDoc}
299      */
300     @Override
301     @NonNull
302     public List<Key<?>> getKeys() {
303         // Force the javadoc for this function to show up on the CaptureRequest page
304         return super.getKeys();
305     }
306
307     /**
308      * Retrieve the tag for this request, if any.
309      *
310      * <p>This tag is not used for anything by the camera device, but can be
311      * used by an application to easily identify a CaptureRequest when it is
312      * returned by
313      * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
314      * </p>
315      *
316      * @return the last tag Object set on this request, or {@code null} if
317      *     no tag has been set.
318      * @see Builder#setTag
319      */
320     @Nullable
321     public Object getTag() {
322         return mUserTag;
323     }
324
325     /**
326      * Determine if this is a reprocess capture request.
327      *
328      * <p>A reprocess capture request produces output images from an input buffer from the
329      * {@link CameraCaptureSession}'s input {@link Surface}. A reprocess capture request can be
330      * created by {@link CameraDevice#createReprocessCaptureRequest}.</p>
331      *
332      * @return {@code true} if this is a reprocess capture request. {@code false} if this is not a
333      * reprocess capture request.
334      *
335      * @see CameraDevice#createReprocessCaptureRequest
336      */
337     public boolean isReprocess() {
338         return mIsReprocess;
339     }
340
341     /**
342      * <p>Determine if this request is part of a constrained high speed request list that was
343      * created by
344      * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}.
345      * A constrained high speed request list contains some constrained high speed capture requests
346      * with certain interleaved pattern that is suitable for high speed preview/video streaming. An
347      * active constrained high speed capture session only accepts constrained high speed request
348      * lists.  This method can be used to do the sanity check when a constrained high speed capture
349      * session receives a request list via {@link CameraCaptureSession#setRepeatingBurst} or
350      * {@link CameraCaptureSession#captureBurst}.  </p>
351      *
352      *
353      * @return {@code true} if this request is part of a constrained high speed request list,
354      * {@code false} otherwise.
355      *
356      * @hide
357      */
358     public boolean isPartOfCRequestList() {
359         return mIsPartOfCHSRequestList;
360     }
361
362     /**
363      * Returns a copy of the underlying {@link CameraMetadataNative}.
364      * @hide
365      */
366     public CameraMetadataNative getNativeCopy() {
367         return new CameraMetadataNative(mSettings);
368     }
369
370     /**
371      * Get the reprocessable session ID this reprocess capture request is associated with.
372      *
373      * @return the reprocessable session ID this reprocess capture request is associated with
374      *
375      * @throws IllegalStateException if this capture request is not a reprocess capture request.
376      * @hide
377      */
378     public int getReprocessableSessionId() {
379         if (mIsReprocess == false ||
380                 mReprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) {
381             throw new IllegalStateException("Getting the reprocessable session ID for a "+
382                     "non-reprocess capture request is illegal.");
383         }
384         return mReprocessableSessionId;
385     }
386
387     /**
388      * Determine whether this CaptureRequest is equal to another CaptureRequest.
389      *
390      * <p>A request is considered equal to another is if it's set of key/values is equal, it's
391      * list of output surfaces is equal, the user tag is equal, and the return values of
392      * isReprocess() are equal.</p>
393      *
394      * @param other Another instance of CaptureRequest.
395      *
396      * @return True if the requests are the same, false otherwise.
397      */
398     @Override
399     public boolean equals(Object other) {
400         return other instanceof CaptureRequest
401                 && equals((CaptureRequest)other);
402     }
403
404     private boolean equals(CaptureRequest other) {
405         return other != null
406                 && Objects.equals(mUserTag, other.mUserTag)
407                 && mSurfaceSet.equals(other.mSurfaceSet)
408                 && mSettings.equals(other.mSettings)
409                 && mIsReprocess == other.mIsReprocess
410                 && mReprocessableSessionId == other.mReprocessableSessionId;
411     }
412
413     @Override
414     public int hashCode() {
415         return HashCodeHelpers.hashCodeGeneric(mSettings, mSurfaceSet, mUserTag);
416     }
417
418     public static final Parcelable.Creator<CaptureRequest> CREATOR =
419             new Parcelable.Creator<CaptureRequest>() {
420         @Override
421         public CaptureRequest createFromParcel(Parcel in) {
422             CaptureRequest request = new CaptureRequest();
423             request.readFromParcel(in);
424
425             return request;
426         }
427
428         @Override
429         public CaptureRequest[] newArray(int size) {
430             return new CaptureRequest[size];
431         }
432     };
433
434     /**
435      * Expand this object from a Parcel.
436      * Hidden since this breaks the immutability of CaptureRequest, but is
437      * needed to receive CaptureRequests with aidl.
438      *
439      * @param in The parcel from which the object should be read
440      * @hide
441      */
442     private void readFromParcel(Parcel in) {
443         mSettings.readFromParcel(in);
444
445         mSurfaceSet.clear();
446
447         Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader());
448
449         if (parcelableArray == null) {
450             return;
451         }
452
453         for (Parcelable p : parcelableArray) {
454             Surface s = (Surface) p;
455             mSurfaceSet.add(s);
456         }
457
458         mIsReprocess = (in.readInt() == 0) ? false : true;
459         mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
460     }
461
462     @Override
463     public int describeContents() {
464         return 0;
465     }
466
467     @Override
468     public void writeToParcel(Parcel dest, int flags) {
469         mSettings.writeToParcel(dest, flags);
470         dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags);
471         dest.writeInt(mIsReprocess ? 1 : 0);
472     }
473
474     /**
475      * @hide
476      */
477     public boolean containsTarget(Surface surface) {
478         return mSurfaceSet.contains(surface);
479     }
480
481     /**
482      * @hide
483      */
484     public Collection<Surface> getTargets() {
485         return Collections.unmodifiableCollection(mSurfaceSet);
486     }
487
488     /**
489      * A builder for capture requests.
490      *
491      * <p>To obtain a builder instance, use the
492      * {@link CameraDevice#createCaptureRequest} method, which initializes the
493      * request fields to one of the templates defined in {@link CameraDevice}.
494      *
495      * @see CameraDevice#createCaptureRequest
496      * @see CameraDevice#TEMPLATE_PREVIEW
497      * @see CameraDevice#TEMPLATE_RECORD
498      * @see CameraDevice#TEMPLATE_STILL_CAPTURE
499      * @see CameraDevice#TEMPLATE_VIDEO_SNAPSHOT
500      * @see CameraDevice#TEMPLATE_MANUAL
501      */
502     public final static class Builder {
503
504         private final CaptureRequest mRequest;
505
506         /**
507          * Initialize the builder using the template; the request takes
508          * ownership of the template.
509          *
510          * @param template Template settings for this capture request.
511          * @param reprocess Indicates whether to create a reprocess capture request. {@code true}
512          *                  to create a reprocess capture request. {@code false} to create a regular
513          *                  capture request.
514          * @param reprocessableSessionId The ID of the camera capture session this capture is
515          *                               created for. This is used to validate if the application
516          *                               submits a reprocess capture request to the same session
517          *                               where the {@link TotalCaptureResult}, used to create the
518          *                               reprocess capture, came from.
519          *
520          * @throws IllegalArgumentException If creating a reprocess capture request with an invalid
521          *                                  reprocessableSessionId.
522          * @hide
523          */
524         public Builder(CameraMetadataNative template, boolean reprocess,
525                 int reprocessableSessionId) {
526             mRequest = new CaptureRequest(template, reprocess, reprocessableSessionId);
527         }
528
529         /**
530          * <p>Add a surface to the list of targets for this request</p>
531          *
532          * <p>The Surface added must be one of the surfaces included in the most
533          * recent call to {@link CameraDevice#createCaptureSession}, when the
534          * request is given to the camera device.</p>
535          *
536          * <p>Adding a target more than once has no effect.</p>
537          *
538          * @param outputTarget Surface to use as an output target for this request
539          */
540         public void addTarget(@NonNull Surface outputTarget) {
541             mRequest.mSurfaceSet.add(outputTarget);
542         }
543
544         /**
545          * <p>Remove a surface from the list of targets for this request.</p>
546          *
547          * <p>Removing a target that is not currently added has no effect.</p>
548          *
549          * @param outputTarget Surface to use as an output target for this request
550          */
551         public void removeTarget(@NonNull Surface outputTarget) {
552             mRequest.mSurfaceSet.remove(outputTarget);
553         }
554
555         /**
556          * Set a capture request field to a value. The field definitions can be
557          * found in {@link CaptureRequest}.
558          *
559          * @param key The metadata field to write.
560          * @param value The value to set the field to, which must be of a matching
561          * type to the key.
562          */
563         public <T> void set(@NonNull Key<T> key, T value) {
564             mRequest.mSettings.set(key, value);
565         }
566
567         /**
568          * Get a capture request field value. The field definitions can be
569          * found in {@link CaptureRequest}.
570          *
571          * @throws IllegalArgumentException if the key was not valid
572          *
573          * @param key The metadata field to read.
574          * @return The value of that key, or {@code null} if the field is not set.
575          */
576         @Nullable
577         public <T> T get(Key<T> key) {
578             return mRequest.mSettings.get(key);
579         }
580
581         /**
582          * Set a tag for this request.
583          *
584          * <p>This tag is not used for anything by the camera device, but can be
585          * used by an application to easily identify a CaptureRequest when it is
586          * returned by
587          * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
588          *
589          * @param tag an arbitrary Object to store with this request
590          * @see CaptureRequest#getTag
591          */
592         public void setTag(@Nullable Object tag) {
593             mRequest.mUserTag = tag;
594         }
595
596         /**
597          * <p>Mark this request as part of a constrained high speed request list created by
598          * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}.
599          * A constrained high speed request list contains some constrained high speed capture
600          * requests with certain interleaved pattern that is suitable for high speed preview/video
601          * streaming.</p>
602          *
603          * @hide
604          */
605         public void setPartOfCHSRequestList(boolean partOfCHSList) {
606             mRequest.mIsPartOfCHSRequestList = partOfCHSList;
607         }
608
609         /**
610          * Build a request using the current target Surfaces and settings.
611          * <p>Note that, although it is possible to create a {@code CaptureRequest} with no target
612          * {@link Surface}s, passing such a request into {@link CameraCaptureSession#capture},
613          * {@link CameraCaptureSession#captureBurst},
614          * {@link CameraCaptureSession#setRepeatingBurst}, or
615          * {@link CameraCaptureSession#setRepeatingRequest} will cause that method to throw an
616          * {@link IllegalArgumentException}.</p>
617          *
618          * @return A new capture request instance, ready for submission to the
619          * camera device.
620          */
621         @NonNull
622         public CaptureRequest build() {
623             return new CaptureRequest(mRequest);
624         }
625
626         /**
627          * @hide
628          */
629         public boolean isEmpty() {
630             return mRequest.mSettings.isEmpty();
631         }
632
633     }
634
635     /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
636      * The key entries below this point are generated from metadata
637      * definitions in /system/media/camera/docs. Do not modify by hand or
638      * modify the comment blocks at the start or end.
639      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
640
641     /**
642      * <p>The mode control selects how the image data is converted from the
643      * sensor's native color into linear sRGB color.</p>
644      * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this
645      * control is overridden by the AWB routine. When AWB is disabled, the
646      * application controls how the color mapping is performed.</p>
647      * <p>We define the expected processing pipeline below. For consistency
648      * across devices, this is always the case with TRANSFORM_MATRIX.</p>
649      * <p>When either FULL or HIGH_QUALITY is used, the camera device may
650      * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
651      * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
652      * camera device (in the results) and be roughly correct.</p>
653      * <p>Switching to TRANSFORM_MATRIX and using the data provided from
654      * FAST or HIGH_QUALITY will yield a picture with the same white point
655      * as what was produced by the camera device in the earlier frame.</p>
656      * <p>The expected processing pipeline is as follows:</p>
657      * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
658      * <p>The white balance is encoded by two values, a 4-channel white-balance
659      * gain vector (applied in the Bayer domain), and a 3x3 color transform
660      * matrix (applied after demosaic).</p>
661      * <p>The 4-channel white-balance gains are defined as:</p>
662      * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
663      * </code></pre>
664      * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
665      * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
666      * These may be identical for a given camera device implementation; if
667      * the camera device does not support a separate gain for even/odd green
668      * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
669      * <code>G_even</code> in the output result metadata.</p>
670      * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
671      * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
672      * </code></pre>
673      * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
674      * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
675      * <p>with colors as follows:</p>
676      * <pre><code>r' = I0r + I1g + I2b
677      * g' = I3r + I4g + I5b
678      * b' = I6r + I7g + I8b
679      * </code></pre>
680      * <p>Both the input and output value ranges must match. Overflow/underflow
681      * values are clipped to fit within the range.</p>
682      * <p><b>Possible values:</b>
683      * <ul>
684      *   <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
685      *   <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
686      *   <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
687      * </ul></p>
688      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
689      * <p><b>Full capability</b> -
690      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
691      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
692      *
693      * @see CaptureRequest#COLOR_CORRECTION_GAINS
694      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
695      * @see CaptureRequest#CONTROL_AWB_MODE
696      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
697      * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
698      * @see #COLOR_CORRECTION_MODE_FAST
699      * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
700      */
701     @PublicKey
702     public static final Key<Integer> COLOR_CORRECTION_MODE =
703             new Key<Integer>("android.colorCorrection.mode", int.class);
704
705     /**
706      * <p>A color transform matrix to use to transform
707      * from sensor RGB color space to output linear sRGB color space.</p>
708      * <p>This matrix is either set by the camera device when the request
709      * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
710      * directly by the application in the request when the
711      * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
712      * <p>In the latter case, the camera device may round the matrix to account
713      * for precision issues; the final rounded matrix should be reported back
714      * in this matrix result metadata. The transform should keep the magnitude
715      * of the output color values within <code>[0, 1.0]</code> (assuming input color
716      * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
717      * <p>The valid range of each matrix element varies on different devices, but
718      * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
719      * <p><b>Units</b>: Unitless scale factors</p>
720      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
721      * <p><b>Full capability</b> -
722      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
723      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
724      *
725      * @see CaptureRequest#COLOR_CORRECTION_MODE
726      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
727      */
728     @PublicKey
729     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
730             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
731
732     /**
733      * <p>Gains applying to Bayer raw color channels for
734      * white-balance.</p>
735      * <p>These per-channel gains are either set by the camera device
736      * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
737      * TRANSFORM_MATRIX, or directly by the application in the
738      * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
739      * TRANSFORM_MATRIX.</p>
740      * <p>The gains in the result metadata are the gains actually
741      * applied by the camera device to the current frame.</p>
742      * <p>The valid range of gains varies on different devices, but gains
743      * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
744      * device allows gains below 1.0, this is usually not recommended because
745      * this can create color artifacts.</p>
746      * <p><b>Units</b>: Unitless gain factors</p>
747      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
748      * <p><b>Full capability</b> -
749      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
750      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
751      *
752      * @see CaptureRequest#COLOR_CORRECTION_MODE
753      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
754      */
755     @PublicKey
756     public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
757             new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
758
759     /**
760      * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
761      * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
762      * can not focus on the same point after exiting from the lens. This metadata defines
763      * the high level control of chromatic aberration correction algorithm, which aims to
764      * minimize the chromatic artifacts that may occur along the object boundaries in an
765      * image.</p>
766      * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
767      * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
768      * use the highest-quality aberration correction algorithms, even if it slows down
769      * capture rate. FAST means the camera device will not slow down capture rate when
770      * applying aberration correction.</p>
771      * <p>LEGACY devices will always be in FAST mode.</p>
772      * <p><b>Possible values:</b>
773      * <ul>
774      *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
775      *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
776      *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
777      * </ul></p>
778      * <p><b>Available values for this device:</b><br>
779      * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
780      * <p>This key is available on all devices.</p>
781      *
782      * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
783      * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
784      * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
785      * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
786      */
787     @PublicKey
788     public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
789             new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
790
791     /**
792      * <p>The desired setting for the camera device's auto-exposure
793      * algorithm's antibanding compensation.</p>
794      * <p>Some kinds of lighting fixtures, such as some fluorescent
795      * lights, flicker at the rate of the power supply frequency
796      * (60Hz or 50Hz, depending on country). While this is
797      * typically not noticeable to a person, it can be visible to
798      * a camera device. If a camera sets its exposure time to the
799      * wrong value, the flicker may become visible in the
800      * viewfinder as flicker or in a final captured image, as a
801      * set of variable-brightness bands across the image.</p>
802      * <p>Therefore, the auto-exposure routines of camera devices
803      * include antibanding routines that ensure that the chosen
804      * exposure value will not cause such banding. The choice of
805      * exposure time depends on the rate of flicker, which the
806      * camera device can detect automatically, or the expected
807      * rate can be selected by the application using this
808      * control.</p>
809      * <p>A given camera device may not support all of the possible
810      * options for the antibanding mode. The
811      * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
812      * the available modes for a given camera device.</p>
813      * <p>AUTO mode is the default if it is available on given
814      * camera device. When AUTO mode is not available, the
815      * default will be either 50HZ or 60HZ, and both 50HZ
816      * and 60HZ will be available.</p>
817      * <p>If manual exposure control is enabled (by setting
818      * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
819      * then this setting has no effect, and the application must
820      * ensure it selects exposure times that do not cause banding
821      * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
822      * the application in this.</p>
823      * <p><b>Possible values:</b>
824      * <ul>
825      *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
826      *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
827      *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
828      *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
829      * </ul></p>
830      * <p><b>Available values for this device:</b><br></p>
831      * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
832      * <p>This key is available on all devices.</p>
833      *
834      * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
835      * @see CaptureRequest#CONTROL_AE_MODE
836      * @see CaptureRequest#CONTROL_MODE
837      * @see CaptureResult#STATISTICS_SCENE_FLICKER
838      * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
839      * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
840      * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
841      * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
842      */
843     @PublicKey
844     public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
845             new Key<Integer>("android.control.aeAntibandingMode", int.class);
846
847     /**
848      * <p>Adjustment to auto-exposure (AE) target image
849      * brightness.</p>
850      * <p>The adjustment is measured as a count of steps, with the
851      * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
852      * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
853      * <p>For example, if the exposure value (EV) step is 0.333, '6'
854      * will mean an exposure compensation of +2 EV; -3 will mean an
855      * exposure compensation of -1 EV. One EV represents a doubling
856      * of image brightness. Note that this control will only be
857      * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
858      * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p>
859      * <p>In the event of exposure compensation value being changed, camera device
860      * may take several frames to reach the newly requested exposure target.
861      * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
862      * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
863      * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
864      * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
865      * <p><b>Units</b>: Compensation steps</p>
866      * <p><b>Range of valid values:</b><br>
867      * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
868      * <p>This key is available on all devices.</p>
869      *
870      * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
871      * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
872      * @see CaptureRequest#CONTROL_AE_LOCK
873      * @see CaptureRequest#CONTROL_AE_MODE
874      * @see CaptureResult#CONTROL_AE_STATE
875      */
876     @PublicKey
877     public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
878             new Key<Integer>("android.control.aeExposureCompensation", int.class);
879
880     /**
881      * <p>Whether auto-exposure (AE) is currently locked to its latest
882      * calculated values.</p>
883      * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
884      * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
885      * <p>Note that even when AE is locked, the flash may be fired if
886      * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
887      * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
888      * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
889      * is ON, the camera device will still adjust its exposure value.</p>
890      * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
891      * when AE is already locked, the camera device will not change the exposure time
892      * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
893      * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
894      * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
895      * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
896      * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
897      * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
898      * the AE if AE is locked by the camera device internally during precapture metering
899      * sequence In other words, submitting requests with AE unlock has no effect for an
900      * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
901      * will never succeed in a sequence of preview requests where AE lock is always set
902      * to <code>false</code>.</p>
903      * <p>Since the camera device has a pipeline of in-flight requests, the settings that
904      * get locked do not necessarily correspond to the settings that were present in the
905      * latest capture result received from the camera device, since additional captures
906      * and AE updates may have occurred even before the result was sent out. If an
907      * application is switching between automatic and manual control and wishes to eliminate
908      * any flicker during the switch, the following procedure is recommended:</p>
909      * <ol>
910      * <li>Starting in auto-AE mode:</li>
911      * <li>Lock AE</li>
912      * <li>Wait for the first result to be output that has the AE locked</li>
913      * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
914      * <li>Submit the capture request, proceed to run manual AE as desired.</li>
915      * </ol>
916      * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
917      * <p>This key is available on all devices.</p>
918      *
919      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
920      * @see CaptureRequest#CONTROL_AE_MODE
921      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
922      * @see CaptureResult#CONTROL_AE_STATE
923      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
924      * @see CaptureRequest#SENSOR_SENSITIVITY
925      */
926     @PublicKey
927     public static final Key<Boolean> CONTROL_AE_LOCK =
928             new Key<Boolean>("android.control.aeLock", boolean.class);
929
930     /**
931      * <p>The desired mode for the camera device's
932      * auto-exposure routine.</p>
933      * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
934      * AUTO.</p>
935      * <p>When set to any of the ON modes, the camera device's
936      * auto-exposure routine is enabled, overriding the
937      * application's selected exposure time, sensor sensitivity,
938      * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
939      * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
940      * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
941      * is selected, the camera device's flash unit controls are
942      * also overridden.</p>
943      * <p>The FLASH modes are only available if the camera device
944      * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
945      * <p>If flash TORCH mode is desired, this field must be set to
946      * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
947      * <p>When set to any of the ON modes, the values chosen by the
948      * camera device auto-exposure routine for the overridden
949      * fields for a given capture will be available in its
950      * CaptureResult.</p>
951      * <p><b>Possible values:</b>
952      * <ul>
953      *   <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
954      *   <li>{@link #CONTROL_AE_MODE_ON ON}</li>
955      *   <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
956      *   <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
957      *   <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
958      * </ul></p>
959      * <p><b>Available values for this device:</b><br>
960      * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
961      * <p>This key is available on all devices.</p>
962      *
963      * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
964      * @see CaptureRequest#CONTROL_MODE
965      * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
966      * @see CaptureRequest#FLASH_MODE
967      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
968      * @see CaptureRequest#SENSOR_FRAME_DURATION
969      * @see CaptureRequest#SENSOR_SENSITIVITY
970      * @see #CONTROL_AE_MODE_OFF
971      * @see #CONTROL_AE_MODE_ON
972      * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
973      * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
974      * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
975      */
976     @PublicKey
977     public static final Key<Integer> CONTROL_AE_MODE =
978             new Key<Integer>("android.control.aeMode", int.class);
979
980     /**
981      * <p>List of metering areas to use for auto-exposure adjustment.</p>
982      * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
983      * Otherwise will always be present.</p>
984      * <p>The maximum number of regions supported by the device is determined by the value
985      * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
986      * <p>The coordinate system is based on the active pixel array,
987      * with (0,0) being the top-left pixel in the active pixel array, and
988      * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
989      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
990      * bottom-right pixel in the active pixel array.</p>
991      * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
992      * for every pixel in the area. This means that a large metering area
993      * with the same weight as a smaller area will have more effect in
994      * the metering result. Metering areas can partially overlap and the
995      * camera device will add the weights in the overlap region.</p>
996      * <p>The weights are relative to weights of other exposure metering regions, so if only one
997      * region is used, all non-zero weights will have the same effect. A region with 0
998      * weight is ignored.</p>
999      * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1000      * camera device.</p>
1001      * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1002      * capture result metadata, the camera device will ignore the sections outside the crop
1003      * region and output only the intersection rectangle as the metering region in the result
1004      * metadata.  If the region is entirely outside the crop region, it will be ignored and
1005      * not reported in the result metadata.</p>
1006      * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1007      * <p><b>Range of valid values:</b><br>
1008      * Coordinates must be between <code>[(0,0), (width, height))</code> of
1009      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1010      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1011      *
1012      * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
1013      * @see CaptureRequest#SCALER_CROP_REGION
1014      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1015      */
1016     @PublicKey
1017     public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
1018             new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
1019
1020     /**
1021      * <p>Range over which the auto-exposure routine can
1022      * adjust the capture frame rate to maintain good
1023      * exposure.</p>
1024      * <p>Only constrains auto-exposure (AE) algorithm, not
1025      * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
1026      * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
1027      * <p><b>Units</b>: Frames per second (FPS)</p>
1028      * <p><b>Range of valid values:</b><br>
1029      * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
1030      * <p>This key is available on all devices.</p>
1031      *
1032      * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
1033      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1034      * @see CaptureRequest#SENSOR_FRAME_DURATION
1035      */
1036     @PublicKey
1037     public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
1038             new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
1039
1040     /**
1041      * <p>Whether the camera device will trigger a precapture
1042      * metering sequence when it processes this request.</p>
1043      * <p>This entry is normally set to IDLE, or is not
1044      * included at all in the request settings. When included and
1045      * set to START, the camera device will trigger the auto-exposure (AE)
1046      * precapture metering sequence.</p>
1047      * <p>When set to CANCEL, the camera device will cancel any active
1048      * precapture metering trigger, and return to its initial AE state.
1049      * If a precapture metering sequence is already completed, and the camera
1050      * device has implicitly locked the AE for subsequent still capture, the
1051      * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
1052      * <p>The precapture sequence should be triggered before starting a
1053      * high-quality still capture for final metering decisions to
1054      * be made, and for firing pre-capture flash pulses to estimate
1055      * scene brightness and required final capture flash power, when
1056      * the flash is enabled.</p>
1057      * <p>Normally, this entry should be set to START for only a
1058      * single request, and the application should wait until the
1059      * sequence completes before starting a new one.</p>
1060      * <p>When a precapture metering sequence is finished, the camera device
1061      * may lock the auto-exposure routine internally to be able to accurately expose the
1062      * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
1063      * For this case, the AE may not resume normal scan if no subsequent still capture is
1064      * submitted. To ensure that the AE routine restarts normal scan, the application should
1065      * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
1066      * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a
1067      * still capture request after the precapture sequence completes. Alternatively, for
1068      * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
1069      * internally locked AE if the application doesn't submit a still capture request after
1070      * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
1071      * be used in devices that have earlier API levels.</p>
1072      * <p>The exact effect of auto-exposure (AE) precapture trigger
1073      * depends on the current AE mode and state; see
1074      * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
1075      * details.</p>
1076      * <p>On LEGACY-level devices, the precapture trigger is not supported;
1077      * capturing a high-resolution JPEG image will automatically trigger a
1078      * precapture sequence before the high-resolution capture, including
1079      * potentially firing a pre-capture flash.</p>
1080      * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
1081      * simultaneously is allowed. However, since these triggers often require cooperation between
1082      * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1083      * focus sweep), the camera device may delay acting on a later trigger until the previous
1084      * trigger has been fully handled. This may lead to longer intervals between the trigger and
1085      * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for
1086      * example.</p>
1087      * <p>If both the precapture and the auto-focus trigger are activated on the same request, then
1088      * the camera device will complete them in the optimal order for that device.</p>
1089      * <p><b>Possible values:</b>
1090      * <ul>
1091      *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
1092      *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
1093      *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
1094      * </ul></p>
1095      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1096      * <p><b>Limited capability</b> -
1097      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1098      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1099      *
1100      * @see CaptureRequest#CONTROL_AE_LOCK
1101      * @see CaptureResult#CONTROL_AE_STATE
1102      * @see CaptureRequest#CONTROL_AF_TRIGGER
1103      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
1104      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1105      * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
1106      * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
1107      * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
1108      */
1109     @PublicKey
1110     public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
1111             new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
1112
1113     /**
1114      * <p>Whether auto-focus (AF) is currently enabled, and what
1115      * mode it is set to.</p>
1116      * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
1117      * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1118      * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1119      * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1120      * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p>
1121      * <p>If the lens is controlled by the camera device auto-focus algorithm,
1122      * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
1123      * in result metadata.</p>
1124      * <p><b>Possible values:</b>
1125      * <ul>
1126      *   <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1127      *   <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1128      *   <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1129      *   <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1130      *   <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1131      *   <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1132      * </ul></p>
1133      * <p><b>Available values for this device:</b><br>
1134      * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1135      * <p>This key is available on all devices.</p>
1136      *
1137      * @see CaptureRequest#CONTROL_AE_MODE
1138      * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
1139      * @see CaptureResult#CONTROL_AF_STATE
1140      * @see CaptureRequest#CONTROL_AF_TRIGGER
1141      * @see CaptureRequest#CONTROL_MODE
1142      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1143      * @see #CONTROL_AF_MODE_OFF
1144      * @see #CONTROL_AF_MODE_AUTO
1145      * @see #CONTROL_AF_MODE_MACRO
1146      * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1147      * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1148      * @see #CONTROL_AF_MODE_EDOF
1149      */
1150     @PublicKey
1151     public static final Key<Integer> CONTROL_AF_MODE =
1152             new Key<Integer>("android.control.afMode", int.class);
1153
1154     /**
1155      * <p>List of metering areas to use for auto-focus.</p>
1156      * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
1157      * Otherwise will always be present.</p>
1158      * <p>The maximum number of focus areas supported by the device is determined by the value
1159      * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
1160      * <p>The coordinate system is based on the active pixel array,
1161      * with (0,0) being the top-left pixel in the active pixel array, and
1162      * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1163      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
1164      * bottom-right pixel in the active pixel array.</p>
1165      * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
1166      * for every pixel in the area. This means that a large metering area
1167      * with the same weight as a smaller area will have more effect in
1168      * the metering result. Metering areas can partially overlap and the
1169      * camera device will add the weights in the overlap region.</p>
1170      * <p>The weights are relative to weights of other metering regions, so if only one region
1171      * is used, all non-zero weights will have the same effect. A region with 0 weight is
1172      * ignored.</p>
1173      * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1174      * camera device.</p>
1175      * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1176      * capture result metadata, the camera device will ignore the sections outside the crop
1177      * region and output only the intersection rectangle as the metering region in the result
1178      * metadata. If the region is entirely outside the crop region, it will be ignored and
1179      * not reported in the result metadata.</p>
1180      * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1181      * <p><b>Range of valid values:</b><br>
1182      * Coordinates must be between <code>[(0,0), (width, height))</code> of
1183      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1184      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1185      *
1186      * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
1187      * @see CaptureRequest#SCALER_CROP_REGION
1188      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1189      */
1190     @PublicKey
1191     public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1192             new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
1193
1194     /**
1195      * <p>Whether the camera device will trigger autofocus for this request.</p>
1196      * <p>This entry is normally set to IDLE, or is not
1197      * included at all in the request settings.</p>
1198      * <p>When included and set to START, the camera device will trigger the
1199      * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1200      * <p>When set to CANCEL, the camera device will cancel any active trigger,
1201      * and return to its initial AF state.</p>
1202      * <p>Generally, applications should set this entry to START or CANCEL for only a
1203      * single capture, and then return it to IDLE (or not set at all). Specifying
1204      * START for multiple captures in a row means restarting the AF operation over
1205      * and over again.</p>
1206      * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
1207      * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
1208      * simultaneously is allowed. However, since these triggers often require cooperation between
1209      * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1210      * focus sweep), the camera device may delay acting on a later trigger until the previous
1211      * trigger has been fully handled. This may lead to longer intervals between the trigger and
1212      * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p>
1213      * <p><b>Possible values:</b>
1214      * <ul>
1215      *   <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1216      *   <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1217      *   <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1218      * </ul></p>
1219      * <p>This key is available on all devices.</p>
1220      *
1221      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1222      * @see CaptureResult#CONTROL_AF_STATE
1223      * @see #CONTROL_AF_TRIGGER_IDLE
1224      * @see #CONTROL_AF_TRIGGER_START
1225      * @see #CONTROL_AF_TRIGGER_CANCEL
1226      */
1227     @PublicKey
1228     public static final Key<Integer> CONTROL_AF_TRIGGER =
1229             new Key<Integer>("android.control.afTrigger", int.class);
1230
1231     /**
1232      * <p>Whether auto-white balance (AWB) is currently locked to its
1233      * latest calculated values.</p>
1234      * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1235      * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1236      * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1237      * get locked do not necessarily correspond to the settings that were present in the
1238      * latest capture result received from the camera device, since additional captures
1239      * and AWB updates may have occurred even before the result was sent out. If an
1240      * application is switching between automatic and manual control and wishes to eliminate
1241      * any flicker during the switch, the following procedure is recommended:</p>
1242      * <ol>
1243      * <li>Starting in auto-AWB mode:</li>
1244      * <li>Lock AWB</li>
1245      * <li>Wait for the first result to be output that has the AWB locked</li>
1246      * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1247      * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1248      * </ol>
1249      * <p>Note that AWB lock is only meaningful when
1250      * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1251      * AWB is already fixed to a specific setting.</p>
1252      * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1253      * <p>This key is available on all devices.</p>
1254      *
1255      * @see CaptureRequest#CONTROL_AWB_MODE
1256      */
1257     @PublicKey
1258     public static final Key<Boolean> CONTROL_AWB_LOCK =
1259             new Key<Boolean>("android.control.awbLock", boolean.class);
1260
1261     /**
1262      * <p>Whether auto-white balance (AWB) is currently setting the color
1263      * transform fields, and what its illumination target
1264      * is.</p>
1265      * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
1266      * <p>When set to the ON mode, the camera device's auto-white balance
1267      * routine is enabled, overriding the application's selected
1268      * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1269      * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1270      * is OFF, the behavior of AWB is device dependent. It is recommened to
1271      * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1272      * setting AE mode to OFF.</p>
1273      * <p>When set to the OFF mode, the camera device's auto-white balance
1274      * routine is disabled. The application manually controls the white
1275      * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
1276      * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
1277      * <p>When set to any other modes, the camera device's auto-white
1278      * balance routine is disabled. The camera device uses each
1279      * particular illumination target for white balance
1280      * adjustment. The application's values for
1281      * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1282      * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1283      * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
1284      * <p><b>Possible values:</b>
1285      * <ul>
1286      *   <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1287      *   <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1288      *   <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1289      *   <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1290      *   <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1291      *   <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1292      *   <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1293      *   <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1294      *   <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1295      * </ul></p>
1296      * <p><b>Available values for this device:</b><br>
1297      * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
1298      * <p>This key is available on all devices.</p>
1299      *
1300      * @see CaptureRequest#COLOR_CORRECTION_GAINS
1301      * @see CaptureRequest#COLOR_CORRECTION_MODE
1302      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1303      * @see CaptureRequest#CONTROL_AE_MODE
1304      * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
1305      * @see CaptureRequest#CONTROL_AWB_LOCK
1306      * @see CaptureRequest#CONTROL_MODE
1307      * @see #CONTROL_AWB_MODE_OFF
1308      * @see #CONTROL_AWB_MODE_AUTO
1309      * @see #CONTROL_AWB_MODE_INCANDESCENT
1310      * @see #CONTROL_AWB_MODE_FLUORESCENT
1311      * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1312      * @see #CONTROL_AWB_MODE_DAYLIGHT
1313      * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1314      * @see #CONTROL_AWB_MODE_TWILIGHT
1315      * @see #CONTROL_AWB_MODE_SHADE
1316      */
1317     @PublicKey
1318     public static final Key<Integer> CONTROL_AWB_MODE =
1319             new Key<Integer>("android.control.awbMode", int.class);
1320
1321     /**
1322      * <p>List of metering areas to use for auto-white-balance illuminant
1323      * estimation.</p>
1324      * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
1325      * Otherwise will always be present.</p>
1326      * <p>The maximum number of regions supported by the device is determined by the value
1327      * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
1328      * <p>The coordinate system is based on the active pixel array,
1329      * with (0,0) being the top-left pixel in the active pixel array, and
1330      * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1331      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
1332      * bottom-right pixel in the active pixel array.</p>
1333      * <p>The weight must range from 0 to 1000, and represents a weight
1334      * for every pixel in the area. This means that a large metering area
1335      * with the same weight as a smaller area will have more effect in
1336      * the metering result. Metering areas can partially overlap and the
1337      * camera device will add the weights in the overlap region.</p>
1338      * <p>The weights are relative to weights of other white balance metering regions, so if
1339      * only one region is used, all non-zero weights will have the same effect. A region with
1340      * 0 weight is ignored.</p>
1341      * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1342      * camera device.</p>
1343      * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1344      * capture result metadata, the camera device will ignore the sections outside the crop
1345      * region and output only the intersection rectangle as the metering region in the result
1346      * metadata.  If the region is entirely outside the crop region, it will be ignored and
1347      * not reported in the result metadata.</p>
1348      * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1349      * <p><b>Range of valid values:</b><br>
1350      * Coordinates must be between <code>[(0,0), (width, height))</code> of
1351      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1352      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1353      *
1354      * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
1355      * @see CaptureRequest#SCALER_CROP_REGION
1356      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1357      */
1358     @PublicKey
1359     public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1360             new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
1361
1362     /**
1363      * <p>Information to the camera device 3A (auto-exposure,
1364      * auto-focus, auto-white balance) routines about the purpose
1365      * of this capture, to help the camera device to decide optimal 3A
1366      * strategy.</p>
1367      * <p>This control (except for MANUAL) is only effective if
1368      * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
1369      * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1370      * contains PRIVATE_REPROCESSING or YUV_REPROCESSING. MANUAL will be supported if
1371      * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR. Other intent values are
1372      * always supported.</p>
1373      * <p><b>Possible values:</b>
1374      * <ul>
1375      *   <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1376      *   <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1377      *   <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1378      *   <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1379      *   <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1380      *   <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1381      *   <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1382      * </ul></p>
1383      * <p>This key is available on all devices.</p>
1384      *
1385      * @see CaptureRequest#CONTROL_MODE
1386      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1387      * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1388      * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1389      * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1390      * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1391      * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1392      * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1393      * @see #CONTROL_CAPTURE_INTENT_MANUAL
1394      */
1395     @PublicKey
1396     public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1397             new Key<Integer>("android.control.captureIntent", int.class);
1398
1399     /**
1400      * <p>A special color effect to apply.</p>
1401      * <p>When this mode is set, a color effect will be applied
1402      * to images produced by the camera device. The interpretation
1403      * and implementation of these color effects is left to the
1404      * implementor of the camera device, and should not be
1405      * depended on to be consistent (or present) across all
1406      * devices.</p>
1407      * <p><b>Possible values:</b>
1408      * <ul>
1409      *   <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1410      *   <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1411      *   <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1412      *   <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1413      *   <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1414      *   <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1415      *   <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1416      *   <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1417      *   <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1418      * </ul></p>
1419      * <p><b>Available values for this device:</b><br>
1420      * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
1421      * <p>This key is available on all devices.</p>
1422      *
1423      * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
1424      * @see #CONTROL_EFFECT_MODE_OFF
1425      * @see #CONTROL_EFFECT_MODE_MONO
1426      * @see #CONTROL_EFFECT_MODE_NEGATIVE
1427      * @see #CONTROL_EFFECT_MODE_SOLARIZE
1428      * @see #CONTROL_EFFECT_MODE_SEPIA
1429      * @see #CONTROL_EFFECT_MODE_POSTERIZE
1430      * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1431      * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1432      * @see #CONTROL_EFFECT_MODE_AQUA
1433      */
1434     @PublicKey
1435     public static final Key<Integer> CONTROL_EFFECT_MODE =
1436             new Key<Integer>("android.control.effectMode", int.class);
1437
1438     /**
1439      * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
1440      * routines.</p>
1441      * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
1442      * by the camera device is disabled. The application must set the fields for
1443      * capture parameters itself.</p>
1444      * <p>When set to AUTO, the individual algorithm controls in
1445      * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
1446      * <p>When set to USE_SCENE_MODE, the individual controls in
1447      * android.control.* are mostly disabled, and the camera device implements
1448      * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
1449      * as it wishes. The camera device scene mode 3A settings are provided by
1450      * {@link android.hardware.camera2.CaptureResult capture results}.</p>
1451      * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1452      * is that this frame will not be used by camera device background 3A statistics
1453      * update, as if this frame is never captured. This mode can be used in the scenario
1454      * where the application doesn't want a 3A manual control capture to affect
1455      * the subsequent auto 3A capture results.</p>
1456      * <p><b>Possible values:</b>
1457      * <ul>
1458      *   <li>{@link #CONTROL_MODE_OFF OFF}</li>
1459      *   <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1460      *   <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1461      *   <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1462      * </ul></p>
1463      * <p><b>Available values for this device:</b><br>
1464      * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
1465      * <p>This key is available on all devices.</p>
1466      *
1467      * @see CaptureRequest#CONTROL_AF_MODE
1468      * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
1469      * @see #CONTROL_MODE_OFF
1470      * @see #CONTROL_MODE_AUTO
1471      * @see #CONTROL_MODE_USE_SCENE_MODE
1472      * @see #CONTROL_MODE_OFF_KEEP_STATE
1473      */
1474     @PublicKey
1475     public static final Key<Integer> CONTROL_MODE =
1476             new Key<Integer>("android.control.mode", int.class);
1477
1478     /**
1479      * <p>Control for which scene mode is currently active.</p>
1480      * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1481      * capture settings.</p>
1482      * <p>This is the mode that that is active when
1483      * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
1484      * disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}
1485      * while in use.</p>
1486      * <p>The interpretation and implementation of these scene modes is left
1487      * to the implementor of the camera device. Their behavior will not be
1488      * consistent across all devices, and any given device may only implement
1489      * a subset of these modes.</p>
1490      * <p><b>Possible values:</b>
1491      * <ul>
1492      *   <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1493      *   <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1494      *   <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1495      *   <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1496      *   <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1497      *   <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1498      *   <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1499      *   <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1500      *   <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1501      *   <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1502      *   <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1503      *   <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1504      *   <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1505      *   <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1506      *   <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1507      *   <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1508      *   <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1509      *   <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
1510      *   <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
1511      * </ul></p>
1512      * <p><b>Available values for this device:</b><br>
1513      * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
1514      * <p>This key is available on all devices.</p>
1515      *
1516      * @see CaptureRequest#CONTROL_AE_MODE
1517      * @see CaptureRequest#CONTROL_AF_MODE
1518      * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
1519      * @see CaptureRequest#CONTROL_AWB_MODE
1520      * @see CaptureRequest#CONTROL_MODE
1521      * @see #CONTROL_SCENE_MODE_DISABLED
1522      * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1523      * @see #CONTROL_SCENE_MODE_ACTION
1524      * @see #CONTROL_SCENE_MODE_PORTRAIT
1525      * @see #CONTROL_SCENE_MODE_LANDSCAPE
1526      * @see #CONTROL_SCENE_MODE_NIGHT
1527      * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1528      * @see #CONTROL_SCENE_MODE_THEATRE
1529      * @see #CONTROL_SCENE_MODE_BEACH
1530      * @see #CONTROL_SCENE_MODE_SNOW
1531      * @see #CONTROL_SCENE_MODE_SUNSET
1532      * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1533      * @see #CONTROL_SCENE_MODE_FIREWORKS
1534      * @see #CONTROL_SCENE_MODE_SPORTS
1535      * @see #CONTROL_SCENE_MODE_PARTY
1536      * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1537      * @see #CONTROL_SCENE_MODE_BARCODE
1538      * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
1539      * @see #CONTROL_SCENE_MODE_HDR
1540      */
1541     @PublicKey
1542     public static final Key<Integer> CONTROL_SCENE_MODE =
1543             new Key<Integer>("android.control.sceneMode", int.class);
1544
1545     /**
1546      * <p>Whether video stabilization is
1547      * active.</p>
1548      * <p>Video stabilization automatically translates and scales images from
1549      * the camera in order to stabilize motion between consecutive frames.</p>
1550      * <p>If enabled, video stabilization can modify the
1551      * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
1552      * <p>Switching between different video stabilization modes may take several
1553      * frames to initialize, the camera device will report the current mode
1554      * in capture result metadata. For example, When "ON" mode is requested,
1555      * the video stabilization modes in the first several capture results may
1556      * still be "OFF", and it will become "ON" when the initialization is
1557      * done.</p>
1558      * <p>If a camera device supports both this mode and OIS
1559      * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
1560      * produce undesirable interaction, so it is recommended not to enable
1561      * both at the same time.</p>
1562      * <p><b>Possible values:</b>
1563      * <ul>
1564      *   <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
1565      *   <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
1566      * </ul></p>
1567      * <p>This key is available on all devices.</p>
1568      *
1569      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
1570      * @see CaptureRequest#SCALER_CROP_REGION
1571      * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1572      * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1573      */
1574     @PublicKey
1575     public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1576             new Key<Integer>("android.control.videoStabilizationMode", int.class);
1577
1578     /**
1579      * <p>Operation mode for edge
1580      * enhancement.</p>
1581      * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
1582      * no enhancement will be applied by the camera device.</p>
1583      * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
1584      * will be applied. HIGH_QUALITY mode indicates that the
1585      * camera device will use the highest-quality enhancement algorithms,
1586      * even if it slows down capture rate. FAST means the camera device will
1587      * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
1588      * edge enhancement will slow down capture rate. Every output stream will have a similar
1589      * amount of enhancement applied.</p>
1590      * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
1591      * buffer of high-resolution images during preview and reprocess image(s) from that buffer
1592      * into a final capture when triggered by the user. In this mode, the camera device applies
1593      * edge enhancement to low-resolution streams (below maximum recording resolution) to
1594      * maximize preview quality, but does not apply edge enhancement to high-resolution streams,
1595      * since those will be reprocessed later if necessary.</p>
1596      * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
1597      * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
1598      * The camera device may adjust its internal edge enhancement parameters for best
1599      * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p>
1600      * <p><b>Possible values:</b>
1601      * <ul>
1602      *   <li>{@link #EDGE_MODE_OFF OFF}</li>
1603      *   <li>{@link #EDGE_MODE_FAST FAST}</li>
1604      *   <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
1605      *   <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1606      * </ul></p>
1607      * <p><b>Available values for this device:</b><br>
1608      * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
1609      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1610      * <p><b>Full capability</b> -
1611      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1612      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1613      *
1614      * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
1615      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1616      * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
1617      * @see #EDGE_MODE_OFF
1618      * @see #EDGE_MODE_FAST
1619      * @see #EDGE_MODE_HIGH_QUALITY
1620      * @see #EDGE_MODE_ZERO_SHUTTER_LAG
1621      */
1622     @PublicKey
1623     public static final Key<Integer> EDGE_MODE =
1624             new Key<Integer>("android.edge.mode", int.class);
1625
1626     /**
1627      * <p>The desired mode for for the camera device's flash control.</p>
1628      * <p>This control is only effective when flash unit is available
1629      * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
1630      * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
1631      * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
1632      * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
1633      * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
1634      * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
1635      * device's auto-exposure routine's result. When used in still capture case, this
1636      * control should be used along with auto-exposure (AE) precapture metering sequence
1637      * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
1638      * <p>When set to TORCH, the flash will be on continuously. This mode can be used
1639      * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
1640      * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
1641      * <p><b>Possible values:</b>
1642      * <ul>
1643      *   <li>{@link #FLASH_MODE_OFF OFF}</li>
1644      *   <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
1645      *   <li>{@link #FLASH_MODE_TORCH TORCH}</li>
1646      * </ul></p>
1647      * <p>This key is available on all devices.</p>
1648      *
1649      * @see CaptureRequest#CONTROL_AE_MODE
1650      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1651      * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
1652      * @see CaptureResult#FLASH_STATE
1653      * @see #FLASH_MODE_OFF
1654      * @see #FLASH_MODE_SINGLE
1655      * @see #FLASH_MODE_TORCH
1656      */
1657     @PublicKey
1658     public static final Key<Integer> FLASH_MODE =
1659             new Key<Integer>("android.flash.mode", int.class);
1660
1661     /**
1662      * <p>Operational mode for hot pixel correction.</p>
1663      * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
1664      * that do not accurately measure the incoming light (i.e. pixels that
1665      * are stuck at an arbitrary value or are oversensitive).</p>
1666      * <p><b>Possible values:</b>
1667      * <ul>
1668      *   <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
1669      *   <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
1670      *   <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
1671      * </ul></p>
1672      * <p><b>Available values for this device:</b><br>
1673      * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
1674      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1675      *
1676      * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
1677      * @see #HOT_PIXEL_MODE_OFF
1678      * @see #HOT_PIXEL_MODE_FAST
1679      * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1680      */
1681     @PublicKey
1682     public static final Key<Integer> HOT_PIXEL_MODE =
1683             new Key<Integer>("android.hotPixel.mode", int.class);
1684
1685     /**
1686      * <p>A location object to use when generating image GPS metadata.</p>
1687      * <p>Setting a location object in a request will include the GPS coordinates of the location
1688      * into any JPEG images captured based on the request. These coordinates can then be
1689      * viewed by anyone who receives the JPEG image.</p>
1690      * <p>This key is available on all devices.</p>
1691      */
1692     @PublicKey
1693     @SyntheticKey
1694     public static final Key<android.location.Location> JPEG_GPS_LOCATION =
1695             new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
1696
1697     /**
1698      * <p>GPS coordinates to include in output JPEG
1699      * EXIF.</p>
1700      * <p><b>Range of valid values:</b><br>
1701      * (-180 - 180], [-90,90], [-inf, inf]</p>
1702      * <p>This key is available on all devices.</p>
1703      * @hide
1704      */
1705     public static final Key<double[]> JPEG_GPS_COORDINATES =
1706             new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
1707
1708     /**
1709      * <p>32 characters describing GPS algorithm to
1710      * include in EXIF.</p>
1711      * <p><b>Units</b>: UTF-8 null-terminated string</p>
1712      * <p>This key is available on all devices.</p>
1713      * @hide
1714      */
1715     public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
1716             new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
1717
1718     /**
1719      * <p>Time GPS fix was made to include in
1720      * EXIF.</p>
1721      * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
1722      * <p>This key is available on all devices.</p>
1723      * @hide
1724      */
1725     public static final Key<Long> JPEG_GPS_TIMESTAMP =
1726             new Key<Long>("android.jpeg.gpsTimestamp", long.class);
1727
1728     /**
1729      * <p>The orientation for a JPEG image.</p>
1730      * <p>The clockwise rotation angle in degrees, relative to the orientation
1731      * to the camera, that the JPEG picture needs to be rotated by, to be viewed
1732      * upright.</p>
1733      * <p>Camera devices may either encode this value into the JPEG EXIF header, or
1734      * rotate the image data to match this orientation. When the image data is rotated,
1735      * the thumbnail data will also be rotated.</p>
1736      * <p>Note that this orientation is relative to the orientation of the camera sensor, given
1737      * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
1738      * <p>To translate from the device orientation given by the Android sensor APIs, the following
1739      * sample code may be used:</p>
1740      * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
1741      *     if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
1742      *     int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
1743      *
1744      *     // Round device orientation to a multiple of 90
1745      *     deviceOrientation = (deviceOrientation + 45) / 90 * 90;
1746      *
1747      *     // Reverse device orientation for front-facing cameras
1748      *     boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
1749      *     if (facingFront) deviceOrientation = -deviceOrientation;
1750      *
1751      *     // Calculate desired JPEG orientation relative to camera orientation to make
1752      *     // the image upright relative to the device orientation
1753      *     int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
1754      *
1755      *     return jpegOrientation;
1756      * }
1757      * </code></pre>
1758      * <p><b>Units</b>: Degrees in multiples of 90</p>
1759      * <p><b>Range of valid values:</b><br>
1760      * 0, 90, 180, 270</p>
1761      * <p>This key is available on all devices.</p>
1762      *
1763      * @see CameraCharacteristics#SENSOR_ORIENTATION
1764      */
1765     @PublicKey
1766     public static final Key<Integer> JPEG_ORIENTATION =
1767             new Key<Integer>("android.jpeg.orientation", int.class);
1768
1769     /**
1770      * <p>Compression quality of the final JPEG
1771      * image.</p>
1772      * <p>85-95 is typical usage range.</p>
1773      * <p><b>Range of valid values:</b><br>
1774      * 1-100; larger is higher quality</p>
1775      * <p>This key is available on all devices.</p>
1776      */
1777     @PublicKey
1778     public static final Key<Byte> JPEG_QUALITY =
1779             new Key<Byte>("android.jpeg.quality", byte.class);
1780
1781     /**
1782      * <p>Compression quality of JPEG
1783      * thumbnail.</p>
1784      * <p><b>Range of valid values:</b><br>
1785      * 1-100; larger is higher quality</p>
1786      * <p>This key is available on all devices.</p>
1787      */
1788     @PublicKey
1789     public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
1790             new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
1791
1792     /**
1793      * <p>Resolution of embedded JPEG thumbnail.</p>
1794      * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
1795      * but the captured JPEG will still be a valid image.</p>
1796      * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
1797      * should have the same aspect ratio as the main JPEG output.</p>
1798      * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
1799      * ratio, the camera device creates the thumbnail by cropping it from the primary image.
1800      * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
1801      * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
1802      * generate the thumbnail image. The thumbnail image will always have a smaller Field
1803      * Of View (FOV) than the primary image when aspect ratios differ.</p>
1804      * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested,
1805      * the camera device will handle thumbnail rotation in one of the following ways:</p>
1806      * <ul>
1807      * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
1808      *   and keep jpeg and thumbnail image data unrotated.</li>
1809      * <li>Rotate the jpeg and thumbnail image data and not set
1810      *   {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
1811      *   case, LIMITED or FULL hardware level devices will report rotated thumnail size in
1812      *   capture result, so the width and height will be interchanged if 90 or 270 degree
1813      *   orientation is requested. LEGACY device will always report unrotated thumbnail
1814      *   size.</li>
1815      * </ul>
1816      * <p><b>Range of valid values:</b><br>
1817      * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
1818      * <p>This key is available on all devices.</p>
1819      *
1820      * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
1821      * @see CaptureRequest#JPEG_ORIENTATION
1822      */
1823     @PublicKey
1824     public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
1825             new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
1826
1827     /**
1828      * <p>The desired lens aperture size, as a ratio of lens focal length to the
1829      * effective aperture diameter.</p>
1830      * <p>Setting this value is only supported on the camera devices that have a variable
1831      * aperture lens.</p>
1832      * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1833      * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
1834      * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
1835      * to achieve manual exposure control.</p>
1836      * <p>The requested aperture value may take several frames to reach the
1837      * requested value; the camera device will report the current (intermediate)
1838      * aperture size in capture result metadata while the aperture is changing.
1839      * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
1840      * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1841      * the ON modes, this will be overridden by the camera device
1842      * auto-exposure algorithm, the overridden values are then provided
1843      * back to the user in the corresponding result.</p>
1844      * <p><b>Units</b>: The f-number (f/N)</p>
1845      * <p><b>Range of valid values:</b><br>
1846      * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
1847      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1848      * <p><b>Full capability</b> -
1849      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1850      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1851      *
1852      * @see CaptureRequest#CONTROL_AE_MODE
1853      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1854      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1855      * @see CaptureResult#LENS_STATE
1856      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1857      * @see CaptureRequest#SENSOR_FRAME_DURATION
1858      * @see CaptureRequest#SENSOR_SENSITIVITY
1859      */
1860     @PublicKey
1861     public static final Key<Float> LENS_APERTURE =
1862             new Key<Float>("android.lens.aperture", float.class);
1863
1864     /**
1865      * <p>The desired setting for the lens neutral density filter(s).</p>
1866      * <p>This control will not be supported on most camera devices.</p>
1867      * <p>Lens filters are typically used to lower the amount of light the
1868      * sensor is exposed to (measured in steps of EV). As used here, an EV
1869      * step is the standard logarithmic representation, which are
1870      * non-negative, and inversely proportional to the amount of light
1871      * hitting the sensor.  For example, setting this to 0 would result
1872      * in no reduction of the incoming light, and setting this to 2 would
1873      * mean that the filter is set to reduce incoming light by two stops
1874      * (allowing 1/4 of the prior amount of light to the sensor).</p>
1875      * <p>It may take several frames before the lens filter density changes
1876      * to the requested value. While the filter density is still changing,
1877      * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
1878      * <p><b>Units</b>: Exposure Value (EV)</p>
1879      * <p><b>Range of valid values:</b><br>
1880      * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
1881      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1882      * <p><b>Full capability</b> -
1883      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1884      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1885      *
1886      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1887      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1888      * @see CaptureResult#LENS_STATE
1889      */
1890     @PublicKey
1891     public static final Key<Float> LENS_FILTER_DENSITY =
1892             new Key<Float>("android.lens.filterDensity", float.class);
1893
1894     /**
1895      * <p>The desired lens focal length; used for optical zoom.</p>
1896      * <p>This setting controls the physical focal length of the camera
1897      * device's lens. Changing the focal length changes the field of
1898      * view of the camera device, and is usually used for optical zoom.</p>
1899      * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1900      * setting won't be applied instantaneously, and it may take several
1901      * frames before the lens can change to the requested focal length.
1902      * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1903      * be set to MOVING.</p>
1904      * <p>Optical zoom will not be supported on most devices.</p>
1905      * <p><b>Units</b>: Millimeters</p>
1906      * <p><b>Range of valid values:</b><br>
1907      * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
1908      * <p>This key is available on all devices.</p>
1909      *
1910      * @see CaptureRequest#LENS_APERTURE
1911      * @see CaptureRequest#LENS_FOCUS_DISTANCE
1912      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
1913      * @see CaptureResult#LENS_STATE
1914      */
1915     @PublicKey
1916     public static final Key<Float> LENS_FOCAL_LENGTH =
1917             new Key<Float>("android.lens.focalLength", float.class);
1918
1919     /**
1920      * <p>Desired distance to plane of sharpest focus,
1921      * measured from frontmost surface of the lens.</p>
1922      * <p>This control can be used for setting manual focus, on devices that support
1923      * the MANUAL_SENSOR capability and have a variable-focus lens (see
1924      * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}).</p>
1925      * <p>A value of <code>0.0f</code> means infinity focus. The value set will be clamped to
1926      * <code>[0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>.</p>
1927      * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied
1928      * instantaneously, and it may take several frames before the lens
1929      * can move to the requested focus distance. While the lens is still moving,
1930      * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
1931      * <p>LEGACY devices support at most setting this to <code>0.0f</code>
1932      * for infinity focus.</p>
1933      * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1934      * <p><b>Range of valid values:</b><br>
1935      * &gt;= 0</p>
1936      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1937      * <p><b>Full capability</b> -
1938      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1939      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1940      *
1941      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1942      * @see CaptureRequest#LENS_FOCAL_LENGTH
1943      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
1944      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1945      * @see CaptureResult#LENS_STATE
1946      */
1947     @PublicKey
1948     public static final Key<Float> LENS_FOCUS_DISTANCE =
1949             new Key<Float>("android.lens.focusDistance", float.class);
1950
1951     /**
1952      * <p>Sets whether the camera device uses optical image stabilization (OIS)
1953      * when capturing images.</p>
1954      * <p>OIS is used to compensate for motion blur due to small
1955      * movements of the camera during capture. Unlike digital image
1956      * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
1957      * makes use of mechanical elements to stabilize the camera
1958      * sensor, and thus allows for longer exposure times before
1959      * camera shake becomes apparent.</p>
1960      * <p>Switching between different optical stabilization modes may take several
1961      * frames to initialize, the camera device will report the current mode in
1962      * capture result metadata. For example, When "ON" mode is requested, the
1963      * optical stabilization modes in the first several capture results may still
1964      * be "OFF", and it will become "ON" when the initialization is done.</p>
1965      * <p>If a camera device supports both OIS and digital image stabilization
1966      * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
1967      * interaction, so it is recommended not to enable both at the same time.</p>
1968      * <p>Not all devices will support OIS; see
1969      * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
1970      * available controls.</p>
1971      * <p><b>Possible values:</b>
1972      * <ul>
1973      *   <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
1974      *   <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
1975      * </ul></p>
1976      * <p><b>Available values for this device:</b><br>
1977      * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
1978      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1979      * <p><b>Limited capability</b> -
1980      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1981      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1982      *
1983      * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
1984      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1985      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
1986      * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
1987      * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
1988      */
1989     @PublicKey
1990     public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
1991             new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
1992
1993     /**
1994      * <p>Mode of operation for the noise reduction algorithm.</p>
1995      * <p>The noise reduction algorithm attempts to improve image quality by removing
1996      * excessive noise added by the capture process, especially in dark conditions.</p>
1997      * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
1998      * YUV domain.</p>
1999      * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
2000      * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
2001      * This mode is optional, may not be support by all devices. The application should check
2002      * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
2003      * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2004      * will be applied. HIGH_QUALITY mode indicates that the camera device
2005      * will use the highest-quality noise filtering algorithms,
2006      * even if it slows down capture rate. FAST means the camera device will not
2007      * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
2008      * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
2009      * Every output stream will have a similar amount of enhancement applied.</p>
2010      * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2011      * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2012      * into a final capture when triggered by the user. In this mode, the camera device applies
2013      * noise reduction to low-resolution streams (below maximum recording resolution) to maximize
2014      * preview quality, but does not apply noise reduction to high-resolution streams, since
2015      * those will be reprocessed later if necessary.</p>
2016      * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
2017      * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
2018      * may adjust the noise reduction parameters for best image quality based on the
2019      * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
2020      * <p><b>Possible values:</b>
2021      * <ul>
2022      *   <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2023      *   <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2024      *   <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2025      *   <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
2026      *   <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
2027      * </ul></p>
2028      * <p><b>Available values for this device:</b><br>
2029      * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
2030      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2031      * <p><b>Full capability</b> -
2032      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2033      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2034      *
2035      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2036      * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
2037      * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
2038      * @see #NOISE_REDUCTION_MODE_OFF
2039      * @see #NOISE_REDUCTION_MODE_FAST
2040      * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
2041      * @see #NOISE_REDUCTION_MODE_MINIMAL
2042      * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
2043      */
2044     @PublicKey
2045     public static final Key<Integer> NOISE_REDUCTION_MODE =
2046             new Key<Integer>("android.noiseReduction.mode", int.class);
2047
2048     /**
2049      * <p>An application-specified ID for the current
2050      * request. Must be maintained unchanged in output
2051      * frame</p>
2052      * <p><b>Units</b>: arbitrary integer assigned by application</p>
2053      * <p><b>Range of valid values:</b><br>
2054      * Any int</p>
2055      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2056      * @hide
2057      */
2058     public static final Key<Integer> REQUEST_ID =
2059             new Key<Integer>("android.request.id", int.class);
2060
2061     /**
2062      * <p>The desired region of the sensor to read out for this capture.</p>
2063      * <p>This control can be used to implement digital zoom.</p>
2064      * <p>The crop region coordinate system is based off
2065      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2066      * top-left corner of the sensor active array.</p>
2067      * <p>Output streams use this rectangle to produce their output,
2068      * cropping to a smaller region if necessary to maintain the
2069      * stream's aspect ratio, then scaling the sensor input to
2070      * match the output's configured resolution.</p>
2071      * <p>The crop region is applied after the RAW to other color
2072      * space (e.g. YUV) conversion. Since raw streams
2073      * (e.g. RAW16) don't have the conversion stage, they are not
2074      * croppable. The crop region will be ignored by raw streams.</p>
2075      * <p>For non-raw streams, any additional per-stream cropping will
2076      * be done to maximize the final pixel area of the stream.</p>
2077      * <p>For example, if the crop region is set to a 4:3 aspect
2078      * ratio, then 4:3 streams will use the exact crop
2079      * region. 16:9 streams will further crop vertically
2080      * (letterbox).</p>
2081      * <p>Conversely, if the crop region is set to a 16:9, then 4:3
2082      * outputs will crop horizontally (pillarbox), and 16:9
2083      * streams will match exactly. These additional crops will
2084      * be centered within the crop region.</p>
2085      * <p>The width and height of the crop region cannot
2086      * be set to be smaller than
2087      * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2088      * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2089      * <p>The camera device may adjust the crop region to account
2090      * for rounding and other hardware requirements; the final
2091      * crop region used will be included in the output capture
2092      * result.</p>
2093      * <p><b>Units</b>: Pixel coordinates relative to
2094      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
2095      * <p>This key is available on all devices.</p>
2096      *
2097      * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
2098      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2099      */
2100     @PublicKey
2101     public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2102             new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2103
2104     /**
2105      * <p>Duration each pixel is exposed to
2106      * light.</p>
2107      * <p>If the sensor can't expose this exact duration, it will shorten the
2108      * duration exposed to the nearest possible value (rather than expose longer).
2109      * The final exposure time used will be available in the output capture result.</p>
2110      * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to
2111      * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2112      * <p><b>Units</b>: Nanoseconds</p>
2113      * <p><b>Range of valid values:</b><br>
2114      * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
2115      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2116      * <p><b>Full capability</b> -
2117      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2118      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2119      *
2120      * @see CaptureRequest#CONTROL_AE_MODE
2121      * @see CaptureRequest#CONTROL_MODE
2122      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2123      * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
2124      */
2125     @PublicKey
2126     public static final Key<Long> SENSOR_EXPOSURE_TIME =
2127             new Key<Long>("android.sensor.exposureTime", long.class);
2128
2129     /**
2130      * <p>Duration from start of frame exposure to
2131      * start of next frame exposure.</p>
2132      * <p>The maximum frame rate that can be supported by a camera subsystem is
2133      * a function of many factors:</p>
2134      * <ul>
2135      * <li>Requested resolutions of output image streams</li>
2136      * <li>Availability of binning / skipping modes on the imager</li>
2137      * <li>The bandwidth of the imager interface</li>
2138      * <li>The bandwidth of the various ISP processing blocks</li>
2139      * </ul>
2140      * <p>Since these factors can vary greatly between different ISPs and
2141      * sensors, the camera abstraction tries to represent the bandwidth
2142      * restrictions with as simple a model as possible.</p>
2143      * <p>The model presented has the following characteristics:</p>
2144      * <ul>
2145      * <li>The image sensor is always configured to output the smallest
2146      * resolution possible given the application's requested output stream
2147      * sizes.  The smallest resolution is defined as being at least as large
2148      * as the largest requested output stream size; the camera pipeline must
2149      * never digitally upsample sensor data when the crop region covers the
2150      * whole sensor. In general, this means that if only small output stream
2151      * resolutions are configured, the sensor can provide a higher frame
2152      * rate.</li>
2153      * <li>Since any request may use any or all the currently configured
2154      * output streams, the sensor and ISP must be configured to support
2155      * scaling a single capture to all the streams at the same time.  This
2156      * means the camera pipeline must be ready to produce the largest
2157      * requested output size without any delay.  Therefore, the overall
2158      * frame rate of a given configured stream set is governed only by the
2159      * largest requested stream resolution.</li>
2160      * <li>Using more than one output stream in a request does not affect the
2161      * frame duration.</li>
2162      * <li>Certain format-streams may need to do additional background processing
2163      * before data is consumed/produced by that stream. These processors
2164      * can run concurrently to the rest of the camera pipeline, but
2165      * cannot process more than 1 capture at a time.</li>
2166      * </ul>
2167      * <p>The necessary information for the application, given the model above,
2168      * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field using
2169      * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
2170      * These are used to determine the maximum frame rate / minimum frame
2171      * duration that is possible for a given stream configuration.</p>
2172      * <p>Specifically, the application can use the following rules to
2173      * determine the minimum frame duration it can request from the camera
2174      * device:</p>
2175      * <ol>
2176      * <li>Let the set of currently configured input/output streams
2177      * be called <code>S</code>.</li>
2178      * <li>Find the minimum frame durations for each stream in <code>S</code>, by looking
2179      * it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
2180      * (with its respective size/format). Let this set of frame durations be
2181      * called <code>F</code>.</li>
2182      * <li>For any given request <code>R</code>, the minimum frame duration allowed
2183      * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2184      * used in <code>R</code> be called <code>S_r</code>.</li>
2185      * </ol>
2186      * <p>If none of the streams in <code>S_r</code> have a stall time (listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }
2187      * using its respective size/format), then the frame duration in <code>F</code>
2188      * determines the steady state frame rate that the application will get
2189      * if it uses <code>R</code> as a repeating request. Let this special kind of
2190      * request be called <code>Rsimple</code>.</p>
2191      * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2192      * by a single capture of a new request <code>Rstall</code> (which has at least
2193      * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2194      * same minimum frame duration this will not cause a frame rate loss
2195      * if all buffers from the previous <code>Rstall</code> have already been
2196      * delivered.</p>
2197      * <p>For more details about stalling, see
2198      * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
2199      * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to
2200      * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2201      * <p><b>Units</b>: Nanoseconds</p>
2202      * <p><b>Range of valid values:</b><br>
2203      * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
2204      * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
2205      * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
2206      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2207      * <p><b>Full capability</b> -
2208      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2209      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2210      *
2211      * @see CaptureRequest#CONTROL_AE_MODE
2212      * @see CaptureRequest#CONTROL_MODE
2213      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2214      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
2215      * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
2216      */
2217     @PublicKey
2218     public static final Key<Long> SENSOR_FRAME_DURATION =
2219             new Key<Long>("android.sensor.frameDuration", long.class);
2220
2221     /**
2222      * <p>The amount of gain applied to sensor data
2223      * before processing.</p>
2224      * <p>The sensitivity is the standard ISO sensitivity value,
2225      * as defined in ISO 12232:2006.</p>
2226      * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2227      * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2228      * is guaranteed to use only analog amplification for applying the gain.</p>
2229      * <p>If the camera device cannot apply the exact sensitivity
2230      * requested, it will reduce the gain to the nearest supported
2231      * value. The final sensitivity used will be available in the
2232      * output capture result.</p>
2233      * <p><b>Units</b>: ISO arithmetic units</p>
2234      * <p><b>Range of valid values:</b><br>
2235      * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
2236      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2237      * <p><b>Full capability</b> -
2238      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2239      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2240      *
2241      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2242      * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2243      * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
2244      */
2245     @PublicKey
2246     public static final Key<Integer> SENSOR_SENSITIVITY =
2247             new Key<Integer>("android.sensor.sensitivity", int.class);
2248
2249     /**
2250      * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2251      * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2252      * <p>Each color channel is treated as an unsigned 32-bit integer.
2253      * The camera device then uses the most significant X bits
2254      * that correspond to how many bits are in its Bayer raw sensor
2255      * output.</p>
2256      * <p>For example, a sensor with RAW10 Bayer output would use the
2257      * 10 most significant bits from each color channel.</p>
2258      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2259      *
2260      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2261      */
2262     @PublicKey
2263     public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2264             new Key<int[]>("android.sensor.testPatternData", int[].class);
2265
2266     /**
2267      * <p>When enabled, the sensor sends a test pattern instead of
2268      * doing a real exposure from the camera.</p>
2269      * <p>When a test pattern is enabled, all manual sensor controls specified
2270      * by android.sensor.* will be ignored. All other controls should
2271      * work as normal.</p>
2272      * <p>For example, if manual flash is enabled, flash firing should still
2273      * occur (and that the test pattern remain unmodified, since the flash
2274      * would not actually affect it).</p>
2275      * <p>Defaults to OFF.</p>
2276      * <p><b>Possible values:</b>
2277      * <ul>
2278      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
2279      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
2280      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
2281      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
2282      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
2283      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
2284      * </ul></p>
2285      * <p><b>Available values for this device:</b><br>
2286      * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
2287      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2288      *
2289      * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
2290      * @see #SENSOR_TEST_PATTERN_MODE_OFF
2291      * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2292      * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2293      * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2294      * @see #SENSOR_TEST_PATTERN_MODE_PN9
2295      * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2296      */
2297     @PublicKey
2298     public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2299             new Key<Integer>("android.sensor.testPatternMode", int.class);
2300
2301     /**
2302      * <p>Quality of lens shading correction applied
2303      * to the image data.</p>
2304      * <p>When set to OFF mode, no lens shading correction will be applied by the
2305      * camera device, and an identity lens shading map data will be provided
2306      * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
2307      * shading map with size of <code>[ 4, 3 ]</code>,
2308      * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
2309      * map shown below:</p>
2310      * <pre><code>[ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2311      *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2312      *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2313      *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2314      *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2315      *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0 ]
2316      * </code></pre>
2317      * <p>When set to other modes, lens shading correction will be applied by the camera
2318      * device. Applications can request lens shading map data by setting
2319      * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
2320      * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
2321      * data will be the one applied by the camera device for this capture request.</p>
2322      * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
2323      * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
2324      * AWB are in AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code>
2325      * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
2326      * to be converged before using the returned shading map data.</p>
2327      * <p><b>Possible values:</b>
2328      * <ul>
2329      *   <li>{@link #SHADING_MODE_OFF OFF}</li>
2330      *   <li>{@link #SHADING_MODE_FAST FAST}</li>
2331      *   <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2332      * </ul></p>
2333      * <p><b>Available values for this device:</b><br>
2334      * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
2335      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2336      * <p><b>Full capability</b> -
2337      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2338      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2339      *
2340      * @see CaptureRequest#CONTROL_AE_MODE
2341      * @see CaptureRequest#CONTROL_AWB_MODE
2342      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2343      * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
2344      * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
2345      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2346      * @see #SHADING_MODE_OFF
2347      * @see #SHADING_MODE_FAST
2348      * @see #SHADING_MODE_HIGH_QUALITY
2349      */
2350     @PublicKey
2351     public static final Key<Integer> SHADING_MODE =
2352             new Key<Integer>("android.shading.mode", int.class);
2353
2354     /**
2355      * <p>Operating mode for the face detector
2356      * unit.</p>
2357      * <p>Whether face detection is enabled, and whether it
2358      * should output just the basic fields or the full set of
2359      * fields.</p>
2360      * <p><b>Possible values:</b>
2361      * <ul>
2362      *   <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
2363      *   <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
2364      *   <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
2365      * </ul></p>
2366      * <p><b>Available values for this device:</b><br>
2367      * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
2368      * <p>This key is available on all devices.</p>
2369      *
2370      * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
2371      * @see #STATISTICS_FACE_DETECT_MODE_OFF
2372      * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2373      * @see #STATISTICS_FACE_DETECT_MODE_FULL
2374      */
2375     @PublicKey
2376     public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2377             new Key<Integer>("android.statistics.faceDetectMode", int.class);
2378
2379     /**
2380      * <p>Operating mode for hot pixel map generation.</p>
2381      * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
2382      * If set to <code>false</code>, no hot pixel map will be returned.</p>
2383      * <p><b>Range of valid values:</b><br>
2384      * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
2385      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2386      *
2387      * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2388      * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2389      */
2390     @PublicKey
2391     public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2392             new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2393
2394     /**
2395      * <p>Whether the camera device will output the lens
2396      * shading map in output result metadata.</p>
2397      * <p>When set to ON,
2398      * android.statistics.lensShadingMap will be provided in
2399      * the output result metadata.</p>
2400      * <p>ON is always supported on devices with the RAW capability.</p>
2401      * <p><b>Possible values:</b>
2402      * <ul>
2403      *   <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
2404      *   <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
2405      * </ul></p>
2406      * <p><b>Available values for this device:</b><br>
2407      * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
2408      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2409      * <p><b>Full capability</b> -
2410      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2411      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2412      *
2413      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2414      * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
2415      * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2416      * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2417      */
2418     @PublicKey
2419     public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2420             new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2421
2422     /**
2423      * <p>Tonemapping / contrast / gamma curve for the blue
2424      * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2425      * CONTRAST_CURVE.</p>
2426      * <p>See android.tonemap.curveRed for more details.</p>
2427      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2428      * <p><b>Full capability</b> -
2429      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2430      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2431      *
2432      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2433      * @see CaptureRequest#TONEMAP_MODE
2434      * @hide
2435      */
2436     public static final Key<float[]> TONEMAP_CURVE_BLUE =
2437             new Key<float[]>("android.tonemap.curveBlue", float[].class);
2438
2439     /**
2440      * <p>Tonemapping / contrast / gamma curve for the green
2441      * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2442      * CONTRAST_CURVE.</p>
2443      * <p>See android.tonemap.curveRed for more details.</p>
2444      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2445      * <p><b>Full capability</b> -
2446      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2447      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2448      *
2449      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2450      * @see CaptureRequest#TONEMAP_MODE
2451      * @hide
2452      */
2453     public static final Key<float[]> TONEMAP_CURVE_GREEN =
2454             new Key<float[]>("android.tonemap.curveGreen", float[].class);
2455
2456     /**
2457      * <p>Tonemapping / contrast / gamma curve for the red
2458      * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2459      * CONTRAST_CURVE.</p>
2460      * <p>Each channel's curve is defined by an array of control points:</p>
2461      * <pre><code>android.tonemap.curveRed =
2462      *   [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
2463      * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
2464      * <p>These are sorted in order of increasing <code>Pin</code>; it is
2465      * required that input values 0.0 and 1.0 are included in the list to
2466      * define a complete mapping. For input values between control points,
2467      * the camera device must linearly interpolate between the control
2468      * points.</p>
2469      * <p>Each curve can have an independent number of points, and the number
2470      * of points can be less than max (that is, the request doesn't have to
2471      * always provide a curve with number of points equivalent to
2472      * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2473      * <p>A few examples, and their corresponding graphical mappings; these
2474      * only specify the red channel and the precision is limited to 4
2475      * digits, for conciseness.</p>
2476      * <p>Linear mapping:</p>
2477      * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
2478      * </code></pre>
2479      * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2480      * <p>Invert mapping:</p>
2481      * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
2482      * </code></pre>
2483      * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2484      * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2485      * <pre><code>android.tonemap.curveRed = [
2486      *   0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2487      *   0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2488      *   0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2489      *   0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
2490      * </code></pre>
2491      * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2492      * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2493      * <pre><code>android.tonemap.curveRed = [
2494      *   0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2495      *   0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2496      *   0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2497      *   0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
2498      * </code></pre>
2499      * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
2500      * <p><b>Range of valid values:</b><br>
2501      * 0-1 on both input and output coordinates, normalized
2502      * as a floating-point value such that 0 == black and 1 == white.</p>
2503      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2504      * <p><b>Full capability</b> -
2505      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2506      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2507      *
2508      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2509      * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
2510      * @see CaptureRequest#TONEMAP_MODE
2511      * @hide
2512      */
2513     public static final Key<float[]> TONEMAP_CURVE_RED =
2514             new Key<float[]>("android.tonemap.curveRed", float[].class);
2515
2516     /**
2517      * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
2518      * is CONTRAST_CURVE.</p>
2519      * <p>The tonemapCurve consist of three curves for each of red, green, and blue
2520      * channels respectively. The following example uses the red channel as an
2521      * example. The same logic applies to green and blue channel.
2522      * Each channel's curve is defined by an array of control points:</p>
2523      * <pre><code>curveRed =
2524      *   [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
2525      * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
2526      * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2527      * guaranteed that input values 0.0 and 1.0 are included in the list to
2528      * define a complete mapping. For input values between control points,
2529      * the camera device must linearly interpolate between the control
2530      * points.</p>
2531      * <p>Each curve can have an independent number of points, and the number
2532      * of points can be less than max (that is, the request doesn't have to
2533      * always provide a curve with number of points equivalent to
2534      * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2535      * <p>A few examples, and their corresponding graphical mappings; these
2536      * only specify the red channel and the precision is limited to 4
2537      * digits, for conciseness.</p>
2538      * <p>Linear mapping:</p>
2539      * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
2540      * </code></pre>
2541      * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2542      * <p>Invert mapping:</p>
2543      * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
2544      * </code></pre>
2545      * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2546      * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2547      * <pre><code>curveRed = [
2548      *   (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
2549      *   (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
2550      *   (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
2551      *   (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
2552      * </code></pre>
2553      * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2554      * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2555      * <pre><code>curveRed = [
2556      *   (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
2557      *   (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
2558      *   (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
2559      *   (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
2560      * </code></pre>
2561      * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
2562      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2563      * <p><b>Full capability</b> -
2564      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2565      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2566      *
2567      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2568      * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
2569      * @see CaptureRequest#TONEMAP_MODE
2570      */
2571     @PublicKey
2572     @SyntheticKey
2573     public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
2574             new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
2575
2576     /**
2577      * <p>High-level global contrast/gamma/tonemapping control.</p>
2578      * <p>When switching to an application-defined contrast curve by setting
2579      * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2580      * per-channel with a set of <code>(in, out)</code> points that specify the
2581      * mapping from input high-bit-depth pixel value to the output
2582      * low-bit-depth value.  Since the actual pixel ranges of both input
2583      * and output may change depending on the camera pipeline, the values
2584      * are specified by normalized floating-point numbers.</p>
2585      * <p>More-complex color mapping operations such as 3D color look-up
2586      * tables, selective chroma enhancement, or other non-linear color
2587      * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2588      * CONTRAST_CURVE.</p>
2589      * <p>When using either FAST or HIGH_QUALITY, the camera device will
2590      * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
2591      * These values are always available, and as close as possible to the
2592      * actually used nonlinear/nonglobal transforms.</p>
2593      * <p>If a request is sent with CONTRAST_CURVE with the camera device's
2594      * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2595      * roughly the same.</p>
2596      * <p><b>Possible values:</b>
2597      * <ul>
2598      *   <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
2599      *   <li>{@link #TONEMAP_MODE_FAST FAST}</li>
2600      *   <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2601      *   <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
2602      *   <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
2603      * </ul></p>
2604      * <p><b>Available values for this device:</b><br>
2605      * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
2606      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2607      * <p><b>Full capability</b> -
2608      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2609      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2610      *
2611      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2612      * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
2613      * @see CaptureRequest#TONEMAP_CURVE
2614      * @see CaptureRequest#TONEMAP_MODE
2615      * @see #TONEMAP_MODE_CONTRAST_CURVE
2616      * @see #TONEMAP_MODE_FAST
2617      * @see #TONEMAP_MODE_HIGH_QUALITY
2618      * @see #TONEMAP_MODE_GAMMA_VALUE
2619      * @see #TONEMAP_MODE_PRESET_CURVE
2620      */
2621     @PublicKey
2622     public static final Key<Integer> TONEMAP_MODE =
2623             new Key<Integer>("android.tonemap.mode", int.class);
2624
2625     /**
2626      * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2627      * GAMMA_VALUE</p>
2628      * <p>The tonemap curve will be defined the following formula:
2629      * * OUT = pow(IN, 1.0 / gamma)
2630      * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
2631      * pow is the power function and gamma is the gamma value specified by this
2632      * key.</p>
2633      * <p>The same curve will be applied to all color channels. The camera device
2634      * may clip the input gamma value to its supported range. The actual applied
2635      * value will be returned in capture result.</p>
2636      * <p>The valid range of gamma value varies on different devices, but values
2637      * within [1.0, 5.0] are guaranteed not to be clipped.</p>
2638      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2639      *
2640      * @see CaptureRequest#TONEMAP_MODE
2641      */
2642     @PublicKey
2643     public static final Key<Float> TONEMAP_GAMMA =
2644             new Key<Float>("android.tonemap.gamma", float.class);
2645
2646     /**
2647      * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2648      * PRESET_CURVE</p>
2649      * <p>The tonemap curve will be defined by specified standard.</p>
2650      * <p>sRGB (approximated by 16 control points):</p>
2651      * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
2652      * <p>Rec. 709 (approximated by 16 control points):</p>
2653      * <p><img alt="Rec. 709 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p>
2654      * <p>Note that above figures show a 16 control points approximation of preset
2655      * curves. Camera devices may apply a different approximation to the curve.</p>
2656      * <p><b>Possible values:</b>
2657      * <ul>
2658      *   <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
2659      *   <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
2660      * </ul></p>
2661      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2662      *
2663      * @see CaptureRequest#TONEMAP_MODE
2664      * @see #TONEMAP_PRESET_CURVE_SRGB
2665      * @see #TONEMAP_PRESET_CURVE_REC709
2666      */
2667     @PublicKey
2668     public static final Key<Integer> TONEMAP_PRESET_CURVE =
2669             new Key<Integer>("android.tonemap.presetCurve", int.class);
2670
2671     /**
2672      * <p>This LED is nominally used to indicate to the user
2673      * that the camera is powered on and may be streaming images back to the
2674      * Application Processor. In certain rare circumstances, the OS may
2675      * disable this when video is processed locally and not transmitted to
2676      * any untrusted applications.</p>
2677      * <p>In particular, the LED <em>must</em> always be on when the data could be
2678      * transmitted off the device. The LED <em>should</em> always be on whenever
2679      * data is stored locally on the device.</p>
2680      * <p>The LED <em>may</em> be off if a trusted application is using the data that
2681      * doesn't violate the above rules.</p>
2682      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2683      * @hide
2684      */
2685     public static final Key<Boolean> LED_TRANSMIT =
2686             new Key<Boolean>("android.led.transmit", boolean.class);
2687
2688     /**
2689      * <p>Whether black-level compensation is locked
2690      * to its current values, or is free to vary.</p>
2691      * <p>When set to <code>true</code> (ON), the values used for black-level
2692      * compensation will not change until the lock is set to
2693      * <code>false</code> (OFF).</p>
2694      * <p>Since changes to certain capture parameters (such as
2695      * exposure time) may require resetting of black level
2696      * compensation, the camera device must report whether setting
2697      * the black level lock was successful in the output result
2698      * metadata.</p>
2699      * <p>For example, if a sequence of requests is as follows:</p>
2700      * <ul>
2701      * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li>
2702      * <li>Request 2: Exposure = 10ms, Black level lock = ON</li>
2703      * <li>Request 3: Exposure = 10ms, Black level lock = ON</li>
2704      * <li>Request 4: Exposure = 20ms, Black level lock = ON</li>
2705      * <li>Request 5: Exposure = 20ms, Black level lock = ON</li>
2706      * <li>Request 6: Exposure = 20ms, Black level lock = ON</li>
2707      * </ul>
2708      * <p>And the exposure change in Request 4 requires the camera
2709      * device to reset the black level offsets, then the output
2710      * result metadata is expected to be:</p>
2711      * <ul>
2712      * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li>
2713      * <li>Result 2: Exposure = 10ms, Black level lock = ON</li>
2714      * <li>Result 3: Exposure = 10ms, Black level lock = ON</li>
2715      * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li>
2716      * <li>Result 5: Exposure = 20ms, Black level lock = ON</li>
2717      * <li>Result 6: Exposure = 20ms, Black level lock = ON</li>
2718      * </ul>
2719      * <p>This indicates to the application that on frame 4, black
2720      * levels were reset due to exposure value changes, and pixel
2721      * values may not be consistent across captures.</p>
2722      * <p>The camera device will maintain the lock to the extent
2723      * possible, only overriding the lock to OFF when changes to
2724      * other request parameters require a black level recalculation
2725      * or reset.</p>
2726      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2727      * <p><b>Full capability</b> -
2728      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2729      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2730      *
2731      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2732      */
2733     @PublicKey
2734     public static final Key<Boolean> BLACK_LEVEL_LOCK =
2735             new Key<Boolean>("android.blackLevel.lock", boolean.class);
2736
2737     /**
2738      * <p>The amount of exposure time increase factor applied to the original output
2739      * frame by the application processing before sending for reprocessing.</p>
2740      * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
2741      * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
2742      * <p>For some YUV reprocessing use cases, the application may choose to filter the original
2743      * output frames to effectively reduce the noise to the same level as a frame that was
2744      * captured with longer exposure time. To be more specific, assuming the original captured
2745      * images were captured with a sensitivity of S and an exposure time of T, the model in
2746      * the camera device is that the amount of noise in the image would be approximately what
2747      * would be expected if the original capture parameters had been a sensitivity of
2748      * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
2749      * than S and T respectively. If the captured images were processed by the application
2750      * before being sent for reprocessing, then the application may have used image processing
2751      * algorithms and/or multi-frame image fusion to reduce the noise in the
2752      * application-processed images (input images). By using the effectiveExposureFactor
2753      * control, the application can communicate to the camera device the actual noise level
2754      * improvement in the application-processed image. With this information, the camera
2755      * device can select appropriate noise reduction and edge enhancement parameters to avoid
2756      * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
2757      * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
2758      * <p>For example, for multi-frame image fusion use case, the application may fuse
2759      * multiple output frames together to a final frame for reprocessing. When N image are
2760      * fused into 1 image for reprocessing, the exposure time increase factor could be up to
2761      * square root of N (based on a simple photon shot noise model). The camera device will
2762      * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
2763      * produce the best quality images.</p>
2764      * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
2765      * buffer in a way that affects its effective exposure time.</p>
2766      * <p>This control is only effective for YUV reprocessing capture request. For noise
2767      * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
2768      * Similarly, for edge enhancement reprocessing, it is only effective when
2769      * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
2770      * <p><b>Units</b>: Relative exposure time increase factor.</p>
2771      * <p><b>Range of valid values:</b><br>
2772      * &gt;= 1.0</p>
2773      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2774      * <p><b>Limited capability</b> -
2775      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2776      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2777      *
2778      * @see CaptureRequest#EDGE_MODE
2779      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2780      * @see CaptureRequest#NOISE_REDUCTION_MODE
2781      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2782      */
2783     @PublicKey
2784     public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
2785             new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
2786
2787     /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2788      * End generated code
2789      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
2790
2791
2792
2793 }