blob: 6439338428ee3070d80996b5fee56b7253f1304e [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>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800733 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700734 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800735 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
736 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700737 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700738 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700739 * for every pixel in the area. This means that a large metering area
740 * with the same weight as a smaller area will have more effect in
741 * the metering result. Metering areas can partially overlap and the
742 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700743 * <p>The weights are relative to weights of other exposure metering regions, so if only one
744 * region is used, all non-zero weights will have the same effect. A region with 0
745 * weight is ignored.</p>
746 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
747 * camera device.</p>
748 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
749 * capture result metadata, the camera device will ignore the sections outside the crop
750 * region and output only the intersection rectangle as the metering region in the result
751 * metadata. If the region is entirely outside the crop region, it will be ignored and
752 * not reported in the result metadata.</p>
753 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
754 * <p><b>Range of valid values:</b><br>
755 * Coordinates must be between <code>[(0,0), (width, height))</code> of
756 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700757 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800758 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700759 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800760 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800761 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700762 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700763 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700764 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
765 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700766
767 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700768 * <p>Range over which the auto-exposure routine can
769 * adjust the capture frame rate to maintain good
770 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700771 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700772 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
773 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
774 * <p><b>Units</b>: Frames per second (FPS)</p>
775 * <p><b>Range of valid values:</b><br>
776 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
777 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700778 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700779 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Zhijun He379af012014-05-06 11:54:54 -0700780 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700781 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He379af012014-05-06 11:54:54 -0700782 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700783 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700784 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
785 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700786
787 /**
788 * <p>Whether the camera device will trigger a precapture
789 * metering sequence when it processes this request.</p>
790 * <p>This entry is normally set to IDLE, or is not
791 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -0800792 * set to START, the camera device will trigger the auto-exposure (AE)
Zhijun He379af012014-05-06 11:54:54 -0700793 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -0800794 * <p>When set to CANCEL, the camera device will cancel any active
795 * precapture metering trigger, and return to its initial AE state.
796 * If a precapture metering sequence is already completed, and the camera
797 * device has implicitly locked the AE for subsequent still capture, the
798 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800799 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700800 * high-quality still capture for final metering decisions to
801 * be made, and for firing pre-capture flash pulses to estimate
802 * scene brightness and required final capture flash power, when
803 * the flash is enabled.</p>
804 * <p>Normally, this entry should be set to START for only a
805 * single request, and the application should wait until the
806 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800807 * <p>When a precapture metering sequence is finished, the camera device
808 * may lock the auto-exposure routine internally to be able to accurately expose the
809 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
810 * For this case, the AE may not resume normal scan if no subsequent still capture is
811 * submitted. To ensure that the AE routine restarts normal scan, the application should
812 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
813 * 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 -0800814 * still capture request after the precapture sequence completes. Alternatively, for
815 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
816 * internally locked AE if the application doesn't submit a still capture request after
817 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
818 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700819 * <p>The exact effect of auto-exposure (AE) precapture trigger
820 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700821 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
822 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700823 * <p>On LEGACY-level devices, the precapture trigger is not supported;
824 * capturing a high-resolution JPEG image will automatically trigger a
825 * precapture sequence before the high-resolution capture, including
826 * potentially firing a pre-capture flash.</p>
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -0700827 * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
828 * simultaneously is allowed. However, since these triggers often require cooperation between
829 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
830 * focus sweep), the camera device may delay acting on a later trigger until the previous
831 * trigger has been fully handled. This may lead to longer intervals between the trigger and
832 * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for
833 * example.</p>
834 * <p>If both the precapture and the auto-focus trigger are activated on the same request, then
835 * the camera device will complete them in the optimal order for that device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700836 * <p><b>Possible values:</b>
837 * <ul>
838 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
839 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -0800840 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700841 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700842 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
843 * <p><b>Limited capability</b> -
844 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
845 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700846 *
Zhijun Hedd72be52015-02-06 13:49:51 -0800847 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He379af012014-05-06 11:54:54 -0700848 * @see CaptureResult#CONTROL_AE_STATE
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -0700849 * @see CaptureRequest#CONTROL_AF_TRIGGER
Zhijun Hedd72be52015-02-06 13:49:51 -0800850 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700851 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700852 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
853 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -0800854 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Zhijun He379af012014-05-06 11:54:54 -0700855 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700856 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700857 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
858 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
859
860 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700861 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800862 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
863 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
864 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
865 * the algorithm states to INACTIVE.</p>
866 * <p>The camera device can do several state transitions between two results, if it is
867 * allowed by the state transition table. For example: INACTIVE may never actually be
868 * seen in a result.</p>
869 * <p>The state in the result is the state for this image (in sync with this image): if
870 * AE state becomes CONVERGED, then the image data associated with this result should
871 * be good to use.</p>
872 * <p>Below are state transition tables for different AE modes.</p>
873 * <table>
874 * <thead>
875 * <tr>
876 * <th align="center">State</th>
877 * <th align="center">Transition Cause</th>
878 * <th align="center">New State</th>
879 * <th align="center">Notes</th>
880 * </tr>
881 * </thead>
882 * <tbody>
883 * <tr>
884 * <td align="center">INACTIVE</td>
885 * <td align="center"></td>
886 * <td align="center">INACTIVE</td>
887 * <td align="center">Camera device auto exposure algorithm is disabled</td>
888 * </tr>
889 * </tbody>
890 * </table>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800891 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON*:</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800892 * <table>
893 * <thead>
894 * <tr>
895 * <th align="center">State</th>
896 * <th align="center">Transition Cause</th>
897 * <th align="center">New State</th>
898 * <th align="center">Notes</th>
899 * </tr>
900 * </thead>
901 * <tbody>
902 * <tr>
903 * <td align="center">INACTIVE</td>
904 * <td align="center">Camera device initiates AE scan</td>
905 * <td align="center">SEARCHING</td>
906 * <td align="center">Values changing</td>
907 * </tr>
908 * <tr>
909 * <td align="center">INACTIVE</td>
910 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
911 * <td align="center">LOCKED</td>
912 * <td align="center">Values locked</td>
913 * </tr>
914 * <tr>
915 * <td align="center">SEARCHING</td>
916 * <td align="center">Camera device finishes AE scan</td>
917 * <td align="center">CONVERGED</td>
918 * <td align="center">Good values, not changing</td>
919 * </tr>
920 * <tr>
921 * <td align="center">SEARCHING</td>
922 * <td align="center">Camera device finishes AE scan</td>
923 * <td align="center">FLASH_REQUIRED</td>
924 * <td align="center">Converged but too dark w/o flash</td>
925 * </tr>
926 * <tr>
927 * <td align="center">SEARCHING</td>
928 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
929 * <td align="center">LOCKED</td>
930 * <td align="center">Values locked</td>
931 * </tr>
932 * <tr>
933 * <td align="center">CONVERGED</td>
934 * <td align="center">Camera device initiates AE scan</td>
935 * <td align="center">SEARCHING</td>
936 * <td align="center">Values changing</td>
937 * </tr>
938 * <tr>
939 * <td align="center">CONVERGED</td>
940 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
941 * <td align="center">LOCKED</td>
942 * <td align="center">Values locked</td>
943 * </tr>
944 * <tr>
945 * <td align="center">FLASH_REQUIRED</td>
946 * <td align="center">Camera device initiates AE scan</td>
947 * <td align="center">SEARCHING</td>
948 * <td align="center">Values changing</td>
949 * </tr>
950 * <tr>
951 * <td align="center">FLASH_REQUIRED</td>
952 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
953 * <td align="center">LOCKED</td>
954 * <td align="center">Values locked</td>
955 * </tr>
956 * <tr>
957 * <td align="center">LOCKED</td>
958 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
959 * <td align="center">SEARCHING</td>
960 * <td align="center">Values not good after unlock</td>
961 * </tr>
962 * <tr>
963 * <td align="center">LOCKED</td>
964 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
965 * <td align="center">CONVERGED</td>
966 * <td align="center">Values good after unlock</td>
967 * </tr>
968 * <tr>
969 * <td align="center">LOCKED</td>
970 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
971 * <td align="center">FLASH_REQUIRED</td>
972 * <td align="center">Exposure good, but too dark</td>
973 * </tr>
974 * <tr>
975 * <td align="center">PRECAPTURE</td>
976 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
977 * <td align="center">CONVERGED</td>
978 * <td align="center">Ready for high-quality capture</td>
979 * </tr>
980 * <tr>
981 * <td align="center">PRECAPTURE</td>
982 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
983 * <td align="center">LOCKED</td>
984 * <td align="center">Ready for high-quality capture</td>
985 * </tr>
986 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800987 * <td align="center">LOCKED</td>
988 * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td>
989 * <td align="center">LOCKED</td>
990 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
991 * </tr>
992 * <tr>
993 * <td align="center">LOCKED</td>
994 * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</td>
995 * <td align="center">LOCKED</td>
996 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
997 * </tr>
998 * <tr>
999 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001000 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
1001 * <td align="center">PRECAPTURE</td>
1002 * <td align="center">Start AE precapture metering sequence</td>
1003 * </tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001004 * <tr>
1005 * <td align="center">Any state (excluding LOCKED)</td>
1006 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td>
1007 * <td align="center">INACTIVE</td>
1008 * <td align="center">Currently active precapture metering sequence is canceled</td>
1009 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001010 * </tbody>
1011 * </table>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001012 * <p>If the camera device supports AE external flash mode (ON_EXTERNAL_FLASH is included in
Chien-Yu Chenc9ca7222018-03-15 11:14:29 -07001013 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}), {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} must be FLASH_REQUIRED after
1014 * the camera device finishes AE scan and it's too dark without flash.</p>
Zhijun He60b19dc2014-02-24 10:19:20 -08001015 * <p>For the above table, the camera device may skip reporting any state changes that happen
1016 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1017 * can be skipped in that manner is called a transient state.</p>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001018 * <p>For example, for above AE modes (AE_MODE_ON*), in addition to the state transitions
Zhijun He60b19dc2014-02-24 10:19:20 -08001019 * listed in above table, it is also legal for the camera device to skip one or more
1020 * transient states between two results. See below table for examples:</p>
1021 * <table>
1022 * <thead>
1023 * <tr>
1024 * <th align="center">State</th>
1025 * <th align="center">Transition Cause</th>
1026 * <th align="center">New State</th>
1027 * <th align="center">Notes</th>
1028 * </tr>
1029 * </thead>
1030 * <tbody>
1031 * <tr>
1032 * <td align="center">INACTIVE</td>
1033 * <td align="center">Camera device finished AE scan</td>
1034 * <td align="center">CONVERGED</td>
1035 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1036 * </tr>
1037 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001038 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001039 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
1040 * <td align="center">FLASH_REQUIRED</td>
1041 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
1042 * </tr>
1043 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001044 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001045 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
1046 * <td align="center">CONVERGED</td>
1047 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
1048 * </tr>
1049 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001050 * <td align="center">Any state (excluding LOCKED)</td>
1051 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1052 * <td align="center">FLASH_REQUIRED</td>
1053 * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td>
1054 * </tr>
1055 * <tr>
1056 * <td align="center">Any state (excluding LOCKED)</td>
1057 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1058 * <td align="center">CONVERGED</td>
1059 * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td>
1060 * </tr>
1061 * <tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001062 * <td align="center">CONVERGED</td>
1063 * <td align="center">Camera device finished AE scan</td>
1064 * <td align="center">FLASH_REQUIRED</td>
1065 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
1066 * </tr>
1067 * <tr>
1068 * <td align="center">FLASH_REQUIRED</td>
1069 * <td align="center">Camera device finished AE scan</td>
1070 * <td align="center">CONVERGED</td>
1071 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
1072 * </tr>
1073 * </tbody>
1074 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001075 * <p><b>Possible values:</b>
1076 * <ul>
1077 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
1078 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
1079 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
1080 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
1081 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
1082 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
1083 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001084 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1085 * <p><b>Limited capability</b> -
1086 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1087 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001088 *
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001089 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He228f4f92014-01-16 17:22:05 -08001090 * @see CaptureRequest#CONTROL_AE_LOCK
1091 * @see CaptureRequest#CONTROL_AE_MODE
1092 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Chien-Yu Chenc9ca7222018-03-15 11:14:29 -07001093 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He228f4f92014-01-16 17:22:05 -08001094 * @see CaptureRequest#CONTROL_MODE
1095 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001096 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001097 * @see #CONTROL_AE_STATE_INACTIVE
1098 * @see #CONTROL_AE_STATE_SEARCHING
1099 * @see #CONTROL_AE_STATE_CONVERGED
1100 * @see #CONTROL_AE_STATE_LOCKED
1101 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
1102 * @see #CONTROL_AE_STATE_PRECAPTURE
1103 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001104 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001105 public static final Key<Integer> CONTROL_AE_STATE =
1106 new Key<Integer>("android.control.aeState", int.class);
1107
1108 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001109 * <p>Whether auto-focus (AF) is currently enabled, and what
1110 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001111 * <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 -08001112 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1113 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1114 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1115 * 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 -08001116 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001117 * 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 -07001118 * in result metadata.</p>
1119 * <p><b>Possible values:</b>
1120 * <ul>
1121 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1122 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1123 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1124 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1125 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1126 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1127 * </ul></p>
1128 * <p><b>Available values for this device:</b><br>
1129 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1130 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001131 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001132 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001133 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001134 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001135 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001136 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001137 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001138 * @see #CONTROL_AF_MODE_OFF
1139 * @see #CONTROL_AF_MODE_AUTO
1140 * @see #CONTROL_AF_MODE_MACRO
1141 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1142 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1143 * @see #CONTROL_AF_MODE_EDOF
1144 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001145 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001146 public static final Key<Integer> CONTROL_AF_MODE =
1147 new Key<Integer>("android.control.afMode", int.class);
1148
1149 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001150 * <p>List of metering areas to use for auto-focus.</p>
1151 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001152 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001153 * <p>The maximum number of focus areas supported by the device is determined by the value
1154 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001155 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001156 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001157 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1158 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001159 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001160 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001161 * for every pixel in the area. This means that a large metering area
1162 * with the same weight as a smaller area will have more effect in
1163 * the metering result. Metering areas can partially overlap and the
1164 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001165 * <p>The weights are relative to weights of other metering regions, so if only one region
1166 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1167 * ignored.</p>
1168 * <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 -08001169 * camera device. The capture result will either be a zero weight region as well, or
1170 * the region selected by the camera device as the focus area of interest.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001171 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1172 * capture result metadata, the camera device will ignore the sections outside the crop
1173 * region and output only the intersection rectangle as the metering region in the result
1174 * metadata. If the region is entirely outside the crop region, it will be ignored and
1175 * not reported in the result metadata.</p>
1176 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1177 * <p><b>Range of valid values:</b><br>
1178 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1179 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001180 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001181 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001182 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001183 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001184 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001185 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001186 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001187 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1188 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001189
1190 /**
Zhijun He379af012014-05-06 11:54:54 -07001191 * <p>Whether the camera device will trigger autofocus for this request.</p>
1192 * <p>This entry is normally set to IDLE, or is not
1193 * included at all in the request settings.</p>
1194 * <p>When included and set to START, the camera device will trigger the
1195 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1196 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1197 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001198 * <p>Generally, applications should set this entry to START or CANCEL for only a
1199 * single capture, and then return it to IDLE (or not set at all). Specifying
1200 * START for multiple captures in a row means restarting the AF operation over
1201 * and over again.</p>
1202 * <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 -07001203 * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
1204 * simultaneously is allowed. However, since these triggers often require cooperation between
1205 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1206 * focus sweep), the camera device may delay acting on a later trigger until the previous
1207 * trigger has been fully handled. This may lead to longer intervals between the trigger and
1208 * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001209 * <p><b>Possible values:</b>
1210 * <ul>
1211 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1212 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1213 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1214 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001215 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001216 *
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001217 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Zhijun He379af012014-05-06 11:54:54 -07001218 * @see CaptureResult#CONTROL_AF_STATE
1219 * @see #CONTROL_AF_TRIGGER_IDLE
1220 * @see #CONTROL_AF_TRIGGER_START
1221 * @see #CONTROL_AF_TRIGGER_CANCEL
1222 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001223 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001224 public static final Key<Integer> CONTROL_AF_TRIGGER =
1225 new Key<Integer>("android.control.afTrigger", int.class);
1226
1227 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001228 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001229 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1230 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1231 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1232 * the algorithm states to INACTIVE.</p>
1233 * <p>The camera device can do several state transitions between two results, if it is
1234 * allowed by the state transition table. For example: INACTIVE may never actually be
1235 * seen in a result.</p>
1236 * <p>The state in the result is the state for this image (in sync with this image): if
1237 * AF state becomes FOCUSED, then the image data associated with this result should
1238 * be sharp.</p>
1239 * <p>Below are state transition tables for different AF modes.</p>
1240 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1241 * <table>
1242 * <thead>
1243 * <tr>
1244 * <th align="center">State</th>
1245 * <th align="center">Transition Cause</th>
1246 * <th align="center">New State</th>
1247 * <th align="center">Notes</th>
1248 * </tr>
1249 * </thead>
1250 * <tbody>
1251 * <tr>
1252 * <td align="center">INACTIVE</td>
1253 * <td align="center"></td>
1254 * <td align="center">INACTIVE</td>
1255 * <td align="center">Never changes</td>
1256 * </tr>
1257 * </tbody>
1258 * </table>
1259 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1260 * <table>
1261 * <thead>
1262 * <tr>
1263 * <th align="center">State</th>
1264 * <th align="center">Transition Cause</th>
1265 * <th align="center">New State</th>
1266 * <th align="center">Notes</th>
1267 * </tr>
1268 * </thead>
1269 * <tbody>
1270 * <tr>
1271 * <td align="center">INACTIVE</td>
1272 * <td align="center">AF_TRIGGER</td>
1273 * <td align="center">ACTIVE_SCAN</td>
1274 * <td align="center">Start AF sweep, Lens now moving</td>
1275 * </tr>
1276 * <tr>
1277 * <td align="center">ACTIVE_SCAN</td>
1278 * <td align="center">AF sweep done</td>
1279 * <td align="center">FOCUSED_LOCKED</td>
1280 * <td align="center">Focused, Lens now locked</td>
1281 * </tr>
1282 * <tr>
1283 * <td align="center">ACTIVE_SCAN</td>
1284 * <td align="center">AF sweep done</td>
1285 * <td align="center">NOT_FOCUSED_LOCKED</td>
1286 * <td align="center">Not focused, Lens now locked</td>
1287 * </tr>
1288 * <tr>
1289 * <td align="center">ACTIVE_SCAN</td>
1290 * <td align="center">AF_CANCEL</td>
1291 * <td align="center">INACTIVE</td>
1292 * <td align="center">Cancel/reset AF, Lens now locked</td>
1293 * </tr>
1294 * <tr>
1295 * <td align="center">FOCUSED_LOCKED</td>
1296 * <td align="center">AF_CANCEL</td>
1297 * <td align="center">INACTIVE</td>
1298 * <td align="center">Cancel/reset AF</td>
1299 * </tr>
1300 * <tr>
1301 * <td align="center">FOCUSED_LOCKED</td>
1302 * <td align="center">AF_TRIGGER</td>
1303 * <td align="center">ACTIVE_SCAN</td>
1304 * <td align="center">Start new sweep, Lens now moving</td>
1305 * </tr>
1306 * <tr>
1307 * <td align="center">NOT_FOCUSED_LOCKED</td>
1308 * <td align="center">AF_CANCEL</td>
1309 * <td align="center">INACTIVE</td>
1310 * <td align="center">Cancel/reset AF</td>
1311 * </tr>
1312 * <tr>
1313 * <td align="center">NOT_FOCUSED_LOCKED</td>
1314 * <td align="center">AF_TRIGGER</td>
1315 * <td align="center">ACTIVE_SCAN</td>
1316 * <td align="center">Start new sweep, Lens now moving</td>
1317 * </tr>
1318 * <tr>
1319 * <td align="center">Any state</td>
1320 * <td align="center">Mode change</td>
1321 * <td align="center">INACTIVE</td>
1322 * <td align="center"></td>
1323 * </tr>
1324 * </tbody>
1325 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001326 * <p>For the above table, the camera device may skip reporting any state changes that happen
1327 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1328 * can be skipped in that manner is called a transient state.</p>
1329 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1330 * state transitions listed in above table, it is also legal for the camera device to skip
1331 * one or more transient states between two results. See below table for examples:</p>
1332 * <table>
1333 * <thead>
1334 * <tr>
1335 * <th align="center">State</th>
1336 * <th align="center">Transition Cause</th>
1337 * <th align="center">New State</th>
1338 * <th align="center">Notes</th>
1339 * </tr>
1340 * </thead>
1341 * <tbody>
1342 * <tr>
1343 * <td align="center">INACTIVE</td>
1344 * <td align="center">AF_TRIGGER</td>
1345 * <td align="center">FOCUSED_LOCKED</td>
1346 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1347 * </tr>
1348 * <tr>
1349 * <td align="center">INACTIVE</td>
1350 * <td align="center">AF_TRIGGER</td>
1351 * <td align="center">NOT_FOCUSED_LOCKED</td>
1352 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1353 * </tr>
1354 * <tr>
1355 * <td align="center">FOCUSED_LOCKED</td>
1356 * <td align="center">AF_TRIGGER</td>
1357 * <td align="center">FOCUSED_LOCKED</td>
1358 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1359 * </tr>
1360 * <tr>
1361 * <td align="center">NOT_FOCUSED_LOCKED</td>
1362 * <td align="center">AF_TRIGGER</td>
1363 * <td align="center">FOCUSED_LOCKED</td>
1364 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1365 * </tr>
1366 * </tbody>
1367 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001368 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1369 * <table>
1370 * <thead>
1371 * <tr>
1372 * <th align="center">State</th>
1373 * <th align="center">Transition Cause</th>
1374 * <th align="center">New State</th>
1375 * <th align="center">Notes</th>
1376 * </tr>
1377 * </thead>
1378 * <tbody>
1379 * <tr>
1380 * <td align="center">INACTIVE</td>
1381 * <td align="center">Camera device initiates new scan</td>
1382 * <td align="center">PASSIVE_SCAN</td>
1383 * <td align="center">Start AF scan, Lens now moving</td>
1384 * </tr>
1385 * <tr>
1386 * <td align="center">INACTIVE</td>
1387 * <td align="center">AF_TRIGGER</td>
1388 * <td align="center">NOT_FOCUSED_LOCKED</td>
1389 * <td align="center">AF state query, Lens now locked</td>
1390 * </tr>
1391 * <tr>
1392 * <td align="center">PASSIVE_SCAN</td>
1393 * <td align="center">Camera device completes current scan</td>
1394 * <td align="center">PASSIVE_FOCUSED</td>
1395 * <td align="center">End AF scan, Lens now locked</td>
1396 * </tr>
1397 * <tr>
1398 * <td align="center">PASSIVE_SCAN</td>
1399 * <td align="center">Camera device fails current scan</td>
1400 * <td align="center">PASSIVE_UNFOCUSED</td>
1401 * <td align="center">End AF scan, Lens now locked</td>
1402 * </tr>
1403 * <tr>
1404 * <td align="center">PASSIVE_SCAN</td>
1405 * <td align="center">AF_TRIGGER</td>
1406 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001407 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001408 * </tr>
1409 * <tr>
1410 * <td align="center">PASSIVE_SCAN</td>
1411 * <td align="center">AF_TRIGGER</td>
1412 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001413 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001414 * </tr>
1415 * <tr>
1416 * <td align="center">PASSIVE_SCAN</td>
1417 * <td align="center">AF_CANCEL</td>
1418 * <td align="center">INACTIVE</td>
1419 * <td align="center">Reset lens position, Lens now locked</td>
1420 * </tr>
1421 * <tr>
1422 * <td align="center">PASSIVE_FOCUSED</td>
1423 * <td align="center">Camera device initiates new scan</td>
1424 * <td align="center">PASSIVE_SCAN</td>
1425 * <td align="center">Start AF scan, Lens now moving</td>
1426 * </tr>
1427 * <tr>
1428 * <td align="center">PASSIVE_UNFOCUSED</td>
1429 * <td align="center">Camera device initiates new scan</td>
1430 * <td align="center">PASSIVE_SCAN</td>
1431 * <td align="center">Start AF scan, Lens now moving</td>
1432 * </tr>
1433 * <tr>
1434 * <td align="center">PASSIVE_FOCUSED</td>
1435 * <td align="center">AF_TRIGGER</td>
1436 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001437 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001438 * </tr>
1439 * <tr>
1440 * <td align="center">PASSIVE_UNFOCUSED</td>
1441 * <td align="center">AF_TRIGGER</td>
1442 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001443 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001444 * </tr>
1445 * <tr>
1446 * <td align="center">FOCUSED_LOCKED</td>
1447 * <td align="center">AF_TRIGGER</td>
1448 * <td align="center">FOCUSED_LOCKED</td>
1449 * <td align="center">No effect</td>
1450 * </tr>
1451 * <tr>
1452 * <td align="center">FOCUSED_LOCKED</td>
1453 * <td align="center">AF_CANCEL</td>
1454 * <td align="center">INACTIVE</td>
1455 * <td align="center">Restart AF scan</td>
1456 * </tr>
1457 * <tr>
1458 * <td align="center">NOT_FOCUSED_LOCKED</td>
1459 * <td align="center">AF_TRIGGER</td>
1460 * <td align="center">NOT_FOCUSED_LOCKED</td>
1461 * <td align="center">No effect</td>
1462 * </tr>
1463 * <tr>
1464 * <td align="center">NOT_FOCUSED_LOCKED</td>
1465 * <td align="center">AF_CANCEL</td>
1466 * <td align="center">INACTIVE</td>
1467 * <td align="center">Restart AF scan</td>
1468 * </tr>
1469 * </tbody>
1470 * </table>
1471 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1472 * <table>
1473 * <thead>
1474 * <tr>
1475 * <th align="center">State</th>
1476 * <th align="center">Transition Cause</th>
1477 * <th align="center">New State</th>
1478 * <th align="center">Notes</th>
1479 * </tr>
1480 * </thead>
1481 * <tbody>
1482 * <tr>
1483 * <td align="center">INACTIVE</td>
1484 * <td align="center">Camera device initiates new scan</td>
1485 * <td align="center">PASSIVE_SCAN</td>
1486 * <td align="center">Start AF scan, Lens now moving</td>
1487 * </tr>
1488 * <tr>
1489 * <td align="center">INACTIVE</td>
1490 * <td align="center">AF_TRIGGER</td>
1491 * <td align="center">NOT_FOCUSED_LOCKED</td>
1492 * <td align="center">AF state query, Lens now locked</td>
1493 * </tr>
1494 * <tr>
1495 * <td align="center">PASSIVE_SCAN</td>
1496 * <td align="center">Camera device completes current scan</td>
1497 * <td align="center">PASSIVE_FOCUSED</td>
1498 * <td align="center">End AF scan, Lens now locked</td>
1499 * </tr>
1500 * <tr>
1501 * <td align="center">PASSIVE_SCAN</td>
1502 * <td align="center">Camera device fails current scan</td>
1503 * <td align="center">PASSIVE_UNFOCUSED</td>
1504 * <td align="center">End AF scan, Lens now locked</td>
1505 * </tr>
1506 * <tr>
1507 * <td align="center">PASSIVE_SCAN</td>
1508 * <td align="center">AF_TRIGGER</td>
1509 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001510 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001511 * </tr>
1512 * <tr>
1513 * <td align="center">PASSIVE_SCAN</td>
1514 * <td align="center">AF_TRIGGER</td>
1515 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001516 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001517 * </tr>
1518 * <tr>
1519 * <td align="center">PASSIVE_SCAN</td>
1520 * <td align="center">AF_CANCEL</td>
1521 * <td align="center">INACTIVE</td>
1522 * <td align="center">Reset lens position, Lens now locked</td>
1523 * </tr>
1524 * <tr>
1525 * <td align="center">PASSIVE_FOCUSED</td>
1526 * <td align="center">Camera device initiates new scan</td>
1527 * <td align="center">PASSIVE_SCAN</td>
1528 * <td align="center">Start AF scan, Lens now moving</td>
1529 * </tr>
1530 * <tr>
1531 * <td align="center">PASSIVE_UNFOCUSED</td>
1532 * <td align="center">Camera device initiates new scan</td>
1533 * <td align="center">PASSIVE_SCAN</td>
1534 * <td align="center">Start AF scan, Lens now moving</td>
1535 * </tr>
1536 * <tr>
1537 * <td align="center">PASSIVE_FOCUSED</td>
1538 * <td align="center">AF_TRIGGER</td>
1539 * <td align="center">FOCUSED_LOCKED</td>
1540 * <td align="center">Immediate trans. Lens now locked</td>
1541 * </tr>
1542 * <tr>
1543 * <td align="center">PASSIVE_UNFOCUSED</td>
1544 * <td align="center">AF_TRIGGER</td>
1545 * <td align="center">NOT_FOCUSED_LOCKED</td>
1546 * <td align="center">Immediate trans. Lens now locked</td>
1547 * </tr>
1548 * <tr>
1549 * <td align="center">FOCUSED_LOCKED</td>
1550 * <td align="center">AF_TRIGGER</td>
1551 * <td align="center">FOCUSED_LOCKED</td>
1552 * <td align="center">No effect</td>
1553 * </tr>
1554 * <tr>
1555 * <td align="center">FOCUSED_LOCKED</td>
1556 * <td align="center">AF_CANCEL</td>
1557 * <td align="center">INACTIVE</td>
1558 * <td align="center">Restart AF scan</td>
1559 * </tr>
1560 * <tr>
1561 * <td align="center">NOT_FOCUSED_LOCKED</td>
1562 * <td align="center">AF_TRIGGER</td>
1563 * <td align="center">NOT_FOCUSED_LOCKED</td>
1564 * <td align="center">No effect</td>
1565 * </tr>
1566 * <tr>
1567 * <td align="center">NOT_FOCUSED_LOCKED</td>
1568 * <td align="center">AF_CANCEL</td>
1569 * <td align="center">INACTIVE</td>
1570 * <td align="center">Restart AF scan</td>
1571 * </tr>
1572 * </tbody>
1573 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001574 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1575 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1576 * camera device. When a trigger is included in a mode switch request, the trigger
1577 * will be evaluated in the context of the new mode in the request.
1578 * See below table for examples:</p>
1579 * <table>
1580 * <thead>
1581 * <tr>
1582 * <th align="center">State</th>
1583 * <th align="center">Transition Cause</th>
1584 * <th align="center">New State</th>
1585 * <th align="center">Notes</th>
1586 * </tr>
1587 * </thead>
1588 * <tbody>
1589 * <tr>
1590 * <td align="center">any state</td>
1591 * <td align="center">CAF--&gt;AUTO mode switch</td>
1592 * <td align="center">INACTIVE</td>
1593 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1594 * </tr>
1595 * <tr>
1596 * <td align="center">any state</td>
1597 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1598 * <td align="center">trigger-reachable states from INACTIVE</td>
1599 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1600 * </tr>
1601 * <tr>
1602 * <td align="center">any state</td>
1603 * <td align="center">AUTO--&gt;CAF mode switch</td>
1604 * <td align="center">passively reachable states from INACTIVE</td>
1605 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1606 * </tr>
1607 * </tbody>
1608 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001609 * <p><b>Possible values:</b>
1610 * <ul>
1611 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1612 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1613 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1614 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1615 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1616 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1617 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1618 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001619 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001620 *
1621 * @see CaptureRequest#CONTROL_AF_MODE
1622 * @see CaptureRequest#CONTROL_MODE
1623 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001624 * @see #CONTROL_AF_STATE_INACTIVE
1625 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1626 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1627 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1628 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1629 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001630 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001631 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001632 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001633 public static final Key<Integer> CONTROL_AF_STATE =
1634 new Key<Integer>("android.control.afState", int.class);
1635
1636 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001637 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001638 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001639 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1640 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1641 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1642 * get locked do not necessarily correspond to the settings that were present in the
1643 * latest capture result received from the camera device, since additional captures
1644 * and AWB updates may have occurred even before the result was sent out. If an
1645 * application is switching between automatic and manual control and wishes to eliminate
1646 * any flicker during the switch, the following procedure is recommended:</p>
1647 * <ol>
1648 * <li>Starting in auto-AWB mode:</li>
1649 * <li>Lock AWB</li>
1650 * <li>Wait for the first result to be output that has the AWB locked</li>
1651 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1652 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1653 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001654 * <p>Note that AWB lock is only meaningful when
1655 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1656 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001657 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1658 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001659 *
1660 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001661 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001662 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001663 public static final Key<Boolean> CONTROL_AWB_LOCK =
1664 new Key<Boolean>("android.control.awbLock", boolean.class);
1665
1666 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001667 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001668 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001669 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001670 * <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 -07001671 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001672 * routine is enabled, overriding the application's selected
1673 * {@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 -08001674 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1675 * is OFF, the behavior of AWB is device dependent. It is recommened to
1676 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1677 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001678 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001679 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001680 * 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 -08001681 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001682 * <p>When set to any other modes, the camera device's auto-white
1683 * balance routine is disabled. The camera device uses each
1684 * particular illumination target for white balance
1685 * adjustment. The application's values for
1686 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1687 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1688 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001689 * <p><b>Possible values:</b>
1690 * <ul>
1691 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1692 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1693 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1694 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1695 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1696 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1697 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1698 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1699 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1700 * </ul></p>
1701 * <p><b>Available values for this device:</b><br>
1702 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001703 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001704 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001705 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001706 * @see CaptureRequest#COLOR_CORRECTION_MODE
1707 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001708 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001709 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001710 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001711 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001712 * @see #CONTROL_AWB_MODE_OFF
1713 * @see #CONTROL_AWB_MODE_AUTO
1714 * @see #CONTROL_AWB_MODE_INCANDESCENT
1715 * @see #CONTROL_AWB_MODE_FLUORESCENT
1716 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1717 * @see #CONTROL_AWB_MODE_DAYLIGHT
1718 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1719 * @see #CONTROL_AWB_MODE_TWILIGHT
1720 * @see #CONTROL_AWB_MODE_SHADE
1721 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001722 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001723 public static final Key<Integer> CONTROL_AWB_MODE =
1724 new Key<Integer>("android.control.awbMode", int.class);
1725
1726 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001727 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001728 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001729 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001730 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001731 * <p>The maximum number of regions supported by the device is determined by the value
1732 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001733 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001734 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001735 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1736 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001737 * bottom-right pixel in the active pixel array.</p>
1738 * <p>The weight must range from 0 to 1000, and represents a weight
1739 * for every pixel in the area. This means that a large metering area
1740 * with the same weight as a smaller area will have more effect in
1741 * the metering result. Metering areas can partially overlap and the
1742 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001743 * <p>The weights are relative to weights of other white balance metering regions, so if
1744 * only one region is used, all non-zero weights will have the same effect. A region with
1745 * 0 weight is ignored.</p>
1746 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1747 * camera device.</p>
1748 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1749 * capture result metadata, the camera device will ignore the sections outside the crop
1750 * region and output only the intersection rectangle as the metering region in the result
1751 * metadata. If the region is entirely outside the crop region, it will be ignored and
1752 * not reported in the result metadata.</p>
1753 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1754 * <p><b>Range of valid values:</b><br>
1755 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1756 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001757 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001758 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001759 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001760 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001761 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001762 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001763 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001764 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1765 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001766
1767 /**
Zhijun He379af012014-05-06 11:54:54 -07001768 * <p>Information to the camera device 3A (auto-exposure,
1769 * auto-focus, auto-white balance) routines about the purpose
1770 * of this capture, to help the camera device to decide optimal 3A
1771 * strategy.</p>
1772 * <p>This control (except for MANUAL) is only effective if
1773 * <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 -08001774 * <p>All intents are supported by all devices, except that:
1775 * * ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1776 * PRIVATE_REPROCESSING or YUV_REPROCESSING.
1777 * * MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1778 * MANUAL_SENSOR.
1779 * * MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1780 * MOTION_TRACKING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001781 * <p><b>Possible values:</b>
1782 * <ul>
1783 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1784 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1785 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1786 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1787 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1788 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1789 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001790 * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001791 * </ul></p>
1792 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001793 *
1794 * @see CaptureRequest#CONTROL_MODE
1795 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1796 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1797 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1798 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1799 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1800 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1801 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1802 * @see #CONTROL_CAPTURE_INTENT_MANUAL
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001803 * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING
Zhijun He379af012014-05-06 11:54:54 -07001804 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001805 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001806 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1807 new Key<Integer>("android.control.captureIntent", int.class);
1808
1809 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001810 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001811 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1812 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1813 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1814 * the algorithm states to INACTIVE.</p>
1815 * <p>The camera device can do several state transitions between two results, if it is
1816 * allowed by the state transition table. So INACTIVE may never actually be seen in
1817 * a result.</p>
1818 * <p>The state in the result is the state for this image (in sync with this image): if
1819 * AWB state becomes CONVERGED, then the image data associated with this result should
1820 * be good to use.</p>
1821 * <p>Below are state transition tables for different AWB modes.</p>
1822 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1823 * <table>
1824 * <thead>
1825 * <tr>
1826 * <th align="center">State</th>
1827 * <th align="center">Transition Cause</th>
1828 * <th align="center">New State</th>
1829 * <th align="center">Notes</th>
1830 * </tr>
1831 * </thead>
1832 * <tbody>
1833 * <tr>
1834 * <td align="center">INACTIVE</td>
1835 * <td align="center"></td>
1836 * <td align="center">INACTIVE</td>
1837 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1838 * </tr>
1839 * </tbody>
1840 * </table>
1841 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1842 * <table>
1843 * <thead>
1844 * <tr>
1845 * <th align="center">State</th>
1846 * <th align="center">Transition Cause</th>
1847 * <th align="center">New State</th>
1848 * <th align="center">Notes</th>
1849 * </tr>
1850 * </thead>
1851 * <tbody>
1852 * <tr>
1853 * <td align="center">INACTIVE</td>
1854 * <td align="center">Camera device initiates AWB scan</td>
1855 * <td align="center">SEARCHING</td>
1856 * <td align="center">Values changing</td>
1857 * </tr>
1858 * <tr>
1859 * <td align="center">INACTIVE</td>
1860 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1861 * <td align="center">LOCKED</td>
1862 * <td align="center">Values locked</td>
1863 * </tr>
1864 * <tr>
1865 * <td align="center">SEARCHING</td>
1866 * <td align="center">Camera device finishes AWB scan</td>
1867 * <td align="center">CONVERGED</td>
1868 * <td align="center">Good values, not changing</td>
1869 * </tr>
1870 * <tr>
1871 * <td align="center">SEARCHING</td>
1872 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1873 * <td align="center">LOCKED</td>
1874 * <td align="center">Values locked</td>
1875 * </tr>
1876 * <tr>
1877 * <td align="center">CONVERGED</td>
1878 * <td align="center">Camera device initiates AWB scan</td>
1879 * <td align="center">SEARCHING</td>
1880 * <td align="center">Values changing</td>
1881 * </tr>
1882 * <tr>
1883 * <td align="center">CONVERGED</td>
1884 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1885 * <td align="center">LOCKED</td>
1886 * <td align="center">Values locked</td>
1887 * </tr>
1888 * <tr>
1889 * <td align="center">LOCKED</td>
1890 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1891 * <td align="center">SEARCHING</td>
1892 * <td align="center">Values not good after unlock</td>
1893 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001894 * </tbody>
1895 * </table>
1896 * <p>For the above table, the camera device may skip reporting any state changes that happen
1897 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1898 * can be skipped in that manner is called a transient state.</p>
1899 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1900 * listed in above table, it is also legal for the camera device to skip one or more
1901 * transient states between two results. See below table for examples:</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 finished AWB scan</td>
1915 * <td align="center">CONVERGED</td>
1916 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1917 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001918 * <tr>
1919 * <td align="center">LOCKED</td>
1920 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1921 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001922 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001923 * </tr>
1924 * </tbody>
1925 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001926 * <p><b>Possible values:</b>
1927 * <ul>
1928 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1929 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1930 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1931 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1932 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001933 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1934 * <p><b>Limited capability</b> -
1935 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1936 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001937 *
1938 * @see CaptureRequest#CONTROL_AWB_LOCK
1939 * @see CaptureRequest#CONTROL_AWB_MODE
1940 * @see CaptureRequest#CONTROL_MODE
1941 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001942 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001943 * @see #CONTROL_AWB_STATE_INACTIVE
1944 * @see #CONTROL_AWB_STATE_SEARCHING
1945 * @see #CONTROL_AWB_STATE_CONVERGED
1946 * @see #CONTROL_AWB_STATE_LOCKED
1947 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001948 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001949 public static final Key<Integer> CONTROL_AWB_STATE =
1950 new Key<Integer>("android.control.awbState", int.class);
1951
1952 /**
Zhijun He379af012014-05-06 11:54:54 -07001953 * <p>A special color effect to apply.</p>
1954 * <p>When this mode is set, a color effect will be applied
1955 * to images produced by the camera device. The interpretation
1956 * and implementation of these color effects is left to the
1957 * implementor of the camera device, and should not be
1958 * depended on to be consistent (or present) across all
1959 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001960 * <p><b>Possible values:</b>
1961 * <ul>
1962 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1963 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1964 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1965 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1966 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1967 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1968 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1969 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1970 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1971 * </ul></p>
1972 * <p><b>Available values for this device:</b><br>
1973 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001974 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001975 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001976 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07001977 * @see #CONTROL_EFFECT_MODE_OFF
1978 * @see #CONTROL_EFFECT_MODE_MONO
1979 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1980 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1981 * @see #CONTROL_EFFECT_MODE_SEPIA
1982 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1983 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1984 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1985 * @see #CONTROL_EFFECT_MODE_AQUA
1986 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001987 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001988 public static final Key<Integer> CONTROL_EFFECT_MODE =
1989 new Key<Integer>("android.control.effectMode", int.class);
1990
1991 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001992 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001993 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001994 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001995 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001996 * capture parameters itself.</p>
1997 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001998 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001999 * <p>When set to USE_SCENE_MODE, the individual controls in
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002000 * android.control.* are mostly disabled, and the camera device
2001 * implements one of the scene mode settings (such as ACTION,
2002 * SUNSET, or PARTY) as it wishes. The camera device scene mode
2003 * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08002004 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
2005 * is that this frame will not be used by camera device background 3A statistics
2006 * update, as if this frame is never captured. This mode can be used in the scenario
2007 * where the application doesn't want a 3A manual control capture to affect
2008 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002009 * <p><b>Possible values:</b>
2010 * <ul>
2011 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
2012 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
2013 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
2014 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
2015 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002016 * <p><b>Available values for this device:</b><br>
2017 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002018 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002019 *
2020 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002021 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002022 * @see #CONTROL_MODE_OFF
2023 * @see #CONTROL_MODE_AUTO
2024 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08002025 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002026 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002027 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002028 public static final Key<Integer> CONTROL_MODE =
2029 new Key<Integer>("android.control.mode", int.class);
2030
2031 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002032 * <p>Control for which scene mode is currently active.</p>
2033 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
2034 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07002035 * <p>This is the mode that that is active when
Zhijun Heee2ebde2015-06-16 19:58:11 -07002036 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
2037 * 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}
2038 * while in use.</p>
Zhijun He379af012014-05-06 11:54:54 -07002039 * <p>The interpretation and implementation of these scene modes is left
2040 * to the implementor of the camera device. Their behavior will not be
2041 * consistent across all devices, and any given device may only implement
2042 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002043 * <p><b>Possible values:</b>
2044 * <ul>
2045 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
2046 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
2047 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
2048 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
2049 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
2050 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
2051 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
2052 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
2053 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
2054 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
2055 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
2056 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
2057 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
2058 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
2059 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
2060 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
2061 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
2062 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002063 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002064 * </ul></p>
2065 * <p><b>Available values for this device:</b><br>
2066 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002067 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002068 *
2069 * @see CaptureRequest#CONTROL_AE_MODE
2070 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002071 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07002072 * @see CaptureRequest#CONTROL_AWB_MODE
2073 * @see CaptureRequest#CONTROL_MODE
2074 * @see #CONTROL_SCENE_MODE_DISABLED
2075 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
2076 * @see #CONTROL_SCENE_MODE_ACTION
2077 * @see #CONTROL_SCENE_MODE_PORTRAIT
2078 * @see #CONTROL_SCENE_MODE_LANDSCAPE
2079 * @see #CONTROL_SCENE_MODE_NIGHT
2080 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
2081 * @see #CONTROL_SCENE_MODE_THEATRE
2082 * @see #CONTROL_SCENE_MODE_BEACH
2083 * @see #CONTROL_SCENE_MODE_SNOW
2084 * @see #CONTROL_SCENE_MODE_SUNSET
2085 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
2086 * @see #CONTROL_SCENE_MODE_FIREWORKS
2087 * @see #CONTROL_SCENE_MODE_SPORTS
2088 * @see #CONTROL_SCENE_MODE_PARTY
2089 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
2090 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07002091 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002092 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07002093 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002094 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002095 public static final Key<Integer> CONTROL_SCENE_MODE =
2096 new Key<Integer>("android.control.sceneMode", int.class);
2097
2098 /**
2099 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002100 * active.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002101 * <p>Video stabilization automatically warps images from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002102 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07002103 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07002104 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002105 * <p>Switching between different video stabilization modes may take several
2106 * frames to initialize, the camera device will report the current mode
2107 * in capture result metadata. For example, When "ON" mode is requested,
2108 * the video stabilization modes in the first several capture results may
2109 * still be "OFF", and it will become "ON" when the initialization is
2110 * done.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002111 * <p>In addition, not all recording sizes or frame rates may be supported for
2112 * stabilization by a device that reports stabilization support. It is guaranteed
2113 * that an output targeting a MediaRecorder or MediaCodec will be stabilized if
2114 * the recording resolution is less than or equal to 1920 x 1080 (width less than
2115 * or equal to 1920, height less than or equal to 1080), and the recording
2116 * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult
2117 * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return
2118 * OFF if the recording output is not stabilized, or if there are no output
2119 * Surface types that can be stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002120 * <p>If a camera device supports both this mode and OIS
2121 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
2122 * produce undesirable interaction, so it is recommended not to enable
2123 * both at the same time.</p>
2124 * <p><b>Possible values:</b>
2125 * <ul>
2126 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
2127 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
2128 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002129 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002130 *
Jianing Wei2813b0f2015-09-29 14:24:36 -07002131 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Zhijun He45fa43a12014-06-13 18:29:37 -07002132 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07002133 * @see CaptureRequest#SCALER_CROP_REGION
2134 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
2135 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
2136 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002137 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002138 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
2139 new Key<Integer>("android.control.videoStabilizationMode", int.class);
2140
2141 /**
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002142 * <p>The amount of additional sensitivity boost applied to output images
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002143 * after RAW sensor data is captured.</p>
2144 * <p>Some camera devices support additional digital sensitivity boosting in the
2145 * camera processing pipeline after sensor RAW image is captured.
2146 * Such a boost will be applied to YUV/JPEG format output images but will not
2147 * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p>
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002148 * <p>This key will be <code>null</code> for devices that do not support any RAW format
2149 * outputs. For devices that do support RAW format outputs, this key will always
2150 * present, and if a device does not support post RAW sensitivity boost, it will
2151 * list <code>100</code> in this key.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002152 * <p>If the camera device cannot apply the exact boost requested, it will reduce the
2153 * boost to the nearest supported value.
2154 * The final boost value used will be available in the output capture result.</p>
2155 * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images
2156 * of such device will have the total sensitivity of
Yin-Chia Yeh67e61b62016-01-26 13:27:35 -08002157 * <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 -08002158 * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p>
2159 * <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
2160 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2161 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
2162 * <p><b>Range of valid values:</b><br>
2163 * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p>
2164 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2165 *
2166 * @see CaptureRequest#CONTROL_AE_MODE
2167 * @see CaptureRequest#CONTROL_MODE
2168 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
2169 * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE
2170 * @see CaptureRequest#SENSOR_SENSITIVITY
2171 */
2172 @PublicKey
2173 public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST =
2174 new Key<Integer>("android.control.postRawSensitivityBoost", int.class);
2175
2176 /**
Chien-Yu Chene4491712017-01-11 11:14:06 -08002177 * <p>Allow camera device to enable zero-shutter-lag mode for requests with
2178 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p>
2179 * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with
2180 * STILL_CAPTURE capture intent. The camera device may use images captured in the past to
2181 * produce output images for a zero-shutter-lag request. The result metadata including the
2182 * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images.
2183 * Therefore, the contents of the output images and the result metadata may be out of order
2184 * compared to previous regular requests. enableZsl does not affect requests with other
2185 * capture intents.</p>
2186 * <p>For example, when requests are submitted in the following order:
2187 * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW
2188 * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p>
2189 * <p>The output images for request B may have contents captured before the output images for
2190 * request A, and the result metadata for request B may be older than the result metadata for
2191 * request A.</p>
Chien-Yu Chen1d72ee32017-04-18 15:23:06 -07002192 * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in
2193 * the past for requests with STILL_CAPTURE capture intent.</p>
2194 * <p>For applications targeting SDK versions O and newer, the value of enableZsl in
2195 * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always
2196 * <code>false</code> if present.</p>
2197 * <p>For applications targeting SDK versions older than O, the value of enableZsl in all
2198 * capture templates is always <code>false</code> if present.</p>
Chien-Yu Chen81026382017-05-03 12:30:58 -07002199 * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
Chien-Yu Chene4491712017-01-11 11:14:06 -08002200 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2201 *
2202 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
2203 * @see CaptureResult#SENSOR_TIMESTAMP
2204 */
2205 @PublicKey
2206 public static final Key<Boolean> CONTROL_ENABLE_ZSL =
2207 new Key<Boolean>("android.control.enableZsl", boolean.class);
2208
2209 /**
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002210 * <p>Whether a significant scene change is detected within the currently-set AF
2211 * region(s).</p>
2212 * <p>When the camera focus routine detects a change in the scene it is looking at,
2213 * such as a large shift in camera viewpoint, significant motion in the scene, or a
2214 * significant illumination change, this value will be set to DETECTED for a single capture
2215 * result. Otherwise the value will be NOT_DETECTED. The threshold for detection is similar
2216 * to what would trigger a new passive focus scan to begin in CONTINUOUS autofocus modes.</p>
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002217 * <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 -08002218 * <p><b>Possible values:</b>
2219 * <ul>
2220 * <li>{@link #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED NOT_DETECTED}</li>
2221 * <li>{@link #CONTROL_AF_SCENE_CHANGE_DETECTED DETECTED}</li>
2222 * </ul></p>
2223 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2224 * @see #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED
2225 * @see #CONTROL_AF_SCENE_CHANGE_DETECTED
2226 */
2227 @PublicKey
2228 public static final Key<Integer> CONTROL_AF_SCENE_CHANGE =
2229 new Key<Integer>("android.control.afSceneChange", int.class);
2230
2231 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002232 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08002233 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002234 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2235 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002236 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08002237 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08002238 * camera device will use the highest-quality enhancement algorithms,
2239 * even if it slows down capture rate. FAST means the camera device will
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002240 * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
2241 * edge enhancement will slow down capture rate. Every output stream will have a similar
2242 * amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002243 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2244 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2245 * into a final capture when triggered by the user. In this mode, the camera device applies
2246 * edge enhancement to low-resolution streams (below maximum recording resolution) to
2247 * maximize preview quality, but does not apply edge enhancement to high-resolution streams,
2248 * since those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002249 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2250 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002251 * The camera device may adjust its internal edge enhancement parameters for best
Zhijun He0e99c222015-01-29 15:26:05 -08002252 * 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 -07002253 * <p><b>Possible values:</b>
2254 * <ul>
2255 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2256 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2257 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002258 * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002259 * </ul></p>
2260 * <p><b>Available values for this device:</b><br>
2261 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002262 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2263 * <p><b>Full capability</b> -
2264 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2265 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002266 *
2267 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002268 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002269 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002270 * @see #EDGE_MODE_OFF
2271 * @see #EDGE_MODE_FAST
2272 * @see #EDGE_MODE_HIGH_QUALITY
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002273 * @see #EDGE_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002274 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002275 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002276 public static final Key<Integer> EDGE_MODE =
2277 new Key<Integer>("android.edge.mode", int.class);
2278
2279 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002280 * <p>The desired mode for for the camera device's flash control.</p>
2281 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002282 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002283 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2284 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2285 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2286 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2287 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2288 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002289 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002290 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2291 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2292 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002293 * <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 -07002294 * <p><b>Possible values:</b>
2295 * <ul>
2296 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2297 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2298 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2299 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002300 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002301 *
2302 * @see CaptureRequest#CONTROL_AE_MODE
2303 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2304 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002305 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002306 * @see #FLASH_MODE_OFF
2307 * @see #FLASH_MODE_SINGLE
2308 * @see #FLASH_MODE_TORCH
2309 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002310 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002311 public static final Key<Integer> FLASH_MODE =
2312 new Key<Integer>("android.flash.mode", int.class);
2313
2314 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002315 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002316 * unit.</p>
2317 * <p>When the camera device doesn't have flash unit
2318 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2319 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002320 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2321 * <ul>
2322 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2323 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002324 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002325 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002326 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002327 * </ul>
2328 * <p>In all other conditions the state will not be available on
2329 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002330 * <p><b>Possible values:</b>
2331 * <ul>
2332 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2333 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2334 * <li>{@link #FLASH_STATE_READY READY}</li>
2335 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2336 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2337 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002338 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2339 * <p><b>Limited capability</b> -
2340 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2341 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002342 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002343 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002344 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002345 * @see CaptureRequest#FLASH_MODE
2346 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002347 * @see #FLASH_STATE_UNAVAILABLE
2348 * @see #FLASH_STATE_CHARGING
2349 * @see #FLASH_STATE_READY
2350 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002351 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002352 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002353 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002354 public static final Key<Integer> FLASH_STATE =
2355 new Key<Integer>("android.flash.state", int.class);
2356
2357 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002358 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002359 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002360 * that do not accurately measure the incoming light (i.e. pixels that
2361 * are stuck at an arbitrary value or are oversensitive).</p>
2362 * <p><b>Possible values:</b>
2363 * <ul>
2364 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2365 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2366 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2367 * </ul></p>
2368 * <p><b>Available values for this device:</b><br>
2369 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002370 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002371 *
2372 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002373 * @see #HOT_PIXEL_MODE_OFF
2374 * @see #HOT_PIXEL_MODE_FAST
2375 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2376 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002377 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002378 public static final Key<Integer> HOT_PIXEL_MODE =
2379 new Key<Integer>("android.hotPixel.mode", int.class);
2380
2381 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002382 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002383 * <p>Setting a location object in a request will include the GPS coordinates of the location
2384 * into any JPEG images captured based on the request. These coordinates can then be
2385 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002386 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002387 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002388 @PublicKey
2389 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002390 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2391 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2392
2393 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002394 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002395 * EXIF.</p>
2396 * <p><b>Range of valid values:</b><br>
2397 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002398 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002399 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002400 */
2401 public static final Key<double[]> JPEG_GPS_COORDINATES =
2402 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2403
2404 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002405 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002406 * include in EXIF.</p>
2407 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002408 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002409 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002410 */
2411 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2412 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2413
2414 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002415 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002416 * EXIF.</p>
2417 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002418 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002419 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002420 */
2421 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2422 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2423
2424 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002425 * <p>The orientation for a JPEG image.</p>
2426 * <p>The clockwise rotation angle in degrees, relative to the orientation
2427 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2428 * upright.</p>
2429 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07002430 * rotate the image data to match this orientation. When the image data is rotated,
2431 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002432 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2433 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
Emilian Peev3abc7512018-03-28 11:22:26 +01002434 * <p>To translate from the device orientation given by the Android sensor APIs for camera
2435 * sensors which are not EXTERNAL, the following sample code may be used:</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002436 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2437 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2438 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2439 *
2440 * // Round device orientation to a multiple of 90
2441 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2442 *
2443 * // Reverse device orientation for front-facing cameras
2444 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2445 * if (facingFront) deviceOrientation = -deviceOrientation;
2446 *
2447 * // Calculate desired JPEG orientation relative to camera orientation to make
2448 * // the image upright relative to the device orientation
2449 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2450 *
2451 * return jpegOrientation;
2452 * }
2453 * </code></pre>
Emilian Peev3abc7512018-03-28 11:22:26 +01002454 * <p>For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will
2455 * also be set to EXTERNAL. The above code is not relevant in such case.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002456 * <p><b>Units</b>: Degrees in multiples of 90</p>
2457 * <p><b>Range of valid values:</b><br>
2458 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002459 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002460 *
2461 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002462 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002463 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002464 public static final Key<Integer> JPEG_ORIENTATION =
2465 new Key<Integer>("android.jpeg.orientation", int.class);
2466
2467 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002468 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002469 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002470 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002471 * <p><b>Range of valid values:</b><br>
2472 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002473 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002474 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002475 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002476 public static final Key<Byte> JPEG_QUALITY =
2477 new Key<Byte>("android.jpeg.quality", byte.class);
2478
2479 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002480 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002481 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002482 * <p><b>Range of valid values:</b><br>
2483 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002484 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002485 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002486 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002487 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2488 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2489
2490 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002491 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002492 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2493 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002494 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2495 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002496 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2497 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2498 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2499 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2500 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2501 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002502 * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested,
2503 * the camera device will handle thumbnail rotation in one of the following ways:</p>
2504 * <ul>
2505 * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
2506 * and keep jpeg and thumbnail image data unrotated.</li>
2507 * <li>Rotate the jpeg and thumbnail image data and not set
2508 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
2509 * case, LIMITED or FULL hardware level devices will report rotated thumnail size in
2510 * capture result, so the width and height will be interchanged if 90 or 270 degree
2511 * orientation is requested. LEGACY device will always report unrotated thumbnail
2512 * size.</li>
2513 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002514 * <p><b>Range of valid values:</b><br>
2515 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002516 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002517 *
2518 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002519 * @see CaptureRequest#JPEG_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002520 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002521 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002522 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2523 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002524
2525 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002526 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2527 * effective aperture diameter.</p>
2528 * <p>Setting this value is only supported on the camera devices that have a variable
2529 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002530 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2531 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002532 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002533 * to achieve manual exposure control.</p>
2534 * <p>The requested aperture value may take several frames to reach the
2535 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002536 * aperture size in capture result metadata while the aperture is changing.
2537 * 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 -08002538 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2539 * the ON modes, this will be overridden by the camera device
2540 * auto-exposure algorithm, the overridden values are then provided
2541 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002542 * <p><b>Units</b>: The f-number (f/N)</p>
2543 * <p><b>Range of valid values:</b><br>
2544 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002545 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2546 * <p><b>Full capability</b> -
2547 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2548 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002549 *
Zhijun He399f05d2014-01-15 11:31:30 -08002550 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002551 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002552 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002553 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002554 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002555 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002556 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002557 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002558 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002559 public static final Key<Float> LENS_APERTURE =
2560 new Key<Float>("android.lens.aperture", float.class);
2561
2562 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002563 * <p>The desired setting for the lens neutral density filter(s).</p>
2564 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002565 * <p>Lens filters are typically used to lower the amount of light the
2566 * sensor is exposed to (measured in steps of EV). As used here, an EV
2567 * step is the standard logarithmic representation, which are
2568 * non-negative, and inversely proportional to the amount of light
2569 * hitting the sensor. For example, setting this to 0 would result
2570 * in no reduction of the incoming light, and setting this to 2 would
2571 * mean that the filter is set to reduce incoming light by two stops
2572 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002573 * <p>It may take several frames before the lens filter density changes
2574 * to the requested value. While the filter density is still changing,
2575 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002576 * <p><b>Units</b>: Exposure Value (EV)</p>
2577 * <p><b>Range of valid values:</b><br>
2578 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002579 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2580 * <p><b>Full capability</b> -
2581 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2582 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002583 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002584 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002585 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002586 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002587 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002588 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002589 public static final Key<Float> LENS_FILTER_DENSITY =
2590 new Key<Float>("android.lens.filterDensity", float.class);
2591
2592 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002593 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002594 * <p>This setting controls the physical focal length of the camera
2595 * device's lens. Changing the focal length changes the field of
2596 * view of the camera device, and is usually used for optical zoom.</p>
2597 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2598 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002599 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002600 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2601 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002602 * <p>Optical zoom will not be supported on most devices.</p>
2603 * <p><b>Units</b>: Millimeters</p>
2604 * <p><b>Range of valid values:</b><br>
2605 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002606 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002607 *
2608 * @see CaptureRequest#LENS_APERTURE
2609 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002610 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002611 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002612 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002613 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002614 public static final Key<Float> LENS_FOCAL_LENGTH =
2615 new Key<Float>("android.lens.focalLength", float.class);
2616
2617 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002618 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002619 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002620 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002621 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2622 * <p><b>Range of valid values:</b><br>
2623 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002624 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2625 * <p><b>Full capability</b> -
2626 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2627 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2628 *
2629 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002630 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002631 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002632 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002633 public static final Key<Float> LENS_FOCUS_DISTANCE =
2634 new Key<Float>("android.lens.focusDistance", float.class);
2635
2636 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002637 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002638 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002639 * <p>If variable focus not supported, can still report
2640 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002641 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2642 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2643 * <p><b>Range of valid values:</b><br>
2644 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002645 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2646 * <p><b>Limited capability</b> -
2647 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2648 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2649 *
2650 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002651 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002652 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002653 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002654 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2655 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 -07002656
2657 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002658 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2659 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002660 * <p>OIS is used to compensate for motion blur due to small
2661 * movements of the camera during capture. Unlike digital image
2662 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2663 * makes use of mechanical elements to stabilize the camera
2664 * sensor, and thus allows for longer exposure times before
2665 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002666 * <p>Switching between different optical stabilization modes may take several
2667 * frames to initialize, the camera device will report the current mode in
2668 * capture result metadata. For example, When "ON" mode is requested, the
2669 * optical stabilization modes in the first several capture results may still
2670 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002671 * <p>If a camera device supports both OIS and digital image stabilization
2672 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2673 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002674 * <p>Not all devices will support OIS; see
2675 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2676 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002677 * <p><b>Possible values:</b>
2678 * <ul>
2679 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2680 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2681 * </ul></p>
2682 * <p><b>Available values for this device:</b><br>
2683 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</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>Limited capability</b> -
2686 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2687 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002688 *
2689 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002690 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002691 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002692 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2693 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2694 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002695 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002696 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2697 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2698
2699 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002700 * <p>Current lens status.</p>
2701 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2702 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2703 * they may take several frames to reach the requested values. This state indicates
2704 * the current status of the lens parameters.</p>
2705 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2706 * either because the parameters are all fixed, or because the lens has had enough
2707 * time to reach the most recently-requested values.
2708 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2709 * <ul>
2710 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2711 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2712 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2713 * which means the optical zoom is not supported.</li>
2714 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2715 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2716 * </ul>
2717 * <p>Then this state will always be STATIONARY.</p>
2718 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2719 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002720 * <p><b>Possible values:</b>
2721 * <ul>
2722 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2723 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2724 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002725 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2726 * <p><b>Limited capability</b> -
2727 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2728 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002729 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002730 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002731 * @see CaptureRequest#LENS_APERTURE
2732 * @see CaptureRequest#LENS_FILTER_DENSITY
2733 * @see CaptureRequest#LENS_FOCAL_LENGTH
2734 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2735 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2736 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2737 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2738 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002739 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002740 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002741 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002742 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002743 public static final Key<Integer> LENS_STATE =
2744 new Key<Integer>("android.lens.state", int.class);
2745
2746 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002747 * <p>The orientation of the camera relative to the sensor
2748 * coordinate system.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002749 * <p>The four coefficients that describe the quaternion
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002750 * rotation from the Android sensor coordinate system to a
2751 * camera-aligned coordinate system where the X-axis is
2752 * aligned with the long side of the image sensor, the Y-axis
2753 * is aligned with the short side of the image sensor, and
2754 * the Z-axis is aligned with the optical axis of the sensor.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002755 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002756 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
2757 * amount <code>theta</code>, the following formulas can be used:</p>
2758 * <pre><code> theta = 2 * acos(w)
2759 * a_x = x / sin(theta/2)
2760 * a_y = y / sin(theta/2)
2761 * a_z = z / sin(theta/2)
2762 * </code></pre>
2763 * <p>To create a 3x3 rotation matrix that applies the rotation
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002764 * defined by this quaternion, the following matrix can be
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002765 * used:</p>
2766 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
2767 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
2768 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
2769 * </code></pre>
2770 * <p>This matrix can then be used to apply the rotation to a
2771 * column vector point with</p>
2772 * <p><code>p' = Rp</code></p>
2773 * <p>where <code>p</code> is in the device sensor coordinate system, and
2774 * <code>p'</code> is in the camera-oriented coordinate system.</p>
2775 * <p><b>Units</b>:
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002776 * Quaternion coefficients</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002777 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2778 */
2779 @PublicKey
2780 public static final Key<float[]> LENS_POSE_ROTATION =
2781 new Key<float[]>("android.lens.poseRotation", float[].class);
2782
2783 /**
2784 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07002785 * <p>The position of the camera device's lens optical center,
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002786 * as a three-dimensional vector <code>(x,y,z)</code>.</p>
2787 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
2788 * is relative to the optical center of the largest camera device facing in the same
2789 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
2790 * coordinate axes}. Note that only the axis definitions are shared with the sensor
2791 * coordinate system, but not the origin.</p>
2792 * <p>If this device is the largest or only camera device with a given facing, then this
2793 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
2794 * from the main sensor along the +X axis (to the right from the user's perspective) will
2795 * report <code>(0.03, 0, 0)</code>.</p>
2796 * <p>To transform a pixel coordinates between two cameras facing the same direction, first
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002797 * 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 -08002798 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
2799 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
2800 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
2801 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
2802 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
2803 * coordinates.</p>
2804 * <p>To compare this against a real image from the destination camera, the destination camera
2805 * image then needs to be corrected for radial distortion before comparison or sampling.</p>
2806 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to
2807 * the center of the primary gyroscope on the device.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002808 * <p><b>Units</b>: Meters</p>
2809 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2810 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002811 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002812 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002813 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002814 * @see CameraCharacteristics#LENS_POSE_ROTATION
2815 */
2816 @PublicKey
2817 public static final Key<float[]> LENS_POSE_TRANSLATION =
2818 new Key<float[]>("android.lens.poseTranslation", float[].class);
2819
2820 /**
2821 * <p>The parameters for this camera device's intrinsic
2822 * calibration.</p>
2823 * <p>The five calibration parameters that describe the
2824 * transform from camera-centric 3D coordinates to sensor
2825 * pixel coordinates:</p>
2826 * <pre><code>[f_x, f_y, c_x, c_y, s]
2827 * </code></pre>
2828 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
2829 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
2830 * axis, and <code>s</code> is a skew parameter for the sensor plane not
2831 * being aligned with the lens plane.</p>
2832 * <p>These are typically used within a transformation matrix K:</p>
2833 * <pre><code>K = [ f_x, s, c_x,
2834 * 0, f_y, c_y,
2835 * 0 0, 1 ]
2836 * </code></pre>
2837 * <p>which can then be combined with the camera pose rotation
2838 * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
2839 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
2840 * complete transform from world coordinates to pixel
2841 * coordinates:</p>
2842 * <pre><code>P = [ K 0 * [ R t
2843 * 0 1 ] 0 1 ]
2844 * </code></pre>
2845 * <p>and with <code>p_w</code> being a point in the world coordinate system
2846 * and <code>p_s</code> being a point in the camera active pixel array
2847 * coordinate system, and with the mapping including the
2848 * homogeneous division by z:</p>
2849 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
2850 * p_s = p_h / z_h
2851 * </code></pre>
2852 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
2853 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
2854 * (depth) in pixel coordinates.</p>
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002855 * <p>Note that the coordinate system for this transform is the
2856 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
2857 * where <code>(0,0)</code> is the top-left of the
2858 * preCorrectionActiveArraySize rectangle. Once the pose and
2859 * intrinsic calibration transforms have been applied to a
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002860 * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002861 * transform needs to be applied, and the result adjusted to
2862 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
2863 * system (where <code>(0, 0)</code> is the top-left of the
2864 * activeArraySize rectangle), to determine the final pixel
2865 * coordinate of the world point for processed (non-RAW)
2866 * output buffers.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002867 * <p><b>Units</b>:
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002868 * Pixels in the
2869 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
2870 * coordinate system.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002871 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2872 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002873 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002874 * @see CameraCharacteristics#LENS_POSE_ROTATION
2875 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07002876 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002877 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002878 */
2879 @PublicKey
2880 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
2881 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
2882
2883 /**
2884 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002885 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002886 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002887 * kappa_3]</code> and two tangential distortion coefficients
2888 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
2889 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002890 * <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 -07002891 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002892 * 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 -07002893 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002894 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002895 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
2896 * input image that correspond to the pixel values in the
2897 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
2898 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
2899 * </code></pre>
2900 * <p>The pixel coordinates are defined in a normalized
2901 * coordinate system related to the
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002902 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002903 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
2904 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
2905 * of both x and y coordinates are normalized to be 1 at the
2906 * edge further from the optical center, so the range
2907 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
2908 * <p>Finally, <code>r</code> represents the radial distance from the
2909 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
2910 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
2911 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002912 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002913 * Unitless coefficients.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002914 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002915 *
2916 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002917 * @deprecated
2918 * <p>This field was inconsistently defined in terms of its
2919 * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p>
2920 *
2921 * @see CameraCharacteristics#LENS_DISTORTION
2922
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002923 */
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002924 @Deprecated
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002925 @PublicKey
2926 public static final Key<float[]> LENS_RADIAL_DISTORTION =
2927 new Key<float[]>("android.lens.radialDistortion", float[].class);
2928
2929 /**
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002930 * <p>The correction coefficients to correct for this camera device's
2931 * radial and tangential lens distortion.</p>
2932 * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was
2933 * inconsistently defined.</p>
2934 * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2,
2935 * kappa_3]</code> and two tangential distortion coefficients
2936 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
2937 * lens's geometric distortion with the mapping equations:</p>
2938 * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
2939 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
2940 * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
2941 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
2942 * </code></pre>
2943 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
2944 * input image that correspond to the pixel values in the
2945 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
2946 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
2947 * </code></pre>
2948 * <p>The pixel coordinates are defined in a coordinate system
2949 * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
2950 * calibration fields; see that entry for details of the mapping stages.
2951 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code>
2952 * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and
2953 * the range of the coordinates depends on the focal length
2954 * terms of the intrinsic calibration.</p>
2955 * <p>Finally, <code>r</code> represents the radial distance from the
2956 * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p>
2957 * <p>The distortion model used is the Brown-Conrady model.</p>
2958 * <p><b>Units</b>:
2959 * Unitless coefficients.</p>
2960 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2961 *
2962 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
2963 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
2964 */
2965 @PublicKey
2966 public static final Key<float[]> LENS_DISTORTION =
2967 new Key<float[]>("android.lens.distortion", float[].class);
2968
2969 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002970 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002971 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08002972 * excessive noise added by the capture process, especially in dark conditions.</p>
2973 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
2974 * YUV domain.</p>
2975 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
2976 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
2977 * This mode is optional, may not be support by all devices. The application should check
2978 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002979 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2980 * will be applied. HIGH_QUALITY mode indicates that the camera device
2981 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002982 * even if it slows down capture rate. FAST means the camera device will not
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002983 * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
2984 * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
2985 * Every output stream will have a similar amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002986 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2987 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2988 * into a final capture when triggered by the user. In this mode, the camera device applies
2989 * noise reduction to low-resolution streams (below maximum recording resolution) to maximize
2990 * preview quality, but does not apply noise reduction to high-resolution streams, since
2991 * those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002992 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
2993 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
2994 * may adjust the noise reduction parameters for best image quality based on the
2995 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002996 * <p><b>Possible values:</b>
2997 * <ul>
2998 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2999 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
3000 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08003001 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003002 * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003003 * </ul></p>
3004 * <p><b>Available values for this device:</b><br>
3005 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003006 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3007 * <p><b>Full capability</b> -
3008 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3009 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003010 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003011 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003012 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08003013 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003014 * @see #NOISE_REDUCTION_MODE_OFF
3015 * @see #NOISE_REDUCTION_MODE_FAST
3016 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08003017 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07003018 * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003019 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003020 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003021 public static final Key<Integer> NOISE_REDUCTION_MODE =
3022 new Key<Integer>("android.noiseReduction.mode", int.class);
3023
3024 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003025 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003026 * final one for the capture, or only a partial that contains a
3027 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08003028 * values.</p>
3029 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003030 * single capture may not overlap, except for this entry. The
3031 * FINAL buffers must retain FIFO ordering relative to the
3032 * requests that generate them, so the FINAL buffer for frame 3 must
3033 * always be sent to the framework after the FINAL buffer for frame 2, and
3034 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
3035 * in any order relative to other frames, but all PARTIAL buffers for a given
3036 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08003037 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003038 * <p><b>Range of valid values:</b><br>
3039 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003040 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003041 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003042 * <p>Not used in HALv3 or newer</p>
3043
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003044 * @hide
3045 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003046 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08003047 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
3048 new Key<Boolean>("android.quirks.partialResult", boolean.class);
3049
3050 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003051 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07003052 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08003053 * frameCount value).</p>
3054 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003055 * <p><b>Units</b>: count of frames</p>
3056 * <p><b>Range of valid values:</b><br>
3057 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003058 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003059 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003060 * <p>Not used in HALv3 or newer</p>
3061
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003062 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003063 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003064 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003065 public static final Key<Integer> REQUEST_FRAME_COUNT =
3066 new Key<Integer>("android.request.frameCount", int.class);
3067
3068 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003069 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003070 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08003071 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003072 * <p><b>Units</b>: arbitrary integer assigned by application</p>
3073 * <p><b>Range of valid values:</b><br>
3074 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003075 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003076 * @hide
3077 */
3078 public static final Key<Integer> REQUEST_ID =
3079 new Key<Integer>("android.request.id", int.class);
3080
3081 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003082 * <p>Specifies the number of pipeline stages the frame went
3083 * through from when it was exposed to when the final completed result
3084 * was available to the framework.</p>
3085 * <p>Depending on what settings are used in the request, and
3086 * what streams are configured, the data may undergo less processing,
3087 * and some pipeline stages skipped.</p>
3088 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003089 * <p><b>Range of valid values:</b><br>
3090 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003091 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003092 *
3093 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3094 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003095 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003096 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
3097 new Key<Byte>("android.request.pipelineDepth", byte.class);
3098
3099 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003100 * <p>The desired region of the sensor to read out for this capture.</p>
3101 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003102 * <p>The crop region coordinate system is based off
3103 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
3104 * top-left corner of the sensor active array.</p>
3105 * <p>Output streams use this rectangle to produce their output,
3106 * cropping to a smaller region if necessary to maintain the
3107 * stream's aspect ratio, then scaling the sensor input to
3108 * match the output's configured resolution.</p>
3109 * <p>The crop region is applied after the RAW to other color
3110 * space (e.g. YUV) conversion. Since raw streams
3111 * (e.g. RAW16) don't have the conversion stage, they are not
3112 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07003113 * <p>For non-raw streams, any additional per-stream cropping will
3114 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003115 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003116 * ratio, then 4:3 streams will use the exact crop
3117 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08003118 * (letterbox).</p>
3119 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003120 * outputs will crop horizontally (pillarbox), and 16:9
3121 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08003122 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003123 * <p>The width and height of the crop region cannot
3124 * be set to be smaller than
3125 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
3126 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
3127 * <p>The camera device may adjust the crop region to account
3128 * for rounding and other hardware requirements; the final
3129 * crop region used will be included in the output capture
3130 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003131 * <p><b>Units</b>: Pixel coordinates relative to
3132 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003133 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003134 *
3135 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003136 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003137 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003138 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003139 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
3140 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
3141
3142 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003143 * <p>Duration each pixel is exposed to
3144 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003145 * <p>If the sensor can't expose this exact duration, it will shorten the
3146 * duration exposed to the nearest possible value (rather than expose longer).
3147 * The final exposure time used will be available in the output capture result.</p>
3148 * <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
3149 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3150 * <p><b>Units</b>: Nanoseconds</p>
3151 * <p><b>Range of valid values:</b><br>
3152 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003153 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3154 * <p><b>Full capability</b> -
3155 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3156 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3157 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003158 * @see CaptureRequest#CONTROL_AE_MODE
3159 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003160 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003161 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003162 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003163 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003164 public static final Key<Long> SENSOR_EXPOSURE_TIME =
3165 new Key<Long>("android.sensor.exposureTime", long.class);
3166
3167 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003168 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003169 * start of next frame exposure.</p>
3170 * <p>The maximum frame rate that can be supported by a camera subsystem is
3171 * a function of many factors:</p>
3172 * <ul>
3173 * <li>Requested resolutions of output image streams</li>
3174 * <li>Availability of binning / skipping modes on the imager</li>
3175 * <li>The bandwidth of the imager interface</li>
3176 * <li>The bandwidth of the various ISP processing blocks</li>
3177 * </ul>
3178 * <p>Since these factors can vary greatly between different ISPs and
3179 * sensors, the camera abstraction tries to represent the bandwidth
3180 * restrictions with as simple a model as possible.</p>
3181 * <p>The model presented has the following characteristics:</p>
3182 * <ul>
3183 * <li>The image sensor is always configured to output the smallest
3184 * resolution possible given the application's requested output stream
3185 * sizes. The smallest resolution is defined as being at least as large
3186 * as the largest requested output stream size; the camera pipeline must
3187 * never digitally upsample sensor data when the crop region covers the
3188 * whole sensor. In general, this means that if only small output stream
3189 * resolutions are configured, the sensor can provide a higher frame
3190 * rate.</li>
3191 * <li>Since any request may use any or all the currently configured
3192 * output streams, the sensor and ISP must be configured to support
3193 * scaling a single capture to all the streams at the same time. This
3194 * means the camera pipeline must be ready to produce the largest
3195 * requested output size without any delay. Therefore, the overall
3196 * frame rate of a given configured stream set is governed only by the
3197 * largest requested stream resolution.</li>
3198 * <li>Using more than one output stream in a request does not affect the
3199 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08003200 * <li>Certain format-streams may need to do additional background processing
3201 * before data is consumed/produced by that stream. These processors
3202 * can run concurrently to the rest of the camera pipeline, but
3203 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003204 * </ul>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003205 * <p>The necessary information for the application, given the model above, is provided via
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003206 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003207 * These are used to determine the maximum frame rate / minimum frame duration that is
3208 * possible for a given stream configuration.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003209 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08003210 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003211 * device:</p>
3212 * <ol>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003213 * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li>
3214 * <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 }
3215 * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li>
3216 * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum
3217 * 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 -08003218 * </ol>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003219 * <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 -08003220 * using its respective size/format), then the frame duration in <code>F</code> determines the steady
3221 * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let
3222 * this special kind of request be called <code>Rsimple</code>.</p>
3223 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a
3224 * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if
3225 * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all
3226 * buffers from the previous <code>Rstall</code> have already been delivered.</p>
3227 * <p>For more details about stalling, see {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003228 * <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
3229 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3230 * <p><b>Units</b>: Nanoseconds</p>
3231 * <p><b>Range of valid values:</b><br>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003232 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }.
3233 * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003234 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3235 * <p><b>Full capability</b> -
3236 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3237 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003238 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003239 * @see CaptureRequest#CONTROL_AE_MODE
3240 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003241 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003242 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003243 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003244 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003245 public static final Key<Long> SENSOR_FRAME_DURATION =
3246 new Key<Long>("android.sensor.frameDuration", long.class);
3247
3248 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003249 * <p>The amount of gain applied to sensor data
3250 * before processing.</p>
3251 * <p>The sensitivity is the standard ISO sensitivity value,
3252 * as defined in ISO 12232:2006.</p>
3253 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
3254 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
3255 * is guaranteed to use only analog amplification for applying the gain.</p>
3256 * <p>If the camera device cannot apply the exact sensitivity
3257 * requested, it will reduce the gain to the nearest supported
3258 * value. The final sensitivity used will be available in the
3259 * output capture result.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003260 * <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
3261 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003262 * <p><b>Units</b>: ISO arithmetic units</p>
3263 * <p><b>Range of valid values:</b><br>
3264 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003265 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3266 * <p><b>Full capability</b> -
3267 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3268 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003269 *
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003270 * @see CaptureRequest#CONTROL_AE_MODE
3271 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003272 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003273 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
3274 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003275 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003276 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003277 public static final Key<Integer> SENSOR_SENSITIVITY =
3278 new Key<Integer>("android.sensor.sensitivity", int.class);
3279
3280 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003281 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07003282 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003283 * <p>The timestamps are also included in all image
3284 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07003285 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003286 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07003287 * the timestamps measure time since an unspecified starting point,
3288 * and are monotonically increasing. They can be compared with the
3289 * timestamps for other captures from the same camera device, but are
3290 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003291 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the
3292 * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can
3293 * be compared to other timestamps from other subsystems that
3294 * are using that base.</p>
Chien-Yu Chen6216e4e2015-05-29 11:49:54 -07003295 * <p>For reprocessing, the timestamp will match the start of exposure of
3296 * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the
3297 * timestamp} in the TotalCaptureResult that was used to create the
3298 * reprocess capture request.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003299 * <p><b>Units</b>: Nanoseconds</p>
3300 * <p><b>Range of valid values:</b><br>
3301 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003302 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07003303 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003304 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003305 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003306 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003307 public static final Key<Long> SENSOR_TIMESTAMP =
3308 new Key<Long>("android.sensor.timestamp", long.class);
3309
3310 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07003311 * <p>The estimated camera neutral color in the native sensor colorspace at
3312 * the time of capture.</p>
3313 * <p>This value gives the neutral color point encoded as an RGB value in the
3314 * native sensor color space. The neutral color point indicates the
3315 * currently estimated white point of the scene illumination. It can be
3316 * used to interpolate between the provided color transforms when
3317 * processing raw sensor data.</p>
3318 * <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 -08003319 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3320 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003321 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08003322 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
3323 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
3324
3325 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003326 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003327 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003328 * corresponding to the sensor amplification (S) and sensor readout
3329 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003330 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003331 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
3332 * represented as an array of Pair&lt;Double, Double&gt;, where
3333 * the first member of the Pair at index n is the S coefficient and the
3334 * second member is the O coefficient for the nth color channel in the CFA.</p>
3335 * <p>These coefficients are used in a two parameter noise model to describe
3336 * the amount of noise present in the image for each CFA channel. The
3337 * noise model used here is:</p>
3338 * <p>N(x) = sqrt(Sx + O)</p>
3339 * <p>Where x represents the recorded signal of a CFA channel normalized to
3340 * the range [0, 1], and S and O are the noise model coeffiecients for
3341 * that channel.</p>
3342 * <p>A more detailed description of the noise model can be found in the
3343 * Adobe DNG specification for the NoiseProfile tag.</p>
3344 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3345 *
3346 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3347 */
3348 @PublicKey
3349 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
3350 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
3351
3352 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08003353 * <p>The worst-case divergence between Bayer green channels.</p>
3354 * <p>This value is an estimate of the worst case split between the
3355 * Bayer green channels in the red and blue rows in the sensor color
3356 * filter array.</p>
3357 * <p>The green split is calculated as follows:</p>
3358 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07003359 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
3360 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
3361 * mosaic channels (R, Gr, Gb, B). The location and size of the window
3362 * chosen is implementation defined, and should be chosen to provide a
3363 * green split estimate that is both representative of the entire image
3364 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003365 * <li>The arithmetic mean of the green channels from the red
3366 * rows (mean_Gr) within W is computed.</li>
3367 * <li>The arithmetic mean of the green channels from the blue
3368 * rows (mean_Gb) within W is computed.</li>
3369 * <li>The maximum ratio R of the two means is computed as follows:
3370 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
3371 * </ol>
3372 * <p>The ratio R is the green split divergence reported for this property,
3373 * which represents how much the green channels differ in the mosaic
3374 * pattern. This value is typically used to determine the treatment of
3375 * the green mosaic channels when demosaicing.</p>
3376 * <p>The green split value can be roughly interpreted as follows:</p>
3377 * <ul>
3378 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
3379 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
3380 * correction to avoid demosaic errors (3-20% divergence).</li>
3381 * <li>R &gt; 1.20 will require strong software correction to produce
3382 * a usuable image (&gt;20% divergence).</li>
3383 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003384 * <p><b>Range of valid values:</b><br></p>
3385 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003386 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3387 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003388 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08003389 public static final Key<Float> SENSOR_GREEN_SPLIT =
3390 new Key<Float>("android.sensor.greenSplit", float.class);
3391
3392 /**
Zhijun He379af012014-05-06 11:54:54 -07003393 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
3394 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
3395 * <p>Each color channel is treated as an unsigned 32-bit integer.
3396 * The camera device then uses the most significant X bits
3397 * that correspond to how many bits are in its Bayer raw sensor
3398 * output.</p>
3399 * <p>For example, a sensor with RAW10 Bayer output would use the
3400 * 10 most significant bits from each color channel.</p>
3401 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3402 *
3403 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
3404 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003405 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003406 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
3407 new Key<int[]>("android.sensor.testPatternData", int[].class);
3408
3409 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003410 * <p>When enabled, the sensor sends a test pattern instead of
3411 * doing a real exposure from the camera.</p>
3412 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003413 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08003414 * work as normal.</p>
3415 * <p>For example, if manual flash is enabled, flash firing should still
3416 * occur (and that the test pattern remain unmodified, since the flash
3417 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003418 * <p>Defaults to OFF.</p>
3419 * <p><b>Possible values:</b>
3420 * <ul>
3421 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
3422 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
3423 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
3424 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
3425 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
3426 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
3427 * </ul></p>
3428 * <p><b>Available values for this device:</b><br>
3429 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003430 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003431 *
3432 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08003433 * @see #SENSOR_TEST_PATTERN_MODE_OFF
3434 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
3435 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
3436 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
3437 * @see #SENSOR_TEST_PATTERN_MODE_PN9
3438 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
3439 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003440 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003441 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
3442 new Key<Integer>("android.sensor.testPatternMode", int.class);
3443
3444 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07003445 * <p>Duration between the start of first row exposure
3446 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003447 * <p>This is the exposure time skew between the first and last
3448 * row exposure start times. The first row and the last row are
3449 * the first and last rows inside of the
3450 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003451 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
3452 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003453 * <p><b>Units</b>: Nanoseconds</p>
3454 * <p><b>Range of valid values:</b><br>
3455 * &gt;= 0 and &lt;
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003456 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003457 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3458 * <p><b>Limited capability</b> -
3459 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3460 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003461 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003462 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07003463 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3464 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003465 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07003466 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
3467 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
3468
3469 /**
Zhijun Hecd950b62015-11-12 17:47:52 -08003470 * <p>A per-frame dynamic black level offset for each of the color filter
3471 * arrangement (CFA) mosaic channels.</p>
3472 * <p>Camera sensor black levels may vary dramatically for different
3473 * capture settings (e.g. {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). The fixed black
3474 * level reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may be too
3475 * inaccurate to represent the actual value on a per-frame basis. The
3476 * camera device internal pipeline relies on reliable black level values
3477 * to process the raw images appropriately. To get the best image
3478 * quality, the camera device may choose to estimate the per frame black
3479 * level values either based on optically shielded black regions
3480 * ({@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}) or its internal model.</p>
3481 * <p>This key reports the camera device estimated per-frame zero light
3482 * value for each of the CFA mosaic channels in the camera sensor. The
3483 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may only represent a coarse
3484 * approximation of the actual black level values. This value is the
3485 * black level used in camera device internal image processing pipeline
3486 * and generally more accurate than the fixed black level values.
3487 * However, since they are estimated values by the camera device, they
3488 * may not be as accurate as the black level values calculated from the
3489 * optical black pixels reported by {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}.</p>
3490 * <p>The values are given in the same order as channels listed for the CFA
3491 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
3492 * nth value given corresponds to the black level offset for the nth
3493 * color channel listed in the CFA.</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003494 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is available or the
3495 * camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08003496 * <p><b>Range of valid values:</b><br>
3497 * &gt;= 0 for each.</p>
3498 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3499 *
3500 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
3501 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3502 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3503 * @see CaptureRequest#SENSOR_SENSITIVITY
3504 */
3505 @PublicKey
Zhijun He8998ad92015-11-24 14:31:04 -08003506 public static final Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL =
3507 new Key<float[]>("android.sensor.dynamicBlackLevel", float[].class);
Zhijun Hecd950b62015-11-12 17:47:52 -08003508
3509 /**
3510 * <p>Maximum raw value output by sensor for this frame.</p>
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07003511 * <p>Since the {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may change for different
Zhijun Hecd950b62015-11-12 17:47:52 -08003512 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}), the white
3513 * level will change accordingly. This key is similar to
3514 * {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}, but specifies the camera device
3515 * estimated white level for each frame.</p>
3516 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is
3517 * available or the camera device advertises this key via
3518 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys }.</p>
3519 * <p><b>Range of valid values:</b><br>
3520 * &gt;= 0</p>
3521 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3522 *
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07003523 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
Zhijun Hecd950b62015-11-12 17:47:52 -08003524 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
3525 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3526 * @see CaptureRequest#SENSOR_SENSITIVITY
3527 */
3528 @PublicKey
3529 public static final Key<Integer> SENSOR_DYNAMIC_WHITE_LEVEL =
3530 new Key<Integer>("android.sensor.dynamicWhiteLevel", int.class);
3531
3532 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08003533 * <p>Quality of lens shading correction applied
3534 * to the image data.</p>
3535 * <p>When set to OFF mode, no lens shading correction will be applied by the
3536 * camera device, and an identity lens shading map data will be provided
3537 * 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 -07003538 * shading map with size of <code>[ 4, 3 ]</code>,
3539 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
3540 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003541 * <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 -07003542 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3543 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3544 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3545 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3546 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08003547 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003548 * <p>When set to other modes, lens shading correction will be applied by the camera
3549 * device. Applications can request lens shading map data by setting
3550 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
3551 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
3552 * data will be the one applied by the camera device for this capture request.</p>
3553 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
3554 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
3555 * 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>
3556 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
3557 * to be converged before using the returned shading map data.</p>
3558 * <p><b>Possible values:</b>
3559 * <ul>
3560 * <li>{@link #SHADING_MODE_OFF OFF}</li>
3561 * <li>{@link #SHADING_MODE_FAST FAST}</li>
3562 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3563 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003564 * <p><b>Available values for this device:</b><br>
3565 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003566 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3567 * <p><b>Full capability</b> -
3568 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3569 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003570 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07003571 * @see CaptureRequest#CONTROL_AE_MODE
3572 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003573 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003574 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003575 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08003576 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3577 * @see #SHADING_MODE_OFF
3578 * @see #SHADING_MODE_FAST
3579 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08003580 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003581 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08003582 public static final Key<Integer> SHADING_MODE =
3583 new Key<Integer>("android.shading.mode", int.class);
3584
3585 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003586 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003587 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003588 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003589 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003590 * fields.</p>
3591 * <p><b>Possible values:</b>
3592 * <ul>
3593 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3594 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3595 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3596 * </ul></p>
3597 * <p><b>Available values for this device:</b><br>
3598 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3599 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003600 *
3601 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003602 * @see #STATISTICS_FACE_DETECT_MODE_OFF
3603 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3604 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3605 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003606 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003607 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3608 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3609
3610 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003611 * <p>List of unique IDs for detected faces.</p>
3612 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3613 * to the camera device. A face that leaves the field of view and later returns may be
3614 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003615 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3616 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003617 *
3618 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003619 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003620 */
3621 public static final Key<int[]> STATISTICS_FACE_IDS =
3622 new Key<int[]>("android.statistics.faceIds", int[].class);
3623
3624 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003625 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003626 * faces.</p>
3627 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3628 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003629 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3630 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003631 *
3632 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3633 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003634 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003635 */
3636 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3637 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3638
3639 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003640 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003641 * faces.</p>
3642 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3643 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003644 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3645 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003646 *
3647 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3648 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003649 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003650 */
3651 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3652 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3653
3654 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003655 * <p>List of the face confidence scores for
3656 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003657 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003658 * <p><b>Range of valid values:</b><br>
3659 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003660 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003661 *
3662 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003663 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003664 */
3665 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3666 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3667
3668 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003669 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003670 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003671 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003672 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003673 *
3674 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3675 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003676 @PublicKey
3677 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003678 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3679 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3680
3681 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003682 * <p>The shading map is a low-resolution floating-point map
3683 * that lists the coefficients used to correct for vignetting, for each
3684 * Bayer color channel.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003685 * <p>The map provided here is the same map that is used by the camera device to
3686 * correct both color shading and vignetting for output non-RAW images.</p>
3687 * <p>When there is no lens shading correction applied to RAW
3688 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3689 * false), this map is the complete lens shading correction
3690 * map; when there is some lens shading correction applied to
3691 * 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
3692 * correction map that needs to be applied to get shading
3693 * corrected images that match the camera device's output for
3694 * non-RAW formats.</p>
3695 * <p>For a complete shading correction map, the least shaded
3696 * section of the image will have a gain factor of 1; all
3697 * other sections will have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003698 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003699 * will take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003700 * <p>The shading map is for the entire active pixel array, and is not
3701 * affected by the crop region specified in the request. Each shading map
3702 * entry is the value of the shading compensation map over a specific
3703 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3704 * map, and an active pixel array size (W x H), shading map entry
3705 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3706 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3707 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3708 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3709 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003710 * The shading map is stored in a fully interleaved format.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003711 * <p>The shading map will generally have on the order of 30-40 rows and columns,
3712 * and will be smaller than 64x64.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003713 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003714 * <pre><code>width,height = [ 4, 3 ]
3715 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003716 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003717 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3718 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3719 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3720 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3721 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003722 * </code></pre>
3723 * <p>The low-resolution scaling map images for each channel are
3724 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003725 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3726 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3727 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3728 * <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 -08003729 * <p>As a visualization only, inverting the full-color map to recover an
3730 * 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 -08003731 * <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 -07003732 * <p><b>Range of valid values:</b><br>
3733 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003734 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3735 * <p><b>Full capability</b> -
3736 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3737 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003738 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003739 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003740 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003741 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003742 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003743 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003744 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3745 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3746
3747 /**
3748 * <p>The shading map is a low-resolution floating-point map
Zhijun He43210fe2016-04-12 23:15:23 -07003749 * that lists the coefficients used to correct for vignetting and color shading,
3750 * for each Bayer color channel of RAW image data.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003751 * <p>The map provided here is the same map that is used by the camera device to
3752 * correct both color shading and vignetting for output non-RAW images.</p>
3753 * <p>When there is no lens shading correction applied to RAW
3754 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3755 * false), this map is the complete lens shading correction
3756 * map; when there is some lens shading correction applied to
3757 * 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
3758 * correction map that needs to be applied to get shading
3759 * corrected images that match the camera device's output for
3760 * non-RAW formats.</p>
3761 * <p>For a complete shading correction map, the least shaded
3762 * section of the image will have a gain factor of 1; all
3763 * other sections will have gains above 1.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003764 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003765 * will take into account the colorCorrection settings.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003766 * <p>The shading map is for the entire active pixel array, and is not
3767 * affected by the crop region specified in the request. Each shading map
3768 * entry is the value of the shading compensation map over a specific
3769 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3770 * map, and an active pixel array size (W x H), shading map entry
3771 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3772 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3773 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3774 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3775 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3776 * The shading map is stored in a fully interleaved format, and its size
3777 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003778 * <p>The shading map will generally have on the order of 30-40 rows and columns,
3779 * and will be smaller than 64x64.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003780 * <p>As an example, given a very small map defined as:</p>
3781 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3782 * android.statistics.lensShadingMap =
3783 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003784 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3785 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3786 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3787 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3788 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003789 * </code></pre>
3790 * <p>The low-resolution scaling map images for each channel are
3791 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003792 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3793 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3794 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3795 * <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 -07003796 * <p>As a visualization only, inverting the full-color map to recover an
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003797 * image of a gray wall (using bicubic interpolation for visual quality)
3798 * as captured by the sensor gives:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003799 * <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 -08003800 * <p>Note that the RAW image data might be subject to lens shading
3801 * correction not reported on this map. Query
3802 * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject
3803 * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}
3804 * is TRUE, the RAW image data is subject to partial or full lens shading
3805 * correction. In the case full lens shading correction is applied to RAW
3806 * images, the gain factor map reported in this key will contain all 1.0 gains.
3807 * In other words, the map reported in this key is the remaining lens shading
3808 * that needs to be applied on the RAW image to get images without lens shading
3809 * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image
3810 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003811 * <p><b>Range of valid values:</b><br>
3812 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003813 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3814 * <p><b>Full capability</b> -
3815 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3816 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003817 *
3818 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003819 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003820 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
3821 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003822 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003823 */
3824 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3825 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3826
3827 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003828 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003829 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003830 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003831 * since statistics processing on data from a new frame
3832 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003833 * applied to that frame.</p>
3834 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003835 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003836 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003837 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003838 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003839 *
3840 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003841 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003842 * <p>Never fully implemented or specified; do not use</p>
3843
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003844 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003845 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003846 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003847 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3848 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3849
3850 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003851 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08003852 * calculated by the camera device's statistics units for the current
3853 * output frame.</p>
3854 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003855 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08003856 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003857 * are the best fit for the current output frame. This may
3858 * be different than the transform used for this frame, since
3859 * statistics processing on data from a new frame typically
3860 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003861 * that frame.</p>
3862 * <p>These estimates must be provided for all frames, even if
3863 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003864 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003865 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003866 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003867 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003868 * <p>Never fully implemented or specified; do not use</p>
3869
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003870 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003871 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003872 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003873 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3874 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3875
3876 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08003877 * <p>The camera device estimated scene illumination lighting
3878 * frequency.</p>
3879 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3880 * that depends on the local utility power standards. This flicker must be
3881 * accounted for by auto-exposure routines to avoid artifacts in captured images.
3882 * The camera device uses this entry to tell the application what the scene
3883 * illuminant frequency is.</p>
3884 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003885 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3886 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3887 * antibanding, and the application can ensure it selects
3888 * exposure times that do not cause banding issues by looking
3889 * into this metadata field. See
3890 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3891 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003892 * <p><b>Possible values:</b>
3893 * <ul>
3894 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3895 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3896 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3897 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003898 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3899 * <p><b>Full capability</b> -
3900 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3901 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08003902 *
3903 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3904 * @see CaptureRequest#CONTROL_AE_MODE
3905 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003906 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003907 * @see #STATISTICS_SCENE_FLICKER_NONE
3908 * @see #STATISTICS_SCENE_FLICKER_50HZ
3909 * @see #STATISTICS_SCENE_FLICKER_60HZ
3910 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003911 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003912 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
3913 new Key<Integer>("android.statistics.sceneFlicker", int.class);
3914
3915 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003916 * <p>Operating mode for hot pixel map generation.</p>
3917 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
3918 * If set to <code>false</code>, no hot pixel map will be returned.</p>
3919 * <p><b>Range of valid values:</b><br>
3920 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003921 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003922 *
3923 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
3924 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
3925 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003926 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003927 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
3928 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
3929
3930 /**
3931 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
3932 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
3933 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
3934 * bottom-right of the pixel array, respectively. The width and
3935 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
3936 * This may include hot pixels that lie outside of the active array
3937 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003938 * <p><b>Range of valid values:</b><br></p>
3939 * <p>n &lt;= number of pixels on the sensor.
3940 * The <code>(x, y)</code> coordinates must be bounded by
3941 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003942 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003943 *
3944 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3945 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3946 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003947 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003948 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
3949 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003950
3951 /**
Zhijun He379af012014-05-06 11:54:54 -07003952 * <p>Whether the camera device will output the lens
3953 * shading map in output result metadata.</p>
3954 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003955 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07003956 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003957 * <p>ON is always supported on devices with the RAW capability.</p>
3958 * <p><b>Possible values:</b>
3959 * <ul>
3960 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3961 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3962 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003963 * <p><b>Available values for this device:</b><br>
3964 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003965 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3966 * <p><b>Full capability</b> -
3967 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3968 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3969 *
3970 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003971 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Zhijun He379af012014-05-06 11:54:54 -07003972 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3973 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3974 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003975 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003976 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3977 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3978
3979 /**
Eino-Ville Talvala601e0f62018-02-05 16:25:40 -08003980 * <p>A control for selecting whether OIS position information is included in output
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003981 * result metadata.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003982 * <p><b>Possible values:</b>
3983 * <ul>
3984 * <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li>
3985 * <li>{@link #STATISTICS_OIS_DATA_MODE_ON ON}</li>
3986 * </ul></p>
3987 * <p><b>Available values for this device:</b><br>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003988 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES android.statistics.info.availableOisDataModes}</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003989 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003990 *
3991 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003992 * @see #STATISTICS_OIS_DATA_MODE_OFF
3993 * @see #STATISTICS_OIS_DATA_MODE_ON
3994 */
3995 @PublicKey
3996 public static final Key<Integer> STATISTICS_OIS_DATA_MODE =
3997 new Key<Integer>("android.statistics.oisDataMode", int.class);
3998
3999 /**
4000 * <p>An array of timestamps of OIS samples, in nanoseconds.</p>
4001 * <p>The array contains the timestamps of OIS samples. The timestamps are in the same
4002 * timebase as and comparable to {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp}.</p>
4003 * <p><b>Units</b>: nanoseconds</p>
4004 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4005 *
4006 * @see CaptureResult#SENSOR_TIMESTAMP
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004007 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004008 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004009 public static final Key<long[]> STATISTICS_OIS_TIMESTAMPS =
4010 new Key<long[]>("android.statistics.oisTimestamps", long[].class);
4011
4012 /**
4013 * <p>An array of shifts of OIS samples, in x direction.</p>
4014 * <p>The array contains the amount of shifts in x direction, in pixels, based on OIS samples.
4015 * A positive value is a shift from left to right in active array coordinate system. For
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004016 * example, if the optical center is (1000, 500) in active array coordinates, a shift of
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004017 * (3, 0) puts the new optical center at (1003, 500).</p>
4018 * <p>The number of shifts must match the number of timestamps in
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004019 * android.statistics.oisTimestamps.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004020 * <p><b>Units</b>: Pixels in active array.</p>
4021 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004022 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004023 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004024 public static final Key<float[]> STATISTICS_OIS_X_SHIFTS =
4025 new Key<float[]>("android.statistics.oisXShifts", float[].class);
4026
4027 /**
4028 * <p>An array of shifts of OIS samples, in y direction.</p>
4029 * <p>The array contains the amount of shifts in y direction, in pixels, based on OIS samples.
4030 * A positive value is a shift from top to bottom in active array coordinate system. For
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004031 * example, if the optical center is (1000, 500) in active array coordinates, a shift of
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004032 * (0, 5) puts the new optical center at (1000, 505).</p>
4033 * <p>The number of shifts must match the number of timestamps in
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004034 * android.statistics.oisTimestamps.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004035 * <p><b>Units</b>: Pixels in active array.</p>
4036 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004037 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004038 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08004039 public static final Key<float[]> STATISTICS_OIS_Y_SHIFTS =
4040 new Key<float[]>("android.statistics.oisYShifts", float[].class);
4041
4042 /**
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08004043 * <p>An array of OIS samples.</p>
4044 * <p>Each OIS sample contains the timestamp and the amount of shifts in x and y direction,
4045 * in pixels, of the OIS sample.</p>
4046 * <p>A positive value for a shift in x direction is a shift from left to right in active array
4047 * coordinate system. For example, if the optical center is (1000, 500) in active array
4048 * coordinates, a shift of (3, 0) puts the new optical center at (1003, 500).</p>
4049 * <p>A positive value for a shift in y direction is a shift from top to bottom in active array
4050 * coordinate system. For example, if the optical center is (1000, 500) in active array
4051 * coordinates, a shift of (0, 5) puts the new optical center at (1000, 505).</p>
4052 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4053 */
4054 @PublicKey
4055 @SyntheticKey
4056 public static final Key<android.hardware.camera2.params.OisSample[]> STATISTICS_OIS_SAMPLES =
4057 new Key<android.hardware.camera2.params.OisSample[]>("android.statistics.oisSamples", android.hardware.camera2.params.OisSample[].class);
4058
4059 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004060 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08004061 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4062 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004063 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004064 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4065 * <p><b>Full capability</b> -
4066 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4067 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004068 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004069 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004070 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004071 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004072 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004073 public static final Key<float[]> TONEMAP_CURVE_BLUE =
4074 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004075
4076 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004077 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08004078 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4079 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004080 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004081 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4082 * <p><b>Full capability</b> -
4083 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4084 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004085 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004086 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004087 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004088 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004089 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004090 public static final Key<float[]> TONEMAP_CURVE_GREEN =
4091 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004092
4093 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004094 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08004095 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4096 * CONTRAST_CURVE.</p>
4097 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004098 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004099 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08004100 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004101 * <p>These are sorted in order of increasing <code>Pin</code>; it is
4102 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08004103 * define a complete mapping. For input values between control points,
4104 * the camera device must linearly interpolate between the control
4105 * points.</p>
4106 * <p>Each curve can have an independent number of points, and the number
4107 * of points can be less than max (that is, the request doesn't have to
4108 * always provide a curve with number of points equivalent to
4109 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wang51248bf2018-03-22 00:04:45 -07004110 * <p>For devices with MONOCHROME capability, only red channel is used. Green and blue channels
4111 * are ignored.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08004112 * <p>A few examples, and their corresponding graphical mappings; these
4113 * only specify the red channel and the precision is limited to 4
4114 * digits, for conciseness.</p>
4115 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004116 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004117 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004118 * <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 -08004119 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004120 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004121 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004122 * <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 -08004123 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004124 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004125 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
4126 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
4127 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
4128 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004129 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004130 * <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 -08004131 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004132 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004133 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
4134 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
4135 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
4136 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004137 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004138 * <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 -07004139 * <p><b>Range of valid values:</b><br>
4140 * 0-1 on both input and output coordinates, normalized
4141 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004142 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4143 * <p><b>Full capability</b> -
4144 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4145 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004146 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004147 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08004148 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004149 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004150 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004151 */
4152 public static final Key<float[]> TONEMAP_CURVE_RED =
4153 new Key<float[]>("android.tonemap.curveRed", float[].class);
4154
4155 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004156 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
4157 * is CONTRAST_CURVE.</p>
4158 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
4159 * channels respectively. The following example uses the red channel as an
4160 * example. The same logic applies to green and blue channel.
4161 * Each channel's curve is defined by an array of control points:</p>
4162 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004163 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004164 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
4165 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
4166 * guaranteed that input values 0.0 and 1.0 are included in the list to
4167 * define a complete mapping. For input values between control points,
4168 * the camera device must linearly interpolate between the control
4169 * points.</p>
4170 * <p>Each curve can have an independent number of points, and the number
4171 * of points can be less than max (that is, the request doesn't have to
4172 * always provide a curve with number of points equivalent to
4173 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wang51248bf2018-03-22 00:04:45 -07004174 * <p>For devices with MONOCHROME capability, only red channel is used. Green and blue channels
4175 * are ignored.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004176 * <p>A few examples, and their corresponding graphical mappings; these
4177 * only specify the red channel and the precision is limited to 4
4178 * digits, for conciseness.</p>
4179 * <p>Linear mapping:</p>
4180 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
4181 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004182 * <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 -07004183 * <p>Invert mapping:</p>
4184 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
4185 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004186 * <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 -07004187 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
4188 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004189 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
4190 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
4191 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
4192 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004193 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004194 * <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 -07004195 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
4196 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004197 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
4198 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
4199 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
4200 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004201 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004202 * <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 -07004203 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4204 * <p><b>Full capability</b> -
4205 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4206 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004207 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004208 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004209 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
4210 * @see CaptureRequest#TONEMAP_MODE
4211 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004212 @PublicKey
4213 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004214 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
4215 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
4216
4217 /**
Igor Murashkine0060932014-01-17 17:24:11 -08004218 * <p>High-level global contrast/gamma/tonemapping control.</p>
4219 * <p>When switching to an application-defined contrast curve by setting
4220 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
4221 * per-channel with a set of <code>(in, out)</code> points that specify the
4222 * mapping from input high-bit-depth pixel value to the output
4223 * low-bit-depth value. Since the actual pixel ranges of both input
4224 * and output may change depending on the camera pipeline, the values
4225 * are specified by normalized floating-point numbers.</p>
4226 * <p>More-complex color mapping operations such as 3D color look-up
4227 * tables, selective chroma enhancement, or other non-linear color
4228 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4229 * CONTRAST_CURVE.</p>
4230 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004231 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08004232 * These values are always available, and as close as possible to the
4233 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07004234 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08004235 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
4236 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004237 * <p><b>Possible values:</b>
4238 * <ul>
4239 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
4240 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
4241 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004242 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
4243 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004244 * </ul></p>
4245 * <p><b>Available values for this device:</b><br>
4246 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004247 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4248 * <p><b>Full capability</b> -
4249 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4250 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08004251 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004252 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08004253 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004254 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08004255 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004256 * @see #TONEMAP_MODE_CONTRAST_CURVE
4257 * @see #TONEMAP_MODE_FAST
4258 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004259 * @see #TONEMAP_MODE_GAMMA_VALUE
4260 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004261 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004262 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004263 public static final Key<Integer> TONEMAP_MODE =
4264 new Key<Integer>("android.tonemap.mode", int.class);
4265
4266 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004267 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4268 * GAMMA_VALUE</p>
4269 * <p>The tonemap curve will be defined the following formula:
4270 * * OUT = pow(IN, 1.0 / gamma)
4271 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
4272 * pow is the power function and gamma is the gamma value specified by this
4273 * key.</p>
4274 * <p>The same curve will be applied to all color channels. The camera device
4275 * may clip the input gamma value to its supported range. The actual applied
4276 * value will be returned in capture result.</p>
4277 * <p>The valid range of gamma value varies on different devices, but values
4278 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
4279 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4280 *
4281 * @see CaptureRequest#TONEMAP_MODE
4282 */
4283 @PublicKey
4284 public static final Key<Float> TONEMAP_GAMMA =
4285 new Key<Float>("android.tonemap.gamma", float.class);
4286
4287 /**
4288 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4289 * PRESET_CURVE</p>
4290 * <p>The tonemap curve will be defined by specified standard.</p>
4291 * <p>sRGB (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004292 * <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 -08004293 * <p>Rec. 709 (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004294 * <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 -08004295 * <p>Note that above figures show a 16 control points approximation of preset
4296 * curves. Camera devices may apply a different approximation to the curve.</p>
4297 * <p><b>Possible values:</b>
4298 * <ul>
4299 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
4300 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
4301 * </ul></p>
4302 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4303 *
4304 * @see CaptureRequest#TONEMAP_MODE
4305 * @see #TONEMAP_PRESET_CURVE_SRGB
4306 * @see #TONEMAP_PRESET_CURVE_REC709
4307 */
4308 @PublicKey
4309 public static final Key<Integer> TONEMAP_PRESET_CURVE =
4310 new Key<Integer>("android.tonemap.presetCurve", int.class);
4311
4312 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004313 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004314 * that the camera is powered on and may be streaming images back to the
4315 * Application Processor. In certain rare circumstances, the OS may
4316 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08004317 * any untrusted applications.</p>
4318 * <p>In particular, the LED <em>must</em> always be on when the data could be
4319 * transmitted off the device. The LED <em>should</em> always be on whenever
4320 * data is stored locally on the device.</p>
4321 * <p>The LED <em>may</em> be off if a trusted application is using the data that
4322 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004323 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004324 * @hide
4325 */
4326 public static final Key<Boolean> LED_TRANSMIT =
4327 new Key<Boolean>("android.led.transmit", boolean.class);
4328
4329 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004330 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08004331 * to its current values, or is free to vary.</p>
4332 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004333 * 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 -08004334 * a change in other capture settings forced the camera device to
4335 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004336 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4337 * <p><b>Full capability</b> -
4338 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4339 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004340 *
4341 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004342 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004343 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004344 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004345 public static final Key<Boolean> BLACK_LEVEL_LOCK =
4346 new Key<Boolean>("android.blackLevel.lock", boolean.class);
4347
Igor Murashkin3865a842014-01-17 18:18:39 -08004348 /**
4349 * <p>The frame number corresponding to the last request
4350 * with which the output result (metadata + buffers) has been fully
4351 * synchronized.</p>
4352 * <p>When a request is submitted to the camera device, there is usually a
4353 * delay of several frames before the controls get applied. A camera
4354 * device may either choose to account for this delay by implementing a
4355 * pipeline and carefully submit well-timed atomic control updates, or
4356 * it may start streaming control changes that span over several frame
4357 * boundaries.</p>
4358 * <p>In the latter case, whenever a request's settings change relative to
4359 * the previous submitted request, the full set of changes may take
4360 * multiple frame durations to fully take effect. Some settings may
4361 * take effect sooner (in less frame durations) than others.</p>
4362 * <p>While a set of control changes are being propagated, this value
4363 * will be CONVERGING.</p>
4364 * <p>Once it is fully known that a set of control changes have been
4365 * finished propagating, and the resulting updated control settings
4366 * have been read back by the camera device, this value will be set
4367 * to a non-negative frame number (corresponding to the request to
4368 * which the results have synchronized to).</p>
4369 * <p>Older camera device implementations may not have a way to detect
4370 * when all camera controls have been applied, and will always set this
4371 * value to UNKNOWN.</p>
4372 * <p>FULL capability devices will always have this value set to the
4373 * frame number of the request corresponding to this result.</p>
4374 * <p><em>Further details</em>:</p>
4375 * <ul>
4376 * <li>Whenever a request differs from the last request, any future
4377 * results not yet returned may have this value set to CONVERGING (this
4378 * could include any in-progress captures not yet returned by the camera
4379 * device, for more details see pipeline considerations below).</li>
4380 * <li>Submitting a series of multiple requests that differ from the
4381 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
4382 * moves the new synchronization frame to the last non-repeating
4383 * request (using the smallest frame number from the contiguous list of
4384 * repeating requests).</li>
4385 * <li>Submitting the same request repeatedly will not change this value
4386 * to CONVERGING, if it was already a non-negative value.</li>
4387 * <li>When this value changes to non-negative, that means that all of the
4388 * metadata controls from the request have been applied, all of the
4389 * metadata controls from the camera device have been read to the
4390 * updated values (into the result), and all of the graphics buffers
4391 * corresponding to this result are also synchronized to the request.</li>
4392 * </ul>
4393 * <p><em>Pipeline considerations</em>:</p>
4394 * <p>Submitting a request with updated controls relative to the previously
4395 * submitted requests may also invalidate the synchronization state
4396 * of all the results corresponding to currently in-flight requests.</p>
4397 * <p>In other words, results for this current request and up to
4398 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
4399 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004400 * <p><b>Possible values:</b>
4401 * <ul>
4402 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
4403 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
4404 * </ul></p>
4405 * <p><b>Available values for this device:</b><br>
4406 * Either a non-negative value corresponding to a
4407 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004408 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08004409 *
4410 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
4411 * @see #SYNC_FRAME_NUMBER_CONVERGING
4412 * @see #SYNC_FRAME_NUMBER_UNKNOWN
4413 * @hide
4414 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07004415 public static final Key<Long> SYNC_FRAME_NUMBER =
4416 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08004417
Zhijun He0e99c222015-01-29 15:26:05 -08004418 /**
4419 * <p>The amount of exposure time increase factor applied to the original output
4420 * frame by the application processing before sending for reprocessing.</p>
4421 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
4422 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
4423 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
4424 * output frames to effectively reduce the noise to the same level as a frame that was
4425 * captured with longer exposure time. To be more specific, assuming the original captured
4426 * images were captured with a sensitivity of S and an exposure time of T, the model in
4427 * the camera device is that the amount of noise in the image would be approximately what
4428 * would be expected if the original capture parameters had been a sensitivity of
4429 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
4430 * than S and T respectively. If the captured images were processed by the application
4431 * before being sent for reprocessing, then the application may have used image processing
4432 * algorithms and/or multi-frame image fusion to reduce the noise in the
4433 * application-processed images (input images). By using the effectiveExposureFactor
4434 * control, the application can communicate to the camera device the actual noise level
4435 * improvement in the application-processed image. With this information, the camera
4436 * device can select appropriate noise reduction and edge enhancement parameters to avoid
4437 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
4438 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
4439 * <p>For example, for multi-frame image fusion use case, the application may fuse
4440 * multiple output frames together to a final frame for reprocessing. When N image are
4441 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
4442 * square root of N (based on a simple photon shot noise model). The camera device will
4443 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
4444 * produce the best quality images.</p>
4445 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
4446 * buffer in a way that affects its effective exposure time.</p>
4447 * <p>This control is only effective for YUV reprocessing capture request. For noise
4448 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
4449 * Similarly, for edge enhancement reprocessing, it is only effective when
4450 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
4451 * <p><b>Units</b>: Relative exposure time increase factor.</p>
4452 * <p><b>Range of valid values:</b><br>
4453 * &gt;= 1.0</p>
4454 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07004455 * <p><b>Limited capability</b> -
4456 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4457 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0e99c222015-01-29 15:26:05 -08004458 *
4459 * @see CaptureRequest#EDGE_MODE
Zhijun He513f7c32015-04-24 18:23:54 -07004460 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08004461 * @see CaptureRequest#NOISE_REDUCTION_MODE
4462 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
4463 */
4464 @PublicKey
4465 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
4466 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
4467
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004468 /**
4469 * <p>Mode of operation for the lens distortion correction block.</p>
4470 * <p>The lens distortion correction block attempts to improve image quality by fixing
4471 * radial, tangential, or other geometric aberrations in the camera device's optics. If
4472 * available, the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} field documents the lens's distortion parameters.</p>
4473 * <p>OFF means no distortion correction is done.</p>
4474 * <p>FAST/HIGH_QUALITY both mean camera device determined distortion correction will be
4475 * applied. HIGH_QUALITY mode indicates that the camera device will use the highest-quality
4476 * correction algorithms, even if it slows down capture rate. FAST means the camera device
4477 * will not slow down capture rate when applying correction. FAST may be the same as OFF if
4478 * any correction at all would slow down capture rate. Every output stream will have a
4479 * similar amount of enhancement applied.</p>
4480 * <p>The correction only applies to processed outputs such as YUV, JPEG, or DEPTH16; it is not
4481 * applied to any RAW output. Metadata coordinates such as face rectangles or metering
4482 * regions are also not affected by correction.</p>
4483 * <p>Applications enabling distortion correction need to pay extra attention when converting
4484 * image coordinates between corrected output buffers and the sensor array. For example, if
4485 * the app supports tap-to-focus and enables correction, it then has to apply the distortion
4486 * model described in {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} to the image buffer tap coordinates to properly
4487 * calculate the tap position on the sensor active array to be used with
4488 * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}. The same applies in reverse to detected face rectangles if
4489 * they need to be drawn on top of the corrected output buffers.</p>
4490 * <p><b>Possible values:</b>
4491 * <ul>
4492 * <li>{@link #DISTORTION_CORRECTION_MODE_OFF OFF}</li>
4493 * <li>{@link #DISTORTION_CORRECTION_MODE_FAST FAST}</li>
4494 * <li>{@link #DISTORTION_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
4495 * </ul></p>
4496 * <p><b>Available values for this device:</b><br>
4497 * {@link CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES android.distortionCorrection.availableModes}</p>
4498 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4499 *
4500 * @see CaptureRequest#CONTROL_AF_REGIONS
4501 * @see CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES
4502 * @see CameraCharacteristics#LENS_DISTORTION
4503 * @see #DISTORTION_CORRECTION_MODE_OFF
4504 * @see #DISTORTION_CORRECTION_MODE_FAST
4505 * @see #DISTORTION_CORRECTION_MODE_HIGH_QUALITY
4506 */
4507 @PublicKey
4508 public static final Key<Integer> DISTORTION_CORRECTION_MODE =
4509 new Key<Integer>("android.distortionCorrection.mode", int.class);
4510
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004511 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
4512 * End generated code
4513 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07004514
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004515
4516
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08004517}