blob: fc1baf2a60145a18cfdcf407a654a3a5fb1f6191 [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 Talvala70c22072013-08-27 12:09:04 -070019import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkinbdf366c2014-07-25 16:54:20 -070020import android.hardware.camera2.impl.CaptureResultExtras;
Igor Murashkin6c76f582014-07-15 17:19:49 -070021import android.hardware.camera2.impl.PublicKey;
22import android.hardware.camera2.impl.SyntheticKey;
Igor Murashkind6d65152014-05-19 16:31:02 -070023import android.hardware.camera2.utils.TypeReference;
24import android.util.Log;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070025import android.util.Rational;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080026
Igor Murashkind6d65152014-05-19 16:31:02 -070027import java.util.List;
28
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080029/**
Igor Murashkindb075af2014-05-21 10:07:08 -070030 * <p>The subset of the results of a single image capture from the image sensor.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080031 *
Igor Murashkindb075af2014-05-21 10:07:08 -070032 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080033 * flash), the processing pipeline, the control algorithms, and the output
34 * buffers.</p>
35 *
36 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
37 * {@link CaptureRequest}. All properties listed for capture requests can also
38 * be queried on the capture result, to determine the final values used for
39 * capture. The result also includes additional metadata about the state of the
40 * camera device during the capture.</p>
41 *
Igor Murashkindb075af2014-05-21 10:07:08 -070042 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
43 * are necessarily available. Some results are {@link CaptureResult partial} and will
44 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
45 * every key available that was enabled by the request.</p>
46 *
47 * <p>{@link CaptureResult} objects are immutable.</p>
Ruben Brunkf967a542014-04-28 16:31:11 -070048 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080049 */
Igor Murashkindb075af2014-05-21 10:07:08 -070050public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
Igor Murashkind6d65152014-05-19 16:31:02 -070051
52 private static final String TAG = "CaptureResult";
53 private static final boolean VERBOSE = false;
54
55 /**
56 * A {@code Key} is used to do capture result field lookups with
57 * {@link CaptureResult#get}.
58 *
59 * <p>For example, to get the timestamp corresponding to the exposure of the first row:
60 * <code><pre>
61 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
62 * </pre></code>
63 * </p>
64 *
65 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
66 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
67 *
68 * @see CaptureResult#get
69 * @see CameraCharacteristics#getAvailableCaptureResultKeys
70 */
71 public final static class Key<T> {
72 private final CameraMetadataNative.Key<T> mKey;
73
74 /**
75 * Visible for testing and vendor extensions only.
76 *
77 * @hide
78 */
79 public Key(String name, Class<T> type) {
80 mKey = new CameraMetadataNative.Key<T>(name, type);
81 }
82
83 /**
84 * Visible for testing and vendor extensions only.
85 *
86 * @hide
87 */
88 public Key(String name, TypeReference<T> typeReference) {
89 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
90 }
91
92 /**
93 * Return a camelCase, period separated name formatted like:
94 * {@code "root.section[.subsections].name"}.
95 *
96 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
97 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
98 *
99 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
100 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
101 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
102 *
103 * @return String representation of the key name
104 */
105 public String getName() {
106 return mKey.getName();
107 }
108
109 /**
110 * {@inheritDoc}
111 */
112 @Override
113 public final int hashCode() {
114 return mKey.hashCode();
115 }
116
117 /**
118 * {@inheritDoc}
119 */
120 @SuppressWarnings("unchecked")
121 @Override
122 public final boolean equals(Object o) {
123 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
124 }
125
126 /**
127 * Visible for CameraMetadataNative implementation only; do not use.
128 *
129 * TODO: Make this private or remove it altogether.
130 *
131 * @hide
132 */
133 public CameraMetadataNative.Key<T> getNativeKey() {
134 return mKey;
135 }
136
137 @SuppressWarnings({ "unchecked" })
138 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
139 mKey = (CameraMetadataNative.Key<T>) nativeKey;
140 }
141 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700142
143 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700144 private final CaptureRequest mRequest;
145 private final int mSequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700146 private final long mFrameNumber;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700147
Igor Murashkin70725502013-06-25 20:27:06 +0000148 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700149 * Takes ownership of the passed-in properties object
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700150 *
151 * <p>For internal use only</p>
Igor Murashkin70725502013-06-25 20:27:06 +0000152 * @hide
153 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700154 public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
155 CaptureResultExtras extras) {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700156 if (results == null) {
157 throw new IllegalArgumentException("results was null");
158 }
159
160 if (parent == null) {
161 throw new IllegalArgumentException("parent was null");
162 }
163
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700164 if (extras == null) {
165 throw new IllegalArgumentException("extras was null");
166 }
167
Igor Murashkind6d65152014-05-19 16:31:02 -0700168 mResults = CameraMetadataNative.move(results);
169 if (mResults.isEmpty()) {
170 throw new AssertionError("Results must not be empty");
171 }
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700172 mRequest = parent;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700173 mSequenceId = extras.getRequestId();
174 mFrameNumber = extras.getFrameNumber();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700175 }
176
Ruben Brunkf967a542014-04-28 16:31:11 -0700177 /**
178 * Returns a copy of the underlying {@link CameraMetadataNative}.
179 * @hide
180 */
181 public CameraMetadataNative getNativeCopy() {
182 return new CameraMetadataNative(mResults);
183 }
184
Igor Murashkind6d65152014-05-19 16:31:02 -0700185 /**
186 * Creates a request-less result.
187 *
188 * <p><strong>For testing only.</strong></p>
189 * @hide
190 */
191 public CaptureResult(CameraMetadataNative results, int sequenceId) {
192 if (results == null) {
193 throw new IllegalArgumentException("results was null");
194 }
195
196 mResults = CameraMetadataNative.move(results);
197 if (mResults.isEmpty()) {
198 throw new AssertionError("Results must not be empty");
199 }
200
201 mRequest = null;
202 mSequenceId = sequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700203 mFrameNumber = -1;
Igor Murashkind6d65152014-05-19 16:31:02 -0700204 }
205
206 /**
207 * Get a capture result field value.
208 *
209 * <p>The field definitions can be found in {@link CaptureResult}.</p>
210 *
211 * <p>Querying the value for the same key more than once will return a value
212 * which is equal to the previous queried value.</p>
213 *
214 * @throws IllegalArgumentException if the key was not valid
215 *
216 * @param key The result field to read.
217 * @return The value of that key, or {@code null} if the field is not set.
218 */
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700219 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700220 T value = mResults.get(key);
221 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
222 return value;
223 }
224
225 /**
226 * {@inheritDoc}
227 * @hide
228 */
229 @SuppressWarnings("unchecked")
230 @Override
231 protected <T> T getProtected(Key<?> key) {
232 return (T) mResults.get(key);
233 }
234
235 /**
236 * {@inheritDoc}
237 * @hide
238 */
239 @SuppressWarnings("unchecked")
240 @Override
241 protected Class<Key<?>> getKeyClass() {
242 Object thisClass = Key.class;
243 return (Class<Key<?>>)thisClass;
244 }
245
246 /**
247 * Dumps the native metadata contents to logcat.
248 *
249 * <p>Visibility for testing/debugging only. The results will not
250 * include any synthesized keys, as they are invisible to the native layer.</p>
251 *
252 * @hide
253 */
254 public void dumpToLog() {
255 mResults.dumpToLog();
256 }
257
258 /**
259 * {@inheritDoc}
260 */
261 @Override
262 public List<Key<?>> getKeys() {
263 // Force the javadoc for this function to show up on the CaptureResult page
264 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800265 }
266
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700267 /**
268 * Get the request associated with this result.
269 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700270 * <p>Whenever a request has been fully or partially captured, with
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700271 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or
272 * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s
Igor Murashkindb075af2014-05-21 10:07:08 -0700273 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700274 * </p>
275 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700276 * <p>For example,
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700277 * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700278 * {@literal @}Override
279 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
280 * assert(myResult.getRequest.equals(myRequest) == true);
281 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700282 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700283 * </code></pre>
284 * </p>
285 *
286 * @return The request associated with this result. Never {@code null}.
287 */
288 public CaptureRequest getRequest() {
289 return mRequest;
290 }
291
292 /**
293 * Get the frame number associated with this result.
294 *
295 * <p>Whenever a request has been processed, regardless of failure or success,
296 * it gets a unique frame number assigned to its future result/failure.</p>
297 *
298 * <p>This value monotonically increments, starting with 0,
299 * for every new result or failure; and the scope is the lifetime of the
300 * {@link CameraDevice}.</p>
301 *
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700302 * @return The frame number
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700303 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700304 public long getFrameNumber() {
305 return mFrameNumber;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700306 }
307
308 /**
309 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700310 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700311 *
312 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
313 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
314 *
315 * @return int The ID for the sequence of requests that this capture result is a part of
316 *
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700317 * @see CameraDevice.CaptureCallback#onCaptureSequenceCompleted
318 * @see CameraDevice.CaptureCallback#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700319 */
320 public int getSequenceId() {
321 return mSequenceId;
322 }
323
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700324 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
325 * The key entries below this point are generated from metadata
326 * definitions in /system/media/camera/docs. Do not modify by hand or
327 * modify the comment blocks at the start or end.
328 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
329
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800330
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700331 /**
Zhijun He379af012014-05-06 11:54:54 -0700332 * <p>The mode control selects how the image data is converted from the
333 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700334 * <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 -0700335 * control is overridden by the AWB routine. When AWB is disabled, the
336 * application controls how the color mapping is performed.</p>
337 * <p>We define the expected processing pipeline below. For consistency
338 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
339 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
340 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
341 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
342 * camera device (in the results) and be roughly correct.</p>
343 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
344 * FAST or HIGH_QUALITY will yield a picture with the same white point
345 * as what was produced by the camera device in the earlier frame.</p>
346 * <p>The expected processing pipeline is as follows:</p>
347 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
348 * <p>The white balance is encoded by two values, a 4-channel white-balance
349 * gain vector (applied in the Bayer domain), and a 3x3 color transform
350 * matrix (applied after demosaic).</p>
351 * <p>The 4-channel white-balance gains are defined as:</p>
352 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
353 * </code></pre>
354 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
355 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
356 * These may be identical for a given camera device implementation; if
357 * the camera device does not support a separate gain for even/odd green
358 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
359 * <code>G_even</code> in the output result metadata.</p>
360 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
361 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
362 * </code></pre>
363 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
364 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
365 * <p>with colors as follows:</p>
366 * <pre><code>r' = I0r + I1g + I2b
367 * g' = I3r + I4g + I5b
368 * b' = I6r + I7g + I8b
369 * </code></pre>
370 * <p>Both the input and output value ranges must match. Overflow/underflow
371 * values are clipped to fit within the range.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700372 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
373 * <p><b>Full capability</b> -
374 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
375 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700376 *
377 * @see CaptureRequest#COLOR_CORRECTION_GAINS
378 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
379 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700380 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700381 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
382 * @see #COLOR_CORRECTION_MODE_FAST
383 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
384 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700385 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700386 public static final Key<Integer> COLOR_CORRECTION_MODE =
387 new Key<Integer>("android.colorCorrection.mode", int.class);
388
389 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800390 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700391 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800392 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800393 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700394 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800395 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800396 * <p>In the latter case, the camera device may round the matrix to account
397 * for precision issues; the final rounded matrix should be reported back
398 * in this matrix result metadata. The transform should keep the magnitude
399 * of the output color values within <code>[0, 1.0]</code> (assuming input color
400 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700401 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
402 * <p><b>Full capability</b> -
403 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
404 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800405 *
406 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700407 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700408 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700409 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700410 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
411 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700412
413 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800414 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800415 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700416 * <p>These per-channel gains are either set by the camera device
417 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
418 * TRANSFORM_MATRIX, or directly by the application in the
419 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
420 * TRANSFORM_MATRIX.</p>
421 * <p>The gains in the result metadata are the gains actually
422 * applied by the camera device to the current frame.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700423 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
424 * <p><b>Full capability</b> -
425 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
426 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800427 *
428 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700429 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700430 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700431 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700432 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
433 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700434
435 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700436 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
437 * <p>This must be set to a valid mode from
Zhijun He9e4e4392014-08-18 11:12:32 -0700438 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700439 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
440 * can not focus on the same point after exiting from the lens. This metadata defines
441 * the high level control of chromatic aberration correction algorithm, which aims to
442 * minimize the chromatic artifacts that may occur along the object boundaries in an
443 * image.</p>
444 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
445 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
446 * use the highest-quality aberration correction algorithms, even if it slows down
447 * capture rate. FAST means the camera device will not slow down capture rate when
448 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700449 * <p>LEGACY devices will always be in FAST mode.</p>
450 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700451 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700452 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
453 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
454 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
455 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700456 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700457 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700458 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
459 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700460
461 /**
Zhijun He379af012014-05-06 11:54:54 -0700462 * <p>The desired setting for the camera device's auto-exposure
463 * algorithm's antibanding compensation.</p>
464 * <p>Some kinds of lighting fixtures, such as some fluorescent
465 * lights, flicker at the rate of the power supply frequency
466 * (60Hz or 50Hz, depending on country). While this is
467 * typically not noticeable to a person, it can be visible to
468 * a camera device. If a camera sets its exposure time to the
469 * wrong value, the flicker may become visible in the
470 * viewfinder as flicker or in a final captured image, as a
471 * set of variable-brightness bands across the image.</p>
472 * <p>Therefore, the auto-exposure routines of camera devices
473 * include antibanding routines that ensure that the chosen
474 * exposure value will not cause such banding. The choice of
475 * exposure time depends on the rate of flicker, which the
476 * camera device can detect automatically, or the expected
477 * rate can be selected by the application using this
478 * control.</p>
479 * <p>A given camera device may not support all of the possible
480 * options for the antibanding mode. The
481 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
482 * the available modes for a given camera device.</p>
483 * <p>The default mode is AUTO, which must be supported by all
484 * camera devices.</p>
485 * <p>If manual exposure control is enabled (by setting
486 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
487 * then this setting has no effect, and the application must
488 * ensure it selects exposure times that do not cause banding
489 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
490 * the application in this.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700491 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700492 *
493 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
494 * @see CaptureRequest#CONTROL_AE_MODE
495 * @see CaptureRequest#CONTROL_MODE
496 * @see CaptureResult#STATISTICS_SCENE_FLICKER
497 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
498 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
499 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
500 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
501 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700502 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700503 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
504 new Key<Integer>("android.control.aeAntibandingMode", int.class);
505
506 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700507 * <p>Adjustment to auto-exposure (AE) target image
508 * brightness.</p>
509 * <p>The adjustment is measured as a count of steps, with the
510 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
511 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
512 * <p>For example, if the exposure value (EV) step is 0.333, '6'
513 * will mean an exposure compensation of +2 EV; -3 will mean an
514 * exposure compensation of -1 EV. One EV represents a doubling
515 * of image brightness. Note that this control will only be
516 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
517 * 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 -0700518 * <p>In the event of exposure compensation value being changed, camera device
519 * may take several frames to reach the newly requested exposure target.
520 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
521 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
522 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
523 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700524 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700525 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700526 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
527 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700528 * @see CaptureRequest#CONTROL_AE_LOCK
529 * @see CaptureRequest#CONTROL_AE_MODE
530 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700531 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700532 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700533 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
534 new Key<Integer>("android.control.aeExposureCompensation", int.class);
535
536 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700537 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700538 * calculated values.</p>
539 * <p>Note that even when AE is locked, the flash may be
540 * fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / ON_ALWAYS_FLASH /
541 * ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700542 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
543 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700544 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
545 * when AE is already locked, the camera device will not change the exposure time
546 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
547 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
548 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
549 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
550 * <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 -0700551 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700552 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700553 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700554 * @see CaptureRequest#CONTROL_AE_MODE
555 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
556 * @see CaptureResult#CONTROL_AE_STATE
557 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
558 * @see CaptureRequest#SENSOR_SENSITIVITY
559 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700560 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700561 public static final Key<Boolean> CONTROL_AE_LOCK =
562 new Key<Boolean>("android.control.aeLock", boolean.class);
563
564 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800565 * <p>The desired mode for the camera device's
566 * auto-exposure routine.</p>
567 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
568 * AUTO.</p>
569 * <p>When set to any of the ON modes, the camera device's
570 * auto-exposure routine is enabled, overriding the
571 * application's selected exposure time, sensor sensitivity,
572 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
573 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
574 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
575 * is selected, the camera device's flash unit controls are
576 * also overridden.</p>
577 * <p>The FLASH modes are only available if the camera device
578 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
579 * <p>If flash TORCH mode is desired, this field must be set to
580 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
581 * <p>When set to any of the ON modes, the values chosen by the
582 * camera device auto-exposure routine for the overridden
583 * fields for a given capture will be available in its
584 * CaptureResult.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700585 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800586 *
Zhijun He5f2a47f2014-01-16 15:44:41 -0800587 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800588 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
589 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800590 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
591 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800592 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800593 * @see #CONTROL_AE_MODE_OFF
594 * @see #CONTROL_AE_MODE_ON
595 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
596 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
597 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
598 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700599 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800600 public static final Key<Integer> CONTROL_AE_MODE =
601 new Key<Integer>("android.control.aeMode", int.class);
602
603 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800604 * <p>List of areas to use for
Ruben Brunkf59521d2014-02-03 17:14:33 -0800605 * metering.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700606 * <p>Optional. Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
607 * Otherwise will always be present.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800608 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700609 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800610 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
611 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700612 * bottom-right pixel in the active pixel array.</p>
613 * <p>The weight must range from 0 to 1000, and represents a weight
614 * for every pixel in the area. This means that a large metering area
615 * with the same weight as a smaller area will have more effect in
616 * the metering result. Metering areas can partially overlap and the
617 * camera device will add the weights in the overlap region.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800618 * <p>If all regions have 0 weight, then no specific metering area
Zhijun Hecc28a412014-02-24 15:11:23 -0800619 * needs to be used by the camera device. If the metering region is
Zhijun He14986152014-05-22 21:17:37 -0700620 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
621 * the camera device will ignore the sections outside the region and output the
622 * used sections in the result metadata.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700623 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800624 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700625 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800626 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800627 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700628 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700629 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700630 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
631 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700632
633 /**
Zhijun He379af012014-05-06 11:54:54 -0700634 * <p>Range over which fps can be adjusted to
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700635 * maintain exposure.</p>
636 * <p>Only constrains auto-exposure (AE) algorithm, not
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700637 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}
638 * This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700639 *
640 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
641 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700642 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700643 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
644 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700645
646 /**
647 * <p>Whether the camera device will trigger a precapture
648 * metering sequence when it processes this request.</p>
649 * <p>This entry is normally set to IDLE, or is not
650 * included at all in the request settings. When included and
651 * set to START, the camera device will trigger the autoexposure
652 * precapture metering sequence.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700653 * <p>The precapture sequence should triggered before starting a
654 * high-quality still capture for final metering decisions to
655 * be made, and for firing pre-capture flash pulses to estimate
656 * scene brightness and required final capture flash power, when
657 * the flash is enabled.</p>
658 * <p>Normally, this entry should be set to START for only a
659 * single request, and the application should wait until the
660 * sequence completes before starting a new one.</p>
661 * <p>The exact effect of auto-exposure (AE) precapture trigger
662 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700663 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
664 * details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700665 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
666 * <p><b>Limited capability</b> -
667 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
668 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700669 *
670 * @see CaptureResult#CONTROL_AE_STATE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700671 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700672 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
673 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
674 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700675 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700676 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
677 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
678
679 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700680 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800681 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
682 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
683 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
684 * the algorithm states to INACTIVE.</p>
685 * <p>The camera device can do several state transitions between two results, if it is
686 * allowed by the state transition table. For example: INACTIVE may never actually be
687 * seen in a result.</p>
688 * <p>The state in the result is the state for this image (in sync with this image): if
689 * AE state becomes CONVERGED, then the image data associated with this result should
690 * be good to use.</p>
691 * <p>Below are state transition tables for different AE modes.</p>
692 * <table>
693 * <thead>
694 * <tr>
695 * <th align="center">State</th>
696 * <th align="center">Transition Cause</th>
697 * <th align="center">New State</th>
698 * <th align="center">Notes</th>
699 * </tr>
700 * </thead>
701 * <tbody>
702 * <tr>
703 * <td align="center">INACTIVE</td>
704 * <td align="center"></td>
705 * <td align="center">INACTIVE</td>
706 * <td align="center">Camera device auto exposure algorithm is disabled</td>
707 * </tr>
708 * </tbody>
709 * </table>
710 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
711 * <table>
712 * <thead>
713 * <tr>
714 * <th align="center">State</th>
715 * <th align="center">Transition Cause</th>
716 * <th align="center">New State</th>
717 * <th align="center">Notes</th>
718 * </tr>
719 * </thead>
720 * <tbody>
721 * <tr>
722 * <td align="center">INACTIVE</td>
723 * <td align="center">Camera device initiates AE scan</td>
724 * <td align="center">SEARCHING</td>
725 * <td align="center">Values changing</td>
726 * </tr>
727 * <tr>
728 * <td align="center">INACTIVE</td>
729 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
730 * <td align="center">LOCKED</td>
731 * <td align="center">Values locked</td>
732 * </tr>
733 * <tr>
734 * <td align="center">SEARCHING</td>
735 * <td align="center">Camera device finishes AE scan</td>
736 * <td align="center">CONVERGED</td>
737 * <td align="center">Good values, not changing</td>
738 * </tr>
739 * <tr>
740 * <td align="center">SEARCHING</td>
741 * <td align="center">Camera device finishes AE scan</td>
742 * <td align="center">FLASH_REQUIRED</td>
743 * <td align="center">Converged but too dark w/o flash</td>
744 * </tr>
745 * <tr>
746 * <td align="center">SEARCHING</td>
747 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
748 * <td align="center">LOCKED</td>
749 * <td align="center">Values locked</td>
750 * </tr>
751 * <tr>
752 * <td align="center">CONVERGED</td>
753 * <td align="center">Camera device initiates AE scan</td>
754 * <td align="center">SEARCHING</td>
755 * <td align="center">Values changing</td>
756 * </tr>
757 * <tr>
758 * <td align="center">CONVERGED</td>
759 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
760 * <td align="center">LOCKED</td>
761 * <td align="center">Values locked</td>
762 * </tr>
763 * <tr>
764 * <td align="center">FLASH_REQUIRED</td>
765 * <td align="center">Camera device initiates AE scan</td>
766 * <td align="center">SEARCHING</td>
767 * <td align="center">Values changing</td>
768 * </tr>
769 * <tr>
770 * <td align="center">FLASH_REQUIRED</td>
771 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
772 * <td align="center">LOCKED</td>
773 * <td align="center">Values locked</td>
774 * </tr>
775 * <tr>
776 * <td align="center">LOCKED</td>
777 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
778 * <td align="center">SEARCHING</td>
779 * <td align="center">Values not good after unlock</td>
780 * </tr>
781 * <tr>
782 * <td align="center">LOCKED</td>
783 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
784 * <td align="center">CONVERGED</td>
785 * <td align="center">Values good after unlock</td>
786 * </tr>
787 * <tr>
788 * <td align="center">LOCKED</td>
789 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
790 * <td align="center">FLASH_REQUIRED</td>
791 * <td align="center">Exposure good, but too dark</td>
792 * </tr>
793 * <tr>
794 * <td align="center">PRECAPTURE</td>
795 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
796 * <td align="center">CONVERGED</td>
797 * <td align="center">Ready for high-quality capture</td>
798 * </tr>
799 * <tr>
800 * <td align="center">PRECAPTURE</td>
801 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
802 * <td align="center">LOCKED</td>
803 * <td align="center">Ready for high-quality capture</td>
804 * </tr>
805 * <tr>
806 * <td align="center">Any state</td>
807 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
808 * <td align="center">PRECAPTURE</td>
809 * <td align="center">Start AE precapture metering sequence</td>
810 * </tr>
811 * </tbody>
812 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800813 * <p>For the above table, the camera device may skip reporting any state changes that happen
814 * without application intervention (i.e. mode switch, trigger, locking). Any state that
815 * can be skipped in that manner is called a transient state.</p>
816 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
817 * listed in above table, it is also legal for the camera device to skip one or more
818 * transient states between two results. See below table for examples:</p>
819 * <table>
820 * <thead>
821 * <tr>
822 * <th align="center">State</th>
823 * <th align="center">Transition Cause</th>
824 * <th align="center">New State</th>
825 * <th align="center">Notes</th>
826 * </tr>
827 * </thead>
828 * <tbody>
829 * <tr>
830 * <td align="center">INACTIVE</td>
831 * <td align="center">Camera device finished AE scan</td>
832 * <td align="center">CONVERGED</td>
833 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
834 * </tr>
835 * <tr>
836 * <td align="center">Any state</td>
837 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
838 * <td align="center">FLASH_REQUIRED</td>
839 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
840 * </tr>
841 * <tr>
842 * <td align="center">Any state</td>
843 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
844 * <td align="center">CONVERGED</td>
845 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
846 * </tr>
847 * <tr>
848 * <td align="center">CONVERGED</td>
849 * <td align="center">Camera device finished AE scan</td>
850 * <td align="center">FLASH_REQUIRED</td>
851 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
852 * </tr>
853 * <tr>
854 * <td align="center">FLASH_REQUIRED</td>
855 * <td align="center">Camera device finished AE scan</td>
856 * <td align="center">CONVERGED</td>
857 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
858 * </tr>
859 * </tbody>
860 * </table>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700861 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
862 * <p><b>Limited capability</b> -
863 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
864 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800865 *
866 * @see CaptureRequest#CONTROL_AE_LOCK
867 * @see CaptureRequest#CONTROL_AE_MODE
868 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
869 * @see CaptureRequest#CONTROL_MODE
870 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700871 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700872 * @see #CONTROL_AE_STATE_INACTIVE
873 * @see #CONTROL_AE_STATE_SEARCHING
874 * @see #CONTROL_AE_STATE_CONVERGED
875 * @see #CONTROL_AE_STATE_LOCKED
876 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
877 * @see #CONTROL_AE_STATE_PRECAPTURE
878 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700879 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700880 public static final Key<Integer> CONTROL_AE_STATE =
881 new Key<Integer>("android.control.aeState", int.class);
882
883 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700884 * <p>Whether auto-focus (AF) is currently enabled, and what
885 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800886 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
887 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>).</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800888 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800889 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700890 * in result metadata.
891 * This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800892 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800893 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800894 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -0800895 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700896 * @see #CONTROL_AF_MODE_OFF
897 * @see #CONTROL_AF_MODE_AUTO
898 * @see #CONTROL_AF_MODE_MACRO
899 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
900 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
901 * @see #CONTROL_AF_MODE_EDOF
902 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700903 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700904 public static final Key<Integer> CONTROL_AF_MODE =
905 new Key<Integer>("android.control.afMode", int.class);
906
907 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800908 * <p>List of areas to use for focus
Ruben Brunkf59521d2014-02-03 17:14:33 -0800909 * estimation.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700910 * <p>Optional. Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
911 * Otherwise will always be present.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800912 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700913 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800914 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
915 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700916 * bottom-right pixel in the active pixel array.</p>
917 * <p>The weight must range from 0 to 1000, and represents a weight
918 * for every pixel in the area. This means that a large metering area
919 * with the same weight as a smaller area will have more effect in
920 * the metering result. Metering areas can partially overlap and the
921 * camera device will add the weights in the overlap region.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700922 * <p>If all regions have 0 weight, then no specific metering area
923 * needs to be used by the camera device. If the metering region is
924 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
925 * the camera device will ignore the sections outside the region and output the
926 * used sections in the result metadata.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700927 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800928 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700929 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800930 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800931 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700932 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700933 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700934 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
935 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700936
937 /**
Zhijun He379af012014-05-06 11:54:54 -0700938 * <p>Whether the camera device will trigger autofocus for this request.</p>
939 * <p>This entry is normally set to IDLE, or is not
940 * included at all in the request settings.</p>
941 * <p>When included and set to START, the camera device will trigger the
942 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
943 * <p>When set to CANCEL, the camera device will cancel any active trigger,
944 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700945 * <p>Generally, applications should set this entry to START or CANCEL for only a
946 * single capture, and then return it to IDLE (or not set at all). Specifying
947 * START for multiple captures in a row means restarting the AF operation over
948 * and over again.</p>
949 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700950 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700951 *
952 * @see CaptureResult#CONTROL_AF_STATE
953 * @see #CONTROL_AF_TRIGGER_IDLE
954 * @see #CONTROL_AF_TRIGGER_START
955 * @see #CONTROL_AF_TRIGGER_CANCEL
956 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700957 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700958 public static final Key<Integer> CONTROL_AF_TRIGGER =
959 new Key<Integer>("android.control.afTrigger", int.class);
960
961 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700962 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800963 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
964 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
965 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
966 * the algorithm states to INACTIVE.</p>
967 * <p>The camera device can do several state transitions between two results, if it is
968 * allowed by the state transition table. For example: INACTIVE may never actually be
969 * seen in a result.</p>
970 * <p>The state in the result is the state for this image (in sync with this image): if
971 * AF state becomes FOCUSED, then the image data associated with this result should
972 * be sharp.</p>
973 * <p>Below are state transition tables for different AF modes.</p>
974 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
975 * <table>
976 * <thead>
977 * <tr>
978 * <th align="center">State</th>
979 * <th align="center">Transition Cause</th>
980 * <th align="center">New State</th>
981 * <th align="center">Notes</th>
982 * </tr>
983 * </thead>
984 * <tbody>
985 * <tr>
986 * <td align="center">INACTIVE</td>
987 * <td align="center"></td>
988 * <td align="center">INACTIVE</td>
989 * <td align="center">Never changes</td>
990 * </tr>
991 * </tbody>
992 * </table>
993 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
994 * <table>
995 * <thead>
996 * <tr>
997 * <th align="center">State</th>
998 * <th align="center">Transition Cause</th>
999 * <th align="center">New State</th>
1000 * <th align="center">Notes</th>
1001 * </tr>
1002 * </thead>
1003 * <tbody>
1004 * <tr>
1005 * <td align="center">INACTIVE</td>
1006 * <td align="center">AF_TRIGGER</td>
1007 * <td align="center">ACTIVE_SCAN</td>
1008 * <td align="center">Start AF sweep, Lens now moving</td>
1009 * </tr>
1010 * <tr>
1011 * <td align="center">ACTIVE_SCAN</td>
1012 * <td align="center">AF sweep done</td>
1013 * <td align="center">FOCUSED_LOCKED</td>
1014 * <td align="center">Focused, Lens now locked</td>
1015 * </tr>
1016 * <tr>
1017 * <td align="center">ACTIVE_SCAN</td>
1018 * <td align="center">AF sweep done</td>
1019 * <td align="center">NOT_FOCUSED_LOCKED</td>
1020 * <td align="center">Not focused, Lens now locked</td>
1021 * </tr>
1022 * <tr>
1023 * <td align="center">ACTIVE_SCAN</td>
1024 * <td align="center">AF_CANCEL</td>
1025 * <td align="center">INACTIVE</td>
1026 * <td align="center">Cancel/reset AF, Lens now locked</td>
1027 * </tr>
1028 * <tr>
1029 * <td align="center">FOCUSED_LOCKED</td>
1030 * <td align="center">AF_CANCEL</td>
1031 * <td align="center">INACTIVE</td>
1032 * <td align="center">Cancel/reset AF</td>
1033 * </tr>
1034 * <tr>
1035 * <td align="center">FOCUSED_LOCKED</td>
1036 * <td align="center">AF_TRIGGER</td>
1037 * <td align="center">ACTIVE_SCAN</td>
1038 * <td align="center">Start new sweep, Lens now moving</td>
1039 * </tr>
1040 * <tr>
1041 * <td align="center">NOT_FOCUSED_LOCKED</td>
1042 * <td align="center">AF_CANCEL</td>
1043 * <td align="center">INACTIVE</td>
1044 * <td align="center">Cancel/reset AF</td>
1045 * </tr>
1046 * <tr>
1047 * <td align="center">NOT_FOCUSED_LOCKED</td>
1048 * <td align="center">AF_TRIGGER</td>
1049 * <td align="center">ACTIVE_SCAN</td>
1050 * <td align="center">Start new sweep, Lens now moving</td>
1051 * </tr>
1052 * <tr>
1053 * <td align="center">Any state</td>
1054 * <td align="center">Mode change</td>
1055 * <td align="center">INACTIVE</td>
1056 * <td align="center"></td>
1057 * </tr>
1058 * </tbody>
1059 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001060 * <p>For the above table, the camera device may skip reporting any state changes that happen
1061 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1062 * can be skipped in that manner is called a transient state.</p>
1063 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1064 * state transitions listed in above table, it is also legal for the camera device to skip
1065 * one or more transient states between two results. See below table for examples:</p>
1066 * <table>
1067 * <thead>
1068 * <tr>
1069 * <th align="center">State</th>
1070 * <th align="center">Transition Cause</th>
1071 * <th align="center">New State</th>
1072 * <th align="center">Notes</th>
1073 * </tr>
1074 * </thead>
1075 * <tbody>
1076 * <tr>
1077 * <td align="center">INACTIVE</td>
1078 * <td align="center">AF_TRIGGER</td>
1079 * <td align="center">FOCUSED_LOCKED</td>
1080 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1081 * </tr>
1082 * <tr>
1083 * <td align="center">INACTIVE</td>
1084 * <td align="center">AF_TRIGGER</td>
1085 * <td align="center">NOT_FOCUSED_LOCKED</td>
1086 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1087 * </tr>
1088 * <tr>
1089 * <td align="center">FOCUSED_LOCKED</td>
1090 * <td align="center">AF_TRIGGER</td>
1091 * <td align="center">FOCUSED_LOCKED</td>
1092 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1093 * </tr>
1094 * <tr>
1095 * <td align="center">NOT_FOCUSED_LOCKED</td>
1096 * <td align="center">AF_TRIGGER</td>
1097 * <td align="center">FOCUSED_LOCKED</td>
1098 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1099 * </tr>
1100 * </tbody>
1101 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001102 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1103 * <table>
1104 * <thead>
1105 * <tr>
1106 * <th align="center">State</th>
1107 * <th align="center">Transition Cause</th>
1108 * <th align="center">New State</th>
1109 * <th align="center">Notes</th>
1110 * </tr>
1111 * </thead>
1112 * <tbody>
1113 * <tr>
1114 * <td align="center">INACTIVE</td>
1115 * <td align="center">Camera device initiates new scan</td>
1116 * <td align="center">PASSIVE_SCAN</td>
1117 * <td align="center">Start AF scan, Lens now moving</td>
1118 * </tr>
1119 * <tr>
1120 * <td align="center">INACTIVE</td>
1121 * <td align="center">AF_TRIGGER</td>
1122 * <td align="center">NOT_FOCUSED_LOCKED</td>
1123 * <td align="center">AF state query, Lens now locked</td>
1124 * </tr>
1125 * <tr>
1126 * <td align="center">PASSIVE_SCAN</td>
1127 * <td align="center">Camera device completes current scan</td>
1128 * <td align="center">PASSIVE_FOCUSED</td>
1129 * <td align="center">End AF scan, Lens now locked</td>
1130 * </tr>
1131 * <tr>
1132 * <td align="center">PASSIVE_SCAN</td>
1133 * <td align="center">Camera device fails current scan</td>
1134 * <td align="center">PASSIVE_UNFOCUSED</td>
1135 * <td align="center">End AF scan, Lens now locked</td>
1136 * </tr>
1137 * <tr>
1138 * <td align="center">PASSIVE_SCAN</td>
1139 * <td align="center">AF_TRIGGER</td>
1140 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001141 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001142 * </tr>
1143 * <tr>
1144 * <td align="center">PASSIVE_SCAN</td>
1145 * <td align="center">AF_TRIGGER</td>
1146 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001147 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001148 * </tr>
1149 * <tr>
1150 * <td align="center">PASSIVE_SCAN</td>
1151 * <td align="center">AF_CANCEL</td>
1152 * <td align="center">INACTIVE</td>
1153 * <td align="center">Reset lens position, Lens now locked</td>
1154 * </tr>
1155 * <tr>
1156 * <td align="center">PASSIVE_FOCUSED</td>
1157 * <td align="center">Camera device initiates new scan</td>
1158 * <td align="center">PASSIVE_SCAN</td>
1159 * <td align="center">Start AF scan, Lens now moving</td>
1160 * </tr>
1161 * <tr>
1162 * <td align="center">PASSIVE_UNFOCUSED</td>
1163 * <td align="center">Camera device initiates new scan</td>
1164 * <td align="center">PASSIVE_SCAN</td>
1165 * <td align="center">Start AF scan, Lens now moving</td>
1166 * </tr>
1167 * <tr>
1168 * <td align="center">PASSIVE_FOCUSED</td>
1169 * <td align="center">AF_TRIGGER</td>
1170 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001171 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001172 * </tr>
1173 * <tr>
1174 * <td align="center">PASSIVE_UNFOCUSED</td>
1175 * <td align="center">AF_TRIGGER</td>
1176 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001177 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001178 * </tr>
1179 * <tr>
1180 * <td align="center">FOCUSED_LOCKED</td>
1181 * <td align="center">AF_TRIGGER</td>
1182 * <td align="center">FOCUSED_LOCKED</td>
1183 * <td align="center">No effect</td>
1184 * </tr>
1185 * <tr>
1186 * <td align="center">FOCUSED_LOCKED</td>
1187 * <td align="center">AF_CANCEL</td>
1188 * <td align="center">INACTIVE</td>
1189 * <td align="center">Restart AF scan</td>
1190 * </tr>
1191 * <tr>
1192 * <td align="center">NOT_FOCUSED_LOCKED</td>
1193 * <td align="center">AF_TRIGGER</td>
1194 * <td align="center">NOT_FOCUSED_LOCKED</td>
1195 * <td align="center">No effect</td>
1196 * </tr>
1197 * <tr>
1198 * <td align="center">NOT_FOCUSED_LOCKED</td>
1199 * <td align="center">AF_CANCEL</td>
1200 * <td align="center">INACTIVE</td>
1201 * <td align="center">Restart AF scan</td>
1202 * </tr>
1203 * </tbody>
1204 * </table>
1205 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1206 * <table>
1207 * <thead>
1208 * <tr>
1209 * <th align="center">State</th>
1210 * <th align="center">Transition Cause</th>
1211 * <th align="center">New State</th>
1212 * <th align="center">Notes</th>
1213 * </tr>
1214 * </thead>
1215 * <tbody>
1216 * <tr>
1217 * <td align="center">INACTIVE</td>
1218 * <td align="center">Camera device initiates new scan</td>
1219 * <td align="center">PASSIVE_SCAN</td>
1220 * <td align="center">Start AF scan, Lens now moving</td>
1221 * </tr>
1222 * <tr>
1223 * <td align="center">INACTIVE</td>
1224 * <td align="center">AF_TRIGGER</td>
1225 * <td align="center">NOT_FOCUSED_LOCKED</td>
1226 * <td align="center">AF state query, Lens now locked</td>
1227 * </tr>
1228 * <tr>
1229 * <td align="center">PASSIVE_SCAN</td>
1230 * <td align="center">Camera device completes current scan</td>
1231 * <td align="center">PASSIVE_FOCUSED</td>
1232 * <td align="center">End AF scan, Lens now locked</td>
1233 * </tr>
1234 * <tr>
1235 * <td align="center">PASSIVE_SCAN</td>
1236 * <td align="center">Camera device fails current scan</td>
1237 * <td align="center">PASSIVE_UNFOCUSED</td>
1238 * <td align="center">End AF scan, Lens now locked</td>
1239 * </tr>
1240 * <tr>
1241 * <td align="center">PASSIVE_SCAN</td>
1242 * <td align="center">AF_TRIGGER</td>
1243 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001244 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001245 * </tr>
1246 * <tr>
1247 * <td align="center">PASSIVE_SCAN</td>
1248 * <td align="center">AF_TRIGGER</td>
1249 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001250 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001251 * </tr>
1252 * <tr>
1253 * <td align="center">PASSIVE_SCAN</td>
1254 * <td align="center">AF_CANCEL</td>
1255 * <td align="center">INACTIVE</td>
1256 * <td align="center">Reset lens position, Lens now locked</td>
1257 * </tr>
1258 * <tr>
1259 * <td align="center">PASSIVE_FOCUSED</td>
1260 * <td align="center">Camera device initiates new scan</td>
1261 * <td align="center">PASSIVE_SCAN</td>
1262 * <td align="center">Start AF scan, Lens now moving</td>
1263 * </tr>
1264 * <tr>
1265 * <td align="center">PASSIVE_UNFOCUSED</td>
1266 * <td align="center">Camera device initiates new scan</td>
1267 * <td align="center">PASSIVE_SCAN</td>
1268 * <td align="center">Start AF scan, Lens now moving</td>
1269 * </tr>
1270 * <tr>
1271 * <td align="center">PASSIVE_FOCUSED</td>
1272 * <td align="center">AF_TRIGGER</td>
1273 * <td align="center">FOCUSED_LOCKED</td>
1274 * <td align="center">Immediate trans. Lens now locked</td>
1275 * </tr>
1276 * <tr>
1277 * <td align="center">PASSIVE_UNFOCUSED</td>
1278 * <td align="center">AF_TRIGGER</td>
1279 * <td align="center">NOT_FOCUSED_LOCKED</td>
1280 * <td align="center">Immediate trans. Lens now locked</td>
1281 * </tr>
1282 * <tr>
1283 * <td align="center">FOCUSED_LOCKED</td>
1284 * <td align="center">AF_TRIGGER</td>
1285 * <td align="center">FOCUSED_LOCKED</td>
1286 * <td align="center">No effect</td>
1287 * </tr>
1288 * <tr>
1289 * <td align="center">FOCUSED_LOCKED</td>
1290 * <td align="center">AF_CANCEL</td>
1291 * <td align="center">INACTIVE</td>
1292 * <td align="center">Restart AF scan</td>
1293 * </tr>
1294 * <tr>
1295 * <td align="center">NOT_FOCUSED_LOCKED</td>
1296 * <td align="center">AF_TRIGGER</td>
1297 * <td align="center">NOT_FOCUSED_LOCKED</td>
1298 * <td align="center">No effect</td>
1299 * </tr>
1300 * <tr>
1301 * <td align="center">NOT_FOCUSED_LOCKED</td>
1302 * <td align="center">AF_CANCEL</td>
1303 * <td align="center">INACTIVE</td>
1304 * <td align="center">Restart AF scan</td>
1305 * </tr>
1306 * </tbody>
1307 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001308 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1309 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1310 * camera device. When a trigger is included in a mode switch request, the trigger
1311 * will be evaluated in the context of the new mode in the request.
1312 * See below table for examples:</p>
1313 * <table>
1314 * <thead>
1315 * <tr>
1316 * <th align="center">State</th>
1317 * <th align="center">Transition Cause</th>
1318 * <th align="center">New State</th>
1319 * <th align="center">Notes</th>
1320 * </tr>
1321 * </thead>
1322 * <tbody>
1323 * <tr>
1324 * <td align="center">any state</td>
1325 * <td align="center">CAF--&gt;AUTO mode switch</td>
1326 * <td align="center">INACTIVE</td>
1327 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1328 * </tr>
1329 * <tr>
1330 * <td align="center">any state</td>
1331 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1332 * <td align="center">trigger-reachable states from INACTIVE</td>
1333 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1334 * </tr>
1335 * <tr>
1336 * <td align="center">any state</td>
1337 * <td align="center">AUTO--&gt;CAF mode switch</td>
1338 * <td align="center">passively reachable states from INACTIVE</td>
1339 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1340 * </tr>
1341 * </tbody>
1342 * </table>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001343 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001344 *
1345 * @see CaptureRequest#CONTROL_AF_MODE
1346 * @see CaptureRequest#CONTROL_MODE
1347 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001348 * @see #CONTROL_AF_STATE_INACTIVE
1349 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1350 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1351 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1352 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1353 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001354 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001355 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001356 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001357 public static final Key<Integer> CONTROL_AF_STATE =
1358 new Key<Integer>("android.control.afState", int.class);
1359
1360 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001361 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001362 * latest calculated values.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001363 * <p>Note that AWB lock is only meaningful when
1364 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1365 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001366 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1367 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001368 *
1369 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001370 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001371 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001372 public static final Key<Boolean> CONTROL_AWB_LOCK =
1373 new Key<Boolean>("android.control.awbLock", boolean.class);
1374
1375 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001376 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001377 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001378 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001379 * <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 -07001380 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001381 * routine is enabled, overriding the application's selected
1382 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1383 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001384 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001385 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001386 * 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 -08001387 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001388 * <p>When set to any other modes, the camera device's auto-white
1389 * balance routine is disabled. The camera device uses each
1390 * particular illumination target for white balance
1391 * adjustment. The application's values for
1392 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1393 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1394 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001395 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001396 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001397 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001398 * @see CaptureRequest#COLOR_CORRECTION_MODE
1399 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001400 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001401 * @see #CONTROL_AWB_MODE_OFF
1402 * @see #CONTROL_AWB_MODE_AUTO
1403 * @see #CONTROL_AWB_MODE_INCANDESCENT
1404 * @see #CONTROL_AWB_MODE_FLUORESCENT
1405 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1406 * @see #CONTROL_AWB_MODE_DAYLIGHT
1407 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1408 * @see #CONTROL_AWB_MODE_TWILIGHT
1409 * @see #CONTROL_AWB_MODE_SHADE
1410 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001411 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001412 public static final Key<Integer> CONTROL_AWB_MODE =
1413 new Key<Integer>("android.control.awbMode", int.class);
1414
1415 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001416 * <p>List of areas to use for illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001417 * estimation.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001418 * <p>Optional. Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
1419 * Otherwise will always be present.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001420 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001421 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001422 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1423 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001424 * bottom-right pixel in the active pixel array.</p>
1425 * <p>The weight must range from 0 to 1000, and represents a weight
1426 * for every pixel in the area. This means that a large metering area
1427 * with the same weight as a smaller area will have more effect in
1428 * the metering result. Metering areas can partially overlap and the
1429 * camera device will add the weights in the overlap region.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001430 * <p>If all regions have 0 weight, then no specific metering area
1431 * needs to be used by the camera device. If the metering region is
1432 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
Zhijun He14986152014-05-22 21:17:37 -07001433 * the camera device will ignore the sections outside the region and output the
1434 * used sections in the result metadata.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001435 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001436 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001437 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001438 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001439 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001440 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001441 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001442 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1443 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001444
1445 /**
Zhijun He379af012014-05-06 11:54:54 -07001446 * <p>Information to the camera device 3A (auto-exposure,
1447 * auto-focus, auto-white balance) routines about the purpose
1448 * of this capture, to help the camera device to decide optimal 3A
1449 * strategy.</p>
1450 * <p>This control (except for MANUAL) is only effective if
1451 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001452 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1453 * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001454 * contains MANUAL_SENSOR.
1455 * This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001456 *
1457 * @see CaptureRequest#CONTROL_MODE
1458 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1459 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1460 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1461 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1462 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1463 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1464 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1465 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1466 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001467 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001468 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1469 new Key<Integer>("android.control.captureIntent", int.class);
1470
1471 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001472 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001473 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1474 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1475 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1476 * the algorithm states to INACTIVE.</p>
1477 * <p>The camera device can do several state transitions between two results, if it is
1478 * allowed by the state transition table. So INACTIVE may never actually be seen in
1479 * a result.</p>
1480 * <p>The state in the result is the state for this image (in sync with this image): if
1481 * AWB state becomes CONVERGED, then the image data associated with this result should
1482 * be good to use.</p>
1483 * <p>Below are state transition tables for different AWB modes.</p>
1484 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1485 * <table>
1486 * <thead>
1487 * <tr>
1488 * <th align="center">State</th>
1489 * <th align="center">Transition Cause</th>
1490 * <th align="center">New State</th>
1491 * <th align="center">Notes</th>
1492 * </tr>
1493 * </thead>
1494 * <tbody>
1495 * <tr>
1496 * <td align="center">INACTIVE</td>
1497 * <td align="center"></td>
1498 * <td align="center">INACTIVE</td>
1499 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1500 * </tr>
1501 * </tbody>
1502 * </table>
1503 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1504 * <table>
1505 * <thead>
1506 * <tr>
1507 * <th align="center">State</th>
1508 * <th align="center">Transition Cause</th>
1509 * <th align="center">New State</th>
1510 * <th align="center">Notes</th>
1511 * </tr>
1512 * </thead>
1513 * <tbody>
1514 * <tr>
1515 * <td align="center">INACTIVE</td>
1516 * <td align="center">Camera device initiates AWB scan</td>
1517 * <td align="center">SEARCHING</td>
1518 * <td align="center">Values changing</td>
1519 * </tr>
1520 * <tr>
1521 * <td align="center">INACTIVE</td>
1522 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1523 * <td align="center">LOCKED</td>
1524 * <td align="center">Values locked</td>
1525 * </tr>
1526 * <tr>
1527 * <td align="center">SEARCHING</td>
1528 * <td align="center">Camera device finishes AWB scan</td>
1529 * <td align="center">CONVERGED</td>
1530 * <td align="center">Good values, not changing</td>
1531 * </tr>
1532 * <tr>
1533 * <td align="center">SEARCHING</td>
1534 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1535 * <td align="center">LOCKED</td>
1536 * <td align="center">Values locked</td>
1537 * </tr>
1538 * <tr>
1539 * <td align="center">CONVERGED</td>
1540 * <td align="center">Camera device initiates AWB scan</td>
1541 * <td align="center">SEARCHING</td>
1542 * <td align="center">Values changing</td>
1543 * </tr>
1544 * <tr>
1545 * <td align="center">CONVERGED</td>
1546 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1547 * <td align="center">LOCKED</td>
1548 * <td align="center">Values locked</td>
1549 * </tr>
1550 * <tr>
1551 * <td align="center">LOCKED</td>
1552 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1553 * <td align="center">SEARCHING</td>
1554 * <td align="center">Values not good after unlock</td>
1555 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001556 * </tbody>
1557 * </table>
1558 * <p>For the above table, the camera device may skip reporting any state changes that happen
1559 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1560 * can be skipped in that manner is called a transient state.</p>
1561 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1562 * listed in above table, it is also legal for the camera device to skip one or more
1563 * transient states between two results. See below table for examples:</p>
1564 * <table>
1565 * <thead>
1566 * <tr>
1567 * <th align="center">State</th>
1568 * <th align="center">Transition Cause</th>
1569 * <th align="center">New State</th>
1570 * <th align="center">Notes</th>
1571 * </tr>
1572 * </thead>
1573 * <tbody>
1574 * <tr>
1575 * <td align="center">INACTIVE</td>
1576 * <td align="center">Camera device finished AWB scan</td>
1577 * <td align="center">CONVERGED</td>
1578 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1579 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001580 * <tr>
1581 * <td align="center">LOCKED</td>
1582 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1583 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001584 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001585 * </tr>
1586 * </tbody>
1587 * </table>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001588 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1589 * <p><b>Limited capability</b> -
1590 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1591 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001592 *
1593 * @see CaptureRequest#CONTROL_AWB_LOCK
1594 * @see CaptureRequest#CONTROL_AWB_MODE
1595 * @see CaptureRequest#CONTROL_MODE
1596 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001597 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001598 * @see #CONTROL_AWB_STATE_INACTIVE
1599 * @see #CONTROL_AWB_STATE_SEARCHING
1600 * @see #CONTROL_AWB_STATE_CONVERGED
1601 * @see #CONTROL_AWB_STATE_LOCKED
1602 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001603 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001604 public static final Key<Integer> CONTROL_AWB_STATE =
1605 new Key<Integer>("android.control.awbState", int.class);
1606
1607 /**
Zhijun He379af012014-05-06 11:54:54 -07001608 * <p>A special color effect to apply.</p>
1609 * <p>When this mode is set, a color effect will be applied
1610 * to images produced by the camera device. The interpretation
1611 * and implementation of these color effects is left to the
1612 * implementor of the camera device, and should not be
1613 * depended on to be consistent (or present) across all
1614 * devices.</p>
1615 * <p>A color effect will only be applied if
1616 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001617 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001618 *
1619 * @see CaptureRequest#CONTROL_MODE
1620 * @see #CONTROL_EFFECT_MODE_OFF
1621 * @see #CONTROL_EFFECT_MODE_MONO
1622 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1623 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1624 * @see #CONTROL_EFFECT_MODE_SEPIA
1625 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1626 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1627 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1628 * @see #CONTROL_EFFECT_MODE_AQUA
1629 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001630 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001631 public static final Key<Integer> CONTROL_EFFECT_MODE =
1632 new Key<Integer>("android.control.effectMode", int.class);
1633
1634 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001635 * <p>Overall mode of 3A control
Zhijun Hecc28a412014-02-24 15:11:23 -08001636 * routines.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001637 * <p>High-level 3A control. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001638 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001639 * capture parameters itself.</p>
1640 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001641 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001642 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001643 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001644 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001645 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001646 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001647 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1648 * is that this frame will not be used by camera device background 3A statistics
1649 * update, as if this frame is never captured. This mode can be used in the scenario
1650 * where the application doesn't want a 3A manual control capture to affect
1651 * the subsequent auto 3A capture results.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001652 * <p>LEGACY mode devices will only support AUTO and USE_SCENE_MODE modes.
1653 * LIMITED mode devices will only support OFF and OFF_KEEP_STATE if they
1654 * support the MANUAL_SENSOR capability.</p>
1655 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001656 *
1657 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001658 * @see #CONTROL_MODE_OFF
1659 * @see #CONTROL_MODE_AUTO
1660 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001661 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001662 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001663 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001664 public static final Key<Integer> CONTROL_MODE =
1665 new Key<Integer>("android.control.mode", int.class);
1666
1667 /**
Zhijun He379af012014-05-06 11:54:54 -07001668 * <p>A camera mode optimized for conditions typical in a particular
1669 * capture setting.</p>
1670 * <p>This is the mode that that is active when
1671 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1672 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001673 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.
1674 * The scene modes available for a given camera device are listed in
1675 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}.</p>
Zhijun He379af012014-05-06 11:54:54 -07001676 * <p>The interpretation and implementation of these scene modes is left
1677 * to the implementor of the camera device. Their behavior will not be
1678 * consistent across all devices, and any given device may only implement
1679 * a subset of these modes.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001680 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001681 *
1682 * @see CaptureRequest#CONTROL_AE_MODE
1683 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001684 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001685 * @see CaptureRequest#CONTROL_AWB_MODE
1686 * @see CaptureRequest#CONTROL_MODE
1687 * @see #CONTROL_SCENE_MODE_DISABLED
1688 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1689 * @see #CONTROL_SCENE_MODE_ACTION
1690 * @see #CONTROL_SCENE_MODE_PORTRAIT
1691 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1692 * @see #CONTROL_SCENE_MODE_NIGHT
1693 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1694 * @see #CONTROL_SCENE_MODE_THEATRE
1695 * @see #CONTROL_SCENE_MODE_BEACH
1696 * @see #CONTROL_SCENE_MODE_SNOW
1697 * @see #CONTROL_SCENE_MODE_SUNSET
1698 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1699 * @see #CONTROL_SCENE_MODE_FIREWORKS
1700 * @see #CONTROL_SCENE_MODE_SPORTS
1701 * @see #CONTROL_SCENE_MODE_PARTY
1702 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1703 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07001704 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Zhijun He379af012014-05-06 11:54:54 -07001705 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001706 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001707 public static final Key<Integer> CONTROL_SCENE_MODE =
1708 new Key<Integer>("android.control.sceneMode", int.class);
1709
1710 /**
1711 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001712 * active.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001713 * <p>Video stabilization automatically translates and scales images from the camera
1714 * in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07001715 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001716 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
1717 * <p>Switching between different video stabilization modes may take several frames
1718 * to initialize, the camera device will report the current mode in capture result
1719 * metadata. For example, When "ON" mode is requested, the video stabilization modes
1720 * in the first several capture results may still be "OFF", and it will become "ON"
1721 * when the initialization is done.</p>
1722 * <p>If a camera device supports both this mode and OIS ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}),
1723 * turning both modes on may produce undesirable interaction, so it is recommended not to
1724 * enable both at the same time.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001725 * <p>Some LEGACY camera devices will not support changing video stabilization
1726 * mode; in this case the value will always override to OFF.</p>
1727 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001728 *
Zhijun He45fa43a12014-06-13 18:29:37 -07001729 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07001730 * @see CaptureRequest#SCALER_CROP_REGION
1731 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1732 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1733 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001734 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001735 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1736 new Key<Integer>("android.control.videoStabilizationMode", int.class);
1737
1738 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001739 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001740 * enhancement.</p>
Zhijun He28079362013-12-17 10:35:40 -08001741 * <p>Edge/sharpness/detail enhancement. OFF means no
Zhijun Hecc28a412014-02-24 15:11:23 -08001742 * enhancement will be applied by the camera device.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001743 * <p>This must be set to one of the modes listed in {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001744 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001745 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001746 * camera device will use the highest-quality enhancement algorithms,
1747 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08001748 * not slow down capture rate when applying edge enhancement.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001749 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1750 * <p><b>Full capability</b> -
1751 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1752 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001753 *
1754 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001755 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001756 * @see #EDGE_MODE_OFF
1757 * @see #EDGE_MODE_FAST
1758 * @see #EDGE_MODE_HIGH_QUALITY
1759 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001760 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001761 public static final Key<Integer> EDGE_MODE =
1762 new Key<Integer>("android.edge.mode", int.class);
1763
1764 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001765 * <p>The desired mode for for the camera device's flash control.</p>
1766 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08001767 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001768 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
1769 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
1770 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
1771 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
1772 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
1773 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001774 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08001775 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
1776 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
1777 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001778 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001779 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001780 *
1781 * @see CaptureRequest#CONTROL_AE_MODE
1782 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1783 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08001784 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001785 * @see #FLASH_MODE_OFF
1786 * @see #FLASH_MODE_SINGLE
1787 * @see #FLASH_MODE_TORCH
1788 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001789 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001790 public static final Key<Integer> FLASH_MODE =
1791 new Key<Integer>("android.flash.mode", int.class);
1792
1793 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001794 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08001795 * unit.</p>
1796 * <p>When the camera device doesn't have flash unit
1797 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
1798 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001799 * <p>In certain conditions, this will be available on LEGACY devices:</p>
1800 * <ul>
1801 * <li>Flash-less cameras always return UNAVAILABLE.</li>
1802 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
1803 * will always return FIRED.</li>
1804 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
1805 * will always return FIRED.</li>
1806 * </ul>
1807 * <p>In all other conditions the state will not be available on
1808 * LEGACY devices (i.e. it will be <code>null</code>).</p>
1809 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1810 * <p><b>Limited capability</b> -
1811 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1812 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001813 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001814 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08001815 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001816 * @see CaptureRequest#FLASH_MODE
1817 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001818 * @see #FLASH_STATE_UNAVAILABLE
1819 * @see #FLASH_STATE_CHARGING
1820 * @see #FLASH_STATE_READY
1821 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07001822 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001823 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001824 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001825 public static final Key<Integer> FLASH_STATE =
1826 new Key<Integer>("android.flash.state", int.class);
1827
1828 /**
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001829 * <p>Set operational mode for hot pixel correction.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001830 * <p>Valid modes for this camera device are listed in
1831 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001832 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
1833 * that do not accurately encode the incoming light (i.e. pixels that
1834 * are stuck at an arbitrary value).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001835 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001836 *
1837 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001838 * @see #HOT_PIXEL_MODE_OFF
1839 * @see #HOT_PIXEL_MODE_FAST
1840 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1841 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001842 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001843 public static final Key<Integer> HOT_PIXEL_MODE =
1844 new Key<Integer>("android.hotPixel.mode", int.class);
1845
1846 /**
Ruben Brunk57493682014-05-27 18:58:08 -07001847 * <p>A location object to use when generating image GPS metadata.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001848 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001849 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001850 @PublicKey
1851 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07001852 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
1853 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
1854
1855 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001856 * <p>GPS coordinates to include in output JPEG
1857 * EXIF</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001858 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001859 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001860 */
1861 public static final Key<double[]> JPEG_GPS_COORDINATES =
1862 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
1863
1864 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001865 * <p>32 characters describing GPS algorithm to
1866 * include in EXIF</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001867 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001868 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001869 */
1870 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
1871 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
1872
1873 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001874 * <p>Time GPS fix was made to include in
1875 * EXIF</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001876 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001877 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001878 */
1879 public static final Key<Long> JPEG_GPS_TIMESTAMP =
1880 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
1881
1882 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001883 * <p>Orientation of JPEG image to
1884 * write</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001885 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001886 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001887 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001888 public static final Key<Integer> JPEG_ORIENTATION =
1889 new Key<Integer>("android.jpeg.orientation", int.class);
1890
1891 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001892 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001893 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001894 * <p>85-95 is typical usage range.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001895 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001896 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001897 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001898 public static final Key<Byte> JPEG_QUALITY =
1899 new Key<Byte>("android.jpeg.quality", byte.class);
1900
1901 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001902 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001903 * thumbnail.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001904 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001905 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001906 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001907 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
1908 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
1909
1910 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001911 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001912 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
1913 * but the captured JPEG will still be a valid image.</p>
Zhijun He5a9ff372013-12-26 11:49:09 -08001914 * <p>When a jpeg image capture is issued, the thumbnail size selected should have
1915 * the same aspect ratio as the jpeg image.</p>
Zhijun He50f72432014-05-28 13:52:04 -07001916 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
1917 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
1918 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
1919 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
1920 * generate the thumbnail image. The thumbnail image will always have a smaller Field
1921 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001922 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001923 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001924 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001925 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
1926 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001927
1928 /**
Zhijun Hefb46c642014-01-14 17:57:23 -08001929 * <p>The ratio of lens focal length to the effective
1930 * aperture diameter.</p>
1931 * <p>This will only be supported on the camera devices that
1932 * have variable aperture lens. The aperture value can only be
1933 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
1934 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1935 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001936 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08001937 * to achieve manual exposure control.</p>
1938 * <p>The requested aperture value may take several frames to reach the
1939 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08001940 * aperture size in capture result metadata while the aperture is changing.
1941 * 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 -08001942 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1943 * the ON modes, this will be overridden by the camera device
1944 * auto-exposure algorithm, the overridden values are then provided
1945 * back to the user in the corresponding result.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001946 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1947 * <p><b>Full capability</b> -
1948 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1949 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08001950 *
Zhijun He399f05d2014-01-15 11:31:30 -08001951 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001952 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001953 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001954 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001955 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001956 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001957 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001958 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001959 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001960 public static final Key<Float> LENS_APERTURE =
1961 new Key<Float>("android.lens.aperture", float.class);
1962
1963 /**
Ruben Brunk855bae42014-01-17 10:30:32 -08001964 * <p>State of lens neutral density filter(s).</p>
1965 * <p>This will not be supported on most camera devices. On devices
1966 * where this is supported, this may only be set to one of the
1967 * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p>
1968 * <p>Lens filters are typically used to lower the amount of light the
1969 * sensor is exposed to (measured in steps of EV). As used here, an EV
1970 * step is the standard logarithmic representation, which are
1971 * non-negative, and inversely proportional to the amount of light
1972 * hitting the sensor. For example, setting this to 0 would result
1973 * in no reduction of the incoming light, and setting this to 2 would
1974 * mean that the filter is set to reduce incoming light by two stops
1975 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001976 * <p>It may take several frames before the lens filter density changes
1977 * to the requested value. While the filter density is still changing,
1978 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001979 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1980 * <p><b>Full capability</b> -
1981 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1982 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001983 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001984 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08001985 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001986 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001987 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001988 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001989 public static final Key<Float> LENS_FILTER_DENSITY =
1990 new Key<Float>("android.lens.filterDensity", float.class);
1991
1992 /**
Ruben Brunka20f4c22014-01-17 15:21:13 -08001993 * <p>The current lens focal length; used for optical zoom.</p>
1994 * <p>This setting controls the physical focal length of the camera
1995 * device's lens. Changing the focal length changes the field of
1996 * view of the camera device, and is usually used for optical zoom.</p>
1997 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1998 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08001999 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002000 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2001 * be set to MOVING.</p>
2002 * <p>This is expected not to be supported on most devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002003 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002004 *
2005 * @see CaptureRequest#LENS_APERTURE
2006 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2007 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002008 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002009 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002010 public static final Key<Float> LENS_FOCAL_LENGTH =
2011 new Key<Float>("android.lens.focalLength", float.class);
2012
2013 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002014 * <p>Distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002015 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002016 * <p>Should be zero for fixed-focus cameras</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002017 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2018 * <p><b>Full capability</b> -
2019 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2020 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2021 *
2022 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002023 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002024 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002025 public static final Key<Float> LENS_FOCUS_DISTANCE =
2026 new Key<Float>("android.lens.focusDistance", float.class);
2027
2028 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002029 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002030 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002031 * <p>If variable focus not supported, can still report
2032 * fixed depth of field range</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002033 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2034 * <p><b>Limited capability</b> -
2035 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2036 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2037 *
2038 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002039 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002040 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002041 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2042 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 -07002043
2044 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002045 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2046 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002047 * <p>OIS is used to compensate for motion blur due to small
2048 * movements of the camera during capture. Unlike digital image
2049 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2050 * makes use of mechanical elements to stabilize the camera
2051 * sensor, and thus allows for longer exposure times before
2052 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002053 * <p>Switching between different optical stabilization modes may take several
2054 * frames to initialize, the camera device will report the current mode in
2055 * capture result metadata. For example, When "ON" mode is requested, the
2056 * optical stabilization modes in the first several capture results may still
2057 * be "OFF", and it will become "ON" when the initialization is done.</p>
2058 * <p>If a camera device supports both OIS and EIS ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}),
2059 * turning both modes on may produce undesirable interaction, so it is recommended not
2060 * to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002061 * <p>Not all devices will support OIS; see
2062 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2063 * available controls.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002064 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2065 * <p><b>Limited capability</b> -
2066 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2067 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002068 *
2069 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002070 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002071 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002072 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2073 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2074 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002075 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002076 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2077 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2078
2079 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002080 * <p>Current lens status.</p>
2081 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2082 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2083 * they may take several frames to reach the requested values. This state indicates
2084 * the current status of the lens parameters.</p>
2085 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2086 * either because the parameters are all fixed, or because the lens has had enough
2087 * time to reach the most recently-requested values.
2088 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2089 * <ul>
2090 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2091 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2092 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2093 * which means the optical zoom is not supported.</li>
2094 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2095 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2096 * </ul>
2097 * <p>Then this state will always be STATIONARY.</p>
2098 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2099 * is changing.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002100 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2101 * <p><b>Limited capability</b> -
2102 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2103 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002104 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002105 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002106 * @see CaptureRequest#LENS_APERTURE
2107 * @see CaptureRequest#LENS_FILTER_DENSITY
2108 * @see CaptureRequest#LENS_FOCAL_LENGTH
2109 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2110 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2111 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2112 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2113 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002114 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002115 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002116 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002117 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002118 public static final Key<Integer> LENS_STATE =
2119 new Key<Integer>("android.lens.state", int.class);
2120
2121 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002122 * <p>Mode of operation for the noise reduction algorithm.</p>
Zhijun He28079362013-12-17 10:35:40 -08002123 * <p>Noise filtering control. OFF means no noise reduction
Zhijun Hecc28a412014-02-24 15:11:23 -08002124 * will be applied by the camera device.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002125 * <p>This must be set to a valid mode from
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002126 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002127 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2128 * will be applied. HIGH_QUALITY mode indicates that the camera device
2129 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002130 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08002131 * slow down capture rate when applying noise filtering.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002132 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2133 * <p><b>Full capability</b> -
2134 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2135 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002136 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002137 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002138 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002139 * @see #NOISE_REDUCTION_MODE_OFF
2140 * @see #NOISE_REDUCTION_MODE_FAST
2141 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
2142 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002143 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002144 public static final Key<Integer> NOISE_REDUCTION_MODE =
2145 new Key<Integer>("android.noiseReduction.mode", int.class);
2146
2147 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002148 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002149 * final one for the capture, or only a partial that contains a
2150 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002151 * values.</p>
2152 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002153 * single capture may not overlap, except for this entry. The
2154 * FINAL buffers must retain FIFO ordering relative to the
2155 * requests that generate them, so the FINAL buffer for frame 3 must
2156 * always be sent to the framework after the FINAL buffer for frame 2, and
2157 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2158 * in any order relative to other frames, but all PARTIAL buffers for a given
2159 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002160 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002161 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002162 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002163 * @hide
2164 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002165 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002166 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2167 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2168
2169 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002170 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002171 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002172 * frameCount value).</p>
2173 * <p>Reset on release()</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002174 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002175 * @deprecated
2176 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002177 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002178 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002179 public static final Key<Integer> REQUEST_FRAME_COUNT =
2180 new Key<Integer>("android.request.frameCount", int.class);
2181
2182 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002183 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002184 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002185 * frame</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002186 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002187 * @hide
2188 */
2189 public static final Key<Integer> REQUEST_ID =
2190 new Key<Integer>("android.request.id", int.class);
2191
2192 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002193 * <p>Specifies the number of pipeline stages the frame went
2194 * through from when it was exposed to when the final completed result
2195 * was available to the framework.</p>
2196 * <p>Depending on what settings are used in the request, and
2197 * what streams are configured, the data may undergo less processing,
2198 * and some pipeline stages skipped.</p>
2199 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002200 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002201 *
2202 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2203 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002204 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002205 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2206 new Key<Byte>("android.request.pipelineDepth", byte.class);
2207
2208 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002209 * <p>The region of the sensor to read out for this capture.</p>
2210 * <p>The crop region coordinate system is based off
2211 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2212 * top-left corner of the sensor active array.</p>
2213 * <p>Output streams use this rectangle to produce their output,
2214 * cropping to a smaller region if necessary to maintain the
2215 * stream's aspect ratio, then scaling the sensor input to
2216 * match the output's configured resolution.</p>
2217 * <p>The crop region is applied after the RAW to other color
2218 * space (e.g. YUV) conversion. Since raw streams
2219 * (e.g. RAW16) don't have the conversion stage, they are not
2220 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002221 * <p>For non-raw streams, any additional per-stream cropping will
2222 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002223 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002224 * ratio, then 4:3 streams will use the exact crop
2225 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002226 * (letterbox).</p>
2227 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002228 * outputs will crop horizontally (pillarbox), and 16:9
2229 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002230 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002231 * <p>The width and height of the crop region cannot
2232 * be set to be smaller than
2233 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2234 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2235 * <p>The camera device may adjust the crop region to account
2236 * for rounding and other hardware requirements; the final
2237 * crop region used will be included in the output capture
2238 * result.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002239 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002240 *
2241 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002242 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002243 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002244 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002245 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2246 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2247
2248 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002249 * <p>Duration each pixel is exposed to
2250 * light.</p>
2251 * <p>If the sensor can't expose this exact duration, it should shorten the
2252 * duration exposed to the nearest possible value (rather than expose longer).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002253 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2254 * <p><b>Full capability</b> -
2255 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2256 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2257 *
2258 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002259 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002260 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002261 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2262 new Key<Long>("android.sensor.exposureTime", long.class);
2263
2264 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002265 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002266 * start of next frame exposure.</p>
2267 * <p>The maximum frame rate that can be supported by a camera subsystem is
2268 * a function of many factors:</p>
2269 * <ul>
2270 * <li>Requested resolutions of output image streams</li>
2271 * <li>Availability of binning / skipping modes on the imager</li>
2272 * <li>The bandwidth of the imager interface</li>
2273 * <li>The bandwidth of the various ISP processing blocks</li>
2274 * </ul>
2275 * <p>Since these factors can vary greatly between different ISPs and
2276 * sensors, the camera abstraction tries to represent the bandwidth
2277 * restrictions with as simple a model as possible.</p>
2278 * <p>The model presented has the following characteristics:</p>
2279 * <ul>
2280 * <li>The image sensor is always configured to output the smallest
2281 * resolution possible given the application's requested output stream
2282 * sizes. The smallest resolution is defined as being at least as large
2283 * as the largest requested output stream size; the camera pipeline must
2284 * never digitally upsample sensor data when the crop region covers the
2285 * whole sensor. In general, this means that if only small output stream
2286 * resolutions are configured, the sensor can provide a higher frame
2287 * rate.</li>
2288 * <li>Since any request may use any or all the currently configured
2289 * output streams, the sensor and ISP must be configured to support
2290 * scaling a single capture to all the streams at the same time. This
2291 * means the camera pipeline must be ready to produce the largest
2292 * requested output size without any delay. Therefore, the overall
2293 * frame rate of a given configured stream set is governed only by the
2294 * largest requested stream resolution.</li>
2295 * <li>Using more than one output stream in a request does not affect the
2296 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002297 * <li>Certain format-streams may need to do additional background processing
2298 * before data is consumed/produced by that stream. These processors
2299 * can run concurrently to the rest of the camera pipeline, but
2300 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002301 * </ul>
2302 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002303 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2304 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002305 * These are used to determine the maximum frame rate / minimum frame
2306 * duration that is possible for a given stream configuration.</p>
2307 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002308 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002309 * device:</p>
2310 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002311 * <li>Let the set of currently configured input/output streams
2312 * be called <code>S</code>.</li>
2313 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002314 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2315 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002316 * its respective size/format). Let this set of frame durations be called
2317 * <code>F</code>.</li>
2318 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2319 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2320 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002321 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002322 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002323 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2324 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002325 * <code>F</code> determines the steady state frame rate that the application will
2326 * get if it uses <code>R</code> as a repeating request. Let this special kind
2327 * of request be called <code>Rsimple</code>.</p>
2328 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2329 * by a single capture of a new request <code>Rstall</code> (which has at least
2330 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2331 * same minimum frame duration this will not cause a frame rate loss
2332 * if all buffers from the previous <code>Rstall</code> have already been
2333 * delivered.</p>
2334 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002335 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002336 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2337 * <p><b>Full capability</b> -
2338 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2339 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002340 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002341 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin9c595172014-05-12 13:56:20 -07002342 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002343 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002344 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002345 public static final Key<Long> SENSOR_FRAME_DURATION =
2346 new Key<Long>("android.sensor.frameDuration", long.class);
2347
2348 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002349 * <p>The amount of gain applied to sensor data
2350 * before processing.</p>
2351 * <p>The sensitivity is the standard ISO sensitivity value,
2352 * as defined in ISO 12232:2006.</p>
2353 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2354 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2355 * is guaranteed to use only analog amplification for applying the gain.</p>
2356 * <p>If the camera device cannot apply the exact sensitivity
2357 * requested, it will reduce the gain to the nearest supported
2358 * value. The final sensitivity used will be available in the
2359 * output capture result.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002360 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2361 * <p><b>Full capability</b> -
2362 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2363 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002364 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002365 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002366 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2367 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002368 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002369 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002370 public static final Key<Integer> SENSOR_SENSITIVITY =
2371 new Key<Integer>("android.sensor.sensitivity", int.class);
2372
2373 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002374 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07002375 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002376 * <p>The timestamps are also included in all image
2377 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07002378 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002379 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07002380 * the timestamps measure time since an unspecified starting point,
2381 * and are monotonically increasing. They can be compared with the
2382 * timestamps for other captures from the same camera device, but are
2383 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002384 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME,
Zhijun He45fa43a12014-06-13 18:29:37 -07002385 * the timestamps measure time in the same timebase as
2386 * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2387 * compared to other timestamps from other subsystems that are using
2388 * that base.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002389 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002390 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002391 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002392 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002393 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002394 public static final Key<Long> SENSOR_TIMESTAMP =
2395 new Key<Long>("android.sensor.timestamp", long.class);
2396
2397 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002398 * <p>The estimated camera neutral color in the native sensor colorspace at
2399 * the time of capture.</p>
2400 * <p>This value gives the neutral color point encoded as an RGB value in the
2401 * native sensor color space. The neutral color point indicates the
2402 * currently estimated white point of the scene illumination. It can be
2403 * used to interpolate between the provided color transforms when
2404 * processing raw sensor data.</p>
2405 * <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 -08002406 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2407 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002408 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08002409 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2410 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2411
2412 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002413 * <p>Noise model coefficients for each CFA mosaic channel.</p>
2414 * <p>This tag contains two noise model coefficients for each CFA channel
2415 * corresponding to the sensor amplification (S) and sensor readout
2416 * noise (O). These are given as pairs of coefficients for each channel
2417 * in the same order as channels listed for the CFA layout tag
2418 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
2419 * represented as an array of Pair&lt;Double, Double&gt;, where
2420 * the first member of the Pair at index n is the S coefficient and the
2421 * second member is the O coefficient for the nth color channel in the CFA.</p>
2422 * <p>These coefficients are used in a two parameter noise model to describe
2423 * the amount of noise present in the image for each CFA channel. The
2424 * noise model used here is:</p>
2425 * <p>N(x) = sqrt(Sx + O)</p>
2426 * <p>Where x represents the recorded signal of a CFA channel normalized to
2427 * the range [0, 1], and S and O are the noise model coeffiecients for
2428 * that channel.</p>
2429 * <p>A more detailed description of the noise model can be found in the
2430 * Adobe DNG specification for the NoiseProfile tag.</p>
2431 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2432 *
2433 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2434 */
2435 @PublicKey
2436 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
2437 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
2438
2439 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002440 * <p>The worst-case divergence between Bayer green channels.</p>
2441 * <p>This value is an estimate of the worst case split between the
2442 * Bayer green channels in the red and blue rows in the sensor color
2443 * filter array.</p>
2444 * <p>The green split is calculated as follows:</p>
2445 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002446 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2447 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2448 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2449 * chosen is implementation defined, and should be chosen to provide a
2450 * green split estimate that is both representative of the entire image
2451 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002452 * <li>The arithmetic mean of the green channels from the red
2453 * rows (mean_Gr) within W is computed.</li>
2454 * <li>The arithmetic mean of the green channels from the blue
2455 * rows (mean_Gb) within W is computed.</li>
2456 * <li>The maximum ratio R of the two means is computed as follows:
2457 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2458 * </ol>
2459 * <p>The ratio R is the green split divergence reported for this property,
2460 * which represents how much the green channels differ in the mosaic
2461 * pattern. This value is typically used to determine the treatment of
2462 * the green mosaic channels when demosaicing.</p>
2463 * <p>The green split value can be roughly interpreted as follows:</p>
2464 * <ul>
2465 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2466 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2467 * correction to avoid demosaic errors (3-20% divergence).</li>
2468 * <li>R &gt; 1.20 will require strong software correction to produce
2469 * a usuable image (&gt;20% divergence).</li>
2470 * </ul>
2471 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2472 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002473 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08002474 public static final Key<Float> SENSOR_GREEN_SPLIT =
2475 new Key<Float>("android.sensor.greenSplit", float.class);
2476
2477 /**
Zhijun He379af012014-05-06 11:54:54 -07002478 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2479 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2480 * <p>Each color channel is treated as an unsigned 32-bit integer.
2481 * The camera device then uses the most significant X bits
2482 * that correspond to how many bits are in its Bayer raw sensor
2483 * output.</p>
2484 * <p>For example, a sensor with RAW10 Bayer output would use the
2485 * 10 most significant bits from each color channel.</p>
2486 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2487 *
2488 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2489 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002490 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002491 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2492 new Key<int[]>("android.sensor.testPatternData", int[].class);
2493
2494 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002495 * <p>When enabled, the sensor sends a test pattern instead of
2496 * doing a real exposure from the camera.</p>
2497 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002498 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002499 * work as normal.</p>
2500 * <p>For example, if manual flash is enabled, flash firing should still
2501 * occur (and that the test pattern remain unmodified, since the flash
2502 * would not actually affect it).</p>
2503 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2504 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2505 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2506 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2507 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2508 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2509 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2510 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002511 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002512 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2513 new Key<Integer>("android.sensor.testPatternMode", int.class);
2514
2515 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07002516 * <p>Duration between the start of first row exposure
2517 * and the start of last row exposure.</p>
2518 * <p>This is the exposure time skew (in the unit of nanosecond) between the first and
2519 * last row exposure start times. The first row and the last row are the first
2520 * and last rows inside of the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2521 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
2522 * to the frame readout time.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002523 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2524 * <p><b>Limited capability</b> -
2525 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2526 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07002527 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002528 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07002529 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2530 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002531 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07002532 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
2533 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
2534
2535 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002536 * <p>Quality of lens shading correction applied
2537 * to the image data.</p>
2538 * <p>When set to OFF mode, no lens shading correction will be applied by the
2539 * camera device, and an identity lens shading map data will be provided
2540 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
Ruben Brunk57493682014-05-27 18:58:08 -07002541 * shading map with size specified as <code>android.lens.info.shadingMapSize = [ 4, 3 ]</code>,
2542 * the output android.statistics.lensShadingMap for this case will be an identity map
Zhijun Heba93fe62014-01-17 16:43:05 -08002543 * shown below:</p>
2544 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2545 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2546 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2547 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2548 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2549 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
2550 * </code></pre>
2551 * <p>When set to other modes, lens shading correction will be applied by the
2552 * camera device. Applications can request lens shading map data by setting
2553 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide
Ruben Brunk57493682014-05-27 18:58:08 -07002554 * lens shading map data in android.statistics.lensShadingMap, with size specified
2555 * by android.lens.info.shadingMapSize; the returned shading map data will be the one
Zhijun Hefa7c7552014-05-22 16:36:02 -07002556 * applied by the camera device for this capture request.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002557 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore the reliability
Zhijun Hefa7c7552014-05-22 16:36:02 -07002558 * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in
2559 * AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code> OFF),
2560 * to get best results, it is recommended that the applications wait for the AE and AWB to
2561 * be converged before using the returned shading map data.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002562 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2563 * <p><b>Full capability</b> -
2564 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2565 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002566 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002567 * @see CaptureRequest#CONTROL_AE_MODE
2568 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002569 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heba93fe62014-01-17 16:43:05 -08002570 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2571 * @see #SHADING_MODE_OFF
2572 * @see #SHADING_MODE_FAST
2573 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002574 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002575 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08002576 public static final Key<Integer> SHADING_MODE =
2577 new Key<Integer>("android.shading.mode", int.class);
2578
2579 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002580 * <p>Control for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002581 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002582 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002583 * should output just the basic fields or the full set of
2584 * fields. Value must be one of the
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002585 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.
2586 * This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002587 *
2588 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002589 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2590 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2591 * @see #STATISTICS_FACE_DETECT_MODE_FULL
2592 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002593 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002594 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2595 new Key<Integer>("android.statistics.faceDetectMode", int.class);
2596
2597 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002598 * <p>List of unique IDs for detected faces.</p>
2599 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
2600 * to the camera device. A face that leaves the field of view and later returns may be
2601 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002602 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
2603 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002604 *
2605 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002606 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002607 */
2608 public static final Key<int[]> STATISTICS_FACE_IDS =
2609 new Key<int[]>("android.statistics.faceIds", int[].class);
2610
2611 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002612 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002613 * faces.</p>
2614 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2615 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002616 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
2617 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002618 *
2619 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2620 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002621 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002622 */
2623 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
2624 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
2625
2626 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002627 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002628 * faces.</p>
2629 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2630 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002631 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
2632 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002633 *
2634 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2635 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002636 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002637 */
2638 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
2639 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
2640
2641 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002642 * <p>List of the face confidence scores for
2643 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002644 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002645 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002646 *
2647 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002648 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002649 */
2650 public static final Key<byte[]> STATISTICS_FACE_SCORES =
2651 new Key<byte[]>("android.statistics.faceScores", byte[].class);
2652
2653 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002654 * <p>List of the faces detected through camera face detection
2655 * in this result.</p>
2656 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002657 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002658 *
2659 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
2660 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002661 @PublicKey
2662 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002663 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
2664 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
2665
2666 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002667 * <p>The shading map is a low-resolution floating-point map
2668 * that lists the coefficients used to correct for vignetting, for each
2669 * Bayer color channel.</p>
2670 * <p>The least shaded section of the image should have a gain factor
2671 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002672 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08002673 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002674 * <p>The shading map is for the entire active pixel array, and is not
2675 * affected by the crop region specified in the request. Each shading map
2676 * entry is the value of the shading compensation map over a specific
2677 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2678 * map, and an active pixel array size (W x H), shading map entry
2679 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2680 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2681 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2682 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2683 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07002684 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002685 * <p>The shading map should have on the order of 30-40 rows and columns,
2686 * and must be smaller than 64x64.</p>
2687 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002688 * <pre><code>width,height = [ 4, 3 ]
2689 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002690 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002691 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2692 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2693 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2694 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2695 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002696 * </code></pre>
2697 * <p>The low-resolution scaling map images for each channel are
2698 * (displayed using nearest-neighbor interpolation):</p>
2699 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2700 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2701 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2702 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2703 * <p>As a visualization only, inverting the full-color map to recover an
2704 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2705 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002706 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2707 * <p><b>Full capability</b> -
2708 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2709 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002710 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002711 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002712 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07002713 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002714 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07002715 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
2716 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
2717
2718 /**
2719 * <p>The shading map is a low-resolution floating-point map
2720 * that lists the coefficients used to correct for vignetting, for each
2721 * Bayer color channel.</p>
2722 * <p>The least shaded section of the image should have a gain factor
2723 * of 1; all other sections should have gains above 1.</p>
2724 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
2725 * must take into account the colorCorrection settings.</p>
2726 * <p>The shading map is for the entire active pixel array, and is not
2727 * affected by the crop region specified in the request. Each shading map
2728 * entry is the value of the shading compensation map over a specific
2729 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2730 * map, and an active pixel array size (W x H), shading map entry
2731 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2732 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2733 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2734 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2735 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
2736 * The shading map is stored in a fully interleaved format, and its size
2737 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
2738 * <p>The shading map should have on the order of 30-40 rows and columns,
2739 * and must be smaller than 64x64.</p>
2740 * <p>As an example, given a very small map defined as:</p>
2741 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
2742 * android.statistics.lensShadingMap =
2743 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
2744 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2745 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2746 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2747 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2748 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
2749 * </code></pre>
2750 * <p>The low-resolution scaling map images for each channel are
2751 * (displayed using nearest-neighbor interpolation):</p>
2752 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2753 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2754 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2755 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2756 * <p>As a visualization only, inverting the full-color map to recover an
2757 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2758 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002759 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2760 * <p><b>Full capability</b> -
2761 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2762 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002763 *
2764 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002765 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07002766 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002767 */
2768 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
2769 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
2770
2771 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002772 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08002773 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002774 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002775 * since statistics processing on data from a new frame
2776 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08002777 * applied to that frame.</p>
2778 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002779 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002780 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08002781 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002782 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002783 *
2784 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07002785 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002786 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002787 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002788 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002789 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
2790 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
2791
2792 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002793 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08002794 * calculated by the camera device's statistics units for the current
2795 * output frame.</p>
2796 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002797 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08002798 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002799 * are the best fit for the current output frame. This may
2800 * be different than the transform used for this frame, since
2801 * statistics processing on data from a new frame typically
2802 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002803 * that frame.</p>
2804 * <p>These estimates must be provided for all frames, even if
2805 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002806 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08002807 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002808 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002809 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002810 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002811 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002812 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002813 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
2814 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
2815
2816 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08002817 * <p>The camera device estimated scene illumination lighting
2818 * frequency.</p>
2819 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
2820 * that depends on the local utility power standards. This flicker must be
2821 * accounted for by auto-exposure routines to avoid artifacts in captured images.
2822 * The camera device uses this entry to tell the application what the scene
2823 * illuminant frequency is.</p>
2824 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002825 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
2826 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
2827 * antibanding, and the application can ensure it selects
2828 * exposure times that do not cause banding issues by looking
2829 * into this metadata field. See
2830 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
2831 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002832 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2833 * <p><b>Full capability</b> -
2834 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2835 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08002836 *
2837 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
2838 * @see CaptureRequest#CONTROL_AE_MODE
2839 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002840 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002841 * @see #STATISTICS_SCENE_FLICKER_NONE
2842 * @see #STATISTICS_SCENE_FLICKER_50HZ
2843 * @see #STATISTICS_SCENE_FLICKER_60HZ
2844 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002845 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002846 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
2847 new Key<Integer>("android.statistics.sceneFlicker", int.class);
2848
2849 /**
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002850 * <p>Operating mode for hotpixel map generation.</p>
2851 * <p>If set to ON, a hotpixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002852 * If set to OFF, no hotpixel map will be returned.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002853 * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002854 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002855 *
2856 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2857 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2858 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002859 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002860 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2861 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2862
2863 /**
2864 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
2865 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
2866 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
2867 * bottom-right of the pixel array, respectively. The width and
2868 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
2869 * This may include hot pixels that lie outside of the active array
2870 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002871 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002872 *
2873 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2874 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2875 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002876 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002877 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
2878 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002879
2880 /**
Zhijun He379af012014-05-06 11:54:54 -07002881 * <p>Whether the camera device will output the lens
2882 * shading map in output result metadata.</p>
2883 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002884 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07002885 * the output result metadata.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002886 * <p>Required for devices with the RAW capability.</p>
2887 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2888 * <p><b>Full capability</b> -
2889 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2890 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2891 *
2892 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -07002893 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2894 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2895 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002896 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002897 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2898 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2899
2900 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002901 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08002902 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2903 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002904 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002905 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2906 * <p><b>Full capability</b> -
2907 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2908 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002909 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002910 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08002911 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002912 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002913 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002914 public static final Key<float[]> TONEMAP_CURVE_BLUE =
2915 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002916
2917 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002918 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08002919 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2920 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002921 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002922 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2923 * <p><b>Full capability</b> -
2924 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2925 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002926 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002927 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08002928 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002929 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002930 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002931 public static final Key<float[]> TONEMAP_CURVE_GREEN =
2932 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002933
2934 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002935 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08002936 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2937 * CONTRAST_CURVE.</p>
2938 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002939 * <pre><code>android.tonemap.curveRed =
Igor Murashkine0060932014-01-17 17:24:11 -08002940 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08002941 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Igor Murashkine0060932014-01-17 17:24:11 -08002942 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2943 * guaranteed that input values 0.0 and 1.0 are included in the list to
2944 * define a complete mapping. For input values between control points,
2945 * the camera device must linearly interpolate between the control
2946 * points.</p>
2947 * <p>Each curve can have an independent number of points, and the number
2948 * of points can be less than max (that is, the request doesn't have to
2949 * always provide a curve with number of points equivalent to
2950 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2951 * <p>A few examples, and their corresponding graphical mappings; these
2952 * only specify the red channel and the precision is limited to 4
2953 * digits, for conciseness.</p>
2954 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002955 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002956 * </code></pre>
2957 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2958 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002959 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002960 * </code></pre>
2961 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2962 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002963 * <pre><code>android.tonemap.curveRed = [
Igor Murashkine0060932014-01-17 17:24:11 -08002964 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2965 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2966 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2967 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
2968 * </code></pre>
2969 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2970 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002971 * <pre><code>android.tonemap.curveRed = [
Igor Murashkine0060932014-01-17 17:24:11 -08002972 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2973 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2974 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2975 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
2976 * </code></pre>
2977 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002978 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2979 * <p><b>Full capability</b> -
2980 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2981 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002982 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002983 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08002984 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002985 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002986 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002987 */
2988 public static final Key<float[]> TONEMAP_CURVE_RED =
2989 new Key<float[]>("android.tonemap.curveRed", float[].class);
2990
2991 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002992 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
2993 * is CONTRAST_CURVE.</p>
2994 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
2995 * channels respectively. The following example uses the red channel as an
2996 * example. The same logic applies to green and blue channel.
2997 * Each channel's curve is defined by an array of control points:</p>
2998 * <pre><code>curveRed =
2999 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
3000 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3001 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
3002 * guaranteed that input values 0.0 and 1.0 are included in the list to
3003 * define a complete mapping. For input values between control points,
3004 * the camera device must linearly interpolate between the control
3005 * points.</p>
3006 * <p>Each curve can have an independent number of points, and the number
3007 * of points can be less than max (that is, the request doesn't have to
3008 * always provide a curve with number of points equivalent to
3009 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3010 * <p>A few examples, and their corresponding graphical mappings; these
3011 * only specify the red channel and the precision is limited to 4
3012 * digits, for conciseness.</p>
3013 * <p>Linear mapping:</p>
3014 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
3015 * </code></pre>
3016 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3017 * <p>Invert mapping:</p>
3018 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
3019 * </code></pre>
3020 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3021 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
3022 * <pre><code>curveRed = [
3023 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
3024 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
3025 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
3026 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
3027 * </code></pre>
3028 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3029 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
3030 * <pre><code>curveRed = [
3031 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
3032 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
3033 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
3034 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
3035 * </code></pre>
3036 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003037 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3038 * <p><b>Full capability</b> -
3039 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3040 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003041 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003042 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003043 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
3044 * @see CaptureRequest#TONEMAP_MODE
3045 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003046 @PublicKey
3047 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003048 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
3049 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
3050
3051 /**
Igor Murashkine0060932014-01-17 17:24:11 -08003052 * <p>High-level global contrast/gamma/tonemapping control.</p>
3053 * <p>When switching to an application-defined contrast curve by setting
3054 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
3055 * per-channel with a set of <code>(in, out)</code> points that specify the
3056 * mapping from input high-bit-depth pixel value to the output
3057 * low-bit-depth value. Since the actual pixel ranges of both input
3058 * and output may change depending on the camera pipeline, the values
3059 * are specified by normalized floating-point numbers.</p>
3060 * <p>More-complex color mapping operations such as 3D color look-up
3061 * tables, selective chroma enhancement, or other non-linear color
3062 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3063 * CONTRAST_CURVE.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003064 * <p>This must be set to a valid mode in
3065 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08003066 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003067 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08003068 * These values are always available, and as close as possible to the
3069 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07003070 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08003071 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
3072 * roughly the same.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003073 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3074 * <p><b>Full capability</b> -
3075 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3076 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003077 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003078 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003079 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003080 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08003081 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003082 * @see #TONEMAP_MODE_CONTRAST_CURVE
3083 * @see #TONEMAP_MODE_FAST
3084 * @see #TONEMAP_MODE_HIGH_QUALITY
3085 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003086 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003087 public static final Key<Integer> TONEMAP_MODE =
3088 new Key<Integer>("android.tonemap.mode", int.class);
3089
3090 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003091 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003092 * that the camera is powered on and may be streaming images back to the
3093 * Application Processor. In certain rare circumstances, the OS may
3094 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003095 * any untrusted applications.</p>
3096 * <p>In particular, the LED <em>must</em> always be on when the data could be
3097 * transmitted off the device. The LED <em>should</em> always be on whenever
3098 * data is stored locally on the device.</p>
3099 * <p>The LED <em>may</em> be off if a trusted application is using the data that
3100 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003101 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003102 * @hide
3103 */
3104 public static final Key<Boolean> LED_TRANSMIT =
3105 new Key<Boolean>("android.led.transmit", boolean.class);
3106
3107 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003108 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003109 * to its current values, or is free to vary.</p>
3110 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003111 * 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 -08003112 * a change in other capture settings forced the camera device to
3113 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003114 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3115 * <p><b>Full capability</b> -
3116 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3117 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003118 *
3119 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003120 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003121 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003122 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003123 public static final Key<Boolean> BLACK_LEVEL_LOCK =
3124 new Key<Boolean>("android.blackLevel.lock", boolean.class);
3125
Igor Murashkin3865a842014-01-17 18:18:39 -08003126 /**
3127 * <p>The frame number corresponding to the last request
3128 * with which the output result (metadata + buffers) has been fully
3129 * synchronized.</p>
3130 * <p>When a request is submitted to the camera device, there is usually a
3131 * delay of several frames before the controls get applied. A camera
3132 * device may either choose to account for this delay by implementing a
3133 * pipeline and carefully submit well-timed atomic control updates, or
3134 * it may start streaming control changes that span over several frame
3135 * boundaries.</p>
3136 * <p>In the latter case, whenever a request's settings change relative to
3137 * the previous submitted request, the full set of changes may take
3138 * multiple frame durations to fully take effect. Some settings may
3139 * take effect sooner (in less frame durations) than others.</p>
3140 * <p>While a set of control changes are being propagated, this value
3141 * will be CONVERGING.</p>
3142 * <p>Once it is fully known that a set of control changes have been
3143 * finished propagating, and the resulting updated control settings
3144 * have been read back by the camera device, this value will be set
3145 * to a non-negative frame number (corresponding to the request to
3146 * which the results have synchronized to).</p>
3147 * <p>Older camera device implementations may not have a way to detect
3148 * when all camera controls have been applied, and will always set this
3149 * value to UNKNOWN.</p>
3150 * <p>FULL capability devices will always have this value set to the
3151 * frame number of the request corresponding to this result.</p>
3152 * <p><em>Further details</em>:</p>
3153 * <ul>
3154 * <li>Whenever a request differs from the last request, any future
3155 * results not yet returned may have this value set to CONVERGING (this
3156 * could include any in-progress captures not yet returned by the camera
3157 * device, for more details see pipeline considerations below).</li>
3158 * <li>Submitting a series of multiple requests that differ from the
3159 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
3160 * moves the new synchronization frame to the last non-repeating
3161 * request (using the smallest frame number from the contiguous list of
3162 * repeating requests).</li>
3163 * <li>Submitting the same request repeatedly will not change this value
3164 * to CONVERGING, if it was already a non-negative value.</li>
3165 * <li>When this value changes to non-negative, that means that all of the
3166 * metadata controls from the request have been applied, all of the
3167 * metadata controls from the camera device have been read to the
3168 * updated values (into the result), and all of the graphics buffers
3169 * corresponding to this result are also synchronized to the request.</li>
3170 * </ul>
3171 * <p><em>Pipeline considerations</em>:</p>
3172 * <p>Submitting a request with updated controls relative to the previously
3173 * submitted requests may also invalidate the synchronization state
3174 * of all the results corresponding to currently in-flight requests.</p>
3175 * <p>In other words, results for this current request and up to
3176 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
3177 * android.sync.frameNumber change to CONVERGING.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003178 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003179 *
3180 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3181 * @see #SYNC_FRAME_NUMBER_CONVERGING
3182 * @see #SYNC_FRAME_NUMBER_UNKNOWN
3183 * @hide
3184 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07003185 public static final Key<Long> SYNC_FRAME_NUMBER =
3186 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08003187
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003188 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3189 * End generated code
3190 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07003191
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003192
3193
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08003194}