blob: cac89cf805d9baeb322541cbfb1aedaffc5a8c17 [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
1004 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}), aeState must be FLASH_REQUIRED after the camera device
1005 * 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
1084 * @see CaptureRequest#CONTROL_MODE
1085 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001086 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001087 * @see #CONTROL_AE_STATE_INACTIVE
1088 * @see #CONTROL_AE_STATE_SEARCHING
1089 * @see #CONTROL_AE_STATE_CONVERGED
1090 * @see #CONTROL_AE_STATE_LOCKED
1091 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
1092 * @see #CONTROL_AE_STATE_PRECAPTURE
1093 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001094 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001095 public static final Key<Integer> CONTROL_AE_STATE =
1096 new Key<Integer>("android.control.aeState", int.class);
1097
1098 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001099 * <p>Whether auto-focus (AF) is currently enabled, and what
1100 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001101 * <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 -08001102 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1103 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1104 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1105 * 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 -08001106 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001107 * 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 -07001108 * in result metadata.</p>
1109 * <p><b>Possible values:</b>
1110 * <ul>
1111 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1112 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1113 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1114 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1115 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1116 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1117 * </ul></p>
1118 * <p><b>Available values for this device:</b><br>
1119 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1120 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001121 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001122 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001123 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001124 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001125 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001126 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001127 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001128 * @see #CONTROL_AF_MODE_OFF
1129 * @see #CONTROL_AF_MODE_AUTO
1130 * @see #CONTROL_AF_MODE_MACRO
1131 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1132 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1133 * @see #CONTROL_AF_MODE_EDOF
1134 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001135 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001136 public static final Key<Integer> CONTROL_AF_MODE =
1137 new Key<Integer>("android.control.afMode", int.class);
1138
1139 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001140 * <p>List of metering areas to use for auto-focus.</p>
1141 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001142 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001143 * <p>The maximum number of focus areas supported by the device is determined by the value
1144 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001145 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001146 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001147 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1148 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001149 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001150 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001151 * for every pixel in the area. This means that a large metering area
1152 * with the same weight as a smaller area will have more effect in
1153 * the metering result. Metering areas can partially overlap and the
1154 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001155 * <p>The weights are relative to weights of other metering regions, so if only one region
1156 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1157 * ignored.</p>
1158 * <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 -08001159 * camera device. The capture result will either be a zero weight region as well, or
1160 * the region selected by the camera device as the focus area of interest.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001161 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1162 * capture result metadata, the camera device will ignore the sections outside the crop
1163 * region and output only the intersection rectangle as the metering region in the result
1164 * metadata. If the region is entirely outside the crop region, it will be ignored and
1165 * not reported in the result metadata.</p>
1166 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1167 * <p><b>Range of valid values:</b><br>
1168 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1169 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001170 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001171 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001172 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001173 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001174 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001175 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001176 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001177 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1178 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001179
1180 /**
Zhijun He379af012014-05-06 11:54:54 -07001181 * <p>Whether the camera device will trigger autofocus for this request.</p>
1182 * <p>This entry is normally set to IDLE, or is not
1183 * included at all in the request settings.</p>
1184 * <p>When included and set to START, the camera device will trigger the
1185 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1186 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1187 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001188 * <p>Generally, applications should set this entry to START or CANCEL for only a
1189 * single capture, and then return it to IDLE (or not set at all). Specifying
1190 * START for multiple captures in a row means restarting the AF operation over
1191 * and over again.</p>
1192 * <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 -07001193 * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
1194 * simultaneously is allowed. However, since these triggers often require cooperation between
1195 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1196 * focus sweep), the camera device may delay acting on a later trigger until the previous
1197 * trigger has been fully handled. This may lead to longer intervals between the trigger and
1198 * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001199 * <p><b>Possible values:</b>
1200 * <ul>
1201 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1202 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1203 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1204 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001205 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001206 *
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001207 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Zhijun He379af012014-05-06 11:54:54 -07001208 * @see CaptureResult#CONTROL_AF_STATE
1209 * @see #CONTROL_AF_TRIGGER_IDLE
1210 * @see #CONTROL_AF_TRIGGER_START
1211 * @see #CONTROL_AF_TRIGGER_CANCEL
1212 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001213 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001214 public static final Key<Integer> CONTROL_AF_TRIGGER =
1215 new Key<Integer>("android.control.afTrigger", int.class);
1216
1217 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001218 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001219 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1220 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1221 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1222 * the algorithm states to INACTIVE.</p>
1223 * <p>The camera device can do several state transitions between two results, if it is
1224 * allowed by the state transition table. For example: INACTIVE may never actually be
1225 * seen in a result.</p>
1226 * <p>The state in the result is the state for this image (in sync with this image): if
1227 * AF state becomes FOCUSED, then the image data associated with this result should
1228 * be sharp.</p>
1229 * <p>Below are state transition tables for different AF modes.</p>
1230 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1231 * <table>
1232 * <thead>
1233 * <tr>
1234 * <th align="center">State</th>
1235 * <th align="center">Transition Cause</th>
1236 * <th align="center">New State</th>
1237 * <th align="center">Notes</th>
1238 * </tr>
1239 * </thead>
1240 * <tbody>
1241 * <tr>
1242 * <td align="center">INACTIVE</td>
1243 * <td align="center"></td>
1244 * <td align="center">INACTIVE</td>
1245 * <td align="center">Never changes</td>
1246 * </tr>
1247 * </tbody>
1248 * </table>
1249 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1250 * <table>
1251 * <thead>
1252 * <tr>
1253 * <th align="center">State</th>
1254 * <th align="center">Transition Cause</th>
1255 * <th align="center">New State</th>
1256 * <th align="center">Notes</th>
1257 * </tr>
1258 * </thead>
1259 * <tbody>
1260 * <tr>
1261 * <td align="center">INACTIVE</td>
1262 * <td align="center">AF_TRIGGER</td>
1263 * <td align="center">ACTIVE_SCAN</td>
1264 * <td align="center">Start AF sweep, Lens now moving</td>
1265 * </tr>
1266 * <tr>
1267 * <td align="center">ACTIVE_SCAN</td>
1268 * <td align="center">AF sweep done</td>
1269 * <td align="center">FOCUSED_LOCKED</td>
1270 * <td align="center">Focused, Lens now locked</td>
1271 * </tr>
1272 * <tr>
1273 * <td align="center">ACTIVE_SCAN</td>
1274 * <td align="center">AF sweep done</td>
1275 * <td align="center">NOT_FOCUSED_LOCKED</td>
1276 * <td align="center">Not focused, Lens now locked</td>
1277 * </tr>
1278 * <tr>
1279 * <td align="center">ACTIVE_SCAN</td>
1280 * <td align="center">AF_CANCEL</td>
1281 * <td align="center">INACTIVE</td>
1282 * <td align="center">Cancel/reset AF, Lens now locked</td>
1283 * </tr>
1284 * <tr>
1285 * <td align="center">FOCUSED_LOCKED</td>
1286 * <td align="center">AF_CANCEL</td>
1287 * <td align="center">INACTIVE</td>
1288 * <td align="center">Cancel/reset AF</td>
1289 * </tr>
1290 * <tr>
1291 * <td align="center">FOCUSED_LOCKED</td>
1292 * <td align="center">AF_TRIGGER</td>
1293 * <td align="center">ACTIVE_SCAN</td>
1294 * <td align="center">Start new sweep, Lens now moving</td>
1295 * </tr>
1296 * <tr>
1297 * <td align="center">NOT_FOCUSED_LOCKED</td>
1298 * <td align="center">AF_CANCEL</td>
1299 * <td align="center">INACTIVE</td>
1300 * <td align="center">Cancel/reset AF</td>
1301 * </tr>
1302 * <tr>
1303 * <td align="center">NOT_FOCUSED_LOCKED</td>
1304 * <td align="center">AF_TRIGGER</td>
1305 * <td align="center">ACTIVE_SCAN</td>
1306 * <td align="center">Start new sweep, Lens now moving</td>
1307 * </tr>
1308 * <tr>
1309 * <td align="center">Any state</td>
1310 * <td align="center">Mode change</td>
1311 * <td align="center">INACTIVE</td>
1312 * <td align="center"></td>
1313 * </tr>
1314 * </tbody>
1315 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001316 * <p>For the above table, the camera device may skip reporting any state changes that happen
1317 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1318 * can be skipped in that manner is called a transient state.</p>
1319 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1320 * state transitions listed in above table, it is also legal for the camera device to skip
1321 * one or more transient states between two results. See below table for examples:</p>
1322 * <table>
1323 * <thead>
1324 * <tr>
1325 * <th align="center">State</th>
1326 * <th align="center">Transition Cause</th>
1327 * <th align="center">New State</th>
1328 * <th align="center">Notes</th>
1329 * </tr>
1330 * </thead>
1331 * <tbody>
1332 * <tr>
1333 * <td align="center">INACTIVE</td>
1334 * <td align="center">AF_TRIGGER</td>
1335 * <td align="center">FOCUSED_LOCKED</td>
1336 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1337 * </tr>
1338 * <tr>
1339 * <td align="center">INACTIVE</td>
1340 * <td align="center">AF_TRIGGER</td>
1341 * <td align="center">NOT_FOCUSED_LOCKED</td>
1342 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1343 * </tr>
1344 * <tr>
1345 * <td align="center">FOCUSED_LOCKED</td>
1346 * <td align="center">AF_TRIGGER</td>
1347 * <td align="center">FOCUSED_LOCKED</td>
1348 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1349 * </tr>
1350 * <tr>
1351 * <td align="center">NOT_FOCUSED_LOCKED</td>
1352 * <td align="center">AF_TRIGGER</td>
1353 * <td align="center">FOCUSED_LOCKED</td>
1354 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1355 * </tr>
1356 * </tbody>
1357 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001358 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1359 * <table>
1360 * <thead>
1361 * <tr>
1362 * <th align="center">State</th>
1363 * <th align="center">Transition Cause</th>
1364 * <th align="center">New State</th>
1365 * <th align="center">Notes</th>
1366 * </tr>
1367 * </thead>
1368 * <tbody>
1369 * <tr>
1370 * <td align="center">INACTIVE</td>
1371 * <td align="center">Camera device initiates new scan</td>
1372 * <td align="center">PASSIVE_SCAN</td>
1373 * <td align="center">Start AF scan, Lens now moving</td>
1374 * </tr>
1375 * <tr>
1376 * <td align="center">INACTIVE</td>
1377 * <td align="center">AF_TRIGGER</td>
1378 * <td align="center">NOT_FOCUSED_LOCKED</td>
1379 * <td align="center">AF state query, Lens now locked</td>
1380 * </tr>
1381 * <tr>
1382 * <td align="center">PASSIVE_SCAN</td>
1383 * <td align="center">Camera device completes current scan</td>
1384 * <td align="center">PASSIVE_FOCUSED</td>
1385 * <td align="center">End AF scan, Lens now locked</td>
1386 * </tr>
1387 * <tr>
1388 * <td align="center">PASSIVE_SCAN</td>
1389 * <td align="center">Camera device fails current scan</td>
1390 * <td align="center">PASSIVE_UNFOCUSED</td>
1391 * <td align="center">End AF scan, Lens now locked</td>
1392 * </tr>
1393 * <tr>
1394 * <td align="center">PASSIVE_SCAN</td>
1395 * <td align="center">AF_TRIGGER</td>
1396 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001397 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001398 * </tr>
1399 * <tr>
1400 * <td align="center">PASSIVE_SCAN</td>
1401 * <td align="center">AF_TRIGGER</td>
1402 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001403 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001404 * </tr>
1405 * <tr>
1406 * <td align="center">PASSIVE_SCAN</td>
1407 * <td align="center">AF_CANCEL</td>
1408 * <td align="center">INACTIVE</td>
1409 * <td align="center">Reset lens position, Lens now locked</td>
1410 * </tr>
1411 * <tr>
1412 * <td align="center">PASSIVE_FOCUSED</td>
1413 * <td align="center">Camera device initiates new scan</td>
1414 * <td align="center">PASSIVE_SCAN</td>
1415 * <td align="center">Start AF scan, Lens now moving</td>
1416 * </tr>
1417 * <tr>
1418 * <td align="center">PASSIVE_UNFOCUSED</td>
1419 * <td align="center">Camera device initiates new scan</td>
1420 * <td align="center">PASSIVE_SCAN</td>
1421 * <td align="center">Start AF scan, Lens now moving</td>
1422 * </tr>
1423 * <tr>
1424 * <td align="center">PASSIVE_FOCUSED</td>
1425 * <td align="center">AF_TRIGGER</td>
1426 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001427 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001428 * </tr>
1429 * <tr>
1430 * <td align="center">PASSIVE_UNFOCUSED</td>
1431 * <td align="center">AF_TRIGGER</td>
1432 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001433 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001434 * </tr>
1435 * <tr>
1436 * <td align="center">FOCUSED_LOCKED</td>
1437 * <td align="center">AF_TRIGGER</td>
1438 * <td align="center">FOCUSED_LOCKED</td>
1439 * <td align="center">No effect</td>
1440 * </tr>
1441 * <tr>
1442 * <td align="center">FOCUSED_LOCKED</td>
1443 * <td align="center">AF_CANCEL</td>
1444 * <td align="center">INACTIVE</td>
1445 * <td align="center">Restart AF scan</td>
1446 * </tr>
1447 * <tr>
1448 * <td align="center">NOT_FOCUSED_LOCKED</td>
1449 * <td align="center">AF_TRIGGER</td>
1450 * <td align="center">NOT_FOCUSED_LOCKED</td>
1451 * <td align="center">No effect</td>
1452 * </tr>
1453 * <tr>
1454 * <td align="center">NOT_FOCUSED_LOCKED</td>
1455 * <td align="center">AF_CANCEL</td>
1456 * <td align="center">INACTIVE</td>
1457 * <td align="center">Restart AF scan</td>
1458 * </tr>
1459 * </tbody>
1460 * </table>
1461 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1462 * <table>
1463 * <thead>
1464 * <tr>
1465 * <th align="center">State</th>
1466 * <th align="center">Transition Cause</th>
1467 * <th align="center">New State</th>
1468 * <th align="center">Notes</th>
1469 * </tr>
1470 * </thead>
1471 * <tbody>
1472 * <tr>
1473 * <td align="center">INACTIVE</td>
1474 * <td align="center">Camera device initiates new scan</td>
1475 * <td align="center">PASSIVE_SCAN</td>
1476 * <td align="center">Start AF scan, Lens now moving</td>
1477 * </tr>
1478 * <tr>
1479 * <td align="center">INACTIVE</td>
1480 * <td align="center">AF_TRIGGER</td>
1481 * <td align="center">NOT_FOCUSED_LOCKED</td>
1482 * <td align="center">AF state query, Lens now locked</td>
1483 * </tr>
1484 * <tr>
1485 * <td align="center">PASSIVE_SCAN</td>
1486 * <td align="center">Camera device completes current scan</td>
1487 * <td align="center">PASSIVE_FOCUSED</td>
1488 * <td align="center">End AF scan, Lens now locked</td>
1489 * </tr>
1490 * <tr>
1491 * <td align="center">PASSIVE_SCAN</td>
1492 * <td align="center">Camera device fails current scan</td>
1493 * <td align="center">PASSIVE_UNFOCUSED</td>
1494 * <td align="center">End AF scan, Lens now locked</td>
1495 * </tr>
1496 * <tr>
1497 * <td align="center">PASSIVE_SCAN</td>
1498 * <td align="center">AF_TRIGGER</td>
1499 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001500 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001501 * </tr>
1502 * <tr>
1503 * <td align="center">PASSIVE_SCAN</td>
1504 * <td align="center">AF_TRIGGER</td>
1505 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001506 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001507 * </tr>
1508 * <tr>
1509 * <td align="center">PASSIVE_SCAN</td>
1510 * <td align="center">AF_CANCEL</td>
1511 * <td align="center">INACTIVE</td>
1512 * <td align="center">Reset lens position, Lens now locked</td>
1513 * </tr>
1514 * <tr>
1515 * <td align="center">PASSIVE_FOCUSED</td>
1516 * <td align="center">Camera device initiates new scan</td>
1517 * <td align="center">PASSIVE_SCAN</td>
1518 * <td align="center">Start AF scan, Lens now moving</td>
1519 * </tr>
1520 * <tr>
1521 * <td align="center">PASSIVE_UNFOCUSED</td>
1522 * <td align="center">Camera device initiates new scan</td>
1523 * <td align="center">PASSIVE_SCAN</td>
1524 * <td align="center">Start AF scan, Lens now moving</td>
1525 * </tr>
1526 * <tr>
1527 * <td align="center">PASSIVE_FOCUSED</td>
1528 * <td align="center">AF_TRIGGER</td>
1529 * <td align="center">FOCUSED_LOCKED</td>
1530 * <td align="center">Immediate trans. Lens now locked</td>
1531 * </tr>
1532 * <tr>
1533 * <td align="center">PASSIVE_UNFOCUSED</td>
1534 * <td align="center">AF_TRIGGER</td>
1535 * <td align="center">NOT_FOCUSED_LOCKED</td>
1536 * <td align="center">Immediate trans. Lens now locked</td>
1537 * </tr>
1538 * <tr>
1539 * <td align="center">FOCUSED_LOCKED</td>
1540 * <td align="center">AF_TRIGGER</td>
1541 * <td align="center">FOCUSED_LOCKED</td>
1542 * <td align="center">No effect</td>
1543 * </tr>
1544 * <tr>
1545 * <td align="center">FOCUSED_LOCKED</td>
1546 * <td align="center">AF_CANCEL</td>
1547 * <td align="center">INACTIVE</td>
1548 * <td align="center">Restart AF scan</td>
1549 * </tr>
1550 * <tr>
1551 * <td align="center">NOT_FOCUSED_LOCKED</td>
1552 * <td align="center">AF_TRIGGER</td>
1553 * <td align="center">NOT_FOCUSED_LOCKED</td>
1554 * <td align="center">No effect</td>
1555 * </tr>
1556 * <tr>
1557 * <td align="center">NOT_FOCUSED_LOCKED</td>
1558 * <td align="center">AF_CANCEL</td>
1559 * <td align="center">INACTIVE</td>
1560 * <td align="center">Restart AF scan</td>
1561 * </tr>
1562 * </tbody>
1563 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001564 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1565 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1566 * camera device. When a trigger is included in a mode switch request, the trigger
1567 * will be evaluated in the context of the new mode in the request.
1568 * See below table for examples:</p>
1569 * <table>
1570 * <thead>
1571 * <tr>
1572 * <th align="center">State</th>
1573 * <th align="center">Transition Cause</th>
1574 * <th align="center">New State</th>
1575 * <th align="center">Notes</th>
1576 * </tr>
1577 * </thead>
1578 * <tbody>
1579 * <tr>
1580 * <td align="center">any state</td>
1581 * <td align="center">CAF--&gt;AUTO mode switch</td>
1582 * <td align="center">INACTIVE</td>
1583 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1584 * </tr>
1585 * <tr>
1586 * <td align="center">any state</td>
1587 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1588 * <td align="center">trigger-reachable states from INACTIVE</td>
1589 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1590 * </tr>
1591 * <tr>
1592 * <td align="center">any state</td>
1593 * <td align="center">AUTO--&gt;CAF mode switch</td>
1594 * <td align="center">passively reachable states from INACTIVE</td>
1595 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1596 * </tr>
1597 * </tbody>
1598 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001599 * <p><b>Possible values:</b>
1600 * <ul>
1601 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1602 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1603 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1604 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1605 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1606 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1607 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1608 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001609 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001610 *
1611 * @see CaptureRequest#CONTROL_AF_MODE
1612 * @see CaptureRequest#CONTROL_MODE
1613 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001614 * @see #CONTROL_AF_STATE_INACTIVE
1615 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1616 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1617 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1618 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1619 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001620 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001621 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001622 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001623 public static final Key<Integer> CONTROL_AF_STATE =
1624 new Key<Integer>("android.control.afState", int.class);
1625
1626 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001627 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001628 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001629 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1630 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1631 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1632 * get locked do not necessarily correspond to the settings that were present in the
1633 * latest capture result received from the camera device, since additional captures
1634 * and AWB updates may have occurred even before the result was sent out. If an
1635 * application is switching between automatic and manual control and wishes to eliminate
1636 * any flicker during the switch, the following procedure is recommended:</p>
1637 * <ol>
1638 * <li>Starting in auto-AWB mode:</li>
1639 * <li>Lock AWB</li>
1640 * <li>Wait for the first result to be output that has the AWB locked</li>
1641 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1642 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1643 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001644 * <p>Note that AWB lock is only meaningful when
1645 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1646 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001647 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1648 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001649 *
1650 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001651 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001652 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001653 public static final Key<Boolean> CONTROL_AWB_LOCK =
1654 new Key<Boolean>("android.control.awbLock", boolean.class);
1655
1656 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001657 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001658 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001659 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001660 * <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 -07001661 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001662 * routine is enabled, overriding the application's selected
1663 * {@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 -08001664 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1665 * is OFF, the behavior of AWB is device dependent. It is recommened to
1666 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1667 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001668 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001669 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001670 * 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 -08001671 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001672 * <p>When set to any other modes, the camera device's auto-white
1673 * balance routine is disabled. The camera device uses each
1674 * particular illumination target for white balance
1675 * adjustment. The application's values for
1676 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1677 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1678 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001679 * <p><b>Possible values:</b>
1680 * <ul>
1681 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1682 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1683 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1684 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1685 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1686 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1687 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1688 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1689 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1690 * </ul></p>
1691 * <p><b>Available values for this device:</b><br>
1692 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001693 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001694 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001695 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001696 * @see CaptureRequest#COLOR_CORRECTION_MODE
1697 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001698 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001699 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001700 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001701 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001702 * @see #CONTROL_AWB_MODE_OFF
1703 * @see #CONTROL_AWB_MODE_AUTO
1704 * @see #CONTROL_AWB_MODE_INCANDESCENT
1705 * @see #CONTROL_AWB_MODE_FLUORESCENT
1706 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1707 * @see #CONTROL_AWB_MODE_DAYLIGHT
1708 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1709 * @see #CONTROL_AWB_MODE_TWILIGHT
1710 * @see #CONTROL_AWB_MODE_SHADE
1711 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001712 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001713 public static final Key<Integer> CONTROL_AWB_MODE =
1714 new Key<Integer>("android.control.awbMode", int.class);
1715
1716 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001717 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001718 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001719 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001720 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001721 * <p>The maximum number of regions supported by the device is determined by the value
1722 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001723 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001724 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001725 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1726 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001727 * bottom-right pixel in the active pixel array.</p>
1728 * <p>The weight must range from 0 to 1000, and represents a weight
1729 * for every pixel in the area. This means that a large metering area
1730 * with the same weight as a smaller area will have more effect in
1731 * the metering result. Metering areas can partially overlap and the
1732 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001733 * <p>The weights are relative to weights of other white balance metering regions, so if
1734 * only one region is used, all non-zero weights will have the same effect. A region with
1735 * 0 weight is ignored.</p>
1736 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1737 * camera device.</p>
1738 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1739 * capture result metadata, the camera device will ignore the sections outside the crop
1740 * region and output only the intersection rectangle as the metering region in the result
1741 * metadata. If the region is entirely outside the crop region, it will be ignored and
1742 * not reported in the result metadata.</p>
1743 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1744 * <p><b>Range of valid values:</b><br>
1745 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1746 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001747 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001748 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001749 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001750 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001751 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001752 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001753 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001754 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1755 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001756
1757 /**
Zhijun He379af012014-05-06 11:54:54 -07001758 * <p>Information to the camera device 3A (auto-exposure,
1759 * auto-focus, auto-white balance) routines about the purpose
1760 * of this capture, to help the camera device to decide optimal 3A
1761 * strategy.</p>
1762 * <p>This control (except for MANUAL) is only effective if
1763 * <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 -08001764 * <p>All intents are supported by all devices, except that:
1765 * * ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1766 * PRIVATE_REPROCESSING or YUV_REPROCESSING.
1767 * * MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1768 * MANUAL_SENSOR.
1769 * * MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1770 * MOTION_TRACKING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001771 * <p><b>Possible values:</b>
1772 * <ul>
1773 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1774 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1775 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1776 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1777 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1778 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1779 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001780 * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001781 * </ul></p>
1782 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001783 *
1784 * @see CaptureRequest#CONTROL_MODE
1785 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1786 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1787 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1788 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1789 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1790 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1791 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1792 * @see #CONTROL_CAPTURE_INTENT_MANUAL
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001793 * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING
Zhijun He379af012014-05-06 11:54:54 -07001794 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001795 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001796 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1797 new Key<Integer>("android.control.captureIntent", int.class);
1798
1799 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001800 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001801 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1802 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1803 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1804 * the algorithm states to INACTIVE.</p>
1805 * <p>The camera device can do several state transitions between two results, if it is
1806 * allowed by the state transition table. So INACTIVE may never actually be seen in
1807 * a result.</p>
1808 * <p>The state in the result is the state for this image (in sync with this image): if
1809 * AWB state becomes CONVERGED, then the image data associated with this result should
1810 * be good to use.</p>
1811 * <p>Below are state transition tables for different AWB modes.</p>
1812 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1813 * <table>
1814 * <thead>
1815 * <tr>
1816 * <th align="center">State</th>
1817 * <th align="center">Transition Cause</th>
1818 * <th align="center">New State</th>
1819 * <th align="center">Notes</th>
1820 * </tr>
1821 * </thead>
1822 * <tbody>
1823 * <tr>
1824 * <td align="center">INACTIVE</td>
1825 * <td align="center"></td>
1826 * <td align="center">INACTIVE</td>
1827 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1828 * </tr>
1829 * </tbody>
1830 * </table>
1831 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1832 * <table>
1833 * <thead>
1834 * <tr>
1835 * <th align="center">State</th>
1836 * <th align="center">Transition Cause</th>
1837 * <th align="center">New State</th>
1838 * <th align="center">Notes</th>
1839 * </tr>
1840 * </thead>
1841 * <tbody>
1842 * <tr>
1843 * <td align="center">INACTIVE</td>
1844 * <td align="center">Camera device initiates AWB scan</td>
1845 * <td align="center">SEARCHING</td>
1846 * <td align="center">Values changing</td>
1847 * </tr>
1848 * <tr>
1849 * <td align="center">INACTIVE</td>
1850 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1851 * <td align="center">LOCKED</td>
1852 * <td align="center">Values locked</td>
1853 * </tr>
1854 * <tr>
1855 * <td align="center">SEARCHING</td>
1856 * <td align="center">Camera device finishes AWB scan</td>
1857 * <td align="center">CONVERGED</td>
1858 * <td align="center">Good values, not changing</td>
1859 * </tr>
1860 * <tr>
1861 * <td align="center">SEARCHING</td>
1862 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1863 * <td align="center">LOCKED</td>
1864 * <td align="center">Values locked</td>
1865 * </tr>
1866 * <tr>
1867 * <td align="center">CONVERGED</td>
1868 * <td align="center">Camera device initiates AWB scan</td>
1869 * <td align="center">SEARCHING</td>
1870 * <td align="center">Values changing</td>
1871 * </tr>
1872 * <tr>
1873 * <td align="center">CONVERGED</td>
1874 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1875 * <td align="center">LOCKED</td>
1876 * <td align="center">Values locked</td>
1877 * </tr>
1878 * <tr>
1879 * <td align="center">LOCKED</td>
1880 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1881 * <td align="center">SEARCHING</td>
1882 * <td align="center">Values not good after unlock</td>
1883 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001884 * </tbody>
1885 * </table>
1886 * <p>For the above table, the camera device may skip reporting any state changes that happen
1887 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1888 * can be skipped in that manner is called a transient state.</p>
1889 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1890 * listed in above table, it is also legal for the camera device to skip one or more
1891 * transient states between two results. See below table for examples:</p>
1892 * <table>
1893 * <thead>
1894 * <tr>
1895 * <th align="center">State</th>
1896 * <th align="center">Transition Cause</th>
1897 * <th align="center">New State</th>
1898 * <th align="center">Notes</th>
1899 * </tr>
1900 * </thead>
1901 * <tbody>
1902 * <tr>
1903 * <td align="center">INACTIVE</td>
1904 * <td align="center">Camera device finished AWB scan</td>
1905 * <td align="center">CONVERGED</td>
1906 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1907 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001908 * <tr>
1909 * <td align="center">LOCKED</td>
1910 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1911 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001912 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001913 * </tr>
1914 * </tbody>
1915 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001916 * <p><b>Possible values:</b>
1917 * <ul>
1918 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1919 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1920 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1921 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1922 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001923 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1924 * <p><b>Limited capability</b> -
1925 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1926 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001927 *
1928 * @see CaptureRequest#CONTROL_AWB_LOCK
1929 * @see CaptureRequest#CONTROL_AWB_MODE
1930 * @see CaptureRequest#CONTROL_MODE
1931 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001932 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001933 * @see #CONTROL_AWB_STATE_INACTIVE
1934 * @see #CONTROL_AWB_STATE_SEARCHING
1935 * @see #CONTROL_AWB_STATE_CONVERGED
1936 * @see #CONTROL_AWB_STATE_LOCKED
1937 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001938 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001939 public static final Key<Integer> CONTROL_AWB_STATE =
1940 new Key<Integer>("android.control.awbState", int.class);
1941
1942 /**
Zhijun He379af012014-05-06 11:54:54 -07001943 * <p>A special color effect to apply.</p>
1944 * <p>When this mode is set, a color effect will be applied
1945 * to images produced by the camera device. The interpretation
1946 * and implementation of these color effects is left to the
1947 * implementor of the camera device, and should not be
1948 * depended on to be consistent (or present) across all
1949 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001950 * <p><b>Possible values:</b>
1951 * <ul>
1952 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1953 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1954 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1955 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1956 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1957 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1958 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1959 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1960 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1961 * </ul></p>
1962 * <p><b>Available values for this device:</b><br>
1963 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001964 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001965 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001966 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07001967 * @see #CONTROL_EFFECT_MODE_OFF
1968 * @see #CONTROL_EFFECT_MODE_MONO
1969 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1970 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1971 * @see #CONTROL_EFFECT_MODE_SEPIA
1972 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1973 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1974 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1975 * @see #CONTROL_EFFECT_MODE_AQUA
1976 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001977 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001978 public static final Key<Integer> CONTROL_EFFECT_MODE =
1979 new Key<Integer>("android.control.effectMode", int.class);
1980
1981 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001982 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001983 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001984 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001985 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001986 * capture parameters itself.</p>
1987 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001988 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001989 * <p>When set to USE_SCENE_MODE, the individual controls in
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001990 * android.control.* are mostly disabled, and the camera device
1991 * implements one of the scene mode settings (such as ACTION,
1992 * SUNSET, or PARTY) as it wishes. The camera device scene mode
1993 * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001994 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1995 * is that this frame will not be used by camera device background 3A statistics
1996 * update, as if this frame is never captured. This mode can be used in the scenario
1997 * where the application doesn't want a 3A manual control capture to affect
1998 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001999 * <p><b>Possible values:</b>
2000 * <ul>
2001 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
2002 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
2003 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
2004 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
2005 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002006 * <p><b>Available values for this device:</b><br>
2007 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002008 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002009 *
2010 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08002011 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002012 * @see #CONTROL_MODE_OFF
2013 * @see #CONTROL_MODE_AUTO
2014 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08002015 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002016 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002017 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002018 public static final Key<Integer> CONTROL_MODE =
2019 new Key<Integer>("android.control.mode", int.class);
2020
2021 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002022 * <p>Control for which scene mode is currently active.</p>
2023 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
2024 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07002025 * <p>This is the mode that that is active when
Zhijun Heee2ebde2015-06-16 19:58:11 -07002026 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
2027 * 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}
2028 * while in use.</p>
Zhijun He379af012014-05-06 11:54:54 -07002029 * <p>The interpretation and implementation of these scene modes is left
2030 * to the implementor of the camera device. Their behavior will not be
2031 * consistent across all devices, and any given device may only implement
2032 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002033 * <p><b>Possible values:</b>
2034 * <ul>
2035 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
2036 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
2037 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
2038 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
2039 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
2040 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
2041 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
2042 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
2043 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
2044 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
2045 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
2046 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
2047 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
2048 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
2049 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
2050 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
2051 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
2052 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002053 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002054 * </ul></p>
2055 * <p><b>Available values for this device:</b><br>
2056 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002057 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002058 *
2059 * @see CaptureRequest#CONTROL_AE_MODE
2060 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002061 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07002062 * @see CaptureRequest#CONTROL_AWB_MODE
2063 * @see CaptureRequest#CONTROL_MODE
2064 * @see #CONTROL_SCENE_MODE_DISABLED
2065 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
2066 * @see #CONTROL_SCENE_MODE_ACTION
2067 * @see #CONTROL_SCENE_MODE_PORTRAIT
2068 * @see #CONTROL_SCENE_MODE_LANDSCAPE
2069 * @see #CONTROL_SCENE_MODE_NIGHT
2070 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
2071 * @see #CONTROL_SCENE_MODE_THEATRE
2072 * @see #CONTROL_SCENE_MODE_BEACH
2073 * @see #CONTROL_SCENE_MODE_SNOW
2074 * @see #CONTROL_SCENE_MODE_SUNSET
2075 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
2076 * @see #CONTROL_SCENE_MODE_FIREWORKS
2077 * @see #CONTROL_SCENE_MODE_SPORTS
2078 * @see #CONTROL_SCENE_MODE_PARTY
2079 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
2080 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07002081 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002082 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07002083 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002084 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002085 public static final Key<Integer> CONTROL_SCENE_MODE =
2086 new Key<Integer>("android.control.sceneMode", int.class);
2087
2088 /**
2089 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002090 * active.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002091 * <p>Video stabilization automatically warps images from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002092 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07002093 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07002094 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002095 * <p>Switching between different video stabilization modes may take several
2096 * frames to initialize, the camera device will report the current mode
2097 * in capture result metadata. For example, When "ON" mode is requested,
2098 * the video stabilization modes in the first several capture results may
2099 * still be "OFF", and it will become "ON" when the initialization is
2100 * done.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07002101 * <p>In addition, not all recording sizes or frame rates may be supported for
2102 * stabilization by a device that reports stabilization support. It is guaranteed
2103 * that an output targeting a MediaRecorder or MediaCodec will be stabilized if
2104 * the recording resolution is less than or equal to 1920 x 1080 (width less than
2105 * or equal to 1920, height less than or equal to 1080), and the recording
2106 * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult
2107 * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return
2108 * OFF if the recording output is not stabilized, or if there are no output
2109 * Surface types that can be stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002110 * <p>If a camera device supports both this mode and OIS
2111 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
2112 * produce undesirable interaction, so it is recommended not to enable
2113 * both at the same time.</p>
2114 * <p><b>Possible values:</b>
2115 * <ul>
2116 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
2117 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
2118 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002119 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002120 *
Jianing Wei2813b0f2015-09-29 14:24:36 -07002121 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Zhijun He45fa43a12014-06-13 18:29:37 -07002122 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07002123 * @see CaptureRequest#SCALER_CROP_REGION
2124 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
2125 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
2126 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002127 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002128 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
2129 new Key<Integer>("android.control.videoStabilizationMode", int.class);
2130
2131 /**
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002132 * <p>The amount of additional sensitivity boost applied to output images
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002133 * after RAW sensor data is captured.</p>
2134 * <p>Some camera devices support additional digital sensitivity boosting in the
2135 * camera processing pipeline after sensor RAW image is captured.
2136 * Such a boost will be applied to YUV/JPEG format output images but will not
2137 * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p>
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07002138 * <p>This key will be <code>null</code> for devices that do not support any RAW format
2139 * outputs. For devices that do support RAW format outputs, this key will always
2140 * present, and if a device does not support post RAW sensitivity boost, it will
2141 * list <code>100</code> in this key.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002142 * <p>If the camera device cannot apply the exact boost requested, it will reduce the
2143 * boost to the nearest supported value.
2144 * The final boost value used will be available in the output capture result.</p>
2145 * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images
2146 * of such device will have the total sensitivity of
Yin-Chia Yeh67e61b62016-01-26 13:27:35 -08002147 * <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 -08002148 * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p>
2149 * <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
2150 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2151 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
2152 * <p><b>Range of valid values:</b><br>
2153 * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p>
2154 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2155 *
2156 * @see CaptureRequest#CONTROL_AE_MODE
2157 * @see CaptureRequest#CONTROL_MODE
2158 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
2159 * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE
2160 * @see CaptureRequest#SENSOR_SENSITIVITY
2161 */
2162 @PublicKey
2163 public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST =
2164 new Key<Integer>("android.control.postRawSensitivityBoost", int.class);
2165
2166 /**
Chien-Yu Chene4491712017-01-11 11:14:06 -08002167 * <p>Allow camera device to enable zero-shutter-lag mode for requests with
2168 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p>
2169 * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with
2170 * STILL_CAPTURE capture intent. The camera device may use images captured in the past to
2171 * produce output images for a zero-shutter-lag request. The result metadata including the
2172 * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images.
2173 * Therefore, the contents of the output images and the result metadata may be out of order
2174 * compared to previous regular requests. enableZsl does not affect requests with other
2175 * capture intents.</p>
2176 * <p>For example, when requests are submitted in the following order:
2177 * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW
2178 * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p>
2179 * <p>The output images for request B may have contents captured before the output images for
2180 * request A, and the result metadata for request B may be older than the result metadata for
2181 * request A.</p>
Chien-Yu Chen1d72ee32017-04-18 15:23:06 -07002182 * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in
2183 * the past for requests with STILL_CAPTURE capture intent.</p>
2184 * <p>For applications targeting SDK versions O and newer, the value of enableZsl in
2185 * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always
2186 * <code>false</code> if present.</p>
2187 * <p>For applications targeting SDK versions older than O, the value of enableZsl in all
2188 * capture templates is always <code>false</code> if present.</p>
Chien-Yu Chen81026382017-05-03 12:30:58 -07002189 * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
Chien-Yu Chene4491712017-01-11 11:14:06 -08002190 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2191 *
2192 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
2193 * @see CaptureResult#SENSOR_TIMESTAMP
2194 */
2195 @PublicKey
2196 public static final Key<Boolean> CONTROL_ENABLE_ZSL =
2197 new Key<Boolean>("android.control.enableZsl", boolean.class);
2198
2199 /**
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002200 * <p>Whether a significant scene change is detected within the currently-set AF
2201 * region(s).</p>
2202 * <p>When the camera focus routine detects a change in the scene it is looking at,
2203 * such as a large shift in camera viewpoint, significant motion in the scene, or a
2204 * significant illumination change, this value will be set to DETECTED for a single capture
2205 * result. Otherwise the value will be NOT_DETECTED. The threshold for detection is similar
2206 * to what would trigger a new passive focus scan to begin in CONTINUOUS autofocus modes.</p>
Chien-Yu Chen2adc8ec2017-12-07 14:45:50 -08002207 * <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 -08002208 * <p><b>Possible values:</b>
2209 * <ul>
2210 * <li>{@link #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED NOT_DETECTED}</li>
2211 * <li>{@link #CONTROL_AF_SCENE_CHANGE_DETECTED DETECTED}</li>
2212 * </ul></p>
2213 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2214 * @see #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED
2215 * @see #CONTROL_AF_SCENE_CHANGE_DETECTED
2216 */
2217 @PublicKey
2218 public static final Key<Integer> CONTROL_AF_SCENE_CHANGE =
2219 new Key<Integer>("android.control.afSceneChange", int.class);
2220
2221 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002222 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08002223 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002224 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2225 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002226 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08002227 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08002228 * camera device will use the highest-quality enhancement algorithms,
2229 * even if it slows down capture rate. FAST means the camera device will
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002230 * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
2231 * edge enhancement will slow down capture rate. Every output stream will have a similar
2232 * amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002233 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2234 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2235 * into a final capture when triggered by the user. In this mode, the camera device applies
2236 * edge enhancement to low-resolution streams (below maximum recording resolution) to
2237 * maximize preview quality, but does not apply edge enhancement to high-resolution streams,
2238 * since those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002239 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2240 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002241 * The camera device may adjust its internal edge enhancement parameters for best
Zhijun He0e99c222015-01-29 15:26:05 -08002242 * 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 -07002243 * <p><b>Possible values:</b>
2244 * <ul>
2245 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2246 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2247 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002248 * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002249 * </ul></p>
2250 * <p><b>Available values for this device:</b><br>
2251 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002252 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2253 * <p><b>Full capability</b> -
2254 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2255 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002256 *
2257 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002258 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002259 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002260 * @see #EDGE_MODE_OFF
2261 * @see #EDGE_MODE_FAST
2262 * @see #EDGE_MODE_HIGH_QUALITY
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002263 * @see #EDGE_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002264 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002265 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002266 public static final Key<Integer> EDGE_MODE =
2267 new Key<Integer>("android.edge.mode", int.class);
2268
2269 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002270 * <p>The desired mode for for the camera device's flash control.</p>
2271 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002272 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002273 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2274 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2275 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2276 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2277 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2278 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002279 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002280 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2281 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2282 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002283 * <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 -07002284 * <p><b>Possible values:</b>
2285 * <ul>
2286 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2287 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2288 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2289 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002290 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002291 *
2292 * @see CaptureRequest#CONTROL_AE_MODE
2293 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2294 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002295 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002296 * @see #FLASH_MODE_OFF
2297 * @see #FLASH_MODE_SINGLE
2298 * @see #FLASH_MODE_TORCH
2299 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002300 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002301 public static final Key<Integer> FLASH_MODE =
2302 new Key<Integer>("android.flash.mode", int.class);
2303
2304 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002305 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002306 * unit.</p>
2307 * <p>When the camera device doesn't have flash unit
2308 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2309 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002310 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2311 * <ul>
2312 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2313 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002314 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002315 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002316 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002317 * </ul>
2318 * <p>In all other conditions the state will not be available on
2319 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002320 * <p><b>Possible values:</b>
2321 * <ul>
2322 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2323 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2324 * <li>{@link #FLASH_STATE_READY READY}</li>
2325 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2326 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2327 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002328 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2329 * <p><b>Limited capability</b> -
2330 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2331 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002332 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002333 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002334 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002335 * @see CaptureRequest#FLASH_MODE
2336 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002337 * @see #FLASH_STATE_UNAVAILABLE
2338 * @see #FLASH_STATE_CHARGING
2339 * @see #FLASH_STATE_READY
2340 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002341 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002342 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002343 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002344 public static final Key<Integer> FLASH_STATE =
2345 new Key<Integer>("android.flash.state", int.class);
2346
2347 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002348 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002349 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002350 * that do not accurately measure the incoming light (i.e. pixels that
2351 * are stuck at an arbitrary value or are oversensitive).</p>
2352 * <p><b>Possible values:</b>
2353 * <ul>
2354 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2355 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2356 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2357 * </ul></p>
2358 * <p><b>Available values for this device:</b><br>
2359 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002360 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002361 *
2362 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002363 * @see #HOT_PIXEL_MODE_OFF
2364 * @see #HOT_PIXEL_MODE_FAST
2365 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2366 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002367 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002368 public static final Key<Integer> HOT_PIXEL_MODE =
2369 new Key<Integer>("android.hotPixel.mode", int.class);
2370
2371 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002372 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002373 * <p>Setting a location object in a request will include the GPS coordinates of the location
2374 * into any JPEG images captured based on the request. These coordinates can then be
2375 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002376 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002377 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002378 @PublicKey
2379 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002380 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2381 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2382
2383 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002384 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002385 * EXIF.</p>
2386 * <p><b>Range of valid values:</b><br>
2387 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002388 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002389 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002390 */
2391 public static final Key<double[]> JPEG_GPS_COORDINATES =
2392 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2393
2394 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002395 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002396 * include in EXIF.</p>
2397 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002398 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002399 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002400 */
2401 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2402 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2403
2404 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002405 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002406 * EXIF.</p>
2407 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002408 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002409 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002410 */
2411 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2412 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2413
2414 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002415 * <p>The orientation for a JPEG image.</p>
2416 * <p>The clockwise rotation angle in degrees, relative to the orientation
2417 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2418 * upright.</p>
2419 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07002420 * rotate the image data to match this orientation. When the image data is rotated,
2421 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002422 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2423 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
2424 * <p>To translate from the device orientation given by the Android sensor APIs, the following
2425 * sample code may be used:</p>
2426 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2427 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2428 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2429 *
2430 * // Round device orientation to a multiple of 90
2431 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2432 *
2433 * // Reverse device orientation for front-facing cameras
2434 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2435 * if (facingFront) deviceOrientation = -deviceOrientation;
2436 *
2437 * // Calculate desired JPEG orientation relative to camera orientation to make
2438 * // the image upright relative to the device orientation
2439 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2440 *
2441 * return jpegOrientation;
2442 * }
2443 * </code></pre>
2444 * <p><b>Units</b>: Degrees in multiples of 90</p>
2445 * <p><b>Range of valid values:</b><br>
2446 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002447 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002448 *
2449 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002450 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002451 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002452 public static final Key<Integer> JPEG_ORIENTATION =
2453 new Key<Integer>("android.jpeg.orientation", int.class);
2454
2455 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002456 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002457 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002458 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002459 * <p><b>Range of valid values:</b><br>
2460 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002461 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002462 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002463 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002464 public static final Key<Byte> JPEG_QUALITY =
2465 new Key<Byte>("android.jpeg.quality", byte.class);
2466
2467 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002468 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002469 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002470 * <p><b>Range of valid values:</b><br>
2471 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002472 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002473 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002474 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002475 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2476 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2477
2478 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002479 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002480 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2481 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002482 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2483 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002484 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2485 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2486 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2487 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2488 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2489 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002490 * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested,
2491 * the camera device will handle thumbnail rotation in one of the following ways:</p>
2492 * <ul>
2493 * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
2494 * and keep jpeg and thumbnail image data unrotated.</li>
2495 * <li>Rotate the jpeg and thumbnail image data and not set
2496 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
2497 * case, LIMITED or FULL hardware level devices will report rotated thumnail size in
2498 * capture result, so the width and height will be interchanged if 90 or 270 degree
2499 * orientation is requested. LEGACY device will always report unrotated thumbnail
2500 * size.</li>
2501 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002502 * <p><b>Range of valid values:</b><br>
2503 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002504 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002505 *
2506 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002507 * @see CaptureRequest#JPEG_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002508 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002509 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002510 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2511 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002512
2513 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002514 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2515 * effective aperture diameter.</p>
2516 * <p>Setting this value is only supported on the camera devices that have a variable
2517 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002518 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2519 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002520 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002521 * to achieve manual exposure control.</p>
2522 * <p>The requested aperture value may take several frames to reach the
2523 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002524 * aperture size in capture result metadata while the aperture is changing.
2525 * 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 -08002526 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2527 * the ON modes, this will be overridden by the camera device
2528 * auto-exposure algorithm, the overridden values are then provided
2529 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002530 * <p><b>Units</b>: The f-number (f/N)</p>
2531 * <p><b>Range of valid values:</b><br>
2532 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002533 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2534 * <p><b>Full capability</b> -
2535 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2536 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002537 *
Zhijun He399f05d2014-01-15 11:31:30 -08002538 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002539 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002540 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002541 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002542 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002543 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002544 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002545 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002546 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002547 public static final Key<Float> LENS_APERTURE =
2548 new Key<Float>("android.lens.aperture", float.class);
2549
2550 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002551 * <p>The desired setting for the lens neutral density filter(s).</p>
2552 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002553 * <p>Lens filters are typically used to lower the amount of light the
2554 * sensor is exposed to (measured in steps of EV). As used here, an EV
2555 * step is the standard logarithmic representation, which are
2556 * non-negative, and inversely proportional to the amount of light
2557 * hitting the sensor. For example, setting this to 0 would result
2558 * in no reduction of the incoming light, and setting this to 2 would
2559 * mean that the filter is set to reduce incoming light by two stops
2560 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002561 * <p>It may take several frames before the lens filter density changes
2562 * to the requested value. While the filter density is still changing,
2563 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002564 * <p><b>Units</b>: Exposure Value (EV)</p>
2565 * <p><b>Range of valid values:</b><br>
2566 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002567 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2568 * <p><b>Full capability</b> -
2569 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2570 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002571 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002572 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002573 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002574 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002575 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002576 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002577 public static final Key<Float> LENS_FILTER_DENSITY =
2578 new Key<Float>("android.lens.filterDensity", float.class);
2579
2580 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002581 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002582 * <p>This setting controls the physical focal length of the camera
2583 * device's lens. Changing the focal length changes the field of
2584 * view of the camera device, and is usually used for optical zoom.</p>
2585 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2586 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002587 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002588 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2589 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002590 * <p>Optical zoom will not be supported on most devices.</p>
2591 * <p><b>Units</b>: Millimeters</p>
2592 * <p><b>Range of valid values:</b><br>
2593 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002594 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002595 *
2596 * @see CaptureRequest#LENS_APERTURE
2597 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002598 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002599 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002600 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002601 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002602 public static final Key<Float> LENS_FOCAL_LENGTH =
2603 new Key<Float>("android.lens.focalLength", float.class);
2604
2605 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002606 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002607 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002608 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002609 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2610 * <p><b>Range of valid values:</b><br>
2611 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002612 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2613 * <p><b>Full capability</b> -
2614 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2615 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2616 *
2617 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002618 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002619 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002620 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002621 public static final Key<Float> LENS_FOCUS_DISTANCE =
2622 new Key<Float>("android.lens.focusDistance", float.class);
2623
2624 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002625 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002626 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002627 * <p>If variable focus not supported, can still report
2628 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002629 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2630 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2631 * <p><b>Range of valid values:</b><br>
2632 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002633 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2634 * <p><b>Limited capability</b> -
2635 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2636 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2637 *
2638 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002639 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002640 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002641 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002642 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2643 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 -07002644
2645 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002646 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2647 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002648 * <p>OIS is used to compensate for motion blur due to small
2649 * movements of the camera during capture. Unlike digital image
2650 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2651 * makes use of mechanical elements to stabilize the camera
2652 * sensor, and thus allows for longer exposure times before
2653 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002654 * <p>Switching between different optical stabilization modes may take several
2655 * frames to initialize, the camera device will report the current mode in
2656 * capture result metadata. For example, When "ON" mode is requested, the
2657 * optical stabilization modes in the first several capture results may still
2658 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002659 * <p>If a camera device supports both OIS and digital image stabilization
2660 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2661 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002662 * <p>Not all devices will support OIS; see
2663 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2664 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002665 * <p><b>Possible values:</b>
2666 * <ul>
2667 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2668 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2669 * </ul></p>
2670 * <p><b>Available values for this device:</b><br>
2671 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002672 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2673 * <p><b>Limited capability</b> -
2674 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2675 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002676 *
2677 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002678 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002679 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002680 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2681 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2682 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002683 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002684 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2685 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2686
2687 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002688 * <p>Current lens status.</p>
2689 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2690 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2691 * they may take several frames to reach the requested values. This state indicates
2692 * the current status of the lens parameters.</p>
2693 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2694 * either because the parameters are all fixed, or because the lens has had enough
2695 * time to reach the most recently-requested values.
2696 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2697 * <ul>
2698 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2699 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2700 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2701 * which means the optical zoom is not supported.</li>
2702 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2703 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2704 * </ul>
2705 * <p>Then this state will always be STATIONARY.</p>
2706 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2707 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002708 * <p><b>Possible values:</b>
2709 * <ul>
2710 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2711 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2712 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002713 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2714 * <p><b>Limited capability</b> -
2715 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2716 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002717 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002718 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002719 * @see CaptureRequest#LENS_APERTURE
2720 * @see CaptureRequest#LENS_FILTER_DENSITY
2721 * @see CaptureRequest#LENS_FOCAL_LENGTH
2722 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2723 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2724 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2725 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2726 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002727 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002728 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002729 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002730 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002731 public static final Key<Integer> LENS_STATE =
2732 new Key<Integer>("android.lens.state", int.class);
2733
2734 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002735 * <p>The orientation of the camera relative to the sensor
2736 * coordinate system.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002737 * <p>The four coefficients that describe the quaternion
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002738 * rotation from the Android sensor coordinate system to a
2739 * camera-aligned coordinate system where the X-axis is
2740 * aligned with the long side of the image sensor, the Y-axis
2741 * is aligned with the short side of the image sensor, and
2742 * the Z-axis is aligned with the optical axis of the sensor.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002743 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002744 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
2745 * amount <code>theta</code>, the following formulas can be used:</p>
2746 * <pre><code> theta = 2 * acos(w)
2747 * a_x = x / sin(theta/2)
2748 * a_y = y / sin(theta/2)
2749 * a_z = z / sin(theta/2)
2750 * </code></pre>
2751 * <p>To create a 3x3 rotation matrix that applies the rotation
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002752 * defined by this quaternion, the following matrix can be
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002753 * used:</p>
2754 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
2755 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
2756 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
2757 * </code></pre>
2758 * <p>This matrix can then be used to apply the rotation to a
2759 * column vector point with</p>
2760 * <p><code>p' = Rp</code></p>
2761 * <p>where <code>p</code> is in the device sensor coordinate system, and
2762 * <code>p'</code> is in the camera-oriented coordinate system.</p>
2763 * <p><b>Units</b>:
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002764 * Quaternion coefficients</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002765 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2766 */
2767 @PublicKey
2768 public static final Key<float[]> LENS_POSE_ROTATION =
2769 new Key<float[]>("android.lens.poseRotation", float[].class);
2770
2771 /**
2772 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07002773 * <p>The position of the camera device's lens optical center,
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002774 * as a three-dimensional vector <code>(x,y,z)</code>.</p>
2775 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
2776 * is relative to the optical center of the largest camera device facing in the same
2777 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
2778 * coordinate axes}. Note that only the axis definitions are shared with the sensor
2779 * coordinate system, but not the origin.</p>
2780 * <p>If this device is the largest or only camera device with a given facing, then this
2781 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
2782 * from the main sensor along the +X axis (to the right from the user's perspective) will
2783 * report <code>(0.03, 0, 0)</code>.</p>
2784 * <p>To transform a pixel coordinates between two cameras facing the same direction, first
2785 * the source camera {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} must be corrected for. Then the source
2786 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
2787 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
2788 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
2789 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
2790 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
2791 * coordinates.</p>
2792 * <p>To compare this against a real image from the destination camera, the destination camera
2793 * image then needs to be corrected for radial distortion before comparison or sampling.</p>
2794 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to
2795 * the center of the primary gyroscope on the device.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002796 * <p><b>Units</b>: Meters</p>
2797 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2798 *
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002799 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002800 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002801 * @see CameraCharacteristics#LENS_POSE_ROTATION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002802 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002803 */
2804 @PublicKey
2805 public static final Key<float[]> LENS_POSE_TRANSLATION =
2806 new Key<float[]>("android.lens.poseTranslation", float[].class);
2807
2808 /**
2809 * <p>The parameters for this camera device's intrinsic
2810 * calibration.</p>
2811 * <p>The five calibration parameters that describe the
2812 * transform from camera-centric 3D coordinates to sensor
2813 * pixel coordinates:</p>
2814 * <pre><code>[f_x, f_y, c_x, c_y, s]
2815 * </code></pre>
2816 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
2817 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
2818 * axis, and <code>s</code> is a skew parameter for the sensor plane not
2819 * being aligned with the lens plane.</p>
2820 * <p>These are typically used within a transformation matrix K:</p>
2821 * <pre><code>K = [ f_x, s, c_x,
2822 * 0, f_y, c_y,
2823 * 0 0, 1 ]
2824 * </code></pre>
2825 * <p>which can then be combined with the camera pose rotation
2826 * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
2827 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
2828 * complete transform from world coordinates to pixel
2829 * coordinates:</p>
2830 * <pre><code>P = [ K 0 * [ R t
2831 * 0 1 ] 0 1 ]
2832 * </code></pre>
2833 * <p>and with <code>p_w</code> being a point in the world coordinate system
2834 * and <code>p_s</code> being a point in the camera active pixel array
2835 * coordinate system, and with the mapping including the
2836 * homogeneous division by z:</p>
2837 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
2838 * p_s = p_h / z_h
2839 * </code></pre>
2840 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
2841 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
2842 * (depth) in pixel coordinates.</p>
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002843 * <p>Note that the coordinate system for this transform is the
2844 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
2845 * where <code>(0,0)</code> is the top-left of the
2846 * preCorrectionActiveArraySize rectangle. Once the pose and
2847 * intrinsic calibration transforms have been applied to a
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002848 * world point, then the {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002849 * transform needs to be applied, and the result adjusted to
2850 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
2851 * system (where <code>(0, 0)</code> is the top-left of the
2852 * activeArraySize rectangle), to determine the final pixel
2853 * coordinate of the world point for processed (non-RAW)
2854 * output buffers.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002855 * <p><b>Units</b>:
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002856 * Pixels in the
2857 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
2858 * coordinate system.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002859 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2860 *
2861 * @see CameraCharacteristics#LENS_POSE_ROTATION
2862 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002863 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07002864 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07002865 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002866 */
2867 @PublicKey
2868 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
2869 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
2870
2871 /**
2872 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002873 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002874 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002875 * kappa_3]</code> and two tangential distortion coefficients
2876 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
2877 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002878 * <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 -07002879 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002880 * 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 -07002881 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002882 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002883 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
2884 * input image that correspond to the pixel values in the
2885 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
2886 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
2887 * </code></pre>
2888 * <p>The pixel coordinates are defined in a normalized
2889 * coordinate system related to the
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002890 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002891 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
2892 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
2893 * of both x and y coordinates are normalized to be 1 at the
2894 * edge further from the optical center, so the range
2895 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
2896 * <p>Finally, <code>r</code> represents the radial distance from the
2897 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
2898 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
2899 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002900 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002901 * Unitless coefficients.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002902 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002903 *
2904 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002905 */
2906 @PublicKey
2907 public static final Key<float[]> LENS_RADIAL_DISTORTION =
2908 new Key<float[]>("android.lens.radialDistortion", float[].class);
2909
2910 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002911 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002912 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08002913 * excessive noise added by the capture process, especially in dark conditions.</p>
2914 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
2915 * YUV domain.</p>
2916 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
2917 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
2918 * This mode is optional, may not be support by all devices. The application should check
2919 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002920 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2921 * will be applied. HIGH_QUALITY mode indicates that the camera device
2922 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002923 * even if it slows down capture rate. FAST means the camera device will not
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002924 * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
2925 * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
2926 * Every output stream will have a similar amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002927 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2928 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2929 * into a final capture when triggered by the user. In this mode, the camera device applies
2930 * noise reduction to low-resolution streams (below maximum recording resolution) to maximize
2931 * preview quality, but does not apply noise reduction to high-resolution streams, since
2932 * those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002933 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
2934 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
2935 * may adjust the noise reduction parameters for best image quality based on the
2936 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002937 * <p><b>Possible values:</b>
2938 * <ul>
2939 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2940 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2941 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08002942 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002943 * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002944 * </ul></p>
2945 * <p><b>Available values for this device:</b><br>
2946 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002947 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2948 * <p><b>Full capability</b> -
2949 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2950 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002951 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002952 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002953 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08002954 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002955 * @see #NOISE_REDUCTION_MODE_OFF
2956 * @see #NOISE_REDUCTION_MODE_FAST
2957 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08002958 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002959 * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002960 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002961 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002962 public static final Key<Integer> NOISE_REDUCTION_MODE =
2963 new Key<Integer>("android.noiseReduction.mode", int.class);
2964
2965 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002966 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002967 * final one for the capture, or only a partial that contains a
2968 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002969 * values.</p>
2970 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002971 * single capture may not overlap, except for this entry. The
2972 * FINAL buffers must retain FIFO ordering relative to the
2973 * requests that generate them, so the FINAL buffer for frame 3 must
2974 * always be sent to the framework after the FINAL buffer for frame 2, and
2975 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2976 * in any order relative to other frames, but all PARTIAL buffers for a given
2977 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002978 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002979 * <p><b>Range of valid values:</b><br>
2980 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002981 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002982 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002983 * @hide
2984 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002985 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002986 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2987 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2988
2989 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002990 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002991 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002992 * frameCount value).</p>
2993 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002994 * <p><b>Units</b>: count of frames</p>
2995 * <p><b>Range of valid values:</b><br>
2996 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002997 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002998 * @deprecated
2999 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003000 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07003001 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003002 public static final Key<Integer> REQUEST_FRAME_COUNT =
3003 new Key<Integer>("android.request.frameCount", int.class);
3004
3005 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003006 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003007 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08003008 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003009 * <p><b>Units</b>: arbitrary integer assigned by application</p>
3010 * <p><b>Range of valid values:</b><br>
3011 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003012 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003013 * @hide
3014 */
3015 public static final Key<Integer> REQUEST_ID =
3016 new Key<Integer>("android.request.id", int.class);
3017
3018 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003019 * <p>Specifies the number of pipeline stages the frame went
3020 * through from when it was exposed to when the final completed result
3021 * was available to the framework.</p>
3022 * <p>Depending on what settings are used in the request, and
3023 * what streams are configured, the data may undergo less processing,
3024 * and some pipeline stages skipped.</p>
3025 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003026 * <p><b>Range of valid values:</b><br>
3027 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003028 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003029 *
3030 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3031 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003032 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003033 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
3034 new Key<Byte>("android.request.pipelineDepth", byte.class);
3035
3036 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003037 * <p>The desired region of the sensor to read out for this capture.</p>
3038 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003039 * <p>The crop region coordinate system is based off
3040 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
3041 * top-left corner of the sensor active array.</p>
3042 * <p>Output streams use this rectangle to produce their output,
3043 * cropping to a smaller region if necessary to maintain the
3044 * stream's aspect ratio, then scaling the sensor input to
3045 * match the output's configured resolution.</p>
3046 * <p>The crop region is applied after the RAW to other color
3047 * space (e.g. YUV) conversion. Since raw streams
3048 * (e.g. RAW16) don't have the conversion stage, they are not
3049 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07003050 * <p>For non-raw streams, any additional per-stream cropping will
3051 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003052 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003053 * ratio, then 4:3 streams will use the exact crop
3054 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08003055 * (letterbox).</p>
3056 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003057 * outputs will crop horizontally (pillarbox), and 16:9
3058 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08003059 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003060 * <p>The width and height of the crop region cannot
3061 * be set to be smaller than
3062 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
3063 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
3064 * <p>The camera device may adjust the crop region to account
3065 * for rounding and other hardware requirements; the final
3066 * crop region used will be included in the output capture
3067 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003068 * <p><b>Units</b>: Pixel coordinates relative to
3069 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003070 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003071 *
3072 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003073 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003074 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003075 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003076 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
3077 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
3078
3079 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003080 * <p>Duration each pixel is exposed to
3081 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003082 * <p>If the sensor can't expose this exact duration, it will shorten the
3083 * duration exposed to the nearest possible value (rather than expose longer).
3084 * The final exposure time used will be available in the output capture result.</p>
3085 * <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
3086 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3087 * <p><b>Units</b>: Nanoseconds</p>
3088 * <p><b>Range of valid values:</b><br>
3089 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003090 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3091 * <p><b>Full capability</b> -
3092 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3093 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3094 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003095 * @see CaptureRequest#CONTROL_AE_MODE
3096 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003097 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003098 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003099 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003100 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003101 public static final Key<Long> SENSOR_EXPOSURE_TIME =
3102 new Key<Long>("android.sensor.exposureTime", long.class);
3103
3104 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003105 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003106 * start of next frame exposure.</p>
3107 * <p>The maximum frame rate that can be supported by a camera subsystem is
3108 * a function of many factors:</p>
3109 * <ul>
3110 * <li>Requested resolutions of output image streams</li>
3111 * <li>Availability of binning / skipping modes on the imager</li>
3112 * <li>The bandwidth of the imager interface</li>
3113 * <li>The bandwidth of the various ISP processing blocks</li>
3114 * </ul>
3115 * <p>Since these factors can vary greatly between different ISPs and
3116 * sensors, the camera abstraction tries to represent the bandwidth
3117 * restrictions with as simple a model as possible.</p>
3118 * <p>The model presented has the following characteristics:</p>
3119 * <ul>
3120 * <li>The image sensor is always configured to output the smallest
3121 * resolution possible given the application's requested output stream
3122 * sizes. The smallest resolution is defined as being at least as large
3123 * as the largest requested output stream size; the camera pipeline must
3124 * never digitally upsample sensor data when the crop region covers the
3125 * whole sensor. In general, this means that if only small output stream
3126 * resolutions are configured, the sensor can provide a higher frame
3127 * rate.</li>
3128 * <li>Since any request may use any or all the currently configured
3129 * output streams, the sensor and ISP must be configured to support
3130 * scaling a single capture to all the streams at the same time. This
3131 * means the camera pipeline must be ready to produce the largest
3132 * requested output size without any delay. Therefore, the overall
3133 * frame rate of a given configured stream set is governed only by the
3134 * largest requested stream resolution.</li>
3135 * <li>Using more than one output stream in a request does not affect the
3136 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08003137 * <li>Certain format-streams may need to do additional background processing
3138 * before data is consumed/produced by that stream. These processors
3139 * can run concurrently to the rest of the camera pipeline, but
3140 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003141 * </ul>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003142 * <p>The necessary information for the application, given the model above, is provided via
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003143 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003144 * These are used to determine the maximum frame rate / minimum frame duration that is
3145 * possible for a given stream configuration.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003146 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08003147 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003148 * device:</p>
3149 * <ol>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003150 * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li>
3151 * <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 }
3152 * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li>
3153 * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum
3154 * 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 -08003155 * </ol>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003156 * <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 -08003157 * using its respective size/format), then the frame duration in <code>F</code> determines the steady
3158 * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let
3159 * this special kind of request be called <code>Rsimple</code>.</p>
3160 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a
3161 * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if
3162 * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all
3163 * buffers from the previous <code>Rstall</code> have already been delivered.</p>
3164 * <p>For more details about stalling, see {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003165 * <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
3166 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3167 * <p><b>Units</b>: Nanoseconds</p>
3168 * <p><b>Range of valid values:</b><br>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003169 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }.
3170 * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003171 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3172 * <p><b>Full capability</b> -
3173 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3174 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08003175 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003176 * @see CaptureRequest#CONTROL_AE_MODE
3177 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003178 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003179 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003180 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003181 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003182 public static final Key<Long> SENSOR_FRAME_DURATION =
3183 new Key<Long>("android.sensor.frameDuration", long.class);
3184
3185 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003186 * <p>The amount of gain applied to sensor data
3187 * before processing.</p>
3188 * <p>The sensitivity is the standard ISO sensitivity value,
3189 * as defined in ISO 12232:2006.</p>
3190 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
3191 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
3192 * is guaranteed to use only analog amplification for applying the gain.</p>
3193 * <p>If the camera device cannot apply the exact sensitivity
3194 * requested, it will reduce the gain to the nearest supported
3195 * value. The final sensitivity used will be available in the
3196 * output capture result.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003197 * <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
3198 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003199 * <p><b>Units</b>: ISO arithmetic units</p>
3200 * <p><b>Range of valid values:</b><br>
3201 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003202 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3203 * <p><b>Full capability</b> -
3204 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3205 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003206 *
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08003207 * @see CaptureRequest#CONTROL_AE_MODE
3208 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003209 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003210 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
3211 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003212 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003213 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003214 public static final Key<Integer> SENSOR_SENSITIVITY =
3215 new Key<Integer>("android.sensor.sensitivity", int.class);
3216
3217 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003218 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07003219 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003220 * <p>The timestamps are also included in all image
3221 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07003222 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003223 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07003224 * the timestamps measure time since an unspecified starting point,
3225 * and are monotonically increasing. They can be compared with the
3226 * timestamps for other captures from the same camera device, but are
3227 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003228 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the
3229 * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can
3230 * be compared to other timestamps from other subsystems that
3231 * are using that base.</p>
Chien-Yu Chen6216e4e2015-05-29 11:49:54 -07003232 * <p>For reprocessing, the timestamp will match the start of exposure of
3233 * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the
3234 * timestamp} in the TotalCaptureResult that was used to create the
3235 * reprocess capture request.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003236 * <p><b>Units</b>: Nanoseconds</p>
3237 * <p><b>Range of valid values:</b><br>
3238 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003239 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07003240 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003241 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003242 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003243 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003244 public static final Key<Long> SENSOR_TIMESTAMP =
3245 new Key<Long>("android.sensor.timestamp", long.class);
3246
3247 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07003248 * <p>The estimated camera neutral color in the native sensor colorspace at
3249 * the time of capture.</p>
3250 * <p>This value gives the neutral color point encoded as an RGB value in the
3251 * native sensor color space. The neutral color point indicates the
3252 * currently estimated white point of the scene illumination. It can be
3253 * used to interpolate between the provided color transforms when
3254 * processing raw sensor data.</p>
3255 * <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 -08003256 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3257 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003258 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08003259 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
3260 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
3261
3262 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003263 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003264 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003265 * corresponding to the sensor amplification (S) and sensor readout
3266 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003267 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003268 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
3269 * represented as an array of Pair&lt;Double, Double&gt;, where
3270 * the first member of the Pair at index n is the S coefficient and the
3271 * second member is the O coefficient for the nth color channel in the CFA.</p>
3272 * <p>These coefficients are used in a two parameter noise model to describe
3273 * the amount of noise present in the image for each CFA channel. The
3274 * noise model used here is:</p>
3275 * <p>N(x) = sqrt(Sx + O)</p>
3276 * <p>Where x represents the recorded signal of a CFA channel normalized to
3277 * the range [0, 1], and S and O are the noise model coeffiecients for
3278 * that channel.</p>
3279 * <p>A more detailed description of the noise model can be found in the
3280 * Adobe DNG specification for the NoiseProfile tag.</p>
3281 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3282 *
3283 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3284 */
3285 @PublicKey
3286 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
3287 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
3288
3289 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08003290 * <p>The worst-case divergence between Bayer green channels.</p>
3291 * <p>This value is an estimate of the worst case split between the
3292 * Bayer green channels in the red and blue rows in the sensor color
3293 * filter array.</p>
3294 * <p>The green split is calculated as follows:</p>
3295 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07003296 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
3297 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
3298 * mosaic channels (R, Gr, Gb, B). The location and size of the window
3299 * chosen is implementation defined, and should be chosen to provide a
3300 * green split estimate that is both representative of the entire image
3301 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003302 * <li>The arithmetic mean of the green channels from the red
3303 * rows (mean_Gr) within W is computed.</li>
3304 * <li>The arithmetic mean of the green channels from the blue
3305 * rows (mean_Gb) within W is computed.</li>
3306 * <li>The maximum ratio R of the two means is computed as follows:
3307 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
3308 * </ol>
3309 * <p>The ratio R is the green split divergence reported for this property,
3310 * which represents how much the green channels differ in the mosaic
3311 * pattern. This value is typically used to determine the treatment of
3312 * the green mosaic channels when demosaicing.</p>
3313 * <p>The green split value can be roughly interpreted as follows:</p>
3314 * <ul>
3315 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
3316 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
3317 * correction to avoid demosaic errors (3-20% divergence).</li>
3318 * <li>R &gt; 1.20 will require strong software correction to produce
3319 * a usuable image (&gt;20% divergence).</li>
3320 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003321 * <p><b>Range of valid values:</b><br></p>
3322 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003323 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3324 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003325 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08003326 public static final Key<Float> SENSOR_GREEN_SPLIT =
3327 new Key<Float>("android.sensor.greenSplit", float.class);
3328
3329 /**
Zhijun He379af012014-05-06 11:54:54 -07003330 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
3331 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
3332 * <p>Each color channel is treated as an unsigned 32-bit integer.
3333 * The camera device then uses the most significant X bits
3334 * that correspond to how many bits are in its Bayer raw sensor
3335 * output.</p>
3336 * <p>For example, a sensor with RAW10 Bayer output would use the
3337 * 10 most significant bits from each color channel.</p>
3338 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3339 *
3340 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
3341 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003342 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003343 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
3344 new Key<int[]>("android.sensor.testPatternData", int[].class);
3345
3346 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003347 * <p>When enabled, the sensor sends a test pattern instead of
3348 * doing a real exposure from the camera.</p>
3349 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003350 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08003351 * work as normal.</p>
3352 * <p>For example, if manual flash is enabled, flash firing should still
3353 * occur (and that the test pattern remain unmodified, since the flash
3354 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003355 * <p>Defaults to OFF.</p>
3356 * <p><b>Possible values:</b>
3357 * <ul>
3358 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
3359 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
3360 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
3361 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
3362 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
3363 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
3364 * </ul></p>
3365 * <p><b>Available values for this device:</b><br>
3366 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003367 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003368 *
3369 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08003370 * @see #SENSOR_TEST_PATTERN_MODE_OFF
3371 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
3372 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
3373 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
3374 * @see #SENSOR_TEST_PATTERN_MODE_PN9
3375 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
3376 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003377 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003378 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
3379 new Key<Integer>("android.sensor.testPatternMode", int.class);
3380
3381 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07003382 * <p>Duration between the start of first row exposure
3383 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003384 * <p>This is the exposure time skew between the first and last
3385 * row exposure start times. The first row and the last row are
3386 * the first and last rows inside of the
3387 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003388 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
3389 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003390 * <p><b>Units</b>: Nanoseconds</p>
3391 * <p><b>Range of valid values:</b><br>
3392 * &gt;= 0 and &lt;
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003393 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003394 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3395 * <p><b>Limited capability</b> -
3396 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3397 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003398 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003399 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07003400 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3401 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003402 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07003403 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
3404 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
3405
3406 /**
Zhijun Hecd950b62015-11-12 17:47:52 -08003407 * <p>A per-frame dynamic black level offset for each of the color filter
3408 * arrangement (CFA) mosaic channels.</p>
3409 * <p>Camera sensor black levels may vary dramatically for different
3410 * capture settings (e.g. {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). The fixed black
3411 * level reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may be too
3412 * inaccurate to represent the actual value on a per-frame basis. The
3413 * camera device internal pipeline relies on reliable black level values
3414 * to process the raw images appropriately. To get the best image
3415 * quality, the camera device may choose to estimate the per frame black
3416 * level values either based on optically shielded black regions
3417 * ({@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}) or its internal model.</p>
3418 * <p>This key reports the camera device estimated per-frame zero light
3419 * value for each of the CFA mosaic channels in the camera sensor. The
3420 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may only represent a coarse
3421 * approximation of the actual black level values. This value is the
3422 * black level used in camera device internal image processing pipeline
3423 * and generally more accurate than the fixed black level values.
3424 * However, since they are estimated values by the camera device, they
3425 * may not be as accurate as the black level values calculated from the
3426 * optical black pixels reported by {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}.</p>
3427 * <p>The values are given in the same order as channels listed for the CFA
3428 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
3429 * nth value given corresponds to the black level offset for the nth
3430 * color channel listed in the CFA.</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003431 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is available or the
3432 * camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08003433 * <p><b>Range of valid values:</b><br>
3434 * &gt;= 0 for each.</p>
3435 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3436 *
3437 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
3438 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3439 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3440 * @see CaptureRequest#SENSOR_SENSITIVITY
3441 */
3442 @PublicKey
Zhijun He8998ad92015-11-24 14:31:04 -08003443 public static final Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL =
3444 new Key<float[]>("android.sensor.dynamicBlackLevel", float[].class);
Zhijun Hecd950b62015-11-12 17:47:52 -08003445
3446 /**
3447 * <p>Maximum raw value output by sensor for this frame.</p>
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07003448 * <p>Since the {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may change for different
Zhijun Hecd950b62015-11-12 17:47:52 -08003449 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}), the white
3450 * level will change accordingly. This key is similar to
3451 * {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}, but specifies the camera device
3452 * estimated white level for each frame.</p>
3453 * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is
3454 * available or the camera device advertises this key via
3455 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys }.</p>
3456 * <p><b>Range of valid values:</b><br>
3457 * &gt;= 0</p>
3458 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3459 *
Eino-Ville Talvalac7c569d2016-04-04 10:48:38 -07003460 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
Zhijun Hecd950b62015-11-12 17:47:52 -08003461 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
3462 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3463 * @see CaptureRequest#SENSOR_SENSITIVITY
3464 */
3465 @PublicKey
3466 public static final Key<Integer> SENSOR_DYNAMIC_WHITE_LEVEL =
3467 new Key<Integer>("android.sensor.dynamicWhiteLevel", int.class);
3468
3469 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08003470 * <p>Quality of lens shading correction applied
3471 * to the image data.</p>
3472 * <p>When set to OFF mode, no lens shading correction will be applied by the
3473 * camera device, and an identity lens shading map data will be provided
3474 * 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 -07003475 * shading map with size of <code>[ 4, 3 ]</code>,
3476 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
3477 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003478 * <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 -07003479 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3480 * 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 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08003484 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003485 * <p>When set to other modes, lens shading correction will be applied by the camera
3486 * device. Applications can request lens shading map data by setting
3487 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
3488 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
3489 * data will be the one applied by the camera device for this capture request.</p>
3490 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
3491 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
3492 * 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>
3493 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
3494 * to be converged before using the returned shading map data.</p>
3495 * <p><b>Possible values:</b>
3496 * <ul>
3497 * <li>{@link #SHADING_MODE_OFF OFF}</li>
3498 * <li>{@link #SHADING_MODE_FAST FAST}</li>
3499 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3500 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003501 * <p><b>Available values for this device:</b><br>
3502 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003503 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3504 * <p><b>Full capability</b> -
3505 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3506 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003507 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07003508 * @see CaptureRequest#CONTROL_AE_MODE
3509 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003510 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003511 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003512 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08003513 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3514 * @see #SHADING_MODE_OFF
3515 * @see #SHADING_MODE_FAST
3516 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08003517 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003518 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08003519 public static final Key<Integer> SHADING_MODE =
3520 new Key<Integer>("android.shading.mode", int.class);
3521
3522 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003523 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003524 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003525 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003526 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003527 * fields.</p>
3528 * <p><b>Possible values:</b>
3529 * <ul>
3530 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3531 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3532 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3533 * </ul></p>
3534 * <p><b>Available values for this device:</b><br>
3535 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3536 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003537 *
3538 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003539 * @see #STATISTICS_FACE_DETECT_MODE_OFF
3540 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3541 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3542 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003543 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003544 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3545 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3546
3547 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003548 * <p>List of unique IDs for detected faces.</p>
3549 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3550 * to the camera device. A face that leaves the field of view and later returns may be
3551 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003552 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3553 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003554 *
3555 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003556 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003557 */
3558 public static final Key<int[]> STATISTICS_FACE_IDS =
3559 new Key<int[]>("android.statistics.faceIds", int[].class);
3560
3561 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003562 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003563 * faces.</p>
3564 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3565 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003566 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3567 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003568 *
3569 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3570 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003571 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003572 */
3573 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3574 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3575
3576 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003577 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003578 * faces.</p>
3579 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3580 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003581 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3582 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003583 *
3584 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3585 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003586 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003587 */
3588 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3589 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3590
3591 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003592 * <p>List of the face confidence scores for
3593 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003594 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003595 * <p><b>Range of valid values:</b><br>
3596 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003597 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003598 *
3599 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003600 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003601 */
3602 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3603 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3604
3605 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003606 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003607 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003608 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003609 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003610 *
3611 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3612 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003613 @PublicKey
3614 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003615 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3616 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3617
3618 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003619 * <p>The shading map is a low-resolution floating-point map
3620 * that lists the coefficients used to correct for vignetting, for each
3621 * Bayer color channel.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003622 * <p>The map provided here is the same map that is used by the camera device to
3623 * correct both color shading and vignetting for output non-RAW images.</p>
3624 * <p>When there is no lens shading correction applied to RAW
3625 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3626 * false), this map is the complete lens shading correction
3627 * map; when there is some lens shading correction applied to
3628 * 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
3629 * correction map that needs to be applied to get shading
3630 * corrected images that match the camera device's output for
3631 * non-RAW formats.</p>
3632 * <p>For a complete shading correction map, the least shaded
3633 * section of the image will have a gain factor of 1; all
3634 * other sections will have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003635 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003636 * will take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003637 * <p>The shading map is for the entire active pixel array, and is not
3638 * affected by the crop region specified in the request. Each shading map
3639 * entry is the value of the shading compensation map over a specific
3640 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3641 * map, and an active pixel array size (W x H), shading map entry
3642 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3643 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3644 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3645 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3646 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003647 * The shading map is stored in a fully interleaved format.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003648 * <p>The shading map will generally have on the order of 30-40 rows and columns,
3649 * and will be smaller than 64x64.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003650 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003651 * <pre><code>width,height = [ 4, 3 ]
3652 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003653 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003654 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3655 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3656 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3657 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3658 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003659 * </code></pre>
3660 * <p>The low-resolution scaling map images for each channel are
3661 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003662 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3663 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3664 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3665 * <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 -08003666 * <p>As a visualization only, inverting the full-color map to recover an
3667 * 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 -08003668 * <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 -07003669 * <p><b>Range of valid values:</b><br>
3670 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003671 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3672 * <p><b>Full capability</b> -
3673 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3674 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003675 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003676 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003677 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003678 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003679 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003680 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003681 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3682 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3683
3684 /**
3685 * <p>The shading map is a low-resolution floating-point map
Zhijun He43210fe2016-04-12 23:15:23 -07003686 * that lists the coefficients used to correct for vignetting and color shading,
3687 * for each Bayer color channel of RAW image data.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003688 * <p>The map provided here is the same map that is used by the camera device to
3689 * correct both color shading and vignetting for output non-RAW images.</p>
3690 * <p>When there is no lens shading correction applied to RAW
3691 * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3692 * false), this map is the complete lens shading correction
3693 * map; when there is some lens shading correction applied to
3694 * 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
3695 * correction map that needs to be applied to get shading
3696 * corrected images that match the camera device's output for
3697 * non-RAW formats.</p>
3698 * <p>For a complete shading correction map, the least shaded
3699 * section of the image will have a gain factor of 1; all
3700 * other sections will have gains above 1.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003701 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003702 * will take into account the colorCorrection settings.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003703 * <p>The shading map is for the entire active pixel array, and is not
3704 * affected by the crop region specified in the request. Each shading map
3705 * entry is the value of the shading compensation map over a specific
3706 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3707 * map, and an active pixel array size (W x H), shading map entry
3708 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3709 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3710 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3711 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3712 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3713 * The shading map is stored in a fully interleaved format, and its size
3714 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
Eino-Ville Talvalac62cea82016-06-02 14:21:27 -07003715 * <p>The shading map will generally have on the order of 30-40 rows and columns,
3716 * and will be smaller than 64x64.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003717 * <p>As an example, given a very small map defined as:</p>
3718 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3719 * android.statistics.lensShadingMap =
3720 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003721 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3722 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3723 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3724 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3725 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003726 * </code></pre>
3727 * <p>The low-resolution scaling map images for each channel are
3728 * (displayed using nearest-neighbor interpolation):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003729 * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3730 * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3731 * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3732 * <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 -07003733 * <p>As a visualization only, inverting the full-color map to recover an
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003734 * image of a gray wall (using bicubic interpolation for visual quality)
3735 * as captured by the sensor gives:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003736 * <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 -08003737 * <p>Note that the RAW image data might be subject to lens shading
3738 * correction not reported on this map. Query
3739 * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject
3740 * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}
3741 * is TRUE, the RAW image data is subject to partial or full lens shading
3742 * correction. In the case full lens shading correction is applied to RAW
3743 * images, the gain factor map reported in this key will contain all 1.0 gains.
3744 * In other words, the map reported in this key is the remaining lens shading
3745 * that needs to be applied on the RAW image to get images without lens shading
3746 * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image
3747 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003748 * <p><b>Range of valid values:</b><br>
3749 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003750 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3751 * <p><b>Full capability</b> -
3752 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3753 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003754 *
3755 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003756 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003757 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
3758 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003759 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003760 */
3761 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3762 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3763
3764 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003765 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003766 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003767 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003768 * since statistics processing on data from a new frame
3769 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003770 * applied to that frame.</p>
3771 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003772 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003773 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003774 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003775 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003776 *
3777 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003778 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003779 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003780 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003781 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003782 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3783 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3784
3785 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003786 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08003787 * calculated by the camera device's statistics units for the current
3788 * output frame.</p>
3789 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003790 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08003791 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003792 * are the best fit for the current output frame. This may
3793 * be different than the transform used for this frame, since
3794 * statistics processing on data from a new frame typically
3795 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003796 * that frame.</p>
3797 * <p>These estimates must be provided for all frames, even if
3798 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003799 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003800 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003801 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003802 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003803 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003804 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003805 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003806 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3807 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3808
3809 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08003810 * <p>The camera device estimated scene illumination lighting
3811 * frequency.</p>
3812 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3813 * that depends on the local utility power standards. This flicker must be
3814 * accounted for by auto-exposure routines to avoid artifacts in captured images.
3815 * The camera device uses this entry to tell the application what the scene
3816 * illuminant frequency is.</p>
3817 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003818 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3819 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3820 * antibanding, and the application can ensure it selects
3821 * exposure times that do not cause banding issues by looking
3822 * into this metadata field. See
3823 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3824 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003825 * <p><b>Possible values:</b>
3826 * <ul>
3827 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3828 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3829 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3830 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003831 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3832 * <p><b>Full capability</b> -
3833 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3834 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08003835 *
3836 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3837 * @see CaptureRequest#CONTROL_AE_MODE
3838 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003839 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003840 * @see #STATISTICS_SCENE_FLICKER_NONE
3841 * @see #STATISTICS_SCENE_FLICKER_50HZ
3842 * @see #STATISTICS_SCENE_FLICKER_60HZ
3843 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003844 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003845 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
3846 new Key<Integer>("android.statistics.sceneFlicker", int.class);
3847
3848 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003849 * <p>Operating mode for hot pixel map generation.</p>
3850 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
3851 * If set to <code>false</code>, no hot pixel map will be returned.</p>
3852 * <p><b>Range of valid values:</b><br>
3853 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003854 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003855 *
3856 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
3857 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
3858 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003859 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003860 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
3861 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
3862
3863 /**
3864 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
3865 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
3866 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
3867 * bottom-right of the pixel array, respectively. The width and
3868 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
3869 * This may include hot pixels that lie outside of the active array
3870 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003871 * <p><b>Range of valid values:</b><br></p>
3872 * <p>n &lt;= number of pixels on the sensor.
3873 * The <code>(x, y)</code> coordinates must be bounded by
3874 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003875 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003876 *
3877 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3878 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3879 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003880 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003881 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
3882 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003883
3884 /**
Zhijun He379af012014-05-06 11:54:54 -07003885 * <p>Whether the camera device will output the lens
3886 * shading map in output result metadata.</p>
3887 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003888 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07003889 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003890 * <p>ON is always supported on devices with the RAW capability.</p>
3891 * <p><b>Possible values:</b>
3892 * <ul>
3893 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3894 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3895 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003896 * <p><b>Available values for this device:</b><br>
3897 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003898 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3899 * <p><b>Full capability</b> -
3900 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3901 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3902 *
3903 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003904 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Zhijun He379af012014-05-06 11:54:54 -07003905 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3906 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3907 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003908 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003909 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3910 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3911
3912 /**
Eino-Ville Talvala601e0f62018-02-05 16:25:40 -08003913 * <p>A control for selecting whether OIS position information is included in output
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003914 * result metadata.</p>
3915 * <p>When set to ON,
3916 * {@link CaptureResult#STATISTICS_OIS_TIMESTAMPS android.statistics.oisTimestamps}, android.statistics.oisShiftPixelX,
Eino-Ville Talvala601e0f62018-02-05 16:25:40 -08003917 * and android.statistics.oisShiftPixelY provide OIS data in the output result metadata.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003918 * <p><b>Possible values:</b>
3919 * <ul>
3920 * <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li>
3921 * <li>{@link #STATISTICS_OIS_DATA_MODE_ON ON}</li>
3922 * </ul></p>
3923 * <p><b>Available values for this device:</b><br>
3924 * android.Statistics.info.availableOisDataModes</p>
3925 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3926 *
3927 * @see CaptureResult#STATISTICS_OIS_TIMESTAMPS
3928 * @see #STATISTICS_OIS_DATA_MODE_OFF
3929 * @see #STATISTICS_OIS_DATA_MODE_ON
3930 */
3931 @PublicKey
3932 public static final Key<Integer> STATISTICS_OIS_DATA_MODE =
3933 new Key<Integer>("android.statistics.oisDataMode", int.class);
3934
3935 /**
3936 * <p>An array of timestamps of OIS samples, in nanoseconds.</p>
3937 * <p>The array contains the timestamps of OIS samples. The timestamps are in the same
3938 * timebase as and comparable to {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp}.</p>
3939 * <p><b>Units</b>: nanoseconds</p>
3940 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3941 *
3942 * @see CaptureResult#SENSOR_TIMESTAMP
3943 */
3944 @PublicKey
3945 public static final Key<long[]> STATISTICS_OIS_TIMESTAMPS =
3946 new Key<long[]>("android.statistics.oisTimestamps", long[].class);
3947
3948 /**
3949 * <p>An array of shifts of OIS samples, in x direction.</p>
3950 * <p>The array contains the amount of shifts in x direction, in pixels, based on OIS samples.
3951 * A positive value is a shift from left to right in active array coordinate system. For
3952 * example, if the optical center is (1000, 500) in active array coordinates, an shift of
3953 * (3, 0) puts the new optical center at (1003, 500).</p>
3954 * <p>The number of shifts must match the number of timestamps in
3955 * {@link CaptureResult#STATISTICS_OIS_TIMESTAMPS android.statistics.oisTimestamps}.</p>
3956 * <p><b>Units</b>: Pixels in active array.</p>
3957 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3958 *
3959 * @see CaptureResult#STATISTICS_OIS_TIMESTAMPS
3960 */
3961 @PublicKey
3962 public static final Key<float[]> STATISTICS_OIS_X_SHIFTS =
3963 new Key<float[]>("android.statistics.oisXShifts", float[].class);
3964
3965 /**
3966 * <p>An array of shifts of OIS samples, in y direction.</p>
3967 * <p>The array contains the amount of shifts in y direction, in pixels, based on OIS samples.
3968 * A positive value is a shift from top to bottom in active array coordinate system. For
3969 * example, if the optical center is (1000, 500) in active array coordinates, an shift of
3970 * (0, 5) puts the new optical center at (1000, 505).</p>
3971 * <p>The number of shifts must match the number of timestamps in
3972 * {@link CaptureResult#STATISTICS_OIS_TIMESTAMPS android.statistics.oisTimestamps}.</p>
3973 * <p><b>Units</b>: Pixels in active array.</p>
3974 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3975 *
3976 * @see CaptureResult#STATISTICS_OIS_TIMESTAMPS
3977 */
3978 @PublicKey
3979 public static final Key<float[]> STATISTICS_OIS_Y_SHIFTS =
3980 new Key<float[]>("android.statistics.oisYShifts", float[].class);
3981
3982 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003983 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08003984 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3985 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003986 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003987 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3988 * <p><b>Full capability</b> -
3989 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3990 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003991 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003992 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003993 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003994 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003995 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003996 public static final Key<float[]> TONEMAP_CURVE_BLUE =
3997 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003998
3999 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004000 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08004001 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4002 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004003 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004004 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4005 * <p><b>Full capability</b> -
4006 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4007 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004008 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004009 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08004010 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004011 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004012 */
Zhijun He3ffd7052013-08-19 15:45:08 -07004013 public static final Key<float[]> TONEMAP_CURVE_GREEN =
4014 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004015
4016 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004017 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08004018 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4019 * CONTRAST_CURVE.</p>
4020 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004021 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004022 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08004023 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004024 * <p>These are sorted in order of increasing <code>Pin</code>; it is
4025 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08004026 * define a complete mapping. For input values between control points,
4027 * the camera device must linearly interpolate between the control
4028 * points.</p>
4029 * <p>Each curve can have an independent number of points, and the number
4030 * of points can be less than max (that is, the request doesn't have to
4031 * always provide a curve with number of points equivalent to
4032 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
4033 * <p>A few examples, and their corresponding graphical mappings; these
4034 * only specify the red channel and the precision is limited to 4
4035 * digits, for conciseness.</p>
4036 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004037 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004038 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004039 * <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 -08004040 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004041 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004042 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004043 * <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 -08004044 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004045 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004046 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
4047 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
4048 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
4049 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004050 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004051 * <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 -08004052 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004053 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004054 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
4055 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
4056 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
4057 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08004058 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004059 * <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 -07004060 * <p><b>Range of valid values:</b><br>
4061 * 0-1 on both input and output coordinates, normalized
4062 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004063 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4064 * <p><b>Full capability</b> -
4065 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4066 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004067 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004068 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08004069 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004070 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004071 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004072 */
4073 public static final Key<float[]> TONEMAP_CURVE_RED =
4074 new Key<float[]>("android.tonemap.curveRed", float[].class);
4075
4076 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004077 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
4078 * is CONTRAST_CURVE.</p>
4079 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
4080 * channels respectively. The following example uses the red channel as an
4081 * example. The same logic applies to green and blue channel.
4082 * Each channel's curve is defined by an array of control points:</p>
4083 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004084 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004085 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
4086 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
4087 * guaranteed that input values 0.0 and 1.0 are included in the list to
4088 * define a complete mapping. For input values between control points,
4089 * the camera device must linearly interpolate between the control
4090 * points.</p>
4091 * <p>Each curve can have an independent number of points, and the number
4092 * of points can be less than max (that is, the request doesn't have to
4093 * always provide a curve with number of points equivalent to
4094 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
4095 * <p>A few examples, and their corresponding graphical mappings; these
4096 * only specify the red channel and the precision is limited to 4
4097 * digits, for conciseness.</p>
4098 * <p>Linear mapping:</p>
4099 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
4100 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004101 * <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 -07004102 * <p>Invert mapping:</p>
4103 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
4104 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004105 * <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 -07004106 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
4107 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004108 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
4109 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
4110 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
4111 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004112 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004113 * <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 -07004114 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
4115 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004116 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
4117 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
4118 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
4119 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004120 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004121 * <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 -07004122 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4123 * <p><b>Full capability</b> -
4124 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4125 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004126 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004127 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004128 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
4129 * @see CaptureRequest#TONEMAP_MODE
4130 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004131 @PublicKey
4132 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004133 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
4134 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
4135
4136 /**
Igor Murashkine0060932014-01-17 17:24:11 -08004137 * <p>High-level global contrast/gamma/tonemapping control.</p>
4138 * <p>When switching to an application-defined contrast curve by setting
4139 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
4140 * per-channel with a set of <code>(in, out)</code> points that specify the
4141 * mapping from input high-bit-depth pixel value to the output
4142 * low-bit-depth value. Since the actual pixel ranges of both input
4143 * and output may change depending on the camera pipeline, the values
4144 * are specified by normalized floating-point numbers.</p>
4145 * <p>More-complex color mapping operations such as 3D color look-up
4146 * tables, selective chroma enhancement, or other non-linear color
4147 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4148 * CONTRAST_CURVE.</p>
4149 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004150 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08004151 * These values are always available, and as close as possible to the
4152 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07004153 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08004154 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
4155 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004156 * <p><b>Possible values:</b>
4157 * <ul>
4158 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
4159 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
4160 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004161 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
4162 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004163 * </ul></p>
4164 * <p><b>Available values for this device:</b><br>
4165 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004166 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4167 * <p><b>Full capability</b> -
4168 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4169 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08004170 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004171 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08004172 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07004173 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08004174 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004175 * @see #TONEMAP_MODE_CONTRAST_CURVE
4176 * @see #TONEMAP_MODE_FAST
4177 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004178 * @see #TONEMAP_MODE_GAMMA_VALUE
4179 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004180 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004181 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004182 public static final Key<Integer> TONEMAP_MODE =
4183 new Key<Integer>("android.tonemap.mode", int.class);
4184
4185 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08004186 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4187 * GAMMA_VALUE</p>
4188 * <p>The tonemap curve will be defined the following formula:
4189 * * OUT = pow(IN, 1.0 / gamma)
4190 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
4191 * pow is the power function and gamma is the gamma value specified by this
4192 * key.</p>
4193 * <p>The same curve will be applied to all color channels. The camera device
4194 * may clip the input gamma value to its supported range. The actual applied
4195 * value will be returned in capture result.</p>
4196 * <p>The valid range of gamma value varies on different devices, but values
4197 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
4198 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4199 *
4200 * @see CaptureRequest#TONEMAP_MODE
4201 */
4202 @PublicKey
4203 public static final Key<Float> TONEMAP_GAMMA =
4204 new Key<Float>("android.tonemap.gamma", float.class);
4205
4206 /**
4207 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4208 * PRESET_CURVE</p>
4209 * <p>The tonemap curve will be defined by specified standard.</p>
4210 * <p>sRGB (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004211 * <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 -08004212 * <p>Rec. 709 (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08004213 * <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 -08004214 * <p>Note that above figures show a 16 control points approximation of preset
4215 * curves. Camera devices may apply a different approximation to the curve.</p>
4216 * <p><b>Possible values:</b>
4217 * <ul>
4218 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
4219 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
4220 * </ul></p>
4221 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4222 *
4223 * @see CaptureRequest#TONEMAP_MODE
4224 * @see #TONEMAP_PRESET_CURVE_SRGB
4225 * @see #TONEMAP_PRESET_CURVE_REC709
4226 */
4227 @PublicKey
4228 public static final Key<Integer> TONEMAP_PRESET_CURVE =
4229 new Key<Integer>("android.tonemap.presetCurve", int.class);
4230
4231 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004232 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004233 * that the camera is powered on and may be streaming images back to the
4234 * Application Processor. In certain rare circumstances, the OS may
4235 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08004236 * any untrusted applications.</p>
4237 * <p>In particular, the LED <em>must</em> always be on when the data could be
4238 * transmitted off the device. The LED <em>should</em> always be on whenever
4239 * data is stored locally on the device.</p>
4240 * <p>The LED <em>may</em> be off if a trusted application is using the data that
4241 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004242 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004243 * @hide
4244 */
4245 public static final Key<Boolean> LED_TRANSMIT =
4246 new Key<Boolean>("android.led.transmit", boolean.class);
4247
4248 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08004249 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08004250 * to its current values, or is free to vary.</p>
4251 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004252 * 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 -08004253 * a change in other capture settings forced the camera device to
4254 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004255 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4256 * <p><b>Full capability</b> -
4257 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4258 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08004259 *
4260 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004261 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004262 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07004263 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004264 public static final Key<Boolean> BLACK_LEVEL_LOCK =
4265 new Key<Boolean>("android.blackLevel.lock", boolean.class);
4266
Igor Murashkin3865a842014-01-17 18:18:39 -08004267 /**
4268 * <p>The frame number corresponding to the last request
4269 * with which the output result (metadata + buffers) has been fully
4270 * synchronized.</p>
4271 * <p>When a request is submitted to the camera device, there is usually a
4272 * delay of several frames before the controls get applied. A camera
4273 * device may either choose to account for this delay by implementing a
4274 * pipeline and carefully submit well-timed atomic control updates, or
4275 * it may start streaming control changes that span over several frame
4276 * boundaries.</p>
4277 * <p>In the latter case, whenever a request's settings change relative to
4278 * the previous submitted request, the full set of changes may take
4279 * multiple frame durations to fully take effect. Some settings may
4280 * take effect sooner (in less frame durations) than others.</p>
4281 * <p>While a set of control changes are being propagated, this value
4282 * will be CONVERGING.</p>
4283 * <p>Once it is fully known that a set of control changes have been
4284 * finished propagating, and the resulting updated control settings
4285 * have been read back by the camera device, this value will be set
4286 * to a non-negative frame number (corresponding to the request to
4287 * which the results have synchronized to).</p>
4288 * <p>Older camera device implementations may not have a way to detect
4289 * when all camera controls have been applied, and will always set this
4290 * value to UNKNOWN.</p>
4291 * <p>FULL capability devices will always have this value set to the
4292 * frame number of the request corresponding to this result.</p>
4293 * <p><em>Further details</em>:</p>
4294 * <ul>
4295 * <li>Whenever a request differs from the last request, any future
4296 * results not yet returned may have this value set to CONVERGING (this
4297 * could include any in-progress captures not yet returned by the camera
4298 * device, for more details see pipeline considerations below).</li>
4299 * <li>Submitting a series of multiple requests that differ from the
4300 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
4301 * moves the new synchronization frame to the last non-repeating
4302 * request (using the smallest frame number from the contiguous list of
4303 * repeating requests).</li>
4304 * <li>Submitting the same request repeatedly will not change this value
4305 * to CONVERGING, if it was already a non-negative value.</li>
4306 * <li>When this value changes to non-negative, that means that all of the
4307 * metadata controls from the request have been applied, all of the
4308 * metadata controls from the camera device have been read to the
4309 * updated values (into the result), and all of the graphics buffers
4310 * corresponding to this result are also synchronized to the request.</li>
4311 * </ul>
4312 * <p><em>Pipeline considerations</em>:</p>
4313 * <p>Submitting a request with updated controls relative to the previously
4314 * submitted requests may also invalidate the synchronization state
4315 * of all the results corresponding to currently in-flight requests.</p>
4316 * <p>In other words, results for this current request and up to
4317 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
4318 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07004319 * <p><b>Possible values:</b>
4320 * <ul>
4321 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
4322 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
4323 * </ul></p>
4324 * <p><b>Available values for this device:</b><br>
4325 * Either a non-negative value corresponding to a
4326 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004327 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08004328 *
4329 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
4330 * @see #SYNC_FRAME_NUMBER_CONVERGING
4331 * @see #SYNC_FRAME_NUMBER_UNKNOWN
4332 * @hide
4333 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07004334 public static final Key<Long> SYNC_FRAME_NUMBER =
4335 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08004336
Zhijun He0e99c222015-01-29 15:26:05 -08004337 /**
4338 * <p>The amount of exposure time increase factor applied to the original output
4339 * frame by the application processing before sending for reprocessing.</p>
4340 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
4341 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
4342 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
4343 * output frames to effectively reduce the noise to the same level as a frame that was
4344 * captured with longer exposure time. To be more specific, assuming the original captured
4345 * images were captured with a sensitivity of S and an exposure time of T, the model in
4346 * the camera device is that the amount of noise in the image would be approximately what
4347 * would be expected if the original capture parameters had been a sensitivity of
4348 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
4349 * than S and T respectively. If the captured images were processed by the application
4350 * before being sent for reprocessing, then the application may have used image processing
4351 * algorithms and/or multi-frame image fusion to reduce the noise in the
4352 * application-processed images (input images). By using the effectiveExposureFactor
4353 * control, the application can communicate to the camera device the actual noise level
4354 * improvement in the application-processed image. With this information, the camera
4355 * device can select appropriate noise reduction and edge enhancement parameters to avoid
4356 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
4357 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
4358 * <p>For example, for multi-frame image fusion use case, the application may fuse
4359 * multiple output frames together to a final frame for reprocessing. When N image are
4360 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
4361 * square root of N (based on a simple photon shot noise model). The camera device will
4362 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
4363 * produce the best quality images.</p>
4364 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
4365 * buffer in a way that affects its effective exposure time.</p>
4366 * <p>This control is only effective for YUV reprocessing capture request. For noise
4367 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
4368 * Similarly, for edge enhancement reprocessing, it is only effective when
4369 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
4370 * <p><b>Units</b>: Relative exposure time increase factor.</p>
4371 * <p><b>Range of valid values:</b><br>
4372 * &gt;= 1.0</p>
4373 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07004374 * <p><b>Limited capability</b> -
4375 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4376 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0e99c222015-01-29 15:26:05 -08004377 *
4378 * @see CaptureRequest#EDGE_MODE
Zhijun He513f7c32015-04-24 18:23:54 -07004379 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08004380 * @see CaptureRequest#NOISE_REDUCTION_MODE
4381 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
4382 */
4383 @PublicKey
4384 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
4385 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
4386
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004387 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
4388 * End generated code
4389 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07004390
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004391
4392
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08004393}