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