blob: b54696741e2fca909fd27b67ab0463303e4b0f96 [file] [log] [blame]
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Eino-Ville Talvala2f1a2e42013-07-25 17:12:05 -070017package android.hardware.camera2;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080018
Eino-Ville Talvala8b905572015-05-14 15:43:01 -070019import android.annotation.NonNull;
20import android.annotation.Nullable;
Artur Satayev26958002019-12-10 17:47:52 +000021import android.compat.annotation.UnsupportedAppUsage;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070022import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkinbdf366c2014-07-25 16:54:20 -070023import android.hardware.camera2.impl.CaptureResultExtras;
Igor Murashkin6c76f582014-07-15 17:19:49 -070024import android.hardware.camera2.impl.PublicKey;
25import android.hardware.camera2.impl.SyntheticKey;
Igor Murashkind6d65152014-05-19 16:31:02 -070026import android.hardware.camera2.utils.TypeReference;
27import android.util.Log;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070028import android.util.Rational;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080029
Igor Murashkind6d65152014-05-19 16:31:02 -070030import java.util.List;
31
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080032/**
Igor Murashkindb075af2014-05-21 10:07:08 -070033 * <p>The subset of the results of a single image capture from the image sensor.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080034 *
Igor Murashkindb075af2014-05-21 10:07:08 -070035 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080036 * flash), the processing pipeline, the control algorithms, and the output
37 * buffers.</p>
38 *
39 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
40 * {@link CaptureRequest}. All properties listed for capture requests can also
41 * be queried on the capture result, to determine the final values used for
42 * capture. The result also includes additional metadata about the state of the
43 * camera device during the capture.</p>
44 *
Igor Murashkindb075af2014-05-21 10:07:08 -070045 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
46 * are necessarily available. Some results are {@link CaptureResult partial} and will
47 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
48 * every key available that was enabled by the request.</p>
49 *
50 * <p>{@link CaptureResult} objects are immutable.</p>
Ruben Brunkf967a542014-04-28 16:31:11 -070051 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080052 */
Igor Murashkindb075af2014-05-21 10:07:08 -070053public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
Igor Murashkind6d65152014-05-19 16:31:02 -070054
55 private static final String TAG = "CaptureResult";
56 private static final boolean VERBOSE = false;
57
58 /**
59 * A {@code Key} is used to do capture result field lookups with
60 * {@link CaptureResult#get}.
61 *
62 * <p>For example, to get the timestamp corresponding to the exposure of the first row:
63 * <code><pre>
64 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
65 * </pre></code>
66 * </p>
67 *
68 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
69 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
70 *
71 * @see CaptureResult#get
72 * @see CameraCharacteristics#getAvailableCaptureResultKeys
73 */
74 public final static class Key<T> {
75 private final CameraMetadataNative.Key<T> mKey;
76
77 /**
78 * Visible for testing and vendor extensions only.
79 *
80 * @hide
81 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +010082 @UnsupportedAppUsage
Emilian Peevde62d842017-03-23 19:20:40 +000083 public Key(String name, Class<T> type, long vendorId) {
84 mKey = new CameraMetadataNative.Key<T>(name, type, vendorId);
85 }
86
87 /**
88 * Visible for testing and vendor extensions only.
89 *
90 * @hide
91 */
David Brazdil67e37d62019-03-08 11:26:46 +000092 public Key(String name, String fallbackName, Class<T> type) {
Justin Yunf01e40c2018-05-18 20:39:45 +090093 mKey = new CameraMetadataNative.Key<T>(name, fallbackName, type);
94 }
95
96 /**
Eino-Ville Talvala1cf59fd2019-01-25 17:33:05 -080097 * Construct a new Key with a given name and type.
Justin Yunf01e40c2018-05-18 20:39:45 +090098 *
Eino-Ville Talvala1cf59fd2019-01-25 17:33:05 -080099 * <p>Normally, applications should use the existing Key definitions in
100 * {@link CaptureResult}, and not need to construct their own Key objects. However, they may
101 * be useful for testing purposes and for defining custom capture result fields.</p>
Justin Yunf01e40c2018-05-18 20:39:45 +0900102 */
Eino-Ville Talvala79d4aac2019-03-06 14:26:10 -0800103 public Key(@NonNull String name, @NonNull Class<T> type) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700104 mKey = new CameraMetadataNative.Key<T>(name, type);
105 }
106
107 /**
108 * Visible for testing and vendor extensions only.
109 *
110 * @hide
111 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100112 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700113 public Key(String name, TypeReference<T> typeReference) {
114 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
115 }
116
117 /**
118 * Return a camelCase, period separated name formatted like:
119 * {@code "root.section[.subsections].name"}.
120 *
121 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
122 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
123 *
124 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
125 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
126 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
127 *
128 * @return String representation of the key name
129 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700130 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700131 public String getName() {
132 return mKey.getName();
133 }
134
135 /**
Emilian Peevde62d842017-03-23 19:20:40 +0000136 * Return vendor tag id.
137 *
138 * @hide
139 */
140 public long getVendorId() {
141 return mKey.getVendorId();
142 }
143
144 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700145 * {@inheritDoc}
146 */
147 @Override
148 public final int hashCode() {
149 return mKey.hashCode();
150 }
151
152 /**
153 * {@inheritDoc}
154 */
155 @SuppressWarnings("unchecked")
156 @Override
157 public final boolean equals(Object o) {
158 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
159 }
160
161 /**
Chien-Yu Chen12a83852015-07-07 12:17:22 -0700162 * Return this {@link Key} as a string representation.
163 *
164 * <p>{@code "CaptureResult.Key(%s)"}, where {@code %s} represents
165 * the name of this key as returned by {@link #getName}.</p>
166 *
167 * @return string representation of {@link Key}
168 */
169 @NonNull
170 @Override
171 public String toString() {
172 return String.format("CaptureResult.Key(%s)", mKey.getName());
173 }
174
175 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700176 * Visible for CameraMetadataNative implementation only; do not use.
177 *
178 * TODO: Make this private or remove it altogether.
179 *
180 * @hide
181 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100182 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700183 public CameraMetadataNative.Key<T> getNativeKey() {
184 return mKey;
185 }
186
187 @SuppressWarnings({ "unchecked" })
188 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
189 mKey = (CameraMetadataNative.Key<T>) nativeKey;
190 }
191 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700192
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100193 @UnsupportedAppUsage
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700194 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700195 private final CaptureRequest mRequest;
196 private final int mSequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700197 private final long mFrameNumber;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700198
Igor Murashkin70725502013-06-25 20:27:06 +0000199 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700200 * Takes ownership of the passed-in properties object
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700201 *
202 * <p>For internal use only</p>
Igor Murashkin70725502013-06-25 20:27:06 +0000203 * @hide
204 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700205 public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
206 CaptureResultExtras extras) {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700207 if (results == null) {
208 throw new IllegalArgumentException("results was null");
209 }
210
211 if (parent == null) {
212 throw new IllegalArgumentException("parent was null");
213 }
214
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700215 if (extras == null) {
216 throw new IllegalArgumentException("extras was null");
217 }
218
Igor Murashkind6d65152014-05-19 16:31:02 -0700219 mResults = CameraMetadataNative.move(results);
220 if (mResults.isEmpty()) {
221 throw new AssertionError("Results must not be empty");
222 }
Emilian Peevde62d842017-03-23 19:20:40 +0000223 setNativeInstance(mResults);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700224 mRequest = parent;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700225 mSequenceId = extras.getRequestId();
226 mFrameNumber = extras.getFrameNumber();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700227 }
228
Ruben Brunkf967a542014-04-28 16:31:11 -0700229 /**
230 * Returns a copy of the underlying {@link CameraMetadataNative}.
231 * @hide
232 */
233 public CameraMetadataNative getNativeCopy() {
234 return new CameraMetadataNative(mResults);
235 }
236
Igor Murashkind6d65152014-05-19 16:31:02 -0700237 /**
238 * Creates a request-less result.
239 *
240 * <p><strong>For testing only.</strong></p>
241 * @hide
242 */
243 public CaptureResult(CameraMetadataNative results, int sequenceId) {
244 if (results == null) {
245 throw new IllegalArgumentException("results was null");
246 }
247
248 mResults = CameraMetadataNative.move(results);
249 if (mResults.isEmpty()) {
250 throw new AssertionError("Results must not be empty");
251 }
252
Emilian Peevde62d842017-03-23 19:20:40 +0000253 setNativeInstance(mResults);
Igor Murashkind6d65152014-05-19 16:31:02 -0700254 mRequest = null;
255 mSequenceId = sequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700256 mFrameNumber = -1;
Igor Murashkind6d65152014-05-19 16:31:02 -0700257 }
258
259 /**
260 * Get a capture result field value.
261 *
262 * <p>The field definitions can be found in {@link CaptureResult}.</p>
263 *
264 * <p>Querying the value for the same key more than once will return a value
265 * which is equal to the previous queried value.</p>
266 *
267 * @throws IllegalArgumentException if the key was not valid
268 *
269 * @param key The result field to read.
270 * @return The value of that key, or {@code null} if the field is not set.
271 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700272 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700273 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700274 T value = mResults.get(key);
275 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
276 return value;
277 }
278
279 /**
280 * {@inheritDoc}
281 * @hide
282 */
283 @SuppressWarnings("unchecked")
284 @Override
285 protected <T> T getProtected(Key<?> key) {
286 return (T) mResults.get(key);
287 }
288
289 /**
290 * {@inheritDoc}
291 * @hide
292 */
293 @SuppressWarnings("unchecked")
294 @Override
295 protected Class<Key<?>> getKeyClass() {
296 Object thisClass = Key.class;
297 return (Class<Key<?>>)thisClass;
298 }
299
300 /**
301 * Dumps the native metadata contents to logcat.
302 *
303 * <p>Visibility for testing/debugging only. The results will not
304 * include any synthesized keys, as they are invisible to the native layer.</p>
305 *
306 * @hide
307 */
308 public void dumpToLog() {
309 mResults.dumpToLog();
310 }
311
312 /**
313 * {@inheritDoc}
314 */
315 @Override
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700316 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700317 public List<Key<?>> getKeys() {
318 // Force the javadoc for this function to show up on the CaptureResult page
319 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800320 }
321
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700322 /**
323 * Get the request associated with this result.
324 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700325 * <p>Whenever a request has been fully or partially captured, with
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700326 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or
327 * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s
Igor Murashkindb075af2014-05-21 10:07:08 -0700328 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700329 * </p>
330 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700331 * <p>For example,
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700332 * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700333 * {@literal @}Override
334 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
335 * assert(myResult.getRequest.equals(myRequest) == true);
336 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700337 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700338 * </code></pre>
339 * </p>
340 *
341 * @return The request associated with this result. Never {@code null}.
342 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700343 @NonNull
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700344 public CaptureRequest getRequest() {
345 return mRequest;
346 }
347
348 /**
349 * Get the frame number associated with this result.
350 *
351 * <p>Whenever a request has been processed, regardless of failure or success,
352 * it gets a unique frame number assigned to its future result/failure.</p>
353 *
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700354 * <p>For the same type of request (capturing from the camera device or reprocessing), this
355 * value monotonically increments, starting with 0, for every new result or failure and the
356 * scope is the lifetime of the {@link CameraDevice}. Between different types of requests,
357 * the frame number may not monotonically increment. For example, the frame number of a newer
358 * reprocess result may be smaller than the frame number of an older result of capturing new
359 * images from the camera device, but the frame number of a newer reprocess result will never be
360 * smaller than the frame number of an older reprocess result.</p>
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700361 *
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700362 * @return The frame number
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700363 *
364 * @see CameraDevice#createCaptureRequest
365 * @see CameraDevice#createReprocessCaptureRequest
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700366 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700367 public long getFrameNumber() {
368 return mFrameNumber;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700369 }
370
371 /**
372 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700373 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700374 *
375 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
376 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
377 *
378 * @return int The ID for the sequence of requests that this capture result is a part of
379 *
Aurimas Liutikasdc309f22018-06-04 15:35:31 -0700380 * @see CameraCaptureSession.CaptureCallback#onCaptureSequenceCompleted
381 * @see CameraCaptureSession.CaptureCallback#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700382 */
383 public int getSequenceId() {
384 return mSequenceId;
385 }
386
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700387 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
388 * The key entries below this point are generated from metadata
389 * definitions in /system/media/camera/docs. Do not modify by hand or
390 * modify the comment blocks at the start or end.
391 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
392
393 /**
Zhijun He379af012014-05-06 11:54:54 -0700394 * <p>The mode control selects how the image data is converted from the
395 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700396 * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this
Zhijun He379af012014-05-06 11:54:54 -0700397 * control is overridden by the AWB routine. When AWB is disabled, the
398 * application controls how the color mapping is performed.</p>
399 * <p>We define the expected processing pipeline below. For consistency
400 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
Shuzhen Wang1ab85142019-07-08 15:14:16 -0700401 * <p>When either FAST or HIGH_QUALITY is used, the camera device may
Zhijun He379af012014-05-06 11:54:54 -0700402 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
403 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
404 * camera device (in the results) and be roughly correct.</p>
405 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
406 * FAST or HIGH_QUALITY will yield a picture with the same white point
407 * as what was produced by the camera device in the earlier frame.</p>
408 * <p>The expected processing pipeline is as follows:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -0800409 * <p><img alt="White balance processing pipeline" src="/reference/images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
Zhijun He379af012014-05-06 11:54:54 -0700410 * <p>The white balance is encoded by two values, a 4-channel white-balance
411 * gain vector (applied in the Bayer domain), and a 3x3 color transform
412 * matrix (applied after demosaic).</p>
413 * <p>The 4-channel white-balance gains are defined as:</p>
414 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
415 * </code></pre>
416 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
417 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
418 * These may be identical for a given camera device implementation; if
419 * the camera device does not support a separate gain for even/odd green
420 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
421 * <code>G_even</code> in the output result metadata.</p>
422 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
423 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
424 * </code></pre>
425 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
426 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
427 * <p>with colors as follows:</p>
428 * <pre><code>r' = I0r + I1g + I2b
429 * g' = I3r + I4g + I5b
430 * b' = I6r + I7g + I8b
431 * </code></pre>
432 * <p>Both the input and output value ranges must match. Overflow/underflow
433 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700434 * <p><b>Possible values:</b>
435 * <ul>
436 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
437 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
438 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
439 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800440 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700441 * <p><b>Full capability</b> -
442 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
443 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700444 *
445 * @see CaptureRequest#COLOR_CORRECTION_GAINS
446 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
447 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700448 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700449 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
450 * @see #COLOR_CORRECTION_MODE_FAST
451 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
452 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700453 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800454 @NonNull
Zhijun He379af012014-05-06 11:54:54 -0700455 public static final Key<Integer> COLOR_CORRECTION_MODE =
456 new Key<Integer>("android.colorCorrection.mode", int.class);
457
458 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800459 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700460 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800461 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800462 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700463 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800464 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800465 * <p>In the latter case, the camera device may round the matrix to account
466 * for precision issues; the final rounded matrix should be reported back
467 * in this matrix result metadata. The transform should keep the magnitude
468 * of the output color values within <code>[0, 1.0]</code> (assuming input color
469 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800470 * <p>The valid range of each matrix element varies on different devices, but
471 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700472 * <p><b>Units</b>: Unitless scale factors</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800473 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700474 * <p><b>Full capability</b> -
475 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
476 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800477 *
478 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700479 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700480 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700481 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800482 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700483 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
484 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700485
486 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800487 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800488 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700489 * <p>These per-channel gains are either set by the camera device
490 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
491 * TRANSFORM_MATRIX, or directly by the application in the
492 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
493 * TRANSFORM_MATRIX.</p>
494 * <p>The gains in the result metadata are the gains actually
495 * applied by the camera device to the current frame.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800496 * <p>The valid range of gains varies on different devices, but gains
497 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
498 * device allows gains below 1.0, this is usually not recommended because
499 * this can create color artifacts.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700500 * <p><b>Units</b>: Unitless gain factors</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800501 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700502 * <p><b>Full capability</b> -
503 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
504 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800505 *
506 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700507 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700508 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700509 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800510 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700511 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
512 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700513
514 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700515 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700516 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
517 * can not focus on the same point after exiting from the lens. This metadata defines
518 * the high level control of chromatic aberration correction algorithm, which aims to
519 * minimize the chromatic artifacts that may occur along the object boundaries in an
520 * image.</p>
521 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
522 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
523 * use the highest-quality aberration correction algorithms, even if it slows down
524 * capture rate. FAST means the camera device will not slow down capture rate when
525 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700526 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700527 * <p><b>Possible values:</b>
528 * <ul>
529 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
530 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
531 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
532 * </ul></p>
533 * <p><b>Available values for this device:</b><br>
534 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700535 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700536 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700537 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
538 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
539 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
540 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700541 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700542 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800543 @NonNull
Zhijun He9e4e4392014-08-18 11:12:32 -0700544 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
545 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700546
547 /**
Zhijun He379af012014-05-06 11:54:54 -0700548 * <p>The desired setting for the camera device's auto-exposure
549 * algorithm's antibanding compensation.</p>
550 * <p>Some kinds of lighting fixtures, such as some fluorescent
551 * lights, flicker at the rate of the power supply frequency
552 * (60Hz or 50Hz, depending on country). While this is
553 * typically not noticeable to a person, it can be visible to
554 * a camera device. If a camera sets its exposure time to the
555 * wrong value, the flicker may become visible in the
556 * viewfinder as flicker or in a final captured image, as a
557 * set of variable-brightness bands across the image.</p>
558 * <p>Therefore, the auto-exposure routines of camera devices
559 * include antibanding routines that ensure that the chosen
560 * exposure value will not cause such banding. The choice of
561 * exposure time depends on the rate of flicker, which the
562 * camera device can detect automatically, or the expected
563 * rate can be selected by the application using this
564 * control.</p>
565 * <p>A given camera device may not support all of the possible
566 * options for the antibanding mode. The
567 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
568 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800569 * <p>AUTO mode is the default if it is available on given
570 * camera device. When AUTO mode is not available, the
571 * default will be either 50HZ or 60HZ, and both 50HZ
572 * and 60HZ will be available.</p>
Zhijun He379af012014-05-06 11:54:54 -0700573 * <p>If manual exposure control is enabled (by setting
574 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
575 * then this setting has no effect, and the application must
576 * ensure it selects exposure times that do not cause banding
577 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
578 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700579 * <p><b>Possible values:</b>
580 * <ul>
581 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
582 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
583 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
584 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
585 * </ul></p>
586 * <p><b>Available values for this device:</b><br></p>
587 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700588 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700589 *
590 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
591 * @see CaptureRequest#CONTROL_AE_MODE
592 * @see CaptureRequest#CONTROL_MODE
593 * @see CaptureResult#STATISTICS_SCENE_FLICKER
594 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
595 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
596 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
597 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
598 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700599 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800600 @NonNull
Zhijun He379af012014-05-06 11:54:54 -0700601 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
602 new Key<Integer>("android.control.aeAntibandingMode", int.class);
603
604 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700605 * <p>Adjustment to auto-exposure (AE) target image
606 * brightness.</p>
607 * <p>The adjustment is measured as a count of steps, with the
608 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
609 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
610 * <p>For example, if the exposure value (EV) step is 0.333, '6'
611 * will mean an exposure compensation of +2 EV; -3 will mean an
612 * exposure compensation of -1 EV. One EV represents a doubling
613 * of image brightness. Note that this control will only be
614 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
615 * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700616 * <p>In the event of exposure compensation value being changed, camera device
617 * may take several frames to reach the newly requested exposure target.
618 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
619 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
620 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
621 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700622 * <p><b>Units</b>: Compensation steps</p>
623 * <p><b>Range of valid values:</b><br>
624 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700625 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700626 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700627 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
628 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700629 * @see CaptureRequest#CONTROL_AE_LOCK
630 * @see CaptureRequest#CONTROL_AE_MODE
631 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700632 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700633 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800634 @NonNull
Zhijun He379af012014-05-06 11:54:54 -0700635 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
636 new Key<Integer>("android.control.aeExposureCompensation", int.class);
637
638 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700639 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700640 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700641 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
642 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
643 * <p>Note that even when AE is locked, the flash may be fired if
644 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
645 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700646 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
647 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700648 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
649 * when AE is already locked, the camera device will not change the exposure time
650 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
651 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
652 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
Zhijun Hefa95b042015-02-09 10:40:49 -0800653 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
654 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
655 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
656 * the AE if AE is locked by the camera device internally during precapture metering
657 * sequence In other words, submitting requests with AE unlock has no effect for an
658 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
659 * will never succeed in a sequence of preview requests where AE lock is always set
660 * to <code>false</code>.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700661 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
662 * get locked do not necessarily correspond to the settings that were present in the
663 * latest capture result received from the camera device, since additional captures
664 * and AE updates may have occurred even before the result was sent out. If an
665 * application is switching between automatic and manual control and wishes to eliminate
666 * any flicker during the switch, the following procedure is recommended:</p>
667 * <ol>
668 * <li>Starting in auto-AE mode:</li>
669 * <li>Lock AE</li>
670 * <li>Wait for the first result to be output that has the AE locked</li>
671 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
672 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
673 * </ol>
Zhijun He379af012014-05-06 11:54:54 -0700674 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700675 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700676 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700677 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700678 * @see CaptureRequest#CONTROL_AE_MODE
679 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
680 * @see CaptureResult#CONTROL_AE_STATE
681 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
682 * @see CaptureRequest#SENSOR_SENSITIVITY
683 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700684 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800685 @NonNull
Zhijun He379af012014-05-06 11:54:54 -0700686 public static final Key<Boolean> CONTROL_AE_LOCK =
687 new Key<Boolean>("android.control.aeLock", boolean.class);
688
689 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800690 * <p>The desired mode for the camera device's
691 * auto-exposure routine.</p>
692 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
693 * AUTO.</p>
694 * <p>When set to any of the ON modes, the camera device's
695 * auto-exposure routine is enabled, overriding the
696 * application's selected exposure time, sensor sensitivity,
697 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
698 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
699 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
700 * is selected, the camera device's flash unit controls are
701 * also overridden.</p>
702 * <p>The FLASH modes are only available if the camera device
703 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
704 * <p>If flash TORCH mode is desired, this field must be set to
705 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
706 * <p>When set to any of the ON modes, the values chosen by the
707 * camera device auto-exposure routine for the overridden
708 * fields for a given capture will be available in its
709 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700710 * <p><b>Possible values:</b>
711 * <ul>
712 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
713 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
714 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
715 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
716 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800717 * <li>{@link #CONTROL_AE_MODE_ON_EXTERNAL_FLASH ON_EXTERNAL_FLASH}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700718 * </ul></p>
719 * <p><b>Available values for this device:</b><br>
720 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700721 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800722 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700723 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -0800724 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800725 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
726 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800727 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
728 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800729 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800730 * @see #CONTROL_AE_MODE_OFF
731 * @see #CONTROL_AE_MODE_ON
732 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
733 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
734 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800735 * @see #CONTROL_AE_MODE_ON_EXTERNAL_FLASH
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800736 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700737 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800738 @NonNull
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800739 public static final Key<Integer> CONTROL_AE_MODE =
740 new Key<Integer>("android.control.aeMode", int.class);
741
742 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700743 * <p>List of metering areas to use for auto-exposure adjustment.</p>
744 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700745 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700746 * <p>The maximum number of regions supported by the device is determined by the value
747 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700748 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
749 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
750 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800751 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700752 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
753 * active pixel array.</p>
754 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
755 * system depends on the mode being set.
756 * When the distortion correction mode is OFF, the coordinate system follows
757 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
758 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
759 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
760 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
761 * pixel in the pre-correction active pixel array.
762 * When the distortion correction mode is not OFF, the coordinate system follows
763 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
764 * <code>(0, 0)</code> being the top-left pixel of the active array, and
765 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
766 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
767 * active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700768 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700769 * for every pixel in the area. This means that a large metering area
770 * with the same weight as a smaller area will have more effect in
771 * the metering result. Metering areas can partially overlap and the
772 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700773 * <p>The weights are relative to weights of other exposure metering regions, so if only one
774 * region is used, all non-zero weights will have the same effect. A region with 0
775 * weight is ignored.</p>
776 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
777 * camera device.</p>
778 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
779 * capture result metadata, the camera device will ignore the sections outside the crop
780 * region and output only the intersection rectangle as the metering region in the result
781 * metadata. If the region is entirely outside the crop region, it will be ignored and
782 * not reported in the result metadata.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -0800783 * <p>Starting from API level 30, the coordinate system of activeArraySize or
784 * preCorrectionActiveArraySize is used to represent post-zoomRatio field of view, not
785 * pre-zoom field of view. This means that the same aeRegions values at different
786 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} represent different parts of the scene. The aeRegions
787 * coordinates are relative to the activeArray/preCorrectionActiveArray representing the
788 * zoomed field of view. If {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} is set to 1.0 (default), the same
789 * aeRegions at different {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} still represent the same parts of the
790 * scene as they do before. See {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details. Whether to use
791 * activeArraySize or preCorrectionActiveArraySize still depends on distortion correction
792 * mode.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700793 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
794 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
795 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700796 * <p><b>Range of valid values:</b><br>
797 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700798 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
799 * depending on distortion correction capability and mode</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800800 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800801 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700802 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -0800803 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700804 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800805 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800806 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700807 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700808 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700809 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800810 @NonNull
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700811 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
812 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700813
814 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700815 * <p>Range over which the auto-exposure routine can
816 * adjust the capture frame rate to maintain good
817 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700818 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700819 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
820 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
821 * <p><b>Units</b>: Frames per second (FPS)</p>
822 * <p><b>Range of valid values:</b><br>
823 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
824 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700825 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700826 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Zhijun He379af012014-05-06 11:54:54 -0700827 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700828 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He379af012014-05-06 11:54:54 -0700829 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700830 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800831 @NonNull
Igor Murashkin78712a82014-05-27 18:32:18 -0700832 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
833 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700834
835 /**
836 * <p>Whether the camera device will trigger a precapture
837 * metering sequence when it processes this request.</p>
838 * <p>This entry is normally set to IDLE, or is not
839 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -0800840 * set to START, the camera device will trigger the auto-exposure (AE)
Zhijun He379af012014-05-06 11:54:54 -0700841 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -0800842 * <p>When set to CANCEL, the camera device will cancel any active
843 * precapture metering trigger, and return to its initial AE state.
844 * If a precapture metering sequence is already completed, and the camera
845 * device has implicitly locked the AE for subsequent still capture, the
846 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800847 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700848 * high-quality still capture for final metering decisions to
849 * be made, and for firing pre-capture flash pulses to estimate
850 * scene brightness and required final capture flash power, when
851 * the flash is enabled.</p>
852 * <p>Normally, this entry should be set to START for only a
853 * single request, and the application should wait until the
854 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800855 * <p>When a precapture metering sequence is finished, the camera device
856 * may lock the auto-exposure routine internally to be able to accurately expose the
857 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
858 * For this case, the AE may not resume normal scan if no subsequent still capture is
859 * submitted. To ensure that the AE routine restarts normal scan, the application should
860 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
861 * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a
Zhijun Hefa95b042015-02-09 10:40:49 -0800862 * still capture request after the precapture sequence completes. Alternatively, for
863 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
864 * internally locked AE if the application doesn't submit a still capture request after
865 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
866 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700867 * <p>The exact effect of auto-exposure (AE) precapture trigger
868 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700869 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
870 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700871 * <p>On LEGACY-level devices, the precapture trigger is not supported;
872 * capturing a high-resolution JPEG image will automatically trigger a
873 * precapture sequence before the high-resolution capture, including
874 * potentially firing a pre-capture flash.</p>
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -0700875 * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
876 * simultaneously is allowed. However, since these triggers often require cooperation between
877 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
878 * focus sweep), the camera device may delay acting on a later trigger until the previous
879 * trigger has been fully handled. This may lead to longer intervals between the trigger and
880 * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for
881 * example.</p>
882 * <p>If both the precapture and the auto-focus trigger are activated on the same request, then
883 * the camera device will complete them in the optimal order for that device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700884 * <p><b>Possible values:</b>
885 * <ul>
886 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
887 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -0800888 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700889 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800890 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700891 * <p><b>Limited capability</b> -
892 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
893 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700894 *
Zhijun Hedd72be52015-02-06 13:49:51 -0800895 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He379af012014-05-06 11:54:54 -0700896 * @see CaptureResult#CONTROL_AE_STATE
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -0700897 * @see CaptureRequest#CONTROL_AF_TRIGGER
Zhijun Hedd72be52015-02-06 13:49:51 -0800898 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700899 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700900 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
901 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -0800902 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Zhijun He379af012014-05-06 11:54:54 -0700903 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700904 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800905 @NonNull
Zhijun He379af012014-05-06 11:54:54 -0700906 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
907 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
908
909 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700910 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800911 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
912 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
913 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
914 * the algorithm states to INACTIVE.</p>
915 * <p>The camera device can do several state transitions between two results, if it is
916 * allowed by the state transition table. For example: INACTIVE may never actually be
917 * seen in a result.</p>
918 * <p>The state in the result is the state for this image (in sync with this image): if
919 * AE state becomes CONVERGED, then the image data associated with this result should
920 * be good to use.</p>
921 * <p>Below are state transition tables for different AE modes.</p>
922 * <table>
923 * <thead>
924 * <tr>
925 * <th align="center">State</th>
926 * <th align="center">Transition Cause</th>
927 * <th align="center">New State</th>
928 * <th align="center">Notes</th>
929 * </tr>
930 * </thead>
931 * <tbody>
932 * <tr>
933 * <td align="center">INACTIVE</td>
934 * <td align="center"></td>
935 * <td align="center">INACTIVE</td>
936 * <td align="center">Camera device auto exposure algorithm is disabled</td>
937 * </tr>
938 * </tbody>
939 * </table>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800940 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON*:</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800941 * <table>
942 * <thead>
943 * <tr>
944 * <th align="center">State</th>
945 * <th align="center">Transition Cause</th>
946 * <th align="center">New State</th>
947 * <th align="center">Notes</th>
948 * </tr>
949 * </thead>
950 * <tbody>
951 * <tr>
952 * <td align="center">INACTIVE</td>
953 * <td align="center">Camera device initiates AE scan</td>
954 * <td align="center">SEARCHING</td>
955 * <td align="center">Values changing</td>
956 * </tr>
957 * <tr>
958 * <td align="center">INACTIVE</td>
959 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
960 * <td align="center">LOCKED</td>
961 * <td align="center">Values locked</td>
962 * </tr>
963 * <tr>
964 * <td align="center">SEARCHING</td>
965 * <td align="center">Camera device finishes AE scan</td>
966 * <td align="center">CONVERGED</td>
967 * <td align="center">Good values, not changing</td>
968 * </tr>
969 * <tr>
970 * <td align="center">SEARCHING</td>
971 * <td align="center">Camera device finishes AE scan</td>
972 * <td align="center">FLASH_REQUIRED</td>
973 * <td align="center">Converged but too dark w/o flash</td>
974 * </tr>
975 * <tr>
976 * <td align="center">SEARCHING</td>
977 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
978 * <td align="center">LOCKED</td>
979 * <td align="center">Values locked</td>
980 * </tr>
981 * <tr>
982 * <td align="center">CONVERGED</td>
983 * <td align="center">Camera device initiates AE scan</td>
984 * <td align="center">SEARCHING</td>
985 * <td align="center">Values changing</td>
986 * </tr>
987 * <tr>
988 * <td align="center">CONVERGED</td>
989 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
990 * <td align="center">LOCKED</td>
991 * <td align="center">Values locked</td>
992 * </tr>
993 * <tr>
994 * <td align="center">FLASH_REQUIRED</td>
995 * <td align="center">Camera device initiates AE scan</td>
996 * <td align="center">SEARCHING</td>
997 * <td align="center">Values changing</td>
998 * </tr>
999 * <tr>
1000 * <td align="center">FLASH_REQUIRED</td>
1001 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
1002 * <td align="center">LOCKED</td>
1003 * <td align="center">Values locked</td>
1004 * </tr>
1005 * <tr>
1006 * <td align="center">LOCKED</td>
1007 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
1008 * <td align="center">SEARCHING</td>
1009 * <td align="center">Values not good after unlock</td>
1010 * </tr>
1011 * <tr>
1012 * <td align="center">LOCKED</td>
1013 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
1014 * <td align="center">CONVERGED</td>
1015 * <td align="center">Values good after unlock</td>
1016 * </tr>
1017 * <tr>
1018 * <td align="center">LOCKED</td>
1019 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
1020 * <td align="center">FLASH_REQUIRED</td>
1021 * <td align="center">Exposure good, but too dark</td>
1022 * </tr>
1023 * <tr>
1024 * <td align="center">PRECAPTURE</td>
1025 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
1026 * <td align="center">CONVERGED</td>
1027 * <td align="center">Ready for high-quality capture</td>
1028 * </tr>
1029 * <tr>
1030 * <td align="center">PRECAPTURE</td>
1031 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
1032 * <td align="center">LOCKED</td>
1033 * <td align="center">Ready for high-quality capture</td>
1034 * </tr>
1035 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001036 * <td align="center">LOCKED</td>
1037 * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td>
1038 * <td align="center">LOCKED</td>
1039 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
1040 * </tr>
1041 * <tr>
1042 * <td align="center">LOCKED</td>
1043 * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</td>
1044 * <td align="center">LOCKED</td>
1045 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
1046 * </tr>
1047 * <tr>
1048 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001049 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
1050 * <td align="center">PRECAPTURE</td>
1051 * <td align="center">Start AE precapture metering sequence</td>
1052 * </tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001053 * <tr>
1054 * <td align="center">Any state (excluding LOCKED)</td>
1055 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td>
1056 * <td align="center">INACTIVE</td>
1057 * <td align="center">Currently active precapture metering sequence is canceled</td>
1058 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001059 * </tbody>
1060 * </table>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001061 * <p>If the camera device supports AE external flash mode (ON_EXTERNAL_FLASH is included in
Chien-Yu Chenc9ca7222018-03-15 11:14:29 -07001062 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}), {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} must be FLASH_REQUIRED after
1063 * the camera device finishes AE scan and it's too dark without flash.</p>
Zhijun He60b19dc2014-02-24 10:19:20 -08001064 * <p>For the above table, the camera device may skip reporting any state changes that happen
1065 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1066 * can be skipped in that manner is called a transient state.</p>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001067 * <p>For example, for above AE modes (AE_MODE_ON*), in addition to the state transitions
Zhijun He60b19dc2014-02-24 10:19:20 -08001068 * listed in above table, it is also legal for the camera device to skip one or more
1069 * transient states between two results. See below table for examples:</p>
1070 * <table>
1071 * <thead>
1072 * <tr>
1073 * <th align="center">State</th>
1074 * <th align="center">Transition Cause</th>
1075 * <th align="center">New State</th>
1076 * <th align="center">Notes</th>
1077 * </tr>
1078 * </thead>
1079 * <tbody>
1080 * <tr>
1081 * <td align="center">INACTIVE</td>
1082 * <td align="center">Camera device finished AE scan</td>
1083 * <td align="center">CONVERGED</td>
1084 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1085 * </tr>
1086 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001087 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001088 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
1089 * <td align="center">FLASH_REQUIRED</td>
1090 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
1091 * </tr>
1092 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001093 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001094 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
1095 * <td align="center">CONVERGED</td>
1096 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
1097 * </tr>
1098 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001099 * <td align="center">Any state (excluding LOCKED)</td>
1100 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1101 * <td align="center">FLASH_REQUIRED</td>
1102 * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td>
1103 * </tr>
1104 * <tr>
1105 * <td align="center">Any state (excluding LOCKED)</td>
1106 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1107 * <td align="center">CONVERGED</td>
1108 * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td>
1109 * </tr>
1110 * <tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001111 * <td align="center">CONVERGED</td>
1112 * <td align="center">Camera device finished AE scan</td>
1113 * <td align="center">FLASH_REQUIRED</td>
1114 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
1115 * </tr>
1116 * <tr>
1117 * <td align="center">FLASH_REQUIRED</td>
1118 * <td align="center">Camera device finished AE scan</td>
1119 * <td align="center">CONVERGED</td>
1120 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
1121 * </tr>
1122 * </tbody>
1123 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001124 * <p><b>Possible values:</b>
1125 * <ul>
1126 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
1127 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
1128 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
1129 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
1130 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
1131 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
1132 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001133 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001134 * <p><b>Limited capability</b> -
1135 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1136 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001137 *
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001138 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He228f4f92014-01-16 17:22:05 -08001139 * @see CaptureRequest#CONTROL_AE_LOCK
1140 * @see CaptureRequest#CONTROL_AE_MODE
1141 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Chien-Yu Chenc9ca7222018-03-15 11:14:29 -07001142 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He228f4f92014-01-16 17:22:05 -08001143 * @see CaptureRequest#CONTROL_MODE
1144 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001145 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001146 * @see #CONTROL_AE_STATE_INACTIVE
1147 * @see #CONTROL_AE_STATE_SEARCHING
1148 * @see #CONTROL_AE_STATE_CONVERGED
1149 * @see #CONTROL_AE_STATE_LOCKED
1150 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
1151 * @see #CONTROL_AE_STATE_PRECAPTURE
1152 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001153 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001154 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001155 public static final Key<Integer> CONTROL_AE_STATE =
1156 new Key<Integer>("android.control.aeState", int.class);
1157
1158 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001159 * <p>Whether auto-focus (AF) is currently enabled, and what
1160 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001161 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001162 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1163 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1164 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1165 * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p>
Zhijun He78146ec2014-01-14 18:12:13 -08001166 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001167 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001168 * in result metadata.</p>
1169 * <p><b>Possible values:</b>
1170 * <ul>
1171 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1172 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1173 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1174 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1175 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1176 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1177 * </ul></p>
1178 * <p><b>Available values for this device:</b><br>
1179 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1180 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001181 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001182 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001183 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001184 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001185 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001186 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001187 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001188 * @see #CONTROL_AF_MODE_OFF
1189 * @see #CONTROL_AF_MODE_AUTO
1190 * @see #CONTROL_AF_MODE_MACRO
1191 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1192 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1193 * @see #CONTROL_AF_MODE_EDOF
1194 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001195 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001196 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001197 public static final Key<Integer> CONTROL_AF_MODE =
1198 new Key<Integer>("android.control.afMode", int.class);
1199
1200 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001201 * <p>List of metering areas to use for auto-focus.</p>
1202 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001203 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001204 * <p>The maximum number of focus areas supported by the device is determined by the value
1205 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001206 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1207 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
1208 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001209 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001210 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1211 * active pixel array.</p>
1212 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1213 * system depends on the mode being set.
1214 * When the distortion correction mode is OFF, the coordinate system follows
1215 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
1216 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
1217 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
1218 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
1219 * pixel in the pre-correction active pixel array.
1220 * When the distortion correction mode is not OFF, the coordinate system follows
1221 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
1222 * <code>(0, 0)</code> being the top-left pixel of the active array, and
1223 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1224 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1225 * active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001226 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001227 * for every pixel in the area. This means that a large metering area
1228 * with the same weight as a smaller area will have more effect in
1229 * the metering result. Metering areas can partially overlap and the
1230 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001231 * <p>The weights are relative to weights of other metering regions, so if only one region
1232 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1233 * ignored.</p>
1234 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
Shuzhen Wanga31d58f2018-02-08 12:44:47 -08001235 * camera device. The capture result will either be a zero weight region as well, or
1236 * the region selected by the camera device as the focus area of interest.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001237 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1238 * capture result metadata, the camera device will ignore the sections outside the crop
1239 * region and output only the intersection rectangle as the metering region in the result
1240 * metadata. If the region is entirely outside the crop region, it will be ignored and
1241 * not reported in the result metadata.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001242 * <p>Starting from API level 30, the coordinate system of activeArraySize or
1243 * preCorrectionActiveArraySize is used to represent post-zoomRatio field of view, not
1244 * pre-zoom field of view. This means that the same afRegions values at different
1245 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} represent different parts of the scene. The afRegions
1246 * coordinates are relative to the activeArray/preCorrectionActiveArray representing the
1247 * zoomed field of view. If {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} is set to 1.0 (default), the same
1248 * afRegions at different {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} still represent the same parts of the
1249 * scene as they do before. See {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details. Whether to use
1250 * activeArraySize or preCorrectionActiveArraySize still depends on distortion correction
1251 * mode.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001252 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
1253 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
1254 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001255 * <p><b>Range of valid values:</b><br>
1256 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001257 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1258 * depending on distortion correction capability and mode</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001259 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001260 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001261 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001262 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001263 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001264 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001265 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001266 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001267 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001268 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001269 @NonNull
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001270 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1271 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001272
1273 /**
Zhijun He379af012014-05-06 11:54:54 -07001274 * <p>Whether the camera device will trigger autofocus for this request.</p>
1275 * <p>This entry is normally set to IDLE, or is not
1276 * included at all in the request settings.</p>
1277 * <p>When included and set to START, the camera device will trigger the
1278 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1279 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1280 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001281 * <p>Generally, applications should set this entry to START or CANCEL for only a
1282 * single capture, and then return it to IDLE (or not set at all). Specifying
1283 * START for multiple captures in a row means restarting the AF operation over
1284 * and over again.</p>
1285 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001286 * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
1287 * simultaneously is allowed. However, since these triggers often require cooperation between
1288 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1289 * focus sweep), the camera device may delay acting on a later trigger until the previous
1290 * trigger has been fully handled. This may lead to longer intervals between the trigger and
1291 * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001292 * <p><b>Possible values:</b>
1293 * <ul>
1294 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1295 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1296 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1297 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001298 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001299 *
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001300 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Zhijun He379af012014-05-06 11:54:54 -07001301 * @see CaptureResult#CONTROL_AF_STATE
1302 * @see #CONTROL_AF_TRIGGER_IDLE
1303 * @see #CONTROL_AF_TRIGGER_START
1304 * @see #CONTROL_AF_TRIGGER_CANCEL
1305 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001306 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001307 @NonNull
Zhijun He379af012014-05-06 11:54:54 -07001308 public static final Key<Integer> CONTROL_AF_TRIGGER =
1309 new Key<Integer>("android.control.afTrigger", int.class);
1310
1311 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001312 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001313 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1314 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1315 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1316 * the algorithm states to INACTIVE.</p>
1317 * <p>The camera device can do several state transitions between two results, if it is
1318 * allowed by the state transition table. For example: INACTIVE may never actually be
1319 * seen in a result.</p>
1320 * <p>The state in the result is the state for this image (in sync with this image): if
1321 * AF state becomes FOCUSED, then the image data associated with this result should
1322 * be sharp.</p>
1323 * <p>Below are state transition tables for different AF modes.</p>
1324 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1325 * <table>
1326 * <thead>
1327 * <tr>
1328 * <th align="center">State</th>
1329 * <th align="center">Transition Cause</th>
1330 * <th align="center">New State</th>
1331 * <th align="center">Notes</th>
1332 * </tr>
1333 * </thead>
1334 * <tbody>
1335 * <tr>
1336 * <td align="center">INACTIVE</td>
1337 * <td align="center"></td>
1338 * <td align="center">INACTIVE</td>
1339 * <td align="center">Never changes</td>
1340 * </tr>
1341 * </tbody>
1342 * </table>
1343 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1344 * <table>
1345 * <thead>
1346 * <tr>
1347 * <th align="center">State</th>
1348 * <th align="center">Transition Cause</th>
1349 * <th align="center">New State</th>
1350 * <th align="center">Notes</th>
1351 * </tr>
1352 * </thead>
1353 * <tbody>
1354 * <tr>
1355 * <td align="center">INACTIVE</td>
1356 * <td align="center">AF_TRIGGER</td>
1357 * <td align="center">ACTIVE_SCAN</td>
1358 * <td align="center">Start AF sweep, Lens now moving</td>
1359 * </tr>
1360 * <tr>
1361 * <td align="center">ACTIVE_SCAN</td>
1362 * <td align="center">AF sweep done</td>
1363 * <td align="center">FOCUSED_LOCKED</td>
1364 * <td align="center">Focused, Lens now locked</td>
1365 * </tr>
1366 * <tr>
1367 * <td align="center">ACTIVE_SCAN</td>
1368 * <td align="center">AF sweep done</td>
1369 * <td align="center">NOT_FOCUSED_LOCKED</td>
1370 * <td align="center">Not focused, Lens now locked</td>
1371 * </tr>
1372 * <tr>
1373 * <td align="center">ACTIVE_SCAN</td>
1374 * <td align="center">AF_CANCEL</td>
1375 * <td align="center">INACTIVE</td>
1376 * <td align="center">Cancel/reset AF, Lens now locked</td>
1377 * </tr>
1378 * <tr>
1379 * <td align="center">FOCUSED_LOCKED</td>
1380 * <td align="center">AF_CANCEL</td>
1381 * <td align="center">INACTIVE</td>
1382 * <td align="center">Cancel/reset AF</td>
1383 * </tr>
1384 * <tr>
1385 * <td align="center">FOCUSED_LOCKED</td>
1386 * <td align="center">AF_TRIGGER</td>
1387 * <td align="center">ACTIVE_SCAN</td>
1388 * <td align="center">Start new sweep, Lens now moving</td>
1389 * </tr>
1390 * <tr>
1391 * <td align="center">NOT_FOCUSED_LOCKED</td>
1392 * <td align="center">AF_CANCEL</td>
1393 * <td align="center">INACTIVE</td>
1394 * <td align="center">Cancel/reset AF</td>
1395 * </tr>
1396 * <tr>
1397 * <td align="center">NOT_FOCUSED_LOCKED</td>
1398 * <td align="center">AF_TRIGGER</td>
1399 * <td align="center">ACTIVE_SCAN</td>
1400 * <td align="center">Start new sweep, Lens now moving</td>
1401 * </tr>
1402 * <tr>
1403 * <td align="center">Any state</td>
1404 * <td align="center">Mode change</td>
1405 * <td align="center">INACTIVE</td>
1406 * <td align="center"></td>
1407 * </tr>
1408 * </tbody>
1409 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001410 * <p>For the above table, the camera device may skip reporting any state changes that happen
1411 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1412 * can be skipped in that manner is called a transient state.</p>
1413 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1414 * state transitions listed in above table, it is also legal for the camera device to skip
1415 * one or more transient states between two results. See below table for examples:</p>
1416 * <table>
1417 * <thead>
1418 * <tr>
1419 * <th align="center">State</th>
1420 * <th align="center">Transition Cause</th>
1421 * <th align="center">New State</th>
1422 * <th align="center">Notes</th>
1423 * </tr>
1424 * </thead>
1425 * <tbody>
1426 * <tr>
1427 * <td align="center">INACTIVE</td>
1428 * <td align="center">AF_TRIGGER</td>
1429 * <td align="center">FOCUSED_LOCKED</td>
1430 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1431 * </tr>
1432 * <tr>
1433 * <td align="center">INACTIVE</td>
1434 * <td align="center">AF_TRIGGER</td>
1435 * <td align="center">NOT_FOCUSED_LOCKED</td>
1436 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1437 * </tr>
1438 * <tr>
1439 * <td align="center">FOCUSED_LOCKED</td>
1440 * <td align="center">AF_TRIGGER</td>
1441 * <td align="center">FOCUSED_LOCKED</td>
1442 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1443 * </tr>
1444 * <tr>
1445 * <td align="center">NOT_FOCUSED_LOCKED</td>
1446 * <td align="center">AF_TRIGGER</td>
1447 * <td align="center">FOCUSED_LOCKED</td>
1448 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1449 * </tr>
1450 * </tbody>
1451 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001452 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1453 * <table>
1454 * <thead>
1455 * <tr>
1456 * <th align="center">State</th>
1457 * <th align="center">Transition Cause</th>
1458 * <th align="center">New State</th>
1459 * <th align="center">Notes</th>
1460 * </tr>
1461 * </thead>
1462 * <tbody>
1463 * <tr>
1464 * <td align="center">INACTIVE</td>
1465 * <td align="center">Camera device initiates new scan</td>
1466 * <td align="center">PASSIVE_SCAN</td>
1467 * <td align="center">Start AF scan, Lens now moving</td>
1468 * </tr>
1469 * <tr>
1470 * <td align="center">INACTIVE</td>
1471 * <td align="center">AF_TRIGGER</td>
1472 * <td align="center">NOT_FOCUSED_LOCKED</td>
1473 * <td align="center">AF state query, Lens now locked</td>
1474 * </tr>
1475 * <tr>
1476 * <td align="center">PASSIVE_SCAN</td>
1477 * <td align="center">Camera device completes current scan</td>
1478 * <td align="center">PASSIVE_FOCUSED</td>
1479 * <td align="center">End AF scan, Lens now locked</td>
1480 * </tr>
1481 * <tr>
1482 * <td align="center">PASSIVE_SCAN</td>
1483 * <td align="center">Camera device fails current scan</td>
1484 * <td align="center">PASSIVE_UNFOCUSED</td>
1485 * <td align="center">End AF scan, Lens now locked</td>
1486 * </tr>
1487 * <tr>
1488 * <td align="center">PASSIVE_SCAN</td>
1489 * <td align="center">AF_TRIGGER</td>
1490 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001491 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001492 * </tr>
1493 * <tr>
1494 * <td align="center">PASSIVE_SCAN</td>
1495 * <td align="center">AF_TRIGGER</td>
1496 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001497 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001498 * </tr>
1499 * <tr>
1500 * <td align="center">PASSIVE_SCAN</td>
1501 * <td align="center">AF_CANCEL</td>
1502 * <td align="center">INACTIVE</td>
1503 * <td align="center">Reset lens position, Lens now locked</td>
1504 * </tr>
1505 * <tr>
1506 * <td align="center">PASSIVE_FOCUSED</td>
1507 * <td align="center">Camera device initiates new scan</td>
1508 * <td align="center">PASSIVE_SCAN</td>
1509 * <td align="center">Start AF scan, Lens now moving</td>
1510 * </tr>
1511 * <tr>
1512 * <td align="center">PASSIVE_UNFOCUSED</td>
1513 * <td align="center">Camera device initiates new scan</td>
1514 * <td align="center">PASSIVE_SCAN</td>
1515 * <td align="center">Start AF scan, Lens now moving</td>
1516 * </tr>
1517 * <tr>
1518 * <td align="center">PASSIVE_FOCUSED</td>
1519 * <td align="center">AF_TRIGGER</td>
1520 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001521 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001522 * </tr>
1523 * <tr>
1524 * <td align="center">PASSIVE_UNFOCUSED</td>
1525 * <td align="center">AF_TRIGGER</td>
1526 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001527 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001528 * </tr>
1529 * <tr>
1530 * <td align="center">FOCUSED_LOCKED</td>
1531 * <td align="center">AF_TRIGGER</td>
1532 * <td align="center">FOCUSED_LOCKED</td>
1533 * <td align="center">No effect</td>
1534 * </tr>
1535 * <tr>
1536 * <td align="center">FOCUSED_LOCKED</td>
1537 * <td align="center">AF_CANCEL</td>
1538 * <td align="center">INACTIVE</td>
1539 * <td align="center">Restart AF scan</td>
1540 * </tr>
1541 * <tr>
1542 * <td align="center">NOT_FOCUSED_LOCKED</td>
1543 * <td align="center">AF_TRIGGER</td>
1544 * <td align="center">NOT_FOCUSED_LOCKED</td>
1545 * <td align="center">No effect</td>
1546 * </tr>
1547 * <tr>
1548 * <td align="center">NOT_FOCUSED_LOCKED</td>
1549 * <td align="center">AF_CANCEL</td>
1550 * <td align="center">INACTIVE</td>
1551 * <td align="center">Restart AF scan</td>
1552 * </tr>
1553 * </tbody>
1554 * </table>
1555 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1556 * <table>
1557 * <thead>
1558 * <tr>
1559 * <th align="center">State</th>
1560 * <th align="center">Transition Cause</th>
1561 * <th align="center">New State</th>
1562 * <th align="center">Notes</th>
1563 * </tr>
1564 * </thead>
1565 * <tbody>
1566 * <tr>
1567 * <td align="center">INACTIVE</td>
1568 * <td align="center">Camera device initiates new scan</td>
1569 * <td align="center">PASSIVE_SCAN</td>
1570 * <td align="center">Start AF scan, Lens now moving</td>
1571 * </tr>
1572 * <tr>
1573 * <td align="center">INACTIVE</td>
1574 * <td align="center">AF_TRIGGER</td>
1575 * <td align="center">NOT_FOCUSED_LOCKED</td>
1576 * <td align="center">AF state query, Lens now locked</td>
1577 * </tr>
1578 * <tr>
1579 * <td align="center">PASSIVE_SCAN</td>
1580 * <td align="center">Camera device completes current scan</td>
1581 * <td align="center">PASSIVE_FOCUSED</td>
1582 * <td align="center">End AF scan, Lens now locked</td>
1583 * </tr>
1584 * <tr>
1585 * <td align="center">PASSIVE_SCAN</td>
1586 * <td align="center">Camera device fails current scan</td>
1587 * <td align="center">PASSIVE_UNFOCUSED</td>
1588 * <td align="center">End AF scan, Lens now locked</td>
1589 * </tr>
1590 * <tr>
1591 * <td align="center">PASSIVE_SCAN</td>
1592 * <td align="center">AF_TRIGGER</td>
1593 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001594 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001595 * </tr>
1596 * <tr>
1597 * <td align="center">PASSIVE_SCAN</td>
1598 * <td align="center">AF_TRIGGER</td>
1599 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001600 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001601 * </tr>
1602 * <tr>
1603 * <td align="center">PASSIVE_SCAN</td>
1604 * <td align="center">AF_CANCEL</td>
1605 * <td align="center">INACTIVE</td>
1606 * <td align="center">Reset lens position, Lens now locked</td>
1607 * </tr>
1608 * <tr>
1609 * <td align="center">PASSIVE_FOCUSED</td>
1610 * <td align="center">Camera device initiates new scan</td>
1611 * <td align="center">PASSIVE_SCAN</td>
1612 * <td align="center">Start AF scan, Lens now moving</td>
1613 * </tr>
1614 * <tr>
1615 * <td align="center">PASSIVE_UNFOCUSED</td>
1616 * <td align="center">Camera device initiates new scan</td>
1617 * <td align="center">PASSIVE_SCAN</td>
1618 * <td align="center">Start AF scan, Lens now moving</td>
1619 * </tr>
1620 * <tr>
1621 * <td align="center">PASSIVE_FOCUSED</td>
1622 * <td align="center">AF_TRIGGER</td>
1623 * <td align="center">FOCUSED_LOCKED</td>
1624 * <td align="center">Immediate trans. Lens now locked</td>
1625 * </tr>
1626 * <tr>
1627 * <td align="center">PASSIVE_UNFOCUSED</td>
1628 * <td align="center">AF_TRIGGER</td>
1629 * <td align="center">NOT_FOCUSED_LOCKED</td>
1630 * <td align="center">Immediate trans. Lens now locked</td>
1631 * </tr>
1632 * <tr>
1633 * <td align="center">FOCUSED_LOCKED</td>
1634 * <td align="center">AF_TRIGGER</td>
1635 * <td align="center">FOCUSED_LOCKED</td>
1636 * <td align="center">No effect</td>
1637 * </tr>
1638 * <tr>
1639 * <td align="center">FOCUSED_LOCKED</td>
1640 * <td align="center">AF_CANCEL</td>
1641 * <td align="center">INACTIVE</td>
1642 * <td align="center">Restart AF scan</td>
1643 * </tr>
1644 * <tr>
1645 * <td align="center">NOT_FOCUSED_LOCKED</td>
1646 * <td align="center">AF_TRIGGER</td>
1647 * <td align="center">NOT_FOCUSED_LOCKED</td>
1648 * <td align="center">No effect</td>
1649 * </tr>
1650 * <tr>
1651 * <td align="center">NOT_FOCUSED_LOCKED</td>
1652 * <td align="center">AF_CANCEL</td>
1653 * <td align="center">INACTIVE</td>
1654 * <td align="center">Restart AF scan</td>
1655 * </tr>
1656 * </tbody>
1657 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001658 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1659 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1660 * camera device. When a trigger is included in a mode switch request, the trigger
1661 * will be evaluated in the context of the new mode in the request.
1662 * See below table for examples:</p>
1663 * <table>
1664 * <thead>
1665 * <tr>
1666 * <th align="center">State</th>
1667 * <th align="center">Transition Cause</th>
1668 * <th align="center">New State</th>
1669 * <th align="center">Notes</th>
1670 * </tr>
1671 * </thead>
1672 * <tbody>
1673 * <tr>
1674 * <td align="center">any state</td>
1675 * <td align="center">CAF--&gt;AUTO mode switch</td>
1676 * <td align="center">INACTIVE</td>
1677 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1678 * </tr>
1679 * <tr>
1680 * <td align="center">any state</td>
1681 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1682 * <td align="center">trigger-reachable states from INACTIVE</td>
1683 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1684 * </tr>
1685 * <tr>
1686 * <td align="center">any state</td>
1687 * <td align="center">AUTO--&gt;CAF mode switch</td>
1688 * <td align="center">passively reachable states from INACTIVE</td>
1689 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1690 * </tr>
1691 * </tbody>
1692 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001693 * <p><b>Possible values:</b>
1694 * <ul>
1695 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1696 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1697 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1698 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1699 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1700 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1701 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1702 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001703 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001704 *
1705 * @see CaptureRequest#CONTROL_AF_MODE
1706 * @see CaptureRequest#CONTROL_MODE
1707 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001708 * @see #CONTROL_AF_STATE_INACTIVE
1709 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1710 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1711 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1712 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1713 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001714 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001715 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001716 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001717 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001718 public static final Key<Integer> CONTROL_AF_STATE =
1719 new Key<Integer>("android.control.afState", int.class);
1720
1721 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001722 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001723 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001724 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1725 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1726 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1727 * get locked do not necessarily correspond to the settings that were present in the
1728 * latest capture result received from the camera device, since additional captures
1729 * and AWB updates may have occurred even before the result was sent out. If an
1730 * application is switching between automatic and manual control and wishes to eliminate
1731 * any flicker during the switch, the following procedure is recommended:</p>
1732 * <ol>
1733 * <li>Starting in auto-AWB mode:</li>
1734 * <li>Lock AWB</li>
1735 * <li>Wait for the first result to be output that has the AWB locked</li>
1736 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1737 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1738 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001739 * <p>Note that AWB lock is only meaningful when
1740 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1741 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001742 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1743 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001744 *
1745 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001746 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001747 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001748 @NonNull
Zhijun He379af012014-05-06 11:54:54 -07001749 public static final Key<Boolean> CONTROL_AWB_LOCK =
1750 new Key<Boolean>("android.control.awbLock", boolean.class);
1751
1752 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001753 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001754 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001755 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001756 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001757 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001758 * routine is enabled, overriding the application's selected
1759 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001760 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1761 * is OFF, the behavior of AWB is device dependent. It is recommened to
1762 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1763 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001764 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001765 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001766 * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
Zhijun He399f05d2014-01-15 11:31:30 -08001767 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001768 * <p>When set to any other modes, the camera device's auto-white
1769 * balance routine is disabled. The camera device uses each
1770 * particular illumination target for white balance
1771 * adjustment. The application's values for
1772 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1773 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1774 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001775 * <p><b>Possible values:</b>
1776 * <ul>
1777 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1778 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1779 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1780 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1781 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1782 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1783 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1784 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1785 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1786 * </ul></p>
1787 * <p><b>Available values for this device:</b><br>
1788 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001789 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001790 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001791 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001792 * @see CaptureRequest#COLOR_CORRECTION_MODE
1793 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001794 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001795 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001796 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001797 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001798 * @see #CONTROL_AWB_MODE_OFF
1799 * @see #CONTROL_AWB_MODE_AUTO
1800 * @see #CONTROL_AWB_MODE_INCANDESCENT
1801 * @see #CONTROL_AWB_MODE_FLUORESCENT
1802 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1803 * @see #CONTROL_AWB_MODE_DAYLIGHT
1804 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1805 * @see #CONTROL_AWB_MODE_TWILIGHT
1806 * @see #CONTROL_AWB_MODE_SHADE
1807 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001808 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001809 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001810 public static final Key<Integer> CONTROL_AWB_MODE =
1811 new Key<Integer>("android.control.awbMode", int.class);
1812
1813 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001814 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001815 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001816 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001817 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001818 * <p>The maximum number of regions supported by the device is determined by the value
1819 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001820 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1821 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
1822 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001823 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001824 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1825 * active pixel array.</p>
1826 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1827 * system depends on the mode being set.
1828 * When the distortion correction mode is OFF, the coordinate system follows
1829 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
1830 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
1831 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
1832 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
1833 * pixel in the pre-correction active pixel array.
1834 * When the distortion correction mode is not OFF, the coordinate system follows
1835 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
1836 * <code>(0, 0)</code> being the top-left pixel of the active array, and
1837 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1838 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1839 * active pixel array.</p>
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001840 * <p>The weight must range from 0 to 1000, and represents a weight
1841 * for every pixel in the area. This means that a large metering area
1842 * with the same weight as a smaller area will have more effect in
1843 * the metering result. Metering areas can partially overlap and the
1844 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001845 * <p>The weights are relative to weights of other white balance metering regions, so if
1846 * only one region is used, all non-zero weights will have the same effect. A region with
1847 * 0 weight is ignored.</p>
1848 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1849 * camera device.</p>
1850 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1851 * capture result metadata, the camera device will ignore the sections outside the crop
1852 * region and output only the intersection rectangle as the metering region in the result
1853 * metadata. If the region is entirely outside the crop region, it will be ignored and
1854 * not reported in the result metadata.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001855 * <p>Starting from API level 30, the coordinate system of activeArraySize or
1856 * preCorrectionActiveArraySize is used to represent post-zoomRatio field of view, not
1857 * pre-zoom field of view. This means that the same awbRegions values at different
1858 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} represent different parts of the scene. The awbRegions
1859 * coordinates are relative to the activeArray/preCorrectionActiveArray representing the
1860 * zoomed field of view. If {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} is set to 1.0 (default), the same
1861 * awbRegions at different {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} still represent the same parts of
1862 * the scene as they do before. See {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details. Whether to use
1863 * activeArraySize or preCorrectionActiveArraySize still depends on distortion correction
1864 * mode.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001865 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
1866 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
1867 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001868 * <p><b>Range of valid values:</b><br>
1869 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001870 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1871 * depending on distortion correction capability and mode</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001872 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001873 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001874 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001875 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001876 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001877 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001878 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001879 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001880 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001881 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001882 @NonNull
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001883 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1884 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001885
1886 /**
Zhijun He379af012014-05-06 11:54:54 -07001887 * <p>Information to the camera device 3A (auto-exposure,
1888 * auto-focus, auto-white balance) routines about the purpose
1889 * of this capture, to help the camera device to decide optimal 3A
1890 * strategy.</p>
1891 * <p>This control (except for MANUAL) is only effective if
1892 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001893 * <p>All intents are supported by all devices, except that:
1894 * * ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1895 * PRIVATE_REPROCESSING or YUV_REPROCESSING.
1896 * * MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1897 * MANUAL_SENSOR.
1898 * * MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1899 * MOTION_TRACKING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001900 * <p><b>Possible values:</b>
1901 * <ul>
1902 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1903 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1904 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1905 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1906 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1907 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1908 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001909 * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001910 * </ul></p>
1911 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001912 *
1913 * @see CaptureRequest#CONTROL_MODE
1914 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1915 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1916 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1917 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1918 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1919 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1920 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1921 * @see #CONTROL_CAPTURE_INTENT_MANUAL
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001922 * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING
Zhijun He379af012014-05-06 11:54:54 -07001923 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001924 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001925 @NonNull
Zhijun He379af012014-05-06 11:54:54 -07001926 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1927 new Key<Integer>("android.control.captureIntent", int.class);
1928
1929 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001930 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001931 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1932 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1933 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1934 * the algorithm states to INACTIVE.</p>
1935 * <p>The camera device can do several state transitions between two results, if it is
1936 * allowed by the state transition table. So INACTIVE may never actually be seen in
1937 * a result.</p>
1938 * <p>The state in the result is the state for this image (in sync with this image): if
1939 * AWB state becomes CONVERGED, then the image data associated with this result should
1940 * be good to use.</p>
1941 * <p>Below are state transition tables for different AWB modes.</p>
1942 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1943 * <table>
1944 * <thead>
1945 * <tr>
1946 * <th align="center">State</th>
1947 * <th align="center">Transition Cause</th>
1948 * <th align="center">New State</th>
1949 * <th align="center">Notes</th>
1950 * </tr>
1951 * </thead>
1952 * <tbody>
1953 * <tr>
1954 * <td align="center">INACTIVE</td>
1955 * <td align="center"></td>
1956 * <td align="center">INACTIVE</td>
1957 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1958 * </tr>
1959 * </tbody>
1960 * </table>
1961 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1962 * <table>
1963 * <thead>
1964 * <tr>
1965 * <th align="center">State</th>
1966 * <th align="center">Transition Cause</th>
1967 * <th align="center">New State</th>
1968 * <th align="center">Notes</th>
1969 * </tr>
1970 * </thead>
1971 * <tbody>
1972 * <tr>
1973 * <td align="center">INACTIVE</td>
1974 * <td align="center">Camera device initiates AWB scan</td>
1975 * <td align="center">SEARCHING</td>
1976 * <td align="center">Values changing</td>
1977 * </tr>
1978 * <tr>
1979 * <td align="center">INACTIVE</td>
1980 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1981 * <td align="center">LOCKED</td>
1982 * <td align="center">Values locked</td>
1983 * </tr>
1984 * <tr>
1985 * <td align="center">SEARCHING</td>
1986 * <td align="center">Camera device finishes AWB scan</td>
1987 * <td align="center">CONVERGED</td>
1988 * <td align="center">Good values, not changing</td>
1989 * </tr>
1990 * <tr>
1991 * <td align="center">SEARCHING</td>
1992 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1993 * <td align="center">LOCKED</td>
1994 * <td align="center">Values locked</td>
1995 * </tr>
1996 * <tr>
1997 * <td align="center">CONVERGED</td>
1998 * <td align="center">Camera device initiates AWB scan</td>
1999 * <td align="center">SEARCHING</td>
2000 * <td align="center">Values changing</td>
2001 * </tr>
2002 * <tr>
2003 * <td align="center">CONVERGED</td>
2004 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
2005 * <td align="center">LOCKED</td>
2006 * <td align="center">Values locked</td>
2007 * </tr>
2008 * <tr>
2009 * <td align="center">LOCKED</td>
2010 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
2011 * <td align="center">SEARCHING</td>
2012 * <td align="center">Values not good after unlock</td>
2013 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08002014 * </tbody>
2015 * </table>
2016 * <p>For the above table, the camera device may skip reporting any state changes that happen
2017 * without application intervention (i.e. mode switch, trigger, locking). Any state that
2018 * can be skipped in that manner is called a transient state.</p>
2019 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
2020 * listed in above table, it is also legal for the camera device to skip one or more
2021 * transient states between two results. See below table for examples:</p>
2022 * <table>
2023 * <thead>
2024 * <tr>
2025 * <th align="center">State</th>
2026 * <th align="center">Transition Cause</th>
2027 * <th align="center">New State</th>
2028 * <th align="center">Notes</th>
2029 * </tr>
2030 * </thead>
2031 * <tbody>
2032 * <tr>
2033 * <td align="center">INACTIVE</td>
2034 * <td align="center">Camera device finished AWB scan</td>
2035 * <td align="center">CONVERGED</td>
2036 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
2037 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08002038 * <tr>
2039 * <td align="center">LOCKED</td>
2040 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
2041 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08002042 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08002043 * </tr>
2044 * </tbody>
2045 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002046 * <p><b>Possible values:</b>
2047 * <ul>
2048 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
2049 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
2050 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
2051 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
2052 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002053 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002054 * <p><b>Limited capability</b> -
2055 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2056 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08002057 *
2058 * @see CaptureRequest#CONTROL_AWB_LOCK
2059 * @see CaptureRequest#CONTROL_AWB_MODE
2060 * @see CaptureRequest#CONTROL_MODE
2061 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002062 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002063 * @see #CONTROL_AWB_STATE_INACTIVE
2064 * @see #CONTROL_AWB_STATE_SEARCHING
2065 * @see #CONTROL_AWB_STATE_CONVERGED
2066 * @see #CONTROL_AWB_STATE_LOCKED
2067 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002068 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002069 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002070 public static final Key<Integer> CONTROL_AWB_STATE =
2071 new Key<Integer>("android.control.awbState", int.class);
2072
2073 /**
Zhijun He379af012014-05-06 11:54:54 -07002074 * <p>A special color effect to apply.</p>
2075 * <p>When this mode is set, a color effect will be applied
2076 * to images produced by the camera device. The interpretation
2077 * and implementation of these color effects is left to the
2078 * implementor of the camera device, and should not be
2079 * depended on to be consistent (or present) across all
2080 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002081 * <p><b>Possible values:</b>
2082 * <ul>
2083 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
2084 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
2085 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
2086 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
2087 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
2088 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
2089 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
2090 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
2091 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
2092 * </ul></p>
2093 * <p><b>Available values for this device:</b><br>
2094 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002095 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002096 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002097 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07002098 * @see #CONTROL_EFFECT_MODE_OFF
2099 * @see #CONTROL_EFFECT_MODE_MONO
2100 * @see #CONTROL_EFFECT_MODE_NEGATIVE
2101 * @see #CONTROL_EFFECT_MODE_SOLARIZE
2102 * @see #CONTROL_EFFECT_MODE_SEPIA
2103 * @see #CONTROL_EFFECT_MODE_POSTERIZE
2104 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
2105 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
2106 * @see #CONTROL_EFFECT_MODE_AQUA
2107 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002108 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002109 @NonNull
Zhijun He379af012014-05-06 11:54:54 -07002110 public static final Key<Integer> CONTROL_EFFECT_MODE =
2111 new Key<Integer>("android.control.effectMode", int.class);
2112
2113 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002114 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08002115 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002116 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08002117 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08002118 * capture parameters itself.</p>
2119 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002120 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Shuzhen Wang796863a2020-03-16 16:00:18 -07002121 * <p>When set to USE_SCENE_MODE or USE_EXTENDED_SCENE_MODE, the individual controls in
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002122 * android.control.* are mostly disabled, and the camera device
Shuzhen Wang796863a2020-03-16 16:00:18 -07002123 * implements one of the scene mode or extended scene mode settings (such as ACTION,
2124 * SUNSET, PARTY, or BOKEH) as it wishes. The camera device scene mode
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002125 * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08002126 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
2127 * is that this frame will not be used by camera device background 3A statistics
2128 * update, as if this frame is never captured. This mode can be used in the scenario
2129 * where the application doesn't want a 3A manual control capture to affect
2130 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002131 * <p><b>Possible values:</b>
2132 * <ul>
2133 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
2134 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
2135 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
2136 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
Shuzhen Wang796863a2020-03-16 16:00:18 -07002137 * <li>{@link #CONTROL_MODE_USE_EXTENDED_SCENE_MODE USE_EXTENDED_SCENE_MODE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002138 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002139 * <p><b>Available values for this device:</b><br>
2140 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002141 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002142 *
2143 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002144 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002145 * @see #CONTROL_MODE_OFF
2146 * @see #CONTROL_MODE_AUTO
2147 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08002148 * @see #CONTROL_MODE_OFF_KEEP_STATE
Shuzhen Wang796863a2020-03-16 16:00:18 -07002149 * @see #CONTROL_MODE_USE_EXTENDED_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002150 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002151 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002152 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002153 public static final Key<Integer> CONTROL_MODE =
2154 new Key<Integer>("android.control.mode", int.class);
2155
2156 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002157 * <p>Control for which scene mode is currently active.</p>
2158 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
2159 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07002160 * <p>This is the mode that that is active when
Zhijun Heee2ebde2015-06-16 19:58:11 -07002161 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
2162 * 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}
2163 * while in use.</p>
Zhijun He379af012014-05-06 11:54:54 -07002164 * <p>The interpretation and implementation of these scene modes is left
2165 * to the implementor of the camera device. Their behavior will not be
2166 * consistent across all devices, and any given device may only implement
2167 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002168 * <p><b>Possible values:</b>
2169 * <ul>
2170 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
2171 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
2172 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
2173 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
2174 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
2175 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
2176 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
2177 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
2178 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
2179 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
2180 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
2181 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
2182 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
2183 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
2184 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
2185 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
2186 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
2187 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002188 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002189 * </ul></p>
2190 * <p><b>Available values for this device:</b><br>
2191 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002192 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002193 *
2194 * @see CaptureRequest#CONTROL_AE_MODE
2195 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002196 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07002197 * @see CaptureRequest#CONTROL_AWB_MODE
2198 * @see CaptureRequest#CONTROL_MODE
2199 * @see #CONTROL_SCENE_MODE_DISABLED
2200 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
2201 * @see #CONTROL_SCENE_MODE_ACTION
2202 * @see #CONTROL_SCENE_MODE_PORTRAIT
2203 * @see #CONTROL_SCENE_MODE_LANDSCAPE
2204 * @see #CONTROL_SCENE_MODE_NIGHT
2205 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
2206 * @see #CONTROL_SCENE_MODE_THEATRE
2207 * @see #CONTROL_SCENE_MODE_BEACH
2208 * @see #CONTROL_SCENE_MODE_SNOW
2209 * @see #CONTROL_SCENE_MODE_SUNSET
2210 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
2211 * @see #CONTROL_SCENE_MODE_FIREWORKS
2212 * @see #CONTROL_SCENE_MODE_SPORTS
2213 * @see #CONTROL_SCENE_MODE_PARTY
2214 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
2215 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07002216 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002217 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07002218 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002219 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002220 @NonNull
Zhijun He379af012014-05-06 11:54:54 -07002221 public static final Key<Integer> CONTROL_SCENE_MODE =
2222 new Key<Integer>("android.control.sceneMode", int.class);
2223
2224 /**
2225 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002226 * active.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002227 * <p>Video stabilization automatically warps images from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002228 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07002229 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07002230 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002231 * <p>Switching between different video stabilization modes may take several
2232 * frames to initialize, the camera device will report the current mode
2233 * in capture result metadata. For example, When "ON" mode is requested,
2234 * the video stabilization modes in the first several capture results may
2235 * still be "OFF", and it will become "ON" when the initialization is
2236 * done.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002237 * <p>In addition, not all recording sizes or frame rates may be supported for
2238 * stabilization by a device that reports stabilization support. It is guaranteed
2239 * that an output targeting a MediaRecorder or MediaCodec will be stabilized if
2240 * the recording resolution is less than or equal to 1920 x 1080 (width less than
2241 * or equal to 1920, height less than or equal to 1080), and the recording
2242 * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult
2243 * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return
2244 * OFF if the recording output is not stabilized, or if there are no output
2245 * Surface types that can be stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002246 * <p>If a camera device supports both this mode and OIS
2247 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
2248 * produce undesirable interaction, so it is recommended not to enable
2249 * both at the same time.</p>
2250 * <p><b>Possible values:</b>
2251 * <ul>
2252 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
2253 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
2254 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002255 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002256 *
Jianing Wei2813b0f2015-09-29 14:24:36 -07002257 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Zhijun He45fa43a12014-06-13 18:29:37 -07002258 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07002259 * @see CaptureRequest#SCALER_CROP_REGION
2260 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
2261 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
2262 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002263 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002264 @NonNull
Zhijun He379af012014-05-06 11:54:54 -07002265 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
2266 new Key<Integer>("android.control.videoStabilizationMode", int.class);
2267
2268 /**
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002269 * <p>The amount of additional sensitivity boost applied to output images
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002270 * after RAW sensor data is captured.</p>
2271 * <p>Some camera devices support additional digital sensitivity boosting in the
2272 * camera processing pipeline after sensor RAW image is captured.
2273 * Such a boost will be applied to YUV/JPEG format output images but will not
2274 * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p>
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002275 * <p>This key will be <code>null</code> for devices that do not support any RAW format
2276 * outputs. For devices that do support RAW format outputs, this key will always
2277 * present, and if a device does not support post RAW sensitivity boost, it will
2278 * list <code>100</code> in this key.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002279 * <p>If the camera device cannot apply the exact boost requested, it will reduce the
2280 * boost to the nearest supported value.
2281 * The final boost value used will be available in the output capture result.</p>
2282 * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images
2283 * of such device will have the total sensitivity of
Yin-Chia Yeh67e61b62016-01-26 13:27:35 -08002284 * <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} / 100</code>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002285 * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p>
2286 * <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
2287 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2288 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
2289 * <p><b>Range of valid values:</b><br>
2290 * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002291 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002292 *
2293 * @see CaptureRequest#CONTROL_AE_MODE
2294 * @see CaptureRequest#CONTROL_MODE
2295 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
2296 * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE
2297 * @see CaptureRequest#SENSOR_SENSITIVITY
2298 */
2299 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002300 @NonNull
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002301 public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST =
2302 new Key<Integer>("android.control.postRawSensitivityBoost", int.class);
2303
2304 /**
Chien-Yu Chene4491712017-01-11 11:14:06 -08002305 * <p>Allow camera device to enable zero-shutter-lag mode for requests with
2306 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p>
2307 * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with
2308 * STILL_CAPTURE capture intent. The camera device may use images captured in the past to
2309 * produce output images for a zero-shutter-lag request. The result metadata including the
2310 * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images.
2311 * Therefore, the contents of the output images and the result metadata may be out of order
2312 * compared to previous regular requests. enableZsl does not affect requests with other
2313 * capture intents.</p>
2314 * <p>For example, when requests are submitted in the following order:
2315 * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW
2316 * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p>
2317 * <p>The output images for request B may have contents captured before the output images for
2318 * request A, and the result metadata for request B may be older than the result metadata for
2319 * request A.</p>
Chien-Yu Chen1d72ee32017-04-18 15:23:06 -07002320 * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in
2321 * the past for requests with STILL_CAPTURE capture intent.</p>
2322 * <p>For applications targeting SDK versions O and newer, the value of enableZsl in
2323 * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always
2324 * <code>false</code> if present.</p>
2325 * <p>For applications targeting SDK versions older than O, the value of enableZsl in all
2326 * capture templates is always <code>false</code> if present.</p>
Chien-Yu Chen81026382017-05-03 12:30:58 -07002327 * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002328 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Chien-Yu Chene4491712017-01-11 11:14:06 -08002329 *
2330 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
2331 * @see CaptureResult#SENSOR_TIMESTAMP
2332 */
2333 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002334 @NonNull
Chien-Yu Chene4491712017-01-11 11:14:06 -08002335 public static final Key<Boolean> CONTROL_ENABLE_ZSL =
2336 new Key<Boolean>("android.control.enableZsl", boolean.class);
2337
2338 /**
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002339 * <p>Whether a significant scene change is detected within the currently-set AF
2340 * region(s).</p>
2341 * <p>When the camera focus routine detects a change in the scene it is looking at,
2342 * such as a large shift in camera viewpoint, significant motion in the scene, or a
2343 * significant illumination change, this value will be set to DETECTED for a single capture
2344 * result. Otherwise the value will be NOT_DETECTED. The threshold for detection is similar
2345 * to what would trigger a new passive focus scan to begin in CONTINUOUS autofocus modes.</p>
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002346 * <p>This key will be available if the camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p>
Chien-Yu Chene8d86eb2017-11-27 15:42:44 -08002347 * <p><b>Possible values:</b>
2348 * <ul>
2349 * <li>{@link #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED NOT_DETECTED}</li>
2350 * <li>{@link #CONTROL_AF_SCENE_CHANGE_DETECTED DETECTED}</li>
2351 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002352 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Chien-Yu Chene8d86eb2017-11-27 15:42:44 -08002353 * @see #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED
2354 * @see #CONTROL_AF_SCENE_CHANGE_DETECTED
2355 */
2356 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002357 @NonNull
Chien-Yu Chene8d86eb2017-11-27 15:42:44 -08002358 public static final Key<Integer> CONTROL_AF_SCENE_CHANGE =
2359 new Key<Integer>("android.control.afSceneChange", int.class);
2360
2361 /**
Shuzhen Wang796863a2020-03-16 16:00:18 -07002362 * <p>Whether extended scene mode is enabled for a particular capture request.</p>
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002363 * <p>With bokeh mode, the camera device may blur out the parts of scene that are not in
2364 * focus, creating a bokeh (or shallow depth of field) effect for people or objects.</p>
Shuzhen Wang796863a2020-03-16 16:00:18 -07002365 * <p>When set to BOKEH_STILL_CAPTURE mode with STILL_CAPTURE capture intent, due to the extra
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002366 * processing needed for high quality bokeh effect, the stall may be longer than when
2367 * capture intent is not STILL_CAPTURE.</p>
Shuzhen Wang796863a2020-03-16 16:00:18 -07002368 * <p>When set to BOKEH_STILL_CAPTURE mode with PREVIEW capture intent,</p>
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002369 * <ul>
2370 * <li>If the camera device has BURST_CAPTURE capability, the frame rate requirement of
2371 * BURST_CAPTURE must still be met.</li>
Shuzhen Wang796863a2020-03-16 16:00:18 -07002372 * <li>All streams not larger than the maximum streaming dimension for BOKEH_STILL_CAPTURE mode
2373 * (queried via {@link android.hardware.camera2.CameraCharacteristics#CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES })
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002374 * will have preview bokeh effect applied.</li>
2375 * </ul>
Shuzhen Wang796863a2020-03-16 16:00:18 -07002376 * <p>When set to BOKEH_CONTINUOUS mode, configured streams dimension should not exceed this mode's
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002377 * maximum streaming dimension in order to have bokeh effect applied. Bokeh effect may not
2378 * be available for streams larger than the maximum streaming dimension.</p>
Shuzhen Wang796863a2020-03-16 16:00:18 -07002379 * <p>Switching between different extended scene modes may involve reconfiguration of the camera
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002380 * pipeline, resulting in long latency. The application should check this key against the
2381 * available session keys queried via
2382 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</p>
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002383 * <p>For a logical multi-camera, bokeh may be implemented by stereo vision from sub-cameras
2384 * with different field of view. As a result, when bokeh mode is enabled, the camera device
Shuzhen Wang796863a2020-03-16 16:00:18 -07002385 * may override {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} or {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, and the field of
2386 * view may be smaller than when bokeh mode is off.</p>
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002387 * <p><b>Possible values:</b>
2388 * <ul>
Shuzhen Wang796863a2020-03-16 16:00:18 -07002389 * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_DISABLED DISABLED}</li>
2390 * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE BOKEH_STILL_CAPTURE}</li>
2391 * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS BOKEH_CONTINUOUS}</li>
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002392 * </ul></p>
2393 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvalad2d749a2020-01-06 16:10:29 -08002394 *
Shuzhen Wang796863a2020-03-16 16:00:18 -07002395 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Eino-Ville Talvalad2d749a2020-01-06 16:10:29 -08002396 * @see CaptureRequest#SCALER_CROP_REGION
Shuzhen Wang796863a2020-03-16 16:00:18 -07002397 * @see #CONTROL_EXTENDED_SCENE_MODE_DISABLED
2398 * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE
2399 * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002400 */
2401 @PublicKey
2402 @NonNull
Shuzhen Wang796863a2020-03-16 16:00:18 -07002403 public static final Key<Integer> CONTROL_EXTENDED_SCENE_MODE =
2404 new Key<Integer>("android.control.extendedSceneMode", int.class);
Shuzhen Wang1ab85142019-07-08 15:14:16 -07002405
2406 /**
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002407 * <p>The desired zoom ratio</p>
2408 * <p>Instead of using {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} with dual purposes of crop and zoom, the
2409 * application can now choose to use this tag to specify the desired zoom level. The
2410 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} can still be used to specify the horizontal or vertical
2411 * crop to achieve aspect ratios different than the native camera sensor.</p>
2412 * <p>By using this control, the application gains a simpler way to control zoom, which can
Shuzhen Wang69cf0fd2020-03-13 09:40:58 -07002413 * be a combination of optical and digital zoom. For example, a multi-camera system may
2414 * contain more than one lens with different focal lengths, and the user can use optical
Eino-Ville Talvala403ea082020-05-11 10:17:21 -07002415 * zoom by switching between lenses. Using zoomRatio has benefits in the scenarios below:</p>
2416 * <ul>
2417 * <li>Zooming in from a wide-angle lens to a telephoto lens: A floating-point ratio provides
2418 * better precision compared to an integer value of {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</li>
2419 * <li>Zooming out from a wide lens to an ultrawide lens: zoomRatio supports zoom-out whereas
2420 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} doesn't.</li>
2421 * </ul>
Shuzhen Wang69cf0fd2020-03-13 09:40:58 -07002422 * <p>To illustrate, here are several scenarios of different zoom ratios, crop regions,
2423 * and output streams, for a hypothetical camera device with an active array of size
2424 * <code>(2000,1500)</code>.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002425 * <ul>
Shuzhen Wang69cf0fd2020-03-13 09:40:58 -07002426 * <li>Camera Configuration:<ul>
2427 * <li>Active array size: <code>2000x1500</code> (3 MP, 4:3 aspect ratio)</li>
2428 * <li>Output stream #1: <code>640x480</code> (VGA, 4:3 aspect ratio)</li>
2429 * <li>Output stream #2: <code>1280x720</code> (720p, 16:9 aspect ratio)</li>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002430 * </ul>
Shuzhen Wang69cf0fd2020-03-13 09:40:58 -07002431 * </li>
2432 * <li>Case #1: 4:3 crop region with 2.0x zoom ratio<ul>
2433 * <li>Zoomed field of view: 1/4 of original field of view</li>
2434 * <li>Crop region: <code>Rect(0, 0, 2000, 1500) // (left, top, right, bottom)</code> (post zoom)</li>
2435 * </ul>
2436 * </li>
2437 * <li><img alt="4:3 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.control.zoomRatio/zoom-ratio-2-crop-43.png" /><ul>
2438 * <li><code>640x480</code> stream source area: <code>(0, 0, 2000, 1500)</code> (equal to crop region)</li>
2439 * <li><code>1280x720</code> stream source area: <code>(0, 187, 2000, 1312)</code> (letterboxed)</li>
2440 * </ul>
2441 * </li>
2442 * <li>Case #2: 16:9 crop region with 2.0x zoom.<ul>
2443 * <li>Zoomed field of view: 1/4 of original field of view</li>
2444 * <li>Crop region: <code>Rect(0, 187, 2000, 1312)</code></li>
2445 * <li><img alt="16:9 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.control.zoomRatio/zoom-ratio-2-crop-169.png" /></li>
2446 * <li><code>640x480</code> stream source area: <code>(250, 187, 1750, 1312)</code> (pillarboxed)</li>
2447 * <li><code>1280x720</code> stream source area: <code>(0, 187, 2000, 1312)</code> (equal to crop region)</li>
2448 * </ul>
2449 * </li>
2450 * <li>Case #3: 1:1 crop region with 0.5x zoom out to ultrawide lens.<ul>
2451 * <li>Zoomed field of view: 4x of original field of view (switched from wide lens to ultrawide lens)</li>
2452 * <li>Crop region: <code>Rect(250, 0, 1750, 1500)</code></li>
2453 * <li><img alt="1:1 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.control.zoomRatio/zoom-ratio-0.5-crop-11.png" /></li>
2454 * <li><code>640x480</code> stream source area: <code>(250, 187, 1750, 1312)</code> (letterboxed)</li>
2455 * <li><code>1280x720</code> stream source area: <code>(250, 328, 1750, 1172)</code> (letterboxed)</li>
2456 * </ul>
2457 * </li>
2458 * </ul>
2459 * <p>As seen from the graphs above, the coordinate system of cropRegion now changes to the
2460 * effective after-zoom field-of-view, and is represented by the rectangle of (0, 0,
2461 * activeArrayWith, activeArrayHeight). The same applies to AE/AWB/AF regions, and faces.
2462 * This coordinate system change isn't applicable to RAW capture and its related
2463 * metadata such as intrinsicCalibration and lensShadingMap.</p>
2464 * <p>Using the same hypothetical example above, and assuming output stream #1 (640x480) is
2465 * the viewfinder stream, the application can achieve 2.0x zoom in one of two ways:</p>
2466 * <ul>
2467 * <li>zoomRatio = 2.0, scaler.cropRegion = (0, 0, 2000, 1500)</li>
2468 * <li>zoomRatio = 1.0 (default), scaler.cropRegion = (500, 375, 1500, 1125)</li>
2469 * </ul>
2470 * <p>If the application intends to set aeRegions to be top-left quarter of the viewfinder
2471 * field-of-view, the {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions} should be set to (0, 0, 1000, 750) with
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002472 * zoomRatio set to 2.0. Alternatively, the application can set aeRegions to the equivalent
Shuzhen Wang69cf0fd2020-03-13 09:40:58 -07002473 * region of (500, 375, 1000, 750) for zoomRatio of 1.0. If the application doesn't
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002474 * explicitly set {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, its value defaults to 1.0.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002475 * <p>One limitation of controlling zoom using zoomRatio is that the {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}
2476 * must only be used for letterboxing or pillarboxing of the sensor active array, and no
2477 * FREEFORM cropping can be used with {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} other than 1.0.</p>
2478 * <p><b>Range of valid values:</b><br>
2479 * {@link CameraCharacteristics#CONTROL_ZOOM_RATIO_RANGE android.control.zoomRatioRange}</p>
2480 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2481 * <p><b>Limited capability</b> -
2482 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2483 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2484 *
2485 * @see CaptureRequest#CONTROL_AE_REGIONS
2486 * @see CaptureRequest#CONTROL_ZOOM_RATIO
2487 * @see CameraCharacteristics#CONTROL_ZOOM_RATIO_RANGE
2488 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2489 * @see CaptureRequest#SCALER_CROP_REGION
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002490 */
2491 @PublicKey
2492 @NonNull
2493 public static final Key<Float> CONTROL_ZOOM_RATIO =
2494 new Key<Float>("android.control.zoomRatio", float.class);
2495
2496 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002497 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08002498 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002499 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2500 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002501 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08002502 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08002503 * camera device will use the highest-quality enhancement algorithms,
2504 * even if it slows down capture rate. FAST means the camera device will
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002505 * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
2506 * edge enhancement will slow down capture rate. Every output stream will have a similar
2507 * amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002508 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2509 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2510 * into a final capture when triggered by the user. In this mode, the camera device applies
2511 * edge enhancement to low-resolution streams (below maximum recording resolution) to
2512 * maximize preview quality, but does not apply edge enhancement to high-resolution streams,
2513 * since those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002514 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2515 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002516 * The camera device may adjust its internal edge enhancement parameters for best
Zhijun He0e99c222015-01-29 15:26:05 -08002517 * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002518 * <p><b>Possible values:</b>
2519 * <ul>
2520 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2521 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2522 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002523 * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002524 * </ul></p>
2525 * <p><b>Available values for this device:</b><br>
2526 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002527 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002528 * <p><b>Full capability</b> -
2529 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2530 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002531 *
2532 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002533 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002534 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002535 * @see #EDGE_MODE_OFF
2536 * @see #EDGE_MODE_FAST
2537 * @see #EDGE_MODE_HIGH_QUALITY
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002538 * @see #EDGE_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002539 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002540 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002541 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002542 public static final Key<Integer> EDGE_MODE =
2543 new Key<Integer>("android.edge.mode", int.class);
2544
2545 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002546 * <p>The desired mode for for the camera device's flash control.</p>
2547 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002548 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002549 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2550 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2551 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2552 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2553 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2554 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002555 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002556 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2557 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2558 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002559 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002560 * <p><b>Possible values:</b>
2561 * <ul>
2562 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2563 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2564 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2565 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002566 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002567 *
2568 * @see CaptureRequest#CONTROL_AE_MODE
2569 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2570 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002571 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002572 * @see #FLASH_MODE_OFF
2573 * @see #FLASH_MODE_SINGLE
2574 * @see #FLASH_MODE_TORCH
2575 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002576 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002577 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002578 public static final Key<Integer> FLASH_MODE =
2579 new Key<Integer>("android.flash.mode", int.class);
2580
2581 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002582 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002583 * unit.</p>
2584 * <p>When the camera device doesn't have flash unit
2585 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2586 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002587 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2588 * <ul>
2589 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2590 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002591 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002592 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002593 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002594 * </ul>
2595 * <p>In all other conditions the state will not be available on
2596 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002597 * <p><b>Possible values:</b>
2598 * <ul>
2599 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2600 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2601 * <li>{@link #FLASH_STATE_READY READY}</li>
2602 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2603 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2604 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002605 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002606 * <p><b>Limited capability</b> -
2607 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2608 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002609 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002610 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002611 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002612 * @see CaptureRequest#FLASH_MODE
2613 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002614 * @see #FLASH_STATE_UNAVAILABLE
2615 * @see #FLASH_STATE_CHARGING
2616 * @see #FLASH_STATE_READY
2617 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002618 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002619 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002620 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002621 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002622 public static final Key<Integer> FLASH_STATE =
2623 new Key<Integer>("android.flash.state", int.class);
2624
2625 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002626 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002627 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002628 * that do not accurately measure the incoming light (i.e. pixels that
2629 * are stuck at an arbitrary value or are oversensitive).</p>
2630 * <p><b>Possible values:</b>
2631 * <ul>
2632 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2633 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2634 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2635 * </ul></p>
2636 * <p><b>Available values for this device:</b><br>
2637 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002638 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002639 *
2640 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002641 * @see #HOT_PIXEL_MODE_OFF
2642 * @see #HOT_PIXEL_MODE_FAST
2643 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2644 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002645 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002646 @NonNull
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002647 public static final Key<Integer> HOT_PIXEL_MODE =
2648 new Key<Integer>("android.hotPixel.mode", int.class);
2649
2650 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002651 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002652 * <p>Setting a location object in a request will include the GPS coordinates of the location
2653 * into any JPEG images captured based on the request. These coordinates can then be
2654 * viewed by anyone who receives the JPEG image.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002655 * <p>This tag is also used for HEIC image capture.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002656 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002657 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002658 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002659 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07002660 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002661 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2662 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2663
2664 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002665 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002666 * EXIF.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002667 * <p>This tag is also used for HEIC image capture.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002668 * <p><b>Range of valid values:</b><br>
2669 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002670 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002671 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002672 */
2673 public static final Key<double[]> JPEG_GPS_COORDINATES =
2674 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2675
2676 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002677 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002678 * include in EXIF.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002679 * <p>This tag is also used for HEIC image capture.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002680 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002681 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002682 */
2683 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2684 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2685
2686 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002687 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002688 * EXIF.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002689 * <p>This tag is also used for HEIC image capture.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002690 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002691 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002692 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002693 */
2694 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2695 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2696
2697 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002698 * <p>The orientation for a JPEG image.</p>
2699 * <p>The clockwise rotation angle in degrees, relative to the orientation
2700 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2701 * upright.</p>
2702 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07002703 * rotate the image data to match this orientation. When the image data is rotated,
2704 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002705 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2706 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
Emilian Peev3abc7512018-03-28 11:22:26 +01002707 * <p>To translate from the device orientation given by the Android sensor APIs for camera
2708 * sensors which are not EXTERNAL, the following sample code may be used:</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002709 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2710 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2711 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2712 *
2713 * // Round device orientation to a multiple of 90
2714 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2715 *
2716 * // Reverse device orientation for front-facing cameras
2717 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2718 * if (facingFront) deviceOrientation = -deviceOrientation;
2719 *
2720 * // Calculate desired JPEG orientation relative to camera orientation to make
2721 * // the image upright relative to the device orientation
2722 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2723 *
2724 * return jpegOrientation;
2725 * }
2726 * </code></pre>
Emilian Peev3abc7512018-03-28 11:22:26 +01002727 * <p>For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will
2728 * also be set to EXTERNAL. The above code is not relevant in such case.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002729 * <p>This tag is also used to describe the orientation of the HEIC image capture, in which
2730 * case the rotation is reflected by
2731 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}, and not by
2732 * rotating the image data itself.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002733 * <p><b>Units</b>: Degrees in multiples of 90</p>
2734 * <p><b>Range of valid values:</b><br>
2735 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002736 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002737 *
2738 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002739 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002740 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002741 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002742 public static final Key<Integer> JPEG_ORIENTATION =
2743 new Key<Integer>("android.jpeg.orientation", int.class);
2744
2745 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002746 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002747 * image.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002748 * <p>85-95 is typical usage range. This tag is also used to describe the quality
2749 * of the HEIC image capture.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002750 * <p><b>Range of valid values:</b><br>
2751 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002752 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002753 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002754 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002755 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002756 public static final Key<Byte> JPEG_QUALITY =
2757 new Key<Byte>("android.jpeg.quality", byte.class);
2758
2759 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002760 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002761 * thumbnail.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002762 * <p>This tag is also used to describe the quality of the HEIC image capture.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002763 * <p><b>Range of valid values:</b><br>
2764 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002765 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002766 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002767 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002768 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002769 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2770 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2771
2772 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002773 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002774 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2775 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002776 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2777 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002778 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2779 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2780 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2781 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2782 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2783 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002784 * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested,
2785 * the camera device will handle thumbnail rotation in one of the following ways:</p>
2786 * <ul>
2787 * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
2788 * and keep jpeg and thumbnail image data unrotated.</li>
2789 * <li>Rotate the jpeg and thumbnail image data and not set
2790 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
2791 * case, LIMITED or FULL hardware level devices will report rotated thumnail size in
2792 * capture result, so the width and height will be interchanged if 90 or 270 degree
2793 * orientation is requested. LEGACY device will always report unrotated thumbnail
2794 * size.</li>
2795 * </ul>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002796 * <p>The tag is also used as thumbnail size for HEIC image format capture, in which case the
2797 * the thumbnail rotation is reflected by
2798 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}, and not by
2799 * rotating the thumbnail data itself.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002800 * <p><b>Range of valid values:</b><br>
2801 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002802 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002803 *
2804 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002805 * @see CaptureRequest#JPEG_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002806 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002807 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002808 @NonNull
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002809 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2810 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002811
2812 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002813 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2814 * effective aperture diameter.</p>
2815 * <p>Setting this value is only supported on the camera devices that have a variable
2816 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002817 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2818 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002819 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002820 * to achieve manual exposure control.</p>
2821 * <p>The requested aperture value may take several frames to reach the
2822 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002823 * aperture size in capture result metadata while the aperture is changing.
2824 * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002825 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2826 * the ON modes, this will be overridden by the camera device
2827 * auto-exposure algorithm, the overridden values are then provided
2828 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002829 * <p><b>Units</b>: The f-number (f/N)</p>
2830 * <p><b>Range of valid values:</b><br>
2831 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002832 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002833 * <p><b>Full capability</b> -
2834 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2835 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002836 *
Zhijun He399f05d2014-01-15 11:31:30 -08002837 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002838 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002839 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002840 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002841 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002842 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002843 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002844 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002845 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002846 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002847 public static final Key<Float> LENS_APERTURE =
2848 new Key<Float>("android.lens.aperture", float.class);
2849
2850 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002851 * <p>The desired setting for the lens neutral density filter(s).</p>
2852 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002853 * <p>Lens filters are typically used to lower the amount of light the
2854 * sensor is exposed to (measured in steps of EV). As used here, an EV
2855 * step is the standard logarithmic representation, which are
2856 * non-negative, and inversely proportional to the amount of light
2857 * hitting the sensor. For example, setting this to 0 would result
2858 * in no reduction of the incoming light, and setting this to 2 would
2859 * mean that the filter is set to reduce incoming light by two stops
2860 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002861 * <p>It may take several frames before the lens filter density changes
2862 * to the requested value. While the filter density is still changing,
2863 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002864 * <p><b>Units</b>: Exposure Value (EV)</p>
2865 * <p><b>Range of valid values:</b><br>
2866 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002867 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002868 * <p><b>Full capability</b> -
2869 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2870 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002871 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002872 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002873 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002874 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002875 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002876 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002877 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002878 public static final Key<Float> LENS_FILTER_DENSITY =
2879 new Key<Float>("android.lens.filterDensity", float.class);
2880
2881 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002882 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002883 * <p>This setting controls the physical focal length of the camera
2884 * device's lens. Changing the focal length changes the field of
2885 * view of the camera device, and is usually used for optical zoom.</p>
2886 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2887 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002888 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002889 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2890 * be set to MOVING.</p>
Shuzhen Wang69cf0fd2020-03-13 09:40:58 -07002891 * <p>Optical zoom via this control will not be supported on most devices. Starting from API
2892 * level 30, the camera device may combine optical and digital zoom through the
2893 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} control.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002894 * <p><b>Units</b>: Millimeters</p>
2895 * <p><b>Range of valid values:</b><br>
2896 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002897 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002898 *
Shuzhen Wang69cf0fd2020-03-13 09:40:58 -07002899 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Ruben Brunka20f4c22014-01-17 15:21:13 -08002900 * @see CaptureRequest#LENS_APERTURE
2901 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002902 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002903 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002904 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002905 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002906 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002907 public static final Key<Float> LENS_FOCAL_LENGTH =
2908 new Key<Float>("android.lens.focalLength", float.class);
2909
2910 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002911 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002912 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002913 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002914 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2915 * <p><b>Range of valid values:</b><br>
2916 * &gt;= 0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002917 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002918 * <p><b>Full capability</b> -
2919 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2920 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2921 *
2922 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002923 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002924 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002925 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002926 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002927 public static final Key<Float> LENS_FOCUS_DISTANCE =
2928 new Key<Float>("android.lens.focusDistance", float.class);
2929
2930 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002931 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002932 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002933 * <p>If variable focus not supported, can still report
2934 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002935 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2936 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2937 * <p><b>Range of valid values:</b><br>
2938 * &gt;=0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002939 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002940 * <p><b>Limited capability</b> -
2941 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2942 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2943 *
2944 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002945 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002946 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002947 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002948 @NonNull
Igor Murashkin57438682014-05-30 10:49:00 -07002949 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2950 new Key<android.util.Pair<Float,Float>>("android.lens.focusRange", new TypeReference<android.util.Pair<Float,Float>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002951
2952 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002953 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2954 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002955 * <p>OIS is used to compensate for motion blur due to small
2956 * movements of the camera during capture. Unlike digital image
2957 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2958 * makes use of mechanical elements to stabilize the camera
2959 * sensor, and thus allows for longer exposure times before
2960 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002961 * <p>Switching between different optical stabilization modes may take several
2962 * frames to initialize, the camera device will report the current mode in
2963 * capture result metadata. For example, When "ON" mode is requested, the
2964 * optical stabilization modes in the first several capture results may still
2965 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002966 * <p>If a camera device supports both OIS and digital image stabilization
2967 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2968 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002969 * <p>Not all devices will support OIS; see
2970 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2971 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002972 * <p><b>Possible values:</b>
2973 * <ul>
2974 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2975 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2976 * </ul></p>
2977 * <p><b>Available values for this device:</b><br>
2978 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002979 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002980 * <p><b>Limited capability</b> -
2981 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2982 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002983 *
2984 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002985 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002986 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002987 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2988 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2989 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002990 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002991 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002992 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2993 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2994
2995 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002996 * <p>Current lens status.</p>
2997 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2998 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2999 * they may take several frames to reach the requested values. This state indicates
3000 * the current status of the lens parameters.</p>
3001 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
3002 * either because the parameters are all fixed, or because the lens has had enough
3003 * time to reach the most recently-requested values.
3004 * If all these lens parameters are not changable for a camera device, as listed below:</p>
3005 * <ul>
3006 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
3007 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
3008 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
3009 * which means the optical zoom is not supported.</li>
3010 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
3011 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
3012 * </ul>
3013 * <p>Then this state will always be STATIONARY.</p>
3014 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
3015 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003016 * <p><b>Possible values:</b>
3017 * <ul>
3018 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
3019 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
3020 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003021 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003022 * <p><b>Limited capability</b> -
3023 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3024 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08003025 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003026 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08003027 * @see CaptureRequest#LENS_APERTURE
3028 * @see CaptureRequest#LENS_FILTER_DENSITY
3029 * @see CaptureRequest#LENS_FOCAL_LENGTH
3030 * @see CaptureRequest#LENS_FOCUS_DISTANCE
3031 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
3032 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
3033 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
3034 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003035 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07003036 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003037 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003038 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003039 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003040 public static final Key<Integer> LENS_STATE =
3041 new Key<Integer>("android.lens.state", int.class);
3042
3043 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003044 * <p>The orientation of the camera relative to the sensor
3045 * coordinate system.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07003046 * <p>The four coefficients that describe the quaternion
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003047 * rotation from the Android sensor coordinate system to a
3048 * camera-aligned coordinate system where the X-axis is
3049 * aligned with the long side of the image sensor, the Y-axis
3050 * is aligned with the short side of the image sensor, and
3051 * the Z-axis is aligned with the optical axis of the sensor.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07003052 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003053 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
3054 * amount <code>theta</code>, the following formulas can be used:</p>
3055 * <pre><code> theta = 2 * acos(w)
3056 * a_x = x / sin(theta/2)
3057 * a_y = y / sin(theta/2)
3058 * a_z = z / sin(theta/2)
3059 * </code></pre>
3060 * <p>To create a 3x3 rotation matrix that applies the rotation
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07003061 * defined by this quaternion, the following matrix can be
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003062 * used:</p>
3063 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
3064 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
3065 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
3066 * </code></pre>
3067 * <p>This matrix can then be used to apply the rotation to a
3068 * column vector point with</p>
3069 * <p><code>p' = Rp</code></p>
3070 * <p>where <code>p</code> is in the device sensor coordinate system, and
3071 * <code>p'</code> is in the camera-oriented coordinate system.</p>
Shuzhen Wang2071f2e2020-01-08 13:07:06 -08003072 * <p>If {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, the quaternion rotation cannot
3073 * be accurately represented by the camera device, and will be represented by
3074 * default values matching its default facing.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003075 * <p><b>Units</b>:
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07003076 * Quaternion coefficients</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003077 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003078 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Shuzhen Wang2071f2e2020-01-08 13:07:06 -08003079 *
3080 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003081 */
3082 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003083 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003084 public static final Key<float[]> LENS_POSE_ROTATION =
3085 new Key<float[]>("android.lens.poseRotation", float[].class);
3086
3087 /**
3088 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07003089 * <p>The position of the camera device's lens optical center,
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08003090 * as a three-dimensional vector <code>(x,y,z)</code>.</p>
3091 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
3092 * is relative to the optical center of the largest camera device facing in the same
3093 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
3094 * coordinate axes}. Note that only the axis definitions are shared with the sensor
3095 * coordinate system, but not the origin.</p>
3096 * <p>If this device is the largest or only camera device with a given facing, then this
3097 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
3098 * from the main sensor along the +X axis (to the right from the user's perspective) will
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003099 * report <code>(0.03, 0, 0)</code>. Note that this means that, for many computer vision
3100 * applications, the position needs to be negated to convert it to a translation from the
3101 * camera to the origin.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08003102 * <p>To transform a pixel coordinates between two cameras facing the same direction, first
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003103 * the source camera {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} must be corrected for. Then the source
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08003104 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
3105 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
3106 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
3107 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
3108 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
3109 * coordinates.</p>
3110 * <p>To compare this against a real image from the destination camera, the destination camera
3111 * image then needs to be corrected for radial distortion before comparison or sampling.</p>
3112 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003113 * the center of the primary gyroscope on the device. The axis definitions are the same as
3114 * with PRIMARY_CAMERA.</p>
Shuzhen Wang2071f2e2020-01-08 13:07:06 -08003115 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, this position cannot be accurately
3116 * represented by the camera device, and will be represented as <code>(0, 0, 0)</code>.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003117 * <p><b>Units</b>: Meters</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003118 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003119 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003120 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003121 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07003122 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08003123 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003124 * @see CameraCharacteristics#LENS_POSE_ROTATION
3125 */
3126 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003127 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003128 public static final Key<float[]> LENS_POSE_TRANSLATION =
3129 new Key<float[]>("android.lens.poseTranslation", float[].class);
3130
3131 /**
3132 * <p>The parameters for this camera device's intrinsic
3133 * calibration.</p>
3134 * <p>The five calibration parameters that describe the
3135 * transform from camera-centric 3D coordinates to sensor
3136 * pixel coordinates:</p>
3137 * <pre><code>[f_x, f_y, c_x, c_y, s]
3138 * </code></pre>
3139 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
3140 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
3141 * axis, and <code>s</code> is a skew parameter for the sensor plane not
3142 * being aligned with the lens plane.</p>
3143 * <p>These are typically used within a transformation matrix K:</p>
3144 * <pre><code>K = [ f_x, s, c_x,
3145 * 0, f_y, c_y,
3146 * 0 0, 1 ]
3147 * </code></pre>
3148 * <p>which can then be combined with the camera pose rotation
3149 * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003150 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respectively) to calculate the
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003151 * complete transform from world coordinates to pixel
3152 * coordinates:</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003153 * <pre><code>P = [ K 0 * [ R -Rt
3154 * 0 1 ] 0 1 ]
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003155 * </code></pre>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003156 * <p>(Note the negation of poseTranslation when mapping from camera
3157 * to world coordinates, and multiplication by the rotation).</p>
3158 * <p>With <code>p_w</code> being a point in the world coordinate system
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003159 * and <code>p_s</code> being a point in the camera active pixel array
3160 * coordinate system, and with the mapping including the
3161 * homogeneous division by z:</p>
3162 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
3163 * p_s = p_h / z_h
3164 * </code></pre>
3165 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
3166 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
3167 * (depth) in pixel coordinates.</p>
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07003168 * <p>Note that the coordinate system for this transform is the
3169 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
3170 * where <code>(0,0)</code> is the top-left of the
3171 * preCorrectionActiveArraySize rectangle. Once the pose and
3172 * intrinsic calibration transforms have been applied to a
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003173 * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07003174 * transform needs to be applied, and the result adjusted to
3175 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
3176 * system (where <code>(0, 0)</code> is the top-left of the
3177 * activeArraySize rectangle), to determine the final pixel
3178 * coordinate of the world point for processed (non-RAW)
3179 * output buffers.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003180 * <p>For camera devices, the center of pixel <code>(x,y)</code> is located at
3181 * coordinate <code>(x + 0.5, y + 0.5)</code>. So on a device with a
3182 * precorrection active array of size <code>(10,10)</code>, the valid pixel
3183 * indices go from <code>(0,0)-(9,9)</code>, and an perfectly-built camera would
3184 * have an optical center at the exact center of the pixel grid, at
3185 * coordinates <code>(5.0, 5.0)</code>, which is the top-left corner of pixel
3186 * <code>(5,5)</code>.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003187 * <p><b>Units</b>:
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07003188 * Pixels in the
3189 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
3190 * coordinate system.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003191 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003192 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003193 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003194 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003195 * @see CameraCharacteristics#LENS_POSE_ROTATION
3196 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07003197 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07003198 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003199 */
3200 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003201 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003202 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
3203 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
3204
3205 /**
3206 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07003207 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07003208 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07003209 * kappa_3]</code> and two tangential distortion coefficients
3210 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
3211 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07003212 * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07003213 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07003214 * y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07003215 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003216 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07003217 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
3218 * input image that correspond to the pixel values in the
3219 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
3220 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
3221 * </code></pre>
3222 * <p>The pixel coordinates are defined in a normalized
3223 * coordinate system related to the
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07003224 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07003225 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
3226 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
3227 * of both x and y coordinates are normalized to be 1 at the
3228 * edge further from the optical center, so the range
3229 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
3230 * <p>Finally, <code>r</code> represents the radial distance from the
3231 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
3232 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
3233 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003234 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07003235 * Unitless coefficients.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003236 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003237 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07003238 *
3239 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003240 * @deprecated
3241 * <p>This field was inconsistently defined in terms of its
3242 * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p>
3243 *
3244 * @see CameraCharacteristics#LENS_DISTORTION
3245
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003246 */
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003247 @Deprecated
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003248 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003249 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003250 public static final Key<float[]> LENS_RADIAL_DISTORTION =
3251 new Key<float[]>("android.lens.radialDistortion", float[].class);
3252
3253 /**
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003254 * <p>The correction coefficients to correct for this camera device's
3255 * radial and tangential lens distortion.</p>
3256 * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was
3257 * inconsistently defined.</p>
3258 * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2,
3259 * kappa_3]</code> and two tangential distortion coefficients
3260 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
3261 * lens's geometric distortion with the mapping equations:</p>
3262 * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
3263 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
3264 * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
3265 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
3266 * </code></pre>
3267 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
3268 * input image that correspond to the pixel values in the
3269 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
3270 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
3271 * </code></pre>
3272 * <p>The pixel coordinates are defined in a coordinate system
3273 * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
3274 * calibration fields; see that entry for details of the mapping stages.
3275 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code>
3276 * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and
3277 * the range of the coordinates depends on the focal length
3278 * terms of the intrinsic calibration.</p>
3279 * <p>Finally, <code>r</code> represents the radial distance from the
3280 * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p>
3281 * <p>The distortion model used is the Brown-Conrady model.</p>
3282 * <p><b>Units</b>:
3283 * Unitless coefficients.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003284 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003285 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003286 *
3287 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
3288 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
3289 */
3290 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003291 @NonNull
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003292 public static final Key<float[]> LENS_DISTORTION =
3293 new Key<float[]>("android.lens.distortion", float[].class);
3294
3295 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003296 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003297 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08003298 * excessive noise added by the capture process, especially in dark conditions.</p>
3299 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
3300 * YUV domain.</p>
3301 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
3302 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
3303 * This mode is optional, may not be support by all devices. The application should check
3304 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08003305 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
3306 * will be applied. HIGH_QUALITY mode indicates that the camera device
3307 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003308 * even if it slows down capture rate. FAST means the camera device will not
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07003309 * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
3310 * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
3311 * Every output stream will have a similar amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003312 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
3313 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
3314 * into a final capture when triggered by the user. In this mode, the camera device applies
3315 * noise reduction to low-resolution streams (below maximum recording resolution) to maximize
3316 * preview quality, but does not apply noise reduction to high-resolution streams, since
3317 * those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08003318 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
3319 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
3320 * may adjust the noise reduction parameters for best image quality based on the
3321 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003322 * <p><b>Possible values:</b>
3323 * <ul>
3324 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
3325 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
3326 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08003327 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003328 * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003329 * </ul></p>
3330 * <p><b>Available values for this device:</b><br>
3331 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003332 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003333 * <p><b>Full capability</b> -
3334 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3335 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003336 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003337 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003338 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08003339 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003340 * @see #NOISE_REDUCTION_MODE_OFF
3341 * @see #NOISE_REDUCTION_MODE_FAST
3342 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08003343 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003344 * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003345 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003346 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003347 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003348 public static final Key<Integer> NOISE_REDUCTION_MODE =
3349 new Key<Integer>("android.noiseReduction.mode", int.class);
3350
3351 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003352 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003353 * final one for the capture, or only a partial that contains a
3354 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08003355 * values.</p>
3356 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003357 * single capture may not overlap, except for this entry. The
3358 * FINAL buffers must retain FIFO ordering relative to the
3359 * requests that generate them, so the FINAL buffer for frame 3 must
3360 * always be sent to the framework after the FINAL buffer for frame 2, and
3361 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
3362 * in any order relative to other frames, but all PARTIAL buffers for a given
3363 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08003364 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003365 * <p><b>Range of valid values:</b><br>
3366 * Optional. Default value is FINAL.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003367 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003368 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003369 * <p>Not used in HALv3 or newer</p>
3370
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003371 * @hide
3372 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003373 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003374 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
3375 new Key<Boolean>("android.quirks.partialResult", boolean.class);
3376
3377 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003378 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07003379 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08003380 * frameCount value).</p>
3381 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003382 * <p><b>Units</b>: count of frames</p>
3383 * <p><b>Range of valid values:</b><br>
3384 * &gt; 0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003385 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003386 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003387 * <p>Not used in HALv3 or newer</p>
3388
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003389 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003390 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003391 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003392 public static final Key<Integer> REQUEST_FRAME_COUNT =
3393 new Key<Integer>("android.request.frameCount", int.class);
3394
3395 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003396 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003397 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08003398 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003399 * <p><b>Units</b>: arbitrary integer assigned by application</p>
3400 * <p><b>Range of valid values:</b><br>
3401 * Any int</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003402 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003403 * @hide
3404 */
3405 public static final Key<Integer> REQUEST_ID =
3406 new Key<Integer>("android.request.id", int.class);
3407
3408 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003409 * <p>Specifies the number of pipeline stages the frame went
3410 * through from when it was exposed to when the final completed result
3411 * was available to the framework.</p>
3412 * <p>Depending on what settings are used in the request, and
3413 * what streams are configured, the data may undergo less processing,
3414 * and some pipeline stages skipped.</p>
3415 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003416 * <p><b>Range of valid values:</b><br>
3417 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003418 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003419 *
3420 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3421 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003422 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003423 @NonNull
Igor Murashkinc127f052014-01-17 18:06:02 -08003424 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
3425 new Key<Byte>("android.request.pipelineDepth", byte.class);
3426
3427 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003428 * <p>The desired region of the sensor to read out for this capture.</p>
3429 * <p>This control can be used to implement digital zoom.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003430 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3431 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being
3432 * the top-left pixel of the active array.</p>
Eino-Ville Talvalad2d749a2020-01-06 16:10:29 -08003433 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate system
3434 * depends on the mode being set. When the distortion correction mode is OFF, the
3435 * coordinate system follows {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with <code>(0,
3436 * 0)</code> being the top-left pixel of the pre-correction active array. When the distortion
3437 * correction mode is not OFF, the coordinate system follows
3438 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the top-left pixel of the
3439 * active array.</p>
3440 * <p>Output streams use this rectangle to produce their output, cropping to a smaller region
3441 * if necessary to maintain the stream's aspect ratio, then scaling the sensor input to
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003442 * match the output's configured resolution.</p>
Eino-Ville Talvalad2d749a2020-01-06 16:10:29 -08003443 * <p>The crop region is applied after the RAW to other color space (e.g. YUV)
3444 * conversion. Since raw streams (e.g. RAW16) don't have the conversion stage, they are not
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003445 * croppable. The crop region will be ignored by raw streams.</p>
Eino-Ville Talvalad2d749a2020-01-06 16:10:29 -08003446 * <p>For non-raw streams, any additional per-stream cropping will be done to maximize the
3447 * final pixel area of the stream.</p>
3448 * <p>For example, if the crop region is set to a 4:3 aspect ratio, then 4:3 streams will use
3449 * the exact crop region. 16:9 streams will further crop vertically (letterbox).</p>
3450 * <p>Conversely, if the crop region is set to a 16:9, then 4:3 outputs will crop horizontally
3451 * (pillarbox), and 16:9 streams will match exactly. These additional crops will be
3452 * centered within the crop region.</p>
3453 * <p>To illustrate, here are several scenarios of different crop regions and output streams,
3454 * for a hypothetical camera device with an active array of size <code>(2000,1500)</code>. Note that
3455 * several of these examples use non-centered crop regions for ease of illustration; such
3456 * regions are only supported on devices with FREEFORM capability
3457 * ({@link CameraCharacteristics#SCALER_CROPPING_TYPE android.scaler.croppingType} <code>== FREEFORM</code>), but this does not affect the way the crop
3458 * rules work otherwise.</p>
3459 * <ul>
3460 * <li>Camera Configuration:<ul>
3461 * <li>Active array size: <code>2000x1500</code> (3 MP, 4:3 aspect ratio)</li>
3462 * <li>Output stream #1: <code>640x480</code> (VGA, 4:3 aspect ratio)</li>
3463 * <li>Output stream #2: <code>1280x720</code> (720p, 16:9 aspect ratio)</li>
3464 * </ul>
3465 * </li>
3466 * <li>Case #1: 4:3 crop region with 2x digital zoom<ul>
3467 * <li>Crop region: <code>Rect(500, 375, 1500, 1125) // (left, top, right, bottom)</code></li>
3468 * <li><img alt="4:3 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.scaler.cropRegion/crop-region-43-ratio.png" /></li>
3469 * <li><code>640x480</code> stream source area: <code>(500, 375, 1500, 1125)</code> (equal to crop region)</li>
3470 * <li><code>1280x720</code> stream source area: <code>(500, 469, 1500, 1031)</code> (letterboxed)</li>
3471 * </ul>
3472 * </li>
3473 * <li>Case #2: 16:9 crop region with ~1.5x digital zoom.<ul>
3474 * <li>Crop region: <code>Rect(500, 375, 1833, 1125)</code></li>
3475 * <li><img alt="16:9 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.scaler.cropRegion/crop-region-169-ratio.png" /></li>
3476 * <li><code>640x480</code> stream source area: <code>(666, 375, 1666, 1125)</code> (pillarboxed)</li>
3477 * <li><code>1280x720</code> stream source area: <code>(500, 375, 1833, 1125)</code> (equal to crop region)</li>
3478 * </ul>
3479 * </li>
3480 * <li>Case #3: 1:1 crop region with ~2.6x digital zoom.<ul>
3481 * <li>Crop region: <code>Rect(500, 375, 1250, 1125)</code></li>
3482 * <li><img alt="1:1 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.scaler.cropRegion/crop-region-11-ratio.png" /></li>
3483 * <li><code>640x480</code> stream source area: <code>(500, 469, 1250, 1031)</code> (letterboxed)</li>
3484 * <li><code>1280x720</code> stream source area: <code>(500, 543, 1250, 957)</code> (letterboxed)</li>
3485 * </ul>
3486 * </li>
3487 * <li>Case #4: Replace <code>640x480</code> stream with <code>1024x1024</code> stream, with 4:3 crop region:<ul>
3488 * <li>Crop region: <code>Rect(500, 375, 1500, 1125)</code></li>
3489 * <li><img alt="Square output, 4:3 aspect ratio crop diagram" src="/reference/images/camera2/metadata/android.scaler.cropRegion/crop-region-43-square-ratio.png" /></li>
3490 * <li><code>1024x1024</code> stream source area: <code>(625, 375, 1375, 1125)</code> (pillarboxed)</li>
3491 * <li><code>1280x720</code> stream source area: <code>(500, 469, 1500, 1031)</code> (letterboxed)</li>
3492 * <li>Note that in this case, neither of the two outputs is a subset of the other, with
3493 * each containing image data the other doesn't have.</li>
3494 * </ul>
3495 * </li>
3496 * </ul>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003497 * <p>If the coordinate system is {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, the width and height
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003498 * of the crop region cannot be set to be smaller than
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003499 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
3500 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003501 * <p>If the coordinate system is {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, the width
3502 * and height of the crop region cannot be set to be smaller than
3503 * <code>floor( preCorrectionActiveArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>
3504 * and
3505 * <code>floor( preCorrectionActiveArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>,
3506 * respectively.</p>
Eino-Ville Talvalad2d749a2020-01-06 16:10:29 -08003507 * <p>The camera device may adjust the crop region to account for rounding and other hardware
3508 * requirements; the final crop region used will be included in the output capture result.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08003509 * <p>Starting from API level 30, it's strongly recommended to use {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}
3510 * to take advantage of better support for zoom with logical multi-camera. The benefits
3511 * include better precision with optical-digital zoom combination, and ability to do
3512 * zoom-out from 1.0x. When using {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for zoom, the crop region in
3513 * the capture request must be either letterboxing or pillarboxing (but not both). The
3514 * coordinate system is post-zoom, meaning that the activeArraySize or
Eino-Ville Talvalad2d749a2020-01-06 16:10:29 -08003515 * preCorrectionActiveArraySize covers the camera device's field of view "after" zoom. See
3516 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003517 * <p><b>Units</b>: Pixel coordinates relative to
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003518 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
3519 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on distortion correction
3520 * capability and mode</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003521 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003522 *
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08003523 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003524 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003525 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalad2d749a2020-01-06 16:10:29 -08003526 * @see CameraCharacteristics#SCALER_CROPPING_TYPE
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003527 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003528 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003529 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003530 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003531 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003532 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
3533 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
3534
3535 /**
Eino-Ville Talvalaa9b1d602020-01-06 13:10:22 -08003536 * <p>Whether a rotation-and-crop operation is applied to processed
3537 * outputs from the camera.</p>
3538 * <p>This control is primarily intended to help camera applications with no support for
3539 * multi-window modes to work correctly on devices where multi-window scenarios are
3540 * unavoidable, such as foldables or other devices with variable display geometry or more
3541 * free-form window placement (such as laptops, which often place portrait-orientation apps
3542 * in landscape with pillarboxing).</p>
3543 * <p>If supported, the default value is <code>ROTATE_AND_CROP_AUTO</code>, which allows the camera API
3544 * to enable backwards-compatibility support for applications that do not support resizing
3545 * / multi-window modes, when the device is in fact in a multi-window mode (such as inset
3546 * portrait on laptops, or on a foldable device in some fold states). In addition,
3547 * <code>ROTATE_AND_CROP_NONE</code> and <code>ROTATE_AND_CROP_90</code> will always be available if this control
3548 * is supported by the device. If not supported, devices API level 30 or higher will always
3549 * list only <code>ROTATE_AND_CROP_NONE</code>.</p>
3550 * <p>When <code>CROP_AUTO</code> is in use, and the camera API activates backward-compatibility mode,
3551 * several metadata fields will also be parsed differently to ensure that coordinates are
3552 * correctly handled for features like drawing face detection boxes or passing in
3553 * tap-to-focus coordinates. The camera API will convert positions in the active array
3554 * coordinate system to/from the cropped-and-rotated coordinate system to make the
3555 * operation transparent for applications. The following controls are affected:</p>
3556 * <ul>
3557 * <li>{@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}</li>
3558 * <li>{@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}</li>
3559 * <li>{@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}</li>
3560 * <li>{@link CaptureResult#STATISTICS_FACES android.statistics.faces}</li>
3561 * </ul>
3562 * <p>Capture results will contain the actual value selected by the API;
3563 * <code>ROTATE_AND_CROP_AUTO</code> will never be seen in a capture result.</p>
3564 * <p>Applications can also select their preferred cropping mode, either to opt out of the
3565 * backwards-compatibility treatment, or to use the cropping feature themselves as needed.
3566 * In this case, no coordinate translation will be done automatically, and all controls
3567 * will continue to use the normal active array coordinates.</p>
3568 * <p>Cropping and rotating is done after the application of digital zoom (via either
3569 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} or {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}), but before each individual
3570 * output is further cropped and scaled. It only affects processed outputs such as
3571 * YUV, PRIVATE, and JPEG. It has no effect on RAW outputs.</p>
3572 * <p>When <code>CROP_90</code> or <code>CROP_270</code> are selected, there is a significant loss to the field of
3573 * view. For example, with a 4:3 aspect ratio output of 1600x1200, <code>CROP_90</code> will still
3574 * produce 1600x1200 output, but these buffers are cropped from a vertical 3:4 slice at the
3575 * center of the 4:3 area, then rotated to be 4:3, and then upscaled to 1600x1200. Only
3576 * 56.25% of the original FOV is still visible. In general, for an aspect ratio of <code>w:h</code>,
3577 * the crop and rotate operation leaves <code>(h/w)^2</code> of the field of view visible. For 16:9,
3578 * this is ~31.6%.</p>
3579 * <p>As a visual example, the figure below shows the effect of <code>ROTATE_AND_CROP_90</code> on the
3580 * outputs for the following parameters:</p>
3581 * <ul>
3582 * <li>Sensor active array: <code>2000x1500</code></li>
3583 * <li>Crop region: top-left: <code>(500, 375)</code>, size: <code>(1000, 750)</code> (4:3 aspect ratio)</li>
3584 * <li>Output streams: YUV <code>640x480</code> and YUV <code>1280x720</code></li>
3585 * <li><code>ROTATE_AND_CROP_90</code></li>
3586 * </ul>
3587 * <p><img alt="Effect of ROTATE_AND_CROP_90" src="/reference/images/camera2/metadata/android.scaler.rotateAndCrop/crop-region-rotate-90-43-ratio.png" /></p>
3588 * <p>With these settings, the regions of the active array covered by the output streams are:</p>
3589 * <ul>
3590 * <li>640x480 stream crop: top-left: <code>(219, 375)</code>, size: <code>(562, 750)</code></li>
3591 * <li>1280x720 stream crop: top-left: <code>(289, 375)</code>, size: <code>(422, 750)</code></li>
3592 * </ul>
3593 * <p>Since the buffers are rotated, the buffers as seen by the application are:</p>
3594 * <ul>
3595 * <li>640x480 stream: top-left: <code>(781, 375)</code> on active array, size: <code>(640, 480)</code>, downscaled 1.17x from sensor pixels</li>
3596 * <li>1280x720 stream: top-left: <code>(711, 375)</code> on active array, size: <code>(1280, 720)</code>, upscaled 1.71x from sensor pixels</li>
3597 * </ul>
3598 * <p><b>Possible values:</b>
3599 * <ul>
3600 * <li>{@link #SCALER_ROTATE_AND_CROP_NONE NONE}</li>
3601 * <li>{@link #SCALER_ROTATE_AND_CROP_90 90}</li>
3602 * <li>{@link #SCALER_ROTATE_AND_CROP_180 180}</li>
3603 * <li>{@link #SCALER_ROTATE_AND_CROP_270 270}</li>
3604 * <li>{@link #SCALER_ROTATE_AND_CROP_AUTO AUTO}</li>
3605 * </ul></p>
3606 * <p><b>Available values for this device:</b><br>
Eino-Ville Talvala9f9bb3b2020-03-18 13:31:03 -07003607 * android.scaler.availableRotateAndCropModes</p>
Eino-Ville Talvalaa9b1d602020-01-06 13:10:22 -08003608 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3609 *
3610 * @see CaptureRequest#CONTROL_AE_REGIONS
3611 * @see CaptureRequest#CONTROL_AF_REGIONS
3612 * @see CaptureRequest#CONTROL_AWB_REGIONS
3613 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Eino-Ville Talvalaa9b1d602020-01-06 13:10:22 -08003614 * @see CaptureRequest#SCALER_CROP_REGION
3615 * @see CaptureResult#STATISTICS_FACES
3616 * @see #SCALER_ROTATE_AND_CROP_NONE
3617 * @see #SCALER_ROTATE_AND_CROP_90
3618 * @see #SCALER_ROTATE_AND_CROP_180
3619 * @see #SCALER_ROTATE_AND_CROP_270
3620 * @see #SCALER_ROTATE_AND_CROP_AUTO
Eino-Ville Talvala9f9bb3b2020-03-18 13:31:03 -07003621 * @hide
Eino-Ville Talvalaa9b1d602020-01-06 13:10:22 -08003622 */
Eino-Ville Talvalaa9b1d602020-01-06 13:10:22 -08003623 public static final Key<Integer> SCALER_ROTATE_AND_CROP =
3624 new Key<Integer>("android.scaler.rotateAndCrop", int.class);
3625
3626 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003627 * <p>Duration each pixel is exposed to
3628 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003629 * <p>If the sensor can't expose this exact duration, it will shorten the
3630 * duration exposed to the nearest possible value (rather than expose longer).
3631 * The final exposure time used will be available in the output capture result.</p>
3632 * <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
3633 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3634 * <p><b>Units</b>: Nanoseconds</p>
3635 * <p><b>Range of valid values:</b><br>
3636 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003637 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003638 * <p><b>Full capability</b> -
3639 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3640 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3641 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003642 * @see CaptureRequest#CONTROL_AE_MODE
3643 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003644 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003645 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003646 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003647 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003648 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003649 public static final Key<Long> SENSOR_EXPOSURE_TIME =
3650 new Key<Long>("android.sensor.exposureTime", long.class);
3651
3652 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003653 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003654 * start of next frame exposure.</p>
3655 * <p>The maximum frame rate that can be supported by a camera subsystem is
3656 * a function of many factors:</p>
3657 * <ul>
3658 * <li>Requested resolutions of output image streams</li>
3659 * <li>Availability of binning / skipping modes on the imager</li>
3660 * <li>The bandwidth of the imager interface</li>
3661 * <li>The bandwidth of the various ISP processing blocks</li>
3662 * </ul>
3663 * <p>Since these factors can vary greatly between different ISPs and
3664 * sensors, the camera abstraction tries to represent the bandwidth
3665 * restrictions with as simple a model as possible.</p>
3666 * <p>The model presented has the following characteristics:</p>
3667 * <ul>
3668 * <li>The image sensor is always configured to output the smallest
3669 * resolution possible given the application's requested output stream
3670 * sizes. The smallest resolution is defined as being at least as large
3671 * as the largest requested output stream size; the camera pipeline must
3672 * never digitally upsample sensor data when the crop region covers the
3673 * whole sensor. In general, this means that if only small output stream
3674 * resolutions are configured, the sensor can provide a higher frame
3675 * rate.</li>
3676 * <li>Since any request may use any or all the currently configured
3677 * output streams, the sensor and ISP must be configured to support
3678 * scaling a single capture to all the streams at the same time. This
3679 * means the camera pipeline must be ready to produce the largest
3680 * requested output size without any delay. Therefore, the overall
3681 * frame rate of a given configured stream set is governed only by the
3682 * largest requested stream resolution.</li>
3683 * <li>Using more than one output stream in a request does not affect the
3684 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08003685 * <li>Certain format-streams may need to do additional background processing
3686 * before data is consumed/produced by that stream. These processors
3687 * can run concurrently to the rest of the camera pipeline, but
3688 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003689 * </ul>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003690 * <p>The necessary information for the application, given the model above, is provided via
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003691 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003692 * These are used to determine the maximum frame rate / minimum frame duration that is
3693 * possible for a given stream configuration.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003694 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08003695 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003696 * device:</p>
3697 * <ol>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003698 * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li>
3699 * <li>Find the minimum frame durations for each stream in <code>S</code>, by looking it up in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
3700 * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li>
3701 * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum
3702 * out of all values in <code>F</code>. Let the streams used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003703 * </ol>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003704 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003705 * using its respective size/format), then the frame duration in <code>F</code> determines the steady
3706 * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let
3707 * this special kind of request be called <code>Rsimple</code>.</p>
3708 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a
3709 * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if
3710 * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all
3711 * buffers from the previous <code>Rstall</code> have already been delivered.</p>
3712 * <p>For more details about stalling, see {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003713 * <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
3714 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3715 * <p><b>Units</b>: Nanoseconds</p>
3716 * <p><b>Range of valid values:</b><br>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003717 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }.
3718 * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003719 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003720 * <p><b>Full capability</b> -
3721 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3722 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003723 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003724 * @see CaptureRequest#CONTROL_AE_MODE
3725 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003726 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003727 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003728 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003729 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003730 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003731 public static final Key<Long> SENSOR_FRAME_DURATION =
3732 new Key<Long>("android.sensor.frameDuration", long.class);
3733
3734 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003735 * <p>The amount of gain applied to sensor data
3736 * before processing.</p>
3737 * <p>The sensitivity is the standard ISO sensitivity value,
3738 * as defined in ISO 12232:2006.</p>
3739 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
3740 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
3741 * is guaranteed to use only analog amplification for applying the gain.</p>
3742 * <p>If the camera device cannot apply the exact sensitivity
3743 * requested, it will reduce the gain to the nearest supported
3744 * value. The final sensitivity used will be available in the
3745 * output capture result.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003746 * <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
3747 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
Shuzhen Wang252fa532019-07-08 15:14:16 -07003748 * <p>Note that for devices supporting postRawSensitivityBoost, the total sensitivity applied
3749 * to the final processed image is the combination of {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} and
3750 * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost}. In case the application uses the sensor
3751 * sensitivity from last capture result of an auto request for a manual request, in order
3752 * to achieve the same brightness in the output image, the application should also
3753 * set postRawSensitivityBoost.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003754 * <p><b>Units</b>: ISO arithmetic units</p>
3755 * <p><b>Range of valid values:</b><br>
3756 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003757 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003758 * <p><b>Full capability</b> -
3759 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3760 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003761 *
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003762 * @see CaptureRequest#CONTROL_AE_MODE
3763 * @see CaptureRequest#CONTROL_MODE
Shuzhen Wang252fa532019-07-08 15:14:16 -07003764 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003765 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003766 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
3767 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Shuzhen Wang252fa532019-07-08 15:14:16 -07003768 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003769 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003770 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003771 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003772 public static final Key<Integer> SENSOR_SENSITIVITY =
3773 new Key<Integer>("android.sensor.sensitivity", int.class);
3774
3775 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003776 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07003777 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003778 * <p>The timestamps are also included in all image
3779 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07003780 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003781 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07003782 * the timestamps measure time since an unspecified starting point,
3783 * and are monotonically increasing. They can be compared with the
3784 * timestamps for other captures from the same camera device, but are
3785 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003786 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the
3787 * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can
3788 * be compared to other timestamps from other subsystems that
3789 * are using that base.</p>
Chien-Yu Chen6216e4e2015-05-29 11:49:54 -07003790 * <p>For reprocessing, the timestamp will match the start of exposure of
3791 * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the
3792 * timestamp} in the TotalCaptureResult that was used to create the
3793 * reprocess capture request.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003794 * <p><b>Units</b>: Nanoseconds</p>
3795 * <p><b>Range of valid values:</b><br>
3796 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003797 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07003798 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003799 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003800 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003801 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003802 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003803 public static final Key<Long> SENSOR_TIMESTAMP =
3804 new Key<Long>("android.sensor.timestamp", long.class);
3805
3806 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07003807 * <p>The estimated camera neutral color in the native sensor colorspace at
3808 * the time of capture.</p>
3809 * <p>This value gives the neutral color point encoded as an RGB value in the
3810 * native sensor color space. The neutral color point indicates the
3811 * currently estimated white point of the scene illumination. It can be
3812 * used to interpolate between the provided color transforms when
3813 * processing raw sensor data.</p>
3814 * <p>The order of the values is R, G, B; where R is in the lowest index.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003815 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3816 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003817 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk20c76f62014-02-07 15:47:10 -08003818 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003819 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003820 @NonNull
Ruben Brunk20c76f62014-02-07 15:47:10 -08003821 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
3822 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
3823
3824 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003825 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003826 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003827 * corresponding to the sensor amplification (S) and sensor readout
3828 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003829 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003830 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
3831 * represented as an array of Pair&lt;Double, Double&gt;, where
3832 * the first member of the Pair at index n is the S coefficient and the
3833 * second member is the O coefficient for the nth color channel in the CFA.</p>
3834 * <p>These coefficients are used in a two parameter noise model to describe
3835 * the amount of noise present in the image for each CFA channel. The
3836 * noise model used here is:</p>
3837 * <p>N(x) = sqrt(Sx + O)</p>
3838 * <p>Where x represents the recorded signal of a CFA channel normalized to
3839 * the range [0, 1], and S and O are the noise model coeffiecients for
3840 * that channel.</p>
3841 * <p>A more detailed description of the noise model can be found in the
3842 * Adobe DNG specification for the NoiseProfile tag.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003843 * <p>For a MONOCHROME camera, there is only one color channel. So the noise model coefficients
3844 * will only contain one S and one O.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003845 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003846 *
3847 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3848 */
3849 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003850 @NonNull
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003851 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
3852 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
3853
3854 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08003855 * <p>The worst-case divergence between Bayer green channels.</p>
3856 * <p>This value is an estimate of the worst case split between the
3857 * Bayer green channels in the red and blue rows in the sensor color
3858 * filter array.</p>
3859 * <p>The green split is calculated as follows:</p>
3860 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07003861 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
3862 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
3863 * mosaic channels (R, Gr, Gb, B). The location and size of the window
3864 * chosen is implementation defined, and should be chosen to provide a
3865 * green split estimate that is both representative of the entire image
3866 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003867 * <li>The arithmetic mean of the green channels from the red
3868 * rows (mean_Gr) within W is computed.</li>
3869 * <li>The arithmetic mean of the green channels from the blue
3870 * rows (mean_Gb) within W is computed.</li>
3871 * <li>The maximum ratio R of the two means is computed as follows:
3872 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
3873 * </ol>
3874 * <p>The ratio R is the green split divergence reported for this property,
3875 * which represents how much the green channels differ in the mosaic
3876 * pattern. This value is typically used to determine the treatment of
3877 * the green mosaic channels when demosaicing.</p>
3878 * <p>The green split value can be roughly interpreted as follows:</p>
3879 * <ul>
3880 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
3881 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
3882 * correction to avoid demosaic errors (3-20% divergence).</li>
3883 * <li>R &gt; 1.20 will require strong software correction to produce
3884 * a usuable image (&gt;20% divergence).</li>
3885 * </ul>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003886 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3887 * the camera device has RAW capability.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003888 * <p><b>Range of valid values:</b><br></p>
3889 * <p>&gt;= 0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003890 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003891 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003892 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003893 @NonNull
Ruben Brunk987d9f72014-02-11 18:00:24 -08003894 public static final Key<Float> SENSOR_GREEN_SPLIT =
3895 new Key<Float>("android.sensor.greenSplit", float.class);
3896
3897 /**
Zhijun He379af012014-05-06 11:54:54 -07003898 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
3899 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
3900 * <p>Each color channel is treated as an unsigned 32-bit integer.
3901 * The camera device then uses the most significant X bits
3902 * that correspond to how many bits are in its Bayer raw sensor
3903 * output.</p>
3904 * <p>For example, a sensor with RAW10 Bayer output would use the
3905 * 10 most significant bits from each color channel.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003906 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07003907 *
3908 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
3909 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003910 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003911 @NonNull
Zhijun He379af012014-05-06 11:54:54 -07003912 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
3913 new Key<int[]>("android.sensor.testPatternData", int[].class);
3914
3915 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003916 * <p>When enabled, the sensor sends a test pattern instead of
3917 * doing a real exposure from the camera.</p>
3918 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003919 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08003920 * work as normal.</p>
3921 * <p>For example, if manual flash is enabled, flash firing should still
3922 * occur (and that the test pattern remain unmodified, since the flash
3923 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003924 * <p>Defaults to OFF.</p>
3925 * <p><b>Possible values:</b>
3926 * <ul>
3927 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
3928 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
3929 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
3930 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
3931 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
3932 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
3933 * </ul></p>
3934 * <p><b>Available values for this device:</b><br>
3935 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003936 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003937 *
3938 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08003939 * @see #SENSOR_TEST_PATTERN_MODE_OFF
3940 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
3941 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
3942 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
3943 * @see #SENSOR_TEST_PATTERN_MODE_PN9
3944 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
3945 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003946 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003947 @NonNull
Igor Murashkinc127f052014-01-17 18:06:02 -08003948 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
3949 new Key<Integer>("android.sensor.testPatternMode", int.class);
3950
3951 /**
Eino-Ville Talvala3a639682020-05-11 10:24:54 -07003952 * <p>Duration between the start of exposure for the first row of the image sensor,
3953 * and the start of exposure for one past the last row of the image sensor.</p>
3954 * <p>This is the exposure time skew between the first and <code>(last+1)</code> row exposure start times. The
3955 * first row and the last row are the first and last rows inside of the
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003956 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvala3a639682020-05-11 10:24:54 -07003957 * <p>For typical camera sensors that use rolling shutters, this is also equivalent to the frame
3958 * readout time.</p>
3959 * <p>If the image sensor is operating in a binned or cropped mode due to the current output
3960 * target resolutions, it's possible this skew is reported to be larger than the exposure
3961 * time, for example, since it is based on the full array even if a partial array is read
3962 * out. Be sure to scale the number to cover the section of the sensor actually being used
3963 * for the outputs you care about. So if your output covers N rows of the active array of
3964 * height H, scale this value by N/H to get the total skew for that viewport.</p>
3965 * <p><em>Note:</em> Prior to Android 11, this field was described as measuring duration from
3966 * first to last row of the image sensor, which is not equal to the frame readout time for a
3967 * rolling shutter sensor. Implementations generally reported the latter value, so to resolve
3968 * the inconsistency, the description has been updated to range from (first, last+1) row
3969 * exposure start, instead.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003970 * <p><b>Units</b>: Nanoseconds</p>
3971 * <p><b>Range of valid values:</b><br>
3972 * &gt;= 0 and &lt;
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003973 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003974 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003975 * <p><b>Limited capability</b> -
3976 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3977 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003978 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003979 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07003980 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3981 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003982 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003983 @NonNull
Zhijun He0bda31a2014-06-13 14:38:39 -07003984 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
3985 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
3986
3987 /**
Zhijun Hecd950b62015-11-12 17:47:52 -08003988 * <p>A per-frame dynamic black level offset for each of the color filter
3989 * arrangement (CFA) mosaic channels.</p>
3990 * <p>Camera sensor black levels may vary dramatically for different
3991 * capture settings (e.g. {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). The fixed black
3992 * level reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may be too
3993 * inaccurate to represent the actual value on a per-frame basis. The
3994 * camera device internal pipeline relies on reliable black level values
3995 * to process the raw images appropriately. To get the best image
3996 * quality, the camera device may choose to estimate the per frame black
3997 * level values either based on optically shielded black regions
3998 * ({@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}) or its internal model.</p>
3999 * <p>This key reports the camera device estimated per-frame zero light
4000 * value for each of the CFA mosaic channels in the camera sensor. The
4001 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may only represent a coarse
4002 * approximation of the actual black level values. This value is the
4003 * black level used in camera device internal image processing pipeline
4004 * and generally more accurate than the fixed black level values.
4005 * However, since they are estimated values by the camera device, they
4006 * may not be as accurate as the black level values calculated from the
4007 * optical black pixels reported by {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}.</p>
4008 * <p>The values are given in the same order as channels listed for the CFA
4009 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
4010 * nth value given corresponds to the black level offset for the nth
4011 * color channel listed in the CFA.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07004012 * <p>For a MONOCHROME camera, all of the 2x2 channels must have the same values.</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004013 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is available or the
4014 * camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08004015 * <p><b>Range of valid values:</b><br>
4016 * &gt;= 0 for each.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004017 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08004018 *
4019 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
4020 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
4021 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
4022 * @see CaptureRequest#SENSOR_SENSITIVITY
4023 */
4024 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004025 @NonNull
Zhijun He8998ad92015-11-24 14:31:04 -08004026 public static final Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL =
4027 new Key<float[]>("android.sensor.dynamicBlackLevel", float[].class);
Zhijun Hecd950b62015-11-12 17:47:52 -08004028
4029 /**
4030 * <p>Maximum raw value output by sensor for this frame.</p>
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07004031 * <p>Since the {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may change for different
Zhijun Hecd950b62015-11-12 17:47:52 -08004032 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}), the white
4033 * level will change accordingly. This key is similar to
4034 * {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}, but specifies the camera device
4035 * estimated white level for each frame.</p>
4036 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is
4037 * available or the camera device advertises this key via
4038 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys }.</p>
4039 * <p><b>Range of valid values:</b><br>
4040 * &gt;= 0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004041 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08004042 *
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07004043 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
Zhijun Hecd950b62015-11-12 17:47:52 -08004044 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
4045 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
4046 * @see CaptureRequest#SENSOR_SENSITIVITY
4047 */
4048 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004049 @NonNull
Zhijun Hecd950b62015-11-12 17:47:52 -08004050 public static final Key<Integer> SENSOR_DYNAMIC_WHITE_LEVEL =
4051 new Key<Integer>("android.sensor.dynamicWhiteLevel", int.class);
4052
4053 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08004054 * <p>Quality of lens shading correction applied
4055 * to the image data.</p>
4056 * <p>When set to OFF mode, no lens shading correction will be applied by the
4057 * camera device, and an identity lens shading map data will be provided
4058 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004059 * shading map with size of <code>[ 4, 3 ]</code>,
4060 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
4061 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08004062 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004063 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
4064 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
4065 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
4066 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
4067 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08004068 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004069 * <p>When set to other modes, lens shading correction will be applied by the camera
4070 * device. Applications can request lens shading map data by setting
4071 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
4072 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
4073 * data will be the one applied by the camera device for this capture request.</p>
4074 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
4075 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
4076 * 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>
4077 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
4078 * to be converged before using the returned shading map data.</p>
4079 * <p><b>Possible values:</b>
4080 * <ul>
4081 * <li>{@link #SHADING_MODE_OFF OFF}</li>
4082 * <li>{@link #SHADING_MODE_FAST FAST}</li>
4083 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
4084 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004085 * <p><b>Available values for this device:</b><br>
4086 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004087 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004088 * <p><b>Full capability</b> -
4089 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4090 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08004091 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07004092 * @see CaptureRequest#CONTROL_AE_MODE
4093 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004094 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004095 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004096 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08004097 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
4098 * @see #SHADING_MODE_OFF
4099 * @see #SHADING_MODE_FAST
4100 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08004101 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004102 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004103 @NonNull
Zhijun Heba93fe62014-01-17 16:43:05 -08004104 public static final Key<Integer> SHADING_MODE =
4105 new Key<Integer>("android.shading.mode", int.class);
4106
4107 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004108 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07004109 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08004110 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004111 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004112 * fields.</p>
4113 * <p><b>Possible values:</b>
4114 * <ul>
4115 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
4116 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
4117 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
4118 * </ul></p>
4119 * <p><b>Available values for this device:</b><br>
4120 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
4121 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004122 *
4123 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004124 * @see #STATISTICS_FACE_DETECT_MODE_OFF
4125 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
4126 * @see #STATISTICS_FACE_DETECT_MODE_FULL
4127 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004128 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004129 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004130 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
4131 new Key<Integer>("android.statistics.faceDetectMode", int.class);
4132
4133 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004134 * <p>List of unique IDs for detected faces.</p>
4135 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
4136 * to the camera device. A face that leaves the field of view and later returns may be
4137 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004138 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
4139 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004140 *
4141 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08004142 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004143 */
4144 public static final Key<int[]> STATISTICS_FACE_IDS =
4145 new Key<int[]>("android.statistics.faceIds", int[].class);
4146
4147 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004148 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004149 * faces.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004150 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
4151 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being
4152 * the top-left pixel of the active array.</p>
4153 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
4154 * system depends on the mode being set.
4155 * When the distortion correction mode is OFF, the coordinate system follows
4156 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
4157 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array.
4158 * When the distortion correction mode is not OFF, the coordinate system follows
4159 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004160 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08004161 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL.</p>
4162 * <p>Starting from API level 30, the coordinate system of activeArraySize or
4163 * preCorrectionActiveArraySize is used to represent post-zoomRatio field of view, not
4164 * pre-zoomRatio field of view. This means that if the relative position of faces and
4165 * the camera device doesn't change, when zooming in by increasing
4166 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, the face landmarks move farther away from the center of the
4167 * activeArray or preCorrectionActiveArray. If {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} is set to 1.0
4168 * (default), the face landmarks coordinates won't change as {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}
4169 * changes. See {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details. Whether to use activeArraySize or
4170 * preCorrectionActiveArraySize still depends on distortion correction mode.</p>
4171 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004172 *
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08004173 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004174 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08004175 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004176 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004177 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004178 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08004179 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004180 */
4181 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
4182 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
4183
4184 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004185 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004186 * faces.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004187 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
4188 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being
4189 * the top-left pixel of the active array.</p>
4190 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
4191 * system depends on the mode being set.
4192 * When the distortion correction mode is OFF, the coordinate system follows
4193 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
4194 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array.
4195 * When the distortion correction mode is not OFF, the coordinate system follows
4196 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004197 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08004198 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
4199 * <p>Starting from API level 30, the coordinate system of activeArraySize or
4200 * preCorrectionActiveArraySize is used to represent post-zoomRatio field of view, not
4201 * pre-zoomRatio field of view. This means that if the relative position of faces and
4202 * the camera device doesn't change, when zooming in by increasing
4203 * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, the face rectangles grow larger and move farther away from
4204 * the center of the activeArray or preCorrectionActiveArray. If {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}
4205 * is set to 1.0 (default), the face rectangles won't change as {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}
4206 * changes. See {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} for details. Whether to use activeArraySize or
4207 * preCorrectionActiveArraySize still depends on distortion correction mode.</p>
4208 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004209 *
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08004210 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004211 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08004212 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004213 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004214 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004215 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08004216 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004217 */
4218 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
4219 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
4220
4221 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004222 * <p>List of the face confidence scores for
4223 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004224 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004225 * <p><b>Range of valid values:</b><br>
4226 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004227 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004228 *
4229 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08004230 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004231 */
4232 public static final Key<byte[]> STATISTICS_FACE_SCORES =
4233 new Key<byte[]>("android.statistics.faceScores", byte[].class);
4234
4235 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07004236 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004237 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07004238 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004239 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07004240 *
4241 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
4242 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004243 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004244 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07004245 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07004246 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
4247 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
4248
4249 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08004250 * <p>The shading map is a low-resolution floating-point map
4251 * that lists the coefficients used to correct for vignetting, for each
4252 * Bayer color channel.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07004253 * <p>The map provided here is the same map that is used by the camera device to
4254 * correct both color shading and vignetting for output non-RAW images.</p>
4255 * <p>When there is no lens shading correction applied to RAW
4256 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
4257 * false), this map is the complete lens shading correction
4258 * map; when there is some lens shading correction applied to
4259 * the RAW output image ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}<code>==</code> true), this map reports the remaining lens shading
4260 * correction map that needs to be applied to get shading
4261 * corrected images that match the camera device's output for
4262 * non-RAW formats.</p>
4263 * <p>For a complete shading correction map, the least shaded
4264 * section of the image will have a gain factor of 1; all
4265 * other sections will have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004266 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07004267 * will take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08004268 * <p>The shading map is for the entire active pixel array, and is not
4269 * affected by the crop region specified in the request. Each shading map
4270 * entry is the value of the shading compensation map over a specific
4271 * pixel on the sensor. Specifically, with a (N x M) resolution shading
4272 * map, and an active pixel array size (W x H), shading map entry
4273 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
4274 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
4275 * The map is assumed to be bilinearly interpolated between the sample points.</p>
4276 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
4277 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07004278 * The shading map is stored in a fully interleaved format.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07004279 * <p>The shading map will generally have on the order of 30-40 rows and columns,
4280 * and will be smaller than 64x64.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08004281 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07004282 * <pre><code>width,height = [ 4, 3 ]
4283 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08004284 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004285 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
4286 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
4287 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
4288 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
4289 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08004290 * </code></pre>
4291 * <p>The low-resolution scaling map images for each channel are
4292 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004293 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
4294 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
4295 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
4296 * <img alt="Blue lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08004297 * <p>As a visualization only, inverting the full-color map to recover an
4298 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004299 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07004300 * <p>For a MONOCHROME camera, all of the 2x2 channels must have the same values. An example
4301 * shading map for such a camera is defined as:</p>
4302 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
4303 * android.statistics.lensShadingMap =
4304 * [ 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
4305 * 1.1, 1.1, 1.1, 1.1, 1.3, 1.3, 1.3, 1.3,
4306 * 1.2, 1.2, 1.2, 1.2, 1.1, 1.1, 1.1, 1.1,
4307 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.2, 1.2,
4308 * 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
4309 * 1.2, 1.2, 1.2, 1.2, 1.3, 1.3, 1.3, 1.3 ]
4310 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004311 * <p><b>Range of valid values:</b><br>
4312 * Each gain factor is &gt;= 1</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004313 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004314 * <p><b>Full capability</b> -
4315 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4316 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004317 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08004318 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004319 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07004320 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07004321 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004322 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004323 @NonNull
Ruben Brunk57493682014-05-27 18:58:08 -07004324 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
4325 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
4326
4327 /**
4328 * <p>The shading map is a low-resolution floating-point map
Zhijun He43210fe2016-04-12 23:15:23 -07004329 * that lists the coefficients used to correct for vignetting and color shading,
4330 * for each Bayer color channel of RAW image data.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07004331 * <p>The map provided here is the same map that is used by the camera device to
4332 * correct both color shading and vignetting for output non-RAW images.</p>
4333 * <p>When there is no lens shading correction applied to RAW
4334 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
4335 * false), this map is the complete lens shading correction
4336 * map; when there is some lens shading correction applied to
4337 * the RAW output image ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}<code>==</code> true), this map reports the remaining lens shading
4338 * correction map that needs to be applied to get shading
4339 * corrected images that match the camera device's output for
4340 * non-RAW formats.</p>
4341 * <p>For a complete shading correction map, the least shaded
4342 * section of the image will have a gain factor of 1; all
4343 * other sections will have gains above 1.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07004344 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07004345 * will take into account the colorCorrection settings.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07004346 * <p>The shading map is for the entire active pixel array, and is not
4347 * affected by the crop region specified in the request. Each shading map
4348 * entry is the value of the shading compensation map over a specific
4349 * pixel on the sensor. Specifically, with a (N x M) resolution shading
4350 * map, and an active pixel array size (W x H), shading map entry
4351 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
4352 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
4353 * The map is assumed to be bilinearly interpolated between the sample points.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07004354 * <p>For a Bayer camera, the channel order is [R, Geven, Godd, B], where Geven is
4355 * the green channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07004356 * The shading map is stored in a fully interleaved format, and its size
4357 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07004358 * <p>The shading map will generally have on the order of 30-40 rows and columns,
4359 * and will be smaller than 64x64.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07004360 * <p>As an example, given a very small map for a Bayer camera defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07004361 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
4362 * android.statistics.lensShadingMap =
4363 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004364 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
4365 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
4366 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
4367 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
4368 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07004369 * </code></pre>
4370 * <p>The low-resolution scaling map images for each channel are
4371 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004372 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
4373 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
4374 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
4375 * <img alt="Blue lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
Ruben Brunk57493682014-05-27 18:58:08 -07004376 * <p>As a visualization only, inverting the full-color map to recover an
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004377 * image of a gray wall (using bicubic interpolation for visual quality)
4378 * as captured by the sensor gives:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004379 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07004380 * <p>For a MONOCHROME camera, all of the 2x2 channels must have the same values. An example
4381 * shading map for such a camera is defined as:</p>
4382 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
4383 * android.statistics.lensShadingMap =
4384 * [ 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
4385 * 1.1, 1.1, 1.1, 1.1, 1.3, 1.3, 1.3, 1.3,
4386 * 1.2, 1.2, 1.2, 1.2, 1.1, 1.1, 1.1, 1.1,
4387 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.2, 1.2,
4388 * 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
4389 * 1.2, 1.2, 1.2, 1.2, 1.3, 1.3, 1.3, 1.3 ]
4390 * </code></pre>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004391 * <p>Note that the RAW image data might be subject to lens shading
4392 * correction not reported on this map. Query
4393 * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject
4394 * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}
4395 * is TRUE, the RAW image data is subject to partial or full lens shading
4396 * correction. In the case full lens shading correction is applied to RAW
4397 * images, the gain factor map reported in this key will contain all 1.0 gains.
4398 * In other words, the map reported in this key is the remaining lens shading
4399 * that needs to be applied on the RAW image to get images without lens shading
4400 * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image
4401 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004402 * <p><b>Range of valid values:</b><br>
4403 * Each gain factor is &gt;= 1</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004404 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004405 * <p><b>Full capability</b> -
4406 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4407 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07004408 *
4409 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004410 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004411 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
4412 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07004413 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004414 */
4415 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
4416 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
4417
4418 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004419 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08004420 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08004421 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004422 * since statistics processing on data from a new frame
4423 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08004424 * applied to that frame.</p>
4425 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004426 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07004427 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08004428 * regardless of the android.control.* current values.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004429 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004430 *
4431 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07004432 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07004433 * <p>Never fully implemented or specified; do not use</p>
4434
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08004435 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004436 */
Igor Murashkin9c595172014-05-12 13:56:20 -07004437 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004438 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
4439 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
4440
4441 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004442 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08004443 * calculated by the camera device's statistics units for the current
4444 * output frame.</p>
4445 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004446 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08004447 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004448 * are the best fit for the current output frame. This may
4449 * be different than the transform used for this frame, since
4450 * statistics processing on data from a new frame typically
4451 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08004452 * that frame.</p>
4453 * <p>These estimates must be provided for all frames, even if
4454 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07004455 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08004456 * regardless of the android.control.* current values.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004457 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07004458 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07004459 * <p>Never fully implemented or specified; do not use</p>
4460
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08004461 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004462 */
Igor Murashkin9c595172014-05-12 13:56:20 -07004463 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004464 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
4465 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
4466
4467 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08004468 * <p>The camera device estimated scene illumination lighting
4469 * frequency.</p>
4470 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
4471 * that depends on the local utility power standards. This flicker must be
4472 * accounted for by auto-exposure routines to avoid artifacts in captured images.
4473 * The camera device uses this entry to tell the application what the scene
4474 * illuminant frequency is.</p>
4475 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004476 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
4477 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
4478 * antibanding, and the application can ensure it selects
4479 * exposure times that do not cause banding issues by looking
4480 * into this metadata field. See
4481 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
4482 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004483 * <p><b>Possible values:</b>
4484 * <ul>
4485 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
4486 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
4487 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
4488 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004489 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004490 * <p><b>Full capability</b> -
4491 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4492 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08004493 *
4494 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
4495 * @see CaptureRequest#CONTROL_AE_MODE
4496 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004497 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004498 * @see #STATISTICS_SCENE_FLICKER_NONE
4499 * @see #STATISTICS_SCENE_FLICKER_50HZ
4500 * @see #STATISTICS_SCENE_FLICKER_60HZ
4501 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004502 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004503 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004504 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
4505 new Key<Integer>("android.statistics.sceneFlicker", int.class);
4506
4507 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004508 * <p>Operating mode for hot pixel map generation.</p>
4509 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
4510 * If set to <code>false</code>, no hot pixel map will be returned.</p>
4511 * <p><b>Range of valid values:</b><br>
4512 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004513 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004514 *
4515 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
4516 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
4517 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004518 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004519 @NonNull
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004520 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
4521 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
4522
4523 /**
4524 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
4525 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
4526 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
4527 * bottom-right of the pixel array, respectively. The width and
4528 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
4529 * This may include hot pixels that lie outside of the active array
4530 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004531 * <p><b>Range of valid values:</b><br></p>
4532 * <p>n &lt;= number of pixels on the sensor.
4533 * The <code>(x, y)</code> coordinates must be bounded by
4534 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004535 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004536 *
4537 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
4538 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
4539 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004540 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004541 @NonNull
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004542 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
4543 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004544
4545 /**
Zhijun He379af012014-05-06 11:54:54 -07004546 * <p>Whether the camera device will output the lens
4547 * shading map in output result metadata.</p>
4548 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004549 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07004550 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004551 * <p>ON is always supported on devices with the RAW capability.</p>
4552 * <p><b>Possible values:</b>
4553 * <ul>
4554 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
4555 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
4556 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004557 * <p><b>Available values for this device:</b><br>
4558 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004559 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004560 * <p><b>Full capability</b> -
4561 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4562 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4563 *
4564 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004565 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Zhijun He379af012014-05-06 11:54:54 -07004566 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
4567 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
4568 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004569 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004570 @NonNull
Zhijun He379af012014-05-06 11:54:54 -07004571 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
4572 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
4573
4574 /**
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004575 * <p>A control for selecting whether optical stabilization (OIS) position
4576 * information is included in output result metadata.</p>
4577 * <p>Since optical image stabilization generally involves motion much faster than the duration
4578 * of individualq image exposure, multiple OIS samples can be included for a single capture
4579 * result. For example, if the OIS reporting operates at 200 Hz, a typical camera operating
4580 * at 30fps may have 6-7 OIS samples per capture result. This information can be combined
4581 * with the rolling shutter skew to account for lens motion during image exposure in
4582 * post-processing algorithms.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004583 * <p><b>Possible values:</b>
4584 * <ul>
4585 * <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li>
4586 * <li>{@link #STATISTICS_OIS_DATA_MODE_ON ON}</li>
4587 * </ul></p>
4588 * <p><b>Available values for this device:</b><br>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07004589 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES android.statistics.info.availableOisDataModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004590 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07004591 *
4592 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004593 * @see #STATISTICS_OIS_DATA_MODE_OFF
4594 * @see #STATISTICS_OIS_DATA_MODE_ON
4595 */
4596 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004597 @NonNull
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004598 public static final Key<Integer> STATISTICS_OIS_DATA_MODE =
4599 new Key<Integer>("android.statistics.oisDataMode", int.class);
4600
4601 /**
4602 * <p>An array of timestamps of OIS samples, in nanoseconds.</p>
4603 * <p>The array contains the timestamps of OIS samples. The timestamps are in the same
4604 * timebase as and comparable to {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp}.</p>
4605 * <p><b>Units</b>: nanoseconds</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004606 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004607 *
4608 * @see CaptureResult#SENSOR_TIMESTAMP
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004609 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004610 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004611 public static final Key<long[]> STATISTICS_OIS_TIMESTAMPS =
4612 new Key<long[]>("android.statistics.oisTimestamps", long[].class);
4613
4614 /**
4615 * <p>An array of shifts of OIS samples, in x direction.</p>
4616 * <p>The array contains the amount of shifts in x direction, in pixels, based on OIS samples.
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004617 * A positive value is a shift from left to right in the pre-correction active array
4618 * coordinate system. For example, if the optical center is (1000, 500) in pre-correction
4619 * active array coordinates, a shift of (3, 0) puts the new optical center at (1003, 500).</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004620 * <p>The number of shifts must match the number of timestamps in
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004621 * android.statistics.oisTimestamps.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004622 * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on
4623 * supporting devices). They are always reported in pre-correction active array coordinates,
4624 * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift
4625 * is needed.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004626 * <p><b>Units</b>: Pixels in active array.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004627 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004628 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004629 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004630 public static final Key<float[]> STATISTICS_OIS_X_SHIFTS =
4631 new Key<float[]>("android.statistics.oisXShifts", float[].class);
4632
4633 /**
4634 * <p>An array of shifts of OIS samples, in y direction.</p>
4635 * <p>The array contains the amount of shifts in y direction, in pixels, based on OIS samples.
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004636 * A positive value is a shift from top to bottom in pre-correction active array coordinate
4637 * system. For example, if the optical center is (1000, 500) in active array coordinates, a
4638 * shift of (0, 5) puts the new optical center at (1000, 505).</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004639 * <p>The number of shifts must match the number of timestamps in
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004640 * android.statistics.oisTimestamps.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004641 * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on
4642 * supporting devices). They are always reported in pre-correction active array coordinates,
4643 * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift
4644 * is needed.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004645 * <p><b>Units</b>: Pixels in active array.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004646 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004647 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004648 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004649 public static final Key<float[]> STATISTICS_OIS_Y_SHIFTS =
4650 new Key<float[]>("android.statistics.oisYShifts", float[].class);
4651
4652 /**
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004653 * <p>An array of optical stabilization (OIS) position samples.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004654 * <p>Each OIS sample contains the timestamp and the amount of shifts in x and y direction,
4655 * in pixels, of the OIS sample.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004656 * <p>A positive value for a shift in x direction is a shift from left to right in the
4657 * pre-correction active array coordinate system. For example, if the optical center is
4658 * (1000, 500) in pre-correction active array coordinates, a shift of (3, 0) puts the new
4659 * optical center at (1003, 500).</p>
4660 * <p>A positive value for a shift in y direction is a shift from top to bottom in
4661 * pre-correction active array coordinate system. For example, if the optical center is
4662 * (1000, 500) in active array coordinates, a shift of (0, 5) puts the new optical center at
4663 * (1000, 505).</p>
4664 * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on
4665 * supporting devices). They are always reported in pre-correction active array coordinates,
4666 * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift
4667 * is needed.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004668 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004669 */
4670 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004671 @NonNull
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004672 @SyntheticKey
4673 public static final Key<android.hardware.camera2.params.OisSample[]> STATISTICS_OIS_SAMPLES =
4674 new Key<android.hardware.camera2.params.OisSample[]>("android.statistics.oisSamples", android.hardware.camera2.params.OisSample[].class);
4675
4676 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004677 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08004678 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4679 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004680 * <p>See android.tonemap.curveRed for more details.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004681 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004682 * <p><b>Full capability</b> -
4683 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4684 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004685 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004686 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004687 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004688 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004689 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004690 public static final Key<float[]> TONEMAP_CURVE_BLUE =
4691 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004692
4693 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004694 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08004695 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4696 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004697 * <p>See android.tonemap.curveRed for more details.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004698 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004699 * <p><b>Full capability</b> -
4700 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4701 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004702 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004703 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004704 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004705 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004706 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004707 public static final Key<float[]> TONEMAP_CURVE_GREEN =
4708 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004709
4710 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004711 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08004712 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4713 * CONTRAST_CURVE.</p>
4714 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004715 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004716 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08004717 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004718 * <p>These are sorted in order of increasing <code>Pin</code>; it is
4719 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08004720 * define a complete mapping. For input values between control points,
4721 * the camera device must linearly interpolate between the control
4722 * points.</p>
4723 * <p>Each curve can have an independent number of points, and the number
4724 * of points can be less than max (that is, the request doesn't have to
4725 * always provide a curve with number of points equivalent to
4726 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07004727 * <p>For devices with MONOCHROME capability, all three channels must have the same set of
4728 * control points.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08004729 * <p>A few examples, and their corresponding graphical mappings; these
4730 * only specify the red channel and the precision is limited to 4
4731 * digits, for conciseness.</p>
4732 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004733 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004734 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004735 * <p><img alt="Linear mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
Igor Murashkine0060932014-01-17 17:24:11 -08004736 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004737 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004738 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004739 * <p><img alt="Inverting mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
Igor Murashkine0060932014-01-17 17:24:11 -08004740 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004741 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004742 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
4743 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
4744 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
4745 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004746 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004747 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
Igor Murashkine0060932014-01-17 17:24:11 -08004748 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004749 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004750 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
4751 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
4752 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
4753 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004754 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004755 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004756 * <p><b>Range of valid values:</b><br>
4757 * 0-1 on both input and output coordinates, normalized
4758 * as a floating-point value such that 0 == black and 1 == white.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004759 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004760 * <p><b>Full capability</b> -
4761 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4762 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004763 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004764 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08004765 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004766 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004767 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004768 */
4769 public static final Key<float[]> TONEMAP_CURVE_RED =
4770 new Key<float[]>("android.tonemap.curveRed", float[].class);
4771
4772 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004773 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
4774 * is CONTRAST_CURVE.</p>
4775 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
4776 * channels respectively. The following example uses the red channel as an
4777 * example. The same logic applies to green and blue channel.
4778 * Each channel's curve is defined by an array of control points:</p>
4779 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004780 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004781 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
4782 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
4783 * guaranteed that input values 0.0 and 1.0 are included in the list to
4784 * define a complete mapping. For input values between control points,
4785 * the camera device must linearly interpolate between the control
4786 * points.</p>
4787 * <p>Each curve can have an independent number of points, and the number
4788 * of points can be less than max (that is, the request doesn't have to
4789 * always provide a curve with number of points equivalent to
4790 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07004791 * <p>For devices with MONOCHROME capability, all three channels must have the same set of
4792 * control points.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004793 * <p>A few examples, and their corresponding graphical mappings; these
4794 * only specify the red channel and the precision is limited to 4
4795 * digits, for conciseness.</p>
4796 * <p>Linear mapping:</p>
4797 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
4798 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004799 * <p><img alt="Linear mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004800 * <p>Invert mapping:</p>
4801 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
4802 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004803 * <p><img alt="Inverting mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004804 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
4805 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004806 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
4807 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
4808 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
4809 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004810 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004811 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004812 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
4813 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004814 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
4815 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
4816 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
4817 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004818 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004819 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004820 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004821 * <p><b>Full capability</b> -
4822 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4823 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004824 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004825 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004826 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
4827 * @see CaptureRequest#TONEMAP_MODE
4828 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004829 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004830 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07004831 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004832 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
4833 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
4834
4835 /**
Igor Murashkine0060932014-01-17 17:24:11 -08004836 * <p>High-level global contrast/gamma/tonemapping control.</p>
4837 * <p>When switching to an application-defined contrast curve by setting
4838 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
4839 * per-channel with a set of <code>(in, out)</code> points that specify the
4840 * mapping from input high-bit-depth pixel value to the output
4841 * low-bit-depth value. Since the actual pixel ranges of both input
4842 * and output may change depending on the camera pipeline, the values
4843 * are specified by normalized floating-point numbers.</p>
4844 * <p>More-complex color mapping operations such as 3D color look-up
4845 * tables, selective chroma enhancement, or other non-linear color
4846 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4847 * CONTRAST_CURVE.</p>
4848 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004849 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08004850 * These values are always available, and as close as possible to the
4851 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07004852 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08004853 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
4854 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004855 * <p><b>Possible values:</b>
4856 * <ul>
4857 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
4858 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
4859 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004860 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
4861 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004862 * </ul></p>
4863 * <p><b>Available values for this device:</b><br>
4864 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004865 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004866 * <p><b>Full capability</b> -
4867 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4868 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08004869 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004870 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08004871 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004872 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08004873 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004874 * @see #TONEMAP_MODE_CONTRAST_CURVE
4875 * @see #TONEMAP_MODE_FAST
4876 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004877 * @see #TONEMAP_MODE_GAMMA_VALUE
4878 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004879 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004880 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004881 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004882 public static final Key<Integer> TONEMAP_MODE =
4883 new Key<Integer>("android.tonemap.mode", int.class);
4884
4885 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004886 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4887 * GAMMA_VALUE</p>
4888 * <p>The tonemap curve will be defined the following formula:
4889 * * OUT = pow(IN, 1.0 / gamma)
4890 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
4891 * pow is the power function and gamma is the gamma value specified by this
4892 * key.</p>
4893 * <p>The same curve will be applied to all color channels. The camera device
4894 * may clip the input gamma value to its supported range. The actual applied
4895 * value will be returned in capture result.</p>
4896 * <p>The valid range of gamma value varies on different devices, but values
4897 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004898 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004899 *
4900 * @see CaptureRequest#TONEMAP_MODE
4901 */
4902 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004903 @NonNull
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004904 public static final Key<Float> TONEMAP_GAMMA =
4905 new Key<Float>("android.tonemap.gamma", float.class);
4906
4907 /**
4908 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4909 * PRESET_CURVE</p>
4910 * <p>The tonemap curve will be defined by specified standard.</p>
4911 * <p>sRGB (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004912 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004913 * <p>Rec. 709 (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004914 * <p><img alt="Rec. 709 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004915 * <p>Note that above figures show a 16 control points approximation of preset
4916 * curves. Camera devices may apply a different approximation to the curve.</p>
4917 * <p><b>Possible values:</b>
4918 * <ul>
4919 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
4920 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
4921 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004922 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004923 *
4924 * @see CaptureRequest#TONEMAP_MODE
4925 * @see #TONEMAP_PRESET_CURVE_SRGB
4926 * @see #TONEMAP_PRESET_CURVE_REC709
4927 */
4928 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004929 @NonNull
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004930 public static final Key<Integer> TONEMAP_PRESET_CURVE =
4931 new Key<Integer>("android.tonemap.presetCurve", int.class);
4932
4933 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004934 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004935 * that the camera is powered on and may be streaming images back to the
4936 * Application Processor. In certain rare circumstances, the OS may
4937 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08004938 * any untrusted applications.</p>
4939 * <p>In particular, the LED <em>must</em> always be on when the data could be
4940 * transmitted off the device. The LED <em>should</em> always be on whenever
4941 * data is stored locally on the device.</p>
4942 * <p>The LED <em>may</em> be off if a trusted application is using the data that
4943 * doesn't violate the above rules.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004944 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004945 * @hide
4946 */
4947 public static final Key<Boolean> LED_TRANSMIT =
4948 new Key<Boolean>("android.led.transmit", boolean.class);
4949
4950 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004951 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08004952 * to its current values, or is free to vary.</p>
4953 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004954 * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08004955 * a change in other capture settings forced the camera device to
4956 * perform a black level reset.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004957 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004958 * <p><b>Full capability</b> -
4959 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4960 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004961 *
4962 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004963 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004964 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004965 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004966 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004967 public static final Key<Boolean> BLACK_LEVEL_LOCK =
4968 new Key<Boolean>("android.blackLevel.lock", boolean.class);
4969
Igor Murashkin3865a842014-01-17 18:18:39 -08004970 /**
4971 * <p>The frame number corresponding to the last request
4972 * with which the output result (metadata + buffers) has been fully
4973 * synchronized.</p>
4974 * <p>When a request is submitted to the camera device, there is usually a
4975 * delay of several frames before the controls get applied. A camera
4976 * device may either choose to account for this delay by implementing a
4977 * pipeline and carefully submit well-timed atomic control updates, or
4978 * it may start streaming control changes that span over several frame
4979 * boundaries.</p>
4980 * <p>In the latter case, whenever a request's settings change relative to
4981 * the previous submitted request, the full set of changes may take
4982 * multiple frame durations to fully take effect. Some settings may
4983 * take effect sooner (in less frame durations) than others.</p>
4984 * <p>While a set of control changes are being propagated, this value
4985 * will be CONVERGING.</p>
4986 * <p>Once it is fully known that a set of control changes have been
4987 * finished propagating, and the resulting updated control settings
4988 * have been read back by the camera device, this value will be set
4989 * to a non-negative frame number (corresponding to the request to
4990 * which the results have synchronized to).</p>
4991 * <p>Older camera device implementations may not have a way to detect
4992 * when all camera controls have been applied, and will always set this
4993 * value to UNKNOWN.</p>
4994 * <p>FULL capability devices will always have this value set to the
4995 * frame number of the request corresponding to this result.</p>
4996 * <p><em>Further details</em>:</p>
4997 * <ul>
4998 * <li>Whenever a request differs from the last request, any future
4999 * results not yet returned may have this value set to CONVERGING (this
5000 * could include any in-progress captures not yet returned by the camera
5001 * device, for more details see pipeline considerations below).</li>
5002 * <li>Submitting a series of multiple requests that differ from the
5003 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
5004 * moves the new synchronization frame to the last non-repeating
5005 * request (using the smallest frame number from the contiguous list of
5006 * repeating requests).</li>
5007 * <li>Submitting the same request repeatedly will not change this value
5008 * to CONVERGING, if it was already a non-negative value.</li>
5009 * <li>When this value changes to non-negative, that means that all of the
5010 * metadata controls from the request have been applied, all of the
5011 * metadata controls from the camera device have been read to the
5012 * updated values (into the result), and all of the graphics buffers
5013 * corresponding to this result are also synchronized to the request.</li>
5014 * </ul>
5015 * <p><em>Pipeline considerations</em>:</p>
5016 * <p>Submitting a request with updated controls relative to the previously
5017 * submitted requests may also invalidate the synchronization state
5018 * of all the results corresponding to currently in-flight requests.</p>
5019 * <p>In other words, results for this current request and up to
5020 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
5021 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07005022 * <p><b>Possible values:</b>
5023 * <ul>
5024 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
5025 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
5026 * </ul></p>
5027 * <p><b>Available values for this device:</b><br>
5028 * Either a non-negative value corresponding to a
5029 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07005030 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08005031 *
5032 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
5033 * @see #SYNC_FRAME_NUMBER_CONVERGING
5034 * @see #SYNC_FRAME_NUMBER_UNKNOWN
5035 * @hide
5036 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07005037 public static final Key<Long> SYNC_FRAME_NUMBER =
5038 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08005039
Zhijun He0e99c222015-01-29 15:26:05 -08005040 /**
5041 * <p>The amount of exposure time increase factor applied to the original output
5042 * frame by the application processing before sending for reprocessing.</p>
5043 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
5044 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
5045 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
5046 * output frames to effectively reduce the noise to the same level as a frame that was
5047 * captured with longer exposure time. To be more specific, assuming the original captured
5048 * images were captured with a sensitivity of S and an exposure time of T, the model in
5049 * the camera device is that the amount of noise in the image would be approximately what
5050 * would be expected if the original capture parameters had been a sensitivity of
5051 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
5052 * than S and T respectively. If the captured images were processed by the application
5053 * before being sent for reprocessing, then the application may have used image processing
5054 * algorithms and/or multi-frame image fusion to reduce the noise in the
5055 * application-processed images (input images). By using the effectiveExposureFactor
5056 * control, the application can communicate to the camera device the actual noise level
5057 * improvement in the application-processed image. With this information, the camera
5058 * device can select appropriate noise reduction and edge enhancement parameters to avoid
5059 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
5060 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
5061 * <p>For example, for multi-frame image fusion use case, the application may fuse
5062 * multiple output frames together to a final frame for reprocessing. When N image are
5063 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
5064 * square root of N (based on a simple photon shot noise model). The camera device will
5065 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
5066 * produce the best quality images.</p>
5067 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
5068 * buffer in a way that affects its effective exposure time.</p>
5069 * <p>This control is only effective for YUV reprocessing capture request. For noise
5070 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
5071 * Similarly, for edge enhancement reprocessing, it is only effective when
5072 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
5073 * <p><b>Units</b>: Relative exposure time increase factor.</p>
5074 * <p><b>Range of valid values:</b><br>
5075 * &gt;= 1.0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08005076 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07005077 * <p><b>Limited capability</b> -
5078 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5079 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0e99c222015-01-29 15:26:05 -08005080 *
5081 * @see CaptureRequest#EDGE_MODE
Zhijun He513f7c32015-04-24 18:23:54 -07005082 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08005083 * @see CaptureRequest#NOISE_REDUCTION_MODE
5084 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
5085 */
5086 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08005087 @NonNull
Zhijun He0e99c222015-01-29 15:26:05 -08005088 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
5089 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
5090
Eino-Ville Talvala41670722018-03-13 19:43:07 -07005091 /**
Shuzhen Wang61aaa322018-11-19 16:04:57 -08005092 * <p>String containing the ID of the underlying active physical camera.</p>
5093 * <p>The ID of the active physical camera that's backing the logical camera. All camera
5094 * streams and metadata that are not physical camera specific will be originating from this
Shuzhen Wang8f620842019-02-27 08:55:53 -08005095 * physical camera.</p>
Shuzhen Wang61aaa322018-11-19 16:04:57 -08005096 * <p>For a logical camera made up of physical cameras where each camera's lenses have
5097 * different characteristics, the camera device may choose to switch between the physical
5098 * cameras when application changes FOCAL_LENGTH or SCALER_CROP_REGION.
5099 * At the time of lens switch, this result metadata reflects the new active physical camera
5100 * ID.</p>
Shuzhen Wang8f620842019-02-27 08:55:53 -08005101 * <p>This key will be available if the camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.
5102 * When available, this must be one of valid physical IDs backing this logical multi-camera.
5103 * If this key is not available for a logical multi-camera, the camera device implementation
5104 * may still switch between different active physical cameras based on use case, but the
5105 * current active physical camera information won't be available to the application.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08005106 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wang61aaa322018-11-19 16:04:57 -08005107 */
5108 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08005109 @NonNull
Shuzhen Wang61aaa322018-11-19 16:04:57 -08005110 public static final Key<String> LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID =
5111 new Key<String>("android.logicalMultiCamera.activePhysicalId", String.class);
5112
5113 /**
Eino-Ville Talvala41670722018-03-13 19:43:07 -07005114 * <p>Mode of operation for the lens distortion correction block.</p>
5115 * <p>The lens distortion correction block attempts to improve image quality by fixing
5116 * radial, tangential, or other geometric aberrations in the camera device's optics. If
5117 * available, the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} field documents the lens's distortion parameters.</p>
5118 * <p>OFF means no distortion correction is done.</p>
5119 * <p>FAST/HIGH_QUALITY both mean camera device determined distortion correction will be
5120 * applied. HIGH_QUALITY mode indicates that the camera device will use the highest-quality
5121 * correction algorithms, even if it slows down capture rate. FAST means the camera device
5122 * will not slow down capture rate when applying correction. FAST may be the same as OFF if
5123 * any correction at all would slow down capture rate. Every output stream will have a
5124 * similar amount of enhancement applied.</p>
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07005125 * <p>The correction only applies to processed outputs such as YUV, Y8, JPEG, or DEPTH16; it is
5126 * not applied to any RAW output.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07005127 * <p>This control will be on by default on devices that support this control. Applications
5128 * disabling distortion correction need to pay extra attention with the coordinate system of
5129 * metering regions, crop region, and face rectangles. When distortion correction is OFF,
5130 * metadata coordinates follow the coordinate system of
5131 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}. When distortion is not OFF, metadata
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07005132 * coordinates follow the coordinate system of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}. The
5133 * camera device will map these metadata fields to match the corrected image produced by the
5134 * camera device, for both capture requests and results. However, this mapping is not very
5135 * precise, since rectangles do not generally map to rectangles when corrected. Only linear
5136 * scaling between the active array and precorrection active array coordinates is
5137 * performed. Applications that require precise correction of metadata need to undo that
5138 * linear scaling, and apply a more complete correction that takes into the account the app's
5139 * own requirements.</p>
5140 * <p>The full list of metadata that is affected in this way by distortion correction is:</p>
5141 * <ul>
5142 * <li>{@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}</li>
5143 * <li>{@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}</li>
5144 * <li>{@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}</li>
5145 * <li>{@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}</li>
5146 * <li>{@link CaptureResult#STATISTICS_FACES android.statistics.faces}</li>
5147 * </ul>
Eino-Ville Talvala41670722018-03-13 19:43:07 -07005148 * <p><b>Possible values:</b>
5149 * <ul>
5150 * <li>{@link #DISTORTION_CORRECTION_MODE_OFF OFF}</li>
5151 * <li>{@link #DISTORTION_CORRECTION_MODE_FAST FAST}</li>
5152 * <li>{@link #DISTORTION_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
5153 * </ul></p>
5154 * <p><b>Available values for this device:</b><br>
5155 * {@link CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES android.distortionCorrection.availableModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08005156 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala41670722018-03-13 19:43:07 -07005157 *
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07005158 * @see CaptureRequest#CONTROL_AE_REGIONS
5159 * @see CaptureRequest#CONTROL_AF_REGIONS
5160 * @see CaptureRequest#CONTROL_AWB_REGIONS
Eino-Ville Talvala41670722018-03-13 19:43:07 -07005161 * @see CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES
5162 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07005163 * @see CaptureRequest#SCALER_CROP_REGION
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07005164 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
5165 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07005166 * @see CaptureResult#STATISTICS_FACES
Eino-Ville Talvala41670722018-03-13 19:43:07 -07005167 * @see #DISTORTION_CORRECTION_MODE_OFF
5168 * @see #DISTORTION_CORRECTION_MODE_FAST
5169 * @see #DISTORTION_CORRECTION_MODE_HIGH_QUALITY
5170 */
5171 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08005172 @NonNull
Eino-Ville Talvala41670722018-03-13 19:43:07 -07005173 public static final Key<Integer> DISTORTION_CORRECTION_MODE =
5174 new Key<Integer>("android.distortionCorrection.mode", int.class);
5175
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07005176 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
5177 * End generated code
5178 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07005179
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07005180
5181
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08005182
5183
5184
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08005185}