blob: 585c597c58e43e26aa181b60e9ef2b7164618008 [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;
Mathew Inwoodbcbe4402018-08-08 15:42:59 +010021import android.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 */
Justin Yunf01e40c2018-05-18 20:39:45 +090092 public Key(String name, String fallbackName, Class<T> type) {
93 mKey = new CameraMetadataNative.Key<T>(name, fallbackName, type);
94 }
95
96 /**
97 * Visible for testing and vendor extensions only.
98 *
99 * @hide
100 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100101 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700102 public Key(String name, Class<T> type) {
103 mKey = new CameraMetadataNative.Key<T>(name, type);
104 }
105
106 /**
107 * Visible for testing and vendor extensions only.
108 *
109 * @hide
110 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100111 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700112 public Key(String name, TypeReference<T> typeReference) {
113 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
114 }
115
116 /**
117 * Return a camelCase, period separated name formatted like:
118 * {@code "root.section[.subsections].name"}.
119 *
120 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
121 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
122 *
123 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
124 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
125 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
126 *
127 * @return String representation of the key name
128 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700129 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700130 public String getName() {
131 return mKey.getName();
132 }
133
134 /**
Emilian Peevde62d842017-03-23 19:20:40 +0000135 * Return vendor tag id.
136 *
137 * @hide
138 */
139 public long getVendorId() {
140 return mKey.getVendorId();
141 }
142
143 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700144 * {@inheritDoc}
145 */
146 @Override
147 public final int hashCode() {
148 return mKey.hashCode();
149 }
150
151 /**
152 * {@inheritDoc}
153 */
154 @SuppressWarnings("unchecked")
155 @Override
156 public final boolean equals(Object o) {
157 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
158 }
159
160 /**
Chien-Yu Chen12a83852015-07-07 12:17:22 -0700161 * Return this {@link Key} as a string representation.
162 *
163 * <p>{@code "CaptureResult.Key(%s)"}, where {@code %s} represents
164 * the name of this key as returned by {@link #getName}.</p>
165 *
166 * @return string representation of {@link Key}
167 */
168 @NonNull
169 @Override
170 public String toString() {
171 return String.format("CaptureResult.Key(%s)", mKey.getName());
172 }
173
174 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700175 * Visible for CameraMetadataNative implementation only; do not use.
176 *
177 * TODO: Make this private or remove it altogether.
178 *
179 * @hide
180 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100181 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700182 public CameraMetadataNative.Key<T> getNativeKey() {
183 return mKey;
184 }
185
186 @SuppressWarnings({ "unchecked" })
187 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
188 mKey = (CameraMetadataNative.Key<T>) nativeKey;
189 }
190 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700191
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100192 @UnsupportedAppUsage
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700193 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700194 private final CaptureRequest mRequest;
195 private final int mSequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700196 private final long mFrameNumber;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700197
Igor Murashkin70725502013-06-25 20:27:06 +0000198 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700199 * Takes ownership of the passed-in properties object
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700200 *
201 * <p>For internal use only</p>
Igor Murashkin70725502013-06-25 20:27:06 +0000202 * @hide
203 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700204 public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
205 CaptureResultExtras extras) {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700206 if (results == null) {
207 throw new IllegalArgumentException("results was null");
208 }
209
210 if (parent == null) {
211 throw new IllegalArgumentException("parent was null");
212 }
213
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700214 if (extras == null) {
215 throw new IllegalArgumentException("extras was null");
216 }
217
Igor Murashkind6d65152014-05-19 16:31:02 -0700218 mResults = CameraMetadataNative.move(results);
219 if (mResults.isEmpty()) {
220 throw new AssertionError("Results must not be empty");
221 }
Emilian Peevde62d842017-03-23 19:20:40 +0000222 setNativeInstance(mResults);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700223 mRequest = parent;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700224 mSequenceId = extras.getRequestId();
225 mFrameNumber = extras.getFrameNumber();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700226 }
227
Ruben Brunkf967a542014-04-28 16:31:11 -0700228 /**
229 * Returns a copy of the underlying {@link CameraMetadataNative}.
230 * @hide
231 */
232 public CameraMetadataNative getNativeCopy() {
233 return new CameraMetadataNative(mResults);
234 }
235
Igor Murashkind6d65152014-05-19 16:31:02 -0700236 /**
237 * Creates a request-less result.
238 *
239 * <p><strong>For testing only.</strong></p>
240 * @hide
241 */
242 public CaptureResult(CameraMetadataNative results, int sequenceId) {
243 if (results == null) {
244 throw new IllegalArgumentException("results was null");
245 }
246
247 mResults = CameraMetadataNative.move(results);
248 if (mResults.isEmpty()) {
249 throw new AssertionError("Results must not be empty");
250 }
251
Emilian Peevde62d842017-03-23 19:20:40 +0000252 setNativeInstance(mResults);
Igor Murashkind6d65152014-05-19 16:31:02 -0700253 mRequest = null;
254 mSequenceId = sequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700255 mFrameNumber = -1;
Igor Murashkind6d65152014-05-19 16:31:02 -0700256 }
257
258 /**
259 * Get a capture result field value.
260 *
261 * <p>The field definitions can be found in {@link CaptureResult}.</p>
262 *
263 * <p>Querying the value for the same key more than once will return a value
264 * which is equal to the previous queried value.</p>
265 *
266 * @throws IllegalArgumentException if the key was not valid
267 *
268 * @param key The result field to read.
269 * @return The value of that key, or {@code null} if the field is not set.
270 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700271 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700272 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700273 T value = mResults.get(key);
274 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
275 return value;
276 }
277
278 /**
279 * {@inheritDoc}
280 * @hide
281 */
282 @SuppressWarnings("unchecked")
283 @Override
284 protected <T> T getProtected(Key<?> key) {
285 return (T) mResults.get(key);
286 }
287
288 /**
289 * {@inheritDoc}
290 * @hide
291 */
292 @SuppressWarnings("unchecked")
293 @Override
294 protected Class<Key<?>> getKeyClass() {
295 Object thisClass = Key.class;
296 return (Class<Key<?>>)thisClass;
297 }
298
299 /**
300 * Dumps the native metadata contents to logcat.
301 *
302 * <p>Visibility for testing/debugging only. The results will not
303 * include any synthesized keys, as they are invisible to the native layer.</p>
304 *
305 * @hide
306 */
307 public void dumpToLog() {
308 mResults.dumpToLog();
309 }
310
311 /**
312 * {@inheritDoc}
313 */
314 @Override
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700315 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700316 public List<Key<?>> getKeys() {
317 // Force the javadoc for this function to show up on the CaptureResult page
318 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800319 }
320
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700321 /**
322 * Get the request associated with this result.
323 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700324 * <p>Whenever a request has been fully or partially captured, with
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700325 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or
326 * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s
Igor Murashkindb075af2014-05-21 10:07:08 -0700327 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700328 * </p>
329 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700330 * <p>For example,
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700331 * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700332 * {@literal @}Override
333 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
334 * assert(myResult.getRequest.equals(myRequest) == true);
335 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700336 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700337 * </code></pre>
338 * </p>
339 *
340 * @return The request associated with this result. Never {@code null}.
341 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700342 @NonNull
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700343 public CaptureRequest getRequest() {
344 return mRequest;
345 }
346
347 /**
348 * Get the frame number associated with this result.
349 *
350 * <p>Whenever a request has been processed, regardless of failure or success,
351 * it gets a unique frame number assigned to its future result/failure.</p>
352 *
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700353 * <p>For the same type of request (capturing from the camera device or reprocessing), this
354 * value monotonically increments, starting with 0, for every new result or failure and the
355 * scope is the lifetime of the {@link CameraDevice}. Between different types of requests,
356 * the frame number may not monotonically increment. For example, the frame number of a newer
357 * reprocess result may be smaller than the frame number of an older result of capturing new
358 * images from the camera device, but the frame number of a newer reprocess result will never be
359 * smaller than the frame number of an older reprocess result.</p>
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700360 *
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700361 * @return The frame number
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700362 *
363 * @see CameraDevice#createCaptureRequest
364 * @see CameraDevice#createReprocessCaptureRequest
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700365 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700366 public long getFrameNumber() {
367 return mFrameNumber;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700368 }
369
370 /**
371 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700372 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700373 *
374 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
375 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
376 *
377 * @return int The ID for the sequence of requests that this capture result is a part of
378 *
Aurimas Liutikasdc309f22018-06-04 15:35:31 -0700379 * @see CameraCaptureSession.CaptureCallback#onCaptureSequenceCompleted
380 * @see CameraCaptureSession.CaptureCallback#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700381 */
382 public int getSequenceId() {
383 return mSequenceId;
384 }
385
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700386 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
387 * The key entries below this point are generated from metadata
388 * definitions in /system/media/camera/docs. Do not modify by hand or
389 * modify the comment blocks at the start or end.
390 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
391
392 /**
Zhijun He379af012014-05-06 11:54:54 -0700393 * <p>The mode control selects how the image data is converted from the
394 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700395 * <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 -0700396 * control is overridden by the AWB routine. When AWB is disabled, the
397 * application controls how the color mapping is performed.</p>
398 * <p>We define the expected processing pipeline below. For consistency
399 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
400 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
401 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
402 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
403 * camera device (in the results) and be roughly correct.</p>
404 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
405 * FAST or HIGH_QUALITY will yield a picture with the same white point
406 * as what was produced by the camera device in the earlier frame.</p>
407 * <p>The expected processing pipeline is as follows:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -0800408 * <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 -0700409 * <p>The white balance is encoded by two values, a 4-channel white-balance
410 * gain vector (applied in the Bayer domain), and a 3x3 color transform
411 * matrix (applied after demosaic).</p>
412 * <p>The 4-channel white-balance gains are defined as:</p>
413 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
414 * </code></pre>
415 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
416 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
417 * These may be identical for a given camera device implementation; if
418 * the camera device does not support a separate gain for even/odd green
419 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
420 * <code>G_even</code> in the output result metadata.</p>
421 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
422 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
423 * </code></pre>
424 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
425 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
426 * <p>with colors as follows:</p>
427 * <pre><code>r' = I0r + I1g + I2b
428 * g' = I3r + I4g + I5b
429 * b' = I6r + I7g + I8b
430 * </code></pre>
431 * <p>Both the input and output value ranges must match. Overflow/underflow
432 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700433 * <p><b>Possible values:</b>
434 * <ul>
435 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
436 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
437 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
438 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700439 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
440 * <p><b>Full capability</b> -
441 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
442 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700443 *
444 * @see CaptureRequest#COLOR_CORRECTION_GAINS
445 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
446 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700447 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700448 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
449 * @see #COLOR_CORRECTION_MODE_FAST
450 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
451 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700452 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700453 public static final Key<Integer> COLOR_CORRECTION_MODE =
454 new Key<Integer>("android.colorCorrection.mode", int.class);
455
456 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800457 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700458 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800459 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800460 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700461 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800462 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800463 * <p>In the latter case, the camera device may round the matrix to account
464 * for precision issues; the final rounded matrix should be reported back
465 * in this matrix result metadata. The transform should keep the magnitude
466 * of the output color values within <code>[0, 1.0]</code> (assuming input color
467 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800468 * <p>The valid range of each matrix element varies on different devices, but
469 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700470 * <p><b>Units</b>: Unitless scale factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700471 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
472 * <p><b>Full capability</b> -
473 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
474 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800475 *
476 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700477 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700478 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700479 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700480 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
481 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700482
483 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800484 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800485 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700486 * <p>These per-channel gains are either set by the camera device
487 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
488 * TRANSFORM_MATRIX, or directly by the application in the
489 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
490 * TRANSFORM_MATRIX.</p>
491 * <p>The gains in the result metadata are the gains actually
492 * applied by the camera device to the current frame.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800493 * <p>The valid range of gains varies on different devices, but gains
494 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
495 * device allows gains below 1.0, this is usually not recommended because
496 * this can create color artifacts.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700497 * <p><b>Units</b>: Unitless gain factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700498 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
499 * <p><b>Full capability</b> -
500 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
501 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800502 *
503 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700504 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700505 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700506 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700507 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
508 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700509
510 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700511 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700512 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
513 * can not focus on the same point after exiting from the lens. This metadata defines
514 * the high level control of chromatic aberration correction algorithm, which aims to
515 * minimize the chromatic artifacts that may occur along the object boundaries in an
516 * image.</p>
517 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
518 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
519 * use the highest-quality aberration correction algorithms, even if it slows down
520 * capture rate. FAST means the camera device will not slow down capture rate when
521 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700522 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700523 * <p><b>Possible values:</b>
524 * <ul>
525 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
526 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
527 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
528 * </ul></p>
529 * <p><b>Available values for this device:</b><br>
530 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700531 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700532 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700533 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
534 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
535 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
536 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700537 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700538 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700539 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
540 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700541
542 /**
Zhijun He379af012014-05-06 11:54:54 -0700543 * <p>The desired setting for the camera device's auto-exposure
544 * algorithm's antibanding compensation.</p>
545 * <p>Some kinds of lighting fixtures, such as some fluorescent
546 * lights, flicker at the rate of the power supply frequency
547 * (60Hz or 50Hz, depending on country). While this is
548 * typically not noticeable to a person, it can be visible to
549 * a camera device. If a camera sets its exposure time to the
550 * wrong value, the flicker may become visible in the
551 * viewfinder as flicker or in a final captured image, as a
552 * set of variable-brightness bands across the image.</p>
553 * <p>Therefore, the auto-exposure routines of camera devices
554 * include antibanding routines that ensure that the chosen
555 * exposure value will not cause such banding. The choice of
556 * exposure time depends on the rate of flicker, which the
557 * camera device can detect automatically, or the expected
558 * rate can be selected by the application using this
559 * control.</p>
560 * <p>A given camera device may not support all of the possible
561 * options for the antibanding mode. The
562 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
563 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800564 * <p>AUTO mode is the default if it is available on given
565 * camera device. When AUTO mode is not available, the
566 * default will be either 50HZ or 60HZ, and both 50HZ
567 * and 60HZ will be available.</p>
Zhijun He379af012014-05-06 11:54:54 -0700568 * <p>If manual exposure control is enabled (by setting
569 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
570 * then this setting has no effect, and the application must
571 * ensure it selects exposure times that do not cause banding
572 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
573 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700574 * <p><b>Possible values:</b>
575 * <ul>
576 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
577 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
578 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
579 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
580 * </ul></p>
581 * <p><b>Available values for this device:</b><br></p>
582 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700583 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700584 *
585 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
586 * @see CaptureRequest#CONTROL_AE_MODE
587 * @see CaptureRequest#CONTROL_MODE
588 * @see CaptureResult#STATISTICS_SCENE_FLICKER
589 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
590 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
591 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
592 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
593 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700594 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700595 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
596 new Key<Integer>("android.control.aeAntibandingMode", int.class);
597
598 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700599 * <p>Adjustment to auto-exposure (AE) target image
600 * brightness.</p>
601 * <p>The adjustment is measured as a count of steps, with the
602 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
603 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
604 * <p>For example, if the exposure value (EV) step is 0.333, '6'
605 * will mean an exposure compensation of +2 EV; -3 will mean an
606 * exposure compensation of -1 EV. One EV represents a doubling
607 * of image brightness. Note that this control will only be
608 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
609 * 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 -0700610 * <p>In the event of exposure compensation value being changed, camera device
611 * may take several frames to reach the newly requested exposure target.
612 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
613 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
614 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
615 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700616 * <p><b>Units</b>: Compensation steps</p>
617 * <p><b>Range of valid values:</b><br>
618 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700619 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700620 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700621 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
622 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700623 * @see CaptureRequest#CONTROL_AE_LOCK
624 * @see CaptureRequest#CONTROL_AE_MODE
625 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700626 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700627 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700628 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
629 new Key<Integer>("android.control.aeExposureCompensation", int.class);
630
631 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700632 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700633 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700634 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
635 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
636 * <p>Note that even when AE is locked, the flash may be fired if
637 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
638 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700639 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
640 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700641 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
642 * when AE is already locked, the camera device will not change the exposure time
643 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
644 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
645 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
Zhijun Hefa95b042015-02-09 10:40:49 -0800646 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
647 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
648 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
649 * the AE if AE is locked by the camera device internally during precapture metering
650 * sequence In other words, submitting requests with AE unlock has no effect for an
651 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
652 * will never succeed in a sequence of preview requests where AE lock is always set
653 * to <code>false</code>.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700654 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
655 * get locked do not necessarily correspond to the settings that were present in the
656 * latest capture result received from the camera device, since additional captures
657 * and AE updates may have occurred even before the result was sent out. If an
658 * application is switching between automatic and manual control and wishes to eliminate
659 * any flicker during the switch, the following procedure is recommended:</p>
660 * <ol>
661 * <li>Starting in auto-AE mode:</li>
662 * <li>Lock AE</li>
663 * <li>Wait for the first result to be output that has the AE locked</li>
664 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
665 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
666 * </ol>
Zhijun He379af012014-05-06 11:54:54 -0700667 * <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 -0700668 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700669 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700670 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700671 * @see CaptureRequest#CONTROL_AE_MODE
672 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
673 * @see CaptureResult#CONTROL_AE_STATE
674 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
675 * @see CaptureRequest#SENSOR_SENSITIVITY
676 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700677 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700678 public static final Key<Boolean> CONTROL_AE_LOCK =
679 new Key<Boolean>("android.control.aeLock", boolean.class);
680
681 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800682 * <p>The desired mode for the camera device's
683 * auto-exposure routine.</p>
684 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
685 * AUTO.</p>
686 * <p>When set to any of the ON modes, the camera device's
687 * auto-exposure routine is enabled, overriding the
688 * application's selected exposure time, sensor sensitivity,
689 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
690 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
691 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
692 * is selected, the camera device's flash unit controls are
693 * also overridden.</p>
694 * <p>The FLASH modes are only available if the camera device
695 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
696 * <p>If flash TORCH mode is desired, this field must be set to
697 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
698 * <p>When set to any of the ON modes, the values chosen by the
699 * camera device auto-exposure routine for the overridden
700 * fields for a given capture will be available in its
701 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700702 * <p><b>Possible values:</b>
703 * <ul>
704 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
705 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
706 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
707 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
708 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800709 * <li>{@link #CONTROL_AE_MODE_ON_EXTERNAL_FLASH ON_EXTERNAL_FLASH}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700710 * </ul></p>
711 * <p><b>Available values for this device:</b><br>
712 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700713 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800714 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700715 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -0800716 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800717 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
718 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800719 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
720 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800721 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800722 * @see #CONTROL_AE_MODE_OFF
723 * @see #CONTROL_AE_MODE_ON
724 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
725 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
726 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800727 * @see #CONTROL_AE_MODE_ON_EXTERNAL_FLASH
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800728 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700729 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800730 public static final Key<Integer> CONTROL_AE_MODE =
731 new Key<Integer>("android.control.aeMode", int.class);
732
733 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700734 * <p>List of metering areas to use for auto-exposure adjustment.</p>
735 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700736 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700737 * <p>The maximum number of regions supported by the device is determined by the value
738 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700739 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
740 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
741 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800742 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700743 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
744 * active pixel array.</p>
745 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
746 * system depends on the mode being set.
747 * When the distortion correction mode is OFF, the coordinate system follows
748 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
749 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
750 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
751 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
752 * pixel in the pre-correction active pixel array.
753 * When the distortion correction mode is not OFF, the coordinate system follows
754 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
755 * <code>(0, 0)</code> being the top-left pixel of the active array, and
756 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
757 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
758 * active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700759 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700760 * for every pixel in the area. This means that a large metering area
761 * with the same weight as a smaller area will have more effect in
762 * the metering result. Metering areas can partially overlap and the
763 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700764 * <p>The weights are relative to weights of other exposure metering regions, so if only one
765 * region is used, all non-zero weights will have the same effect. A region with 0
766 * weight is ignored.</p>
767 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
768 * camera device.</p>
769 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
770 * capture result metadata, the camera device will ignore the sections outside the crop
771 * region and output only the intersection rectangle as the metering region in the result
772 * metadata. If the region is entirely outside the crop region, it will be ignored and
773 * not reported in the result metadata.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700774 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
775 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
776 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700777 * <p><b>Range of valid values:</b><br>
778 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700779 * {@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}
780 * depending on distortion correction capability and mode</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700781 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800782 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700783 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700784 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800785 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800786 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700787 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700788 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700789 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700790 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
791 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700792
793 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700794 * <p>Range over which the auto-exposure routine can
795 * adjust the capture frame rate to maintain good
796 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700797 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700798 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
799 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
800 * <p><b>Units</b>: Frames per second (FPS)</p>
801 * <p><b>Range of valid values:</b><br>
802 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
803 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700804 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700805 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Zhijun He379af012014-05-06 11:54:54 -0700806 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700807 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He379af012014-05-06 11:54:54 -0700808 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700809 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700810 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
811 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700812
813 /**
814 * <p>Whether the camera device will trigger a precapture
815 * metering sequence when it processes this request.</p>
816 * <p>This entry is normally set to IDLE, or is not
817 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -0800818 * set to START, the camera device will trigger the auto-exposure (AE)
Zhijun He379af012014-05-06 11:54:54 -0700819 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -0800820 * <p>When set to CANCEL, the camera device will cancel any active
821 * precapture metering trigger, and return to its initial AE state.
822 * If a precapture metering sequence is already completed, and the camera
823 * device has implicitly locked the AE for subsequent still capture, the
824 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800825 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700826 * high-quality still capture for final metering decisions to
827 * be made, and for firing pre-capture flash pulses to estimate
828 * scene brightness and required final capture flash power, when
829 * the flash is enabled.</p>
830 * <p>Normally, this entry should be set to START for only a
831 * single request, and the application should wait until the
832 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800833 * <p>When a precapture metering sequence is finished, the camera device
834 * may lock the auto-exposure routine internally to be able to accurately expose the
835 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
836 * For this case, the AE may not resume normal scan if no subsequent still capture is
837 * submitted. To ensure that the AE routine restarts normal scan, the application should
838 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
839 * 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 -0800840 * still capture request after the precapture sequence completes. Alternatively, for
841 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
842 * internally locked AE if the application doesn't submit a still capture request after
843 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
844 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700845 * <p>The exact effect of auto-exposure (AE) precapture trigger
846 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700847 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
848 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700849 * <p>On LEGACY-level devices, the precapture trigger is not supported;
850 * capturing a high-resolution JPEG image will automatically trigger a
851 * precapture sequence before the high-resolution capture, including
852 * potentially firing a pre-capture flash.</p>
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -0700853 * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
854 * simultaneously is allowed. However, since these triggers often require cooperation between
855 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
856 * focus sweep), the camera device may delay acting on a later trigger until the previous
857 * trigger has been fully handled. This may lead to longer intervals between the trigger and
858 * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for
859 * example.</p>
860 * <p>If both the precapture and the auto-focus trigger are activated on the same request, then
861 * the camera device will complete them in the optimal order for that device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700862 * <p><b>Possible values:</b>
863 * <ul>
864 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
865 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -0800866 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700867 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700868 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
869 * <p><b>Limited capability</b> -
870 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
871 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700872 *
Zhijun Hedd72be52015-02-06 13:49:51 -0800873 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He379af012014-05-06 11:54:54 -0700874 * @see CaptureResult#CONTROL_AE_STATE
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -0700875 * @see CaptureRequest#CONTROL_AF_TRIGGER
Zhijun Hedd72be52015-02-06 13:49:51 -0800876 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700877 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700878 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
879 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -0800880 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Zhijun He379af012014-05-06 11:54:54 -0700881 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700882 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700883 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
884 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
885
886 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700887 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800888 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
889 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
890 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
891 * the algorithm states to INACTIVE.</p>
892 * <p>The camera device can do several state transitions between two results, if it is
893 * allowed by the state transition table. For example: INACTIVE may never actually be
894 * seen in a result.</p>
895 * <p>The state in the result is the state for this image (in sync with this image): if
896 * AE state becomes CONVERGED, then the image data associated with this result should
897 * be good to use.</p>
898 * <p>Below are state transition tables for different AE modes.</p>
899 * <table>
900 * <thead>
901 * <tr>
902 * <th align="center">State</th>
903 * <th align="center">Transition Cause</th>
904 * <th align="center">New State</th>
905 * <th align="center">Notes</th>
906 * </tr>
907 * </thead>
908 * <tbody>
909 * <tr>
910 * <td align="center">INACTIVE</td>
911 * <td align="center"></td>
912 * <td align="center">INACTIVE</td>
913 * <td align="center">Camera device auto exposure algorithm is disabled</td>
914 * </tr>
915 * </tbody>
916 * </table>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800917 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON*:</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800918 * <table>
919 * <thead>
920 * <tr>
921 * <th align="center">State</th>
922 * <th align="center">Transition Cause</th>
923 * <th align="center">New State</th>
924 * <th align="center">Notes</th>
925 * </tr>
926 * </thead>
927 * <tbody>
928 * <tr>
929 * <td align="center">INACTIVE</td>
930 * <td align="center">Camera device initiates AE scan</td>
931 * <td align="center">SEARCHING</td>
932 * <td align="center">Values changing</td>
933 * </tr>
934 * <tr>
935 * <td align="center">INACTIVE</td>
936 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
937 * <td align="center">LOCKED</td>
938 * <td align="center">Values locked</td>
939 * </tr>
940 * <tr>
941 * <td align="center">SEARCHING</td>
942 * <td align="center">Camera device finishes AE scan</td>
943 * <td align="center">CONVERGED</td>
944 * <td align="center">Good values, not changing</td>
945 * </tr>
946 * <tr>
947 * <td align="center">SEARCHING</td>
948 * <td align="center">Camera device finishes AE scan</td>
949 * <td align="center">FLASH_REQUIRED</td>
950 * <td align="center">Converged but too dark w/o flash</td>
951 * </tr>
952 * <tr>
953 * <td align="center">SEARCHING</td>
954 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
955 * <td align="center">LOCKED</td>
956 * <td align="center">Values locked</td>
957 * </tr>
958 * <tr>
959 * <td align="center">CONVERGED</td>
960 * <td align="center">Camera device initiates AE scan</td>
961 * <td align="center">SEARCHING</td>
962 * <td align="center">Values changing</td>
963 * </tr>
964 * <tr>
965 * <td align="center">CONVERGED</td>
966 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
967 * <td align="center">LOCKED</td>
968 * <td align="center">Values locked</td>
969 * </tr>
970 * <tr>
971 * <td align="center">FLASH_REQUIRED</td>
972 * <td align="center">Camera device initiates AE scan</td>
973 * <td align="center">SEARCHING</td>
974 * <td align="center">Values changing</td>
975 * </tr>
976 * <tr>
977 * <td align="center">FLASH_REQUIRED</td>
978 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
979 * <td align="center">LOCKED</td>
980 * <td align="center">Values locked</td>
981 * </tr>
982 * <tr>
983 * <td align="center">LOCKED</td>
984 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
985 * <td align="center">SEARCHING</td>
986 * <td align="center">Values not good after unlock</td>
987 * </tr>
988 * <tr>
989 * <td align="center">LOCKED</td>
990 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
991 * <td align="center">CONVERGED</td>
992 * <td align="center">Values good after unlock</td>
993 * </tr>
994 * <tr>
995 * <td align="center">LOCKED</td>
996 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
997 * <td align="center">FLASH_REQUIRED</td>
998 * <td align="center">Exposure good, but too dark</td>
999 * </tr>
1000 * <tr>
1001 * <td align="center">PRECAPTURE</td>
1002 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
1003 * <td align="center">CONVERGED</td>
1004 * <td align="center">Ready for high-quality capture</td>
1005 * </tr>
1006 * <tr>
1007 * <td align="center">PRECAPTURE</td>
1008 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
1009 * <td align="center">LOCKED</td>
1010 * <td align="center">Ready for high-quality capture</td>
1011 * </tr>
1012 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001013 * <td align="center">LOCKED</td>
1014 * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td>
1015 * <td align="center">LOCKED</td>
1016 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
1017 * </tr>
1018 * <tr>
1019 * <td align="center">LOCKED</td>
1020 * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</td>
1021 * <td align="center">LOCKED</td>
1022 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
1023 * </tr>
1024 * <tr>
1025 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001026 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
1027 * <td align="center">PRECAPTURE</td>
1028 * <td align="center">Start AE precapture metering sequence</td>
1029 * </tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001030 * <tr>
1031 * <td align="center">Any state (excluding LOCKED)</td>
1032 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td>
1033 * <td align="center">INACTIVE</td>
1034 * <td align="center">Currently active precapture metering sequence is canceled</td>
1035 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001036 * </tbody>
1037 * </table>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001038 * <p>If the camera device supports AE external flash mode (ON_EXTERNAL_FLASH is included in
Chien-Yu Chenc9ca7222018-03-15 11:14:29 -07001039 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}), {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} must be FLASH_REQUIRED after
1040 * the camera device finishes AE scan and it's too dark without flash.</p>
Zhijun He60b19dc2014-02-24 10:19:20 -08001041 * <p>For the above table, the camera device may skip reporting any state changes that happen
1042 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1043 * can be skipped in that manner is called a transient state.</p>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001044 * <p>For example, for above AE modes (AE_MODE_ON*), in addition to the state transitions
Zhijun He60b19dc2014-02-24 10:19:20 -08001045 * listed in above table, it is also legal for the camera device to skip one or more
1046 * transient states between two results. See below table for examples:</p>
1047 * <table>
1048 * <thead>
1049 * <tr>
1050 * <th align="center">State</th>
1051 * <th align="center">Transition Cause</th>
1052 * <th align="center">New State</th>
1053 * <th align="center">Notes</th>
1054 * </tr>
1055 * </thead>
1056 * <tbody>
1057 * <tr>
1058 * <td align="center">INACTIVE</td>
1059 * <td align="center">Camera device finished AE scan</td>
1060 * <td align="center">CONVERGED</td>
1061 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1062 * </tr>
1063 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001064 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001065 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
1066 * <td align="center">FLASH_REQUIRED</td>
1067 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
1068 * </tr>
1069 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001070 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001071 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
1072 * <td align="center">CONVERGED</td>
1073 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
1074 * </tr>
1075 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001076 * <td align="center">Any state (excluding LOCKED)</td>
1077 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1078 * <td align="center">FLASH_REQUIRED</td>
1079 * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td>
1080 * </tr>
1081 * <tr>
1082 * <td align="center">Any state (excluding LOCKED)</td>
1083 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1084 * <td align="center">CONVERGED</td>
1085 * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td>
1086 * </tr>
1087 * <tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001088 * <td align="center">CONVERGED</td>
1089 * <td align="center">Camera device finished AE scan</td>
1090 * <td align="center">FLASH_REQUIRED</td>
1091 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
1092 * </tr>
1093 * <tr>
1094 * <td align="center">FLASH_REQUIRED</td>
1095 * <td align="center">Camera device finished AE scan</td>
1096 * <td align="center">CONVERGED</td>
1097 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
1098 * </tr>
1099 * </tbody>
1100 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001101 * <p><b>Possible values:</b>
1102 * <ul>
1103 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
1104 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
1105 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
1106 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
1107 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
1108 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
1109 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001110 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1111 * <p><b>Limited capability</b> -
1112 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1113 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001114 *
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001115 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He228f4f92014-01-16 17:22:05 -08001116 * @see CaptureRequest#CONTROL_AE_LOCK
1117 * @see CaptureRequest#CONTROL_AE_MODE
1118 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Chien-Yu Chenc9ca7222018-03-15 11:14:29 -07001119 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He228f4f92014-01-16 17:22:05 -08001120 * @see CaptureRequest#CONTROL_MODE
1121 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001122 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001123 * @see #CONTROL_AE_STATE_INACTIVE
1124 * @see #CONTROL_AE_STATE_SEARCHING
1125 * @see #CONTROL_AE_STATE_CONVERGED
1126 * @see #CONTROL_AE_STATE_LOCKED
1127 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
1128 * @see #CONTROL_AE_STATE_PRECAPTURE
1129 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001130 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001131 public static final Key<Integer> CONTROL_AE_STATE =
1132 new Key<Integer>("android.control.aeState", int.class);
1133
1134 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001135 * <p>Whether auto-focus (AF) is currently enabled, and what
1136 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001137 * <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 -08001138 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1139 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1140 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1141 * 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 -08001142 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001143 * 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 -07001144 * in result metadata.</p>
1145 * <p><b>Possible values:</b>
1146 * <ul>
1147 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1148 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1149 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1150 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1151 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1152 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1153 * </ul></p>
1154 * <p><b>Available values for this device:</b><br>
1155 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1156 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001157 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001158 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001159 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001160 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001161 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001162 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001163 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001164 * @see #CONTROL_AF_MODE_OFF
1165 * @see #CONTROL_AF_MODE_AUTO
1166 * @see #CONTROL_AF_MODE_MACRO
1167 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1168 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1169 * @see #CONTROL_AF_MODE_EDOF
1170 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001171 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001172 public static final Key<Integer> CONTROL_AF_MODE =
1173 new Key<Integer>("android.control.afMode", int.class);
1174
1175 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001176 * <p>List of metering areas to use for auto-focus.</p>
1177 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001178 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001179 * <p>The maximum number of focus areas supported by the device is determined by the value
1180 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001181 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1182 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
1183 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001184 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001185 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1186 * active pixel array.</p>
1187 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1188 * system depends on the mode being set.
1189 * When the distortion correction mode is OFF, the coordinate system follows
1190 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
1191 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
1192 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
1193 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
1194 * pixel in the pre-correction active pixel array.
1195 * When the distortion correction mode is not OFF, the coordinate system follows
1196 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
1197 * <code>(0, 0)</code> being the top-left pixel of the active array, and
1198 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1199 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1200 * active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001201 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001202 * for every pixel in the area. This means that a large metering area
1203 * with the same weight as a smaller area will have more effect in
1204 * the metering result. Metering areas can partially overlap and the
1205 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001206 * <p>The weights are relative to weights of other metering regions, so if only one region
1207 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1208 * ignored.</p>
1209 * <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 -08001210 * camera device. The capture result will either be a zero weight region as well, or
1211 * the region selected by the camera device as the focus area of interest.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001212 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1213 * capture result metadata, the camera device will ignore the sections outside the crop
1214 * region and output only the intersection rectangle as the metering region in the result
1215 * metadata. If the region is entirely outside the crop region, it will be ignored and
1216 * not reported in the result metadata.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001217 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
1218 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
1219 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001220 * <p><b>Range of valid values:</b><br>
1221 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001222 * {@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}
1223 * depending on distortion correction capability and mode</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001224 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001225 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001226 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001227 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001228 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001229 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001230 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001231 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001232 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001233 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1234 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001235
1236 /**
Zhijun He379af012014-05-06 11:54:54 -07001237 * <p>Whether the camera device will trigger autofocus for this request.</p>
1238 * <p>This entry is normally set to IDLE, or is not
1239 * included at all in the request settings.</p>
1240 * <p>When included and set to START, the camera device will trigger the
1241 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1242 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1243 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001244 * <p>Generally, applications should set this entry to START or CANCEL for only a
1245 * single capture, and then return it to IDLE (or not set at all). Specifying
1246 * START for multiple captures in a row means restarting the AF operation over
1247 * and over again.</p>
1248 * <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 -07001249 * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
1250 * simultaneously is allowed. However, since these triggers often require cooperation between
1251 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1252 * focus sweep), the camera device may delay acting on a later trigger until the previous
1253 * trigger has been fully handled. This may lead to longer intervals between the trigger and
1254 * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001255 * <p><b>Possible values:</b>
1256 * <ul>
1257 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1258 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1259 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1260 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001261 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001262 *
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001263 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Zhijun He379af012014-05-06 11:54:54 -07001264 * @see CaptureResult#CONTROL_AF_STATE
1265 * @see #CONTROL_AF_TRIGGER_IDLE
1266 * @see #CONTROL_AF_TRIGGER_START
1267 * @see #CONTROL_AF_TRIGGER_CANCEL
1268 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001269 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001270 public static final Key<Integer> CONTROL_AF_TRIGGER =
1271 new Key<Integer>("android.control.afTrigger", int.class);
1272
1273 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001274 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001275 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1276 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1277 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1278 * the algorithm states to INACTIVE.</p>
1279 * <p>The camera device can do several state transitions between two results, if it is
1280 * allowed by the state transition table. For example: INACTIVE may never actually be
1281 * seen in a result.</p>
1282 * <p>The state in the result is the state for this image (in sync with this image): if
1283 * AF state becomes FOCUSED, then the image data associated with this result should
1284 * be sharp.</p>
1285 * <p>Below are state transition tables for different AF modes.</p>
1286 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1287 * <table>
1288 * <thead>
1289 * <tr>
1290 * <th align="center">State</th>
1291 * <th align="center">Transition Cause</th>
1292 * <th align="center">New State</th>
1293 * <th align="center">Notes</th>
1294 * </tr>
1295 * </thead>
1296 * <tbody>
1297 * <tr>
1298 * <td align="center">INACTIVE</td>
1299 * <td align="center"></td>
1300 * <td align="center">INACTIVE</td>
1301 * <td align="center">Never changes</td>
1302 * </tr>
1303 * </tbody>
1304 * </table>
1305 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1306 * <table>
1307 * <thead>
1308 * <tr>
1309 * <th align="center">State</th>
1310 * <th align="center">Transition Cause</th>
1311 * <th align="center">New State</th>
1312 * <th align="center">Notes</th>
1313 * </tr>
1314 * </thead>
1315 * <tbody>
1316 * <tr>
1317 * <td align="center">INACTIVE</td>
1318 * <td align="center">AF_TRIGGER</td>
1319 * <td align="center">ACTIVE_SCAN</td>
1320 * <td align="center">Start AF sweep, Lens now moving</td>
1321 * </tr>
1322 * <tr>
1323 * <td align="center">ACTIVE_SCAN</td>
1324 * <td align="center">AF sweep done</td>
1325 * <td align="center">FOCUSED_LOCKED</td>
1326 * <td align="center">Focused, Lens now locked</td>
1327 * </tr>
1328 * <tr>
1329 * <td align="center">ACTIVE_SCAN</td>
1330 * <td align="center">AF sweep done</td>
1331 * <td align="center">NOT_FOCUSED_LOCKED</td>
1332 * <td align="center">Not focused, Lens now locked</td>
1333 * </tr>
1334 * <tr>
1335 * <td align="center">ACTIVE_SCAN</td>
1336 * <td align="center">AF_CANCEL</td>
1337 * <td align="center">INACTIVE</td>
1338 * <td align="center">Cancel/reset AF, Lens now locked</td>
1339 * </tr>
1340 * <tr>
1341 * <td align="center">FOCUSED_LOCKED</td>
1342 * <td align="center">AF_CANCEL</td>
1343 * <td align="center">INACTIVE</td>
1344 * <td align="center">Cancel/reset AF</td>
1345 * </tr>
1346 * <tr>
1347 * <td align="center">FOCUSED_LOCKED</td>
1348 * <td align="center">AF_TRIGGER</td>
1349 * <td align="center">ACTIVE_SCAN</td>
1350 * <td align="center">Start new sweep, Lens now moving</td>
1351 * </tr>
1352 * <tr>
1353 * <td align="center">NOT_FOCUSED_LOCKED</td>
1354 * <td align="center">AF_CANCEL</td>
1355 * <td align="center">INACTIVE</td>
1356 * <td align="center">Cancel/reset AF</td>
1357 * </tr>
1358 * <tr>
1359 * <td align="center">NOT_FOCUSED_LOCKED</td>
1360 * <td align="center">AF_TRIGGER</td>
1361 * <td align="center">ACTIVE_SCAN</td>
1362 * <td align="center">Start new sweep, Lens now moving</td>
1363 * </tr>
1364 * <tr>
1365 * <td align="center">Any state</td>
1366 * <td align="center">Mode change</td>
1367 * <td align="center">INACTIVE</td>
1368 * <td align="center"></td>
1369 * </tr>
1370 * </tbody>
1371 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001372 * <p>For the above table, the camera device may skip reporting any state changes that happen
1373 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1374 * can be skipped in that manner is called a transient state.</p>
1375 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1376 * state transitions listed in above table, it is also legal for the camera device to skip
1377 * one or more transient states between two results. See below table for examples:</p>
1378 * <table>
1379 * <thead>
1380 * <tr>
1381 * <th align="center">State</th>
1382 * <th align="center">Transition Cause</th>
1383 * <th align="center">New State</th>
1384 * <th align="center">Notes</th>
1385 * </tr>
1386 * </thead>
1387 * <tbody>
1388 * <tr>
1389 * <td align="center">INACTIVE</td>
1390 * <td align="center">AF_TRIGGER</td>
1391 * <td align="center">FOCUSED_LOCKED</td>
1392 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1393 * </tr>
1394 * <tr>
1395 * <td align="center">INACTIVE</td>
1396 * <td align="center">AF_TRIGGER</td>
1397 * <td align="center">NOT_FOCUSED_LOCKED</td>
1398 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1399 * </tr>
1400 * <tr>
1401 * <td align="center">FOCUSED_LOCKED</td>
1402 * <td align="center">AF_TRIGGER</td>
1403 * <td align="center">FOCUSED_LOCKED</td>
1404 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1405 * </tr>
1406 * <tr>
1407 * <td align="center">NOT_FOCUSED_LOCKED</td>
1408 * <td align="center">AF_TRIGGER</td>
1409 * <td align="center">FOCUSED_LOCKED</td>
1410 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1411 * </tr>
1412 * </tbody>
1413 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001414 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1415 * <table>
1416 * <thead>
1417 * <tr>
1418 * <th align="center">State</th>
1419 * <th align="center">Transition Cause</th>
1420 * <th align="center">New State</th>
1421 * <th align="center">Notes</th>
1422 * </tr>
1423 * </thead>
1424 * <tbody>
1425 * <tr>
1426 * <td align="center">INACTIVE</td>
1427 * <td align="center">Camera device initiates new scan</td>
1428 * <td align="center">PASSIVE_SCAN</td>
1429 * <td align="center">Start AF scan, Lens now moving</td>
1430 * </tr>
1431 * <tr>
1432 * <td align="center">INACTIVE</td>
1433 * <td align="center">AF_TRIGGER</td>
1434 * <td align="center">NOT_FOCUSED_LOCKED</td>
1435 * <td align="center">AF state query, Lens now locked</td>
1436 * </tr>
1437 * <tr>
1438 * <td align="center">PASSIVE_SCAN</td>
1439 * <td align="center">Camera device completes current scan</td>
1440 * <td align="center">PASSIVE_FOCUSED</td>
1441 * <td align="center">End AF scan, Lens now locked</td>
1442 * </tr>
1443 * <tr>
1444 * <td align="center">PASSIVE_SCAN</td>
1445 * <td align="center">Camera device fails current scan</td>
1446 * <td align="center">PASSIVE_UNFOCUSED</td>
1447 * <td align="center">End AF scan, Lens now locked</td>
1448 * </tr>
1449 * <tr>
1450 * <td align="center">PASSIVE_SCAN</td>
1451 * <td align="center">AF_TRIGGER</td>
1452 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001453 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001454 * </tr>
1455 * <tr>
1456 * <td align="center">PASSIVE_SCAN</td>
1457 * <td align="center">AF_TRIGGER</td>
1458 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001459 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001460 * </tr>
1461 * <tr>
1462 * <td align="center">PASSIVE_SCAN</td>
1463 * <td align="center">AF_CANCEL</td>
1464 * <td align="center">INACTIVE</td>
1465 * <td align="center">Reset lens position, Lens now locked</td>
1466 * </tr>
1467 * <tr>
1468 * <td align="center">PASSIVE_FOCUSED</td>
1469 * <td align="center">Camera device initiates new scan</td>
1470 * <td align="center">PASSIVE_SCAN</td>
1471 * <td align="center">Start AF scan, Lens now moving</td>
1472 * </tr>
1473 * <tr>
1474 * <td align="center">PASSIVE_UNFOCUSED</td>
1475 * <td align="center">Camera device initiates new scan</td>
1476 * <td align="center">PASSIVE_SCAN</td>
1477 * <td align="center">Start AF scan, Lens now moving</td>
1478 * </tr>
1479 * <tr>
1480 * <td align="center">PASSIVE_FOCUSED</td>
1481 * <td align="center">AF_TRIGGER</td>
1482 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001483 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001484 * </tr>
1485 * <tr>
1486 * <td align="center">PASSIVE_UNFOCUSED</td>
1487 * <td align="center">AF_TRIGGER</td>
1488 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001489 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001490 * </tr>
1491 * <tr>
1492 * <td align="center">FOCUSED_LOCKED</td>
1493 * <td align="center">AF_TRIGGER</td>
1494 * <td align="center">FOCUSED_LOCKED</td>
1495 * <td align="center">No effect</td>
1496 * </tr>
1497 * <tr>
1498 * <td align="center">FOCUSED_LOCKED</td>
1499 * <td align="center">AF_CANCEL</td>
1500 * <td align="center">INACTIVE</td>
1501 * <td align="center">Restart AF scan</td>
1502 * </tr>
1503 * <tr>
1504 * <td align="center">NOT_FOCUSED_LOCKED</td>
1505 * <td align="center">AF_TRIGGER</td>
1506 * <td align="center">NOT_FOCUSED_LOCKED</td>
1507 * <td align="center">No effect</td>
1508 * </tr>
1509 * <tr>
1510 * <td align="center">NOT_FOCUSED_LOCKED</td>
1511 * <td align="center">AF_CANCEL</td>
1512 * <td align="center">INACTIVE</td>
1513 * <td align="center">Restart AF scan</td>
1514 * </tr>
1515 * </tbody>
1516 * </table>
1517 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1518 * <table>
1519 * <thead>
1520 * <tr>
1521 * <th align="center">State</th>
1522 * <th align="center">Transition Cause</th>
1523 * <th align="center">New State</th>
1524 * <th align="center">Notes</th>
1525 * </tr>
1526 * </thead>
1527 * <tbody>
1528 * <tr>
1529 * <td align="center">INACTIVE</td>
1530 * <td align="center">Camera device initiates new scan</td>
1531 * <td align="center">PASSIVE_SCAN</td>
1532 * <td align="center">Start AF scan, Lens now moving</td>
1533 * </tr>
1534 * <tr>
1535 * <td align="center">INACTIVE</td>
1536 * <td align="center">AF_TRIGGER</td>
1537 * <td align="center">NOT_FOCUSED_LOCKED</td>
1538 * <td align="center">AF state query, Lens now locked</td>
1539 * </tr>
1540 * <tr>
1541 * <td align="center">PASSIVE_SCAN</td>
1542 * <td align="center">Camera device completes current scan</td>
1543 * <td align="center">PASSIVE_FOCUSED</td>
1544 * <td align="center">End AF scan, Lens now locked</td>
1545 * </tr>
1546 * <tr>
1547 * <td align="center">PASSIVE_SCAN</td>
1548 * <td align="center">Camera device fails current scan</td>
1549 * <td align="center">PASSIVE_UNFOCUSED</td>
1550 * <td align="center">End AF scan, Lens now locked</td>
1551 * </tr>
1552 * <tr>
1553 * <td align="center">PASSIVE_SCAN</td>
1554 * <td align="center">AF_TRIGGER</td>
1555 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001556 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001557 * </tr>
1558 * <tr>
1559 * <td align="center">PASSIVE_SCAN</td>
1560 * <td align="center">AF_TRIGGER</td>
1561 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001562 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001563 * </tr>
1564 * <tr>
1565 * <td align="center">PASSIVE_SCAN</td>
1566 * <td align="center">AF_CANCEL</td>
1567 * <td align="center">INACTIVE</td>
1568 * <td align="center">Reset lens position, Lens now locked</td>
1569 * </tr>
1570 * <tr>
1571 * <td align="center">PASSIVE_FOCUSED</td>
1572 * <td align="center">Camera device initiates new scan</td>
1573 * <td align="center">PASSIVE_SCAN</td>
1574 * <td align="center">Start AF scan, Lens now moving</td>
1575 * </tr>
1576 * <tr>
1577 * <td align="center">PASSIVE_UNFOCUSED</td>
1578 * <td align="center">Camera device initiates new scan</td>
1579 * <td align="center">PASSIVE_SCAN</td>
1580 * <td align="center">Start AF scan, Lens now moving</td>
1581 * </tr>
1582 * <tr>
1583 * <td align="center">PASSIVE_FOCUSED</td>
1584 * <td align="center">AF_TRIGGER</td>
1585 * <td align="center">FOCUSED_LOCKED</td>
1586 * <td align="center">Immediate trans. Lens now locked</td>
1587 * </tr>
1588 * <tr>
1589 * <td align="center">PASSIVE_UNFOCUSED</td>
1590 * <td align="center">AF_TRIGGER</td>
1591 * <td align="center">NOT_FOCUSED_LOCKED</td>
1592 * <td align="center">Immediate trans. Lens now locked</td>
1593 * </tr>
1594 * <tr>
1595 * <td align="center">FOCUSED_LOCKED</td>
1596 * <td align="center">AF_TRIGGER</td>
1597 * <td align="center">FOCUSED_LOCKED</td>
1598 * <td align="center">No effect</td>
1599 * </tr>
1600 * <tr>
1601 * <td align="center">FOCUSED_LOCKED</td>
1602 * <td align="center">AF_CANCEL</td>
1603 * <td align="center">INACTIVE</td>
1604 * <td align="center">Restart AF scan</td>
1605 * </tr>
1606 * <tr>
1607 * <td align="center">NOT_FOCUSED_LOCKED</td>
1608 * <td align="center">AF_TRIGGER</td>
1609 * <td align="center">NOT_FOCUSED_LOCKED</td>
1610 * <td align="center">No effect</td>
1611 * </tr>
1612 * <tr>
1613 * <td align="center">NOT_FOCUSED_LOCKED</td>
1614 * <td align="center">AF_CANCEL</td>
1615 * <td align="center">INACTIVE</td>
1616 * <td align="center">Restart AF scan</td>
1617 * </tr>
1618 * </tbody>
1619 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001620 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1621 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1622 * camera device. When a trigger is included in a mode switch request, the trigger
1623 * will be evaluated in the context of the new mode in the request.
1624 * See below table for examples:</p>
1625 * <table>
1626 * <thead>
1627 * <tr>
1628 * <th align="center">State</th>
1629 * <th align="center">Transition Cause</th>
1630 * <th align="center">New State</th>
1631 * <th align="center">Notes</th>
1632 * </tr>
1633 * </thead>
1634 * <tbody>
1635 * <tr>
1636 * <td align="center">any state</td>
1637 * <td align="center">CAF--&gt;AUTO mode switch</td>
1638 * <td align="center">INACTIVE</td>
1639 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1640 * </tr>
1641 * <tr>
1642 * <td align="center">any state</td>
1643 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1644 * <td align="center">trigger-reachable states from INACTIVE</td>
1645 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1646 * </tr>
1647 * <tr>
1648 * <td align="center">any state</td>
1649 * <td align="center">AUTO--&gt;CAF mode switch</td>
1650 * <td align="center">passively reachable states from INACTIVE</td>
1651 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1652 * </tr>
1653 * </tbody>
1654 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001655 * <p><b>Possible values:</b>
1656 * <ul>
1657 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1658 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1659 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1660 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1661 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1662 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1663 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1664 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001665 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001666 *
1667 * @see CaptureRequest#CONTROL_AF_MODE
1668 * @see CaptureRequest#CONTROL_MODE
1669 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001670 * @see #CONTROL_AF_STATE_INACTIVE
1671 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1672 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1673 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1674 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1675 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001676 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001677 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001678 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001679 public static final Key<Integer> CONTROL_AF_STATE =
1680 new Key<Integer>("android.control.afState", int.class);
1681
1682 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001683 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001684 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001685 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1686 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1687 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1688 * get locked do not necessarily correspond to the settings that were present in the
1689 * latest capture result received from the camera device, since additional captures
1690 * and AWB updates may have occurred even before the result was sent out. If an
1691 * application is switching between automatic and manual control and wishes to eliminate
1692 * any flicker during the switch, the following procedure is recommended:</p>
1693 * <ol>
1694 * <li>Starting in auto-AWB mode:</li>
1695 * <li>Lock AWB</li>
1696 * <li>Wait for the first result to be output that has the AWB locked</li>
1697 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1698 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1699 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001700 * <p>Note that AWB lock is only meaningful when
1701 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1702 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001703 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1704 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001705 *
1706 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001707 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001708 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001709 public static final Key<Boolean> CONTROL_AWB_LOCK =
1710 new Key<Boolean>("android.control.awbLock", boolean.class);
1711
1712 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001713 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001714 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001715 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001716 * <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 -07001717 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001718 * routine is enabled, overriding the application's selected
1719 * {@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 -08001720 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1721 * is OFF, the behavior of AWB is device dependent. It is recommened to
1722 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1723 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001724 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001725 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001726 * 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 -08001727 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001728 * <p>When set to any other modes, the camera device's auto-white
1729 * balance routine is disabled. The camera device uses each
1730 * particular illumination target for white balance
1731 * adjustment. The application's values for
1732 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1733 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1734 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001735 * <p><b>Possible values:</b>
1736 * <ul>
1737 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1738 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1739 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1740 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1741 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1742 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1743 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1744 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1745 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1746 * </ul></p>
1747 * <p><b>Available values for this device:</b><br>
1748 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001749 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001750 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001751 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001752 * @see CaptureRequest#COLOR_CORRECTION_MODE
1753 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001754 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001755 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001756 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001757 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001758 * @see #CONTROL_AWB_MODE_OFF
1759 * @see #CONTROL_AWB_MODE_AUTO
1760 * @see #CONTROL_AWB_MODE_INCANDESCENT
1761 * @see #CONTROL_AWB_MODE_FLUORESCENT
1762 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1763 * @see #CONTROL_AWB_MODE_DAYLIGHT
1764 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1765 * @see #CONTROL_AWB_MODE_TWILIGHT
1766 * @see #CONTROL_AWB_MODE_SHADE
1767 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001768 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001769 public static final Key<Integer> CONTROL_AWB_MODE =
1770 new Key<Integer>("android.control.awbMode", int.class);
1771
1772 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001773 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001774 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001775 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001776 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001777 * <p>The maximum number of regions supported by the device is determined by the value
1778 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001779 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1780 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
1781 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001782 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001783 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1784 * active pixel array.</p>
1785 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1786 * system depends on the mode being set.
1787 * When the distortion correction mode is OFF, the coordinate system follows
1788 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
1789 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
1790 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
1791 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
1792 * pixel in the pre-correction active pixel array.
1793 * When the distortion correction mode is not OFF, the coordinate system follows
1794 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
1795 * <code>(0, 0)</code> being the top-left pixel of the active array, and
1796 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1797 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1798 * active pixel array.</p>
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001799 * <p>The weight must range from 0 to 1000, and represents a weight
1800 * for every pixel in the area. This means that a large metering area
1801 * with the same weight as a smaller area will have more effect in
1802 * the metering result. Metering areas can partially overlap and the
1803 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001804 * <p>The weights are relative to weights of other white balance metering regions, so if
1805 * only one region is used, all non-zero weights will have the same effect. A region with
1806 * 0 weight is ignored.</p>
1807 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1808 * camera device.</p>
1809 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1810 * capture result metadata, the camera device will ignore the sections outside the crop
1811 * region and output only the intersection rectangle as the metering region in the result
1812 * metadata. If the region is entirely outside the crop region, it will be ignored and
1813 * not reported in the result metadata.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001814 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
1815 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
1816 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001817 * <p><b>Range of valid values:</b><br>
1818 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001819 * {@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}
1820 * depending on distortion correction capability and mode</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001821 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001822 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001823 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001824 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001825 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001826 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001827 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001828 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001829 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001830 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1831 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001832
1833 /**
Zhijun He379af012014-05-06 11:54:54 -07001834 * <p>Information to the camera device 3A (auto-exposure,
1835 * auto-focus, auto-white balance) routines about the purpose
1836 * of this capture, to help the camera device to decide optimal 3A
1837 * strategy.</p>
1838 * <p>This control (except for MANUAL) is only effective if
1839 * <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 -08001840 * <p>All intents are supported by all devices, except that:
1841 * * ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1842 * PRIVATE_REPROCESSING or YUV_REPROCESSING.
1843 * * MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1844 * MANUAL_SENSOR.
1845 * * MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1846 * MOTION_TRACKING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001847 * <p><b>Possible values:</b>
1848 * <ul>
1849 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1850 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1851 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1852 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1853 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1854 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1855 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001856 * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001857 * </ul></p>
1858 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001859 *
1860 * @see CaptureRequest#CONTROL_MODE
1861 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1862 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1863 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1864 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1865 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1866 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1867 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1868 * @see #CONTROL_CAPTURE_INTENT_MANUAL
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001869 * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING
Zhijun He379af012014-05-06 11:54:54 -07001870 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001871 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001872 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1873 new Key<Integer>("android.control.captureIntent", int.class);
1874
1875 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001876 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001877 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1878 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1879 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1880 * the algorithm states to INACTIVE.</p>
1881 * <p>The camera device can do several state transitions between two results, if it is
1882 * allowed by the state transition table. So INACTIVE may never actually be seen in
1883 * a result.</p>
1884 * <p>The state in the result is the state for this image (in sync with this image): if
1885 * AWB state becomes CONVERGED, then the image data associated with this result should
1886 * be good to use.</p>
1887 * <p>Below are state transition tables for different AWB modes.</p>
1888 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1889 * <table>
1890 * <thead>
1891 * <tr>
1892 * <th align="center">State</th>
1893 * <th align="center">Transition Cause</th>
1894 * <th align="center">New State</th>
1895 * <th align="center">Notes</th>
1896 * </tr>
1897 * </thead>
1898 * <tbody>
1899 * <tr>
1900 * <td align="center">INACTIVE</td>
1901 * <td align="center"></td>
1902 * <td align="center">INACTIVE</td>
1903 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1904 * </tr>
1905 * </tbody>
1906 * </table>
1907 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1908 * <table>
1909 * <thead>
1910 * <tr>
1911 * <th align="center">State</th>
1912 * <th align="center">Transition Cause</th>
1913 * <th align="center">New State</th>
1914 * <th align="center">Notes</th>
1915 * </tr>
1916 * </thead>
1917 * <tbody>
1918 * <tr>
1919 * <td align="center">INACTIVE</td>
1920 * <td align="center">Camera device initiates AWB scan</td>
1921 * <td align="center">SEARCHING</td>
1922 * <td align="center">Values changing</td>
1923 * </tr>
1924 * <tr>
1925 * <td align="center">INACTIVE</td>
1926 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1927 * <td align="center">LOCKED</td>
1928 * <td align="center">Values locked</td>
1929 * </tr>
1930 * <tr>
1931 * <td align="center">SEARCHING</td>
1932 * <td align="center">Camera device finishes AWB scan</td>
1933 * <td align="center">CONVERGED</td>
1934 * <td align="center">Good values, not changing</td>
1935 * </tr>
1936 * <tr>
1937 * <td align="center">SEARCHING</td>
1938 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1939 * <td align="center">LOCKED</td>
1940 * <td align="center">Values locked</td>
1941 * </tr>
1942 * <tr>
1943 * <td align="center">CONVERGED</td>
1944 * <td align="center">Camera device initiates AWB scan</td>
1945 * <td align="center">SEARCHING</td>
1946 * <td align="center">Values changing</td>
1947 * </tr>
1948 * <tr>
1949 * <td align="center">CONVERGED</td>
1950 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1951 * <td align="center">LOCKED</td>
1952 * <td align="center">Values locked</td>
1953 * </tr>
1954 * <tr>
1955 * <td align="center">LOCKED</td>
1956 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1957 * <td align="center">SEARCHING</td>
1958 * <td align="center">Values not good after unlock</td>
1959 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001960 * </tbody>
1961 * </table>
1962 * <p>For the above table, the camera device may skip reporting any state changes that happen
1963 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1964 * can be skipped in that manner is called a transient state.</p>
1965 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1966 * listed in above table, it is also legal for the camera device to skip one or more
1967 * transient states between two results. See below table for examples:</p>
1968 * <table>
1969 * <thead>
1970 * <tr>
1971 * <th align="center">State</th>
1972 * <th align="center">Transition Cause</th>
1973 * <th align="center">New State</th>
1974 * <th align="center">Notes</th>
1975 * </tr>
1976 * </thead>
1977 * <tbody>
1978 * <tr>
1979 * <td align="center">INACTIVE</td>
1980 * <td align="center">Camera device finished AWB scan</td>
1981 * <td align="center">CONVERGED</td>
1982 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1983 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001984 * <tr>
1985 * <td align="center">LOCKED</td>
1986 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1987 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001988 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001989 * </tr>
1990 * </tbody>
1991 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001992 * <p><b>Possible values:</b>
1993 * <ul>
1994 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1995 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1996 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1997 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1998 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001999 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2000 * <p><b>Limited capability</b> -
2001 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2002 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08002003 *
2004 * @see CaptureRequest#CONTROL_AWB_LOCK
2005 * @see CaptureRequest#CONTROL_AWB_MODE
2006 * @see CaptureRequest#CONTROL_MODE
2007 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002008 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002009 * @see #CONTROL_AWB_STATE_INACTIVE
2010 * @see #CONTROL_AWB_STATE_SEARCHING
2011 * @see #CONTROL_AWB_STATE_CONVERGED
2012 * @see #CONTROL_AWB_STATE_LOCKED
2013 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002014 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002015 public static final Key<Integer> CONTROL_AWB_STATE =
2016 new Key<Integer>("android.control.awbState", int.class);
2017
2018 /**
Zhijun He379af012014-05-06 11:54:54 -07002019 * <p>A special color effect to apply.</p>
2020 * <p>When this mode is set, a color effect will be applied
2021 * to images produced by the camera device. The interpretation
2022 * and implementation of these color effects is left to the
2023 * implementor of the camera device, and should not be
2024 * depended on to be consistent (or present) across all
2025 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002026 * <p><b>Possible values:</b>
2027 * <ul>
2028 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
2029 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
2030 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
2031 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
2032 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
2033 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
2034 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
2035 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
2036 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
2037 * </ul></p>
2038 * <p><b>Available values for this device:</b><br>
2039 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002040 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002041 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002042 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07002043 * @see #CONTROL_EFFECT_MODE_OFF
2044 * @see #CONTROL_EFFECT_MODE_MONO
2045 * @see #CONTROL_EFFECT_MODE_NEGATIVE
2046 * @see #CONTROL_EFFECT_MODE_SOLARIZE
2047 * @see #CONTROL_EFFECT_MODE_SEPIA
2048 * @see #CONTROL_EFFECT_MODE_POSTERIZE
2049 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
2050 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
2051 * @see #CONTROL_EFFECT_MODE_AQUA
2052 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002053 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002054 public static final Key<Integer> CONTROL_EFFECT_MODE =
2055 new Key<Integer>("android.control.effectMode", int.class);
2056
2057 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002058 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08002059 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002060 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08002061 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08002062 * capture parameters itself.</p>
2063 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002064 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08002065 * <p>When set to USE_SCENE_MODE, the individual controls in
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002066 * android.control.* are mostly disabled, and the camera device
2067 * implements one of the scene mode settings (such as ACTION,
2068 * SUNSET, or PARTY) as it wishes. The camera device scene mode
2069 * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08002070 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
2071 * is that this frame will not be used by camera device background 3A statistics
2072 * update, as if this frame is never captured. This mode can be used in the scenario
2073 * where the application doesn't want a 3A manual control capture to affect
2074 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002075 * <p><b>Possible values:</b>
2076 * <ul>
2077 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
2078 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
2079 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
2080 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
2081 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002082 * <p><b>Available values for this device:</b><br>
2083 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002084 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002085 *
2086 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002087 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002088 * @see #CONTROL_MODE_OFF
2089 * @see #CONTROL_MODE_AUTO
2090 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08002091 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002092 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002093 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002094 public static final Key<Integer> CONTROL_MODE =
2095 new Key<Integer>("android.control.mode", int.class);
2096
2097 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002098 * <p>Control for which scene mode is currently active.</p>
2099 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
2100 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07002101 * <p>This is the mode that that is active when
Zhijun Heee2ebde2015-06-16 19:58:11 -07002102 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
2103 * 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}
2104 * while in use.</p>
Zhijun He379af012014-05-06 11:54:54 -07002105 * <p>The interpretation and implementation of these scene modes is left
2106 * to the implementor of the camera device. Their behavior will not be
2107 * consistent across all devices, and any given device may only implement
2108 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002109 * <p><b>Possible values:</b>
2110 * <ul>
2111 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
2112 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
2113 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
2114 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
2115 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
2116 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
2117 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
2118 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
2119 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
2120 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
2121 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
2122 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
2123 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
2124 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
2125 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
2126 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
2127 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
2128 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002129 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002130 * </ul></p>
2131 * <p><b>Available values for this device:</b><br>
2132 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002133 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002134 *
2135 * @see CaptureRequest#CONTROL_AE_MODE
2136 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002137 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07002138 * @see CaptureRequest#CONTROL_AWB_MODE
2139 * @see CaptureRequest#CONTROL_MODE
2140 * @see #CONTROL_SCENE_MODE_DISABLED
2141 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
2142 * @see #CONTROL_SCENE_MODE_ACTION
2143 * @see #CONTROL_SCENE_MODE_PORTRAIT
2144 * @see #CONTROL_SCENE_MODE_LANDSCAPE
2145 * @see #CONTROL_SCENE_MODE_NIGHT
2146 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
2147 * @see #CONTROL_SCENE_MODE_THEATRE
2148 * @see #CONTROL_SCENE_MODE_BEACH
2149 * @see #CONTROL_SCENE_MODE_SNOW
2150 * @see #CONTROL_SCENE_MODE_SUNSET
2151 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
2152 * @see #CONTROL_SCENE_MODE_FIREWORKS
2153 * @see #CONTROL_SCENE_MODE_SPORTS
2154 * @see #CONTROL_SCENE_MODE_PARTY
2155 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
2156 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07002157 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002158 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07002159 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002160 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002161 public static final Key<Integer> CONTROL_SCENE_MODE =
2162 new Key<Integer>("android.control.sceneMode", int.class);
2163
2164 /**
2165 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002166 * active.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002167 * <p>Video stabilization automatically warps images from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002168 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07002169 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07002170 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002171 * <p>Switching between different video stabilization modes may take several
2172 * frames to initialize, the camera device will report the current mode
2173 * in capture result metadata. For example, When "ON" mode is requested,
2174 * the video stabilization modes in the first several capture results may
2175 * still be "OFF", and it will become "ON" when the initialization is
2176 * done.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002177 * <p>In addition, not all recording sizes or frame rates may be supported for
2178 * stabilization by a device that reports stabilization support. It is guaranteed
2179 * that an output targeting a MediaRecorder or MediaCodec will be stabilized if
2180 * the recording resolution is less than or equal to 1920 x 1080 (width less than
2181 * or equal to 1920, height less than or equal to 1080), and the recording
2182 * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult
2183 * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return
2184 * OFF if the recording output is not stabilized, or if there are no output
2185 * Surface types that can be stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002186 * <p>If a camera device supports both this mode and OIS
2187 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
2188 * produce undesirable interaction, so it is recommended not to enable
2189 * both at the same time.</p>
2190 * <p><b>Possible values:</b>
2191 * <ul>
2192 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
2193 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
2194 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002195 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002196 *
Jianing Wei2813b0f2015-09-29 14:24:36 -07002197 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Zhijun He45fa43a12014-06-13 18:29:37 -07002198 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07002199 * @see CaptureRequest#SCALER_CROP_REGION
2200 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
2201 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
2202 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002203 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002204 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
2205 new Key<Integer>("android.control.videoStabilizationMode", int.class);
2206
2207 /**
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002208 * <p>The amount of additional sensitivity boost applied to output images
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002209 * after RAW sensor data is captured.</p>
2210 * <p>Some camera devices support additional digital sensitivity boosting in the
2211 * camera processing pipeline after sensor RAW image is captured.
2212 * Such a boost will be applied to YUV/JPEG format output images but will not
2213 * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p>
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002214 * <p>This key will be <code>null</code> for devices that do not support any RAW format
2215 * outputs. For devices that do support RAW format outputs, this key will always
2216 * present, and if a device does not support post RAW sensitivity boost, it will
2217 * list <code>100</code> in this key.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002218 * <p>If the camera device cannot apply the exact boost requested, it will reduce the
2219 * boost to the nearest supported value.
2220 * The final boost value used will be available in the output capture result.</p>
2221 * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images
2222 * of such device will have the total sensitivity of
Yin-Chia Yeh67e61b62016-01-26 13:27:35 -08002223 * <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 -08002224 * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p>
2225 * <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
2226 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2227 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
2228 * <p><b>Range of valid values:</b><br>
2229 * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p>
2230 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2231 *
2232 * @see CaptureRequest#CONTROL_AE_MODE
2233 * @see CaptureRequest#CONTROL_MODE
2234 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
2235 * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE
2236 * @see CaptureRequest#SENSOR_SENSITIVITY
2237 */
2238 @PublicKey
2239 public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST =
2240 new Key<Integer>("android.control.postRawSensitivityBoost", int.class);
2241
2242 /**
Chien-Yu Chene4491712017-01-11 11:14:06 -08002243 * <p>Allow camera device to enable zero-shutter-lag mode for requests with
2244 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p>
2245 * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with
2246 * STILL_CAPTURE capture intent. The camera device may use images captured in the past to
2247 * produce output images for a zero-shutter-lag request. The result metadata including the
2248 * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images.
2249 * Therefore, the contents of the output images and the result metadata may be out of order
2250 * compared to previous regular requests. enableZsl does not affect requests with other
2251 * capture intents.</p>
2252 * <p>For example, when requests are submitted in the following order:
2253 * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW
2254 * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p>
2255 * <p>The output images for request B may have contents captured before the output images for
2256 * request A, and the result metadata for request B may be older than the result metadata for
2257 * request A.</p>
Chien-Yu Chen1d72ee32017-04-18 15:23:06 -07002258 * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in
2259 * the past for requests with STILL_CAPTURE capture intent.</p>
2260 * <p>For applications targeting SDK versions O and newer, the value of enableZsl in
2261 * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always
2262 * <code>false</code> if present.</p>
2263 * <p>For applications targeting SDK versions older than O, the value of enableZsl in all
2264 * capture templates is always <code>false</code> if present.</p>
Chien-Yu Chen81026382017-05-03 12:30:58 -07002265 * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
Chien-Yu Chene4491712017-01-11 11:14:06 -08002266 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2267 *
2268 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
2269 * @see CaptureResult#SENSOR_TIMESTAMP
2270 */
2271 @PublicKey
2272 public static final Key<Boolean> CONTROL_ENABLE_ZSL =
2273 new Key<Boolean>("android.control.enableZsl", boolean.class);
2274
2275 /**
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002276 * <p>Whether a significant scene change is detected within the currently-set AF
2277 * region(s).</p>
2278 * <p>When the camera focus routine detects a change in the scene it is looking at,
2279 * such as a large shift in camera viewpoint, significant motion in the scene, or a
2280 * significant illumination change, this value will be set to DETECTED for a single capture
2281 * result. Otherwise the value will be NOT_DETECTED. The threshold for detection is similar
2282 * to what would trigger a new passive focus scan to begin in CONTINUOUS autofocus modes.</p>
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002283 * <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 -08002284 * <p><b>Possible values:</b>
2285 * <ul>
2286 * <li>{@link #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED NOT_DETECTED}</li>
2287 * <li>{@link #CONTROL_AF_SCENE_CHANGE_DETECTED DETECTED}</li>
2288 * </ul></p>
2289 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2290 * @see #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED
2291 * @see #CONTROL_AF_SCENE_CHANGE_DETECTED
2292 */
2293 @PublicKey
2294 public static final Key<Integer> CONTROL_AF_SCENE_CHANGE =
2295 new Key<Integer>("android.control.afSceneChange", int.class);
2296
2297 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002298 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08002299 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002300 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2301 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002302 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08002303 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08002304 * camera device will use the highest-quality enhancement algorithms,
2305 * even if it slows down capture rate. FAST means the camera device will
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002306 * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
2307 * edge enhancement will slow down capture rate. Every output stream will have a similar
2308 * amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002309 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2310 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2311 * into a final capture when triggered by the user. In this mode, the camera device applies
2312 * edge enhancement to low-resolution streams (below maximum recording resolution) to
2313 * maximize preview quality, but does not apply edge enhancement to high-resolution streams,
2314 * since those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002315 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2316 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002317 * The camera device may adjust its internal edge enhancement parameters for best
Zhijun He0e99c222015-01-29 15:26:05 -08002318 * 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 -07002319 * <p><b>Possible values:</b>
2320 * <ul>
2321 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2322 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2323 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002324 * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002325 * </ul></p>
2326 * <p><b>Available values for this device:</b><br>
2327 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002328 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2329 * <p><b>Full capability</b> -
2330 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2331 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002332 *
2333 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002334 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002335 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002336 * @see #EDGE_MODE_OFF
2337 * @see #EDGE_MODE_FAST
2338 * @see #EDGE_MODE_HIGH_QUALITY
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002339 * @see #EDGE_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002340 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002341 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002342 public static final Key<Integer> EDGE_MODE =
2343 new Key<Integer>("android.edge.mode", int.class);
2344
2345 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002346 * <p>The desired mode for for the camera device's flash control.</p>
2347 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002348 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002349 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2350 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2351 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2352 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2353 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2354 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002355 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002356 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2357 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2358 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002359 * <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 -07002360 * <p><b>Possible values:</b>
2361 * <ul>
2362 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2363 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2364 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2365 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002366 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002367 *
2368 * @see CaptureRequest#CONTROL_AE_MODE
2369 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2370 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002371 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002372 * @see #FLASH_MODE_OFF
2373 * @see #FLASH_MODE_SINGLE
2374 * @see #FLASH_MODE_TORCH
2375 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002376 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002377 public static final Key<Integer> FLASH_MODE =
2378 new Key<Integer>("android.flash.mode", int.class);
2379
2380 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002381 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002382 * unit.</p>
2383 * <p>When the camera device doesn't have flash unit
2384 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2385 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002386 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2387 * <ul>
2388 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2389 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002390 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002391 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002392 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002393 * </ul>
2394 * <p>In all other conditions the state will not be available on
2395 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002396 * <p><b>Possible values:</b>
2397 * <ul>
2398 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2399 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2400 * <li>{@link #FLASH_STATE_READY READY}</li>
2401 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2402 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2403 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002404 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2405 * <p><b>Limited capability</b> -
2406 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2407 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002408 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002409 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002410 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002411 * @see CaptureRequest#FLASH_MODE
2412 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002413 * @see #FLASH_STATE_UNAVAILABLE
2414 * @see #FLASH_STATE_CHARGING
2415 * @see #FLASH_STATE_READY
2416 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002417 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002418 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002419 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002420 public static final Key<Integer> FLASH_STATE =
2421 new Key<Integer>("android.flash.state", int.class);
2422
2423 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002424 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002425 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002426 * that do not accurately measure the incoming light (i.e. pixels that
2427 * are stuck at an arbitrary value or are oversensitive).</p>
2428 * <p><b>Possible values:</b>
2429 * <ul>
2430 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2431 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2432 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2433 * </ul></p>
2434 * <p><b>Available values for this device:</b><br>
2435 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002436 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002437 *
2438 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002439 * @see #HOT_PIXEL_MODE_OFF
2440 * @see #HOT_PIXEL_MODE_FAST
2441 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2442 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002443 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002444 public static final Key<Integer> HOT_PIXEL_MODE =
2445 new Key<Integer>("android.hotPixel.mode", int.class);
2446
2447 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002448 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002449 * <p>Setting a location object in a request will include the GPS coordinates of the location
2450 * into any JPEG images captured based on the request. These coordinates can then be
2451 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002452 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002453 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002454 @PublicKey
2455 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002456 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2457 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2458
2459 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002460 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002461 * EXIF.</p>
2462 * <p><b>Range of valid values:</b><br>
2463 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002464 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002465 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002466 */
2467 public static final Key<double[]> JPEG_GPS_COORDINATES =
2468 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2469
2470 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002471 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002472 * include in EXIF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002473 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002474 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002475 */
2476 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2477 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2478
2479 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002480 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002481 * EXIF.</p>
2482 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002483 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002484 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002485 */
2486 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2487 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2488
2489 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002490 * <p>The orientation for a JPEG image.</p>
2491 * <p>The clockwise rotation angle in degrees, relative to the orientation
2492 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2493 * upright.</p>
2494 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07002495 * rotate the image data to match this orientation. When the image data is rotated,
2496 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002497 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2498 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
Emilian Peev3abc7512018-03-28 11:22:26 +01002499 * <p>To translate from the device orientation given by the Android sensor APIs for camera
2500 * sensors which are not EXTERNAL, the following sample code may be used:</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002501 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2502 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2503 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2504 *
2505 * // Round device orientation to a multiple of 90
2506 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2507 *
2508 * // Reverse device orientation for front-facing cameras
2509 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2510 * if (facingFront) deviceOrientation = -deviceOrientation;
2511 *
2512 * // Calculate desired JPEG orientation relative to camera orientation to make
2513 * // the image upright relative to the device orientation
2514 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2515 *
2516 * return jpegOrientation;
2517 * }
2518 * </code></pre>
Emilian Peev3abc7512018-03-28 11:22:26 +01002519 * <p>For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will
2520 * also be set to EXTERNAL. The above code is not relevant in such case.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002521 * <p><b>Units</b>: Degrees in multiples of 90</p>
2522 * <p><b>Range of valid values:</b><br>
2523 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002524 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002525 *
2526 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002527 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002528 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002529 public static final Key<Integer> JPEG_ORIENTATION =
2530 new Key<Integer>("android.jpeg.orientation", int.class);
2531
2532 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002533 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002534 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002535 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002536 * <p><b>Range of valid values:</b><br>
2537 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002538 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002539 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002540 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002541 public static final Key<Byte> JPEG_QUALITY =
2542 new Key<Byte>("android.jpeg.quality", byte.class);
2543
2544 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002545 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002546 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002547 * <p><b>Range of valid values:</b><br>
2548 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002549 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002550 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002551 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002552 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2553 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2554
2555 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002556 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002557 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2558 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002559 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2560 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002561 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2562 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2563 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2564 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2565 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2566 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002567 * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested,
2568 * the camera device will handle thumbnail rotation in one of the following ways:</p>
2569 * <ul>
2570 * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
2571 * and keep jpeg and thumbnail image data unrotated.</li>
2572 * <li>Rotate the jpeg and thumbnail image data and not set
2573 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
2574 * case, LIMITED or FULL hardware level devices will report rotated thumnail size in
2575 * capture result, so the width and height will be interchanged if 90 or 270 degree
2576 * orientation is requested. LEGACY device will always report unrotated thumbnail
2577 * size.</li>
2578 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002579 * <p><b>Range of valid values:</b><br>
2580 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002581 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002582 *
2583 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002584 * @see CaptureRequest#JPEG_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002585 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002586 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002587 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2588 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002589
2590 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002591 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2592 * effective aperture diameter.</p>
2593 * <p>Setting this value is only supported on the camera devices that have a variable
2594 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002595 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2596 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002597 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002598 * to achieve manual exposure control.</p>
2599 * <p>The requested aperture value may take several frames to reach the
2600 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002601 * aperture size in capture result metadata while the aperture is changing.
2602 * 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 -08002603 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2604 * the ON modes, this will be overridden by the camera device
2605 * auto-exposure algorithm, the overridden values are then provided
2606 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002607 * <p><b>Units</b>: The f-number (f/N)</p>
2608 * <p><b>Range of valid values:</b><br>
2609 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002610 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2611 * <p><b>Full capability</b> -
2612 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2613 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002614 *
Zhijun He399f05d2014-01-15 11:31:30 -08002615 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002616 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002617 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002618 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002619 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002620 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002621 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002622 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002623 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002624 public static final Key<Float> LENS_APERTURE =
2625 new Key<Float>("android.lens.aperture", float.class);
2626
2627 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002628 * <p>The desired setting for the lens neutral density filter(s).</p>
2629 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002630 * <p>Lens filters are typically used to lower the amount of light the
2631 * sensor is exposed to (measured in steps of EV). As used here, an EV
2632 * step is the standard logarithmic representation, which are
2633 * non-negative, and inversely proportional to the amount of light
2634 * hitting the sensor. For example, setting this to 0 would result
2635 * in no reduction of the incoming light, and setting this to 2 would
2636 * mean that the filter is set to reduce incoming light by two stops
2637 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002638 * <p>It may take several frames before the lens filter density changes
2639 * to the requested value. While the filter density is still changing,
2640 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002641 * <p><b>Units</b>: Exposure Value (EV)</p>
2642 * <p><b>Range of valid values:</b><br>
2643 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002644 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2645 * <p><b>Full capability</b> -
2646 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2647 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002648 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002649 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002650 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002651 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002652 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002653 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002654 public static final Key<Float> LENS_FILTER_DENSITY =
2655 new Key<Float>("android.lens.filterDensity", float.class);
2656
2657 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002658 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002659 * <p>This setting controls the physical focal length of the camera
2660 * device's lens. Changing the focal length changes the field of
2661 * view of the camera device, and is usually used for optical zoom.</p>
2662 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2663 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002664 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002665 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2666 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002667 * <p>Optical zoom will not be supported on most devices.</p>
2668 * <p><b>Units</b>: Millimeters</p>
2669 * <p><b>Range of valid values:</b><br>
2670 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002671 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002672 *
2673 * @see CaptureRequest#LENS_APERTURE
2674 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002675 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002676 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002677 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002678 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002679 public static final Key<Float> LENS_FOCAL_LENGTH =
2680 new Key<Float>("android.lens.focalLength", float.class);
2681
2682 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002683 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002684 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002685 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002686 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2687 * <p><b>Range of valid values:</b><br>
2688 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002689 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2690 * <p><b>Full capability</b> -
2691 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2692 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2693 *
2694 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002695 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002696 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002697 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002698 public static final Key<Float> LENS_FOCUS_DISTANCE =
2699 new Key<Float>("android.lens.focusDistance", float.class);
2700
2701 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002702 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002703 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002704 * <p>If variable focus not supported, can still report
2705 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002706 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2707 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2708 * <p><b>Range of valid values:</b><br>
2709 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002710 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2711 * <p><b>Limited capability</b> -
2712 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2713 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2714 *
2715 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002716 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002717 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002718 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002719 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2720 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 -07002721
2722 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002723 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2724 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002725 * <p>OIS is used to compensate for motion blur due to small
2726 * movements of the camera during capture. Unlike digital image
2727 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2728 * makes use of mechanical elements to stabilize the camera
2729 * sensor, and thus allows for longer exposure times before
2730 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002731 * <p>Switching between different optical stabilization modes may take several
2732 * frames to initialize, the camera device will report the current mode in
2733 * capture result metadata. For example, When "ON" mode is requested, the
2734 * optical stabilization modes in the first several capture results may still
2735 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002736 * <p>If a camera device supports both OIS and digital image stabilization
2737 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2738 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002739 * <p>Not all devices will support OIS; see
2740 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2741 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002742 * <p><b>Possible values:</b>
2743 * <ul>
2744 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2745 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2746 * </ul></p>
2747 * <p><b>Available values for this device:</b><br>
2748 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002749 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2750 * <p><b>Limited capability</b> -
2751 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2752 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002753 *
2754 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002755 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002756 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002757 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2758 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2759 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002760 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002761 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2762 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2763
2764 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002765 * <p>Current lens status.</p>
2766 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2767 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2768 * they may take several frames to reach the requested values. This state indicates
2769 * the current status of the lens parameters.</p>
2770 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2771 * either because the parameters are all fixed, or because the lens has had enough
2772 * time to reach the most recently-requested values.
2773 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2774 * <ul>
2775 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2776 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2777 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2778 * which means the optical zoom is not supported.</li>
2779 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2780 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2781 * </ul>
2782 * <p>Then this state will always be STATIONARY.</p>
2783 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2784 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002785 * <p><b>Possible values:</b>
2786 * <ul>
2787 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2788 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2789 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002790 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2791 * <p><b>Limited capability</b> -
2792 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2793 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002794 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002795 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002796 * @see CaptureRequest#LENS_APERTURE
2797 * @see CaptureRequest#LENS_FILTER_DENSITY
2798 * @see CaptureRequest#LENS_FOCAL_LENGTH
2799 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2800 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2801 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2802 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2803 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002804 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002805 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002806 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002807 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002808 public static final Key<Integer> LENS_STATE =
2809 new Key<Integer>("android.lens.state", int.class);
2810
2811 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002812 * <p>The orientation of the camera relative to the sensor
2813 * coordinate system.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002814 * <p>The four coefficients that describe the quaternion
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002815 * rotation from the Android sensor coordinate system to a
2816 * camera-aligned coordinate system where the X-axis is
2817 * aligned with the long side of the image sensor, the Y-axis
2818 * is aligned with the short side of the image sensor, and
2819 * the Z-axis is aligned with the optical axis of the sensor.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002820 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002821 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
2822 * amount <code>theta</code>, the following formulas can be used:</p>
2823 * <pre><code> theta = 2 * acos(w)
2824 * a_x = x / sin(theta/2)
2825 * a_y = y / sin(theta/2)
2826 * a_z = z / sin(theta/2)
2827 * </code></pre>
2828 * <p>To create a 3x3 rotation matrix that applies the rotation
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002829 * defined by this quaternion, the following matrix can be
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002830 * used:</p>
2831 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
2832 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
2833 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
2834 * </code></pre>
2835 * <p>This matrix can then be used to apply the rotation to a
2836 * column vector point with</p>
2837 * <p><code>p' = Rp</code></p>
2838 * <p>where <code>p</code> is in the device sensor coordinate system, and
2839 * <code>p'</code> is in the camera-oriented coordinate system.</p>
2840 * <p><b>Units</b>:
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002841 * Quaternion coefficients</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002842 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01002843 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002844 */
2845 @PublicKey
2846 public static final Key<float[]> LENS_POSE_ROTATION =
2847 new Key<float[]>("android.lens.poseRotation", float[].class);
2848
2849 /**
2850 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07002851 * <p>The position of the camera device's lens optical center,
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002852 * as a three-dimensional vector <code>(x,y,z)</code>.</p>
2853 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
2854 * is relative to the optical center of the largest camera device facing in the same
2855 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
2856 * coordinate axes}. Note that only the axis definitions are shared with the sensor
2857 * coordinate system, but not the origin.</p>
2858 * <p>If this device is the largest or only camera device with a given facing, then this
2859 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
2860 * 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 -07002861 * report <code>(0.03, 0, 0)</code>. Note that this means that, for many computer vision
2862 * applications, the position needs to be negated to convert it to a translation from the
2863 * camera to the origin.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002864 * <p>To transform a pixel coordinates between two cameras facing the same direction, first
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002865 * 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 -08002866 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
2867 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
2868 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
2869 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
2870 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
2871 * coordinates.</p>
2872 * <p>To compare this against a real image from the destination camera, the destination camera
2873 * image then needs to be corrected for radial distortion before comparison or sampling.</p>
2874 * <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 -07002875 * the center of the primary gyroscope on the device. The axis definitions are the same as
2876 * with PRIMARY_CAMERA.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002877 * <p><b>Units</b>: Meters</p>
2878 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01002879 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002880 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002881 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002882 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002883 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002884 * @see CameraCharacteristics#LENS_POSE_ROTATION
2885 */
2886 @PublicKey
2887 public static final Key<float[]> LENS_POSE_TRANSLATION =
2888 new Key<float[]>("android.lens.poseTranslation", float[].class);
2889
2890 /**
2891 * <p>The parameters for this camera device's intrinsic
2892 * calibration.</p>
2893 * <p>The five calibration parameters that describe the
2894 * transform from camera-centric 3D coordinates to sensor
2895 * pixel coordinates:</p>
2896 * <pre><code>[f_x, f_y, c_x, c_y, s]
2897 * </code></pre>
2898 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
2899 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
2900 * axis, and <code>s</code> is a skew parameter for the sensor plane not
2901 * being aligned with the lens plane.</p>
2902 * <p>These are typically used within a transformation matrix K:</p>
2903 * <pre><code>K = [ f_x, s, c_x,
2904 * 0, f_y, c_y,
2905 * 0 0, 1 ]
2906 * </code></pre>
2907 * <p>which can then be combined with the camera pose rotation
2908 * <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 -07002909 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respectively) to calculate the
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002910 * complete transform from world coordinates to pixel
2911 * coordinates:</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07002912 * <pre><code>P = [ K 0 * [ R -Rt
2913 * 0 1 ] 0 1 ]
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002914 * </code></pre>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07002915 * <p>(Note the negation of poseTranslation when mapping from camera
2916 * to world coordinates, and multiplication by the rotation).</p>
2917 * <p>With <code>p_w</code> being a point in the world coordinate system
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002918 * and <code>p_s</code> being a point in the camera active pixel array
2919 * coordinate system, and with the mapping including the
2920 * homogeneous division by z:</p>
2921 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
2922 * p_s = p_h / z_h
2923 * </code></pre>
2924 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
2925 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
2926 * (depth) in pixel coordinates.</p>
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002927 * <p>Note that the coordinate system for this transform is the
2928 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
2929 * where <code>(0,0)</code> is the top-left of the
2930 * preCorrectionActiveArraySize rectangle. Once the pose and
2931 * intrinsic calibration transforms have been applied to a
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002932 * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002933 * transform needs to be applied, and the result adjusted to
2934 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
2935 * system (where <code>(0, 0)</code> is the top-left of the
2936 * activeArraySize rectangle), to determine the final pixel
2937 * coordinate of the world point for processed (non-RAW)
2938 * output buffers.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07002939 * <p>For camera devices, the center of pixel <code>(x,y)</code> is located at
2940 * coordinate <code>(x + 0.5, y + 0.5)</code>. So on a device with a
2941 * precorrection active array of size <code>(10,10)</code>, the valid pixel
2942 * indices go from <code>(0,0)-(9,9)</code>, and an perfectly-built camera would
2943 * have an optical center at the exact center of the pixel grid, at
2944 * coordinates <code>(5.0, 5.0)</code>, which is the top-left corner of pixel
2945 * <code>(5,5)</code>.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002946 * <p><b>Units</b>:
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002947 * Pixels in the
2948 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
2949 * coordinate system.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002950 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01002951 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002952 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002953 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002954 * @see CameraCharacteristics#LENS_POSE_ROTATION
2955 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07002956 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002957 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002958 */
2959 @PublicKey
2960 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
2961 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
2962
2963 /**
2964 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002965 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002966 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002967 * kappa_3]</code> and two tangential distortion coefficients
2968 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
2969 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002970 * <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 -07002971 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002972 * 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 -07002973 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002974 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002975 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
2976 * input image that correspond to the pixel values in the
2977 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
2978 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
2979 * </code></pre>
2980 * <p>The pixel coordinates are defined in a normalized
2981 * coordinate system related to the
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002982 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002983 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
2984 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
2985 * of both x and y coordinates are normalized to be 1 at the
2986 * edge further from the optical center, so the range
2987 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
2988 * <p>Finally, <code>r</code> represents the radial distance from the
2989 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
2990 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
2991 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002992 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002993 * Unitless coefficients.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002994 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01002995 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002996 *
2997 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002998 * @deprecated
2999 * <p>This field was inconsistently defined in terms of its
3000 * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p>
3001 *
3002 * @see CameraCharacteristics#LENS_DISTORTION
3003
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003004 */
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003005 @Deprecated
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00003006 @PublicKey
3007 public static final Key<float[]> LENS_RADIAL_DISTORTION =
3008 new Key<float[]>("android.lens.radialDistortion", float[].class);
3009
3010 /**
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003011 * <p>The correction coefficients to correct for this camera device's
3012 * radial and tangential lens distortion.</p>
3013 * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was
3014 * inconsistently defined.</p>
3015 * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2,
3016 * kappa_3]</code> and two tangential distortion coefficients
3017 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
3018 * lens's geometric distortion with the mapping equations:</p>
3019 * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
3020 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
3021 * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
3022 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
3023 * </code></pre>
3024 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
3025 * input image that correspond to the pixel values in the
3026 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
3027 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
3028 * </code></pre>
3029 * <p>The pixel coordinates are defined in a coordinate system
3030 * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
3031 * calibration fields; see that entry for details of the mapping stages.
3032 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code>
3033 * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and
3034 * the range of the coordinates depends on the focal length
3035 * terms of the intrinsic calibration.</p>
3036 * <p>Finally, <code>r</code> represents the radial distance from the
3037 * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p>
3038 * <p>The distortion model used is the Brown-Conrady model.</p>
3039 * <p><b>Units</b>:
3040 * Unitless coefficients.</p>
3041 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003042 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003043 *
3044 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
3045 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
3046 */
3047 @PublicKey
3048 public static final Key<float[]> LENS_DISTORTION =
3049 new Key<float[]>("android.lens.distortion", float[].class);
3050
3051 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003052 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003053 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08003054 * excessive noise added by the capture process, especially in dark conditions.</p>
3055 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
3056 * YUV domain.</p>
3057 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
3058 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
3059 * This mode is optional, may not be support by all devices. The application should check
3060 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08003061 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
3062 * will be applied. HIGH_QUALITY mode indicates that the camera device
3063 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003064 * even if it slows down capture rate. FAST means the camera device will not
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07003065 * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
3066 * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
3067 * Every output stream will have a similar amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003068 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
3069 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
3070 * into a final capture when triggered by the user. In this mode, the camera device applies
3071 * noise reduction to low-resolution streams (below maximum recording resolution) to maximize
3072 * preview quality, but does not apply noise reduction to high-resolution streams, since
3073 * those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08003074 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
3075 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
3076 * may adjust the noise reduction parameters for best image quality based on the
3077 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003078 * <p><b>Possible values:</b>
3079 * <ul>
3080 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
3081 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
3082 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08003083 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003084 * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003085 * </ul></p>
3086 * <p><b>Available values for this device:</b><br>
3087 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003088 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3089 * <p><b>Full capability</b> -
3090 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3091 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003092 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003093 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003094 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08003095 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003096 * @see #NOISE_REDUCTION_MODE_OFF
3097 * @see #NOISE_REDUCTION_MODE_FAST
3098 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08003099 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003100 * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003101 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003102 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003103 public static final Key<Integer> NOISE_REDUCTION_MODE =
3104 new Key<Integer>("android.noiseReduction.mode", int.class);
3105
3106 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003107 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003108 * final one for the capture, or only a partial that contains a
3109 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08003110 * values.</p>
3111 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003112 * single capture may not overlap, except for this entry. The
3113 * FINAL buffers must retain FIFO ordering relative to the
3114 * requests that generate them, so the FINAL buffer for frame 3 must
3115 * always be sent to the framework after the FINAL buffer for frame 2, and
3116 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
3117 * in any order relative to other frames, but all PARTIAL buffers for a given
3118 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08003119 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003120 * <p><b>Range of valid values:</b><br>
3121 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003122 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003123 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003124 * <p>Not used in HALv3 or newer</p>
3125
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003126 * @hide
3127 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003128 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003129 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
3130 new Key<Boolean>("android.quirks.partialResult", boolean.class);
3131
3132 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003133 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07003134 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08003135 * frameCount value).</p>
3136 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003137 * <p><b>Units</b>: count of frames</p>
3138 * <p><b>Range of valid values:</b><br>
3139 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003140 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003141 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003142 * <p>Not used in HALv3 or newer</p>
3143
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003144 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003145 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003146 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003147 public static final Key<Integer> REQUEST_FRAME_COUNT =
3148 new Key<Integer>("android.request.frameCount", int.class);
3149
3150 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003151 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003152 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08003153 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003154 * <p><b>Units</b>: arbitrary integer assigned by application</p>
3155 * <p><b>Range of valid values:</b><br>
3156 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003157 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003158 * @hide
3159 */
3160 public static final Key<Integer> REQUEST_ID =
3161 new Key<Integer>("android.request.id", int.class);
3162
3163 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003164 * <p>Specifies the number of pipeline stages the frame went
3165 * through from when it was exposed to when the final completed result
3166 * was available to the framework.</p>
3167 * <p>Depending on what settings are used in the request, and
3168 * what streams are configured, the data may undergo less processing,
3169 * and some pipeline stages skipped.</p>
3170 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003171 * <p><b>Range of valid values:</b><br>
3172 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003173 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003174 *
3175 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3176 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003177 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003178 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
3179 new Key<Byte>("android.request.pipelineDepth", byte.class);
3180
3181 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003182 * <p>The desired region of the sensor to read out for this capture.</p>
3183 * <p>This control can be used to implement digital zoom.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003184 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3185 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being
3186 * the top-left pixel of the active array.</p>
3187 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3188 * system depends on the mode being set.
3189 * When the distortion correction mode is OFF, the coordinate system follows
3190 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
3191 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array.
3192 * When the distortion correction mode is not OFF, the coordinate system follows
3193 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3194 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003195 * <p>Output streams use this rectangle to produce their output,
3196 * cropping to a smaller region if necessary to maintain the
3197 * stream's aspect ratio, then scaling the sensor input to
3198 * match the output's configured resolution.</p>
3199 * <p>The crop region is applied after the RAW to other color
3200 * space (e.g. YUV) conversion. Since raw streams
3201 * (e.g. RAW16) don't have the conversion stage, they are not
3202 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07003203 * <p>For non-raw streams, any additional per-stream cropping will
3204 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003205 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003206 * ratio, then 4:3 streams will use the exact crop
3207 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08003208 * (letterbox).</p>
3209 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003210 * outputs will crop horizontally (pillarbox), and 16:9
3211 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08003212 * be centered within the crop region.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003213 * <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 -07003214 * of the crop region cannot be set to be smaller than
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003215 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
3216 * <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 -07003217 * <p>If the coordinate system is {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, the width
3218 * and height of the crop region cannot be set to be smaller than
3219 * <code>floor( preCorrectionActiveArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>
3220 * and
3221 * <code>floor( preCorrectionActiveArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>,
3222 * respectively.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003223 * <p>The camera device may adjust the crop region to account
3224 * for rounding and other hardware requirements; the final
3225 * crop region used will be included in the output capture
3226 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003227 * <p><b>Units</b>: Pixel coordinates relative to
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003228 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
3229 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on distortion correction
3230 * capability and mode</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003231 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003232 *
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003233 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003234 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003235 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003236 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003237 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003238 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003239 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
3240 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
3241
3242 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003243 * <p>Duration each pixel is exposed to
3244 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003245 * <p>If the sensor can't expose this exact duration, it will shorten the
3246 * duration exposed to the nearest possible value (rather than expose longer).
3247 * The final exposure time used will be available in the output capture result.</p>
3248 * <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
3249 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3250 * <p><b>Units</b>: Nanoseconds</p>
3251 * <p><b>Range of valid values:</b><br>
3252 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003253 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3254 * <p><b>Full capability</b> -
3255 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3256 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3257 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003258 * @see CaptureRequest#CONTROL_AE_MODE
3259 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003260 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003261 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003262 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003263 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003264 public static final Key<Long> SENSOR_EXPOSURE_TIME =
3265 new Key<Long>("android.sensor.exposureTime", long.class);
3266
3267 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003268 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003269 * start of next frame exposure.</p>
3270 * <p>The maximum frame rate that can be supported by a camera subsystem is
3271 * a function of many factors:</p>
3272 * <ul>
3273 * <li>Requested resolutions of output image streams</li>
3274 * <li>Availability of binning / skipping modes on the imager</li>
3275 * <li>The bandwidth of the imager interface</li>
3276 * <li>The bandwidth of the various ISP processing blocks</li>
3277 * </ul>
3278 * <p>Since these factors can vary greatly between different ISPs and
3279 * sensors, the camera abstraction tries to represent the bandwidth
3280 * restrictions with as simple a model as possible.</p>
3281 * <p>The model presented has the following characteristics:</p>
3282 * <ul>
3283 * <li>The image sensor is always configured to output the smallest
3284 * resolution possible given the application's requested output stream
3285 * sizes. The smallest resolution is defined as being at least as large
3286 * as the largest requested output stream size; the camera pipeline must
3287 * never digitally upsample sensor data when the crop region covers the
3288 * whole sensor. In general, this means that if only small output stream
3289 * resolutions are configured, the sensor can provide a higher frame
3290 * rate.</li>
3291 * <li>Since any request may use any or all the currently configured
3292 * output streams, the sensor and ISP must be configured to support
3293 * scaling a single capture to all the streams at the same time. This
3294 * means the camera pipeline must be ready to produce the largest
3295 * requested output size without any delay. Therefore, the overall
3296 * frame rate of a given configured stream set is governed only by the
3297 * largest requested stream resolution.</li>
3298 * <li>Using more than one output stream in a request does not affect the
3299 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08003300 * <li>Certain format-streams may need to do additional background processing
3301 * before data is consumed/produced by that stream. These processors
3302 * can run concurrently to the rest of the camera pipeline, but
3303 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003304 * </ul>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003305 * <p>The necessary information for the application, given the model above, is provided via
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003306 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003307 * These are used to determine the maximum frame rate / minimum frame duration that is
3308 * possible for a given stream configuration.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003309 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08003310 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003311 * device:</p>
3312 * <ol>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003313 * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li>
3314 * <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 }
3315 * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li>
3316 * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum
3317 * 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 -08003318 * </ol>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003319 * <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 -08003320 * using its respective size/format), then the frame duration in <code>F</code> determines the steady
3321 * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let
3322 * this special kind of request be called <code>Rsimple</code>.</p>
3323 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a
3324 * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if
3325 * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all
3326 * buffers from the previous <code>Rstall</code> have already been delivered.</p>
3327 * <p>For more details about stalling, see {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003328 * <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
3329 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3330 * <p><b>Units</b>: Nanoseconds</p>
3331 * <p><b>Range of valid values:</b><br>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003332 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }.
3333 * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003334 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3335 * <p><b>Full capability</b> -
3336 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3337 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003338 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003339 * @see CaptureRequest#CONTROL_AE_MODE
3340 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003341 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003342 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003343 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003344 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003345 public static final Key<Long> SENSOR_FRAME_DURATION =
3346 new Key<Long>("android.sensor.frameDuration", long.class);
3347
3348 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003349 * <p>The amount of gain applied to sensor data
3350 * before processing.</p>
3351 * <p>The sensitivity is the standard ISO sensitivity value,
3352 * as defined in ISO 12232:2006.</p>
3353 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
3354 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
3355 * is guaranteed to use only analog amplification for applying the gain.</p>
3356 * <p>If the camera device cannot apply the exact sensitivity
3357 * requested, it will reduce the gain to the nearest supported
3358 * value. The final sensitivity used will be available in the
3359 * output capture result.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003360 * <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
3361 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003362 * <p><b>Units</b>: ISO arithmetic units</p>
3363 * <p><b>Range of valid values:</b><br>
3364 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003365 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3366 * <p><b>Full capability</b> -
3367 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3368 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003369 *
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003370 * @see CaptureRequest#CONTROL_AE_MODE
3371 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003372 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003373 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
3374 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003375 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003376 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003377 public static final Key<Integer> SENSOR_SENSITIVITY =
3378 new Key<Integer>("android.sensor.sensitivity", int.class);
3379
3380 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003381 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07003382 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003383 * <p>The timestamps are also included in all image
3384 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07003385 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003386 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07003387 * the timestamps measure time since an unspecified starting point,
3388 * and are monotonically increasing. They can be compared with the
3389 * timestamps for other captures from the same camera device, but are
3390 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003391 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the
3392 * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can
3393 * be compared to other timestamps from other subsystems that
3394 * are using that base.</p>
Chien-Yu Chen6216e4e2015-05-29 11:49:54 -07003395 * <p>For reprocessing, the timestamp will match the start of exposure of
3396 * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the
3397 * timestamp} in the TotalCaptureResult that was used to create the
3398 * reprocess capture request.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003399 * <p><b>Units</b>: Nanoseconds</p>
3400 * <p><b>Range of valid values:</b><br>
3401 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003402 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07003403 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003404 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003405 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003406 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003407 public static final Key<Long> SENSOR_TIMESTAMP =
3408 new Key<Long>("android.sensor.timestamp", long.class);
3409
3410 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07003411 * <p>The estimated camera neutral color in the native sensor colorspace at
3412 * the time of capture.</p>
3413 * <p>This value gives the neutral color point encoded as an RGB value in the
3414 * native sensor color space. The neutral color point indicates the
3415 * currently estimated white point of the scene illumination. It can be
3416 * used to interpolate between the provided color transforms when
3417 * processing raw sensor data.</p>
3418 * <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 -07003419 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3420 * the camera device has RAW capability.</p>
Ruben Brunk20c76f62014-02-07 15:47:10 -08003421 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3422 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003423 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08003424 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
3425 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
3426
3427 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003428 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003429 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003430 * corresponding to the sensor amplification (S) and sensor readout
3431 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003432 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003433 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
3434 * represented as an array of Pair&lt;Double, Double&gt;, where
3435 * the first member of the Pair at index n is the S coefficient and the
3436 * second member is the O coefficient for the nth color channel in the CFA.</p>
3437 * <p>These coefficients are used in a two parameter noise model to describe
3438 * the amount of noise present in the image for each CFA channel. The
3439 * noise model used here is:</p>
3440 * <p>N(x) = sqrt(Sx + O)</p>
3441 * <p>Where x represents the recorded signal of a CFA channel normalized to
3442 * the range [0, 1], and S and O are the noise model coeffiecients for
3443 * that channel.</p>
3444 * <p>A more detailed description of the noise model can be found in the
3445 * Adobe DNG specification for the NoiseProfile tag.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003446 * <p>For a MONOCHROME camera, there is only one color channel. So the noise model coefficients
3447 * will only contain one S and one O.</p>
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003448 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3449 *
3450 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3451 */
3452 @PublicKey
3453 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
3454 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
3455
3456 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08003457 * <p>The worst-case divergence between Bayer green channels.</p>
3458 * <p>This value is an estimate of the worst case split between the
3459 * Bayer green channels in the red and blue rows in the sensor color
3460 * filter array.</p>
3461 * <p>The green split is calculated as follows:</p>
3462 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07003463 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
3464 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
3465 * mosaic channels (R, Gr, Gb, B). The location and size of the window
3466 * chosen is implementation defined, and should be chosen to provide a
3467 * green split estimate that is both representative of the entire image
3468 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003469 * <li>The arithmetic mean of the green channels from the red
3470 * rows (mean_Gr) within W is computed.</li>
3471 * <li>The arithmetic mean of the green channels from the blue
3472 * rows (mean_Gb) within W is computed.</li>
3473 * <li>The maximum ratio R of the two means is computed as follows:
3474 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
3475 * </ol>
3476 * <p>The ratio R is the green split divergence reported for this property,
3477 * which represents how much the green channels differ in the mosaic
3478 * pattern. This value is typically used to determine the treatment of
3479 * the green mosaic channels when demosaicing.</p>
3480 * <p>The green split value can be roughly interpreted as follows:</p>
3481 * <ul>
3482 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
3483 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
3484 * correction to avoid demosaic errors (3-20% divergence).</li>
3485 * <li>R &gt; 1.20 will require strong software correction to produce
3486 * a usuable image (&gt;20% divergence).</li>
3487 * </ul>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003488 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3489 * the camera device has RAW capability.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003490 * <p><b>Range of valid values:</b><br></p>
3491 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003492 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3493 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003494 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08003495 public static final Key<Float> SENSOR_GREEN_SPLIT =
3496 new Key<Float>("android.sensor.greenSplit", float.class);
3497
3498 /**
Zhijun He379af012014-05-06 11:54:54 -07003499 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
3500 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
3501 * <p>Each color channel is treated as an unsigned 32-bit integer.
3502 * The camera device then uses the most significant X bits
3503 * that correspond to how many bits are in its Bayer raw sensor
3504 * output.</p>
3505 * <p>For example, a sensor with RAW10 Bayer output would use the
3506 * 10 most significant bits from each color channel.</p>
3507 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3508 *
3509 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
3510 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003511 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003512 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
3513 new Key<int[]>("android.sensor.testPatternData", int[].class);
3514
3515 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003516 * <p>When enabled, the sensor sends a test pattern instead of
3517 * doing a real exposure from the camera.</p>
3518 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003519 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08003520 * work as normal.</p>
3521 * <p>For example, if manual flash is enabled, flash firing should still
3522 * occur (and that the test pattern remain unmodified, since the flash
3523 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003524 * <p>Defaults to OFF.</p>
3525 * <p><b>Possible values:</b>
3526 * <ul>
3527 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
3528 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
3529 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
3530 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
3531 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
3532 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
3533 * </ul></p>
3534 * <p><b>Available values for this device:</b><br>
3535 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003536 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003537 *
3538 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08003539 * @see #SENSOR_TEST_PATTERN_MODE_OFF
3540 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
3541 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
3542 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
3543 * @see #SENSOR_TEST_PATTERN_MODE_PN9
3544 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
3545 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003546 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003547 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
3548 new Key<Integer>("android.sensor.testPatternMode", int.class);
3549
3550 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07003551 * <p>Duration between the start of first row exposure
3552 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003553 * <p>This is the exposure time skew between the first and last
3554 * row exposure start times. The first row and the last row are
3555 * the first and last rows inside of the
3556 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003557 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
3558 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003559 * <p><b>Units</b>: Nanoseconds</p>
3560 * <p><b>Range of valid values:</b><br>
3561 * &gt;= 0 and &lt;
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003562 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003563 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3564 * <p><b>Limited capability</b> -
3565 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3566 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003567 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003568 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07003569 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3570 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003571 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07003572 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
3573 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
3574
3575 /**
Zhijun Hecd950b62015-11-12 17:47:52 -08003576 * <p>A per-frame dynamic black level offset for each of the color filter
3577 * arrangement (CFA) mosaic channels.</p>
3578 * <p>Camera sensor black levels may vary dramatically for different
3579 * capture settings (e.g. {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). The fixed black
3580 * level reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may be too
3581 * inaccurate to represent the actual value on a per-frame basis. The
3582 * camera device internal pipeline relies on reliable black level values
3583 * to process the raw images appropriately. To get the best image
3584 * quality, the camera device may choose to estimate the per frame black
3585 * level values either based on optically shielded black regions
3586 * ({@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}) or its internal model.</p>
3587 * <p>This key reports the camera device estimated per-frame zero light
3588 * value for each of the CFA mosaic channels in the camera sensor. The
3589 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may only represent a coarse
3590 * approximation of the actual black level values. This value is the
3591 * black level used in camera device internal image processing pipeline
3592 * and generally more accurate than the fixed black level values.
3593 * However, since they are estimated values by the camera device, they
3594 * may not be as accurate as the black level values calculated from the
3595 * optical black pixels reported by {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}.</p>
3596 * <p>The values are given in the same order as channels listed for the CFA
3597 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
3598 * nth value given corresponds to the black level offset for the nth
3599 * color channel listed in the CFA.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003600 * <p>For a MONOCHROME camera, all of the 2x2 channels must have the same values.</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003601 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is available or the
3602 * camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08003603 * <p><b>Range of valid values:</b><br>
3604 * &gt;= 0 for each.</p>
3605 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3606 *
3607 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
3608 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3609 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3610 * @see CaptureRequest#SENSOR_SENSITIVITY
3611 */
3612 @PublicKey
Zhijun He8998ad92015-11-24 14:31:04 -08003613 public static final Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL =
3614 new Key<float[]>("android.sensor.dynamicBlackLevel", float[].class);
Zhijun Hecd950b62015-11-12 17:47:52 -08003615
3616 /**
3617 * <p>Maximum raw value output by sensor for this frame.</p>
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07003618 * <p>Since the {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may change for different
Zhijun Hecd950b62015-11-12 17:47:52 -08003619 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}), the white
3620 * level will change accordingly. This key is similar to
3621 * {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}, but specifies the camera device
3622 * estimated white level for each frame.</p>
3623 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is
3624 * available or the camera device advertises this key via
3625 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys }.</p>
3626 * <p><b>Range of valid values:</b><br>
3627 * &gt;= 0</p>
3628 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3629 *
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07003630 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
Zhijun Hecd950b62015-11-12 17:47:52 -08003631 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
3632 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3633 * @see CaptureRequest#SENSOR_SENSITIVITY
3634 */
3635 @PublicKey
3636 public static final Key<Integer> SENSOR_DYNAMIC_WHITE_LEVEL =
3637 new Key<Integer>("android.sensor.dynamicWhiteLevel", int.class);
3638
3639 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08003640 * <p>Quality of lens shading correction applied
3641 * to the image data.</p>
3642 * <p>When set to OFF mode, no lens shading correction will be applied by the
3643 * camera device, and an identity lens shading map data will be provided
3644 * 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 -07003645 * shading map with size of <code>[ 4, 3 ]</code>,
3646 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
3647 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003648 * <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 -07003649 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3650 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3651 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3652 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3653 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08003654 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003655 * <p>When set to other modes, lens shading correction will be applied by the camera
3656 * device. Applications can request lens shading map data by setting
3657 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
3658 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
3659 * data will be the one applied by the camera device for this capture request.</p>
3660 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
3661 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
3662 * 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>
3663 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
3664 * to be converged before using the returned shading map data.</p>
3665 * <p><b>Possible values:</b>
3666 * <ul>
3667 * <li>{@link #SHADING_MODE_OFF OFF}</li>
3668 * <li>{@link #SHADING_MODE_FAST FAST}</li>
3669 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3670 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003671 * <p><b>Available values for this device:</b><br>
3672 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003673 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3674 * <p><b>Full capability</b> -
3675 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3676 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003677 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07003678 * @see CaptureRequest#CONTROL_AE_MODE
3679 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003680 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003681 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003682 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08003683 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3684 * @see #SHADING_MODE_OFF
3685 * @see #SHADING_MODE_FAST
3686 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08003687 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003688 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08003689 public static final Key<Integer> SHADING_MODE =
3690 new Key<Integer>("android.shading.mode", int.class);
3691
3692 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003693 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003694 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003695 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003696 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003697 * fields.</p>
3698 * <p><b>Possible values:</b>
3699 * <ul>
3700 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3701 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3702 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3703 * </ul></p>
3704 * <p><b>Available values for this device:</b><br>
3705 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3706 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003707 *
3708 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003709 * @see #STATISTICS_FACE_DETECT_MODE_OFF
3710 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3711 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3712 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003713 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003714 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3715 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3716
3717 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003718 * <p>List of unique IDs for detected faces.</p>
3719 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3720 * to the camera device. A face that leaves the field of view and later returns may be
3721 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003722 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3723 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003724 *
3725 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003726 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003727 */
3728 public static final Key<int[]> STATISTICS_FACE_IDS =
3729 new Key<int[]>("android.statistics.faceIds", int[].class);
3730
3731 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003732 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003733 * faces.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003734 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3735 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being
3736 * the top-left pixel of the active array.</p>
3737 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3738 * system depends on the mode being set.
3739 * When the distortion correction mode is OFF, the coordinate system follows
3740 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
3741 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array.
3742 * When the distortion correction mode is not OFF, the coordinate system follows
3743 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003744 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003745 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3746 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003747 *
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003748 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003749 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003750 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003751 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003752 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003753 */
3754 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3755 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3756
3757 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003758 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003759 * faces.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003760 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3761 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being
3762 * the top-left pixel of the active array.</p>
3763 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3764 * system depends on the mode being set.
3765 * When the distortion correction mode is OFF, the coordinate system follows
3766 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
3767 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array.
3768 * When the distortion correction mode is not OFF, the coordinate system follows
3769 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003770 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003771 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3772 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003773 *
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003774 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003775 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003776 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003777 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003778 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003779 */
3780 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3781 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3782
3783 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003784 * <p>List of the face confidence scores for
3785 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003786 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003787 * <p><b>Range of valid values:</b><br>
3788 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003789 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003790 *
3791 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003792 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003793 */
3794 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3795 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3796
3797 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003798 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003799 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003800 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003801 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003802 *
3803 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3804 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003805 @PublicKey
3806 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003807 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3808 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3809
3810 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003811 * <p>The shading map is a low-resolution floating-point map
3812 * that lists the coefficients used to correct for vignetting, for each
3813 * Bayer color channel.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003814 * <p>The map provided here is the same map that is used by the camera device to
3815 * correct both color shading and vignetting for output non-RAW images.</p>
3816 * <p>When there is no lens shading correction applied to RAW
3817 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3818 * false), this map is the complete lens shading correction
3819 * map; when there is some lens shading correction applied to
3820 * 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
3821 * correction map that needs to be applied to get shading
3822 * corrected images that match the camera device's output for
3823 * non-RAW formats.</p>
3824 * <p>For a complete shading correction map, the least shaded
3825 * section of the image will have a gain factor of 1; all
3826 * other sections will have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003827 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003828 * will take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003829 * <p>The shading map is for the entire active pixel array, and is not
3830 * affected by the crop region specified in the request. Each shading map
3831 * entry is the value of the shading compensation map over a specific
3832 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3833 * map, and an active pixel array size (W x H), shading map entry
3834 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3835 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3836 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3837 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3838 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003839 * The shading map is stored in a fully interleaved format.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003840 * <p>The shading map will generally have on the order of 30-40 rows and columns,
3841 * and will be smaller than 64x64.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003842 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003843 * <pre><code>width,height = [ 4, 3 ]
3844 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003845 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003846 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3847 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3848 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3849 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3850 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003851 * </code></pre>
3852 * <p>The low-resolution scaling map images for each channel are
3853 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003854 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3855 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3856 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3857 * <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 -08003858 * <p>As a visualization only, inverting the full-color map to recover an
3859 * 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 -08003860 * <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 -07003861 * <p>For a MONOCHROME camera, all of the 2x2 channels must have the same values. An example
3862 * shading map for such a camera is defined as:</p>
3863 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3864 * android.statistics.lensShadingMap =
3865 * [ 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
3866 * 1.1, 1.1, 1.1, 1.1, 1.3, 1.3, 1.3, 1.3,
3867 * 1.2, 1.2, 1.2, 1.2, 1.1, 1.1, 1.1, 1.1,
3868 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.2, 1.2,
3869 * 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
3870 * 1.2, 1.2, 1.2, 1.2, 1.3, 1.3, 1.3, 1.3 ]
3871 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003872 * <p><b>Range of valid values:</b><br>
3873 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003874 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3875 * <p><b>Full capability</b> -
3876 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3877 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003878 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003879 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003880 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003881 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003882 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003883 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003884 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3885 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3886
3887 /**
3888 * <p>The shading map is a low-resolution floating-point map
Zhijun He43210fe2016-04-12 23:15:23 -07003889 * that lists the coefficients used to correct for vignetting and color shading,
3890 * for each Bayer color channel of RAW image data.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003891 * <p>The map provided here is the same map that is used by the camera device to
3892 * correct both color shading and vignetting for output non-RAW images.</p>
3893 * <p>When there is no lens shading correction applied to RAW
3894 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3895 * false), this map is the complete lens shading correction
3896 * map; when there is some lens shading correction applied to
3897 * 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
3898 * correction map that needs to be applied to get shading
3899 * corrected images that match the camera device's output for
3900 * non-RAW formats.</p>
3901 * <p>For a complete shading correction map, the least shaded
3902 * section of the image will have a gain factor of 1; all
3903 * other sections will have gains above 1.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003904 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003905 * will take into account the colorCorrection settings.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003906 * <p>The shading map is for the entire active pixel array, and is not
3907 * affected by the crop region specified in the request. Each shading map
3908 * entry is the value of the shading compensation map over a specific
3909 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3910 * map, and an active pixel array size (W x H), shading map entry
3911 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3912 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3913 * The map is assumed to be bilinearly interpolated between the sample points.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003914 * <p>For a Bayer camera, the channel order is [R, Geven, Godd, B], where Geven is
3915 * the green channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003916 * The shading map is stored in a fully interleaved format, and its size
3917 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003918 * <p>The shading map will generally have on the order of 30-40 rows and columns,
3919 * and will be smaller than 64x64.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003920 * <p>As an example, given a very small map for a Bayer camera defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003921 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3922 * android.statistics.lensShadingMap =
3923 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003924 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3925 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3926 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3927 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3928 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003929 * </code></pre>
3930 * <p>The low-resolution scaling map images for each channel are
3931 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003932 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3933 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3934 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3935 * <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 -07003936 * <p>As a visualization only, inverting the full-color map to recover an
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003937 * image of a gray wall (using bicubic interpolation for visual quality)
3938 * as captured by the sensor gives:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003939 * <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 -07003940 * <p>For a MONOCHROME camera, all of the 2x2 channels must have the same values. An example
3941 * shading map for such a camera is defined as:</p>
3942 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3943 * android.statistics.lensShadingMap =
3944 * [ 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
3945 * 1.1, 1.1, 1.1, 1.1, 1.3, 1.3, 1.3, 1.3,
3946 * 1.2, 1.2, 1.2, 1.2, 1.1, 1.1, 1.1, 1.1,
3947 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.2, 1.2,
3948 * 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
3949 * 1.2, 1.2, 1.2, 1.2, 1.3, 1.3, 1.3, 1.3 ]
3950 * </code></pre>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003951 * <p>Note that the RAW image data might be subject to lens shading
3952 * correction not reported on this map. Query
3953 * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject
3954 * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}
3955 * is TRUE, the RAW image data is subject to partial or full lens shading
3956 * correction. In the case full lens shading correction is applied to RAW
3957 * images, the gain factor map reported in this key will contain all 1.0 gains.
3958 * In other words, the map reported in this key is the remaining lens shading
3959 * that needs to be applied on the RAW image to get images without lens shading
3960 * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image
3961 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003962 * <p><b>Range of valid values:</b><br>
3963 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003964 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3965 * <p><b>Full capability</b> -
3966 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3967 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003968 *
3969 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003970 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003971 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
3972 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003973 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003974 */
3975 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3976 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3977
3978 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003979 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003980 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003981 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003982 * since statistics processing on data from a new frame
3983 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003984 * applied to that frame.</p>
3985 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003986 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003987 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003988 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003989 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003990 *
3991 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003992 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003993 * <p>Never fully implemented or specified; do not use</p>
3994
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003995 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003996 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003997 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003998 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3999 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
4000
4001 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004002 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08004003 * calculated by the camera device's statistics units for the current
4004 * output frame.</p>
4005 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004006 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08004007 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004008 * are the best fit for the current output frame. This may
4009 * be different than the transform used for this frame, since
4010 * statistics processing on data from a new frame typically
4011 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08004012 * that frame.</p>
4013 * <p>These estimates must be provided for all frames, even if
4014 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07004015 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08004016 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08004017 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07004018 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07004019 * <p>Never fully implemented or specified; do not use</p>
4020
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08004021 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004022 */
Igor Murashkin9c595172014-05-12 13:56:20 -07004023 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004024 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
4025 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
4026
4027 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08004028 * <p>The camera device estimated scene illumination lighting
4029 * frequency.</p>
4030 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
4031 * that depends on the local utility power standards. This flicker must be
4032 * accounted for by auto-exposure routines to avoid artifacts in captured images.
4033 * The camera device uses this entry to tell the application what the scene
4034 * illuminant frequency is.</p>
4035 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004036 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
4037 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
4038 * antibanding, and the application can ensure it selects
4039 * exposure times that do not cause banding issues by looking
4040 * into this metadata field. See
4041 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
4042 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004043 * <p><b>Possible values:</b>
4044 * <ul>
4045 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
4046 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
4047 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
4048 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004049 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4050 * <p><b>Full capability</b> -
4051 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4052 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08004053 *
4054 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
4055 * @see CaptureRequest#CONTROL_AE_MODE
4056 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004057 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004058 * @see #STATISTICS_SCENE_FLICKER_NONE
4059 * @see #STATISTICS_SCENE_FLICKER_50HZ
4060 * @see #STATISTICS_SCENE_FLICKER_60HZ
4061 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004062 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004063 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
4064 new Key<Integer>("android.statistics.sceneFlicker", int.class);
4065
4066 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004067 * <p>Operating mode for hot pixel map generation.</p>
4068 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
4069 * If set to <code>false</code>, no hot pixel map will be returned.</p>
4070 * <p><b>Range of valid values:</b><br>
4071 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004072 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004073 *
4074 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
4075 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
4076 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004077 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004078 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
4079 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
4080
4081 /**
4082 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
4083 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
4084 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
4085 * bottom-right of the pixel array, respectively. The width and
4086 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
4087 * This may include hot pixels that lie outside of the active array
4088 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004089 * <p><b>Range of valid values:</b><br></p>
4090 * <p>n &lt;= number of pixels on the sensor.
4091 * The <code>(x, y)</code> coordinates must be bounded by
4092 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004093 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004094 *
4095 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
4096 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
4097 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004098 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004099 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
4100 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004101
4102 /**
Zhijun He379af012014-05-06 11:54:54 -07004103 * <p>Whether the camera device will output the lens
4104 * shading map in output result metadata.</p>
4105 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004106 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07004107 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004108 * <p>ON is always supported on devices with the RAW capability.</p>
4109 * <p><b>Possible values:</b>
4110 * <ul>
4111 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
4112 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
4113 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004114 * <p><b>Available values for this device:</b><br>
4115 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004116 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4117 * <p><b>Full capability</b> -
4118 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4119 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4120 *
4121 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004122 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Zhijun He379af012014-05-06 11:54:54 -07004123 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
4124 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
4125 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004126 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07004127 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
4128 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
4129
4130 /**
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004131 * <p>A control for selecting whether optical stabilization (OIS) position
4132 * information is included in output result metadata.</p>
4133 * <p>Since optical image stabilization generally involves motion much faster than the duration
4134 * of individualq image exposure, multiple OIS samples can be included for a single capture
4135 * result. For example, if the OIS reporting operates at 200 Hz, a typical camera operating
4136 * at 30fps may have 6-7 OIS samples per capture result. This information can be combined
4137 * with the rolling shutter skew to account for lens motion during image exposure in
4138 * post-processing algorithms.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004139 * <p><b>Possible values:</b>
4140 * <ul>
4141 * <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li>
4142 * <li>{@link #STATISTICS_OIS_DATA_MODE_ON ON}</li>
4143 * </ul></p>
4144 * <p><b>Available values for this device:</b><br>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07004145 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES android.statistics.info.availableOisDataModes}</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004146 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07004147 *
4148 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004149 * @see #STATISTICS_OIS_DATA_MODE_OFF
4150 * @see #STATISTICS_OIS_DATA_MODE_ON
4151 */
4152 @PublicKey
4153 public static final Key<Integer> STATISTICS_OIS_DATA_MODE =
4154 new Key<Integer>("android.statistics.oisDataMode", int.class);
4155
4156 /**
4157 * <p>An array of timestamps of OIS samples, in nanoseconds.</p>
4158 * <p>The array contains the timestamps of OIS samples. The timestamps are in the same
4159 * timebase as and comparable to {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp}.</p>
4160 * <p><b>Units</b>: nanoseconds</p>
4161 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4162 *
4163 * @see CaptureResult#SENSOR_TIMESTAMP
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004164 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004165 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004166 public static final Key<long[]> STATISTICS_OIS_TIMESTAMPS =
4167 new Key<long[]>("android.statistics.oisTimestamps", long[].class);
4168
4169 /**
4170 * <p>An array of shifts of OIS samples, in x direction.</p>
4171 * <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 -07004172 * A positive value is a shift from left to right in the pre-correction active array
4173 * coordinate system. For example, if the optical center is (1000, 500) in pre-correction
4174 * 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 -08004175 * <p>The number of shifts must match the number of timestamps in
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004176 * android.statistics.oisTimestamps.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004177 * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on
4178 * supporting devices). They are always reported in pre-correction active array coordinates,
4179 * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift
4180 * is needed.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004181 * <p><b>Units</b>: Pixels in active array.</p>
4182 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004183 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004184 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004185 public static final Key<float[]> STATISTICS_OIS_X_SHIFTS =
4186 new Key<float[]>("android.statistics.oisXShifts", float[].class);
4187
4188 /**
4189 * <p>An array of shifts of OIS samples, in y direction.</p>
4190 * <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 -07004191 * A positive value is a shift from top to bottom in pre-correction active array coordinate
4192 * system. For example, if the optical center is (1000, 500) in active array coordinates, a
4193 * shift of (0, 5) puts the new optical center at (1000, 505).</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004194 * <p>The number of shifts must match the number of timestamps in
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004195 * android.statistics.oisTimestamps.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004196 * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on
4197 * supporting devices). They are always reported in pre-correction active array coordinates,
4198 * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift
4199 * is needed.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004200 * <p><b>Units</b>: Pixels in active array.</p>
4201 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004202 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004203 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004204 public static final Key<float[]> STATISTICS_OIS_Y_SHIFTS =
4205 new Key<float[]>("android.statistics.oisYShifts", float[].class);
4206
4207 /**
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004208 * <p>An array of optical stabilization (OIS) position samples.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004209 * <p>Each OIS sample contains the timestamp and the amount of shifts in x and y direction,
4210 * in pixels, of the OIS sample.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004211 * <p>A positive value for a shift in x direction is a shift from left to right in the
4212 * pre-correction active array coordinate system. For example, if the optical center is
4213 * (1000, 500) in pre-correction active array coordinates, a shift of (3, 0) puts the new
4214 * optical center at (1003, 500).</p>
4215 * <p>A positive value for a shift in y direction is a shift from top to bottom in
4216 * pre-correction active array coordinate system. For example, if the optical center is
4217 * (1000, 500) in active array coordinates, a shift of (0, 5) puts the new optical center at
4218 * (1000, 505).</p>
4219 * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on
4220 * supporting devices). They are always reported in pre-correction active array coordinates,
4221 * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift
4222 * is needed.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004223 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4224 */
4225 @PublicKey
4226 @SyntheticKey
4227 public static final Key<android.hardware.camera2.params.OisSample[]> STATISTICS_OIS_SAMPLES =
4228 new Key<android.hardware.camera2.params.OisSample[]>("android.statistics.oisSamples", android.hardware.camera2.params.OisSample[].class);
4229
4230 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004231 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08004232 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4233 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004234 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004235 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4236 * <p><b>Full capability</b> -
4237 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4238 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004239 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004240 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004241 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004242 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004243 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004244 public static final Key<float[]> TONEMAP_CURVE_BLUE =
4245 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004246
4247 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004248 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08004249 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4250 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004251 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004252 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4253 * <p><b>Full capability</b> -
4254 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4255 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004256 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004257 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004258 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004259 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004260 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004261 public static final Key<float[]> TONEMAP_CURVE_GREEN =
4262 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004263
4264 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004265 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08004266 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4267 * CONTRAST_CURVE.</p>
4268 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004269 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004270 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08004271 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004272 * <p>These are sorted in order of increasing <code>Pin</code>; it is
4273 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08004274 * define a complete mapping. For input values between control points,
4275 * the camera device must linearly interpolate between the control
4276 * points.</p>
4277 * <p>Each curve can have an independent number of points, and the number
4278 * of points can be less than max (that is, the request doesn't have to
4279 * always provide a curve with number of points equivalent to
4280 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07004281 * <p>For devices with MONOCHROME capability, all three channels must have the same set of
4282 * control points.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08004283 * <p>A few examples, and their corresponding graphical mappings; these
4284 * only specify the red channel and the precision is limited to 4
4285 * digits, for conciseness.</p>
4286 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004287 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004288 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004289 * <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 -08004290 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004291 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004292 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004293 * <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 -08004294 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004295 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004296 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
4297 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
4298 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
4299 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004300 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004301 * <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 -08004302 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004303 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004304 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
4305 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
4306 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
4307 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004308 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004309 * <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 -07004310 * <p><b>Range of valid values:</b><br>
4311 * 0-1 on both input and output coordinates, normalized
4312 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004313 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4314 * <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 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004318 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08004319 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004320 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004321 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004322 */
4323 public static final Key<float[]> TONEMAP_CURVE_RED =
4324 new Key<float[]>("android.tonemap.curveRed", float[].class);
4325
4326 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004327 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
4328 * is CONTRAST_CURVE.</p>
4329 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
4330 * channels respectively. The following example uses the red channel as an
4331 * example. The same logic applies to green and blue channel.
4332 * Each channel's curve is defined by an array of control points:</p>
4333 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004334 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004335 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
4336 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
4337 * guaranteed that input values 0.0 and 1.0 are included in the list to
4338 * define a complete mapping. For input values between control points,
4339 * the camera device must linearly interpolate between the control
4340 * points.</p>
4341 * <p>Each curve can have an independent number of points, and the number
4342 * of points can be less than max (that is, the request doesn't have to
4343 * always provide a curve with number of points equivalent to
4344 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07004345 * <p>For devices with MONOCHROME capability, all three channels must have the same set of
4346 * control points.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004347 * <p>A few examples, and their corresponding graphical mappings; these
4348 * only specify the red channel and the precision is limited to 4
4349 * digits, for conciseness.</p>
4350 * <p>Linear mapping:</p>
4351 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
4352 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004353 * <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 -07004354 * <p>Invert mapping:</p>
4355 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
4356 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004357 * <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 -07004358 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
4359 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004360 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
4361 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
4362 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
4363 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004364 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004365 * <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 -07004366 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
4367 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004368 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
4369 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
4370 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
4371 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004372 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004373 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004374 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4375 * <p><b>Full capability</b> -
4376 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4377 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004378 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004379 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004380 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
4381 * @see CaptureRequest#TONEMAP_MODE
4382 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004383 @PublicKey
4384 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004385 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
4386 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
4387
4388 /**
Igor Murashkine0060932014-01-17 17:24:11 -08004389 * <p>High-level global contrast/gamma/tonemapping control.</p>
4390 * <p>When switching to an application-defined contrast curve by setting
4391 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
4392 * per-channel with a set of <code>(in, out)</code> points that specify the
4393 * mapping from input high-bit-depth pixel value to the output
4394 * low-bit-depth value. Since the actual pixel ranges of both input
4395 * and output may change depending on the camera pipeline, the values
4396 * are specified by normalized floating-point numbers.</p>
4397 * <p>More-complex color mapping operations such as 3D color look-up
4398 * tables, selective chroma enhancement, or other non-linear color
4399 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4400 * CONTRAST_CURVE.</p>
4401 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004402 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08004403 * These values are always available, and as close as possible to the
4404 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07004405 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08004406 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
4407 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004408 * <p><b>Possible values:</b>
4409 * <ul>
4410 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
4411 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
4412 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004413 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
4414 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004415 * </ul></p>
4416 * <p><b>Available values for this device:</b><br>
4417 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004418 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4419 * <p><b>Full capability</b> -
4420 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4421 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08004422 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004423 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08004424 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004425 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08004426 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004427 * @see #TONEMAP_MODE_CONTRAST_CURVE
4428 * @see #TONEMAP_MODE_FAST
4429 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004430 * @see #TONEMAP_MODE_GAMMA_VALUE
4431 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004432 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004433 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004434 public static final Key<Integer> TONEMAP_MODE =
4435 new Key<Integer>("android.tonemap.mode", int.class);
4436
4437 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004438 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4439 * GAMMA_VALUE</p>
4440 * <p>The tonemap curve will be defined the following formula:
4441 * * OUT = pow(IN, 1.0 / gamma)
4442 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
4443 * pow is the power function and gamma is the gamma value specified by this
4444 * key.</p>
4445 * <p>The same curve will be applied to all color channels. The camera device
4446 * may clip the input gamma value to its supported range. The actual applied
4447 * value will be returned in capture result.</p>
4448 * <p>The valid range of gamma value varies on different devices, but values
4449 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
4450 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4451 *
4452 * @see CaptureRequest#TONEMAP_MODE
4453 */
4454 @PublicKey
4455 public static final Key<Float> TONEMAP_GAMMA =
4456 new Key<Float>("android.tonemap.gamma", float.class);
4457
4458 /**
4459 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4460 * PRESET_CURVE</p>
4461 * <p>The tonemap curve will be defined by specified standard.</p>
4462 * <p>sRGB (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004463 * <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 -08004464 * <p>Rec. 709 (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004465 * <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 -08004466 * <p>Note that above figures show a 16 control points approximation of preset
4467 * curves. Camera devices may apply a different approximation to the curve.</p>
4468 * <p><b>Possible values:</b>
4469 * <ul>
4470 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
4471 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
4472 * </ul></p>
4473 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4474 *
4475 * @see CaptureRequest#TONEMAP_MODE
4476 * @see #TONEMAP_PRESET_CURVE_SRGB
4477 * @see #TONEMAP_PRESET_CURVE_REC709
4478 */
4479 @PublicKey
4480 public static final Key<Integer> TONEMAP_PRESET_CURVE =
4481 new Key<Integer>("android.tonemap.presetCurve", int.class);
4482
4483 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004484 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004485 * that the camera is powered on and may be streaming images back to the
4486 * Application Processor. In certain rare circumstances, the OS may
4487 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08004488 * any untrusted applications.</p>
4489 * <p>In particular, the LED <em>must</em> always be on when the data could be
4490 * transmitted off the device. The LED <em>should</em> always be on whenever
4491 * data is stored locally on the device.</p>
4492 * <p>The LED <em>may</em> be off if a trusted application is using the data that
4493 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004494 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004495 * @hide
4496 */
4497 public static final Key<Boolean> LED_TRANSMIT =
4498 new Key<Boolean>("android.led.transmit", boolean.class);
4499
4500 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004501 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08004502 * to its current values, or is free to vary.</p>
4503 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004504 * 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 -08004505 * a change in other capture settings forced the camera device to
4506 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004507 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4508 * <p><b>Full capability</b> -
4509 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4510 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004511 *
4512 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004513 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004514 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004515 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004516 public static final Key<Boolean> BLACK_LEVEL_LOCK =
4517 new Key<Boolean>("android.blackLevel.lock", boolean.class);
4518
Igor Murashkin3865a842014-01-17 18:18:39 -08004519 /**
4520 * <p>The frame number corresponding to the last request
4521 * with which the output result (metadata + buffers) has been fully
4522 * synchronized.</p>
4523 * <p>When a request is submitted to the camera device, there is usually a
4524 * delay of several frames before the controls get applied. A camera
4525 * device may either choose to account for this delay by implementing a
4526 * pipeline and carefully submit well-timed atomic control updates, or
4527 * it may start streaming control changes that span over several frame
4528 * boundaries.</p>
4529 * <p>In the latter case, whenever a request's settings change relative to
4530 * the previous submitted request, the full set of changes may take
4531 * multiple frame durations to fully take effect. Some settings may
4532 * take effect sooner (in less frame durations) than others.</p>
4533 * <p>While a set of control changes are being propagated, this value
4534 * will be CONVERGING.</p>
4535 * <p>Once it is fully known that a set of control changes have been
4536 * finished propagating, and the resulting updated control settings
4537 * have been read back by the camera device, this value will be set
4538 * to a non-negative frame number (corresponding to the request to
4539 * which the results have synchronized to).</p>
4540 * <p>Older camera device implementations may not have a way to detect
4541 * when all camera controls have been applied, and will always set this
4542 * value to UNKNOWN.</p>
4543 * <p>FULL capability devices will always have this value set to the
4544 * frame number of the request corresponding to this result.</p>
4545 * <p><em>Further details</em>:</p>
4546 * <ul>
4547 * <li>Whenever a request differs from the last request, any future
4548 * results not yet returned may have this value set to CONVERGING (this
4549 * could include any in-progress captures not yet returned by the camera
4550 * device, for more details see pipeline considerations below).</li>
4551 * <li>Submitting a series of multiple requests that differ from the
4552 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
4553 * moves the new synchronization frame to the last non-repeating
4554 * request (using the smallest frame number from the contiguous list of
4555 * repeating requests).</li>
4556 * <li>Submitting the same request repeatedly will not change this value
4557 * to CONVERGING, if it was already a non-negative value.</li>
4558 * <li>When this value changes to non-negative, that means that all of the
4559 * metadata controls from the request have been applied, all of the
4560 * metadata controls from the camera device have been read to the
4561 * updated values (into the result), and all of the graphics buffers
4562 * corresponding to this result are also synchronized to the request.</li>
4563 * </ul>
4564 * <p><em>Pipeline considerations</em>:</p>
4565 * <p>Submitting a request with updated controls relative to the previously
4566 * submitted requests may also invalidate the synchronization state
4567 * of all the results corresponding to currently in-flight requests.</p>
4568 * <p>In other words, results for this current request and up to
4569 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
4570 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004571 * <p><b>Possible values:</b>
4572 * <ul>
4573 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
4574 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
4575 * </ul></p>
4576 * <p><b>Available values for this device:</b><br>
4577 * Either a non-negative value corresponding to a
4578 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004579 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08004580 *
4581 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
4582 * @see #SYNC_FRAME_NUMBER_CONVERGING
4583 * @see #SYNC_FRAME_NUMBER_UNKNOWN
4584 * @hide
4585 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07004586 public static final Key<Long> SYNC_FRAME_NUMBER =
4587 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08004588
Zhijun He0e99c222015-01-29 15:26:05 -08004589 /**
4590 * <p>The amount of exposure time increase factor applied to the original output
4591 * frame by the application processing before sending for reprocessing.</p>
4592 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
4593 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
4594 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
4595 * output frames to effectively reduce the noise to the same level as a frame that was
4596 * captured with longer exposure time. To be more specific, assuming the original captured
4597 * images were captured with a sensitivity of S and an exposure time of T, the model in
4598 * the camera device is that the amount of noise in the image would be approximately what
4599 * would be expected if the original capture parameters had been a sensitivity of
4600 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
4601 * than S and T respectively. If the captured images were processed by the application
4602 * before being sent for reprocessing, then the application may have used image processing
4603 * algorithms and/or multi-frame image fusion to reduce the noise in the
4604 * application-processed images (input images). By using the effectiveExposureFactor
4605 * control, the application can communicate to the camera device the actual noise level
4606 * improvement in the application-processed image. With this information, the camera
4607 * device can select appropriate noise reduction and edge enhancement parameters to avoid
4608 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
4609 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
4610 * <p>For example, for multi-frame image fusion use case, the application may fuse
4611 * multiple output frames together to a final frame for reprocessing. When N image are
4612 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
4613 * square root of N (based on a simple photon shot noise model). The camera device will
4614 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
4615 * produce the best quality images.</p>
4616 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
4617 * buffer in a way that affects its effective exposure time.</p>
4618 * <p>This control is only effective for YUV reprocessing capture request. For noise
4619 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
4620 * Similarly, for edge enhancement reprocessing, it is only effective when
4621 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
4622 * <p><b>Units</b>: Relative exposure time increase factor.</p>
4623 * <p><b>Range of valid values:</b><br>
4624 * &gt;= 1.0</p>
4625 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07004626 * <p><b>Limited capability</b> -
4627 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4628 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0e99c222015-01-29 15:26:05 -08004629 *
4630 * @see CaptureRequest#EDGE_MODE
Zhijun He513f7c32015-04-24 18:23:54 -07004631 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08004632 * @see CaptureRequest#NOISE_REDUCTION_MODE
4633 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
4634 */
4635 @PublicKey
4636 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
4637 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
4638
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004639 /**
Shuzhen Wang61aaa322018-11-19 16:04:57 -08004640 * <p>String containing the ID of the underlying active physical camera.</p>
4641 * <p>The ID of the active physical camera that's backing the logical camera. All camera
4642 * streams and metadata that are not physical camera specific will be originating from this
4643 * physical camera. This must be one of valid physical IDs advertised in the physicalIds
4644 * static tag.</p>
4645 * <p>For a logical camera made up of physical cameras where each camera's lenses have
4646 * different characteristics, the camera device may choose to switch between the physical
4647 * cameras when application changes FOCAL_LENGTH or SCALER_CROP_REGION.
4648 * At the time of lens switch, this result metadata reflects the new active physical camera
4649 * ID.</p>
4650 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4651 */
4652 @PublicKey
4653 public static final Key<String> LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID =
4654 new Key<String>("android.logicalMultiCamera.activePhysicalId", String.class);
4655
4656 /**
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004657 * <p>Mode of operation for the lens distortion correction block.</p>
4658 * <p>The lens distortion correction block attempts to improve image quality by fixing
4659 * radial, tangential, or other geometric aberrations in the camera device's optics. If
4660 * available, the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} field documents the lens's distortion parameters.</p>
4661 * <p>OFF means no distortion correction is done.</p>
4662 * <p>FAST/HIGH_QUALITY both mean camera device determined distortion correction will be
4663 * applied. HIGH_QUALITY mode indicates that the camera device will use the highest-quality
4664 * correction algorithms, even if it slows down capture rate. FAST means the camera device
4665 * will not slow down capture rate when applying correction. FAST may be the same as OFF if
4666 * any correction at all would slow down capture rate. Every output stream will have a
4667 * similar amount of enhancement applied.</p>
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07004668 * <p>The correction only applies to processed outputs such as YUV, Y8, JPEG, or DEPTH16; it is
4669 * not applied to any RAW output.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004670 * <p>This control will be on by default on devices that support this control. Applications
4671 * disabling distortion correction need to pay extra attention with the coordinate system of
4672 * metering regions, crop region, and face rectangles. When distortion correction is OFF,
4673 * metadata coordinates follow the coordinate system of
4674 * {@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 -07004675 * coordinates follow the coordinate system of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}. The
4676 * camera device will map these metadata fields to match the corrected image produced by the
4677 * camera device, for both capture requests and results. However, this mapping is not very
4678 * precise, since rectangles do not generally map to rectangles when corrected. Only linear
4679 * scaling between the active array and precorrection active array coordinates is
4680 * performed. Applications that require precise correction of metadata need to undo that
4681 * linear scaling, and apply a more complete correction that takes into the account the app's
4682 * own requirements.</p>
4683 * <p>The full list of metadata that is affected in this way by distortion correction is:</p>
4684 * <ul>
4685 * <li>{@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}</li>
4686 * <li>{@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}</li>
4687 * <li>{@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}</li>
4688 * <li>{@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}</li>
4689 * <li>{@link CaptureResult#STATISTICS_FACES android.statistics.faces}</li>
4690 * </ul>
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004691 * <p><b>Possible values:</b>
4692 * <ul>
4693 * <li>{@link #DISTORTION_CORRECTION_MODE_OFF OFF}</li>
4694 * <li>{@link #DISTORTION_CORRECTION_MODE_FAST FAST}</li>
4695 * <li>{@link #DISTORTION_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
4696 * </ul></p>
4697 * <p><b>Available values for this device:</b><br>
4698 * {@link CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES android.distortionCorrection.availableModes}</p>
4699 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4700 *
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004701 * @see CaptureRequest#CONTROL_AE_REGIONS
4702 * @see CaptureRequest#CONTROL_AF_REGIONS
4703 * @see CaptureRequest#CONTROL_AWB_REGIONS
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004704 * @see CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES
4705 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004706 * @see CaptureRequest#SCALER_CROP_REGION
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004707 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
4708 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07004709 * @see CaptureResult#STATISTICS_FACES
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004710 * @see #DISTORTION_CORRECTION_MODE_OFF
4711 * @see #DISTORTION_CORRECTION_MODE_FAST
4712 * @see #DISTORTION_CORRECTION_MODE_HIGH_QUALITY
4713 */
4714 @PublicKey
4715 public static final Key<Integer> DISTORTION_CORRECTION_MODE =
4716 new Key<Integer>("android.distortionCorrection.mode", int.class);
4717
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004718 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
4719 * End generated code
4720 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07004721
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004722
4723
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08004724}