blob: e84e48f8fbcb2c62f0c5b88601d08d54e205c958 [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 */
Igor Murashkind6d65152014-05-19 16:31:02 -070090 public Key(String name, Class<T> type) {
91 mKey = new CameraMetadataNative.Key<T>(name, type);
92 }
93
94 /**
95 * Visible for testing and vendor extensions only.
96 *
97 * @hide
98 */
99 public Key(String name, TypeReference<T> typeReference) {
100 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
101 }
102
103 /**
104 * Return a camelCase, period separated name formatted like:
105 * {@code "root.section[.subsections].name"}.
106 *
107 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
108 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
109 *
110 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
111 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
112 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
113 *
114 * @return String representation of the key name
115 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700116 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700117 public String getName() {
118 return mKey.getName();
119 }
120
121 /**
Emilian Peevde62d842017-03-23 19:20:40 +0000122 * Return vendor tag id.
123 *
124 * @hide
125 */
126 public long getVendorId() {
127 return mKey.getVendorId();
128 }
129
130 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700131 * {@inheritDoc}
132 */
133 @Override
134 public final int hashCode() {
135 return mKey.hashCode();
136 }
137
138 /**
139 * {@inheritDoc}
140 */
141 @SuppressWarnings("unchecked")
142 @Override
143 public final boolean equals(Object o) {
144 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
145 }
146
147 /**
Chien-Yu Chen12a83852015-07-07 12:17:22 -0700148 * Return this {@link Key} as a string representation.
149 *
150 * <p>{@code "CaptureResult.Key(%s)"}, where {@code %s} represents
151 * the name of this key as returned by {@link #getName}.</p>
152 *
153 * @return string representation of {@link Key}
154 */
155 @NonNull
156 @Override
157 public String toString() {
158 return String.format("CaptureResult.Key(%s)", mKey.getName());
159 }
160
161 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700162 * Visible for CameraMetadataNative implementation only; do not use.
163 *
164 * TODO: Make this private or remove it altogether.
165 *
166 * @hide
167 */
168 public CameraMetadataNative.Key<T> getNativeKey() {
169 return mKey;
170 }
171
172 @SuppressWarnings({ "unchecked" })
173 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
174 mKey = (CameraMetadataNative.Key<T>) nativeKey;
175 }
176 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700177
178 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700179 private final CaptureRequest mRequest;
180 private final int mSequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700181 private final long mFrameNumber;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700182
Igor Murashkin70725502013-06-25 20:27:06 +0000183 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700184 * Takes ownership of the passed-in properties object
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700185 *
186 * <p>For internal use only</p>
Igor Murashkin70725502013-06-25 20:27:06 +0000187 * @hide
188 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700189 public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
190 CaptureResultExtras extras) {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700191 if (results == null) {
192 throw new IllegalArgumentException("results was null");
193 }
194
195 if (parent == null) {
196 throw new IllegalArgumentException("parent was null");
197 }
198
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700199 if (extras == null) {
200 throw new IllegalArgumentException("extras was null");
201 }
202
Igor Murashkind6d65152014-05-19 16:31:02 -0700203 mResults = CameraMetadataNative.move(results);
204 if (mResults.isEmpty()) {
205 throw new AssertionError("Results must not be empty");
206 }
Emilian Peevde62d842017-03-23 19:20:40 +0000207 setNativeInstance(mResults);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700208 mRequest = parent;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700209 mSequenceId = extras.getRequestId();
210 mFrameNumber = extras.getFrameNumber();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700211 }
212
Ruben Brunkf967a542014-04-28 16:31:11 -0700213 /**
214 * Returns a copy of the underlying {@link CameraMetadataNative}.
215 * @hide
216 */
217 public CameraMetadataNative getNativeCopy() {
218 return new CameraMetadataNative(mResults);
219 }
220
Igor Murashkind6d65152014-05-19 16:31:02 -0700221 /**
222 * Creates a request-less result.
223 *
224 * <p><strong>For testing only.</strong></p>
225 * @hide
226 */
227 public CaptureResult(CameraMetadataNative results, int sequenceId) {
228 if (results == null) {
229 throw new IllegalArgumentException("results was null");
230 }
231
232 mResults = CameraMetadataNative.move(results);
233 if (mResults.isEmpty()) {
234 throw new AssertionError("Results must not be empty");
235 }
236
Emilian Peevde62d842017-03-23 19:20:40 +0000237 setNativeInstance(mResults);
Igor Murashkind6d65152014-05-19 16:31:02 -0700238 mRequest = null;
239 mSequenceId = sequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700240 mFrameNumber = -1;
Igor Murashkind6d65152014-05-19 16:31:02 -0700241 }
242
243 /**
244 * Get a capture result field value.
245 *
246 * <p>The field definitions can be found in {@link CaptureResult}.</p>
247 *
248 * <p>Querying the value for the same key more than once will return a value
249 * which is equal to the previous queried value.</p>
250 *
251 * @throws IllegalArgumentException if the key was not valid
252 *
253 * @param key The result field to read.
254 * @return The value of that key, or {@code null} if the field is not set.
255 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700256 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700257 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700258 T value = mResults.get(key);
259 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
260 return value;
261 }
262
263 /**
264 * {@inheritDoc}
265 * @hide
266 */
267 @SuppressWarnings("unchecked")
268 @Override
269 protected <T> T getProtected(Key<?> key) {
270 return (T) mResults.get(key);
271 }
272
273 /**
274 * {@inheritDoc}
275 * @hide
276 */
277 @SuppressWarnings("unchecked")
278 @Override
279 protected Class<Key<?>> getKeyClass() {
280 Object thisClass = Key.class;
281 return (Class<Key<?>>)thisClass;
282 }
283
284 /**
285 * Dumps the native metadata contents to logcat.
286 *
287 * <p>Visibility for testing/debugging only. The results will not
288 * include any synthesized keys, as they are invisible to the native layer.</p>
289 *
290 * @hide
291 */
292 public void dumpToLog() {
293 mResults.dumpToLog();
294 }
295
296 /**
297 * {@inheritDoc}
298 */
299 @Override
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700300 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700301 public List<Key<?>> getKeys() {
302 // Force the javadoc for this function to show up on the CaptureResult page
303 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800304 }
305
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700306 /**
307 * Get the request associated with this result.
308 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700309 * <p>Whenever a request has been fully or partially captured, with
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700310 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or
311 * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s
Igor Murashkindb075af2014-05-21 10:07:08 -0700312 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700313 * </p>
314 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700315 * <p>For example,
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700316 * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700317 * {@literal @}Override
318 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
319 * assert(myResult.getRequest.equals(myRequest) == true);
320 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700321 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700322 * </code></pre>
323 * </p>
324 *
325 * @return The request associated with this result. Never {@code null}.
326 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700327 @NonNull
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700328 public CaptureRequest getRequest() {
329 return mRequest;
330 }
331
332 /**
333 * Get the frame number associated with this result.
334 *
335 * <p>Whenever a request has been processed, regardless of failure or success,
336 * it gets a unique frame number assigned to its future result/failure.</p>
337 *
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700338 * <p>For the same type of request (capturing from the camera device or reprocessing), this
339 * value monotonically increments, starting with 0, for every new result or failure and the
340 * scope is the lifetime of the {@link CameraDevice}. Between different types of requests,
341 * the frame number may not monotonically increment. For example, the frame number of a newer
342 * reprocess result may be smaller than the frame number of an older result of capturing new
343 * images from the camera device, but the frame number of a newer reprocess result will never be
344 * smaller than the frame number of an older reprocess result.</p>
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700345 *
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700346 * @return The frame number
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700347 *
348 * @see CameraDevice#createCaptureRequest
349 * @see CameraDevice#createReprocessCaptureRequest
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700350 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700351 public long getFrameNumber() {
352 return mFrameNumber;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700353 }
354
355 /**
356 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700357 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700358 *
359 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
360 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
361 *
362 * @return int The ID for the sequence of requests that this capture result is a part of
363 *
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700364 * @see CameraDevice.CaptureCallback#onCaptureSequenceCompleted
365 * @see CameraDevice.CaptureCallback#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700366 */
367 public int getSequenceId() {
368 return mSequenceId;
369 }
370
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700371 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
372 * The key entries below this point are generated from metadata
373 * definitions in /system/media/camera/docs. Do not modify by hand or
374 * modify the comment blocks at the start or end.
375 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
376
377 /**
Zhijun He379af012014-05-06 11:54:54 -0700378 * <p>The mode control selects how the image data is converted from the
379 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700380 * <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 -0700381 * control is overridden by the AWB routine. When AWB is disabled, the
382 * application controls how the color mapping is performed.</p>
383 * <p>We define the expected processing pipeline below. For consistency
384 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
385 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
386 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
387 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
388 * camera device (in the results) and be roughly correct.</p>
389 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
390 * FAST or HIGH_QUALITY will yield a picture with the same white point
391 * as what was produced by the camera device in the earlier frame.</p>
392 * <p>The expected processing pipeline is as follows:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -0800393 * <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 -0700394 * <p>The white balance is encoded by two values, a 4-channel white-balance
395 * gain vector (applied in the Bayer domain), and a 3x3 color transform
396 * matrix (applied after demosaic).</p>
397 * <p>The 4-channel white-balance gains are defined as:</p>
398 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
399 * </code></pre>
400 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
401 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
402 * These may be identical for a given camera device implementation; if
403 * the camera device does not support a separate gain for even/odd green
404 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
405 * <code>G_even</code> in the output result metadata.</p>
406 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
407 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
408 * </code></pre>
409 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
410 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
411 * <p>with colors as follows:</p>
412 * <pre><code>r' = I0r + I1g + I2b
413 * g' = I3r + I4g + I5b
414 * b' = I6r + I7g + I8b
415 * </code></pre>
416 * <p>Both the input and output value ranges must match. Overflow/underflow
417 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700418 * <p><b>Possible values:</b>
419 * <ul>
420 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
421 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
422 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
423 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700424 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
425 * <p><b>Full capability</b> -
426 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
427 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700428 *
429 * @see CaptureRequest#COLOR_CORRECTION_GAINS
430 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
431 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700432 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700433 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
434 * @see #COLOR_CORRECTION_MODE_FAST
435 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
436 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700437 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700438 public static final Key<Integer> COLOR_CORRECTION_MODE =
439 new Key<Integer>("android.colorCorrection.mode", int.class);
440
441 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800442 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700443 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800444 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800445 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700446 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800447 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800448 * <p>In the latter case, the camera device may round the matrix to account
449 * for precision issues; the final rounded matrix should be reported back
450 * in this matrix result metadata. The transform should keep the magnitude
451 * of the output color values within <code>[0, 1.0]</code> (assuming input color
452 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800453 * <p>The valid range of each matrix element varies on different devices, but
454 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700455 * <p><b>Units</b>: Unitless scale factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700456 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
457 * <p><b>Full capability</b> -
458 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
459 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800460 *
461 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700462 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700463 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700464 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700465 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
466 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700467
468 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800469 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800470 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700471 * <p>These per-channel gains are either set by the camera device
472 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
473 * TRANSFORM_MATRIX, or directly by the application in the
474 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
475 * TRANSFORM_MATRIX.</p>
476 * <p>The gains in the result metadata are the gains actually
477 * applied by the camera device to the current frame.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800478 * <p>The valid range of gains varies on different devices, but gains
479 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
480 * device allows gains below 1.0, this is usually not recommended because
481 * this can create color artifacts.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700482 * <p><b>Units</b>: Unitless gain factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700483 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
484 * <p><b>Full capability</b> -
485 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
486 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800487 *
488 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700489 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700490 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700491 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700492 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
493 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700494
495 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700496 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700497 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
498 * can not focus on the same point after exiting from the lens. This metadata defines
499 * the high level control of chromatic aberration correction algorithm, which aims to
500 * minimize the chromatic artifacts that may occur along the object boundaries in an
501 * image.</p>
502 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
503 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
504 * use the highest-quality aberration correction algorithms, even if it slows down
505 * capture rate. FAST means the camera device will not slow down capture rate when
506 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700507 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700508 * <p><b>Possible values:</b>
509 * <ul>
510 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
511 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
512 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
513 * </ul></p>
514 * <p><b>Available values for this device:</b><br>
515 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700516 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700517 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700518 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
519 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
520 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
521 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700522 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700523 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700524 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
525 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700526
527 /**
Zhijun He379af012014-05-06 11:54:54 -0700528 * <p>The desired setting for the camera device's auto-exposure
529 * algorithm's antibanding compensation.</p>
530 * <p>Some kinds of lighting fixtures, such as some fluorescent
531 * lights, flicker at the rate of the power supply frequency
532 * (60Hz or 50Hz, depending on country). While this is
533 * typically not noticeable to a person, it can be visible to
534 * a camera device. If a camera sets its exposure time to the
535 * wrong value, the flicker may become visible in the
536 * viewfinder as flicker or in a final captured image, as a
537 * set of variable-brightness bands across the image.</p>
538 * <p>Therefore, the auto-exposure routines of camera devices
539 * include antibanding routines that ensure that the chosen
540 * exposure value will not cause such banding. The choice of
541 * exposure time depends on the rate of flicker, which the
542 * camera device can detect automatically, or the expected
543 * rate can be selected by the application using this
544 * control.</p>
545 * <p>A given camera device may not support all of the possible
546 * options for the antibanding mode. The
547 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
548 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800549 * <p>AUTO mode is the default if it is available on given
550 * camera device. When AUTO mode is not available, the
551 * default will be either 50HZ or 60HZ, and both 50HZ
552 * and 60HZ will be available.</p>
Zhijun He379af012014-05-06 11:54:54 -0700553 * <p>If manual exposure control is enabled (by setting
554 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
555 * then this setting has no effect, and the application must
556 * ensure it selects exposure times that do not cause banding
557 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
558 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700559 * <p><b>Possible values:</b>
560 * <ul>
561 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
562 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
563 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
564 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
565 * </ul></p>
566 * <p><b>Available values for this device:</b><br></p>
567 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700568 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700569 *
570 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
571 * @see CaptureRequest#CONTROL_AE_MODE
572 * @see CaptureRequest#CONTROL_MODE
573 * @see CaptureResult#STATISTICS_SCENE_FLICKER
574 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
575 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
576 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
577 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
578 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700579 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700580 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
581 new Key<Integer>("android.control.aeAntibandingMode", int.class);
582
583 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700584 * <p>Adjustment to auto-exposure (AE) target image
585 * brightness.</p>
586 * <p>The adjustment is measured as a count of steps, with the
587 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
588 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
589 * <p>For example, if the exposure value (EV) step is 0.333, '6'
590 * will mean an exposure compensation of +2 EV; -3 will mean an
591 * exposure compensation of -1 EV. One EV represents a doubling
592 * of image brightness. Note that this control will only be
593 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
594 * 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 -0700595 * <p>In the event of exposure compensation value being changed, camera device
596 * may take several frames to reach the newly requested exposure target.
597 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
598 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
599 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
600 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700601 * <p><b>Units</b>: Compensation steps</p>
602 * <p><b>Range of valid values:</b><br>
603 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700604 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700605 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700606 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
607 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700608 * @see CaptureRequest#CONTROL_AE_LOCK
609 * @see CaptureRequest#CONTROL_AE_MODE
610 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700611 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700612 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700613 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
614 new Key<Integer>("android.control.aeExposureCompensation", int.class);
615
616 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700617 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700618 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700619 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
620 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
621 * <p>Note that even when AE is locked, the flash may be fired if
622 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
623 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700624 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
625 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700626 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
627 * when AE is already locked, the camera device will not change the exposure time
628 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
629 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
630 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
Zhijun Hefa95b042015-02-09 10:40:49 -0800631 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
632 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
633 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
634 * the AE if AE is locked by the camera device internally during precapture metering
635 * sequence In other words, submitting requests with AE unlock has no effect for an
636 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
637 * will never succeed in a sequence of preview requests where AE lock is always set
638 * to <code>false</code>.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700639 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
640 * get locked do not necessarily correspond to the settings that were present in the
641 * latest capture result received from the camera device, since additional captures
642 * and AE updates may have occurred even before the result was sent out. If an
643 * application is switching between automatic and manual control and wishes to eliminate
644 * any flicker during the switch, the following procedure is recommended:</p>
645 * <ol>
646 * <li>Starting in auto-AE mode:</li>
647 * <li>Lock AE</li>
648 * <li>Wait for the first result to be output that has the AE locked</li>
649 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
650 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
651 * </ol>
Zhijun He379af012014-05-06 11:54:54 -0700652 * <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 -0700653 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700654 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700655 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700656 * @see CaptureRequest#CONTROL_AE_MODE
657 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
658 * @see CaptureResult#CONTROL_AE_STATE
659 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
660 * @see CaptureRequest#SENSOR_SENSITIVITY
661 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700662 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700663 public static final Key<Boolean> CONTROL_AE_LOCK =
664 new Key<Boolean>("android.control.aeLock", boolean.class);
665
666 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800667 * <p>The desired mode for the camera device's
668 * auto-exposure routine.</p>
669 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
670 * AUTO.</p>
671 * <p>When set to any of the ON modes, the camera device's
672 * auto-exposure routine is enabled, overriding the
673 * application's selected exposure time, sensor sensitivity,
674 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
675 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
676 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
677 * is selected, the camera device's flash unit controls are
678 * also overridden.</p>
679 * <p>The FLASH modes are only available if the camera device
680 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
681 * <p>If flash TORCH mode is desired, this field must be set to
682 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
683 * <p>When set to any of the ON modes, the values chosen by the
684 * camera device auto-exposure routine for the overridden
685 * fields for a given capture will be available in its
686 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700687 * <p><b>Possible values:</b>
688 * <ul>
689 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
690 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
691 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
692 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
693 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800694 * <li>{@link #CONTROL_AE_MODE_ON_EXTERNAL_FLASH ON_EXTERNAL_FLASH}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700695 * </ul></p>
696 * <p><b>Available values for this device:</b><br>
697 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700698 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800699 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700700 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -0800701 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800702 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
703 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800704 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
705 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800706 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800707 * @see #CONTROL_AE_MODE_OFF
708 * @see #CONTROL_AE_MODE_ON
709 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
710 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
711 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800712 * @see #CONTROL_AE_MODE_ON_EXTERNAL_FLASH
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800713 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700714 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800715 public static final Key<Integer> CONTROL_AE_MODE =
716 new Key<Integer>("android.control.aeMode", int.class);
717
718 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700719 * <p>List of metering areas to use for auto-exposure adjustment.</p>
720 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700721 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700722 * <p>The maximum number of regions supported by the device is determined by the value
723 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800724 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700725 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800726 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
727 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700728 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700729 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700730 * for every pixel in the area. This means that a large metering area
731 * with the same weight as a smaller area will have more effect in
732 * the metering result. Metering areas can partially overlap and the
733 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700734 * <p>The weights are relative to weights of other exposure metering regions, so if only one
735 * region is used, all non-zero weights will have the same effect. A region with 0
736 * weight is ignored.</p>
737 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
738 * camera device.</p>
739 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
740 * capture result metadata, the camera device will ignore the sections outside the crop
741 * region and output only the intersection rectangle as the metering region in the result
742 * metadata. If the region is entirely outside the crop region, it will be ignored and
743 * not reported in the result metadata.</p>
744 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
745 * <p><b>Range of valid values:</b><br>
746 * Coordinates must be between <code>[(0,0), (width, height))</code> of
747 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700748 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800749 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700750 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800751 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800752 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700753 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700754 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700755 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
756 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700757
758 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700759 * <p>Range over which the auto-exposure routine can
760 * adjust the capture frame rate to maintain good
761 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700762 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700763 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
764 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
765 * <p><b>Units</b>: Frames per second (FPS)</p>
766 * <p><b>Range of valid values:</b><br>
767 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
768 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700769 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700770 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Zhijun He379af012014-05-06 11:54:54 -0700771 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700772 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He379af012014-05-06 11:54:54 -0700773 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700774 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700775 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
776 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700777
778 /**
779 * <p>Whether the camera device will trigger a precapture
780 * metering sequence when it processes this request.</p>
781 * <p>This entry is normally set to IDLE, or is not
782 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -0800783 * set to START, the camera device will trigger the auto-exposure (AE)
Zhijun He379af012014-05-06 11:54:54 -0700784 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -0800785 * <p>When set to CANCEL, the camera device will cancel any active
786 * precapture metering trigger, and return to its initial AE state.
787 * If a precapture metering sequence is already completed, and the camera
788 * device has implicitly locked the AE for subsequent still capture, the
789 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800790 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700791 * high-quality still capture for final metering decisions to
792 * be made, and for firing pre-capture flash pulses to estimate
793 * scene brightness and required final capture flash power, when
794 * the flash is enabled.</p>
795 * <p>Normally, this entry should be set to START for only a
796 * single request, and the application should wait until the
797 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800798 * <p>When a precapture metering sequence is finished, the camera device
799 * may lock the auto-exposure routine internally to be able to accurately expose the
800 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
801 * For this case, the AE may not resume normal scan if no subsequent still capture is
802 * submitted. To ensure that the AE routine restarts normal scan, the application should
803 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
804 * 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 -0800805 * still capture request after the precapture sequence completes. Alternatively, for
806 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
807 * internally locked AE if the application doesn't submit a still capture request after
808 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
809 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700810 * <p>The exact effect of auto-exposure (AE) precapture trigger
811 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700812 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
813 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700814 * <p>On LEGACY-level devices, the precapture trigger is not supported;
815 * capturing a high-resolution JPEG image will automatically trigger a
816 * precapture sequence before the high-resolution capture, including
817 * potentially firing a pre-capture flash.</p>
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -0700818 * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
819 * simultaneously is allowed. However, since these triggers often require cooperation between
820 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
821 * focus sweep), the camera device may delay acting on a later trigger until the previous
822 * trigger has been fully handled. This may lead to longer intervals between the trigger and
823 * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for
824 * example.</p>
825 * <p>If both the precapture and the auto-focus trigger are activated on the same request, then
826 * the camera device will complete them in the optimal order for that device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700827 * <p><b>Possible values:</b>
828 * <ul>
829 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
830 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -0800831 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700832 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700833 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
834 * <p><b>Limited capability</b> -
835 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
836 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700837 *
Zhijun Hedd72be52015-02-06 13:49:51 -0800838 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He379af012014-05-06 11:54:54 -0700839 * @see CaptureResult#CONTROL_AE_STATE
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -0700840 * @see CaptureRequest#CONTROL_AF_TRIGGER
Zhijun Hedd72be52015-02-06 13:49:51 -0800841 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700842 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700843 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
844 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -0800845 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Zhijun He379af012014-05-06 11:54:54 -0700846 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700847 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700848 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
849 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
850
851 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700852 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800853 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
854 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
855 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
856 * the algorithm states to INACTIVE.</p>
857 * <p>The camera device can do several state transitions between two results, if it is
858 * allowed by the state transition table. For example: INACTIVE may never actually be
859 * seen in a result.</p>
860 * <p>The state in the result is the state for this image (in sync with this image): if
861 * AE state becomes CONVERGED, then the image data associated with this result should
862 * be good to use.</p>
863 * <p>Below are state transition tables for different AE modes.</p>
864 * <table>
865 * <thead>
866 * <tr>
867 * <th align="center">State</th>
868 * <th align="center">Transition Cause</th>
869 * <th align="center">New State</th>
870 * <th align="center">Notes</th>
871 * </tr>
872 * </thead>
873 * <tbody>
874 * <tr>
875 * <td align="center">INACTIVE</td>
876 * <td align="center"></td>
877 * <td align="center">INACTIVE</td>
878 * <td align="center">Camera device auto exposure algorithm is disabled</td>
879 * </tr>
880 * </tbody>
881 * </table>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -0800882 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON*:</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800883 * <table>
884 * <thead>
885 * <tr>
886 * <th align="center">State</th>
887 * <th align="center">Transition Cause</th>
888 * <th align="center">New State</th>
889 * <th align="center">Notes</th>
890 * </tr>
891 * </thead>
892 * <tbody>
893 * <tr>
894 * <td align="center">INACTIVE</td>
895 * <td align="center">Camera device initiates AE scan</td>
896 * <td align="center">SEARCHING</td>
897 * <td align="center">Values changing</td>
898 * </tr>
899 * <tr>
900 * <td align="center">INACTIVE</td>
901 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
902 * <td align="center">LOCKED</td>
903 * <td align="center">Values locked</td>
904 * </tr>
905 * <tr>
906 * <td align="center">SEARCHING</td>
907 * <td align="center">Camera device finishes AE scan</td>
908 * <td align="center">CONVERGED</td>
909 * <td align="center">Good values, not changing</td>
910 * </tr>
911 * <tr>
912 * <td align="center">SEARCHING</td>
913 * <td align="center">Camera device finishes AE scan</td>
914 * <td align="center">FLASH_REQUIRED</td>
915 * <td align="center">Converged but too dark w/o flash</td>
916 * </tr>
917 * <tr>
918 * <td align="center">SEARCHING</td>
919 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
920 * <td align="center">LOCKED</td>
921 * <td align="center">Values locked</td>
922 * </tr>
923 * <tr>
924 * <td align="center">CONVERGED</td>
925 * <td align="center">Camera device initiates AE scan</td>
926 * <td align="center">SEARCHING</td>
927 * <td align="center">Values changing</td>
928 * </tr>
929 * <tr>
930 * <td align="center">CONVERGED</td>
931 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
932 * <td align="center">LOCKED</td>
933 * <td align="center">Values locked</td>
934 * </tr>
935 * <tr>
936 * <td align="center">FLASH_REQUIRED</td>
937 * <td align="center">Camera device initiates AE scan</td>
938 * <td align="center">SEARCHING</td>
939 * <td align="center">Values changing</td>
940 * </tr>
941 * <tr>
942 * <td align="center">FLASH_REQUIRED</td>
943 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
944 * <td align="center">LOCKED</td>
945 * <td align="center">Values locked</td>
946 * </tr>
947 * <tr>
948 * <td align="center">LOCKED</td>
949 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
950 * <td align="center">SEARCHING</td>
951 * <td align="center">Values not good after unlock</td>
952 * </tr>
953 * <tr>
954 * <td align="center">LOCKED</td>
955 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
956 * <td align="center">CONVERGED</td>
957 * <td align="center">Values good after unlock</td>
958 * </tr>
959 * <tr>
960 * <td align="center">LOCKED</td>
961 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
962 * <td align="center">FLASH_REQUIRED</td>
963 * <td align="center">Exposure good, but too dark</td>
964 * </tr>
965 * <tr>
966 * <td align="center">PRECAPTURE</td>
967 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
968 * <td align="center">CONVERGED</td>
969 * <td align="center">Ready for high-quality capture</td>
970 * </tr>
971 * <tr>
972 * <td align="center">PRECAPTURE</td>
973 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
974 * <td align="center">LOCKED</td>
975 * <td align="center">Ready for high-quality capture</td>
976 * </tr>
977 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800978 * <td align="center">LOCKED</td>
979 * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td>
980 * <td align="center">LOCKED</td>
981 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
982 * </tr>
983 * <tr>
984 * <td align="center">LOCKED</td>
985 * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</td>
986 * <td align="center">LOCKED</td>
987 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
988 * </tr>
989 * <tr>
990 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He228f4f92014-01-16 17:22:05 -0800991 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
992 * <td align="center">PRECAPTURE</td>
993 * <td align="center">Start AE precapture metering sequence</td>
994 * </tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800995 * <tr>
996 * <td align="center">Any state (excluding LOCKED)</td>
997 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td>
998 * <td align="center">INACTIVE</td>
999 * <td align="center">Currently active precapture metering sequence is canceled</td>
1000 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001001 * </tbody>
1002 * </table>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001003 * <p>If the camera device supports AE external flash mode (ON_EXTERNAL_FLASH is included in
Chien-Yu Chenc9ca7222018-03-15 11:14:29 -07001004 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}), {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} must be FLASH_REQUIRED after
1005 * the camera device finishes AE scan and it's too dark without flash.</p>
Zhijun He60b19dc2014-02-24 10:19:20 -08001006 * <p>For the above table, the camera device may skip reporting any state changes that happen
1007 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1008 * can be skipped in that manner is called a transient state.</p>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001009 * <p>For example, for above AE modes (AE_MODE_ON*), in addition to the state transitions
Zhijun He60b19dc2014-02-24 10:19:20 -08001010 * listed in above table, it is also legal for the camera device to skip one or more
1011 * transient states between two results. See below table for examples:</p>
1012 * <table>
1013 * <thead>
1014 * <tr>
1015 * <th align="center">State</th>
1016 * <th align="center">Transition Cause</th>
1017 * <th align="center">New State</th>
1018 * <th align="center">Notes</th>
1019 * </tr>
1020 * </thead>
1021 * <tbody>
1022 * <tr>
1023 * <td align="center">INACTIVE</td>
1024 * <td align="center">Camera device finished AE scan</td>
1025 * <td align="center">CONVERGED</td>
1026 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1027 * </tr>
1028 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001029 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001030 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
1031 * <td align="center">FLASH_REQUIRED</td>
1032 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
1033 * </tr>
1034 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001035 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001036 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
1037 * <td align="center">CONVERGED</td>
1038 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
1039 * </tr>
1040 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -08001041 * <td align="center">Any state (excluding LOCKED)</td>
1042 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1043 * <td align="center">FLASH_REQUIRED</td>
1044 * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td>
1045 * </tr>
1046 * <tr>
1047 * <td align="center">Any state (excluding LOCKED)</td>
1048 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1049 * <td align="center">CONVERGED</td>
1050 * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td>
1051 * </tr>
1052 * <tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001053 * <td align="center">CONVERGED</td>
1054 * <td align="center">Camera device finished AE scan</td>
1055 * <td align="center">FLASH_REQUIRED</td>
1056 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
1057 * </tr>
1058 * <tr>
1059 * <td align="center">FLASH_REQUIRED</td>
1060 * <td align="center">Camera device finished AE scan</td>
1061 * <td align="center">CONVERGED</td>
1062 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
1063 * </tr>
1064 * </tbody>
1065 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001066 * <p><b>Possible values:</b>
1067 * <ul>
1068 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
1069 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
1070 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
1071 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
1072 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
1073 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
1074 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001075 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1076 * <p><b>Limited capability</b> -
1077 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1078 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001079 *
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001080 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He228f4f92014-01-16 17:22:05 -08001081 * @see CaptureRequest#CONTROL_AE_LOCK
1082 * @see CaptureRequest#CONTROL_AE_MODE
1083 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Chien-Yu Chenc9ca7222018-03-15 11:14:29 -07001084 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He228f4f92014-01-16 17:22:05 -08001085 * @see CaptureRequest#CONTROL_MODE
1086 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001087 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001088 * @see #CONTROL_AE_STATE_INACTIVE
1089 * @see #CONTROL_AE_STATE_SEARCHING
1090 * @see #CONTROL_AE_STATE_CONVERGED
1091 * @see #CONTROL_AE_STATE_LOCKED
1092 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
1093 * @see #CONTROL_AE_STATE_PRECAPTURE
1094 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001095 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001096 public static final Key<Integer> CONTROL_AE_STATE =
1097 new Key<Integer>("android.control.aeState", int.class);
1098
1099 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001100 * <p>Whether auto-focus (AF) is currently enabled, and what
1101 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001102 * <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 -08001103 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1104 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1105 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1106 * 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 -08001107 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001108 * 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 -07001109 * in result metadata.</p>
1110 * <p><b>Possible values:</b>
1111 * <ul>
1112 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1113 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1114 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1115 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1116 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1117 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1118 * </ul></p>
1119 * <p><b>Available values for this device:</b><br>
1120 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1121 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001122 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001123 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001124 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001125 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001126 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001127 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001128 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001129 * @see #CONTROL_AF_MODE_OFF
1130 * @see #CONTROL_AF_MODE_AUTO
1131 * @see #CONTROL_AF_MODE_MACRO
1132 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1133 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1134 * @see #CONTROL_AF_MODE_EDOF
1135 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001136 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001137 public static final Key<Integer> CONTROL_AF_MODE =
1138 new Key<Integer>("android.control.afMode", int.class);
1139
1140 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001141 * <p>List of metering areas to use for auto-focus.</p>
1142 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001143 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001144 * <p>The maximum number of focus areas supported by the device is determined by the value
1145 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001146 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001147 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001148 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1149 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001150 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001151 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001152 * for every pixel in the area. This means that a large metering area
1153 * with the same weight as a smaller area will have more effect in
1154 * the metering result. Metering areas can partially overlap and the
1155 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001156 * <p>The weights are relative to weights of other metering regions, so if only one region
1157 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1158 * ignored.</p>
1159 * <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 -08001160 * camera device. The capture result will either be a zero weight region as well, or
1161 * the region selected by the camera device as the focus area of interest.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001162 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1163 * capture result metadata, the camera device will ignore the sections outside the crop
1164 * region and output only the intersection rectangle as the metering region in the result
1165 * metadata. If the region is entirely outside the crop region, it will be ignored and
1166 * not reported in the result metadata.</p>
1167 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1168 * <p><b>Range of valid values:</b><br>
1169 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1170 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001171 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001172 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001173 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001174 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001175 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001176 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001177 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001178 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1179 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001180
1181 /**
Zhijun He379af012014-05-06 11:54:54 -07001182 * <p>Whether the camera device will trigger autofocus for this request.</p>
1183 * <p>This entry is normally set to IDLE, or is not
1184 * included at all in the request settings.</p>
1185 * <p>When included and set to START, the camera device will trigger the
1186 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1187 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1188 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001189 * <p>Generally, applications should set this entry to START or CANCEL for only a
1190 * single capture, and then return it to IDLE (or not set at all). Specifying
1191 * START for multiple captures in a row means restarting the AF operation over
1192 * and over again.</p>
1193 * <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 -07001194 * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
1195 * simultaneously is allowed. However, since these triggers often require cooperation between
1196 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1197 * focus sweep), the camera device may delay acting on a later trigger until the previous
1198 * trigger has been fully handled. This may lead to longer intervals between the trigger and
1199 * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001200 * <p><b>Possible values:</b>
1201 * <ul>
1202 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1203 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1204 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1205 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001206 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001207 *
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001208 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Zhijun He379af012014-05-06 11:54:54 -07001209 * @see CaptureResult#CONTROL_AF_STATE
1210 * @see #CONTROL_AF_TRIGGER_IDLE
1211 * @see #CONTROL_AF_TRIGGER_START
1212 * @see #CONTROL_AF_TRIGGER_CANCEL
1213 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001214 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001215 public static final Key<Integer> CONTROL_AF_TRIGGER =
1216 new Key<Integer>("android.control.afTrigger", int.class);
1217
1218 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001219 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001220 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1221 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1222 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1223 * the algorithm states to INACTIVE.</p>
1224 * <p>The camera device can do several state transitions between two results, if it is
1225 * allowed by the state transition table. For example: INACTIVE may never actually be
1226 * seen in a result.</p>
1227 * <p>The state in the result is the state for this image (in sync with this image): if
1228 * AF state becomes FOCUSED, then the image data associated with this result should
1229 * be sharp.</p>
1230 * <p>Below are state transition tables for different AF modes.</p>
1231 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1232 * <table>
1233 * <thead>
1234 * <tr>
1235 * <th align="center">State</th>
1236 * <th align="center">Transition Cause</th>
1237 * <th align="center">New State</th>
1238 * <th align="center">Notes</th>
1239 * </tr>
1240 * </thead>
1241 * <tbody>
1242 * <tr>
1243 * <td align="center">INACTIVE</td>
1244 * <td align="center"></td>
1245 * <td align="center">INACTIVE</td>
1246 * <td align="center">Never changes</td>
1247 * </tr>
1248 * </tbody>
1249 * </table>
1250 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1251 * <table>
1252 * <thead>
1253 * <tr>
1254 * <th align="center">State</th>
1255 * <th align="center">Transition Cause</th>
1256 * <th align="center">New State</th>
1257 * <th align="center">Notes</th>
1258 * </tr>
1259 * </thead>
1260 * <tbody>
1261 * <tr>
1262 * <td align="center">INACTIVE</td>
1263 * <td align="center">AF_TRIGGER</td>
1264 * <td align="center">ACTIVE_SCAN</td>
1265 * <td align="center">Start AF sweep, Lens now moving</td>
1266 * </tr>
1267 * <tr>
1268 * <td align="center">ACTIVE_SCAN</td>
1269 * <td align="center">AF sweep done</td>
1270 * <td align="center">FOCUSED_LOCKED</td>
1271 * <td align="center">Focused, Lens now locked</td>
1272 * </tr>
1273 * <tr>
1274 * <td align="center">ACTIVE_SCAN</td>
1275 * <td align="center">AF sweep done</td>
1276 * <td align="center">NOT_FOCUSED_LOCKED</td>
1277 * <td align="center">Not focused, Lens now locked</td>
1278 * </tr>
1279 * <tr>
1280 * <td align="center">ACTIVE_SCAN</td>
1281 * <td align="center">AF_CANCEL</td>
1282 * <td align="center">INACTIVE</td>
1283 * <td align="center">Cancel/reset AF, Lens now locked</td>
1284 * </tr>
1285 * <tr>
1286 * <td align="center">FOCUSED_LOCKED</td>
1287 * <td align="center">AF_CANCEL</td>
1288 * <td align="center">INACTIVE</td>
1289 * <td align="center">Cancel/reset AF</td>
1290 * </tr>
1291 * <tr>
1292 * <td align="center">FOCUSED_LOCKED</td>
1293 * <td align="center">AF_TRIGGER</td>
1294 * <td align="center">ACTIVE_SCAN</td>
1295 * <td align="center">Start new sweep, Lens now moving</td>
1296 * </tr>
1297 * <tr>
1298 * <td align="center">NOT_FOCUSED_LOCKED</td>
1299 * <td align="center">AF_CANCEL</td>
1300 * <td align="center">INACTIVE</td>
1301 * <td align="center">Cancel/reset AF</td>
1302 * </tr>
1303 * <tr>
1304 * <td align="center">NOT_FOCUSED_LOCKED</td>
1305 * <td align="center">AF_TRIGGER</td>
1306 * <td align="center">ACTIVE_SCAN</td>
1307 * <td align="center">Start new sweep, Lens now moving</td>
1308 * </tr>
1309 * <tr>
1310 * <td align="center">Any state</td>
1311 * <td align="center">Mode change</td>
1312 * <td align="center">INACTIVE</td>
1313 * <td align="center"></td>
1314 * </tr>
1315 * </tbody>
1316 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001317 * <p>For the above table, the camera device may skip reporting any state changes that happen
1318 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1319 * can be skipped in that manner is called a transient state.</p>
1320 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1321 * state transitions listed in above table, it is also legal for the camera device to skip
1322 * one or more transient states between two results. See below table for examples:</p>
1323 * <table>
1324 * <thead>
1325 * <tr>
1326 * <th align="center">State</th>
1327 * <th align="center">Transition Cause</th>
1328 * <th align="center">New State</th>
1329 * <th align="center">Notes</th>
1330 * </tr>
1331 * </thead>
1332 * <tbody>
1333 * <tr>
1334 * <td align="center">INACTIVE</td>
1335 * <td align="center">AF_TRIGGER</td>
1336 * <td align="center">FOCUSED_LOCKED</td>
1337 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1338 * </tr>
1339 * <tr>
1340 * <td align="center">INACTIVE</td>
1341 * <td align="center">AF_TRIGGER</td>
1342 * <td align="center">NOT_FOCUSED_LOCKED</td>
1343 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1344 * </tr>
1345 * <tr>
1346 * <td align="center">FOCUSED_LOCKED</td>
1347 * <td align="center">AF_TRIGGER</td>
1348 * <td align="center">FOCUSED_LOCKED</td>
1349 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1350 * </tr>
1351 * <tr>
1352 * <td align="center">NOT_FOCUSED_LOCKED</td>
1353 * <td align="center">AF_TRIGGER</td>
1354 * <td align="center">FOCUSED_LOCKED</td>
1355 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1356 * </tr>
1357 * </tbody>
1358 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001359 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1360 * <table>
1361 * <thead>
1362 * <tr>
1363 * <th align="center">State</th>
1364 * <th align="center">Transition Cause</th>
1365 * <th align="center">New State</th>
1366 * <th align="center">Notes</th>
1367 * </tr>
1368 * </thead>
1369 * <tbody>
1370 * <tr>
1371 * <td align="center">INACTIVE</td>
1372 * <td align="center">Camera device initiates new scan</td>
1373 * <td align="center">PASSIVE_SCAN</td>
1374 * <td align="center">Start AF scan, Lens now moving</td>
1375 * </tr>
1376 * <tr>
1377 * <td align="center">INACTIVE</td>
1378 * <td align="center">AF_TRIGGER</td>
1379 * <td align="center">NOT_FOCUSED_LOCKED</td>
1380 * <td align="center">AF state query, Lens now locked</td>
1381 * </tr>
1382 * <tr>
1383 * <td align="center">PASSIVE_SCAN</td>
1384 * <td align="center">Camera device completes current scan</td>
1385 * <td align="center">PASSIVE_FOCUSED</td>
1386 * <td align="center">End AF scan, Lens now locked</td>
1387 * </tr>
1388 * <tr>
1389 * <td align="center">PASSIVE_SCAN</td>
1390 * <td align="center">Camera device fails current scan</td>
1391 * <td align="center">PASSIVE_UNFOCUSED</td>
1392 * <td align="center">End AF scan, Lens now locked</td>
1393 * </tr>
1394 * <tr>
1395 * <td align="center">PASSIVE_SCAN</td>
1396 * <td align="center">AF_TRIGGER</td>
1397 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001398 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001399 * </tr>
1400 * <tr>
1401 * <td align="center">PASSIVE_SCAN</td>
1402 * <td align="center">AF_TRIGGER</td>
1403 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001404 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001405 * </tr>
1406 * <tr>
1407 * <td align="center">PASSIVE_SCAN</td>
1408 * <td align="center">AF_CANCEL</td>
1409 * <td align="center">INACTIVE</td>
1410 * <td align="center">Reset lens position, Lens now locked</td>
1411 * </tr>
1412 * <tr>
1413 * <td align="center">PASSIVE_FOCUSED</td>
1414 * <td align="center">Camera device initiates new scan</td>
1415 * <td align="center">PASSIVE_SCAN</td>
1416 * <td align="center">Start AF scan, Lens now moving</td>
1417 * </tr>
1418 * <tr>
1419 * <td align="center">PASSIVE_UNFOCUSED</td>
1420 * <td align="center">Camera device initiates new scan</td>
1421 * <td align="center">PASSIVE_SCAN</td>
1422 * <td align="center">Start AF scan, Lens now moving</td>
1423 * </tr>
1424 * <tr>
1425 * <td align="center">PASSIVE_FOCUSED</td>
1426 * <td align="center">AF_TRIGGER</td>
1427 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001428 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001429 * </tr>
1430 * <tr>
1431 * <td align="center">PASSIVE_UNFOCUSED</td>
1432 * <td align="center">AF_TRIGGER</td>
1433 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001434 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001435 * </tr>
1436 * <tr>
1437 * <td align="center">FOCUSED_LOCKED</td>
1438 * <td align="center">AF_TRIGGER</td>
1439 * <td align="center">FOCUSED_LOCKED</td>
1440 * <td align="center">No effect</td>
1441 * </tr>
1442 * <tr>
1443 * <td align="center">FOCUSED_LOCKED</td>
1444 * <td align="center">AF_CANCEL</td>
1445 * <td align="center">INACTIVE</td>
1446 * <td align="center">Restart AF scan</td>
1447 * </tr>
1448 * <tr>
1449 * <td align="center">NOT_FOCUSED_LOCKED</td>
1450 * <td align="center">AF_TRIGGER</td>
1451 * <td align="center">NOT_FOCUSED_LOCKED</td>
1452 * <td align="center">No effect</td>
1453 * </tr>
1454 * <tr>
1455 * <td align="center">NOT_FOCUSED_LOCKED</td>
1456 * <td align="center">AF_CANCEL</td>
1457 * <td align="center">INACTIVE</td>
1458 * <td align="center">Restart AF scan</td>
1459 * </tr>
1460 * </tbody>
1461 * </table>
1462 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1463 * <table>
1464 * <thead>
1465 * <tr>
1466 * <th align="center">State</th>
1467 * <th align="center">Transition Cause</th>
1468 * <th align="center">New State</th>
1469 * <th align="center">Notes</th>
1470 * </tr>
1471 * </thead>
1472 * <tbody>
1473 * <tr>
1474 * <td align="center">INACTIVE</td>
1475 * <td align="center">Camera device initiates new scan</td>
1476 * <td align="center">PASSIVE_SCAN</td>
1477 * <td align="center">Start AF scan, Lens now moving</td>
1478 * </tr>
1479 * <tr>
1480 * <td align="center">INACTIVE</td>
1481 * <td align="center">AF_TRIGGER</td>
1482 * <td align="center">NOT_FOCUSED_LOCKED</td>
1483 * <td align="center">AF state query, Lens now locked</td>
1484 * </tr>
1485 * <tr>
1486 * <td align="center">PASSIVE_SCAN</td>
1487 * <td align="center">Camera device completes current scan</td>
1488 * <td align="center">PASSIVE_FOCUSED</td>
1489 * <td align="center">End AF scan, Lens now locked</td>
1490 * </tr>
1491 * <tr>
1492 * <td align="center">PASSIVE_SCAN</td>
1493 * <td align="center">Camera device fails current scan</td>
1494 * <td align="center">PASSIVE_UNFOCUSED</td>
1495 * <td align="center">End AF scan, Lens now locked</td>
1496 * </tr>
1497 * <tr>
1498 * <td align="center">PASSIVE_SCAN</td>
1499 * <td align="center">AF_TRIGGER</td>
1500 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001501 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001502 * </tr>
1503 * <tr>
1504 * <td align="center">PASSIVE_SCAN</td>
1505 * <td align="center">AF_TRIGGER</td>
1506 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001507 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001508 * </tr>
1509 * <tr>
1510 * <td align="center">PASSIVE_SCAN</td>
1511 * <td align="center">AF_CANCEL</td>
1512 * <td align="center">INACTIVE</td>
1513 * <td align="center">Reset lens position, Lens now locked</td>
1514 * </tr>
1515 * <tr>
1516 * <td align="center">PASSIVE_FOCUSED</td>
1517 * <td align="center">Camera device initiates new scan</td>
1518 * <td align="center">PASSIVE_SCAN</td>
1519 * <td align="center">Start AF scan, Lens now moving</td>
1520 * </tr>
1521 * <tr>
1522 * <td align="center">PASSIVE_UNFOCUSED</td>
1523 * <td align="center">Camera device initiates new scan</td>
1524 * <td align="center">PASSIVE_SCAN</td>
1525 * <td align="center">Start AF scan, Lens now moving</td>
1526 * </tr>
1527 * <tr>
1528 * <td align="center">PASSIVE_FOCUSED</td>
1529 * <td align="center">AF_TRIGGER</td>
1530 * <td align="center">FOCUSED_LOCKED</td>
1531 * <td align="center">Immediate trans. Lens now locked</td>
1532 * </tr>
1533 * <tr>
1534 * <td align="center">PASSIVE_UNFOCUSED</td>
1535 * <td align="center">AF_TRIGGER</td>
1536 * <td align="center">NOT_FOCUSED_LOCKED</td>
1537 * <td align="center">Immediate trans. Lens now locked</td>
1538 * </tr>
1539 * <tr>
1540 * <td align="center">FOCUSED_LOCKED</td>
1541 * <td align="center">AF_TRIGGER</td>
1542 * <td align="center">FOCUSED_LOCKED</td>
1543 * <td align="center">No effect</td>
1544 * </tr>
1545 * <tr>
1546 * <td align="center">FOCUSED_LOCKED</td>
1547 * <td align="center">AF_CANCEL</td>
1548 * <td align="center">INACTIVE</td>
1549 * <td align="center">Restart AF scan</td>
1550 * </tr>
1551 * <tr>
1552 * <td align="center">NOT_FOCUSED_LOCKED</td>
1553 * <td align="center">AF_TRIGGER</td>
1554 * <td align="center">NOT_FOCUSED_LOCKED</td>
1555 * <td align="center">No effect</td>
1556 * </tr>
1557 * <tr>
1558 * <td align="center">NOT_FOCUSED_LOCKED</td>
1559 * <td align="center">AF_CANCEL</td>
1560 * <td align="center">INACTIVE</td>
1561 * <td align="center">Restart AF scan</td>
1562 * </tr>
1563 * </tbody>
1564 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001565 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1566 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1567 * camera device. When a trigger is included in a mode switch request, the trigger
1568 * will be evaluated in the context of the new mode in the request.
1569 * See below table for examples:</p>
1570 * <table>
1571 * <thead>
1572 * <tr>
1573 * <th align="center">State</th>
1574 * <th align="center">Transition Cause</th>
1575 * <th align="center">New State</th>
1576 * <th align="center">Notes</th>
1577 * </tr>
1578 * </thead>
1579 * <tbody>
1580 * <tr>
1581 * <td align="center">any state</td>
1582 * <td align="center">CAF--&gt;AUTO mode switch</td>
1583 * <td align="center">INACTIVE</td>
1584 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1585 * </tr>
1586 * <tr>
1587 * <td align="center">any state</td>
1588 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1589 * <td align="center">trigger-reachable states from INACTIVE</td>
1590 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1591 * </tr>
1592 * <tr>
1593 * <td align="center">any state</td>
1594 * <td align="center">AUTO--&gt;CAF mode switch</td>
1595 * <td align="center">passively reachable states from INACTIVE</td>
1596 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1597 * </tr>
1598 * </tbody>
1599 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001600 * <p><b>Possible values:</b>
1601 * <ul>
1602 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1603 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1604 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1605 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1606 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1607 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1608 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1609 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001610 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001611 *
1612 * @see CaptureRequest#CONTROL_AF_MODE
1613 * @see CaptureRequest#CONTROL_MODE
1614 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001615 * @see #CONTROL_AF_STATE_INACTIVE
1616 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1617 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1618 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1619 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1620 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001621 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001622 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001623 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001624 public static final Key<Integer> CONTROL_AF_STATE =
1625 new Key<Integer>("android.control.afState", int.class);
1626
1627 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001628 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001629 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001630 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1631 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1632 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1633 * get locked do not necessarily correspond to the settings that were present in the
1634 * latest capture result received from the camera device, since additional captures
1635 * and AWB updates may have occurred even before the result was sent out. If an
1636 * application is switching between automatic and manual control and wishes to eliminate
1637 * any flicker during the switch, the following procedure is recommended:</p>
1638 * <ol>
1639 * <li>Starting in auto-AWB mode:</li>
1640 * <li>Lock AWB</li>
1641 * <li>Wait for the first result to be output that has the AWB locked</li>
1642 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1643 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1644 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001645 * <p>Note that AWB lock is only meaningful when
1646 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1647 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001648 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1649 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001650 *
1651 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001652 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001653 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001654 public static final Key<Boolean> CONTROL_AWB_LOCK =
1655 new Key<Boolean>("android.control.awbLock", boolean.class);
1656
1657 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001658 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001659 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001660 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001661 * <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 -07001662 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001663 * routine is enabled, overriding the application's selected
1664 * {@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 -08001665 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1666 * is OFF, the behavior of AWB is device dependent. It is recommened to
1667 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1668 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001669 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001670 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001671 * 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 -08001672 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001673 * <p>When set to any other modes, the camera device's auto-white
1674 * balance routine is disabled. The camera device uses each
1675 * particular illumination target for white balance
1676 * adjustment. The application's values for
1677 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1678 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1679 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001680 * <p><b>Possible values:</b>
1681 * <ul>
1682 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1683 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1684 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1685 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1686 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1687 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1688 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1689 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1690 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1691 * </ul></p>
1692 * <p><b>Available values for this device:</b><br>
1693 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001694 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001695 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001696 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001697 * @see CaptureRequest#COLOR_CORRECTION_MODE
1698 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001699 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001700 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001701 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001702 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001703 * @see #CONTROL_AWB_MODE_OFF
1704 * @see #CONTROL_AWB_MODE_AUTO
1705 * @see #CONTROL_AWB_MODE_INCANDESCENT
1706 * @see #CONTROL_AWB_MODE_FLUORESCENT
1707 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1708 * @see #CONTROL_AWB_MODE_DAYLIGHT
1709 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1710 * @see #CONTROL_AWB_MODE_TWILIGHT
1711 * @see #CONTROL_AWB_MODE_SHADE
1712 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001713 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001714 public static final Key<Integer> CONTROL_AWB_MODE =
1715 new Key<Integer>("android.control.awbMode", int.class);
1716
1717 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001718 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001719 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001720 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001721 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001722 * <p>The maximum number of regions supported by the device is determined by the value
1723 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001724 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001725 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001726 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1727 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001728 * bottom-right pixel in the active pixel array.</p>
1729 * <p>The weight must range from 0 to 1000, and represents a weight
1730 * for every pixel in the area. This means that a large metering area
1731 * with the same weight as a smaller area will have more effect in
1732 * the metering result. Metering areas can partially overlap and the
1733 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001734 * <p>The weights are relative to weights of other white balance metering regions, so if
1735 * only one region is used, all non-zero weights will have the same effect. A region with
1736 * 0 weight is ignored.</p>
1737 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1738 * camera device.</p>
1739 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1740 * capture result metadata, the camera device will ignore the sections outside the crop
1741 * region and output only the intersection rectangle as the metering region in the result
1742 * metadata. If the region is entirely outside the crop region, it will be ignored and
1743 * not reported in the result metadata.</p>
1744 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1745 * <p><b>Range of valid values:</b><br>
1746 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1747 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001748 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001749 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001750 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001751 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001752 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001753 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001754 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001755 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1756 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001757
1758 /**
Zhijun He379af012014-05-06 11:54:54 -07001759 * <p>Information to the camera device 3A (auto-exposure,
1760 * auto-focus, auto-white balance) routines about the purpose
1761 * of this capture, to help the camera device to decide optimal 3A
1762 * strategy.</p>
1763 * <p>This control (except for MANUAL) is only effective if
1764 * <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 -08001765 * <p>All intents are supported by all devices, except that:
1766 * * ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1767 * PRIVATE_REPROCESSING or YUV_REPROCESSING.
1768 * * MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1769 * MANUAL_SENSOR.
1770 * * MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1771 * MOTION_TRACKING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001772 * <p><b>Possible values:</b>
1773 * <ul>
1774 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1775 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1776 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1777 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1778 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1779 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1780 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001781 * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001782 * </ul></p>
1783 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001784 *
1785 * @see CaptureRequest#CONTROL_MODE
1786 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1787 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1788 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1789 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1790 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1791 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1792 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1793 * @see #CONTROL_CAPTURE_INTENT_MANUAL
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001794 * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING
Zhijun He379af012014-05-06 11:54:54 -07001795 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001796 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001797 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1798 new Key<Integer>("android.control.captureIntent", int.class);
1799
1800 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001801 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001802 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1803 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1804 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1805 * the algorithm states to INACTIVE.</p>
1806 * <p>The camera device can do several state transitions between two results, if it is
1807 * allowed by the state transition table. So INACTIVE may never actually be seen in
1808 * a result.</p>
1809 * <p>The state in the result is the state for this image (in sync with this image): if
1810 * AWB state becomes CONVERGED, then the image data associated with this result should
1811 * be good to use.</p>
1812 * <p>Below are state transition tables for different AWB modes.</p>
1813 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1814 * <table>
1815 * <thead>
1816 * <tr>
1817 * <th align="center">State</th>
1818 * <th align="center">Transition Cause</th>
1819 * <th align="center">New State</th>
1820 * <th align="center">Notes</th>
1821 * </tr>
1822 * </thead>
1823 * <tbody>
1824 * <tr>
1825 * <td align="center">INACTIVE</td>
1826 * <td align="center"></td>
1827 * <td align="center">INACTIVE</td>
1828 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1829 * </tr>
1830 * </tbody>
1831 * </table>
1832 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1833 * <table>
1834 * <thead>
1835 * <tr>
1836 * <th align="center">State</th>
1837 * <th align="center">Transition Cause</th>
1838 * <th align="center">New State</th>
1839 * <th align="center">Notes</th>
1840 * </tr>
1841 * </thead>
1842 * <tbody>
1843 * <tr>
1844 * <td align="center">INACTIVE</td>
1845 * <td align="center">Camera device initiates AWB scan</td>
1846 * <td align="center">SEARCHING</td>
1847 * <td align="center">Values changing</td>
1848 * </tr>
1849 * <tr>
1850 * <td align="center">INACTIVE</td>
1851 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1852 * <td align="center">LOCKED</td>
1853 * <td align="center">Values locked</td>
1854 * </tr>
1855 * <tr>
1856 * <td align="center">SEARCHING</td>
1857 * <td align="center">Camera device finishes AWB scan</td>
1858 * <td align="center">CONVERGED</td>
1859 * <td align="center">Good values, not changing</td>
1860 * </tr>
1861 * <tr>
1862 * <td align="center">SEARCHING</td>
1863 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1864 * <td align="center">LOCKED</td>
1865 * <td align="center">Values locked</td>
1866 * </tr>
1867 * <tr>
1868 * <td align="center">CONVERGED</td>
1869 * <td align="center">Camera device initiates AWB scan</td>
1870 * <td align="center">SEARCHING</td>
1871 * <td align="center">Values changing</td>
1872 * </tr>
1873 * <tr>
1874 * <td align="center">CONVERGED</td>
1875 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1876 * <td align="center">LOCKED</td>
1877 * <td align="center">Values locked</td>
1878 * </tr>
1879 * <tr>
1880 * <td align="center">LOCKED</td>
1881 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1882 * <td align="center">SEARCHING</td>
1883 * <td align="center">Values not good after unlock</td>
1884 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001885 * </tbody>
1886 * </table>
1887 * <p>For the above table, the camera device may skip reporting any state changes that happen
1888 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1889 * can be skipped in that manner is called a transient state.</p>
1890 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1891 * listed in above table, it is also legal for the camera device to skip one or more
1892 * transient states between two results. See below table for examples:</p>
1893 * <table>
1894 * <thead>
1895 * <tr>
1896 * <th align="center">State</th>
1897 * <th align="center">Transition Cause</th>
1898 * <th align="center">New State</th>
1899 * <th align="center">Notes</th>
1900 * </tr>
1901 * </thead>
1902 * <tbody>
1903 * <tr>
1904 * <td align="center">INACTIVE</td>
1905 * <td align="center">Camera device finished AWB scan</td>
1906 * <td align="center">CONVERGED</td>
1907 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1908 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001909 * <tr>
1910 * <td align="center">LOCKED</td>
1911 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1912 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001913 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001914 * </tr>
1915 * </tbody>
1916 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001917 * <p><b>Possible values:</b>
1918 * <ul>
1919 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1920 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1921 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1922 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1923 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001924 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1925 * <p><b>Limited capability</b> -
1926 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1927 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001928 *
1929 * @see CaptureRequest#CONTROL_AWB_LOCK
1930 * @see CaptureRequest#CONTROL_AWB_MODE
1931 * @see CaptureRequest#CONTROL_MODE
1932 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001933 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001934 * @see #CONTROL_AWB_STATE_INACTIVE
1935 * @see #CONTROL_AWB_STATE_SEARCHING
1936 * @see #CONTROL_AWB_STATE_CONVERGED
1937 * @see #CONTROL_AWB_STATE_LOCKED
1938 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001939 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001940 public static final Key<Integer> CONTROL_AWB_STATE =
1941 new Key<Integer>("android.control.awbState", int.class);
1942
1943 /**
Zhijun He379af012014-05-06 11:54:54 -07001944 * <p>A special color effect to apply.</p>
1945 * <p>When this mode is set, a color effect will be applied
1946 * to images produced by the camera device. The interpretation
1947 * and implementation of these color effects is left to the
1948 * implementor of the camera device, and should not be
1949 * depended on to be consistent (or present) across all
1950 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001951 * <p><b>Possible values:</b>
1952 * <ul>
1953 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1954 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1955 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1956 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1957 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1958 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1959 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1960 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1961 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1962 * </ul></p>
1963 * <p><b>Available values for this device:</b><br>
1964 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001965 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001966 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001967 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07001968 * @see #CONTROL_EFFECT_MODE_OFF
1969 * @see #CONTROL_EFFECT_MODE_MONO
1970 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1971 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1972 * @see #CONTROL_EFFECT_MODE_SEPIA
1973 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1974 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1975 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1976 * @see #CONTROL_EFFECT_MODE_AQUA
1977 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001978 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001979 public static final Key<Integer> CONTROL_EFFECT_MODE =
1980 new Key<Integer>("android.control.effectMode", int.class);
1981
1982 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001983 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001984 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001985 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001986 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001987 * capture parameters itself.</p>
1988 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001989 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001990 * <p>When set to USE_SCENE_MODE, the individual controls in
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001991 * android.control.* are mostly disabled, and the camera device
1992 * implements one of the scene mode settings (such as ACTION,
1993 * SUNSET, or PARTY) as it wishes. The camera device scene mode
1994 * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001995 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1996 * is that this frame will not be used by camera device background 3A statistics
1997 * update, as if this frame is never captured. This mode can be used in the scenario
1998 * where the application doesn't want a 3A manual control capture to affect
1999 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002000 * <p><b>Possible values:</b>
2001 * <ul>
2002 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
2003 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
2004 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
2005 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
2006 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002007 * <p><b>Available values for this device:</b><br>
2008 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002009 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002010 *
2011 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002012 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002013 * @see #CONTROL_MODE_OFF
2014 * @see #CONTROL_MODE_AUTO
2015 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08002016 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002017 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002018 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002019 public static final Key<Integer> CONTROL_MODE =
2020 new Key<Integer>("android.control.mode", int.class);
2021
2022 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002023 * <p>Control for which scene mode is currently active.</p>
2024 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
2025 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07002026 * <p>This is the mode that that is active when
Zhijun Heee2ebde2015-06-16 19:58:11 -07002027 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
2028 * 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}
2029 * while in use.</p>
Zhijun He379af012014-05-06 11:54:54 -07002030 * <p>The interpretation and implementation of these scene modes is left
2031 * to the implementor of the camera device. Their behavior will not be
2032 * consistent across all devices, and any given device may only implement
2033 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002034 * <p><b>Possible values:</b>
2035 * <ul>
2036 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
2037 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
2038 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
2039 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
2040 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
2041 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
2042 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
2043 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
2044 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
2045 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
2046 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
2047 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
2048 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
2049 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
2050 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
2051 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
2052 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
2053 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002054 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002055 * </ul></p>
2056 * <p><b>Available values for this device:</b><br>
2057 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002058 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002059 *
2060 * @see CaptureRequest#CONTROL_AE_MODE
2061 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002062 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07002063 * @see CaptureRequest#CONTROL_AWB_MODE
2064 * @see CaptureRequest#CONTROL_MODE
2065 * @see #CONTROL_SCENE_MODE_DISABLED
2066 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
2067 * @see #CONTROL_SCENE_MODE_ACTION
2068 * @see #CONTROL_SCENE_MODE_PORTRAIT
2069 * @see #CONTROL_SCENE_MODE_LANDSCAPE
2070 * @see #CONTROL_SCENE_MODE_NIGHT
2071 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
2072 * @see #CONTROL_SCENE_MODE_THEATRE
2073 * @see #CONTROL_SCENE_MODE_BEACH
2074 * @see #CONTROL_SCENE_MODE_SNOW
2075 * @see #CONTROL_SCENE_MODE_SUNSET
2076 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
2077 * @see #CONTROL_SCENE_MODE_FIREWORKS
2078 * @see #CONTROL_SCENE_MODE_SPORTS
2079 * @see #CONTROL_SCENE_MODE_PARTY
2080 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
2081 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07002082 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002083 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07002084 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002085 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002086 public static final Key<Integer> CONTROL_SCENE_MODE =
2087 new Key<Integer>("android.control.sceneMode", int.class);
2088
2089 /**
2090 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002091 * active.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002092 * <p>Video stabilization automatically warps images from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002093 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07002094 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07002095 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002096 * <p>Switching between different video stabilization modes may take several
2097 * frames to initialize, the camera device will report the current mode
2098 * in capture result metadata. For example, When "ON" mode is requested,
2099 * the video stabilization modes in the first several capture results may
2100 * still be "OFF", and it will become "ON" when the initialization is
2101 * done.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002102 * <p>In addition, not all recording sizes or frame rates may be supported for
2103 * stabilization by a device that reports stabilization support. It is guaranteed
2104 * that an output targeting a MediaRecorder or MediaCodec will be stabilized if
2105 * the recording resolution is less than or equal to 1920 x 1080 (width less than
2106 * or equal to 1920, height less than or equal to 1080), and the recording
2107 * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult
2108 * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return
2109 * OFF if the recording output is not stabilized, or if there are no output
2110 * Surface types that can be stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002111 * <p>If a camera device supports both this mode and OIS
2112 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
2113 * produce undesirable interaction, so it is recommended not to enable
2114 * both at the same time.</p>
2115 * <p><b>Possible values:</b>
2116 * <ul>
2117 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
2118 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
2119 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002120 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002121 *
Jianing Wei2813b0f2015-09-29 14:24:36 -07002122 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Zhijun He45fa43a12014-06-13 18:29:37 -07002123 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07002124 * @see CaptureRequest#SCALER_CROP_REGION
2125 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
2126 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
2127 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002128 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002129 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
2130 new Key<Integer>("android.control.videoStabilizationMode", int.class);
2131
2132 /**
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002133 * <p>The amount of additional sensitivity boost applied to output images
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002134 * after RAW sensor data is captured.</p>
2135 * <p>Some camera devices support additional digital sensitivity boosting in the
2136 * camera processing pipeline after sensor RAW image is captured.
2137 * Such a boost will be applied to YUV/JPEG format output images but will not
2138 * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p>
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002139 * <p>This key will be <code>null</code> for devices that do not support any RAW format
2140 * outputs. For devices that do support RAW format outputs, this key will always
2141 * present, and if a device does not support post RAW sensitivity boost, it will
2142 * list <code>100</code> in this key.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002143 * <p>If the camera device cannot apply the exact boost requested, it will reduce the
2144 * boost to the nearest supported value.
2145 * The final boost value used will be available in the output capture result.</p>
2146 * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images
2147 * of such device will have the total sensitivity of
Yin-Chia Yeh67e61b62016-01-26 13:27:35 -08002148 * <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 -08002149 * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p>
2150 * <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
2151 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2152 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
2153 * <p><b>Range of valid values:</b><br>
2154 * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p>
2155 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2156 *
2157 * @see CaptureRequest#CONTROL_AE_MODE
2158 * @see CaptureRequest#CONTROL_MODE
2159 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
2160 * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE
2161 * @see CaptureRequest#SENSOR_SENSITIVITY
2162 */
2163 @PublicKey
2164 public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST =
2165 new Key<Integer>("android.control.postRawSensitivityBoost", int.class);
2166
2167 /**
Chien-Yu Chene4491712017-01-11 11:14:06 -08002168 * <p>Allow camera device to enable zero-shutter-lag mode for requests with
2169 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p>
2170 * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with
2171 * STILL_CAPTURE capture intent. The camera device may use images captured in the past to
2172 * produce output images for a zero-shutter-lag request. The result metadata including the
2173 * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images.
2174 * Therefore, the contents of the output images and the result metadata may be out of order
2175 * compared to previous regular requests. enableZsl does not affect requests with other
2176 * capture intents.</p>
2177 * <p>For example, when requests are submitted in the following order:
2178 * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW
2179 * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p>
2180 * <p>The output images for request B may have contents captured before the output images for
2181 * request A, and the result metadata for request B may be older than the result metadata for
2182 * request A.</p>
Chien-Yu Chen1d72ee32017-04-18 15:23:06 -07002183 * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in
2184 * the past for requests with STILL_CAPTURE capture intent.</p>
2185 * <p>For applications targeting SDK versions O and newer, the value of enableZsl in
2186 * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always
2187 * <code>false</code> if present.</p>
2188 * <p>For applications targeting SDK versions older than O, the value of enableZsl in all
2189 * capture templates is always <code>false</code> if present.</p>
Chien-Yu Chen81026382017-05-03 12:30:58 -07002190 * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
Chien-Yu Chene4491712017-01-11 11:14:06 -08002191 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2192 *
2193 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
2194 * @see CaptureResult#SENSOR_TIMESTAMP
2195 */
2196 @PublicKey
2197 public static final Key<Boolean> CONTROL_ENABLE_ZSL =
2198 new Key<Boolean>("android.control.enableZsl", boolean.class);
2199
2200 /**
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002201 * <p>Whether a significant scene change is detected within the currently-set AF
2202 * region(s).</p>
2203 * <p>When the camera focus routine detects a change in the scene it is looking at,
2204 * such as a large shift in camera viewpoint, significant motion in the scene, or a
2205 * significant illumination change, this value will be set to DETECTED for a single capture
2206 * result. Otherwise the value will be NOT_DETECTED. The threshold for detection is similar
2207 * to what would trigger a new passive focus scan to begin in CONTINUOUS autofocus modes.</p>
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002208 * <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 -08002209 * <p><b>Possible values:</b>
2210 * <ul>
2211 * <li>{@link #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED NOT_DETECTED}</li>
2212 * <li>{@link #CONTROL_AF_SCENE_CHANGE_DETECTED DETECTED}</li>
2213 * </ul></p>
2214 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2215 * @see #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED
2216 * @see #CONTROL_AF_SCENE_CHANGE_DETECTED
2217 */
2218 @PublicKey
2219 public static final Key<Integer> CONTROL_AF_SCENE_CHANGE =
2220 new Key<Integer>("android.control.afSceneChange", int.class);
2221
2222 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002223 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08002224 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002225 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2226 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002227 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08002228 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08002229 * camera device will use the highest-quality enhancement algorithms,
2230 * even if it slows down capture rate. FAST means the camera device will
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002231 * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
2232 * edge enhancement will slow down capture rate. Every output stream will have a similar
2233 * amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002234 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2235 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2236 * into a final capture when triggered by the user. In this mode, the camera device applies
2237 * edge enhancement to low-resolution streams (below maximum recording resolution) to
2238 * maximize preview quality, but does not apply edge enhancement to high-resolution streams,
2239 * since those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002240 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2241 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002242 * The camera device may adjust its internal edge enhancement parameters for best
Zhijun He0e99c222015-01-29 15:26:05 -08002243 * 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 -07002244 * <p><b>Possible values:</b>
2245 * <ul>
2246 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2247 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2248 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002249 * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002250 * </ul></p>
2251 * <p><b>Available values for this device:</b><br>
2252 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002253 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2254 * <p><b>Full capability</b> -
2255 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2256 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002257 *
2258 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002259 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002260 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002261 * @see #EDGE_MODE_OFF
2262 * @see #EDGE_MODE_FAST
2263 * @see #EDGE_MODE_HIGH_QUALITY
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002264 * @see #EDGE_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002265 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002266 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002267 public static final Key<Integer> EDGE_MODE =
2268 new Key<Integer>("android.edge.mode", int.class);
2269
2270 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002271 * <p>The desired mode for for the camera device's flash control.</p>
2272 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002273 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002274 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2275 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2276 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2277 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2278 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2279 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002280 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002281 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2282 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2283 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002284 * <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 -07002285 * <p><b>Possible values:</b>
2286 * <ul>
2287 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2288 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2289 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2290 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002291 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002292 *
2293 * @see CaptureRequest#CONTROL_AE_MODE
2294 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2295 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002296 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002297 * @see #FLASH_MODE_OFF
2298 * @see #FLASH_MODE_SINGLE
2299 * @see #FLASH_MODE_TORCH
2300 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002301 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002302 public static final Key<Integer> FLASH_MODE =
2303 new Key<Integer>("android.flash.mode", int.class);
2304
2305 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002306 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002307 * unit.</p>
2308 * <p>When the camera device doesn't have flash unit
2309 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2310 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002311 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2312 * <ul>
2313 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2314 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002315 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002316 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002317 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002318 * </ul>
2319 * <p>In all other conditions the state will not be available on
2320 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002321 * <p><b>Possible values:</b>
2322 * <ul>
2323 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2324 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2325 * <li>{@link #FLASH_STATE_READY READY}</li>
2326 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2327 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2328 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002329 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2330 * <p><b>Limited capability</b> -
2331 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2332 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002333 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002334 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002335 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002336 * @see CaptureRequest#FLASH_MODE
2337 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002338 * @see #FLASH_STATE_UNAVAILABLE
2339 * @see #FLASH_STATE_CHARGING
2340 * @see #FLASH_STATE_READY
2341 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002342 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002343 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002344 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002345 public static final Key<Integer> FLASH_STATE =
2346 new Key<Integer>("android.flash.state", int.class);
2347
2348 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002349 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002350 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002351 * that do not accurately measure the incoming light (i.e. pixels that
2352 * are stuck at an arbitrary value or are oversensitive).</p>
2353 * <p><b>Possible values:</b>
2354 * <ul>
2355 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2356 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2357 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2358 * </ul></p>
2359 * <p><b>Available values for this device:</b><br>
2360 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002361 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002362 *
2363 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002364 * @see #HOT_PIXEL_MODE_OFF
2365 * @see #HOT_PIXEL_MODE_FAST
2366 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2367 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002368 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002369 public static final Key<Integer> HOT_PIXEL_MODE =
2370 new Key<Integer>("android.hotPixel.mode", int.class);
2371
2372 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002373 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002374 * <p>Setting a location object in a request will include the GPS coordinates of the location
2375 * into any JPEG images captured based on the request. These coordinates can then be
2376 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002377 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002378 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002379 @PublicKey
2380 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002381 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2382 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2383
2384 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002385 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002386 * EXIF.</p>
2387 * <p><b>Range of valid values:</b><br>
2388 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002389 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002390 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002391 */
2392 public static final Key<double[]> JPEG_GPS_COORDINATES =
2393 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2394
2395 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002396 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002397 * include in EXIF.</p>
2398 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002399 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002400 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002401 */
2402 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2403 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2404
2405 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002406 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002407 * EXIF.</p>
2408 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002409 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002410 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002411 */
2412 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2413 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2414
2415 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002416 * <p>The orientation for a JPEG image.</p>
2417 * <p>The clockwise rotation angle in degrees, relative to the orientation
2418 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2419 * upright.</p>
2420 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07002421 * rotate the image data to match this orientation. When the image data is rotated,
2422 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002423 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2424 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
2425 * <p>To translate from the device orientation given by the Android sensor APIs, the following
2426 * sample code may be used:</p>
2427 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2428 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2429 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2430 *
2431 * // Round device orientation to a multiple of 90
2432 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2433 *
2434 * // Reverse device orientation for front-facing cameras
2435 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2436 * if (facingFront) deviceOrientation = -deviceOrientation;
2437 *
2438 * // Calculate desired JPEG orientation relative to camera orientation to make
2439 * // the image upright relative to the device orientation
2440 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2441 *
2442 * return jpegOrientation;
2443 * }
2444 * </code></pre>
2445 * <p><b>Units</b>: Degrees in multiples of 90</p>
2446 * <p><b>Range of valid values:</b><br>
2447 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002448 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002449 *
2450 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002451 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002452 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002453 public static final Key<Integer> JPEG_ORIENTATION =
2454 new Key<Integer>("android.jpeg.orientation", int.class);
2455
2456 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002457 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002458 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002459 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002460 * <p><b>Range of valid values:</b><br>
2461 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002462 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002463 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002464 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002465 public static final Key<Byte> JPEG_QUALITY =
2466 new Key<Byte>("android.jpeg.quality", byte.class);
2467
2468 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002469 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002470 * thumbnail.</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_THUMBNAIL_QUALITY =
2477 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2478
2479 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002480 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002481 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2482 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002483 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2484 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002485 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2486 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2487 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2488 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2489 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2490 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002491 * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested,
2492 * the camera device will handle thumbnail rotation in one of the following ways:</p>
2493 * <ul>
2494 * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
2495 * and keep jpeg and thumbnail image data unrotated.</li>
2496 * <li>Rotate the jpeg and thumbnail image data and not set
2497 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
2498 * case, LIMITED or FULL hardware level devices will report rotated thumnail size in
2499 * capture result, so the width and height will be interchanged if 90 or 270 degree
2500 * orientation is requested. LEGACY device will always report unrotated thumbnail
2501 * size.</li>
2502 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002503 * <p><b>Range of valid values:</b><br>
2504 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002505 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002506 *
2507 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002508 * @see CaptureRequest#JPEG_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002509 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002510 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002511 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2512 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002513
2514 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002515 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2516 * effective aperture diameter.</p>
2517 * <p>Setting this value is only supported on the camera devices that have a variable
2518 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002519 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2520 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002521 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002522 * to achieve manual exposure control.</p>
2523 * <p>The requested aperture value may take several frames to reach the
2524 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002525 * aperture size in capture result metadata while the aperture is changing.
2526 * 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 -08002527 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2528 * the ON modes, this will be overridden by the camera device
2529 * auto-exposure algorithm, the overridden values are then provided
2530 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002531 * <p><b>Units</b>: The f-number (f/N)</p>
2532 * <p><b>Range of valid values:</b><br>
2533 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002534 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2535 * <p><b>Full capability</b> -
2536 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2537 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002538 *
Zhijun He399f05d2014-01-15 11:31:30 -08002539 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002540 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002541 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002542 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002543 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002544 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002545 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002546 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002547 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002548 public static final Key<Float> LENS_APERTURE =
2549 new Key<Float>("android.lens.aperture", float.class);
2550
2551 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002552 * <p>The desired setting for the lens neutral density filter(s).</p>
2553 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002554 * <p>Lens filters are typically used to lower the amount of light the
2555 * sensor is exposed to (measured in steps of EV). As used here, an EV
2556 * step is the standard logarithmic representation, which are
2557 * non-negative, and inversely proportional to the amount of light
2558 * hitting the sensor. For example, setting this to 0 would result
2559 * in no reduction of the incoming light, and setting this to 2 would
2560 * mean that the filter is set to reduce incoming light by two stops
2561 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002562 * <p>It may take several frames before the lens filter density changes
2563 * to the requested value. While the filter density is still changing,
2564 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002565 * <p><b>Units</b>: Exposure Value (EV)</p>
2566 * <p><b>Range of valid values:</b><br>
2567 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002568 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2569 * <p><b>Full capability</b> -
2570 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2571 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002572 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002573 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002574 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002575 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002576 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002577 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002578 public static final Key<Float> LENS_FILTER_DENSITY =
2579 new Key<Float>("android.lens.filterDensity", float.class);
2580
2581 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002582 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002583 * <p>This setting controls the physical focal length of the camera
2584 * device's lens. Changing the focal length changes the field of
2585 * view of the camera device, and is usually used for optical zoom.</p>
2586 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2587 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002588 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002589 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2590 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002591 * <p>Optical zoom will not be supported on most devices.</p>
2592 * <p><b>Units</b>: Millimeters</p>
2593 * <p><b>Range of valid values:</b><br>
2594 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002595 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002596 *
2597 * @see CaptureRequest#LENS_APERTURE
2598 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002599 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002600 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002601 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002602 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002603 public static final Key<Float> LENS_FOCAL_LENGTH =
2604 new Key<Float>("android.lens.focalLength", float.class);
2605
2606 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002607 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002608 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002609 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002610 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2611 * <p><b>Range of valid values:</b><br>
2612 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002613 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2614 * <p><b>Full capability</b> -
2615 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2616 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2617 *
2618 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002619 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002620 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002621 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002622 public static final Key<Float> LENS_FOCUS_DISTANCE =
2623 new Key<Float>("android.lens.focusDistance", float.class);
2624
2625 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002626 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002627 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002628 * <p>If variable focus not supported, can still report
2629 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002630 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2631 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2632 * <p><b>Range of valid values:</b><br>
2633 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002634 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2635 * <p><b>Limited capability</b> -
2636 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2637 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2638 *
2639 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002640 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002641 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002642 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002643 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2644 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 -07002645
2646 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002647 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2648 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002649 * <p>OIS is used to compensate for motion blur due to small
2650 * movements of the camera during capture. Unlike digital image
2651 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2652 * makes use of mechanical elements to stabilize the camera
2653 * sensor, and thus allows for longer exposure times before
2654 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002655 * <p>Switching between different optical stabilization modes may take several
2656 * frames to initialize, the camera device will report the current mode in
2657 * capture result metadata. For example, When "ON" mode is requested, the
2658 * optical stabilization modes in the first several capture results may still
2659 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002660 * <p>If a camera device supports both OIS and digital image stabilization
2661 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2662 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002663 * <p>Not all devices will support OIS; see
2664 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2665 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002666 * <p><b>Possible values:</b>
2667 * <ul>
2668 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2669 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2670 * </ul></p>
2671 * <p><b>Available values for this device:</b><br>
2672 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002673 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2674 * <p><b>Limited capability</b> -
2675 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2676 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002677 *
2678 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002679 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002680 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002681 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2682 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2683 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002684 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002685 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2686 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2687
2688 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002689 * <p>Current lens status.</p>
2690 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2691 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2692 * they may take several frames to reach the requested values. This state indicates
2693 * the current status of the lens parameters.</p>
2694 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2695 * either because the parameters are all fixed, or because the lens has had enough
2696 * time to reach the most recently-requested values.
2697 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2698 * <ul>
2699 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2700 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2701 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2702 * which means the optical zoom is not supported.</li>
2703 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2704 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2705 * </ul>
2706 * <p>Then this state will always be STATIONARY.</p>
2707 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2708 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002709 * <p><b>Possible values:</b>
2710 * <ul>
2711 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2712 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2713 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002714 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2715 * <p><b>Limited capability</b> -
2716 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2717 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002718 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002719 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002720 * @see CaptureRequest#LENS_APERTURE
2721 * @see CaptureRequest#LENS_FILTER_DENSITY
2722 * @see CaptureRequest#LENS_FOCAL_LENGTH
2723 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2724 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2725 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2726 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2727 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002728 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002729 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002730 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002731 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002732 public static final Key<Integer> LENS_STATE =
2733 new Key<Integer>("android.lens.state", int.class);
2734
2735 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002736 * <p>The orientation of the camera relative to the sensor
2737 * coordinate system.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002738 * <p>The four coefficients that describe the quaternion
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002739 * rotation from the Android sensor coordinate system to a
2740 * camera-aligned coordinate system where the X-axis is
2741 * aligned with the long side of the image sensor, the Y-axis
2742 * is aligned with the short side of the image sensor, and
2743 * the Z-axis is aligned with the optical axis of the sensor.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002744 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002745 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
2746 * amount <code>theta</code>, the following formulas can be used:</p>
2747 * <pre><code> theta = 2 * acos(w)
2748 * a_x = x / sin(theta/2)
2749 * a_y = y / sin(theta/2)
2750 * a_z = z / sin(theta/2)
2751 * </code></pre>
2752 * <p>To create a 3x3 rotation matrix that applies the rotation
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002753 * defined by this quaternion, the following matrix can be
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002754 * used:</p>
2755 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
2756 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
2757 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
2758 * </code></pre>
2759 * <p>This matrix can then be used to apply the rotation to a
2760 * column vector point with</p>
2761 * <p><code>p' = Rp</code></p>
2762 * <p>where <code>p</code> is in the device sensor coordinate system, and
2763 * <code>p'</code> is in the camera-oriented coordinate system.</p>
2764 * <p><b>Units</b>:
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002765 * Quaternion coefficients</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002766 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2767 */
2768 @PublicKey
2769 public static final Key<float[]> LENS_POSE_ROTATION =
2770 new Key<float[]>("android.lens.poseRotation", float[].class);
2771
2772 /**
2773 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07002774 * <p>The position of the camera device's lens optical center,
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002775 * as a three-dimensional vector <code>(x,y,z)</code>.</p>
2776 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
2777 * is relative to the optical center of the largest camera device facing in the same
2778 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
2779 * coordinate axes}. Note that only the axis definitions are shared with the sensor
2780 * coordinate system, but not the origin.</p>
2781 * <p>If this device is the largest or only camera device with a given facing, then this
2782 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
2783 * from the main sensor along the +X axis (to the right from the user's perspective) will
2784 * report <code>(0.03, 0, 0)</code>.</p>
2785 * <p>To transform a pixel coordinates between two cameras facing the same direction, first
2786 * the source camera {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} must be corrected for. Then the source
2787 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
2788 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
2789 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
2790 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
2791 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
2792 * coordinates.</p>
2793 * <p>To compare this against a real image from the destination camera, the destination camera
2794 * image then needs to be corrected for radial distortion before comparison or sampling.</p>
2795 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to
2796 * the center of the primary gyroscope on the device.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002797 * <p><b>Units</b>: Meters</p>
2798 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2799 *
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002800 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002801 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002802 * @see CameraCharacteristics#LENS_POSE_ROTATION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002803 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002804 */
2805 @PublicKey
2806 public static final Key<float[]> LENS_POSE_TRANSLATION =
2807 new Key<float[]>("android.lens.poseTranslation", float[].class);
2808
2809 /**
2810 * <p>The parameters for this camera device's intrinsic
2811 * calibration.</p>
2812 * <p>The five calibration parameters that describe the
2813 * transform from camera-centric 3D coordinates to sensor
2814 * pixel coordinates:</p>
2815 * <pre><code>[f_x, f_y, c_x, c_y, s]
2816 * </code></pre>
2817 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
2818 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
2819 * axis, and <code>s</code> is a skew parameter for the sensor plane not
2820 * being aligned with the lens plane.</p>
2821 * <p>These are typically used within a transformation matrix K:</p>
2822 * <pre><code>K = [ f_x, s, c_x,
2823 * 0, f_y, c_y,
2824 * 0 0, 1 ]
2825 * </code></pre>
2826 * <p>which can then be combined with the camera pose rotation
2827 * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
2828 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
2829 * complete transform from world coordinates to pixel
2830 * coordinates:</p>
2831 * <pre><code>P = [ K 0 * [ R t
2832 * 0 1 ] 0 1 ]
2833 * </code></pre>
2834 * <p>and with <code>p_w</code> being a point in the world coordinate system
2835 * and <code>p_s</code> being a point in the camera active pixel array
2836 * coordinate system, and with the mapping including the
2837 * homogeneous division by z:</p>
2838 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
2839 * p_s = p_h / z_h
2840 * </code></pre>
2841 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
2842 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
2843 * (depth) in pixel coordinates.</p>
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002844 * <p>Note that the coordinate system for this transform is the
2845 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
2846 * where <code>(0,0)</code> is the top-left of the
2847 * preCorrectionActiveArraySize rectangle. Once the pose and
2848 * intrinsic calibration transforms have been applied to a
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002849 * world point, then the {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002850 * transform needs to be applied, and the result adjusted to
2851 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
2852 * system (where <code>(0, 0)</code> is the top-left of the
2853 * activeArraySize rectangle), to determine the final pixel
2854 * coordinate of the world point for processed (non-RAW)
2855 * output buffers.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002856 * <p><b>Units</b>:
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002857 * Pixels in the
2858 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
2859 * coordinate system.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002860 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2861 *
2862 * @see CameraCharacteristics#LENS_POSE_ROTATION
2863 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002864 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07002865 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002866 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002867 */
2868 @PublicKey
2869 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
2870 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
2871
2872 /**
2873 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002874 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002875 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002876 * kappa_3]</code> and two tangential distortion coefficients
2877 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
2878 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002879 * <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 -07002880 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002881 * 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 -07002882 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002883 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002884 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
2885 * input image that correspond to the pixel values in the
2886 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
2887 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
2888 * </code></pre>
2889 * <p>The pixel coordinates are defined in a normalized
2890 * coordinate system related to the
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002891 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002892 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
2893 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
2894 * of both x and y coordinates are normalized to be 1 at the
2895 * edge further from the optical center, so the range
2896 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
2897 * <p>Finally, <code>r</code> represents the radial distance from the
2898 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
2899 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
2900 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002901 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002902 * Unitless coefficients.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002903 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002904 *
2905 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002906 */
2907 @PublicKey
2908 public static final Key<float[]> LENS_RADIAL_DISTORTION =
2909 new Key<float[]>("android.lens.radialDistortion", float[].class);
2910
2911 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002912 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002913 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08002914 * excessive noise added by the capture process, especially in dark conditions.</p>
2915 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
2916 * YUV domain.</p>
2917 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
2918 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
2919 * This mode is optional, may not be support by all devices. The application should check
2920 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002921 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2922 * will be applied. HIGH_QUALITY mode indicates that the camera device
2923 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002924 * even if it slows down capture rate. FAST means the camera device will not
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002925 * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
2926 * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
2927 * Every output stream will have a similar amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002928 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2929 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2930 * into a final capture when triggered by the user. In this mode, the camera device applies
2931 * noise reduction to low-resolution streams (below maximum recording resolution) to maximize
2932 * preview quality, but does not apply noise reduction to high-resolution streams, since
2933 * those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002934 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
2935 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
2936 * may adjust the noise reduction parameters for best image quality based on the
2937 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002938 * <p><b>Possible values:</b>
2939 * <ul>
2940 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2941 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2942 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08002943 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002944 * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002945 * </ul></p>
2946 * <p><b>Available values for this device:</b><br>
2947 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002948 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2949 * <p><b>Full capability</b> -
2950 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2951 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002952 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002953 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002954 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08002955 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002956 * @see #NOISE_REDUCTION_MODE_OFF
2957 * @see #NOISE_REDUCTION_MODE_FAST
2958 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08002959 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002960 * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002961 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002962 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002963 public static final Key<Integer> NOISE_REDUCTION_MODE =
2964 new Key<Integer>("android.noiseReduction.mode", int.class);
2965
2966 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002967 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002968 * final one for the capture, or only a partial that contains a
2969 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002970 * values.</p>
2971 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002972 * single capture may not overlap, except for this entry. The
2973 * FINAL buffers must retain FIFO ordering relative to the
2974 * requests that generate them, so the FINAL buffer for frame 3 must
2975 * always be sent to the framework after the FINAL buffer for frame 2, and
2976 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2977 * in any order relative to other frames, but all PARTIAL buffers for a given
2978 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002979 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002980 * <p><b>Range of valid values:</b><br>
2981 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002982 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002983 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002984 * @hide
2985 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002986 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002987 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2988 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2989
2990 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002991 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002992 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002993 * frameCount value).</p>
2994 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002995 * <p><b>Units</b>: count of frames</p>
2996 * <p><b>Range of valid values:</b><br>
2997 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002998 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002999 * @deprecated
3000 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003001 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003002 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003003 public static final Key<Integer> REQUEST_FRAME_COUNT =
3004 new Key<Integer>("android.request.frameCount", int.class);
3005
3006 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003007 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003008 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08003009 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003010 * <p><b>Units</b>: arbitrary integer assigned by application</p>
3011 * <p><b>Range of valid values:</b><br>
3012 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003013 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003014 * @hide
3015 */
3016 public static final Key<Integer> REQUEST_ID =
3017 new Key<Integer>("android.request.id", int.class);
3018
3019 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003020 * <p>Specifies the number of pipeline stages the frame went
3021 * through from when it was exposed to when the final completed result
3022 * was available to the framework.</p>
3023 * <p>Depending on what settings are used in the request, and
3024 * what streams are configured, the data may undergo less processing,
3025 * and some pipeline stages skipped.</p>
3026 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003027 * <p><b>Range of valid values:</b><br>
3028 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003029 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003030 *
3031 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3032 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003033 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003034 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
3035 new Key<Byte>("android.request.pipelineDepth", byte.class);
3036
3037 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003038 * <p>The desired region of the sensor to read out for this capture.</p>
3039 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003040 * <p>The crop region coordinate system is based off
3041 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
3042 * top-left corner of the sensor active array.</p>
3043 * <p>Output streams use this rectangle to produce their output,
3044 * cropping to a smaller region if necessary to maintain the
3045 * stream's aspect ratio, then scaling the sensor input to
3046 * match the output's configured resolution.</p>
3047 * <p>The crop region is applied after the RAW to other color
3048 * space (e.g. YUV) conversion. Since raw streams
3049 * (e.g. RAW16) don't have the conversion stage, they are not
3050 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07003051 * <p>For non-raw streams, any additional per-stream cropping will
3052 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003053 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003054 * ratio, then 4:3 streams will use the exact crop
3055 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08003056 * (letterbox).</p>
3057 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003058 * outputs will crop horizontally (pillarbox), and 16:9
3059 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08003060 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003061 * <p>The width and height of the crop region cannot
3062 * be set to be smaller than
3063 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
3064 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
3065 * <p>The camera device may adjust the crop region to account
3066 * for rounding and other hardware requirements; the final
3067 * crop region used will be included in the output capture
3068 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003069 * <p><b>Units</b>: Pixel coordinates relative to
3070 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003071 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003072 *
3073 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003074 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003075 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003076 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003077 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
3078 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
3079
3080 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003081 * <p>Duration each pixel is exposed to
3082 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003083 * <p>If the sensor can't expose this exact duration, it will shorten the
3084 * duration exposed to the nearest possible value (rather than expose longer).
3085 * The final exposure time used will be available in the output capture result.</p>
3086 * <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
3087 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3088 * <p><b>Units</b>: Nanoseconds</p>
3089 * <p><b>Range of valid values:</b><br>
3090 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003091 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3092 * <p><b>Full capability</b> -
3093 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3094 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3095 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003096 * @see CaptureRequest#CONTROL_AE_MODE
3097 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003098 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003099 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003100 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003101 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003102 public static final Key<Long> SENSOR_EXPOSURE_TIME =
3103 new Key<Long>("android.sensor.exposureTime", long.class);
3104
3105 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003106 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003107 * start of next frame exposure.</p>
3108 * <p>The maximum frame rate that can be supported by a camera subsystem is
3109 * a function of many factors:</p>
3110 * <ul>
3111 * <li>Requested resolutions of output image streams</li>
3112 * <li>Availability of binning / skipping modes on the imager</li>
3113 * <li>The bandwidth of the imager interface</li>
3114 * <li>The bandwidth of the various ISP processing blocks</li>
3115 * </ul>
3116 * <p>Since these factors can vary greatly between different ISPs and
3117 * sensors, the camera abstraction tries to represent the bandwidth
3118 * restrictions with as simple a model as possible.</p>
3119 * <p>The model presented has the following characteristics:</p>
3120 * <ul>
3121 * <li>The image sensor is always configured to output the smallest
3122 * resolution possible given the application's requested output stream
3123 * sizes. The smallest resolution is defined as being at least as large
3124 * as the largest requested output stream size; the camera pipeline must
3125 * never digitally upsample sensor data when the crop region covers the
3126 * whole sensor. In general, this means that if only small output stream
3127 * resolutions are configured, the sensor can provide a higher frame
3128 * rate.</li>
3129 * <li>Since any request may use any or all the currently configured
3130 * output streams, the sensor and ISP must be configured to support
3131 * scaling a single capture to all the streams at the same time. This
3132 * means the camera pipeline must be ready to produce the largest
3133 * requested output size without any delay. Therefore, the overall
3134 * frame rate of a given configured stream set is governed only by the
3135 * largest requested stream resolution.</li>
3136 * <li>Using more than one output stream in a request does not affect the
3137 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08003138 * <li>Certain format-streams may need to do additional background processing
3139 * before data is consumed/produced by that stream. These processors
3140 * can run concurrently to the rest of the camera pipeline, but
3141 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003142 * </ul>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003143 * <p>The necessary information for the application, given the model above, is provided via
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003144 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003145 * These are used to determine the maximum frame rate / minimum frame duration that is
3146 * possible for a given stream configuration.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003147 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08003148 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003149 * device:</p>
3150 * <ol>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003151 * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li>
3152 * <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 }
3153 * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li>
3154 * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum
3155 * 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 -08003156 * </ol>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003157 * <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 -08003158 * using its respective size/format), then the frame duration in <code>F</code> determines the steady
3159 * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let
3160 * this special kind of request be called <code>Rsimple</code>.</p>
3161 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a
3162 * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if
3163 * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all
3164 * buffers from the previous <code>Rstall</code> have already been delivered.</p>
3165 * <p>For more details about stalling, see {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003166 * <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
3167 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3168 * <p><b>Units</b>: Nanoseconds</p>
3169 * <p><b>Range of valid values:</b><br>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003170 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }.
3171 * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003172 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3173 * <p><b>Full capability</b> -
3174 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3175 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003176 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003177 * @see CaptureRequest#CONTROL_AE_MODE
3178 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003179 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003180 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003181 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003182 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003183 public static final Key<Long> SENSOR_FRAME_DURATION =
3184 new Key<Long>("android.sensor.frameDuration", long.class);
3185
3186 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003187 * <p>The amount of gain applied to sensor data
3188 * before processing.</p>
3189 * <p>The sensitivity is the standard ISO sensitivity value,
3190 * as defined in ISO 12232:2006.</p>
3191 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
3192 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
3193 * is guaranteed to use only analog amplification for applying the gain.</p>
3194 * <p>If the camera device cannot apply the exact sensitivity
3195 * requested, it will reduce the gain to the nearest supported
3196 * value. The final sensitivity used will be available in the
3197 * output capture result.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003198 * <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
3199 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003200 * <p><b>Units</b>: ISO arithmetic units</p>
3201 * <p><b>Range of valid values:</b><br>
3202 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003203 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3204 * <p><b>Full capability</b> -
3205 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3206 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003207 *
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003208 * @see CaptureRequest#CONTROL_AE_MODE
3209 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003210 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003211 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
3212 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003213 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003214 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003215 public static final Key<Integer> SENSOR_SENSITIVITY =
3216 new Key<Integer>("android.sensor.sensitivity", int.class);
3217
3218 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003219 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07003220 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003221 * <p>The timestamps are also included in all image
3222 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07003223 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003224 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07003225 * the timestamps measure time since an unspecified starting point,
3226 * and are monotonically increasing. They can be compared with the
3227 * timestamps for other captures from the same camera device, but are
3228 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003229 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the
3230 * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can
3231 * be compared to other timestamps from other subsystems that
3232 * are using that base.</p>
Chien-Yu Chen6216e4e2015-05-29 11:49:54 -07003233 * <p>For reprocessing, the timestamp will match the start of exposure of
3234 * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the
3235 * timestamp} in the TotalCaptureResult that was used to create the
3236 * reprocess capture request.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003237 * <p><b>Units</b>: Nanoseconds</p>
3238 * <p><b>Range of valid values:</b><br>
3239 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003240 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07003241 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003242 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
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_TIMESTAMP =
3246 new Key<Long>("android.sensor.timestamp", long.class);
3247
3248 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07003249 * <p>The estimated camera neutral color in the native sensor colorspace at
3250 * the time of capture.</p>
3251 * <p>This value gives the neutral color point encoded as an RGB value in the
3252 * native sensor color space. The neutral color point indicates the
3253 * currently estimated white point of the scene illumination. It can be
3254 * used to interpolate between the provided color transforms when
3255 * processing raw sensor data.</p>
3256 * <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 -08003257 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3258 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003259 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08003260 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
3261 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
3262
3263 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003264 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003265 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003266 * corresponding to the sensor amplification (S) and sensor readout
3267 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003268 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003269 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
3270 * represented as an array of Pair&lt;Double, Double&gt;, where
3271 * the first member of the Pair at index n is the S coefficient and the
3272 * second member is the O coefficient for the nth color channel in the CFA.</p>
3273 * <p>These coefficients are used in a two parameter noise model to describe
3274 * the amount of noise present in the image for each CFA channel. The
3275 * noise model used here is:</p>
3276 * <p>N(x) = sqrt(Sx + O)</p>
3277 * <p>Where x represents the recorded signal of a CFA channel normalized to
3278 * the range [0, 1], and S and O are the noise model coeffiecients for
3279 * that channel.</p>
3280 * <p>A more detailed description of the noise model can be found in the
3281 * Adobe DNG specification for the NoiseProfile tag.</p>
3282 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3283 *
3284 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3285 */
3286 @PublicKey
3287 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
3288 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
3289
3290 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08003291 * <p>The worst-case divergence between Bayer green channels.</p>
3292 * <p>This value is an estimate of the worst case split between the
3293 * Bayer green channels in the red and blue rows in the sensor color
3294 * filter array.</p>
3295 * <p>The green split is calculated as follows:</p>
3296 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07003297 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
3298 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
3299 * mosaic channels (R, Gr, Gb, B). The location and size of the window
3300 * chosen is implementation defined, and should be chosen to provide a
3301 * green split estimate that is both representative of the entire image
3302 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003303 * <li>The arithmetic mean of the green channels from the red
3304 * rows (mean_Gr) within W is computed.</li>
3305 * <li>The arithmetic mean of the green channels from the blue
3306 * rows (mean_Gb) within W is computed.</li>
3307 * <li>The maximum ratio R of the two means is computed as follows:
3308 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
3309 * </ol>
3310 * <p>The ratio R is the green split divergence reported for this property,
3311 * which represents how much the green channels differ in the mosaic
3312 * pattern. This value is typically used to determine the treatment of
3313 * the green mosaic channels when demosaicing.</p>
3314 * <p>The green split value can be roughly interpreted as follows:</p>
3315 * <ul>
3316 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
3317 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
3318 * correction to avoid demosaic errors (3-20% divergence).</li>
3319 * <li>R &gt; 1.20 will require strong software correction to produce
3320 * a usuable image (&gt;20% divergence).</li>
3321 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003322 * <p><b>Range of valid values:</b><br></p>
3323 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003324 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3325 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003326 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08003327 public static final Key<Float> SENSOR_GREEN_SPLIT =
3328 new Key<Float>("android.sensor.greenSplit", float.class);
3329
3330 /**
Zhijun He379af012014-05-06 11:54:54 -07003331 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
3332 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
3333 * <p>Each color channel is treated as an unsigned 32-bit integer.
3334 * The camera device then uses the most significant X bits
3335 * that correspond to how many bits are in its Bayer raw sensor
3336 * output.</p>
3337 * <p>For example, a sensor with RAW10 Bayer output would use the
3338 * 10 most significant bits from each color channel.</p>
3339 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3340 *
3341 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
3342 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003343 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003344 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
3345 new Key<int[]>("android.sensor.testPatternData", int[].class);
3346
3347 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003348 * <p>When enabled, the sensor sends a test pattern instead of
3349 * doing a real exposure from the camera.</p>
3350 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003351 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08003352 * work as normal.</p>
3353 * <p>For example, if manual flash is enabled, flash firing should still
3354 * occur (and that the test pattern remain unmodified, since the flash
3355 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003356 * <p>Defaults to OFF.</p>
3357 * <p><b>Possible values:</b>
3358 * <ul>
3359 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
3360 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
3361 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
3362 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
3363 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
3364 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
3365 * </ul></p>
3366 * <p><b>Available values for this device:</b><br>
3367 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003368 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003369 *
3370 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08003371 * @see #SENSOR_TEST_PATTERN_MODE_OFF
3372 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
3373 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
3374 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
3375 * @see #SENSOR_TEST_PATTERN_MODE_PN9
3376 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
3377 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003378 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003379 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
3380 new Key<Integer>("android.sensor.testPatternMode", int.class);
3381
3382 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07003383 * <p>Duration between the start of first row exposure
3384 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003385 * <p>This is the exposure time skew between the first and last
3386 * row exposure start times. The first row and the last row are
3387 * the first and last rows inside of the
3388 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003389 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
3390 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003391 * <p><b>Units</b>: Nanoseconds</p>
3392 * <p><b>Range of valid values:</b><br>
3393 * &gt;= 0 and &lt;
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003394 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003395 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3396 * <p><b>Limited capability</b> -
3397 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3398 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003399 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003400 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07003401 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3402 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003403 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07003404 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
3405 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
3406
3407 /**
Zhijun Hecd950b62015-11-12 17:47:52 -08003408 * <p>A per-frame dynamic black level offset for each of the color filter
3409 * arrangement (CFA) mosaic channels.</p>
3410 * <p>Camera sensor black levels may vary dramatically for different
3411 * capture settings (e.g. {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). The fixed black
3412 * level reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may be too
3413 * inaccurate to represent the actual value on a per-frame basis. The
3414 * camera device internal pipeline relies on reliable black level values
3415 * to process the raw images appropriately. To get the best image
3416 * quality, the camera device may choose to estimate the per frame black
3417 * level values either based on optically shielded black regions
3418 * ({@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}) or its internal model.</p>
3419 * <p>This key reports the camera device estimated per-frame zero light
3420 * value for each of the CFA mosaic channels in the camera sensor. The
3421 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may only represent a coarse
3422 * approximation of the actual black level values. This value is the
3423 * black level used in camera device internal image processing pipeline
3424 * and generally more accurate than the fixed black level values.
3425 * However, since they are estimated values by the camera device, they
3426 * may not be as accurate as the black level values calculated from the
3427 * optical black pixels reported by {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}.</p>
3428 * <p>The values are given in the same order as channels listed for the CFA
3429 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
3430 * nth value given corresponds to the black level offset for the nth
3431 * color channel listed in the CFA.</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003432 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is available or the
3433 * camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08003434 * <p><b>Range of valid values:</b><br>
3435 * &gt;= 0 for each.</p>
3436 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3437 *
3438 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
3439 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3440 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3441 * @see CaptureRequest#SENSOR_SENSITIVITY
3442 */
3443 @PublicKey
Zhijun He8998ad92015-11-24 14:31:04 -08003444 public static final Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL =
3445 new Key<float[]>("android.sensor.dynamicBlackLevel", float[].class);
Zhijun Hecd950b62015-11-12 17:47:52 -08003446
3447 /**
3448 * <p>Maximum raw value output by sensor for this frame.</p>
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07003449 * <p>Since the {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may change for different
Zhijun Hecd950b62015-11-12 17:47:52 -08003450 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}), the white
3451 * level will change accordingly. This key is similar to
3452 * {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}, but specifies the camera device
3453 * estimated white level for each frame.</p>
3454 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is
3455 * available or the camera device advertises this key via
3456 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys }.</p>
3457 * <p><b>Range of valid values:</b><br>
3458 * &gt;= 0</p>
3459 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3460 *
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07003461 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
Zhijun Hecd950b62015-11-12 17:47:52 -08003462 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
3463 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3464 * @see CaptureRequest#SENSOR_SENSITIVITY
3465 */
3466 @PublicKey
3467 public static final Key<Integer> SENSOR_DYNAMIC_WHITE_LEVEL =
3468 new Key<Integer>("android.sensor.dynamicWhiteLevel", int.class);
3469
3470 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08003471 * <p>Quality of lens shading correction applied
3472 * to the image data.</p>
3473 * <p>When set to OFF mode, no lens shading correction will be applied by the
3474 * camera device, and an identity lens shading map data will be provided
3475 * 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 -07003476 * shading map with size of <code>[ 4, 3 ]</code>,
3477 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
3478 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003479 * <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 -07003480 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3481 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3482 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3483 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3484 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08003485 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003486 * <p>When set to other modes, lens shading correction will be applied by the camera
3487 * device. Applications can request lens shading map data by setting
3488 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
3489 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
3490 * data will be the one applied by the camera device for this capture request.</p>
3491 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
3492 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
3493 * 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>
3494 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
3495 * to be converged before using the returned shading map data.</p>
3496 * <p><b>Possible values:</b>
3497 * <ul>
3498 * <li>{@link #SHADING_MODE_OFF OFF}</li>
3499 * <li>{@link #SHADING_MODE_FAST FAST}</li>
3500 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3501 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003502 * <p><b>Available values for this device:</b><br>
3503 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003504 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3505 * <p><b>Full capability</b> -
3506 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3507 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003508 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07003509 * @see CaptureRequest#CONTROL_AE_MODE
3510 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003511 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003512 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003513 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08003514 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3515 * @see #SHADING_MODE_OFF
3516 * @see #SHADING_MODE_FAST
3517 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08003518 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003519 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08003520 public static final Key<Integer> SHADING_MODE =
3521 new Key<Integer>("android.shading.mode", int.class);
3522
3523 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003524 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003525 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003526 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003527 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003528 * fields.</p>
3529 * <p><b>Possible values:</b>
3530 * <ul>
3531 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3532 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3533 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3534 * </ul></p>
3535 * <p><b>Available values for this device:</b><br>
3536 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3537 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003538 *
3539 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003540 * @see #STATISTICS_FACE_DETECT_MODE_OFF
3541 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3542 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3543 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003544 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003545 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3546 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3547
3548 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003549 * <p>List of unique IDs for detected faces.</p>
3550 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3551 * to the camera device. A face that leaves the field of view and later returns may be
3552 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003553 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3554 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003555 *
3556 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003557 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003558 */
3559 public static final Key<int[]> STATISTICS_FACE_IDS =
3560 new Key<int[]>("android.statistics.faceIds", int[].class);
3561
3562 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003563 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003564 * faces.</p>
3565 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3566 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003567 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3568 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003569 *
3570 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3571 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003572 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003573 */
3574 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3575 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3576
3577 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003578 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003579 * faces.</p>
3580 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3581 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003582 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3583 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003584 *
3585 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3586 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003587 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003588 */
3589 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3590 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3591
3592 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003593 * <p>List of the face confidence scores for
3594 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003595 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003596 * <p><b>Range of valid values:</b><br>
3597 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003598 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003599 *
3600 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003601 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003602 */
3603 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3604 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3605
3606 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003607 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003608 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003609 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003610 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003611 *
3612 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3613 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003614 @PublicKey
3615 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003616 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3617 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3618
3619 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003620 * <p>The shading map is a low-resolution floating-point map
3621 * that lists the coefficients used to correct for vignetting, for each
3622 * Bayer color channel.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003623 * <p>The map provided here is the same map that is used by the camera device to
3624 * correct both color shading and vignetting for output non-RAW images.</p>
3625 * <p>When there is no lens shading correction applied to RAW
3626 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3627 * false), this map is the complete lens shading correction
3628 * map; when there is some lens shading correction applied to
3629 * 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
3630 * correction map that needs to be applied to get shading
3631 * corrected images that match the camera device's output for
3632 * non-RAW formats.</p>
3633 * <p>For a complete shading correction map, the least shaded
3634 * section of the image will have a gain factor of 1; all
3635 * other sections will have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003636 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003637 * will take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003638 * <p>The shading map is for the entire active pixel array, and is not
3639 * affected by the crop region specified in the request. Each shading map
3640 * entry is the value of the shading compensation map over a specific
3641 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3642 * map, and an active pixel array size (W x H), shading map entry
3643 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3644 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3645 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3646 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3647 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003648 * The shading map is stored in a fully interleaved format.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003649 * <p>The shading map will generally have on the order of 30-40 rows and columns,
3650 * and will be smaller than 64x64.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003651 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003652 * <pre><code>width,height = [ 4, 3 ]
3653 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003654 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003655 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3656 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3657 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3658 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3659 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003660 * </code></pre>
3661 * <p>The low-resolution scaling map images for each channel are
3662 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003663 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3664 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3665 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3666 * <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 -08003667 * <p>As a visualization only, inverting the full-color map to recover an
3668 * 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 -08003669 * <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 -07003670 * <p><b>Range of valid values:</b><br>
3671 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003672 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3673 * <p><b>Full capability</b> -
3674 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3675 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003676 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003677 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003678 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003679 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003680 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003681 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003682 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3683 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3684
3685 /**
3686 * <p>The shading map is a low-resolution floating-point map
Zhijun He43210fe2016-04-12 23:15:23 -07003687 * that lists the coefficients used to correct for vignetting and color shading,
3688 * for each Bayer color channel of RAW image data.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003689 * <p>The map provided here is the same map that is used by the camera device to
3690 * correct both color shading and vignetting for output non-RAW images.</p>
3691 * <p>When there is no lens shading correction applied to RAW
3692 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3693 * false), this map is the complete lens shading correction
3694 * map; when there is some lens shading correction applied to
3695 * 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
3696 * correction map that needs to be applied to get shading
3697 * corrected images that match the camera device's output for
3698 * non-RAW formats.</p>
3699 * <p>For a complete shading correction map, the least shaded
3700 * section of the image will have a gain factor of 1; all
3701 * other sections will have gains above 1.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003702 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003703 * will take into account the colorCorrection settings.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003704 * <p>The shading map is for the entire active pixel array, and is not
3705 * affected by the crop region specified in the request. Each shading map
3706 * entry is the value of the shading compensation map over a specific
3707 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3708 * map, and an active pixel array size (W x H), shading map entry
3709 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3710 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3711 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3712 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3713 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3714 * The shading map is stored in a fully interleaved format, and its size
3715 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003716 * <p>The shading map will generally have on the order of 30-40 rows and columns,
3717 * and will be smaller than 64x64.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003718 * <p>As an example, given a very small map defined as:</p>
3719 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3720 * android.statistics.lensShadingMap =
3721 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003722 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3723 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3724 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3725 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3726 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003727 * </code></pre>
3728 * <p>The low-resolution scaling map images for each channel are
3729 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003730 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3731 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3732 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3733 * <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 -07003734 * <p>As a visualization only, inverting the full-color map to recover an
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003735 * image of a gray wall (using bicubic interpolation for visual quality)
3736 * as captured by the sensor gives:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003737 * <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 -08003738 * <p>Note that the RAW image data might be subject to lens shading
3739 * correction not reported on this map. Query
3740 * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject
3741 * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}
3742 * is TRUE, the RAW image data is subject to partial or full lens shading
3743 * correction. In the case full lens shading correction is applied to RAW
3744 * images, the gain factor map reported in this key will contain all 1.0 gains.
3745 * In other words, the map reported in this key is the remaining lens shading
3746 * that needs to be applied on the RAW image to get images without lens shading
3747 * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image
3748 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003749 * <p><b>Range of valid values:</b><br>
3750 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003751 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3752 * <p><b>Full capability</b> -
3753 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3754 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003755 *
3756 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003757 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003758 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
3759 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003760 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003761 */
3762 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3763 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3764
3765 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003766 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003767 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003768 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003769 * since statistics processing on data from a new frame
3770 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003771 * applied to that frame.</p>
3772 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003773 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003774 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003775 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003776 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003777 *
3778 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003779 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003780 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003781 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003782 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003783 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3784 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3785
3786 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003787 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08003788 * calculated by the camera device's statistics units for the current
3789 * output frame.</p>
3790 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003791 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08003792 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003793 * are the best fit for the current output frame. This may
3794 * be different than the transform used for this frame, since
3795 * statistics processing on data from a new frame typically
3796 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003797 * that frame.</p>
3798 * <p>These estimates must be provided for all frames, even if
3799 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003800 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003801 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003802 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003803 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003804 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003805 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003806 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003807 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3808 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3809
3810 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08003811 * <p>The camera device estimated scene illumination lighting
3812 * frequency.</p>
3813 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3814 * that depends on the local utility power standards. This flicker must be
3815 * accounted for by auto-exposure routines to avoid artifacts in captured images.
3816 * The camera device uses this entry to tell the application what the scene
3817 * illuminant frequency is.</p>
3818 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003819 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3820 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3821 * antibanding, and the application can ensure it selects
3822 * exposure times that do not cause banding issues by looking
3823 * into this metadata field. See
3824 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3825 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003826 * <p><b>Possible values:</b>
3827 * <ul>
3828 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3829 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3830 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3831 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003832 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3833 * <p><b>Full capability</b> -
3834 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3835 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08003836 *
3837 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3838 * @see CaptureRequest#CONTROL_AE_MODE
3839 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003840 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003841 * @see #STATISTICS_SCENE_FLICKER_NONE
3842 * @see #STATISTICS_SCENE_FLICKER_50HZ
3843 * @see #STATISTICS_SCENE_FLICKER_60HZ
3844 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003845 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003846 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
3847 new Key<Integer>("android.statistics.sceneFlicker", int.class);
3848
3849 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003850 * <p>Operating mode for hot pixel map generation.</p>
3851 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
3852 * If set to <code>false</code>, no hot pixel map will be returned.</p>
3853 * <p><b>Range of valid values:</b><br>
3854 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003855 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003856 *
3857 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
3858 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
3859 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003860 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003861 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
3862 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
3863
3864 /**
3865 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
3866 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
3867 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
3868 * bottom-right of the pixel array, respectively. The width and
3869 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
3870 * This may include hot pixels that lie outside of the active array
3871 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003872 * <p><b>Range of valid values:</b><br></p>
3873 * <p>n &lt;= number of pixels on the sensor.
3874 * The <code>(x, y)</code> coordinates must be bounded by
3875 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003876 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003877 *
3878 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3879 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3880 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003881 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003882 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
3883 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003884
3885 /**
Zhijun He379af012014-05-06 11:54:54 -07003886 * <p>Whether the camera device will output the lens
3887 * shading map in output result metadata.</p>
3888 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003889 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07003890 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003891 * <p>ON is always supported on devices with the RAW capability.</p>
3892 * <p><b>Possible values:</b>
3893 * <ul>
3894 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3895 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3896 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003897 * <p><b>Available values for this device:</b><br>
3898 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003899 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3900 * <p><b>Full capability</b> -
3901 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3902 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3903 *
3904 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003905 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Zhijun He379af012014-05-06 11:54:54 -07003906 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3907 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3908 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003909 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003910 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3911 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3912
3913 /**
Eino-Ville Talvala601e0f62018-02-05 16:25:40 -08003914 * <p>A control for selecting whether OIS position information is included in output
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003915 * result metadata.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003916 * <p><b>Possible values:</b>
3917 * <ul>
3918 * <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li>
3919 * <li>{@link #STATISTICS_OIS_DATA_MODE_ON ON}</li>
3920 * </ul></p>
3921 * <p><b>Available values for this device:</b><br>
3922 * android.Statistics.info.availableOisDataModes</p>
3923 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003924 * @see #STATISTICS_OIS_DATA_MODE_OFF
3925 * @see #STATISTICS_OIS_DATA_MODE_ON
3926 */
3927 @PublicKey
3928 public static final Key<Integer> STATISTICS_OIS_DATA_MODE =
3929 new Key<Integer>("android.statistics.oisDataMode", int.class);
3930
3931 /**
3932 * <p>An array of timestamps of OIS samples, in nanoseconds.</p>
3933 * <p>The array contains the timestamps of OIS samples. The timestamps are in the same
3934 * timebase as and comparable to {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp}.</p>
3935 * <p><b>Units</b>: nanoseconds</p>
3936 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3937 *
3938 * @see CaptureResult#SENSOR_TIMESTAMP
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08003939 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003940 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003941 public static final Key<long[]> STATISTICS_OIS_TIMESTAMPS =
3942 new Key<long[]>("android.statistics.oisTimestamps", long[].class);
3943
3944 /**
3945 * <p>An array of shifts of OIS samples, in x direction.</p>
3946 * <p>The array contains the amount of shifts in x direction, in pixels, based on OIS samples.
3947 * A positive value is a shift from left to right in active array coordinate system. For
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08003948 * example, if the optical center is (1000, 500) in active array coordinates, a shift of
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003949 * (3, 0) puts the new optical center at (1003, 500).</p>
3950 * <p>The number of shifts must match the number of timestamps in
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08003951 * android.statistics.oisTimestamps.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003952 * <p><b>Units</b>: Pixels in active array.</p>
3953 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08003954 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003955 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003956 public static final Key<float[]> STATISTICS_OIS_X_SHIFTS =
3957 new Key<float[]>("android.statistics.oisXShifts", float[].class);
3958
3959 /**
3960 * <p>An array of shifts of OIS samples, in y direction.</p>
3961 * <p>The array contains the amount of shifts in y direction, in pixels, based on OIS samples.
3962 * A positive value is a shift from top to bottom in active array coordinate system. For
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08003963 * example, if the optical center is (1000, 500) in active array coordinates, a shift of
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003964 * (0, 5) puts the new optical center at (1000, 505).</p>
3965 * <p>The number of shifts must match the number of timestamps in
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08003966 * android.statistics.oisTimestamps.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003967 * <p><b>Units</b>: Pixels in active array.</p>
3968 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08003969 * @hide
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003970 */
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003971 public static final Key<float[]> STATISTICS_OIS_Y_SHIFTS =
3972 new Key<float[]>("android.statistics.oisYShifts", float[].class);
3973
3974 /**
Chien-Yu Chenc804d1c2018-02-15 12:44:19 -08003975 * <p>An array of OIS samples.</p>
3976 * <p>Each OIS sample contains the timestamp and the amount of shifts in x and y direction,
3977 * in pixels, of the OIS sample.</p>
3978 * <p>A positive value for a shift in x direction is a shift from left to right in active array
3979 * coordinate system. For example, if the optical center is (1000, 500) in active array
3980 * coordinates, a shift of (3, 0) puts the new optical center at (1003, 500).</p>
3981 * <p>A positive value for a shift in y direction is a shift from top to bottom in active array
3982 * coordinate system. For example, if the optical center is (1000, 500) in active array
3983 * coordinates, a shift of (0, 5) puts the new optical center at (1000, 505).</p>
3984 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3985 */
3986 @PublicKey
3987 @SyntheticKey
3988 public static final Key<android.hardware.camera2.params.OisSample[]> STATISTICS_OIS_SAMPLES =
3989 new Key<android.hardware.camera2.params.OisSample[]>("android.statistics.oisSamples", android.hardware.camera2.params.OisSample[].class);
3990
3991 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003992 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08003993 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3994 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003995 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003996 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3997 * <p><b>Full capability</b> -
3998 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3999 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004000 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004001 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004002 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004003 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004004 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004005 public static final Key<float[]> TONEMAP_CURVE_BLUE =
4006 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004007
4008 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004009 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08004010 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4011 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004012 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004013 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4014 * <p><b>Full capability</b> -
4015 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4016 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004017 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004018 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004019 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004020 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004021 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004022 public static final Key<float[]> TONEMAP_CURVE_GREEN =
4023 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004024
4025 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004026 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08004027 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4028 * CONTRAST_CURVE.</p>
4029 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004030 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004031 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08004032 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004033 * <p>These are sorted in order of increasing <code>Pin</code>; it is
4034 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08004035 * define a complete mapping. For input values between control points,
4036 * the camera device must linearly interpolate between the control
4037 * points.</p>
4038 * <p>Each curve can have an independent number of points, and the number
4039 * of points can be less than max (that is, the request doesn't have to
4040 * always provide a curve with number of points equivalent to
4041 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
4042 * <p>A few examples, and their corresponding graphical mappings; these
4043 * only specify the red channel and the precision is limited to 4
4044 * digits, for conciseness.</p>
4045 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004046 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004047 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004048 * <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 -08004049 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004050 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004051 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004052 * <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 -08004053 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004054 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004055 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
4056 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
4057 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
4058 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004059 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004060 * <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 -08004061 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004062 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004063 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
4064 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
4065 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
4066 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004067 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004068 * <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 -07004069 * <p><b>Range of valid values:</b><br>
4070 * 0-1 on both input and output coordinates, normalized
4071 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004072 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4073 * <p><b>Full capability</b> -
4074 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4075 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004076 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004077 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08004078 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004079 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004080 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004081 */
4082 public static final Key<float[]> TONEMAP_CURVE_RED =
4083 new Key<float[]>("android.tonemap.curveRed", float[].class);
4084
4085 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004086 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
4087 * is CONTRAST_CURVE.</p>
4088 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
4089 * channels respectively. The following example uses the red channel as an
4090 * example. The same logic applies to green and blue channel.
4091 * Each channel's curve is defined by an array of control points:</p>
4092 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004093 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004094 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
4095 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
4096 * guaranteed that input values 0.0 and 1.0 are included in the list to
4097 * define a complete mapping. For input values between control points,
4098 * the camera device must linearly interpolate between the control
4099 * points.</p>
4100 * <p>Each curve can have an independent number of points, and the number
4101 * of points can be less than max (that is, the request doesn't have to
4102 * always provide a curve with number of points equivalent to
4103 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
4104 * <p>A few examples, and their corresponding graphical mappings; these
4105 * only specify the red channel and the precision is limited to 4
4106 * digits, for conciseness.</p>
4107 * <p>Linear mapping:</p>
4108 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
4109 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004110 * <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 -07004111 * <p>Invert mapping:</p>
4112 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
4113 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004114 * <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 -07004115 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
4116 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004117 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
4118 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
4119 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
4120 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004121 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004122 * <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 -07004123 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
4124 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004125 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
4126 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
4127 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
4128 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004129 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004130 * <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 -07004131 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4132 * <p><b>Full capability</b> -
4133 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4134 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004135 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004136 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004137 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
4138 * @see CaptureRequest#TONEMAP_MODE
4139 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004140 @PublicKey
4141 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004142 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
4143 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
4144
4145 /**
Igor Murashkine0060932014-01-17 17:24:11 -08004146 * <p>High-level global contrast/gamma/tonemapping control.</p>
4147 * <p>When switching to an application-defined contrast curve by setting
4148 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
4149 * per-channel with a set of <code>(in, out)</code> points that specify the
4150 * mapping from input high-bit-depth pixel value to the output
4151 * low-bit-depth value. Since the actual pixel ranges of both input
4152 * and output may change depending on the camera pipeline, the values
4153 * are specified by normalized floating-point numbers.</p>
4154 * <p>More-complex color mapping operations such as 3D color look-up
4155 * tables, selective chroma enhancement, or other non-linear color
4156 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4157 * CONTRAST_CURVE.</p>
4158 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004159 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08004160 * These values are always available, and as close as possible to the
4161 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07004162 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08004163 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
4164 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004165 * <p><b>Possible values:</b>
4166 * <ul>
4167 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
4168 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
4169 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004170 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
4171 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004172 * </ul></p>
4173 * <p><b>Available values for this device:</b><br>
4174 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004175 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4176 * <p><b>Full capability</b> -
4177 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4178 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08004179 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004180 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08004181 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004182 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08004183 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004184 * @see #TONEMAP_MODE_CONTRAST_CURVE
4185 * @see #TONEMAP_MODE_FAST
4186 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004187 * @see #TONEMAP_MODE_GAMMA_VALUE
4188 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004189 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004190 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004191 public static final Key<Integer> TONEMAP_MODE =
4192 new Key<Integer>("android.tonemap.mode", int.class);
4193
4194 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004195 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4196 * GAMMA_VALUE</p>
4197 * <p>The tonemap curve will be defined the following formula:
4198 * * OUT = pow(IN, 1.0 / gamma)
4199 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
4200 * pow is the power function and gamma is the gamma value specified by this
4201 * key.</p>
4202 * <p>The same curve will be applied to all color channels. The camera device
4203 * may clip the input gamma value to its supported range. The actual applied
4204 * value will be returned in capture result.</p>
4205 * <p>The valid range of gamma value varies on different devices, but values
4206 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
4207 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4208 *
4209 * @see CaptureRequest#TONEMAP_MODE
4210 */
4211 @PublicKey
4212 public static final Key<Float> TONEMAP_GAMMA =
4213 new Key<Float>("android.tonemap.gamma", float.class);
4214
4215 /**
4216 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4217 * PRESET_CURVE</p>
4218 * <p>The tonemap curve will be defined by specified standard.</p>
4219 * <p>sRGB (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004220 * <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 -08004221 * <p>Rec. 709 (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004222 * <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 -08004223 * <p>Note that above figures show a 16 control points approximation of preset
4224 * curves. Camera devices may apply a different approximation to the curve.</p>
4225 * <p><b>Possible values:</b>
4226 * <ul>
4227 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
4228 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
4229 * </ul></p>
4230 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4231 *
4232 * @see CaptureRequest#TONEMAP_MODE
4233 * @see #TONEMAP_PRESET_CURVE_SRGB
4234 * @see #TONEMAP_PRESET_CURVE_REC709
4235 */
4236 @PublicKey
4237 public static final Key<Integer> TONEMAP_PRESET_CURVE =
4238 new Key<Integer>("android.tonemap.presetCurve", int.class);
4239
4240 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004241 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004242 * that the camera is powered on and may be streaming images back to the
4243 * Application Processor. In certain rare circumstances, the OS may
4244 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08004245 * any untrusted applications.</p>
4246 * <p>In particular, the LED <em>must</em> always be on when the data could be
4247 * transmitted off the device. The LED <em>should</em> always be on whenever
4248 * data is stored locally on the device.</p>
4249 * <p>The LED <em>may</em> be off if a trusted application is using the data that
4250 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004251 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004252 * @hide
4253 */
4254 public static final Key<Boolean> LED_TRANSMIT =
4255 new Key<Boolean>("android.led.transmit", boolean.class);
4256
4257 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004258 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08004259 * to its current values, or is free to vary.</p>
4260 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004261 * 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 -08004262 * a change in other capture settings forced the camera device to
4263 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004264 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4265 * <p><b>Full capability</b> -
4266 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4267 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004268 *
4269 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004270 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004271 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004272 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004273 public static final Key<Boolean> BLACK_LEVEL_LOCK =
4274 new Key<Boolean>("android.blackLevel.lock", boolean.class);
4275
Igor Murashkin3865a842014-01-17 18:18:39 -08004276 /**
4277 * <p>The frame number corresponding to the last request
4278 * with which the output result (metadata + buffers) has been fully
4279 * synchronized.</p>
4280 * <p>When a request is submitted to the camera device, there is usually a
4281 * delay of several frames before the controls get applied. A camera
4282 * device may either choose to account for this delay by implementing a
4283 * pipeline and carefully submit well-timed atomic control updates, or
4284 * it may start streaming control changes that span over several frame
4285 * boundaries.</p>
4286 * <p>In the latter case, whenever a request's settings change relative to
4287 * the previous submitted request, the full set of changes may take
4288 * multiple frame durations to fully take effect. Some settings may
4289 * take effect sooner (in less frame durations) than others.</p>
4290 * <p>While a set of control changes are being propagated, this value
4291 * will be CONVERGING.</p>
4292 * <p>Once it is fully known that a set of control changes have been
4293 * finished propagating, and the resulting updated control settings
4294 * have been read back by the camera device, this value will be set
4295 * to a non-negative frame number (corresponding to the request to
4296 * which the results have synchronized to).</p>
4297 * <p>Older camera device implementations may not have a way to detect
4298 * when all camera controls have been applied, and will always set this
4299 * value to UNKNOWN.</p>
4300 * <p>FULL capability devices will always have this value set to the
4301 * frame number of the request corresponding to this result.</p>
4302 * <p><em>Further details</em>:</p>
4303 * <ul>
4304 * <li>Whenever a request differs from the last request, any future
4305 * results not yet returned may have this value set to CONVERGING (this
4306 * could include any in-progress captures not yet returned by the camera
4307 * device, for more details see pipeline considerations below).</li>
4308 * <li>Submitting a series of multiple requests that differ from the
4309 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
4310 * moves the new synchronization frame to the last non-repeating
4311 * request (using the smallest frame number from the contiguous list of
4312 * repeating requests).</li>
4313 * <li>Submitting the same request repeatedly will not change this value
4314 * to CONVERGING, if it was already a non-negative value.</li>
4315 * <li>When this value changes to non-negative, that means that all of the
4316 * metadata controls from the request have been applied, all of the
4317 * metadata controls from the camera device have been read to the
4318 * updated values (into the result), and all of the graphics buffers
4319 * corresponding to this result are also synchronized to the request.</li>
4320 * </ul>
4321 * <p><em>Pipeline considerations</em>:</p>
4322 * <p>Submitting a request with updated controls relative to the previously
4323 * submitted requests may also invalidate the synchronization state
4324 * of all the results corresponding to currently in-flight requests.</p>
4325 * <p>In other words, results for this current request and up to
4326 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
4327 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004328 * <p><b>Possible values:</b>
4329 * <ul>
4330 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
4331 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
4332 * </ul></p>
4333 * <p><b>Available values for this device:</b><br>
4334 * Either a non-negative value corresponding to a
4335 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004336 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08004337 *
4338 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
4339 * @see #SYNC_FRAME_NUMBER_CONVERGING
4340 * @see #SYNC_FRAME_NUMBER_UNKNOWN
4341 * @hide
4342 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07004343 public static final Key<Long> SYNC_FRAME_NUMBER =
4344 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08004345
Zhijun He0e99c222015-01-29 15:26:05 -08004346 /**
4347 * <p>The amount of exposure time increase factor applied to the original output
4348 * frame by the application processing before sending for reprocessing.</p>
4349 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
4350 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
4351 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
4352 * output frames to effectively reduce the noise to the same level as a frame that was
4353 * captured with longer exposure time. To be more specific, assuming the original captured
4354 * images were captured with a sensitivity of S and an exposure time of T, the model in
4355 * the camera device is that the amount of noise in the image would be approximately what
4356 * would be expected if the original capture parameters had been a sensitivity of
4357 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
4358 * than S and T respectively. If the captured images were processed by the application
4359 * before being sent for reprocessing, then the application may have used image processing
4360 * algorithms and/or multi-frame image fusion to reduce the noise in the
4361 * application-processed images (input images). By using the effectiveExposureFactor
4362 * control, the application can communicate to the camera device the actual noise level
4363 * improvement in the application-processed image. With this information, the camera
4364 * device can select appropriate noise reduction and edge enhancement parameters to avoid
4365 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
4366 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
4367 * <p>For example, for multi-frame image fusion use case, the application may fuse
4368 * multiple output frames together to a final frame for reprocessing. When N image are
4369 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
4370 * square root of N (based on a simple photon shot noise model). The camera device will
4371 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
4372 * produce the best quality images.</p>
4373 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
4374 * buffer in a way that affects its effective exposure time.</p>
4375 * <p>This control is only effective for YUV reprocessing capture request. For noise
4376 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
4377 * Similarly, for edge enhancement reprocessing, it is only effective when
4378 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
4379 * <p><b>Units</b>: Relative exposure time increase factor.</p>
4380 * <p><b>Range of valid values:</b><br>
4381 * &gt;= 1.0</p>
4382 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07004383 * <p><b>Limited capability</b> -
4384 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4385 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0e99c222015-01-29 15:26:05 -08004386 *
4387 * @see CaptureRequest#EDGE_MODE
Zhijun He513f7c32015-04-24 18:23:54 -07004388 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08004389 * @see CaptureRequest#NOISE_REDUCTION_MODE
4390 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
4391 */
4392 @PublicKey
4393 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
4394 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
4395
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004396 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
4397 * End generated code
4398 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07004399
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004400
4401
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08004402}