blob: 75c27f56c0a6349c24ab6360b54310950988e337 [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;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070021import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkinbdf366c2014-07-25 16:54:20 -070022import android.hardware.camera2.impl.CaptureResultExtras;
Igor Murashkin6c76f582014-07-15 17:19:49 -070023import android.hardware.camera2.impl.PublicKey;
24import android.hardware.camera2.impl.SyntheticKey;
Igor Murashkind6d65152014-05-19 16:31:02 -070025import android.hardware.camera2.utils.TypeReference;
26import android.util.Log;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070027import android.util.Rational;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080028
Igor Murashkind6d65152014-05-19 16:31:02 -070029import java.util.List;
30
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080031/**
Igor Murashkindb075af2014-05-21 10:07:08 -070032 * <p>The subset of the results of a single image capture from the image sensor.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080033 *
Igor Murashkindb075af2014-05-21 10:07:08 -070034 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080035 * flash), the processing pipeline, the control algorithms, and the output
36 * buffers.</p>
37 *
38 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
39 * {@link CaptureRequest}. All properties listed for capture requests can also
40 * be queried on the capture result, to determine the final values used for
41 * capture. The result also includes additional metadata about the state of the
42 * camera device during the capture.</p>
43 *
Igor Murashkindb075af2014-05-21 10:07:08 -070044 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
45 * are necessarily available. Some results are {@link CaptureResult partial} and will
46 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
47 * every key available that was enabled by the request.</p>
48 *
49 * <p>{@link CaptureResult} objects are immutable.</p>
Ruben Brunkf967a542014-04-28 16:31:11 -070050 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080051 */
Igor Murashkindb075af2014-05-21 10:07:08 -070052public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
Igor Murashkind6d65152014-05-19 16:31:02 -070053
54 private static final String TAG = "CaptureResult";
55 private static final boolean VERBOSE = false;
56
57 /**
58 * A {@code Key} is used to do capture result field lookups with
59 * {@link CaptureResult#get}.
60 *
61 * <p>For example, to get the timestamp corresponding to the exposure of the first row:
62 * <code><pre>
63 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
64 * </pre></code>
65 * </p>
66 *
67 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
68 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
69 *
70 * @see CaptureResult#get
71 * @see CameraCharacteristics#getAvailableCaptureResultKeys
72 */
73 public final static class Key<T> {
74 private final CameraMetadataNative.Key<T> mKey;
75
76 /**
77 * Visible for testing and vendor extensions only.
78 *
79 * @hide
80 */
Emilian Peevde62d842017-03-23 19:20:40 +000081 public Key(String name, Class<T> type, long vendorId) {
82 mKey = new CameraMetadataNative.Key<T>(name, type, vendorId);
83 }
84
85 /**
86 * Visible for testing and vendor extensions only.
87 *
88 * @hide
89 */
Justin Yunf01e40c2018-05-18 20:39:45 +090090 public Key(String name, String fallbackName, Class<T> type) {
91 mKey = new CameraMetadataNative.Key<T>(name, fallbackName, type);
92 }
93
94 /**
95 * Visible for testing and vendor extensions only.
96 *
97 * @hide
98 */
Igor Murashkind6d65152014-05-19 16:31:02 -070099 public Key(String name, Class<T> type) {
100 mKey = new CameraMetadataNative.Key<T>(name, type);
101 }
102
103 /**
104 * Visible for testing and vendor extensions only.
105 *
106 * @hide
107 */
108 public Key(String name, TypeReference<T> typeReference) {
109 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
110 }
111
112 /**
113 * Return a camelCase, period separated name formatted like:
114 * {@code "root.section[.subsections].name"}.
115 *
116 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
117 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
118 *
119 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
120 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
121 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
122 *
123 * @return String representation of the key name
124 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700125 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700126 public String getName() {
127 return mKey.getName();
128 }
129
130 /**
Emilian Peevde62d842017-03-23 19:20:40 +0000131 * Return vendor tag id.
132 *
133 * @hide
134 */
135 public long getVendorId() {
136 return mKey.getVendorId();
137 }
138
139 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700140 * {@inheritDoc}
141 */
142 @Override
143 public final int hashCode() {
144 return mKey.hashCode();
145 }
146
147 /**
148 * {@inheritDoc}
149 */
150 @SuppressWarnings("unchecked")
151 @Override
152 public final boolean equals(Object o) {
153 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
154 }
155
156 /**
Chien-Yu Chen12a83852015-07-07 12:17:22 -0700157 * Return this {@link Key} as a string representation.
158 *
159 * <p>{@code "CaptureResult.Key(%s)"}, where {@code %s} represents
160 * the name of this key as returned by {@link #getName}.</p>
161 *
162 * @return string representation of {@link Key}
163 */
164 @NonNull
165 @Override
166 public String toString() {
167 return String.format("CaptureResult.Key(%s)", mKey.getName());
168 }
169
170 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700171 * Visible for CameraMetadataNative implementation only; do not use.
172 *
173 * TODO: Make this private or remove it altogether.
174 *
175 * @hide
176 */
177 public CameraMetadataNative.Key<T> getNativeKey() {
178 return mKey;
179 }
180
181 @SuppressWarnings({ "unchecked" })
182 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
183 mKey = (CameraMetadataNative.Key<T>) nativeKey;
184 }
185 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700186
187 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700188 private final CaptureRequest mRequest;
189 private final int mSequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700190 private final long mFrameNumber;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700191
Igor Murashkin70725502013-06-25 20:27:06 +0000192 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700193 * Takes ownership of the passed-in properties object
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700194 *
195 * <p>For internal use only</p>
Igor Murashkin70725502013-06-25 20:27:06 +0000196 * @hide
197 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700198 public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
199 CaptureResultExtras extras) {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700200 if (results == null) {
201 throw new IllegalArgumentException("results was null");
202 }
203
204 if (parent == null) {
205 throw new IllegalArgumentException("parent was null");
206 }
207
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700208 if (extras == null) {
209 throw new IllegalArgumentException("extras was null");
210 }
211
Igor Murashkind6d65152014-05-19 16:31:02 -0700212 mResults = CameraMetadataNative.move(results);
213 if (mResults.isEmpty()) {
214 throw new AssertionError("Results must not be empty");
215 }
Emilian Peevde62d842017-03-23 19:20:40 +0000216 setNativeInstance(mResults);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700217 mRequest = parent;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700218 mSequenceId = extras.getRequestId();
219 mFrameNumber = extras.getFrameNumber();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700220 }
221
Ruben Brunkf967a542014-04-28 16:31:11 -0700222 /**
223 * Returns a copy of the underlying {@link CameraMetadataNative}.
224 * @hide
225 */
226 public CameraMetadataNative getNativeCopy() {
227 return new CameraMetadataNative(mResults);
228 }
229
Igor Murashkind6d65152014-05-19 16:31:02 -0700230 /**
231 * Creates a request-less result.
232 *
233 * <p><strong>For testing only.</strong></p>
234 * @hide
235 */
236 public CaptureResult(CameraMetadataNative results, int sequenceId) {
237 if (results == null) {
238 throw new IllegalArgumentException("results was null");
239 }
240
241 mResults = CameraMetadataNative.move(results);
242 if (mResults.isEmpty()) {
243 throw new AssertionError("Results must not be empty");
244 }
245
Emilian Peevde62d842017-03-23 19:20:40 +0000246 setNativeInstance(mResults);
Igor Murashkind6d65152014-05-19 16:31:02 -0700247 mRequest = null;
248 mSequenceId = sequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700249 mFrameNumber = -1;
Igor Murashkind6d65152014-05-19 16:31:02 -0700250 }
251
252 /**
253 * Get a capture result field value.
254 *
255 * <p>The field definitions can be found in {@link CaptureResult}.</p>
256 *
257 * <p>Querying the value for the same key more than once will return a value
258 * which is equal to the previous queried value.</p>
259 *
260 * @throws IllegalArgumentException if the key was not valid
261 *
262 * @param key The result field to read.
263 * @return The value of that key, or {@code null} if the field is not set.
264 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700265 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700266 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700267 T value = mResults.get(key);
268 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
269 return value;
270 }
271
272 /**
273 * {@inheritDoc}
274 * @hide
275 */
276 @SuppressWarnings("unchecked")
277 @Override
278 protected <T> T getProtected(Key<?> key) {
279 return (T) mResults.get(key);
280 }
281
282 /**
283 * {@inheritDoc}
284 * @hide
285 */
286 @SuppressWarnings("unchecked")
287 @Override
288 protected Class<Key<?>> getKeyClass() {
289 Object thisClass = Key.class;
290 return (Class<Key<?>>)thisClass;
291 }
292
293 /**
294 * Dumps the native metadata contents to logcat.
295 *
296 * <p>Visibility for testing/debugging only. The results will not
297 * include any synthesized keys, as they are invisible to the native layer.</p>
298 *
299 * @hide
300 */
301 public void dumpToLog() {
302 mResults.dumpToLog();
303 }
304
305 /**
306 * {@inheritDoc}
307 */
308 @Override
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700309 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700310 public List<Key<?>> getKeys() {
311 // Force the javadoc for this function to show up on the CaptureResult page
312 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800313 }
314
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700315 /**
316 * Get the request associated with this result.
317 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700318 * <p>Whenever a request has been fully or partially captured, with
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700319 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or
320 * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s
Igor Murashkindb075af2014-05-21 10:07:08 -0700321 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700322 * </p>
323 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700324 * <p>For example,
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700325 * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700326 * {@literal @}Override
327 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
328 * assert(myResult.getRequest.equals(myRequest) == true);
329 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700330 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700331 * </code></pre>
332 * </p>
333 *
334 * @return The request associated with this result. Never {@code null}.
335 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700336 @NonNull
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700337 public CaptureRequest getRequest() {
338 return mRequest;
339 }
340
341 /**
342 * Get the frame number associated with this result.
343 *
344 * <p>Whenever a request has been processed, regardless of failure or success,
345 * it gets a unique frame number assigned to its future result/failure.</p>
346 *
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700347 * <p>For the same type of request (capturing from the camera device or reprocessing), this
348 * value monotonically increments, starting with 0, for every new result or failure and the
349 * scope is the lifetime of the {@link CameraDevice}. Between different types of requests,
350 * the frame number may not monotonically increment. For example, the frame number of a newer
351 * reprocess result may be smaller than the frame number of an older result of capturing new
352 * images from the camera device, but the frame number of a newer reprocess result will never be
353 * smaller than the frame number of an older reprocess result.</p>
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700354 *
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700355 * @return The frame number
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700356 *
357 * @see CameraDevice#createCaptureRequest
358 * @see CameraDevice#createReprocessCaptureRequest
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700359 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700360 public long getFrameNumber() {
361 return mFrameNumber;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700362 }
363
364 /**
365 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700366 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700367 *
368 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
369 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
370 *
371 * @return int The ID for the sequence of requests that this capture result is a part of
372 *
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700373 * @see CameraDevice.CaptureCallback#onCaptureSequenceCompleted
374 * @see CameraDevice.CaptureCallback#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700375 */
376 public int getSequenceId() {
377 return mSequenceId;
378 }
379
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700380 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
381 * The key entries below this point are generated from metadata
382 * definitions in /system/media/camera/docs. Do not modify by hand or
383 * modify the comment blocks at the start or end.
384 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
385
386 /**
Zhijun He379af012014-05-06 11:54:54 -0700387 * <p>The mode control selects how the image data is converted from the
388 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700389 * <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 -0700390 * control is overridden by the AWB routine. When AWB is disabled, the
391 * application controls how the color mapping is performed.</p>
392 * <p>We define the expected processing pipeline below. For consistency
393 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
394 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
395 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
396 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
397 * camera device (in the results) and be roughly correct.</p>
398 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
399 * FAST or HIGH_QUALITY will yield a picture with the same white point
400 * as what was produced by the camera device in the earlier frame.</p>
401 * <p>The expected processing pipeline is as follows:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -0800402 * <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 -0700403 * <p>The white balance is encoded by two values, a 4-channel white-balance
404 * gain vector (applied in the Bayer domain), and a 3x3 color transform
405 * matrix (applied after demosaic).</p>
406 * <p>The 4-channel white-balance gains are defined as:</p>
407 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
408 * </code></pre>
409 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
410 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
411 * These may be identical for a given camera device implementation; if
412 * the camera device does not support a separate gain for even/odd green
413 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
414 * <code>G_even</code> in the output result metadata.</p>
415 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
416 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
417 * </code></pre>
418 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
419 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
420 * <p>with colors as follows:</p>
421 * <pre><code>r' = I0r + I1g + I2b
422 * g' = I3r + I4g + I5b
423 * b' = I6r + I7g + I8b
424 * </code></pre>
425 * <p>Both the input and output value ranges must match. Overflow/underflow
426 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700427 * <p><b>Possible values:</b>
428 * <ul>
429 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
430 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
431 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
432 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700433 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
434 * <p><b>Full capability</b> -
435 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
436 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700437 *
438 * @see CaptureRequest#COLOR_CORRECTION_GAINS
439 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
440 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700441 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700442 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
443 * @see #COLOR_CORRECTION_MODE_FAST
444 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
445 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700446 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700447 public static final Key<Integer> COLOR_CORRECTION_MODE =
448 new Key<Integer>("android.colorCorrection.mode", int.class);
449
450 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800451 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700452 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800453 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800454 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700455 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800456 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800457 * <p>In the latter case, the camera device may round the matrix to account
458 * for precision issues; the final rounded matrix should be reported back
459 * in this matrix result metadata. The transform should keep the magnitude
460 * of the output color values within <code>[0, 1.0]</code> (assuming input color
461 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800462 * <p>The valid range of each matrix element varies on different devices, but
463 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700464 * <p><b>Units</b>: Unitless scale factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700465 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
466 * <p><b>Full capability</b> -
467 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
468 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800469 *
470 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700471 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700472 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700473 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700474 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
475 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700476
477 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800478 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800479 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700480 * <p>These per-channel gains are either set by the camera device
481 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
482 * TRANSFORM_MATRIX, or directly by the application in the
483 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
484 * TRANSFORM_MATRIX.</p>
485 * <p>The gains in the result metadata are the gains actually
486 * applied by the camera device to the current frame.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800487 * <p>The valid range of gains varies on different devices, but gains
488 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
489 * device allows gains below 1.0, this is usually not recommended because
490 * this can create color artifacts.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700491 * <p><b>Units</b>: Unitless gain factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700492 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
493 * <p><b>Full capability</b> -
494 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
495 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800496 *
497 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700498 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700499 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700500 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700501 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
502 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700503
504 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700505 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700506 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
507 * can not focus on the same point after exiting from the lens. This metadata defines
508 * the high level control of chromatic aberration correction algorithm, which aims to
509 * minimize the chromatic artifacts that may occur along the object boundaries in an
510 * image.</p>
511 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
512 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
513 * use the highest-quality aberration correction algorithms, even if it slows down
514 * capture rate. FAST means the camera device will not slow down capture rate when
515 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700516 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700517 * <p><b>Possible values:</b>
518 * <ul>
519 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
520 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
521 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
522 * </ul></p>
523 * <p><b>Available values for this device:</b><br>
524 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700525 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700526 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700527 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
528 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
529 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
530 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700531 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700532 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700533 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
534 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700535
536 /**
Zhijun He379af012014-05-06 11:54:54 -0700537 * <p>The desired setting for the camera device's auto-exposure
538 * algorithm's antibanding compensation.</p>
539 * <p>Some kinds of lighting fixtures, such as some fluorescent
540 * lights, flicker at the rate of the power supply frequency
541 * (60Hz or 50Hz, depending on country). While this is
542 * typically not noticeable to a person, it can be visible to
543 * a camera device. If a camera sets its exposure time to the
544 * wrong value, the flicker may become visible in the
545 * viewfinder as flicker or in a final captured image, as a
546 * set of variable-brightness bands across the image.</p>
547 * <p>Therefore, the auto-exposure routines of camera devices
548 * include antibanding routines that ensure that the chosen
549 * exposure value will not cause such banding. The choice of
550 * exposure time depends on the rate of flicker, which the
551 * camera device can detect automatically, or the expected
552 * rate can be selected by the application using this
553 * control.</p>
554 * <p>A given camera device may not support all of the possible
555 * options for the antibanding mode. The
556 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
557 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800558 * <p>AUTO mode is the default if it is available on given
559 * camera device. When AUTO mode is not available, the
560 * default will be either 50HZ or 60HZ, and both 50HZ
561 * and 60HZ will be available.</p>
Zhijun He379af012014-05-06 11:54:54 -0700562 * <p>If manual exposure control is enabled (by setting
563 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
564 * then this setting has no effect, and the application must
565 * ensure it selects exposure times that do not cause banding
566 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
567 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700568 * <p><b>Possible values:</b>
569 * <ul>
570 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
571 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
572 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
573 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
574 * </ul></p>
575 * <p><b>Available values for this device:</b><br></p>
576 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700577 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700578 *
579 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
580 * @see CaptureRequest#CONTROL_AE_MODE
581 * @see CaptureRequest#CONTROL_MODE
582 * @see CaptureResult#STATISTICS_SCENE_FLICKER
583 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
584 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
585 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
586 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
587 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700588 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700589 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
590 new Key<Integer>("android.control.aeAntibandingMode", int.class);
591
592 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700593 * <p>Adjustment to auto-exposure (AE) target image
594 * brightness.</p>
595 * <p>The adjustment is measured as a count of steps, with the
596 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
597 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
598 * <p>For example, if the exposure value (EV) step is 0.333, '6'
599 * will mean an exposure compensation of +2 EV; -3 will mean an
600 * exposure compensation of -1 EV. One EV represents a doubling
601 * of image brightness. Note that this control will only be
602 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
603 * 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 -0700604 * <p>In the event of exposure compensation value being changed, camera device
605 * may take several frames to reach the newly requested exposure target.
606 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
607 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
608 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
609 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700610 * <p><b>Units</b>: Compensation steps</p>
611 * <p><b>Range of valid values:</b><br>
612 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700613 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700614 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700615 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
616 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700617 * @see CaptureRequest#CONTROL_AE_LOCK
618 * @see CaptureRequest#CONTROL_AE_MODE
619 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700620 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700621 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700622 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
623 new Key<Integer>("android.control.aeExposureCompensation", int.class);
624
625 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700626 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700627 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700628 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
629 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
630 * <p>Note that even when AE is locked, the flash may be fired if
631 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
632 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700633 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
634 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700635 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
636 * when AE is already locked, the camera device will not change the exposure time
637 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
638 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
639 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
Zhijun Hefa95b042015-02-09 10:40:49 -0800640 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
641 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
642 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
643 * the AE if AE is locked by the camera device internally during precapture metering
644 * sequence In other words, submitting requests with AE unlock has no effect for an
645 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
646 * will never succeed in a sequence of preview requests where AE lock is always set
647 * to <code>false</code>.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700648 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
649 * get locked do not necessarily correspond to the settings that were present in the
650 * latest capture result received from the camera device, since additional captures
651 * and AE updates may have occurred even before the result was sent out. If an
652 * application is switching between automatic and manual control and wishes to eliminate
653 * any flicker during the switch, the following procedure is recommended:</p>
654 * <ol>
655 * <li>Starting in auto-AE mode:</li>
656 * <li>Lock AE</li>
657 * <li>Wait for the first result to be output that has the AE locked</li>
658 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
659 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
660 * </ol>
Zhijun He379af012014-05-06 11:54:54 -0700661 * <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 -0700662 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700663 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700664 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700665 * @see CaptureRequest#CONTROL_AE_MODE
666 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
667 * @see CaptureResult#CONTROL_AE_STATE
668 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
669 * @see CaptureRequest#SENSOR_SENSITIVITY
670 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700671 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700672 public static final Key<Boolean> CONTROL_AE_LOCK =
673 new Key<Boolean>("android.control.aeLock", boolean.class);
674
675 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800676 * <p>The desired mode for the camera device's
677 * auto-exposure routine.</p>
678 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
679 * AUTO.</p>
680 * <p>When set to any of the ON modes, the camera device's
681 * auto-exposure routine is enabled, overriding the
682 * application's selected exposure time, sensor sensitivity,
683 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
684 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
685 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
686 * is selected, the camera device's flash unit controls are
687 * also overridden.</p>
688 * <p>The FLASH modes are only available if the camera device
689 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
690 * <p>If flash TORCH mode is desired, this field must be set to
691 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
692 * <p>When set to any of the ON modes, the values chosen by the
693 * camera device auto-exposure routine for the overridden
694 * fields for a given capture will be available in its
695 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700696 * <p><b>Possible values:</b>
697 * <ul>
698 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
699 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
700 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
701 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
702 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800703 * <li>{@link #CONTROL_AE_MODE_ON_EXTERNAL_FLASH ON_EXTERNAL_FLASH}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700704 * </ul></p>
705 * <p><b>Available values for this device:</b><br>
706 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700707 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800708 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700709 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -0800710 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800711 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
712 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800713 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
714 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800715 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800716 * @see #CONTROL_AE_MODE_OFF
717 * @see #CONTROL_AE_MODE_ON
718 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
719 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
720 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800721 * @see #CONTROL_AE_MODE_ON_EXTERNAL_FLASH
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800722 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700723 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800724 public static final Key<Integer> CONTROL_AE_MODE =
725 new Key<Integer>("android.control.aeMode", int.class);
726
727 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700728 * <p>List of metering areas to use for auto-exposure adjustment.</p>
729 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700730 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700731 * <p>The maximum number of regions supported by the device is determined by the value
732 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700733 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
734 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
735 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800736 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700737 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
738 * active pixel array.</p>
739 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
740 * system depends on the mode being set.
741 * When the distortion correction mode is OFF, the coordinate system follows
742 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
743 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
744 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
745 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
746 * pixel in the pre-correction active pixel array.
747 * When the distortion correction mode is not OFF, the coordinate system follows
748 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
749 * <code>(0, 0)</code> being the top-left pixel of the active array, and
750 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
751 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
752 * active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700753 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700754 * for every pixel in the area. This means that a large metering area
755 * with the same weight as a smaller area will have more effect in
756 * the metering result. Metering areas can partially overlap and the
757 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700758 * <p>The weights are relative to weights of other exposure metering regions, so if only one
759 * region is used, all non-zero weights will have the same effect. A region with 0
760 * weight is ignored.</p>
761 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
762 * camera device.</p>
763 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
764 * capture result metadata, the camera device will ignore the sections outside the crop
765 * region and output only the intersection rectangle as the metering region in the result
766 * metadata. If the region is entirely outside the crop region, it will be ignored and
767 * not reported in the result metadata.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700768 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
769 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
770 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700771 * <p><b>Range of valid values:</b><br>
772 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700773 * {@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}
774 * depending on distortion correction capability and mode</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700775 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800776 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700777 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700778 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800779 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800780 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -0700781 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700782 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700783 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700784 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
785 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700786
787 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700788 * <p>Range over which the auto-exposure routine can
789 * adjust the capture frame rate to maintain good
790 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700791 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700792 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
793 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
794 * <p><b>Units</b>: Frames per second (FPS)</p>
795 * <p><b>Range of valid values:</b><br>
796 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
797 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700798 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700799 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Zhijun He379af012014-05-06 11:54:54 -0700800 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700801 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He379af012014-05-06 11:54:54 -0700802 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700803 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700804 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
805 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700806
807 /**
808 * <p>Whether the camera device will trigger a precapture
809 * metering sequence when it processes this request.</p>
810 * <p>This entry is normally set to IDLE, or is not
811 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -0800812 * set to START, the camera device will trigger the auto-exposure (AE)
Zhijun He379af012014-05-06 11:54:54 -0700813 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -0800814 * <p>When set to CANCEL, the camera device will cancel any active
815 * precapture metering trigger, and return to its initial AE state.
816 * If a precapture metering sequence is already completed, and the camera
817 * device has implicitly locked the AE for subsequent still capture, the
818 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800819 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700820 * high-quality still capture for final metering decisions to
821 * be made, and for firing pre-capture flash pulses to estimate
822 * scene brightness and required final capture flash power, when
823 * the flash is enabled.</p>
824 * <p>Normally, this entry should be set to START for only a
825 * single request, and the application should wait until the
826 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800827 * <p>When a precapture metering sequence is finished, the camera device
828 * may lock the auto-exposure routine internally to be able to accurately expose the
829 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
830 * For this case, the AE may not resume normal scan if no subsequent still capture is
831 * submitted. To ensure that the AE routine restarts normal scan, the application should
832 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
833 * 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 -0800834 * still capture request after the precapture sequence completes. Alternatively, for
835 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
836 * internally locked AE if the application doesn't submit a still capture request after
837 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
838 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700839 * <p>The exact effect of auto-exposure (AE) precapture trigger
840 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700841 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
842 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700843 * <p>On LEGACY-level devices, the precapture trigger is not supported;
844 * capturing a high-resolution JPEG image will automatically trigger a
845 * precapture sequence before the high-resolution capture, including
846 * potentially firing a pre-capture flash.</p>
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -0700847 * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
848 * simultaneously is allowed. However, since these triggers often require cooperation between
849 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
850 * focus sweep), the camera device may delay acting on a later trigger until the previous
851 * trigger has been fully handled. This may lead to longer intervals between the trigger and
852 * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for
853 * example.</p>
854 * <p>If both the precapture and the auto-focus trigger are activated on the same request, then
855 * the camera device will complete them in the optimal order for that device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700856 * <p><b>Possible values:</b>
857 * <ul>
858 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
859 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -0800860 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700861 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700862 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
863 * <p><b>Limited capability</b> -
864 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
865 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700866 *
Zhijun Hedd72be52015-02-06 13:49:51 -0800867 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He379af012014-05-06 11:54:54 -0700868 * @see CaptureResult#CONTROL_AE_STATE
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -0700869 * @see CaptureRequest#CONTROL_AF_TRIGGER
Zhijun Hedd72be52015-02-06 13:49:51 -0800870 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700871 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700872 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
873 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -0800874 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Zhijun He379af012014-05-06 11:54:54 -0700875 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700876 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700877 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
878 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
879
880 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700881 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800882 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
883 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
884 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
885 * the algorithm states to INACTIVE.</p>
886 * <p>The camera device can do several state transitions between two results, if it is
887 * allowed by the state transition table. For example: INACTIVE may never actually be
888 * seen in a result.</p>
889 * <p>The state in the result is the state for this image (in sync with this image): if
890 * AE state becomes CONVERGED, then the image data associated with this result should
891 * be good to use.</p>
892 * <p>Below are state transition tables for different AE modes.</p>
893 * <table>
894 * <thead>
895 * <tr>
896 * <th align="center">State</th>
897 * <th align="center">Transition Cause</th>
898 * <th align="center">New State</th>
899 * <th align="center">Notes</th>
900 * </tr>
901 * </thead>
902 * <tbody>
903 * <tr>
904 * <td align="center">INACTIVE</td>
905 * <td align="center"></td>
906 * <td align="center">INACTIVE</td>
907 * <td align="center">Camera device auto exposure algorithm is disabled</td>
908 * </tr>
909 * </tbody>
910 * </table>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800911 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON*:</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800912 * <table>
913 * <thead>
914 * <tr>
915 * <th align="center">State</th>
916 * <th align="center">Transition Cause</th>
917 * <th align="center">New State</th>
918 * <th align="center">Notes</th>
919 * </tr>
920 * </thead>
921 * <tbody>
922 * <tr>
923 * <td align="center">INACTIVE</td>
924 * <td align="center">Camera device initiates AE scan</td>
925 * <td align="center">SEARCHING</td>
926 * <td align="center">Values changing</td>
927 * </tr>
928 * <tr>
929 * <td align="center">INACTIVE</td>
930 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
931 * <td align="center">LOCKED</td>
932 * <td align="center">Values locked</td>
933 * </tr>
934 * <tr>
935 * <td align="center">SEARCHING</td>
936 * <td align="center">Camera device finishes AE scan</td>
937 * <td align="center">CONVERGED</td>
938 * <td align="center">Good values, not changing</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">FLASH_REQUIRED</td>
944 * <td align="center">Converged but too dark w/o flash</td>
945 * </tr>
946 * <tr>
947 * <td align="center">SEARCHING</td>
948 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
949 * <td align="center">LOCKED</td>
950 * <td align="center">Values locked</td>
951 * </tr>
952 * <tr>
953 * <td align="center">CONVERGED</td>
954 * <td align="center">Camera device initiates AE scan</td>
955 * <td align="center">SEARCHING</td>
956 * <td align="center">Values changing</td>
957 * </tr>
958 * <tr>
959 * <td align="center">CONVERGED</td>
960 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
961 * <td align="center">LOCKED</td>
962 * <td align="center">Values locked</td>
963 * </tr>
964 * <tr>
965 * <td align="center">FLASH_REQUIRED</td>
966 * <td align="center">Camera device initiates AE scan</td>
967 * <td align="center">SEARCHING</td>
968 * <td align="center">Values changing</td>
969 * </tr>
970 * <tr>
971 * <td align="center">FLASH_REQUIRED</td>
972 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
973 * <td align="center">LOCKED</td>
974 * <td align="center">Values locked</td>
975 * </tr>
976 * <tr>
977 * <td align="center">LOCKED</td>
978 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
979 * <td align="center">SEARCHING</td>
980 * <td align="center">Values not good after unlock</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">CONVERGED</td>
986 * <td align="center">Values 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">FLASH_REQUIRED</td>
992 * <td align="center">Exposure good, but too dark</td>
993 * </tr>
994 * <tr>
995 * <td align="center">PRECAPTURE</td>
996 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
997 * <td align="center">CONVERGED</td>
998 * <td align="center">Ready for high-quality capture</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 ON</td>
1003 * <td align="center">LOCKED</td>
1004 * <td align="center">Ready for high-quality capture</td>
1005 * </tr>
1006 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001007 * <td align="center">LOCKED</td>
1008 * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td>
1009 * <td align="center">LOCKED</td>
1010 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
1011 * </tr>
1012 * <tr>
1013 * <td align="center">LOCKED</td>
1014 * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</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">Any state (excluding LOCKED)</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001020 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
1021 * <td align="center">PRECAPTURE</td>
1022 * <td align="center">Start AE precapture metering sequence</td>
1023 * </tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001024 * <tr>
1025 * <td align="center">Any state (excluding LOCKED)</td>
1026 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td>
1027 * <td align="center">INACTIVE</td>
1028 * <td align="center">Currently active precapture metering sequence is canceled</td>
1029 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001030 * </tbody>
1031 * </table>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001032 * <p>If the camera device supports AE external flash mode (ON_EXTERNAL_FLASH is included in
Chien-Yu Chenc9ca7222018-03-15 11:14:29 -07001033 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}), {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} must be FLASH_REQUIRED after
1034 * the camera device finishes AE scan and it's too dark without flash.</p>
Zhijun He60b19dc2014-02-24 10:19:20 -08001035 * <p>For the above table, the camera device may skip reporting any state changes that happen
1036 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1037 * can be skipped in that manner is called a transient state.</p>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001038 * <p>For example, for above AE modes (AE_MODE_ON*), in addition to the state transitions
Zhijun He60b19dc2014-02-24 10:19:20 -08001039 * listed in above table, it is also legal for the camera device to skip one or more
1040 * transient states between two results. See below table for examples:</p>
1041 * <table>
1042 * <thead>
1043 * <tr>
1044 * <th align="center">State</th>
1045 * <th align="center">Transition Cause</th>
1046 * <th align="center">New State</th>
1047 * <th align="center">Notes</th>
1048 * </tr>
1049 * </thead>
1050 * <tbody>
1051 * <tr>
1052 * <td align="center">INACTIVE</td>
1053 * <td align="center">Camera device finished AE scan</td>
1054 * <td align="center">CONVERGED</td>
1055 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1056 * </tr>
1057 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001058 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001059 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
1060 * <td align="center">FLASH_REQUIRED</td>
1061 * <td align="center">Converged but too dark w/o flash after a precapture sequence, 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">CONVERGED</td>
1067 * <td align="center">Converged 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>
1071 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1072 * <td align="center">FLASH_REQUIRED</td>
1073 * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td>
1074 * </tr>
1075 * <tr>
1076 * <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">CONVERGED</td>
1079 * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td>
1080 * </tr>
1081 * <tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001082 * <td align="center">CONVERGED</td>
1083 * <td align="center">Camera device finished AE scan</td>
1084 * <td align="center">FLASH_REQUIRED</td>
1085 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
1086 * </tr>
1087 * <tr>
1088 * <td align="center">FLASH_REQUIRED</td>
1089 * <td align="center">Camera device finished AE scan</td>
1090 * <td align="center">CONVERGED</td>
1091 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
1092 * </tr>
1093 * </tbody>
1094 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001095 * <p><b>Possible values:</b>
1096 * <ul>
1097 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
1098 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
1099 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
1100 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
1101 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
1102 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
1103 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001104 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1105 * <p><b>Limited capability</b> -
1106 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1107 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001108 *
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001109 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He228f4f92014-01-16 17:22:05 -08001110 * @see CaptureRequest#CONTROL_AE_LOCK
1111 * @see CaptureRequest#CONTROL_AE_MODE
1112 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Chien-Yu Chenc9ca7222018-03-15 11:14:29 -07001113 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He228f4f92014-01-16 17:22:05 -08001114 * @see CaptureRequest#CONTROL_MODE
1115 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001116 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001117 * @see #CONTROL_AE_STATE_INACTIVE
1118 * @see #CONTROL_AE_STATE_SEARCHING
1119 * @see #CONTROL_AE_STATE_CONVERGED
1120 * @see #CONTROL_AE_STATE_LOCKED
1121 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
1122 * @see #CONTROL_AE_STATE_PRECAPTURE
1123 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001124 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001125 public static final Key<Integer> CONTROL_AE_STATE =
1126 new Key<Integer>("android.control.aeState", int.class);
1127
1128 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001129 * <p>Whether auto-focus (AF) is currently enabled, and what
1130 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001131 * <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 -08001132 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1133 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1134 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1135 * 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 -08001136 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001137 * 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 -07001138 * in result metadata.</p>
1139 * <p><b>Possible values:</b>
1140 * <ul>
1141 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1142 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1143 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1144 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1145 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1146 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1147 * </ul></p>
1148 * <p><b>Available values for this device:</b><br>
1149 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1150 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001151 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001152 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001153 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001154 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001155 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001156 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001157 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001158 * @see #CONTROL_AF_MODE_OFF
1159 * @see #CONTROL_AF_MODE_AUTO
1160 * @see #CONTROL_AF_MODE_MACRO
1161 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1162 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1163 * @see #CONTROL_AF_MODE_EDOF
1164 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001165 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001166 public static final Key<Integer> CONTROL_AF_MODE =
1167 new Key<Integer>("android.control.afMode", int.class);
1168
1169 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001170 * <p>List of metering areas to use for auto-focus.</p>
1171 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001172 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001173 * <p>The maximum number of focus areas supported by the device is determined by the value
1174 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001175 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1176 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
1177 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001178 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001179 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1180 * active pixel array.</p>
1181 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1182 * system depends on the mode being set.
1183 * When the distortion correction mode is OFF, the coordinate system follows
1184 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
1185 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
1186 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
1187 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
1188 * pixel in the pre-correction active pixel array.
1189 * When the distortion correction mode is not OFF, the coordinate system follows
1190 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
1191 * <code>(0, 0)</code> being the top-left pixel of the active array, and
1192 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1193 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1194 * active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001195 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001196 * for every pixel in the area. This means that a large metering area
1197 * with the same weight as a smaller area will have more effect in
1198 * the metering result. Metering areas can partially overlap and the
1199 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001200 * <p>The weights are relative to weights of other metering regions, so if only one region
1201 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1202 * ignored.</p>
1203 * <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 -08001204 * camera device. The capture result will either be a zero weight region as well, or
1205 * the region selected by the camera device as the focus area of interest.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001206 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1207 * capture result metadata, the camera device will ignore the sections outside the crop
1208 * region and output only the intersection rectangle as the metering region in the result
1209 * metadata. If the region is entirely outside the crop region, it will be ignored and
1210 * not reported in the result metadata.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001211 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
1212 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
1213 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001214 * <p><b>Range of valid values:</b><br>
1215 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001216 * {@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}
1217 * depending on distortion correction capability and mode</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001218 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001219 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001220 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001221 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001222 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001223 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001224 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001225 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001226 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001227 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1228 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001229
1230 /**
Zhijun He379af012014-05-06 11:54:54 -07001231 * <p>Whether the camera device will trigger autofocus for this request.</p>
1232 * <p>This entry is normally set to IDLE, or is not
1233 * included at all in the request settings.</p>
1234 * <p>When included and set to START, the camera device will trigger the
1235 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1236 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1237 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001238 * <p>Generally, applications should set this entry to START or CANCEL for only a
1239 * single capture, and then return it to IDLE (or not set at all). Specifying
1240 * START for multiple captures in a row means restarting the AF operation over
1241 * and over again.</p>
1242 * <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 -07001243 * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
1244 * simultaneously is allowed. However, since these triggers often require cooperation between
1245 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1246 * focus sweep), the camera device may delay acting on a later trigger until the previous
1247 * trigger has been fully handled. This may lead to longer intervals between the trigger and
1248 * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001249 * <p><b>Possible values:</b>
1250 * <ul>
1251 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1252 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1253 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1254 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001255 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001256 *
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001257 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Zhijun He379af012014-05-06 11:54:54 -07001258 * @see CaptureResult#CONTROL_AF_STATE
1259 * @see #CONTROL_AF_TRIGGER_IDLE
1260 * @see #CONTROL_AF_TRIGGER_START
1261 * @see #CONTROL_AF_TRIGGER_CANCEL
1262 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001263 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001264 public static final Key<Integer> CONTROL_AF_TRIGGER =
1265 new Key<Integer>("android.control.afTrigger", int.class);
1266
1267 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001268 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001269 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1270 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1271 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1272 * the algorithm states to INACTIVE.</p>
1273 * <p>The camera device can do several state transitions between two results, if it is
1274 * allowed by the state transition table. For example: INACTIVE may never actually be
1275 * seen in a result.</p>
1276 * <p>The state in the result is the state for this image (in sync with this image): if
1277 * AF state becomes FOCUSED, then the image data associated with this result should
1278 * be sharp.</p>
1279 * <p>Below are state transition tables for different AF modes.</p>
1280 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1281 * <table>
1282 * <thead>
1283 * <tr>
1284 * <th align="center">State</th>
1285 * <th align="center">Transition Cause</th>
1286 * <th align="center">New State</th>
1287 * <th align="center">Notes</th>
1288 * </tr>
1289 * </thead>
1290 * <tbody>
1291 * <tr>
1292 * <td align="center">INACTIVE</td>
1293 * <td align="center"></td>
1294 * <td align="center">INACTIVE</td>
1295 * <td align="center">Never changes</td>
1296 * </tr>
1297 * </tbody>
1298 * </table>
1299 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1300 * <table>
1301 * <thead>
1302 * <tr>
1303 * <th align="center">State</th>
1304 * <th align="center">Transition Cause</th>
1305 * <th align="center">New State</th>
1306 * <th align="center">Notes</th>
1307 * </tr>
1308 * </thead>
1309 * <tbody>
1310 * <tr>
1311 * <td align="center">INACTIVE</td>
1312 * <td align="center">AF_TRIGGER</td>
1313 * <td align="center">ACTIVE_SCAN</td>
1314 * <td align="center">Start AF sweep, Lens now moving</td>
1315 * </tr>
1316 * <tr>
1317 * <td align="center">ACTIVE_SCAN</td>
1318 * <td align="center">AF sweep done</td>
1319 * <td align="center">FOCUSED_LOCKED</td>
1320 * <td align="center">Focused, Lens now locked</td>
1321 * </tr>
1322 * <tr>
1323 * <td align="center">ACTIVE_SCAN</td>
1324 * <td align="center">AF sweep done</td>
1325 * <td align="center">NOT_FOCUSED_LOCKED</td>
1326 * <td align="center">Not focused, Lens now locked</td>
1327 * </tr>
1328 * <tr>
1329 * <td align="center">ACTIVE_SCAN</td>
1330 * <td align="center">AF_CANCEL</td>
1331 * <td align="center">INACTIVE</td>
1332 * <td align="center">Cancel/reset AF, Lens now locked</td>
1333 * </tr>
1334 * <tr>
1335 * <td align="center">FOCUSED_LOCKED</td>
1336 * <td align="center">AF_CANCEL</td>
1337 * <td align="center">INACTIVE</td>
1338 * <td align="center">Cancel/reset AF</td>
1339 * </tr>
1340 * <tr>
1341 * <td align="center">FOCUSED_LOCKED</td>
1342 * <td align="center">AF_TRIGGER</td>
1343 * <td align="center">ACTIVE_SCAN</td>
1344 * <td align="center">Start new sweep, Lens now moving</td>
1345 * </tr>
1346 * <tr>
1347 * <td align="center">NOT_FOCUSED_LOCKED</td>
1348 * <td align="center">AF_CANCEL</td>
1349 * <td align="center">INACTIVE</td>
1350 * <td align="center">Cancel/reset AF</td>
1351 * </tr>
1352 * <tr>
1353 * <td align="center">NOT_FOCUSED_LOCKED</td>
1354 * <td align="center">AF_TRIGGER</td>
1355 * <td align="center">ACTIVE_SCAN</td>
1356 * <td align="center">Start new sweep, Lens now moving</td>
1357 * </tr>
1358 * <tr>
1359 * <td align="center">Any state</td>
1360 * <td align="center">Mode change</td>
1361 * <td align="center">INACTIVE</td>
1362 * <td align="center"></td>
1363 * </tr>
1364 * </tbody>
1365 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001366 * <p>For the above table, the camera device may skip reporting any state changes that happen
1367 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1368 * can be skipped in that manner is called a transient state.</p>
1369 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1370 * state transitions listed in above table, it is also legal for the camera device to skip
1371 * one or more transient states between two results. See below table for examples:</p>
1372 * <table>
1373 * <thead>
1374 * <tr>
1375 * <th align="center">State</th>
1376 * <th align="center">Transition Cause</th>
1377 * <th align="center">New State</th>
1378 * <th align="center">Notes</th>
1379 * </tr>
1380 * </thead>
1381 * <tbody>
1382 * <tr>
1383 * <td align="center">INACTIVE</td>
1384 * <td align="center">AF_TRIGGER</td>
1385 * <td align="center">FOCUSED_LOCKED</td>
1386 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1387 * </tr>
1388 * <tr>
1389 * <td align="center">INACTIVE</td>
1390 * <td align="center">AF_TRIGGER</td>
1391 * <td align="center">NOT_FOCUSED_LOCKED</td>
1392 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1393 * </tr>
1394 * <tr>
1395 * <td align="center">FOCUSED_LOCKED</td>
1396 * <td align="center">AF_TRIGGER</td>
1397 * <td align="center">FOCUSED_LOCKED</td>
1398 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1399 * </tr>
1400 * <tr>
1401 * <td align="center">NOT_FOCUSED_LOCKED</td>
1402 * <td align="center">AF_TRIGGER</td>
1403 * <td align="center">FOCUSED_LOCKED</td>
1404 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1405 * </tr>
1406 * </tbody>
1407 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001408 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1409 * <table>
1410 * <thead>
1411 * <tr>
1412 * <th align="center">State</th>
1413 * <th align="center">Transition Cause</th>
1414 * <th align="center">New State</th>
1415 * <th align="center">Notes</th>
1416 * </tr>
1417 * </thead>
1418 * <tbody>
1419 * <tr>
1420 * <td align="center">INACTIVE</td>
1421 * <td align="center">Camera device initiates new scan</td>
1422 * <td align="center">PASSIVE_SCAN</td>
1423 * <td align="center">Start AF scan, Lens now moving</td>
1424 * </tr>
1425 * <tr>
1426 * <td align="center">INACTIVE</td>
1427 * <td align="center">AF_TRIGGER</td>
1428 * <td align="center">NOT_FOCUSED_LOCKED</td>
1429 * <td align="center">AF state query, Lens now locked</td>
1430 * </tr>
1431 * <tr>
1432 * <td align="center">PASSIVE_SCAN</td>
1433 * <td align="center">Camera device completes current scan</td>
1434 * <td align="center">PASSIVE_FOCUSED</td>
1435 * <td align="center">End AF scan, Lens now locked</td>
1436 * </tr>
1437 * <tr>
1438 * <td align="center">PASSIVE_SCAN</td>
1439 * <td align="center">Camera device fails current scan</td>
1440 * <td align="center">PASSIVE_UNFOCUSED</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">AF_TRIGGER</td>
1446 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001447 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001448 * </tr>
1449 * <tr>
1450 * <td align="center">PASSIVE_SCAN</td>
1451 * <td align="center">AF_TRIGGER</td>
1452 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001453 * <td align="center">Immediate transition, if focus is bad. 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_CANCEL</td>
1458 * <td align="center">INACTIVE</td>
1459 * <td align="center">Reset lens position, Lens now locked</td>
1460 * </tr>
1461 * <tr>
1462 * <td align="center">PASSIVE_FOCUSED</td>
1463 * <td align="center">Camera device initiates new scan</td>
1464 * <td align="center">PASSIVE_SCAN</td>
1465 * <td align="center">Start AF scan, Lens now moving</td>
1466 * </tr>
1467 * <tr>
1468 * <td align="center">PASSIVE_UNFOCUSED</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_FOCUSED</td>
1475 * <td align="center">AF_TRIGGER</td>
1476 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001477 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001478 * </tr>
1479 * <tr>
1480 * <td align="center">PASSIVE_UNFOCUSED</td>
1481 * <td align="center">AF_TRIGGER</td>
1482 * <td align="center">NOT_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">FOCUSED_LOCKED</td>
1487 * <td align="center">AF_TRIGGER</td>
1488 * <td align="center">FOCUSED_LOCKED</td>
1489 * <td align="center">No effect</td>
1490 * </tr>
1491 * <tr>
1492 * <td align="center">FOCUSED_LOCKED</td>
1493 * <td align="center">AF_CANCEL</td>
1494 * <td align="center">INACTIVE</td>
1495 * <td align="center">Restart AF scan</td>
1496 * </tr>
1497 * <tr>
1498 * <td align="center">NOT_FOCUSED_LOCKED</td>
1499 * <td align="center">AF_TRIGGER</td>
1500 * <td align="center">NOT_FOCUSED_LOCKED</td>
1501 * <td align="center">No effect</td>
1502 * </tr>
1503 * <tr>
1504 * <td align="center">NOT_FOCUSED_LOCKED</td>
1505 * <td align="center">AF_CANCEL</td>
1506 * <td align="center">INACTIVE</td>
1507 * <td align="center">Restart AF scan</td>
1508 * </tr>
1509 * </tbody>
1510 * </table>
1511 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1512 * <table>
1513 * <thead>
1514 * <tr>
1515 * <th align="center">State</th>
1516 * <th align="center">Transition Cause</th>
1517 * <th align="center">New State</th>
1518 * <th align="center">Notes</th>
1519 * </tr>
1520 * </thead>
1521 * <tbody>
1522 * <tr>
1523 * <td align="center">INACTIVE</td>
1524 * <td align="center">Camera device initiates new scan</td>
1525 * <td align="center">PASSIVE_SCAN</td>
1526 * <td align="center">Start AF scan, Lens now moving</td>
1527 * </tr>
1528 * <tr>
1529 * <td align="center">INACTIVE</td>
1530 * <td align="center">AF_TRIGGER</td>
1531 * <td align="center">NOT_FOCUSED_LOCKED</td>
1532 * <td align="center">AF state query, Lens now locked</td>
1533 * </tr>
1534 * <tr>
1535 * <td align="center">PASSIVE_SCAN</td>
1536 * <td align="center">Camera device completes current scan</td>
1537 * <td align="center">PASSIVE_FOCUSED</td>
1538 * <td align="center">End AF scan, Lens now locked</td>
1539 * </tr>
1540 * <tr>
1541 * <td align="center">PASSIVE_SCAN</td>
1542 * <td align="center">Camera device fails current scan</td>
1543 * <td align="center">PASSIVE_UNFOCUSED</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">AF_TRIGGER</td>
1549 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001550 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001551 * </tr>
1552 * <tr>
1553 * <td align="center">PASSIVE_SCAN</td>
1554 * <td align="center">AF_TRIGGER</td>
1555 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001556 * <td align="center">Eventual transition if cannot find focus. 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_CANCEL</td>
1561 * <td align="center">INACTIVE</td>
1562 * <td align="center">Reset lens position, Lens now locked</td>
1563 * </tr>
1564 * <tr>
1565 * <td align="center">PASSIVE_FOCUSED</td>
1566 * <td align="center">Camera device initiates new scan</td>
1567 * <td align="center">PASSIVE_SCAN</td>
1568 * <td align="center">Start AF scan, Lens now moving</td>
1569 * </tr>
1570 * <tr>
1571 * <td align="center">PASSIVE_UNFOCUSED</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_FOCUSED</td>
1578 * <td align="center">AF_TRIGGER</td>
1579 * <td align="center">FOCUSED_LOCKED</td>
1580 * <td align="center">Immediate trans. Lens now locked</td>
1581 * </tr>
1582 * <tr>
1583 * <td align="center">PASSIVE_UNFOCUSED</td>
1584 * <td align="center">AF_TRIGGER</td>
1585 * <td align="center">NOT_FOCUSED_LOCKED</td>
1586 * <td align="center">Immediate trans. Lens now locked</td>
1587 * </tr>
1588 * <tr>
1589 * <td align="center">FOCUSED_LOCKED</td>
1590 * <td align="center">AF_TRIGGER</td>
1591 * <td align="center">FOCUSED_LOCKED</td>
1592 * <td align="center">No effect</td>
1593 * </tr>
1594 * <tr>
1595 * <td align="center">FOCUSED_LOCKED</td>
1596 * <td align="center">AF_CANCEL</td>
1597 * <td align="center">INACTIVE</td>
1598 * <td align="center">Restart AF scan</td>
1599 * </tr>
1600 * <tr>
1601 * <td align="center">NOT_FOCUSED_LOCKED</td>
1602 * <td align="center">AF_TRIGGER</td>
1603 * <td align="center">NOT_FOCUSED_LOCKED</td>
1604 * <td align="center">No effect</td>
1605 * </tr>
1606 * <tr>
1607 * <td align="center">NOT_FOCUSED_LOCKED</td>
1608 * <td align="center">AF_CANCEL</td>
1609 * <td align="center">INACTIVE</td>
1610 * <td align="center">Restart AF scan</td>
1611 * </tr>
1612 * </tbody>
1613 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001614 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1615 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1616 * camera device. When a trigger is included in a mode switch request, the trigger
1617 * will be evaluated in the context of the new mode in the request.
1618 * See below table for examples:</p>
1619 * <table>
1620 * <thead>
1621 * <tr>
1622 * <th align="center">State</th>
1623 * <th align="center">Transition Cause</th>
1624 * <th align="center">New State</th>
1625 * <th align="center">Notes</th>
1626 * </tr>
1627 * </thead>
1628 * <tbody>
1629 * <tr>
1630 * <td align="center">any state</td>
1631 * <td align="center">CAF--&gt;AUTO mode switch</td>
1632 * <td align="center">INACTIVE</td>
1633 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1634 * </tr>
1635 * <tr>
1636 * <td align="center">any state</td>
1637 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1638 * <td align="center">trigger-reachable states from INACTIVE</td>
1639 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1640 * </tr>
1641 * <tr>
1642 * <td align="center">any state</td>
1643 * <td align="center">AUTO--&gt;CAF mode switch</td>
1644 * <td align="center">passively reachable states from INACTIVE</td>
1645 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1646 * </tr>
1647 * </tbody>
1648 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001649 * <p><b>Possible values:</b>
1650 * <ul>
1651 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1652 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1653 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1654 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1655 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1656 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1657 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1658 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001659 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001660 *
1661 * @see CaptureRequest#CONTROL_AF_MODE
1662 * @see CaptureRequest#CONTROL_MODE
1663 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001664 * @see #CONTROL_AF_STATE_INACTIVE
1665 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1666 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1667 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1668 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1669 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001670 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001671 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001672 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001673 public static final Key<Integer> CONTROL_AF_STATE =
1674 new Key<Integer>("android.control.afState", int.class);
1675
1676 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001677 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001678 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001679 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1680 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1681 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1682 * get locked do not necessarily correspond to the settings that were present in the
1683 * latest capture result received from the camera device, since additional captures
1684 * and AWB updates may have occurred even before the result was sent out. If an
1685 * application is switching between automatic and manual control and wishes to eliminate
1686 * any flicker during the switch, the following procedure is recommended:</p>
1687 * <ol>
1688 * <li>Starting in auto-AWB mode:</li>
1689 * <li>Lock AWB</li>
1690 * <li>Wait for the first result to be output that has the AWB locked</li>
1691 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1692 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1693 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001694 * <p>Note that AWB lock is only meaningful when
1695 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1696 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001697 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1698 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001699 *
1700 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001701 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001702 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001703 public static final Key<Boolean> CONTROL_AWB_LOCK =
1704 new Key<Boolean>("android.control.awbLock", boolean.class);
1705
1706 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001707 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001708 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001709 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001710 * <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 -07001711 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001712 * routine is enabled, overriding the application's selected
1713 * {@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 -08001714 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1715 * is OFF, the behavior of AWB is device dependent. It is recommened to
1716 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1717 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001718 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001719 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001720 * 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 -08001721 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001722 * <p>When set to any other modes, the camera device's auto-white
1723 * balance routine is disabled. The camera device uses each
1724 * particular illumination target for white balance
1725 * adjustment. The application's values for
1726 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1727 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1728 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001729 * <p><b>Possible values:</b>
1730 * <ul>
1731 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1732 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1733 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1734 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1735 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1736 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1737 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1738 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1739 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1740 * </ul></p>
1741 * <p><b>Available values for this device:</b><br>
1742 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001743 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001744 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001745 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001746 * @see CaptureRequest#COLOR_CORRECTION_MODE
1747 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001748 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001749 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001750 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001751 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001752 * @see #CONTROL_AWB_MODE_OFF
1753 * @see #CONTROL_AWB_MODE_AUTO
1754 * @see #CONTROL_AWB_MODE_INCANDESCENT
1755 * @see #CONTROL_AWB_MODE_FLUORESCENT
1756 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1757 * @see #CONTROL_AWB_MODE_DAYLIGHT
1758 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1759 * @see #CONTROL_AWB_MODE_TWILIGHT
1760 * @see #CONTROL_AWB_MODE_SHADE
1761 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001762 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001763 public static final Key<Integer> CONTROL_AWB_MODE =
1764 new Key<Integer>("android.control.awbMode", int.class);
1765
1766 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001767 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001768 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001769 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001770 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001771 * <p>The maximum number of regions supported by the device is determined by the value
1772 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001773 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1774 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
1775 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001776 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001777 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1778 * active pixel array.</p>
1779 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1780 * system depends on the mode being set.
1781 * When the distortion correction mode is OFF, the coordinate system follows
1782 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
1783 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
1784 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
1785 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
1786 * pixel in the pre-correction active pixel array.
1787 * When the distortion correction mode is not OFF, the coordinate system follows
1788 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
1789 * <code>(0, 0)</code> being the top-left pixel of the active array, and
1790 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1791 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1792 * active pixel array.</p>
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001793 * <p>The weight must range from 0 to 1000, and represents a weight
1794 * for every pixel in the area. This means that a large metering area
1795 * with the same weight as a smaller area will have more effect in
1796 * the metering result. Metering areas can partially overlap and the
1797 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001798 * <p>The weights are relative to weights of other white balance metering regions, so if
1799 * only one region is used, all non-zero weights will have the same effect. A region with
1800 * 0 weight is ignored.</p>
1801 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1802 * camera device.</p>
1803 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1804 * capture result metadata, the camera device will ignore the sections outside the crop
1805 * region and output only the intersection rectangle as the metering region in the result
1806 * metadata. If the region is entirely outside the crop region, it will be ignored and
1807 * not reported in the result metadata.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001808 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
1809 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
1810 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001811 * <p><b>Range of valid values:</b><br>
1812 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001813 * {@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}
1814 * depending on distortion correction capability and mode</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001815 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001816 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001817 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001818 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001819 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001820 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001821 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001822 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001823 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001824 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1825 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001826
1827 /**
Zhijun He379af012014-05-06 11:54:54 -07001828 * <p>Information to the camera device 3A (auto-exposure,
1829 * auto-focus, auto-white balance) routines about the purpose
1830 * of this capture, to help the camera device to decide optimal 3A
1831 * strategy.</p>
1832 * <p>This control (except for MANUAL) is only effective if
1833 * <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 -08001834 * <p>All intents are supported by all devices, except that:
1835 * * ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1836 * PRIVATE_REPROCESSING or YUV_REPROCESSING.
1837 * * MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1838 * MANUAL_SENSOR.
1839 * * MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1840 * MOTION_TRACKING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001841 * <p><b>Possible values:</b>
1842 * <ul>
1843 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1844 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1845 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1846 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1847 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1848 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1849 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001850 * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001851 * </ul></p>
1852 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001853 *
1854 * @see CaptureRequest#CONTROL_MODE
1855 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1856 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1857 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1858 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1859 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1860 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1861 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1862 * @see #CONTROL_CAPTURE_INTENT_MANUAL
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001863 * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING
Zhijun He379af012014-05-06 11:54:54 -07001864 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001865 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001866 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1867 new Key<Integer>("android.control.captureIntent", int.class);
1868
1869 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001870 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001871 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1872 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1873 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1874 * the algorithm states to INACTIVE.</p>
1875 * <p>The camera device can do several state transitions between two results, if it is
1876 * allowed by the state transition table. So INACTIVE may never actually be seen in
1877 * a result.</p>
1878 * <p>The state in the result is the state for this image (in sync with this image): if
1879 * AWB state becomes CONVERGED, then the image data associated with this result should
1880 * be good to use.</p>
1881 * <p>Below are state transition tables for different AWB modes.</p>
1882 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1883 * <table>
1884 * <thead>
1885 * <tr>
1886 * <th align="center">State</th>
1887 * <th align="center">Transition Cause</th>
1888 * <th align="center">New State</th>
1889 * <th align="center">Notes</th>
1890 * </tr>
1891 * </thead>
1892 * <tbody>
1893 * <tr>
1894 * <td align="center">INACTIVE</td>
1895 * <td align="center"></td>
1896 * <td align="center">INACTIVE</td>
1897 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1898 * </tr>
1899 * </tbody>
1900 * </table>
1901 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1902 * <table>
1903 * <thead>
1904 * <tr>
1905 * <th align="center">State</th>
1906 * <th align="center">Transition Cause</th>
1907 * <th align="center">New State</th>
1908 * <th align="center">Notes</th>
1909 * </tr>
1910 * </thead>
1911 * <tbody>
1912 * <tr>
1913 * <td align="center">INACTIVE</td>
1914 * <td align="center">Camera device initiates AWB scan</td>
1915 * <td align="center">SEARCHING</td>
1916 * <td align="center">Values changing</td>
1917 * </tr>
1918 * <tr>
1919 * <td align="center">INACTIVE</td>
1920 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1921 * <td align="center">LOCKED</td>
1922 * <td align="center">Values locked</td>
1923 * </tr>
1924 * <tr>
1925 * <td align="center">SEARCHING</td>
1926 * <td align="center">Camera device finishes AWB scan</td>
1927 * <td align="center">CONVERGED</td>
1928 * <td align="center">Good values, not changing</td>
1929 * </tr>
1930 * <tr>
1931 * <td align="center">SEARCHING</td>
1932 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1933 * <td align="center">LOCKED</td>
1934 * <td align="center">Values locked</td>
1935 * </tr>
1936 * <tr>
1937 * <td align="center">CONVERGED</td>
1938 * <td align="center">Camera device initiates AWB scan</td>
1939 * <td align="center">SEARCHING</td>
1940 * <td align="center">Values changing</td>
1941 * </tr>
1942 * <tr>
1943 * <td align="center">CONVERGED</td>
1944 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1945 * <td align="center">LOCKED</td>
1946 * <td align="center">Values locked</td>
1947 * </tr>
1948 * <tr>
1949 * <td align="center">LOCKED</td>
1950 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1951 * <td align="center">SEARCHING</td>
1952 * <td align="center">Values not good after unlock</td>
1953 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001954 * </tbody>
1955 * </table>
1956 * <p>For the above table, the camera device may skip reporting any state changes that happen
1957 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1958 * can be skipped in that manner is called a transient state.</p>
1959 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1960 * listed in above table, it is also legal for the camera device to skip one or more
1961 * transient states between two results. See below table for examples:</p>
1962 * <table>
1963 * <thead>
1964 * <tr>
1965 * <th align="center">State</th>
1966 * <th align="center">Transition Cause</th>
1967 * <th align="center">New State</th>
1968 * <th align="center">Notes</th>
1969 * </tr>
1970 * </thead>
1971 * <tbody>
1972 * <tr>
1973 * <td align="center">INACTIVE</td>
1974 * <td align="center">Camera device finished AWB scan</td>
1975 * <td align="center">CONVERGED</td>
1976 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1977 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001978 * <tr>
1979 * <td align="center">LOCKED</td>
1980 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1981 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001982 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001983 * </tr>
1984 * </tbody>
1985 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001986 * <p><b>Possible values:</b>
1987 * <ul>
1988 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1989 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1990 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1991 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1992 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001993 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1994 * <p><b>Limited capability</b> -
1995 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1996 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001997 *
1998 * @see CaptureRequest#CONTROL_AWB_LOCK
1999 * @see CaptureRequest#CONTROL_AWB_MODE
2000 * @see CaptureRequest#CONTROL_MODE
2001 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002002 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002003 * @see #CONTROL_AWB_STATE_INACTIVE
2004 * @see #CONTROL_AWB_STATE_SEARCHING
2005 * @see #CONTROL_AWB_STATE_CONVERGED
2006 * @see #CONTROL_AWB_STATE_LOCKED
2007 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002008 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002009 public static final Key<Integer> CONTROL_AWB_STATE =
2010 new Key<Integer>("android.control.awbState", int.class);
2011
2012 /**
Zhijun He379af012014-05-06 11:54:54 -07002013 * <p>A special color effect to apply.</p>
2014 * <p>When this mode is set, a color effect will be applied
2015 * to images produced by the camera device. The interpretation
2016 * and implementation of these color effects is left to the
2017 * implementor of the camera device, and should not be
2018 * depended on to be consistent (or present) across all
2019 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002020 * <p><b>Possible values:</b>
2021 * <ul>
2022 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
2023 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
2024 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
2025 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
2026 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
2027 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
2028 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
2029 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
2030 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
2031 * </ul></p>
2032 * <p><b>Available values for this device:</b><br>
2033 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002034 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002035 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002036 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07002037 * @see #CONTROL_EFFECT_MODE_OFF
2038 * @see #CONTROL_EFFECT_MODE_MONO
2039 * @see #CONTROL_EFFECT_MODE_NEGATIVE
2040 * @see #CONTROL_EFFECT_MODE_SOLARIZE
2041 * @see #CONTROL_EFFECT_MODE_SEPIA
2042 * @see #CONTROL_EFFECT_MODE_POSTERIZE
2043 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
2044 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
2045 * @see #CONTROL_EFFECT_MODE_AQUA
2046 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002047 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002048 public static final Key<Integer> CONTROL_EFFECT_MODE =
2049 new Key<Integer>("android.control.effectMode", int.class);
2050
2051 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002052 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08002053 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002054 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08002055 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08002056 * capture parameters itself.</p>
2057 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002058 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08002059 * <p>When set to USE_SCENE_MODE, the individual controls in
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002060 * android.control.* are mostly disabled, and the camera device
2061 * implements one of the scene mode settings (such as ACTION,
2062 * SUNSET, or PARTY) as it wishes. The camera device scene mode
2063 * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08002064 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
2065 * is that this frame will not be used by camera device background 3A statistics
2066 * update, as if this frame is never captured. This mode can be used in the scenario
2067 * where the application doesn't want a 3A manual control capture to affect
2068 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002069 * <p><b>Possible values:</b>
2070 * <ul>
2071 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
2072 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
2073 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
2074 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
2075 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002076 * <p><b>Available values for this device:</b><br>
2077 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002078 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002079 *
2080 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002081 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002082 * @see #CONTROL_MODE_OFF
2083 * @see #CONTROL_MODE_AUTO
2084 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08002085 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002086 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002087 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002088 public static final Key<Integer> CONTROL_MODE =
2089 new Key<Integer>("android.control.mode", int.class);
2090
2091 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002092 * <p>Control for which scene mode is currently active.</p>
2093 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
2094 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07002095 * <p>This is the mode that that is active when
Zhijun Heee2ebde2015-06-16 19:58:11 -07002096 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
2097 * 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}
2098 * while in use.</p>
Zhijun He379af012014-05-06 11:54:54 -07002099 * <p>The interpretation and implementation of these scene modes is left
2100 * to the implementor of the camera device. Their behavior will not be
2101 * consistent across all devices, and any given device may only implement
2102 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002103 * <p><b>Possible values:</b>
2104 * <ul>
2105 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
2106 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
2107 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
2108 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
2109 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
2110 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
2111 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
2112 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
2113 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
2114 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
2115 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
2116 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
2117 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
2118 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
2119 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
2120 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
2121 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
2122 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002123 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002124 * </ul></p>
2125 * <p><b>Available values for this device:</b><br>
2126 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002127 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002128 *
2129 * @see CaptureRequest#CONTROL_AE_MODE
2130 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002131 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07002132 * @see CaptureRequest#CONTROL_AWB_MODE
2133 * @see CaptureRequest#CONTROL_MODE
2134 * @see #CONTROL_SCENE_MODE_DISABLED
2135 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
2136 * @see #CONTROL_SCENE_MODE_ACTION
2137 * @see #CONTROL_SCENE_MODE_PORTRAIT
2138 * @see #CONTROL_SCENE_MODE_LANDSCAPE
2139 * @see #CONTROL_SCENE_MODE_NIGHT
2140 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
2141 * @see #CONTROL_SCENE_MODE_THEATRE
2142 * @see #CONTROL_SCENE_MODE_BEACH
2143 * @see #CONTROL_SCENE_MODE_SNOW
2144 * @see #CONTROL_SCENE_MODE_SUNSET
2145 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
2146 * @see #CONTROL_SCENE_MODE_FIREWORKS
2147 * @see #CONTROL_SCENE_MODE_SPORTS
2148 * @see #CONTROL_SCENE_MODE_PARTY
2149 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
2150 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07002151 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002152 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07002153 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002154 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002155 public static final Key<Integer> CONTROL_SCENE_MODE =
2156 new Key<Integer>("android.control.sceneMode", int.class);
2157
2158 /**
2159 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002160 * active.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002161 * <p>Video stabilization automatically warps images from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002162 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07002163 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07002164 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002165 * <p>Switching between different video stabilization modes may take several
2166 * frames to initialize, the camera device will report the current mode
2167 * in capture result metadata. For example, When "ON" mode is requested,
2168 * the video stabilization modes in the first several capture results may
2169 * still be "OFF", and it will become "ON" when the initialization is
2170 * done.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002171 * <p>In addition, not all recording sizes or frame rates may be supported for
2172 * stabilization by a device that reports stabilization support. It is guaranteed
2173 * that an output targeting a MediaRecorder or MediaCodec will be stabilized if
2174 * the recording resolution is less than or equal to 1920 x 1080 (width less than
2175 * or equal to 1920, height less than or equal to 1080), and the recording
2176 * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult
2177 * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return
2178 * OFF if the recording output is not stabilized, or if there are no output
2179 * Surface types that can be stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002180 * <p>If a camera device supports both this mode and OIS
2181 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
2182 * produce undesirable interaction, so it is recommended not to enable
2183 * both at the same time.</p>
2184 * <p><b>Possible values:</b>
2185 * <ul>
2186 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
2187 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
2188 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002189 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002190 *
Jianing Wei2813b0f2015-09-29 14:24:36 -07002191 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Zhijun He45fa43a12014-06-13 18:29:37 -07002192 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07002193 * @see CaptureRequest#SCALER_CROP_REGION
2194 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
2195 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
2196 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002197 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002198 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
2199 new Key<Integer>("android.control.videoStabilizationMode", int.class);
2200
2201 /**
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002202 * <p>The amount of additional sensitivity boost applied to output images
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002203 * after RAW sensor data is captured.</p>
2204 * <p>Some camera devices support additional digital sensitivity boosting in the
2205 * camera processing pipeline after sensor RAW image is captured.
2206 * Such a boost will be applied to YUV/JPEG format output images but will not
2207 * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p>
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002208 * <p>This key will be <code>null</code> for devices that do not support any RAW format
2209 * outputs. For devices that do support RAW format outputs, this key will always
2210 * present, and if a device does not support post RAW sensitivity boost, it will
2211 * list <code>100</code> in this key.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002212 * <p>If the camera device cannot apply the exact boost requested, it will reduce the
2213 * boost to the nearest supported value.
2214 * The final boost value used will be available in the output capture result.</p>
2215 * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images
2216 * of such device will have the total sensitivity of
Yin-Chia Yeh67e61b62016-01-26 13:27:35 -08002217 * <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 -08002218 * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p>
2219 * <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
2220 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2221 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
2222 * <p><b>Range of valid values:</b><br>
2223 * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p>
2224 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2225 *
2226 * @see CaptureRequest#CONTROL_AE_MODE
2227 * @see CaptureRequest#CONTROL_MODE
2228 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
2229 * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE
2230 * @see CaptureRequest#SENSOR_SENSITIVITY
2231 */
2232 @PublicKey
2233 public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST =
2234 new Key<Integer>("android.control.postRawSensitivityBoost", int.class);
2235
2236 /**
Chien-Yu Chene4491712017-01-11 11:14:06 -08002237 * <p>Allow camera device to enable zero-shutter-lag mode for requests with
2238 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p>
2239 * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with
2240 * STILL_CAPTURE capture intent. The camera device may use images captured in the past to
2241 * produce output images for a zero-shutter-lag request. The result metadata including the
2242 * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images.
2243 * Therefore, the contents of the output images and the result metadata may be out of order
2244 * compared to previous regular requests. enableZsl does not affect requests with other
2245 * capture intents.</p>
2246 * <p>For example, when requests are submitted in the following order:
2247 * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW
2248 * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p>
2249 * <p>The output images for request B may have contents captured before the output images for
2250 * request A, and the result metadata for request B may be older than the result metadata for
2251 * request A.</p>
Chien-Yu Chen1d72ee32017-04-18 15:23:06 -07002252 * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in
2253 * the past for requests with STILL_CAPTURE capture intent.</p>
2254 * <p>For applications targeting SDK versions O and newer, the value of enableZsl in
2255 * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always
2256 * <code>false</code> if present.</p>
2257 * <p>For applications targeting SDK versions older than O, the value of enableZsl in all
2258 * capture templates is always <code>false</code> if present.</p>
Chien-Yu Chen81026382017-05-03 12:30:58 -07002259 * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
Chien-Yu Chene4491712017-01-11 11:14:06 -08002260 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2261 *
2262 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
2263 * @see CaptureResult#SENSOR_TIMESTAMP
2264 */
2265 @PublicKey
2266 public static final Key<Boolean> CONTROL_ENABLE_ZSL =
2267 new Key<Boolean>("android.control.enableZsl", boolean.class);
2268
2269 /**
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002270 * <p>Whether a significant scene change is detected within the currently-set AF
2271 * region(s).</p>
2272 * <p>When the camera focus routine detects a change in the scene it is looking at,
2273 * such as a large shift in camera viewpoint, significant motion in the scene, or a
2274 * significant illumination change, this value will be set to DETECTED for a single capture
2275 * result. Otherwise the value will be NOT_DETECTED. The threshold for detection is similar
2276 * to what would trigger a new passive focus scan to begin in CONTINUOUS autofocus modes.</p>
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002277 * <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 -08002278 * <p><b>Possible values:</b>
2279 * <ul>
2280 * <li>{@link #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED NOT_DETECTED}</li>
2281 * <li>{@link #CONTROL_AF_SCENE_CHANGE_DETECTED DETECTED}</li>
2282 * </ul></p>
2283 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2284 * @see #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED
2285 * @see #CONTROL_AF_SCENE_CHANGE_DETECTED
2286 */
2287 @PublicKey
2288 public static final Key<Integer> CONTROL_AF_SCENE_CHANGE =
2289 new Key<Integer>("android.control.afSceneChange", int.class);
2290
2291 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002292 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08002293 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002294 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2295 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002296 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08002297 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08002298 * camera device will use the highest-quality enhancement algorithms,
2299 * even if it slows down capture rate. FAST means the camera device will
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002300 * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
2301 * edge enhancement will slow down capture rate. Every output stream will have a similar
2302 * amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002303 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2304 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2305 * into a final capture when triggered by the user. In this mode, the camera device applies
2306 * edge enhancement to low-resolution streams (below maximum recording resolution) to
2307 * maximize preview quality, but does not apply edge enhancement to high-resolution streams,
2308 * since those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002309 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2310 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002311 * The camera device may adjust its internal edge enhancement parameters for best
Zhijun He0e99c222015-01-29 15:26:05 -08002312 * 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 -07002313 * <p><b>Possible values:</b>
2314 * <ul>
2315 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2316 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2317 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002318 * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002319 * </ul></p>
2320 * <p><b>Available values for this device:</b><br>
2321 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002322 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2323 * <p><b>Full capability</b> -
2324 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2325 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002326 *
2327 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002328 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002329 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002330 * @see #EDGE_MODE_OFF
2331 * @see #EDGE_MODE_FAST
2332 * @see #EDGE_MODE_HIGH_QUALITY
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002333 * @see #EDGE_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002334 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002335 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002336 public static final Key<Integer> EDGE_MODE =
2337 new Key<Integer>("android.edge.mode", int.class);
2338
2339 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002340 * <p>The desired mode for for the camera device's flash control.</p>
2341 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002342 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002343 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2344 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2345 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2346 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2347 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2348 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002349 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002350 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2351 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2352 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002353 * <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 -07002354 * <p><b>Possible values:</b>
2355 * <ul>
2356 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2357 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2358 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2359 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002360 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002361 *
2362 * @see CaptureRequest#CONTROL_AE_MODE
2363 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2364 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002365 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002366 * @see #FLASH_MODE_OFF
2367 * @see #FLASH_MODE_SINGLE
2368 * @see #FLASH_MODE_TORCH
2369 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002370 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002371 public static final Key<Integer> FLASH_MODE =
2372 new Key<Integer>("android.flash.mode", int.class);
2373
2374 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002375 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002376 * unit.</p>
2377 * <p>When the camera device doesn't have flash unit
2378 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2379 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002380 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2381 * <ul>
2382 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2383 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002384 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002385 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002386 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002387 * </ul>
2388 * <p>In all other conditions the state will not be available on
2389 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002390 * <p><b>Possible values:</b>
2391 * <ul>
2392 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2393 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2394 * <li>{@link #FLASH_STATE_READY READY}</li>
2395 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2396 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2397 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002398 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2399 * <p><b>Limited capability</b> -
2400 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2401 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002402 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002403 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002404 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002405 * @see CaptureRequest#FLASH_MODE
2406 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002407 * @see #FLASH_STATE_UNAVAILABLE
2408 * @see #FLASH_STATE_CHARGING
2409 * @see #FLASH_STATE_READY
2410 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002411 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002412 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002413 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002414 public static final Key<Integer> FLASH_STATE =
2415 new Key<Integer>("android.flash.state", int.class);
2416
2417 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002418 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002419 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002420 * that do not accurately measure the incoming light (i.e. pixels that
2421 * are stuck at an arbitrary value or are oversensitive).</p>
2422 * <p><b>Possible values:</b>
2423 * <ul>
2424 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2425 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2426 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2427 * </ul></p>
2428 * <p><b>Available values for this device:</b><br>
2429 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002430 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002431 *
2432 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002433 * @see #HOT_PIXEL_MODE_OFF
2434 * @see #HOT_PIXEL_MODE_FAST
2435 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2436 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002437 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002438 public static final Key<Integer> HOT_PIXEL_MODE =
2439 new Key<Integer>("android.hotPixel.mode", int.class);
2440
2441 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002442 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002443 * <p>Setting a location object in a request will include the GPS coordinates of the location
2444 * into any JPEG images captured based on the request. These coordinates can then be
2445 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002446 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002447 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002448 @PublicKey
2449 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002450 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2451 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2452
2453 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002454 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002455 * EXIF.</p>
2456 * <p><b>Range of valid values:</b><br>
2457 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002458 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002459 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002460 */
2461 public static final Key<double[]> JPEG_GPS_COORDINATES =
2462 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2463
2464 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002465 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002466 * include in EXIF.</p>
2467 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002468 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002469 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002470 */
2471 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2472 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2473
2474 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002475 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002476 * EXIF.</p>
2477 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002478 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002479 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002480 */
2481 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2482 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2483
2484 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002485 * <p>The orientation for a JPEG image.</p>
2486 * <p>The clockwise rotation angle in degrees, relative to the orientation
2487 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2488 * upright.</p>
2489 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07002490 * rotate the image data to match this orientation. When the image data is rotated,
2491 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002492 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2493 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
Emilian Peev3abc7512018-03-28 11:22:26 +01002494 * <p>To translate from the device orientation given by the Android sensor APIs for camera
2495 * sensors which are not EXTERNAL, the following sample code may be used:</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002496 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2497 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2498 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2499 *
2500 * // Round device orientation to a multiple of 90
2501 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2502 *
2503 * // Reverse device orientation for front-facing cameras
2504 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2505 * if (facingFront) deviceOrientation = -deviceOrientation;
2506 *
2507 * // Calculate desired JPEG orientation relative to camera orientation to make
2508 * // the image upright relative to the device orientation
2509 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2510 *
2511 * return jpegOrientation;
2512 * }
2513 * </code></pre>
Emilian Peev3abc7512018-03-28 11:22:26 +01002514 * <p>For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will
2515 * also be set to EXTERNAL. The above code is not relevant in such case.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002516 * <p><b>Units</b>: Degrees in multiples of 90</p>
2517 * <p><b>Range of valid values:</b><br>
2518 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002519 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002520 *
2521 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002522 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002523 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002524 public static final Key<Integer> JPEG_ORIENTATION =
2525 new Key<Integer>("android.jpeg.orientation", int.class);
2526
2527 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002528 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002529 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002530 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002531 * <p><b>Range of valid values:</b><br>
2532 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002533 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002534 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002535 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002536 public static final Key<Byte> JPEG_QUALITY =
2537 new Key<Byte>("android.jpeg.quality", byte.class);
2538
2539 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002540 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002541 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002542 * <p><b>Range of valid values:</b><br>
2543 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002544 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002545 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002546 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002547 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2548 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2549
2550 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002551 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002552 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2553 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002554 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2555 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002556 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2557 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2558 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2559 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2560 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2561 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002562 * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested,
2563 * the camera device will handle thumbnail rotation in one of the following ways:</p>
2564 * <ul>
2565 * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
2566 * and keep jpeg and thumbnail image data unrotated.</li>
2567 * <li>Rotate the jpeg and thumbnail image data and not set
2568 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
2569 * case, LIMITED or FULL hardware level devices will report rotated thumnail size in
2570 * capture result, so the width and height will be interchanged if 90 or 270 degree
2571 * orientation is requested. LEGACY device will always report unrotated thumbnail
2572 * size.</li>
2573 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002574 * <p><b>Range of valid values:</b><br>
2575 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002576 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002577 *
2578 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002579 * @see CaptureRequest#JPEG_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002580 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002581 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002582 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2583 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002584
2585 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002586 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2587 * effective aperture diameter.</p>
2588 * <p>Setting this value is only supported on the camera devices that have a variable
2589 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002590 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2591 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002592 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002593 * to achieve manual exposure control.</p>
2594 * <p>The requested aperture value may take several frames to reach the
2595 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002596 * aperture size in capture result metadata while the aperture is changing.
2597 * 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 -08002598 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2599 * the ON modes, this will be overridden by the camera device
2600 * auto-exposure algorithm, the overridden values are then provided
2601 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002602 * <p><b>Units</b>: The f-number (f/N)</p>
2603 * <p><b>Range of valid values:</b><br>
2604 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002605 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2606 * <p><b>Full capability</b> -
2607 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2608 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002609 *
Zhijun He399f05d2014-01-15 11:31:30 -08002610 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002611 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002612 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002613 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002614 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002615 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002616 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002617 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002618 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002619 public static final Key<Float> LENS_APERTURE =
2620 new Key<Float>("android.lens.aperture", float.class);
2621
2622 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002623 * <p>The desired setting for the lens neutral density filter(s).</p>
2624 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002625 * <p>Lens filters are typically used to lower the amount of light the
2626 * sensor is exposed to (measured in steps of EV). As used here, an EV
2627 * step is the standard logarithmic representation, which are
2628 * non-negative, and inversely proportional to the amount of light
2629 * hitting the sensor. For example, setting this to 0 would result
2630 * in no reduction of the incoming light, and setting this to 2 would
2631 * mean that the filter is set to reduce incoming light by two stops
2632 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002633 * <p>It may take several frames before the lens filter density changes
2634 * to the requested value. While the filter density is still changing,
2635 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002636 * <p><b>Units</b>: Exposure Value (EV)</p>
2637 * <p><b>Range of valid values:</b><br>
2638 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002639 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2640 * <p><b>Full capability</b> -
2641 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2642 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002643 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002644 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002645 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002646 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002647 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002648 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002649 public static final Key<Float> LENS_FILTER_DENSITY =
2650 new Key<Float>("android.lens.filterDensity", float.class);
2651
2652 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002653 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002654 * <p>This setting controls the physical focal length of the camera
2655 * device's lens. Changing the focal length changes the field of
2656 * view of the camera device, and is usually used for optical zoom.</p>
2657 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2658 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002659 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002660 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2661 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002662 * <p>Optical zoom will not be supported on most devices.</p>
2663 * <p><b>Units</b>: Millimeters</p>
2664 * <p><b>Range of valid values:</b><br>
2665 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002666 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002667 *
2668 * @see CaptureRequest#LENS_APERTURE
2669 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002670 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002671 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002672 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002673 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002674 public static final Key<Float> LENS_FOCAL_LENGTH =
2675 new Key<Float>("android.lens.focalLength", float.class);
2676
2677 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002678 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002679 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002680 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002681 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2682 * <p><b>Range of valid values:</b><br>
2683 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002684 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2685 * <p><b>Full capability</b> -
2686 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2687 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2688 *
2689 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002690 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002691 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002692 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002693 public static final Key<Float> LENS_FOCUS_DISTANCE =
2694 new Key<Float>("android.lens.focusDistance", float.class);
2695
2696 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002697 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002698 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002699 * <p>If variable focus not supported, can still report
2700 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002701 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2702 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2703 * <p><b>Range of valid values:</b><br>
2704 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002705 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2706 * <p><b>Limited capability</b> -
2707 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2708 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2709 *
2710 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002711 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002712 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002713 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002714 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2715 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 -07002716
2717 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002718 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2719 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002720 * <p>OIS is used to compensate for motion blur due to small
2721 * movements of the camera during capture. Unlike digital image
2722 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2723 * makes use of mechanical elements to stabilize the camera
2724 * sensor, and thus allows for longer exposure times before
2725 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002726 * <p>Switching between different optical stabilization modes may take several
2727 * frames to initialize, the camera device will report the current mode in
2728 * capture result metadata. For example, When "ON" mode is requested, the
2729 * optical stabilization modes in the first several capture results may still
2730 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002731 * <p>If a camera device supports both OIS and digital image stabilization
2732 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2733 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002734 * <p>Not all devices will support OIS; see
2735 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2736 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002737 * <p><b>Possible values:</b>
2738 * <ul>
2739 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2740 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2741 * </ul></p>
2742 * <p><b>Available values for this device:</b><br>
2743 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002744 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2745 * <p><b>Limited capability</b> -
2746 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2747 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002748 *
2749 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002750 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002751 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002752 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2753 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2754 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002755 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002756 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2757 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2758
2759 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002760 * <p>Current lens status.</p>
2761 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2762 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2763 * they may take several frames to reach the requested values. This state indicates
2764 * the current status of the lens parameters.</p>
2765 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2766 * either because the parameters are all fixed, or because the lens has had enough
2767 * time to reach the most recently-requested values.
2768 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2769 * <ul>
2770 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2771 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2772 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2773 * which means the optical zoom is not supported.</li>
2774 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2775 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2776 * </ul>
2777 * <p>Then this state will always be STATIONARY.</p>
2778 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2779 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002780 * <p><b>Possible values:</b>
2781 * <ul>
2782 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2783 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2784 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002785 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2786 * <p><b>Limited capability</b> -
2787 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2788 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002789 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002790 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002791 * @see CaptureRequest#LENS_APERTURE
2792 * @see CaptureRequest#LENS_FILTER_DENSITY
2793 * @see CaptureRequest#LENS_FOCAL_LENGTH
2794 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2795 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2796 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2797 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2798 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002799 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002800 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002801 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002802 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002803 public static final Key<Integer> LENS_STATE =
2804 new Key<Integer>("android.lens.state", int.class);
2805
2806 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002807 * <p>The orientation of the camera relative to the sensor
2808 * coordinate system.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002809 * <p>The four coefficients that describe the quaternion
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002810 * rotation from the Android sensor coordinate system to a
2811 * camera-aligned coordinate system where the X-axis is
2812 * aligned with the long side of the image sensor, the Y-axis
2813 * is aligned with the short side of the image sensor, and
2814 * the Z-axis is aligned with the optical axis of the sensor.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002815 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002816 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
2817 * amount <code>theta</code>, the following formulas can be used:</p>
2818 * <pre><code> theta = 2 * acos(w)
2819 * a_x = x / sin(theta/2)
2820 * a_y = y / sin(theta/2)
2821 * a_z = z / sin(theta/2)
2822 * </code></pre>
2823 * <p>To create a 3x3 rotation matrix that applies the rotation
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002824 * defined by this quaternion, the following matrix can be
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002825 * used:</p>
2826 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
2827 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
2828 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
2829 * </code></pre>
2830 * <p>This matrix can then be used to apply the rotation to a
2831 * column vector point with</p>
2832 * <p><code>p' = Rp</code></p>
2833 * <p>where <code>p</code> is in the device sensor coordinate system, and
2834 * <code>p'</code> is in the camera-oriented coordinate system.</p>
2835 * <p><b>Units</b>:
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002836 * Quaternion coefficients</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002837 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2838 */
2839 @PublicKey
2840 public static final Key<float[]> LENS_POSE_ROTATION =
2841 new Key<float[]>("android.lens.poseRotation", float[].class);
2842
2843 /**
2844 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07002845 * <p>The position of the camera device's lens optical center,
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002846 * as a three-dimensional vector <code>(x,y,z)</code>.</p>
2847 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
2848 * is relative to the optical center of the largest camera device facing in the same
2849 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
2850 * coordinate axes}. Note that only the axis definitions are shared with the sensor
2851 * coordinate system, but not the origin.</p>
2852 * <p>If this device is the largest or only camera device with a given facing, then this
2853 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
2854 * from the main sensor along the +X axis (to the right from the user's perspective) will
2855 * report <code>(0.03, 0, 0)</code>.</p>
2856 * <p>To transform a pixel coordinates between two cameras facing the same direction, first
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002857 * 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 -08002858 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
2859 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
2860 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
2861 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
2862 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
2863 * coordinates.</p>
2864 * <p>To compare this against a real image from the destination camera, the destination camera
2865 * image then needs to be corrected for radial distortion before comparison or sampling.</p>
2866 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to
2867 * the center of the primary gyroscope on the device.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002868 * <p><b>Units</b>: Meters</p>
2869 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2870 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002871 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002872 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002873 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002874 * @see CameraCharacteristics#LENS_POSE_ROTATION
2875 */
2876 @PublicKey
2877 public static final Key<float[]> LENS_POSE_TRANSLATION =
2878 new Key<float[]>("android.lens.poseTranslation", float[].class);
2879
2880 /**
2881 * <p>The parameters for this camera device's intrinsic
2882 * calibration.</p>
2883 * <p>The five calibration parameters that describe the
2884 * transform from camera-centric 3D coordinates to sensor
2885 * pixel coordinates:</p>
2886 * <pre><code>[f_x, f_y, c_x, c_y, s]
2887 * </code></pre>
2888 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
2889 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
2890 * axis, and <code>s</code> is a skew parameter for the sensor plane not
2891 * being aligned with the lens plane.</p>
2892 * <p>These are typically used within a transformation matrix K:</p>
2893 * <pre><code>K = [ f_x, s, c_x,
2894 * 0, f_y, c_y,
2895 * 0 0, 1 ]
2896 * </code></pre>
2897 * <p>which can then be combined with the camera pose rotation
2898 * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
2899 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
2900 * complete transform from world coordinates to pixel
2901 * coordinates:</p>
2902 * <pre><code>P = [ K 0 * [ R t
2903 * 0 1 ] 0 1 ]
2904 * </code></pre>
2905 * <p>and with <code>p_w</code> being a point in the world coordinate system
2906 * and <code>p_s</code> being a point in the camera active pixel array
2907 * coordinate system, and with the mapping including the
2908 * homogeneous division by z:</p>
2909 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
2910 * p_s = p_h / z_h
2911 * </code></pre>
2912 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
2913 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
2914 * (depth) in pixel coordinates.</p>
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002915 * <p>Note that the coordinate system for this transform is the
2916 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
2917 * where <code>(0,0)</code> is the top-left of the
2918 * preCorrectionActiveArraySize rectangle. Once the pose and
2919 * intrinsic calibration transforms have been applied to a
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002920 * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002921 * transform needs to be applied, and the result adjusted to
2922 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
2923 * system (where <code>(0, 0)</code> is the top-left of the
2924 * activeArraySize rectangle), to determine the final pixel
2925 * coordinate of the world point for processed (non-RAW)
2926 * output buffers.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002927 * <p><b>Units</b>:
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002928 * Pixels in the
2929 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
2930 * coordinate system.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002931 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2932 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002933 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002934 * @see CameraCharacteristics#LENS_POSE_ROTATION
2935 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07002936 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002937 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002938 */
2939 @PublicKey
2940 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
2941 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
2942
2943 /**
2944 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002945 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002946 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002947 * kappa_3]</code> and two tangential distortion coefficients
2948 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
2949 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002950 * <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 -07002951 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002952 * 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 -07002953 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002954 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002955 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
2956 * input image that correspond to the pixel values in the
2957 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
2958 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
2959 * </code></pre>
2960 * <p>The pixel coordinates are defined in a normalized
2961 * coordinate system related to the
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002962 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002963 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
2964 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
2965 * of both x and y coordinates are normalized to be 1 at the
2966 * edge further from the optical center, so the range
2967 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
2968 * <p>Finally, <code>r</code> represents the radial distance from the
2969 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
2970 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
2971 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002972 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002973 * Unitless coefficients.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002974 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002975 *
2976 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002977 * @deprecated
2978 * <p>This field was inconsistently defined in terms of its
2979 * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p>
2980 *
2981 * @see CameraCharacteristics#LENS_DISTORTION
2982
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002983 */
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002984 @Deprecated
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002985 @PublicKey
2986 public static final Key<float[]> LENS_RADIAL_DISTORTION =
2987 new Key<float[]>("android.lens.radialDistortion", float[].class);
2988
2989 /**
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002990 * <p>The correction coefficients to correct for this camera device's
2991 * radial and tangential lens distortion.</p>
2992 * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was
2993 * inconsistently defined.</p>
2994 * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2,
2995 * kappa_3]</code> and two tangential distortion coefficients
2996 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
2997 * lens's geometric distortion with the mapping equations:</p>
2998 * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
2999 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
3000 * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
3001 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
3002 * </code></pre>
3003 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
3004 * input image that correspond to the pixel values in the
3005 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
3006 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
3007 * </code></pre>
3008 * <p>The pixel coordinates are defined in a coordinate system
3009 * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
3010 * calibration fields; see that entry for details of the mapping stages.
3011 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code>
3012 * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and
3013 * the range of the coordinates depends on the focal length
3014 * terms of the intrinsic calibration.</p>
3015 * <p>Finally, <code>r</code> represents the radial distance from the
3016 * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p>
3017 * <p>The distortion model used is the Brown-Conrady model.</p>
3018 * <p><b>Units</b>:
3019 * Unitless coefficients.</p>
3020 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3021 *
3022 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
3023 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
3024 */
3025 @PublicKey
3026 public static final Key<float[]> LENS_DISTORTION =
3027 new Key<float[]>("android.lens.distortion", float[].class);
3028
3029 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003030 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003031 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08003032 * excessive noise added by the capture process, especially in dark conditions.</p>
3033 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
3034 * YUV domain.</p>
3035 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
3036 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
3037 * This mode is optional, may not be support by all devices. The application should check
3038 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08003039 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
3040 * will be applied. HIGH_QUALITY mode indicates that the camera device
3041 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003042 * even if it slows down capture rate. FAST means the camera device will not
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07003043 * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
3044 * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
3045 * Every output stream will have a similar amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003046 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
3047 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
3048 * into a final capture when triggered by the user. In this mode, the camera device applies
3049 * noise reduction to low-resolution streams (below maximum recording resolution) to maximize
3050 * preview quality, but does not apply noise reduction to high-resolution streams, since
3051 * those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08003052 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
3053 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
3054 * may adjust the noise reduction parameters for best image quality based on the
3055 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003056 * <p><b>Possible values:</b>
3057 * <ul>
3058 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
3059 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
3060 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08003061 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003062 * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003063 * </ul></p>
3064 * <p><b>Available values for this device:</b><br>
3065 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003066 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3067 * <p><b>Full capability</b> -
3068 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3069 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003070 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003071 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003072 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08003073 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003074 * @see #NOISE_REDUCTION_MODE_OFF
3075 * @see #NOISE_REDUCTION_MODE_FAST
3076 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08003077 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003078 * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003079 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003080 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003081 public static final Key<Integer> NOISE_REDUCTION_MODE =
3082 new Key<Integer>("android.noiseReduction.mode", int.class);
3083
3084 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003085 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003086 * final one for the capture, or only a partial that contains a
3087 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08003088 * values.</p>
3089 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003090 * single capture may not overlap, except for this entry. The
3091 * FINAL buffers must retain FIFO ordering relative to the
3092 * requests that generate them, so the FINAL buffer for frame 3 must
3093 * always be sent to the framework after the FINAL buffer for frame 2, and
3094 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
3095 * in any order relative to other frames, but all PARTIAL buffers for a given
3096 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08003097 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003098 * <p><b>Range of valid values:</b><br>
3099 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003100 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003101 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003102 * <p>Not used in HALv3 or newer</p>
3103
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003104 * @hide
3105 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003106 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003107 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
3108 new Key<Boolean>("android.quirks.partialResult", boolean.class);
3109
3110 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003111 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07003112 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08003113 * frameCount value).</p>
3114 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003115 * <p><b>Units</b>: count of frames</p>
3116 * <p><b>Range of valid values:</b><br>
3117 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003118 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003119 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003120 * <p>Not used in HALv3 or newer</p>
3121
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003122 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003123 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003124 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003125 public static final Key<Integer> REQUEST_FRAME_COUNT =
3126 new Key<Integer>("android.request.frameCount", int.class);
3127
3128 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003129 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003130 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08003131 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003132 * <p><b>Units</b>: arbitrary integer assigned by application</p>
3133 * <p><b>Range of valid values:</b><br>
3134 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003135 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003136 * @hide
3137 */
3138 public static final Key<Integer> REQUEST_ID =
3139 new Key<Integer>("android.request.id", int.class);
3140
3141 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003142 * <p>Specifies the number of pipeline stages the frame went
3143 * through from when it was exposed to when the final completed result
3144 * was available to the framework.</p>
3145 * <p>Depending on what settings are used in the request, and
3146 * what streams are configured, the data may undergo less processing,
3147 * and some pipeline stages skipped.</p>
3148 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003149 * <p><b>Range of valid values:</b><br>
3150 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003151 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003152 *
3153 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3154 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003155 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003156 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
3157 new Key<Byte>("android.request.pipelineDepth", byte.class);
3158
3159 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003160 * <p>The desired region of the sensor to read out for this capture.</p>
3161 * <p>This control can be used to implement digital zoom.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003162 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3163 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being
3164 * the top-left pixel of the active array.</p>
3165 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3166 * system depends on the mode being set.
3167 * When the distortion correction mode is OFF, the coordinate system follows
3168 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
3169 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array.
3170 * When the distortion correction mode is not OFF, the coordinate system follows
3171 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3172 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003173 * <p>Output streams use this rectangle to produce their output,
3174 * cropping to a smaller region if necessary to maintain the
3175 * stream's aspect ratio, then scaling the sensor input to
3176 * match the output's configured resolution.</p>
3177 * <p>The crop region is applied after the RAW to other color
3178 * space (e.g. YUV) conversion. Since raw streams
3179 * (e.g. RAW16) don't have the conversion stage, they are not
3180 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07003181 * <p>For non-raw streams, any additional per-stream cropping will
3182 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003183 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003184 * ratio, then 4:3 streams will use the exact crop
3185 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08003186 * (letterbox).</p>
3187 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003188 * outputs will crop horizontally (pillarbox), and 16:9
3189 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08003190 * be centered within the crop region.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003191 * <p>If the coordinate system is android.sensor.info.activeArraysSize, the width and height
3192 * of the crop region cannot be set to be smaller than
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003193 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
3194 * <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 -07003195 * <p>If the coordinate system is {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, the width
3196 * and height of the crop region cannot be set to be smaller than
3197 * <code>floor( preCorrectionActiveArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>
3198 * and
3199 * <code>floor( preCorrectionActiveArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>,
3200 * respectively.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003201 * <p>The camera device may adjust the crop region to account
3202 * for rounding and other hardware requirements; the final
3203 * crop region used will be included in the output capture
3204 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003205 * <p><b>Units</b>: Pixel coordinates relative to
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003206 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
3207 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on distortion correction
3208 * capability and mode</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003209 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003210 *
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003211 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003212 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003213 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003214 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003215 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003216 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003217 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
3218 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
3219
3220 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003221 * <p>Duration each pixel is exposed to
3222 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003223 * <p>If the sensor can't expose this exact duration, it will shorten the
3224 * duration exposed to the nearest possible value (rather than expose longer).
3225 * The final exposure time used will be available in the output capture result.</p>
3226 * <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
3227 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3228 * <p><b>Units</b>: Nanoseconds</p>
3229 * <p><b>Range of valid values:</b><br>
3230 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003231 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3232 * <p><b>Full capability</b> -
3233 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3234 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3235 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003236 * @see CaptureRequest#CONTROL_AE_MODE
3237 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003238 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003239 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003240 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003241 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003242 public static final Key<Long> SENSOR_EXPOSURE_TIME =
3243 new Key<Long>("android.sensor.exposureTime", long.class);
3244
3245 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003246 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003247 * start of next frame exposure.</p>
3248 * <p>The maximum frame rate that can be supported by a camera subsystem is
3249 * a function of many factors:</p>
3250 * <ul>
3251 * <li>Requested resolutions of output image streams</li>
3252 * <li>Availability of binning / skipping modes on the imager</li>
3253 * <li>The bandwidth of the imager interface</li>
3254 * <li>The bandwidth of the various ISP processing blocks</li>
3255 * </ul>
3256 * <p>Since these factors can vary greatly between different ISPs and
3257 * sensors, the camera abstraction tries to represent the bandwidth
3258 * restrictions with as simple a model as possible.</p>
3259 * <p>The model presented has the following characteristics:</p>
3260 * <ul>
3261 * <li>The image sensor is always configured to output the smallest
3262 * resolution possible given the application's requested output stream
3263 * sizes. The smallest resolution is defined as being at least as large
3264 * as the largest requested output stream size; the camera pipeline must
3265 * never digitally upsample sensor data when the crop region covers the
3266 * whole sensor. In general, this means that if only small output stream
3267 * resolutions are configured, the sensor can provide a higher frame
3268 * rate.</li>
3269 * <li>Since any request may use any or all the currently configured
3270 * output streams, the sensor and ISP must be configured to support
3271 * scaling a single capture to all the streams at the same time. This
3272 * means the camera pipeline must be ready to produce the largest
3273 * requested output size without any delay. Therefore, the overall
3274 * frame rate of a given configured stream set is governed only by the
3275 * largest requested stream resolution.</li>
3276 * <li>Using more than one output stream in a request does not affect the
3277 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08003278 * <li>Certain format-streams may need to do additional background processing
3279 * before data is consumed/produced by that stream. These processors
3280 * can run concurrently to the rest of the camera pipeline, but
3281 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003282 * </ul>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003283 * <p>The necessary information for the application, given the model above, is provided via
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003284 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003285 * These are used to determine the maximum frame rate / minimum frame duration that is
3286 * possible for a given stream configuration.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003287 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08003288 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003289 * device:</p>
3290 * <ol>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003291 * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li>
3292 * <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 }
3293 * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li>
3294 * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum
3295 * 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 -08003296 * </ol>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003297 * <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 -08003298 * using its respective size/format), then the frame duration in <code>F</code> determines the steady
3299 * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let
3300 * this special kind of request be called <code>Rsimple</code>.</p>
3301 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a
3302 * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if
3303 * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all
3304 * buffers from the previous <code>Rstall</code> have already been delivered.</p>
3305 * <p>For more details about stalling, see {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003306 * <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
3307 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3308 * <p><b>Units</b>: Nanoseconds</p>
3309 * <p><b>Range of valid values:</b><br>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003310 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }.
3311 * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003312 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3313 * <p><b>Full capability</b> -
3314 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3315 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003316 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003317 * @see CaptureRequest#CONTROL_AE_MODE
3318 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003319 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003320 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003321 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003322 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003323 public static final Key<Long> SENSOR_FRAME_DURATION =
3324 new Key<Long>("android.sensor.frameDuration", long.class);
3325
3326 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003327 * <p>The amount of gain applied to sensor data
3328 * before processing.</p>
3329 * <p>The sensitivity is the standard ISO sensitivity value,
3330 * as defined in ISO 12232:2006.</p>
3331 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
3332 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
3333 * is guaranteed to use only analog amplification for applying the gain.</p>
3334 * <p>If the camera device cannot apply the exact sensitivity
3335 * requested, it will reduce the gain to the nearest supported
3336 * value. The final sensitivity used will be available in the
3337 * output capture result.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003338 * <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
3339 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003340 * <p><b>Units</b>: ISO arithmetic units</p>
3341 * <p><b>Range of valid values:</b><br>
3342 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003343 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3344 * <p><b>Full capability</b> -
3345 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3346 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003347 *
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003348 * @see CaptureRequest#CONTROL_AE_MODE
3349 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003350 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003351 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
3352 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003353 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003354 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003355 public static final Key<Integer> SENSOR_SENSITIVITY =
3356 new Key<Integer>("android.sensor.sensitivity", int.class);
3357
3358 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003359 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07003360 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003361 * <p>The timestamps are also included in all image
3362 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07003363 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003364 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07003365 * the timestamps measure time since an unspecified starting point,
3366 * and are monotonically increasing. They can be compared with the
3367 * timestamps for other captures from the same camera device, but are
3368 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003369 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the
3370 * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can
3371 * be compared to other timestamps from other subsystems that
3372 * are using that base.</p>
Chien-Yu Chen6216e4e2015-05-29 11:49:54 -07003373 * <p>For reprocessing, the timestamp will match the start of exposure of
3374 * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the
3375 * timestamp} in the TotalCaptureResult that was used to create the
3376 * reprocess capture request.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003377 * <p><b>Units</b>: Nanoseconds</p>
3378 * <p><b>Range of valid values:</b><br>
3379 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003380 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07003381 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003382 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003383 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003384 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003385 public static final Key<Long> SENSOR_TIMESTAMP =
3386 new Key<Long>("android.sensor.timestamp", long.class);
3387
3388 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07003389 * <p>The estimated camera neutral color in the native sensor colorspace at
3390 * the time of capture.</p>
3391 * <p>This value gives the neutral color point encoded as an RGB value in the
3392 * native sensor color space. The neutral color point indicates the
3393 * currently estimated white point of the scene illumination. It can be
3394 * used to interpolate between the provided color transforms when
3395 * processing raw sensor data.</p>
3396 * <p>The order of the values is R, G, B; where R is in the lowest index.</p>
Ruben Brunk20c76f62014-02-07 15:47:10 -08003397 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3398 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003399 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08003400 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
3401 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
3402
3403 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003404 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003405 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003406 * corresponding to the sensor amplification (S) and sensor readout
3407 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003408 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003409 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
3410 * represented as an array of Pair&lt;Double, Double&gt;, where
3411 * the first member of the Pair at index n is the S coefficient and the
3412 * second member is the O coefficient for the nth color channel in the CFA.</p>
3413 * <p>These coefficients are used in a two parameter noise model to describe
3414 * the amount of noise present in the image for each CFA channel. The
3415 * noise model used here is:</p>
3416 * <p>N(x) = sqrt(Sx + O)</p>
3417 * <p>Where x represents the recorded signal of a CFA channel normalized to
3418 * the range [0, 1], and S and O are the noise model coeffiecients for
3419 * that channel.</p>
3420 * <p>A more detailed description of the noise model can be found in the
3421 * Adobe DNG specification for the NoiseProfile tag.</p>
3422 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3423 *
3424 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3425 */
3426 @PublicKey
3427 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
3428 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
3429
3430 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08003431 * <p>The worst-case divergence between Bayer green channels.</p>
3432 * <p>This value is an estimate of the worst case split between the
3433 * Bayer green channels in the red and blue rows in the sensor color
3434 * filter array.</p>
3435 * <p>The green split is calculated as follows:</p>
3436 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07003437 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
3438 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
3439 * mosaic channels (R, Gr, Gb, B). The location and size of the window
3440 * chosen is implementation defined, and should be chosen to provide a
3441 * green split estimate that is both representative of the entire image
3442 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003443 * <li>The arithmetic mean of the green channels from the red
3444 * rows (mean_Gr) within W is computed.</li>
3445 * <li>The arithmetic mean of the green channels from the blue
3446 * rows (mean_Gb) within W is computed.</li>
3447 * <li>The maximum ratio R of the two means is computed as follows:
3448 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
3449 * </ol>
3450 * <p>The ratio R is the green split divergence reported for this property,
3451 * which represents how much the green channels differ in the mosaic
3452 * pattern. This value is typically used to determine the treatment of
3453 * the green mosaic channels when demosaicing.</p>
3454 * <p>The green split value can be roughly interpreted as follows:</p>
3455 * <ul>
3456 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
3457 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
3458 * correction to avoid demosaic errors (3-20% divergence).</li>
3459 * <li>R &gt; 1.20 will require strong software correction to produce
3460 * a usuable image (&gt;20% divergence).</li>
3461 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003462 * <p><b>Range of valid values:</b><br></p>
3463 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003464 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3465 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003466 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08003467 public static final Key<Float> SENSOR_GREEN_SPLIT =
3468 new Key<Float>("android.sensor.greenSplit", float.class);
3469
3470 /**
Zhijun He379af012014-05-06 11:54:54 -07003471 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
3472 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
3473 * <p>Each color channel is treated as an unsigned 32-bit integer.
3474 * The camera device then uses the most significant X bits
3475 * that correspond to how many bits are in its Bayer raw sensor
3476 * output.</p>
3477 * <p>For example, a sensor with RAW10 Bayer output would use the
3478 * 10 most significant bits from each color channel.</p>
3479 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3480 *
3481 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
3482 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003483 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003484 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
3485 new Key<int[]>("android.sensor.testPatternData", int[].class);
3486
3487 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003488 * <p>When enabled, the sensor sends a test pattern instead of
3489 * doing a real exposure from the camera.</p>
3490 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003491 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08003492 * work as normal.</p>
3493 * <p>For example, if manual flash is enabled, flash firing should still
3494 * occur (and that the test pattern remain unmodified, since the flash
3495 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003496 * <p>Defaults to OFF.</p>
3497 * <p><b>Possible values:</b>
3498 * <ul>
3499 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
3500 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
3501 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
3502 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
3503 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
3504 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
3505 * </ul></p>
3506 * <p><b>Available values for this device:</b><br>
3507 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003508 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003509 *
3510 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08003511 * @see #SENSOR_TEST_PATTERN_MODE_OFF
3512 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
3513 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
3514 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
3515 * @see #SENSOR_TEST_PATTERN_MODE_PN9
3516 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
3517 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003518 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003519 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
3520 new Key<Integer>("android.sensor.testPatternMode", int.class);
3521
3522 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07003523 * <p>Duration between the start of first row exposure
3524 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003525 * <p>This is the exposure time skew between the first and last
3526 * row exposure start times. The first row and the last row are
3527 * the first and last rows inside of the
3528 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003529 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
3530 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003531 * <p><b>Units</b>: Nanoseconds</p>
3532 * <p><b>Range of valid values:</b><br>
3533 * &gt;= 0 and &lt;
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003534 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003535 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3536 * <p><b>Limited capability</b> -
3537 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3538 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003539 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003540 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07003541 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3542 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003543 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07003544 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
3545 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
3546
3547 /**
Zhijun Hecd950b62015-11-12 17:47:52 -08003548 * <p>A per-frame dynamic black level offset for each of the color filter
3549 * arrangement (CFA) mosaic channels.</p>
3550 * <p>Camera sensor black levels may vary dramatically for different
3551 * capture settings (e.g. {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). The fixed black
3552 * level reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may be too
3553 * inaccurate to represent the actual value on a per-frame basis. The
3554 * camera device internal pipeline relies on reliable black level values
3555 * to process the raw images appropriately. To get the best image
3556 * quality, the camera device may choose to estimate the per frame black
3557 * level values either based on optically shielded black regions
3558 * ({@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}) or its internal model.</p>
3559 * <p>This key reports the camera device estimated per-frame zero light
3560 * value for each of the CFA mosaic channels in the camera sensor. The
3561 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may only represent a coarse
3562 * approximation of the actual black level values. This value is the
3563 * black level used in camera device internal image processing pipeline
3564 * and generally more accurate than the fixed black level values.
3565 * However, since they are estimated values by the camera device, they
3566 * may not be as accurate as the black level values calculated from the
3567 * optical black pixels reported by {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}.</p>
3568 * <p>The values are given in the same order as channels listed for the CFA
3569 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
3570 * nth value given corresponds to the black level offset for the nth
3571 * color channel listed in the CFA.</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003572 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is available or the
3573 * camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08003574 * <p><b>Range of valid values:</b><br>
3575 * &gt;= 0 for each.</p>
3576 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3577 *
3578 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
3579 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3580 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3581 * @see CaptureRequest#SENSOR_SENSITIVITY
3582 */
3583 @PublicKey
Zhijun He8998ad92015-11-24 14:31:04 -08003584 public static final Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL =
3585 new Key<float[]>("android.sensor.dynamicBlackLevel", float[].class);
Zhijun Hecd950b62015-11-12 17:47:52 -08003586
3587 /**
3588 * <p>Maximum raw value output by sensor for this frame.</p>
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07003589 * <p>Since the {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may change for different
Zhijun Hecd950b62015-11-12 17:47:52 -08003590 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}), the white
3591 * level will change accordingly. This key is similar to
3592 * {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}, but specifies the camera device
3593 * estimated white level for each frame.</p>
3594 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is
3595 * available or the camera device advertises this key via
3596 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys }.</p>
3597 * <p><b>Range of valid values:</b><br>
3598 * &gt;= 0</p>
3599 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3600 *
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07003601 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
Zhijun Hecd950b62015-11-12 17:47:52 -08003602 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
3603 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3604 * @see CaptureRequest#SENSOR_SENSITIVITY
3605 */
3606 @PublicKey
3607 public static final Key<Integer> SENSOR_DYNAMIC_WHITE_LEVEL =
3608 new Key<Integer>("android.sensor.dynamicWhiteLevel", int.class);
3609
3610 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08003611 * <p>Quality of lens shading correction applied
3612 * to the image data.</p>
3613 * <p>When set to OFF mode, no lens shading correction will be applied by the
3614 * camera device, and an identity lens shading map data will be provided
3615 * 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 -07003616 * shading map with size of <code>[ 4, 3 ]</code>,
3617 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
3618 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003619 * <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 -07003620 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3621 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3622 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3623 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3624 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08003625 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003626 * <p>When set to other modes, lens shading correction will be applied by the camera
3627 * device. Applications can request lens shading map data by setting
3628 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
3629 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
3630 * data will be the one applied by the camera device for this capture request.</p>
3631 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
3632 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
3633 * 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>
3634 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
3635 * to be converged before using the returned shading map data.</p>
3636 * <p><b>Possible values:</b>
3637 * <ul>
3638 * <li>{@link #SHADING_MODE_OFF OFF}</li>
3639 * <li>{@link #SHADING_MODE_FAST FAST}</li>
3640 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3641 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003642 * <p><b>Available values for this device:</b><br>
3643 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003644 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3645 * <p><b>Full capability</b> -
3646 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3647 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003648 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07003649 * @see CaptureRequest#CONTROL_AE_MODE
3650 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003651 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003652 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003653 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08003654 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3655 * @see #SHADING_MODE_OFF
3656 * @see #SHADING_MODE_FAST
3657 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08003658 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003659 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08003660 public static final Key<Integer> SHADING_MODE =
3661 new Key<Integer>("android.shading.mode", int.class);
3662
3663 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003664 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003665 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003666 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003667 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003668 * fields.</p>
3669 * <p><b>Possible values:</b>
3670 * <ul>
3671 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3672 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3673 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3674 * </ul></p>
3675 * <p><b>Available values for this device:</b><br>
3676 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3677 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003678 *
3679 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003680 * @see #STATISTICS_FACE_DETECT_MODE_OFF
3681 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3682 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3683 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003684 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003685 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3686 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3687
3688 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003689 * <p>List of unique IDs for detected faces.</p>
3690 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3691 * to the camera device. A face that leaves the field of view and later returns may be
3692 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003693 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3694 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003695 *
3696 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003697 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003698 */
3699 public static final Key<int[]> STATISTICS_FACE_IDS =
3700 new Key<int[]>("android.statistics.faceIds", int[].class);
3701
3702 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003703 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003704 * faces.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003705 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3706 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being
3707 * the top-left pixel of the active array.</p>
3708 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3709 * system depends on the mode being set.
3710 * When the distortion correction mode is OFF, the coordinate system follows
3711 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
3712 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array.
3713 * When the distortion correction mode is not OFF, the coordinate system follows
3714 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003715 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003716 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3717 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003718 *
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003719 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003720 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003721 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003722 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003723 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003724 */
3725 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3726 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3727
3728 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003729 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003730 * faces.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003731 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3732 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being
3733 * the top-left pixel of the active array.</p>
3734 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
3735 * system depends on the mode being set.
3736 * When the distortion correction mode is OFF, the coordinate system follows
3737 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
3738 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array.
3739 * When the distortion correction mode is not OFF, the coordinate system follows
3740 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003741 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003742 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3743 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003744 *
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003745 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003746 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003747 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003748 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003749 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003750 */
3751 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3752 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3753
3754 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003755 * <p>List of the face confidence scores for
3756 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003757 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003758 * <p><b>Range of valid values:</b><br>
3759 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003760 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003761 *
3762 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003763 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003764 */
3765 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3766 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3767
3768 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003769 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003770 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003771 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003772 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003773 *
3774 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3775 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003776 @PublicKey
3777 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003778 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3779 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3780
3781 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003782 * <p>The shading map is a low-resolution floating-point map
3783 * that lists the coefficients used to correct for vignetting, for each
3784 * Bayer color channel.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003785 * <p>The map provided here is the same map that is used by the camera device to
3786 * correct both color shading and vignetting for output non-RAW images.</p>
3787 * <p>When there is no lens shading correction applied to RAW
3788 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3789 * false), this map is the complete lens shading correction
3790 * map; when there is some lens shading correction applied to
3791 * 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
3792 * correction map that needs to be applied to get shading
3793 * corrected images that match the camera device's output for
3794 * non-RAW formats.</p>
3795 * <p>For a complete shading correction map, the least shaded
3796 * section of the image will have a gain factor of 1; all
3797 * other sections will have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003798 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003799 * will take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003800 * <p>The shading map is for the entire active pixel array, and is not
3801 * affected by the crop region specified in the request. Each shading map
3802 * entry is the value of the shading compensation map over a specific
3803 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3804 * map, and an active pixel array size (W x H), shading map entry
3805 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3806 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3807 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3808 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3809 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003810 * The shading map is stored in a fully interleaved format.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003811 * <p>The shading map will generally have on the order of 30-40 rows and columns,
3812 * and will be smaller than 64x64.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003813 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003814 * <pre><code>width,height = [ 4, 3 ]
3815 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003816 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003817 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3818 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3819 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3820 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3821 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003822 * </code></pre>
3823 * <p>The low-resolution scaling map images for each channel are
3824 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003825 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3826 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3827 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3828 * <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 -08003829 * <p>As a visualization only, inverting the full-color map to recover an
3830 * 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 -08003831 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003832 * <p><b>Range of valid values:</b><br>
3833 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003834 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3835 * <p><b>Full capability</b> -
3836 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3837 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003838 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003839 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003840 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003841 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003842 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003843 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003844 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3845 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3846
3847 /**
3848 * <p>The shading map is a low-resolution floating-point map
Zhijun He43210fe2016-04-12 23:15:23 -07003849 * that lists the coefficients used to correct for vignetting and color shading,
3850 * for each Bayer color channel of RAW image data.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003851 * <p>The map provided here is the same map that is used by the camera device to
3852 * correct both color shading and vignetting for output non-RAW images.</p>
3853 * <p>When there is no lens shading correction applied to RAW
3854 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3855 * false), this map is the complete lens shading correction
3856 * map; when there is some lens shading correction applied to
3857 * 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
3858 * correction map that needs to be applied to get shading
3859 * corrected images that match the camera device's output for
3860 * non-RAW formats.</p>
3861 * <p>For a complete shading correction map, the least shaded
3862 * section of the image will have a gain factor of 1; all
3863 * other sections will have gains above 1.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003864 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003865 * will take into account the colorCorrection settings.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003866 * <p>The shading map is for the entire active pixel array, and is not
3867 * affected by the crop region specified in the request. Each shading map
3868 * entry is the value of the shading compensation map over a specific
3869 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3870 * map, and an active pixel array size (W x H), shading map entry
3871 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3872 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3873 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3874 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3875 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3876 * The shading map is stored in a fully interleaved format, and its size
3877 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003878 * <p>The shading map will generally have on the order of 30-40 rows and columns,
3879 * and will be smaller than 64x64.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003880 * <p>As an example, given a very small map defined as:</p>
3881 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3882 * android.statistics.lensShadingMap =
3883 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003884 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3885 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3886 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3887 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3888 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003889 * </code></pre>
3890 * <p>The low-resolution scaling map images for each channel are
3891 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003892 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3893 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3894 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3895 * <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 -07003896 * <p>As a visualization only, inverting the full-color map to recover an
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003897 * image of a gray wall (using bicubic interpolation for visual quality)
3898 * as captured by the sensor gives:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003899 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003900 * <p>Note that the RAW image data might be subject to lens shading
3901 * correction not reported on this map. Query
3902 * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject
3903 * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}
3904 * is TRUE, the RAW image data is subject to partial or full lens shading
3905 * correction. In the case full lens shading correction is applied to RAW
3906 * images, the gain factor map reported in this key will contain all 1.0 gains.
3907 * In other words, the map reported in this key is the remaining lens shading
3908 * that needs to be applied on the RAW image to get images without lens shading
3909 * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image
3910 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003911 * <p><b>Range of valid values:</b><br>
3912 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003913 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3914 * <p><b>Full capability</b> -
3915 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3916 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003917 *
3918 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003919 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003920 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
3921 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003922 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003923 */
3924 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3925 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3926
3927 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003928 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003929 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003930 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003931 * since statistics processing on data from a new frame
3932 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003933 * applied to that frame.</p>
3934 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003935 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003936 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003937 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003938 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003939 *
3940 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003941 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003942 * <p>Never fully implemented or specified; do not use</p>
3943
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003944 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003945 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003946 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003947 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3948 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3949
3950 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003951 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08003952 * calculated by the camera device's statistics units for the current
3953 * output frame.</p>
3954 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003955 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08003956 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003957 * are the best fit for the current output frame. This may
3958 * be different than the transform used for this frame, since
3959 * statistics processing on data from a new frame typically
3960 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003961 * that frame.</p>
3962 * <p>These estimates must be provided for all frames, even if
3963 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003964 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003965 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003966 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003967 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003968 * <p>Never fully implemented or specified; do not use</p>
3969
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003970 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003971 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003972 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003973 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3974 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3975
3976 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08003977 * <p>The camera device estimated scene illumination lighting
3978 * frequency.</p>
3979 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3980 * that depends on the local utility power standards. This flicker must be
3981 * accounted for by auto-exposure routines to avoid artifacts in captured images.
3982 * The camera device uses this entry to tell the application what the scene
3983 * illuminant frequency is.</p>
3984 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003985 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3986 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3987 * antibanding, and the application can ensure it selects
3988 * exposure times that do not cause banding issues by looking
3989 * into this metadata field. See
3990 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3991 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003992 * <p><b>Possible values:</b>
3993 * <ul>
3994 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3995 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3996 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3997 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003998 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3999 * <p><b>Full capability</b> -
4000 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4001 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08004002 *
4003 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
4004 * @see CaptureRequest#CONTROL_AE_MODE
4005 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004006 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004007 * @see #STATISTICS_SCENE_FLICKER_NONE
4008 * @see #STATISTICS_SCENE_FLICKER_50HZ
4009 * @see #STATISTICS_SCENE_FLICKER_60HZ
4010 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004011 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004012 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
4013 new Key<Integer>("android.statistics.sceneFlicker", int.class);
4014
4015 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004016 * <p>Operating mode for hot pixel map generation.</p>
4017 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
4018 * If set to <code>false</code>, no hot pixel map will be returned.</p>
4019 * <p><b>Range of valid values:</b><br>
4020 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004021 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004022 *
4023 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
4024 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
4025 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004026 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004027 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
4028 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
4029
4030 /**
4031 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
4032 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
4033 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
4034 * bottom-right of the pixel array, respectively. The width and
4035 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
4036 * This may include hot pixels that lie outside of the active array
4037 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004038 * <p><b>Range of valid values:</b><br></p>
4039 * <p>n &lt;= number of pixels on the sensor.
4040 * The <code>(x, y)</code> coordinates must be bounded by
4041 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004042 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004043 *
4044 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
4045 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
4046 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004047 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004048 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
4049 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08004050
4051 /**
Zhijun He379af012014-05-06 11:54:54 -07004052 * <p>Whether the camera device will output the lens
4053 * shading map in output result metadata.</p>
4054 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07004055 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07004056 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004057 * <p>ON is always supported on devices with the RAW capability.</p>
4058 * <p><b>Possible values:</b>
4059 * <ul>
4060 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
4061 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
4062 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004063 * <p><b>Available values for this device:</b><br>
4064 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004065 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4066 * <p><b>Full capability</b> -
4067 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4068 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4069 *
4070 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08004071 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Zhijun He379af012014-05-06 11:54:54 -07004072 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
4073 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
4074 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004075 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07004076 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
4077 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
4078
4079 /**
Eino-Ville Talvala601e0f62018-02-05 16:25:40 -08004080 * <p>A control for selecting whether OIS position information is included in output
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004081 * result metadata.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004082 * <p><b>Possible values:</b>
4083 * <ul>
4084 * <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li>
4085 * <li>{@link #STATISTICS_OIS_DATA_MODE_ON ON}</li>
4086 * </ul></p>
4087 * <p><b>Available values for this device:</b><br>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07004088 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES android.statistics.info.availableOisDataModes}</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004089 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07004090 *
4091 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004092 * @see #STATISTICS_OIS_DATA_MODE_OFF
4093 * @see #STATISTICS_OIS_DATA_MODE_ON
4094 */
4095 @PublicKey
4096 public static final Key<Integer> STATISTICS_OIS_DATA_MODE =
4097 new Key<Integer>("android.statistics.oisDataMode", int.class);
4098
4099 /**
4100 * <p>An array of timestamps of OIS samples, in nanoseconds.</p>
4101 * <p>The array contains the timestamps of OIS samples. The timestamps are in the same
4102 * timebase as and comparable to {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp}.</p>
4103 * <p><b>Units</b>: nanoseconds</p>
4104 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4105 *
4106 * @see CaptureResult#SENSOR_TIMESTAMP
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004107 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004108 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004109 public static final Key<long[]> STATISTICS_OIS_TIMESTAMPS =
4110 new Key<long[]>("android.statistics.oisTimestamps", long[].class);
4111
4112 /**
4113 * <p>An array of shifts of OIS samples, in x direction.</p>
4114 * <p>The array contains the amount of shifts in x direction, in pixels, based on OIS samples.
4115 * A positive value is a shift from left to right in active array coordinate system. For
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004116 * example, if the optical center is (1000, 500) in active array coordinates, a shift of
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004117 * (3, 0) puts the new optical center at (1003, 500).</p>
4118 * <p>The number of shifts must match the number of timestamps in
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004119 * android.statistics.oisTimestamps.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004120 * <p><b>Units</b>: Pixels in active array.</p>
4121 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004122 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004123 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004124 public static final Key<float[]> STATISTICS_OIS_X_SHIFTS =
4125 new Key<float[]>("android.statistics.oisXShifts", float[].class);
4126
4127 /**
4128 * <p>An array of shifts of OIS samples, in y direction.</p>
4129 * <p>The array contains the amount of shifts in y direction, in pixels, based on OIS samples.
4130 * A positive value is a shift from top to bottom in active array coordinate system. For
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004131 * example, if the optical center is (1000, 500) in active array coordinates, a shift of
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004132 * (0, 5) puts the new optical center at (1000, 505).</p>
4133 * <p>The number of shifts must match the number of timestamps in
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004134 * android.statistics.oisTimestamps.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004135 * <p><b>Units</b>: Pixels in active array.</p>
4136 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004137 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004138 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004139 public static final Key<float[]> STATISTICS_OIS_Y_SHIFTS =
4140 new Key<float[]>("android.statistics.oisYShifts", float[].class);
4141
4142 /**
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004143 * <p>An array of OIS samples.</p>
4144 * <p>Each OIS sample contains the timestamp and the amount of shifts in x and y direction,
4145 * in pixels, of the OIS sample.</p>
4146 * <p>A positive value for a shift in x direction is a shift from left to right in active array
4147 * coordinate system. For example, if the optical center is (1000, 500) in active array
4148 * coordinates, a shift of (3, 0) puts the new optical center at (1003, 500).</p>
4149 * <p>A positive value for a shift in y direction is a shift from top to bottom in active array
4150 * coordinate system. For example, if the optical center is (1000, 500) in active array
4151 * coordinates, a shift of (0, 5) puts the new optical center at (1000, 505).</p>
4152 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4153 */
4154 @PublicKey
4155 @SyntheticKey
4156 public static final Key<android.hardware.camera2.params.OisSample[]> STATISTICS_OIS_SAMPLES =
4157 new Key<android.hardware.camera2.params.OisSample[]>("android.statistics.oisSamples", android.hardware.camera2.params.OisSample[].class);
4158
4159 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004160 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08004161 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4162 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004163 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004164 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4165 * <p><b>Full capability</b> -
4166 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4167 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004168 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004169 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004170 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004171 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004172 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004173 public static final Key<float[]> TONEMAP_CURVE_BLUE =
4174 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004175
4176 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004177 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08004178 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4179 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004180 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004181 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4182 * <p><b>Full capability</b> -
4183 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4184 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004185 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004186 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004187 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004188 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004189 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004190 public static final Key<float[]> TONEMAP_CURVE_GREEN =
4191 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004192
4193 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004194 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08004195 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4196 * CONTRAST_CURVE.</p>
4197 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004198 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004199 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08004200 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004201 * <p>These are sorted in order of increasing <code>Pin</code>; it is
4202 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08004203 * define a complete mapping. For input values between control points,
4204 * the camera device must linearly interpolate between the control
4205 * points.</p>
4206 * <p>Each curve can have an independent number of points, and the number
4207 * of points can be less than max (that is, the request doesn't have to
4208 * always provide a curve with number of points equivalent to
4209 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wang51248bf2018-03-22 00:04:45 -07004210 * <p>For devices with MONOCHROME capability, only red channel is used. Green and blue channels
4211 * are ignored.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08004212 * <p>A few examples, and their corresponding graphical mappings; these
4213 * only specify the red channel and the precision is limited to 4
4214 * digits, for conciseness.</p>
4215 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004216 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004217 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004218 * <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 -08004219 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004220 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004221 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004222 * <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 -08004223 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004224 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004225 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
4226 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
4227 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
4228 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004229 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004230 * <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 -08004231 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004232 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004233 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
4234 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
4235 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
4236 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004237 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004238 * <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 -07004239 * <p><b>Range of valid values:</b><br>
4240 * 0-1 on both input and output coordinates, normalized
4241 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004242 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4243 * <p><b>Full capability</b> -
4244 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4245 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004246 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004247 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08004248 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004249 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004250 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004251 */
4252 public static final Key<float[]> TONEMAP_CURVE_RED =
4253 new Key<float[]>("android.tonemap.curveRed", float[].class);
4254
4255 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004256 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
4257 * is CONTRAST_CURVE.</p>
4258 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
4259 * channels respectively. The following example uses the red channel as an
4260 * example. The same logic applies to green and blue channel.
4261 * Each channel's curve is defined by an array of control points:</p>
4262 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004263 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004264 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
4265 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
4266 * guaranteed that input values 0.0 and 1.0 are included in the list to
4267 * define a complete mapping. For input values between control points,
4268 * the camera device must linearly interpolate between the control
4269 * points.</p>
4270 * <p>Each curve can have an independent number of points, and the number
4271 * of points can be less than max (that is, the request doesn't have to
4272 * always provide a curve with number of points equivalent to
4273 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wang51248bf2018-03-22 00:04:45 -07004274 * <p>For devices with MONOCHROME capability, only red channel is used. Green and blue channels
4275 * are ignored.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004276 * <p>A few examples, and their corresponding graphical mappings; these
4277 * only specify the red channel and the precision is limited to 4
4278 * digits, for conciseness.</p>
4279 * <p>Linear mapping:</p>
4280 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
4281 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004282 * <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 -07004283 * <p>Invert mapping:</p>
4284 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
4285 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004286 * <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 -07004287 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
4288 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004289 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
4290 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
4291 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
4292 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004293 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004294 * <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 -07004295 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
4296 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004297 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
4298 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
4299 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
4300 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004301 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004302 * <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 -07004303 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4304 * <p><b>Full capability</b> -
4305 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4306 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004307 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004308 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004309 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
4310 * @see CaptureRequest#TONEMAP_MODE
4311 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004312 @PublicKey
4313 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004314 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
4315 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
4316
4317 /**
Igor Murashkine0060932014-01-17 17:24:11 -08004318 * <p>High-level global contrast/gamma/tonemapping control.</p>
4319 * <p>When switching to an application-defined contrast curve by setting
4320 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
4321 * per-channel with a set of <code>(in, out)</code> points that specify the
4322 * mapping from input high-bit-depth pixel value to the output
4323 * low-bit-depth value. Since the actual pixel ranges of both input
4324 * and output may change depending on the camera pipeline, the values
4325 * are specified by normalized floating-point numbers.</p>
4326 * <p>More-complex color mapping operations such as 3D color look-up
4327 * tables, selective chroma enhancement, or other non-linear color
4328 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4329 * CONTRAST_CURVE.</p>
4330 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004331 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08004332 * These values are always available, and as close as possible to the
4333 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07004334 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08004335 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
4336 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004337 * <p><b>Possible values:</b>
4338 * <ul>
4339 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
4340 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
4341 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004342 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
4343 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004344 * </ul></p>
4345 * <p><b>Available values for this device:</b><br>
4346 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004347 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4348 * <p><b>Full capability</b> -
4349 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4350 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08004351 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004352 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08004353 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004354 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08004355 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004356 * @see #TONEMAP_MODE_CONTRAST_CURVE
4357 * @see #TONEMAP_MODE_FAST
4358 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004359 * @see #TONEMAP_MODE_GAMMA_VALUE
4360 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004361 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004362 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004363 public static final Key<Integer> TONEMAP_MODE =
4364 new Key<Integer>("android.tonemap.mode", int.class);
4365
4366 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004367 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4368 * GAMMA_VALUE</p>
4369 * <p>The tonemap curve will be defined the following formula:
4370 * * OUT = pow(IN, 1.0 / gamma)
4371 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
4372 * pow is the power function and gamma is the gamma value specified by this
4373 * key.</p>
4374 * <p>The same curve will be applied to all color channels. The camera device
4375 * may clip the input gamma value to its supported range. The actual applied
4376 * value will be returned in capture result.</p>
4377 * <p>The valid range of gamma value varies on different devices, but values
4378 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
4379 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4380 *
4381 * @see CaptureRequest#TONEMAP_MODE
4382 */
4383 @PublicKey
4384 public static final Key<Float> TONEMAP_GAMMA =
4385 new Key<Float>("android.tonemap.gamma", float.class);
4386
4387 /**
4388 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4389 * PRESET_CURVE</p>
4390 * <p>The tonemap curve will be defined by specified standard.</p>
4391 * <p>sRGB (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004392 * <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 -08004393 * <p>Rec. 709 (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004394 * <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 -08004395 * <p>Note that above figures show a 16 control points approximation of preset
4396 * curves. Camera devices may apply a different approximation to the curve.</p>
4397 * <p><b>Possible values:</b>
4398 * <ul>
4399 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
4400 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
4401 * </ul></p>
4402 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4403 *
4404 * @see CaptureRequest#TONEMAP_MODE
4405 * @see #TONEMAP_PRESET_CURVE_SRGB
4406 * @see #TONEMAP_PRESET_CURVE_REC709
4407 */
4408 @PublicKey
4409 public static final Key<Integer> TONEMAP_PRESET_CURVE =
4410 new Key<Integer>("android.tonemap.presetCurve", int.class);
4411
4412 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004413 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004414 * that the camera is powered on and may be streaming images back to the
4415 * Application Processor. In certain rare circumstances, the OS may
4416 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08004417 * any untrusted applications.</p>
4418 * <p>In particular, the LED <em>must</em> always be on when the data could be
4419 * transmitted off the device. The LED <em>should</em> always be on whenever
4420 * data is stored locally on the device.</p>
4421 * <p>The LED <em>may</em> be off if a trusted application is using the data that
4422 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004423 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004424 * @hide
4425 */
4426 public static final Key<Boolean> LED_TRANSMIT =
4427 new Key<Boolean>("android.led.transmit", boolean.class);
4428
4429 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004430 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08004431 * to its current values, or is free to vary.</p>
4432 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004433 * 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 -08004434 * a change in other capture settings forced the camera device to
4435 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004436 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4437 * <p><b>Full capability</b> -
4438 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4439 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004440 *
4441 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004442 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004443 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004444 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004445 public static final Key<Boolean> BLACK_LEVEL_LOCK =
4446 new Key<Boolean>("android.blackLevel.lock", boolean.class);
4447
Igor Murashkin3865a842014-01-17 18:18:39 -08004448 /**
4449 * <p>The frame number corresponding to the last request
4450 * with which the output result (metadata + buffers) has been fully
4451 * synchronized.</p>
4452 * <p>When a request is submitted to the camera device, there is usually a
4453 * delay of several frames before the controls get applied. A camera
4454 * device may either choose to account for this delay by implementing a
4455 * pipeline and carefully submit well-timed atomic control updates, or
4456 * it may start streaming control changes that span over several frame
4457 * boundaries.</p>
4458 * <p>In the latter case, whenever a request's settings change relative to
4459 * the previous submitted request, the full set of changes may take
4460 * multiple frame durations to fully take effect. Some settings may
4461 * take effect sooner (in less frame durations) than others.</p>
4462 * <p>While a set of control changes are being propagated, this value
4463 * will be CONVERGING.</p>
4464 * <p>Once it is fully known that a set of control changes have been
4465 * finished propagating, and the resulting updated control settings
4466 * have been read back by the camera device, this value will be set
4467 * to a non-negative frame number (corresponding to the request to
4468 * which the results have synchronized to).</p>
4469 * <p>Older camera device implementations may not have a way to detect
4470 * when all camera controls have been applied, and will always set this
4471 * value to UNKNOWN.</p>
4472 * <p>FULL capability devices will always have this value set to the
4473 * frame number of the request corresponding to this result.</p>
4474 * <p><em>Further details</em>:</p>
4475 * <ul>
4476 * <li>Whenever a request differs from the last request, any future
4477 * results not yet returned may have this value set to CONVERGING (this
4478 * could include any in-progress captures not yet returned by the camera
4479 * device, for more details see pipeline considerations below).</li>
4480 * <li>Submitting a series of multiple requests that differ from the
4481 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
4482 * moves the new synchronization frame to the last non-repeating
4483 * request (using the smallest frame number from the contiguous list of
4484 * repeating requests).</li>
4485 * <li>Submitting the same request repeatedly will not change this value
4486 * to CONVERGING, if it was already a non-negative value.</li>
4487 * <li>When this value changes to non-negative, that means that all of the
4488 * metadata controls from the request have been applied, all of the
4489 * metadata controls from the camera device have been read to the
4490 * updated values (into the result), and all of the graphics buffers
4491 * corresponding to this result are also synchronized to the request.</li>
4492 * </ul>
4493 * <p><em>Pipeline considerations</em>:</p>
4494 * <p>Submitting a request with updated controls relative to the previously
4495 * submitted requests may also invalidate the synchronization state
4496 * of all the results corresponding to currently in-flight requests.</p>
4497 * <p>In other words, results for this current request and up to
4498 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
4499 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004500 * <p><b>Possible values:</b>
4501 * <ul>
4502 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
4503 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
4504 * </ul></p>
4505 * <p><b>Available values for this device:</b><br>
4506 * Either a non-negative value corresponding to a
4507 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004508 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08004509 *
4510 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
4511 * @see #SYNC_FRAME_NUMBER_CONVERGING
4512 * @see #SYNC_FRAME_NUMBER_UNKNOWN
4513 * @hide
4514 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07004515 public static final Key<Long> SYNC_FRAME_NUMBER =
4516 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08004517
Zhijun He0e99c222015-01-29 15:26:05 -08004518 /**
4519 * <p>The amount of exposure time increase factor applied to the original output
4520 * frame by the application processing before sending for reprocessing.</p>
4521 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
4522 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
4523 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
4524 * output frames to effectively reduce the noise to the same level as a frame that was
4525 * captured with longer exposure time. To be more specific, assuming the original captured
4526 * images were captured with a sensitivity of S and an exposure time of T, the model in
4527 * the camera device is that the amount of noise in the image would be approximately what
4528 * would be expected if the original capture parameters had been a sensitivity of
4529 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
4530 * than S and T respectively. If the captured images were processed by the application
4531 * before being sent for reprocessing, then the application may have used image processing
4532 * algorithms and/or multi-frame image fusion to reduce the noise in the
4533 * application-processed images (input images). By using the effectiveExposureFactor
4534 * control, the application can communicate to the camera device the actual noise level
4535 * improvement in the application-processed image. With this information, the camera
4536 * device can select appropriate noise reduction and edge enhancement parameters to avoid
4537 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
4538 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
4539 * <p>For example, for multi-frame image fusion use case, the application may fuse
4540 * multiple output frames together to a final frame for reprocessing. When N image are
4541 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
4542 * square root of N (based on a simple photon shot noise model). The camera device will
4543 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
4544 * produce the best quality images.</p>
4545 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
4546 * buffer in a way that affects its effective exposure time.</p>
4547 * <p>This control is only effective for YUV reprocessing capture request. For noise
4548 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
4549 * Similarly, for edge enhancement reprocessing, it is only effective when
4550 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
4551 * <p><b>Units</b>: Relative exposure time increase factor.</p>
4552 * <p><b>Range of valid values:</b><br>
4553 * &gt;= 1.0</p>
4554 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07004555 * <p><b>Limited capability</b> -
4556 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4557 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0e99c222015-01-29 15:26:05 -08004558 *
4559 * @see CaptureRequest#EDGE_MODE
Zhijun He513f7c32015-04-24 18:23:54 -07004560 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08004561 * @see CaptureRequest#NOISE_REDUCTION_MODE
4562 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
4563 */
4564 @PublicKey
4565 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
4566 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
4567
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004568 /**
4569 * <p>Mode of operation for the lens distortion correction block.</p>
4570 * <p>The lens distortion correction block attempts to improve image quality by fixing
4571 * radial, tangential, or other geometric aberrations in the camera device's optics. If
4572 * available, the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} field documents the lens's distortion parameters.</p>
4573 * <p>OFF means no distortion correction is done.</p>
4574 * <p>FAST/HIGH_QUALITY both mean camera device determined distortion correction will be
4575 * applied. HIGH_QUALITY mode indicates that the camera device will use the highest-quality
4576 * correction algorithms, even if it slows down capture rate. FAST means the camera device
4577 * will not slow down capture rate when applying correction. FAST may be the same as OFF if
4578 * any correction at all would slow down capture rate. Every output stream will have a
4579 * similar amount of enhancement applied.</p>
4580 * <p>The correction only applies to processed outputs such as YUV, JPEG, or DEPTH16; it is not
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004581 * applied to any RAW output. Metadata coordinates such as face rectangles or metering
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004582 * regions are also not affected by correction.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004583 * <p>This control will be on by default on devices that support this control. Applications
4584 * disabling distortion correction need to pay extra attention with the coordinate system of
4585 * metering regions, crop region, and face rectangles. When distortion correction is OFF,
4586 * metadata coordinates follow the coordinate system of
4587 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}. When distortion is not OFF, metadata
4588 * coordinates follow the coordinate system of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004589 * <p><b>Possible values:</b>
4590 * <ul>
4591 * <li>{@link #DISTORTION_CORRECTION_MODE_OFF OFF}</li>
4592 * <li>{@link #DISTORTION_CORRECTION_MODE_FAST FAST}</li>
4593 * <li>{@link #DISTORTION_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
4594 * </ul></p>
4595 * <p><b>Available values for this device:</b><br>
4596 * {@link CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES android.distortionCorrection.availableModes}</p>
4597 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4598 *
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004599 * @see CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES
4600 * @see CameraCharacteristics#LENS_DISTORTION
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07004601 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
4602 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004603 * @see #DISTORTION_CORRECTION_MODE_OFF
4604 * @see #DISTORTION_CORRECTION_MODE_FAST
4605 * @see #DISTORTION_CORRECTION_MODE_HIGH_QUALITY
4606 */
4607 @PublicKey
4608 public static final Key<Integer> DISTORTION_CORRECTION_MODE =
4609 new Key<Integer>("android.distortionCorrection.mode", int.class);
4610
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004611 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
4612 * End generated code
4613 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07004614
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004615
4616
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08004617}