blob: 5642f6ff0e43e155355b0da587d2ff202f58327d [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
330 /**
Zhijun He379af012014-05-06 11:54:54 -0700331 * <p>The mode control selects how the image data is converted from the
332 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700333 * <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 -0700334 * control is overridden by the AWB routine. When AWB is disabled, the
335 * application controls how the color mapping is performed.</p>
336 * <p>We define the expected processing pipeline below. For consistency
337 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
338 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
339 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
340 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
341 * camera device (in the results) and be roughly correct.</p>
342 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
343 * FAST or HIGH_QUALITY will yield a picture with the same white point
344 * as what was produced by the camera device in the earlier frame.</p>
345 * <p>The expected processing pipeline is as follows:</p>
346 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
347 * <p>The white balance is encoded by two values, a 4-channel white-balance
348 * gain vector (applied in the Bayer domain), and a 3x3 color transform
349 * matrix (applied after demosaic).</p>
350 * <p>The 4-channel white-balance gains are defined as:</p>
351 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
352 * </code></pre>
353 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
354 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
355 * These may be identical for a given camera device implementation; if
356 * the camera device does not support a separate gain for even/odd green
357 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
358 * <code>G_even</code> in the output result metadata.</p>
359 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
360 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
361 * </code></pre>
362 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
363 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
364 * <p>with colors as follows:</p>
365 * <pre><code>r' = I0r + I1g + I2b
366 * g' = I3r + I4g + I5b
367 * b' = I6r + I7g + I8b
368 * </code></pre>
369 * <p>Both the input and output value ranges must match. Overflow/underflow
370 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700371 * <p><b>Possible values:</b>
372 * <ul>
373 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
374 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
375 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
376 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700377 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
378 * <p><b>Full capability</b> -
379 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
380 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700381 *
382 * @see CaptureRequest#COLOR_CORRECTION_GAINS
383 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
384 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700385 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700386 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
387 * @see #COLOR_CORRECTION_MODE_FAST
388 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
389 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700390 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700391 public static final Key<Integer> COLOR_CORRECTION_MODE =
392 new Key<Integer>("android.colorCorrection.mode", int.class);
393
394 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800395 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700396 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800397 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800398 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700399 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800400 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800401 * <p>In the latter case, the camera device may round the matrix to account
402 * for precision issues; the final rounded matrix should be reported back
403 * in this matrix result metadata. The transform should keep the magnitude
404 * of the output color values within <code>[0, 1.0]</code> (assuming input color
405 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700406 * <p><b>Units</b>: Unitless scale factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700407 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
408 * <p><b>Full capability</b> -
409 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
410 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800411 *
412 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700413 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700414 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700415 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700416 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
417 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700418
419 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800420 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800421 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700422 * <p>These per-channel gains are either set by the camera device
423 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
424 * TRANSFORM_MATRIX, or directly by the application in the
425 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
426 * TRANSFORM_MATRIX.</p>
427 * <p>The gains in the result metadata are the gains actually
428 * applied by the camera device to the current frame.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700429 * <p><b>Units</b>: Unitless gain factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700430 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
431 * <p><b>Full capability</b> -
432 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
433 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800434 *
435 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700436 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700437 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700438 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700439 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
440 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700441
442 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700443 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700444 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
445 * can not focus on the same point after exiting from the lens. This metadata defines
446 * the high level control of chromatic aberration correction algorithm, which aims to
447 * minimize the chromatic artifacts that may occur along the object boundaries in an
448 * image.</p>
449 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
450 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
451 * use the highest-quality aberration correction algorithms, even if it slows down
452 * capture rate. FAST means the camera device will not slow down capture rate when
453 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700454 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700455 * <p><b>Possible values:</b>
456 * <ul>
457 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
458 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
459 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
460 * </ul></p>
461 * <p><b>Available values for this device:</b><br>
462 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700463 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700464 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700465 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
466 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
467 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
468 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700469 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700470 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700471 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
472 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700473
474 /**
Zhijun He379af012014-05-06 11:54:54 -0700475 * <p>The desired setting for the camera device's auto-exposure
476 * algorithm's antibanding compensation.</p>
477 * <p>Some kinds of lighting fixtures, such as some fluorescent
478 * lights, flicker at the rate of the power supply frequency
479 * (60Hz or 50Hz, depending on country). While this is
480 * typically not noticeable to a person, it can be visible to
481 * a camera device. If a camera sets its exposure time to the
482 * wrong value, the flicker may become visible in the
483 * viewfinder as flicker or in a final captured image, as a
484 * set of variable-brightness bands across the image.</p>
485 * <p>Therefore, the auto-exposure routines of camera devices
486 * include antibanding routines that ensure that the chosen
487 * exposure value will not cause such banding. The choice of
488 * exposure time depends on the rate of flicker, which the
489 * camera device can detect automatically, or the expected
490 * rate can be selected by the application using this
491 * control.</p>
492 * <p>A given camera device may not support all of the possible
493 * options for the antibanding mode. The
494 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
495 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800496 * <p>AUTO mode is the default if it is available on given
497 * camera device. When AUTO mode is not available, the
498 * default will be either 50HZ or 60HZ, and both 50HZ
499 * and 60HZ will be available.</p>
Zhijun He379af012014-05-06 11:54:54 -0700500 * <p>If manual exposure control is enabled (by setting
501 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
502 * then this setting has no effect, and the application must
503 * ensure it selects exposure times that do not cause banding
504 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
505 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700506 * <p><b>Possible values:</b>
507 * <ul>
508 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
509 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
510 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
511 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
512 * </ul></p>
513 * <p><b>Available values for this device:</b><br></p>
514 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700515 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700516 *
517 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
518 * @see CaptureRequest#CONTROL_AE_MODE
519 * @see CaptureRequest#CONTROL_MODE
520 * @see CaptureResult#STATISTICS_SCENE_FLICKER
521 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
522 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
523 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
524 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
525 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700526 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700527 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
528 new Key<Integer>("android.control.aeAntibandingMode", int.class);
529
530 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700531 * <p>Adjustment to auto-exposure (AE) target image
532 * brightness.</p>
533 * <p>The adjustment is measured as a count of steps, with the
534 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
535 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
536 * <p>For example, if the exposure value (EV) step is 0.333, '6'
537 * will mean an exposure compensation of +2 EV; -3 will mean an
538 * exposure compensation of -1 EV. One EV represents a doubling
539 * of image brightness. Note that this control will only be
540 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
541 * 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 -0700542 * <p>In the event of exposure compensation value being changed, camera device
543 * may take several frames to reach the newly requested exposure target.
544 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
545 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
546 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
547 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700548 * <p><b>Units</b>: Compensation steps</p>
549 * <p><b>Range of valid values:</b><br>
550 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700551 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700552 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700553 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
554 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700555 * @see CaptureRequest#CONTROL_AE_LOCK
556 * @see CaptureRequest#CONTROL_AE_MODE
557 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700558 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700559 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700560 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
561 new Key<Integer>("android.control.aeExposureCompensation", int.class);
562
563 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700564 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700565 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700566 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
567 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
568 * <p>Note that even when AE is locked, the flash may be fired if
569 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
570 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700571 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
572 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700573 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
574 * when AE is already locked, the camera device will not change the exposure time
575 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
576 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
577 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
578 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700579 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
580 * get locked do not necessarily correspond to the settings that were present in the
581 * latest capture result received from the camera device, since additional captures
582 * and AE updates may have occurred even before the result was sent out. If an
583 * application is switching between automatic and manual control and wishes to eliminate
584 * any flicker during the switch, the following procedure is recommended:</p>
585 * <ol>
586 * <li>Starting in auto-AE mode:</li>
587 * <li>Lock AE</li>
588 * <li>Wait for the first result to be output that has the AE locked</li>
589 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
590 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
591 * </ol>
Zhijun He379af012014-05-06 11:54:54 -0700592 * <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 -0700593 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700594 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700595 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700596 * @see CaptureRequest#CONTROL_AE_MODE
597 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
598 * @see CaptureResult#CONTROL_AE_STATE
599 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
600 * @see CaptureRequest#SENSOR_SENSITIVITY
601 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700602 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700603 public static final Key<Boolean> CONTROL_AE_LOCK =
604 new Key<Boolean>("android.control.aeLock", boolean.class);
605
606 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800607 * <p>The desired mode for the camera device's
608 * auto-exposure routine.</p>
609 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
610 * AUTO.</p>
611 * <p>When set to any of the ON modes, the camera device's
612 * auto-exposure routine is enabled, overriding the
613 * application's selected exposure time, sensor sensitivity,
614 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
615 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
616 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
617 * is selected, the camera device's flash unit controls are
618 * also overridden.</p>
619 * <p>The FLASH modes are only available if the camera device
620 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
621 * <p>If flash TORCH mode is desired, this field must be set to
622 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
623 * <p>When set to any of the ON modes, the values chosen by the
624 * camera device auto-exposure routine for the overridden
625 * fields for a given capture will be available in its
626 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700627 * <p><b>Possible values:</b>
628 * <ul>
629 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
630 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
631 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
632 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
633 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
634 * </ul></p>
635 * <p><b>Available values for this device:</b><br>
636 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700637 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800638 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700639 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -0800640 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800641 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
642 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800643 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
644 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800645 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800646 * @see #CONTROL_AE_MODE_OFF
647 * @see #CONTROL_AE_MODE_ON
648 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
649 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
650 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
651 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700652 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800653 public static final Key<Integer> CONTROL_AE_MODE =
654 new Key<Integer>("android.control.aeMode", int.class);
655
656 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700657 * <p>List of metering areas to use for auto-exposure adjustment.</p>
658 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700659 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700660 * <p>The maximum number of regions supported by the device is determined by the value
661 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800662 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700663 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800664 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
665 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700666 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700667 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700668 * for every pixel in the area. This means that a large metering area
669 * with the same weight as a smaller area will have more effect in
670 * the metering result. Metering areas can partially overlap and the
671 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700672 * <p>The weights are relative to weights of other exposure metering regions, so if only one
673 * region is used, all non-zero weights will have the same effect. A region with 0
674 * weight is ignored.</p>
675 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
676 * camera device.</p>
677 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
678 * capture result metadata, the camera device will ignore the sections outside the crop
679 * region and output only the intersection rectangle as the metering region in the result
680 * metadata. If the region is entirely outside the crop region, it will be ignored and
681 * not reported in the result metadata.</p>
682 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
683 * <p><b>Range of valid values:</b><br>
684 * Coordinates must be between <code>[(0,0), (width, height))</code> of
685 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700686 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800687 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700688 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800689 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800690 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700691 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700692 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700693 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
694 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700695
696 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700697 * <p>Range over which the auto-exposure routine can
698 * adjust the capture frame rate to maintain good
699 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700700 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700701 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
702 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
703 * <p><b>Units</b>: Frames per second (FPS)</p>
704 * <p><b>Range of valid values:</b><br>
705 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
706 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700707 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700708 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Zhijun He379af012014-05-06 11:54:54 -0700709 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700710 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He379af012014-05-06 11:54:54 -0700711 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700712 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700713 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
714 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700715
716 /**
717 * <p>Whether the camera device will trigger a precapture
718 * metering sequence when it processes this request.</p>
719 * <p>This entry is normally set to IDLE, or is not
720 * included at all in the request settings. When included and
721 * set to START, the camera device will trigger the autoexposure
722 * precapture metering sequence.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700723 * <p>The precapture sequence should triggered before starting a
724 * high-quality still capture for final metering decisions to
725 * be made, and for firing pre-capture flash pulses to estimate
726 * scene brightness and required final capture flash power, when
727 * the flash is enabled.</p>
728 * <p>Normally, this entry should be set to START for only a
729 * single request, and the application should wait until the
730 * sequence completes before starting a new one.</p>
731 * <p>The exact effect of auto-exposure (AE) precapture trigger
732 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700733 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
734 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700735 * <p>On LEGACY-level devices, the precapture trigger is not supported;
736 * capturing a high-resolution JPEG image will automatically trigger a
737 * precapture sequence before the high-resolution capture, including
738 * potentially firing a pre-capture flash.</p>
739 * <p><b>Possible values:</b>
740 * <ul>
741 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
742 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
743 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700744 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
745 * <p><b>Limited capability</b> -
746 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
747 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700748 *
749 * @see CaptureResult#CONTROL_AE_STATE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700750 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700751 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
752 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
753 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700754 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700755 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
756 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
757
758 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700759 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800760 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
761 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
762 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
763 * the algorithm states to INACTIVE.</p>
764 * <p>The camera device can do several state transitions between two results, if it is
765 * allowed by the state transition table. For example: INACTIVE may never actually be
766 * seen in a result.</p>
767 * <p>The state in the result is the state for this image (in sync with this image): if
768 * AE state becomes CONVERGED, then the image data associated with this result should
769 * be good to use.</p>
770 * <p>Below are state transition tables for different AE modes.</p>
771 * <table>
772 * <thead>
773 * <tr>
774 * <th align="center">State</th>
775 * <th align="center">Transition Cause</th>
776 * <th align="center">New State</th>
777 * <th align="center">Notes</th>
778 * </tr>
779 * </thead>
780 * <tbody>
781 * <tr>
782 * <td align="center">INACTIVE</td>
783 * <td align="center"></td>
784 * <td align="center">INACTIVE</td>
785 * <td align="center">Camera device auto exposure algorithm is disabled</td>
786 * </tr>
787 * </tbody>
788 * </table>
789 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
790 * <table>
791 * <thead>
792 * <tr>
793 * <th align="center">State</th>
794 * <th align="center">Transition Cause</th>
795 * <th align="center">New State</th>
796 * <th align="center">Notes</th>
797 * </tr>
798 * </thead>
799 * <tbody>
800 * <tr>
801 * <td align="center">INACTIVE</td>
802 * <td align="center">Camera device initiates AE scan</td>
803 * <td align="center">SEARCHING</td>
804 * <td align="center">Values changing</td>
805 * </tr>
806 * <tr>
807 * <td align="center">INACTIVE</td>
808 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
809 * <td align="center">LOCKED</td>
810 * <td align="center">Values locked</td>
811 * </tr>
812 * <tr>
813 * <td align="center">SEARCHING</td>
814 * <td align="center">Camera device finishes AE scan</td>
815 * <td align="center">CONVERGED</td>
816 * <td align="center">Good values, not changing</td>
817 * </tr>
818 * <tr>
819 * <td align="center">SEARCHING</td>
820 * <td align="center">Camera device finishes AE scan</td>
821 * <td align="center">FLASH_REQUIRED</td>
822 * <td align="center">Converged but too dark w/o flash</td>
823 * </tr>
824 * <tr>
825 * <td align="center">SEARCHING</td>
826 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
827 * <td align="center">LOCKED</td>
828 * <td align="center">Values locked</td>
829 * </tr>
830 * <tr>
831 * <td align="center">CONVERGED</td>
832 * <td align="center">Camera device initiates AE scan</td>
833 * <td align="center">SEARCHING</td>
834 * <td align="center">Values changing</td>
835 * </tr>
836 * <tr>
837 * <td align="center">CONVERGED</td>
838 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
839 * <td align="center">LOCKED</td>
840 * <td align="center">Values locked</td>
841 * </tr>
842 * <tr>
843 * <td align="center">FLASH_REQUIRED</td>
844 * <td align="center">Camera device initiates AE scan</td>
845 * <td align="center">SEARCHING</td>
846 * <td align="center">Values changing</td>
847 * </tr>
848 * <tr>
849 * <td align="center">FLASH_REQUIRED</td>
850 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
851 * <td align="center">LOCKED</td>
852 * <td align="center">Values locked</td>
853 * </tr>
854 * <tr>
855 * <td align="center">LOCKED</td>
856 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
857 * <td align="center">SEARCHING</td>
858 * <td align="center">Values not good after unlock</td>
859 * </tr>
860 * <tr>
861 * <td align="center">LOCKED</td>
862 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
863 * <td align="center">CONVERGED</td>
864 * <td align="center">Values good after unlock</td>
865 * </tr>
866 * <tr>
867 * <td align="center">LOCKED</td>
868 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
869 * <td align="center">FLASH_REQUIRED</td>
870 * <td align="center">Exposure good, but too dark</td>
871 * </tr>
872 * <tr>
873 * <td align="center">PRECAPTURE</td>
874 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
875 * <td align="center">CONVERGED</td>
876 * <td align="center">Ready for high-quality capture</td>
877 * </tr>
878 * <tr>
879 * <td align="center">PRECAPTURE</td>
880 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
881 * <td align="center">LOCKED</td>
882 * <td align="center">Ready for high-quality capture</td>
883 * </tr>
884 * <tr>
885 * <td align="center">Any state</td>
886 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
887 * <td align="center">PRECAPTURE</td>
888 * <td align="center">Start AE precapture metering sequence</td>
889 * </tr>
890 * </tbody>
891 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800892 * <p>For the above table, the camera device may skip reporting any state changes that happen
893 * without application intervention (i.e. mode switch, trigger, locking). Any state that
894 * can be skipped in that manner is called a transient state.</p>
895 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
896 * listed in above table, it is also legal for the camera device to skip one or more
897 * transient states between two results. See below table for examples:</p>
898 * <table>
899 * <thead>
900 * <tr>
901 * <th align="center">State</th>
902 * <th align="center">Transition Cause</th>
903 * <th align="center">New State</th>
904 * <th align="center">Notes</th>
905 * </tr>
906 * </thead>
907 * <tbody>
908 * <tr>
909 * <td align="center">INACTIVE</td>
910 * <td align="center">Camera device finished AE scan</td>
911 * <td align="center">CONVERGED</td>
912 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
913 * </tr>
914 * <tr>
915 * <td align="center">Any state</td>
916 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
917 * <td align="center">FLASH_REQUIRED</td>
918 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
919 * </tr>
920 * <tr>
921 * <td align="center">Any state</td>
922 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
923 * <td align="center">CONVERGED</td>
924 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
925 * </tr>
926 * <tr>
927 * <td align="center">CONVERGED</td>
928 * <td align="center">Camera device finished AE scan</td>
929 * <td align="center">FLASH_REQUIRED</td>
930 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
931 * </tr>
932 * <tr>
933 * <td align="center">FLASH_REQUIRED</td>
934 * <td align="center">Camera device finished AE scan</td>
935 * <td align="center">CONVERGED</td>
936 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
937 * </tr>
938 * </tbody>
939 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700940 * <p><b>Possible values:</b>
941 * <ul>
942 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
943 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
944 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
945 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
946 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
947 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
948 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700949 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
950 * <p><b>Limited capability</b> -
951 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
952 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800953 *
954 * @see CaptureRequest#CONTROL_AE_LOCK
955 * @see CaptureRequest#CONTROL_AE_MODE
956 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
957 * @see CaptureRequest#CONTROL_MODE
958 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700959 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700960 * @see #CONTROL_AE_STATE_INACTIVE
961 * @see #CONTROL_AE_STATE_SEARCHING
962 * @see #CONTROL_AE_STATE_CONVERGED
963 * @see #CONTROL_AE_STATE_LOCKED
964 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
965 * @see #CONTROL_AE_STATE_PRECAPTURE
966 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700967 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700968 public static final Key<Integer> CONTROL_AE_STATE =
969 new Key<Integer>("android.control.aeState", int.class);
970
971 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700972 * <p>Whether auto-focus (AF) is currently enabled, and what
973 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800974 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -0800975 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
976 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
977 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
978 * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800979 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800980 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700981 * in result metadata.</p>
982 * <p><b>Possible values:</b>
983 * <ul>
984 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
985 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
986 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
987 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
988 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
989 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
990 * </ul></p>
991 * <p><b>Available values for this device:</b><br>
992 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
993 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800994 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -0800995 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700996 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800997 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -0800998 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800999 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001000 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001001 * @see #CONTROL_AF_MODE_OFF
1002 * @see #CONTROL_AF_MODE_AUTO
1003 * @see #CONTROL_AF_MODE_MACRO
1004 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1005 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1006 * @see #CONTROL_AF_MODE_EDOF
1007 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001008 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001009 public static final Key<Integer> CONTROL_AF_MODE =
1010 new Key<Integer>("android.control.afMode", int.class);
1011
1012 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001013 * <p>List of metering areas to use for auto-focus.</p>
1014 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001015 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001016 * <p>The maximum number of focus areas supported by the device is determined by the value
1017 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001018 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001019 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001020 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1021 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001022 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001023 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001024 * for every pixel in the area. This means that a large metering area
1025 * with the same weight as a smaller area will have more effect in
1026 * the metering result. Metering areas can partially overlap and the
1027 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001028 * <p>The weights are relative to weights of other metering regions, so if only one region
1029 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1030 * ignored.</p>
1031 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1032 * camera device.</p>
1033 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1034 * capture result metadata, the camera device will ignore the sections outside the crop
1035 * region and output only the intersection rectangle as the metering region in the result
1036 * metadata. If the region is entirely outside the crop region, it will be ignored and
1037 * not reported in the result metadata.</p>
1038 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1039 * <p><b>Range of valid values:</b><br>
1040 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1041 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001042 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001043 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001044 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001045 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001046 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001047 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001048 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001049 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1050 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001051
1052 /**
Zhijun He379af012014-05-06 11:54:54 -07001053 * <p>Whether the camera device will trigger autofocus for this request.</p>
1054 * <p>This entry is normally set to IDLE, or is not
1055 * included at all in the request settings.</p>
1056 * <p>When included and set to START, the camera device will trigger the
1057 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1058 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1059 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001060 * <p>Generally, applications should set this entry to START or CANCEL for only a
1061 * single capture, and then return it to IDLE (or not set at all). Specifying
1062 * START for multiple captures in a row means restarting the AF operation over
1063 * and over again.</p>
1064 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001065 * <p><b>Possible values:</b>
1066 * <ul>
1067 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1068 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1069 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1070 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001071 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001072 *
1073 * @see CaptureResult#CONTROL_AF_STATE
1074 * @see #CONTROL_AF_TRIGGER_IDLE
1075 * @see #CONTROL_AF_TRIGGER_START
1076 * @see #CONTROL_AF_TRIGGER_CANCEL
1077 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001078 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001079 public static final Key<Integer> CONTROL_AF_TRIGGER =
1080 new Key<Integer>("android.control.afTrigger", int.class);
1081
1082 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001083 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001084 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1085 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1086 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1087 * the algorithm states to INACTIVE.</p>
1088 * <p>The camera device can do several state transitions between two results, if it is
1089 * allowed by the state transition table. For example: INACTIVE may never actually be
1090 * seen in a result.</p>
1091 * <p>The state in the result is the state for this image (in sync with this image): if
1092 * AF state becomes FOCUSED, then the image data associated with this result should
1093 * be sharp.</p>
1094 * <p>Below are state transition tables for different AF modes.</p>
1095 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1096 * <table>
1097 * <thead>
1098 * <tr>
1099 * <th align="center">State</th>
1100 * <th align="center">Transition Cause</th>
1101 * <th align="center">New State</th>
1102 * <th align="center">Notes</th>
1103 * </tr>
1104 * </thead>
1105 * <tbody>
1106 * <tr>
1107 * <td align="center">INACTIVE</td>
1108 * <td align="center"></td>
1109 * <td align="center">INACTIVE</td>
1110 * <td align="center">Never changes</td>
1111 * </tr>
1112 * </tbody>
1113 * </table>
1114 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1115 * <table>
1116 * <thead>
1117 * <tr>
1118 * <th align="center">State</th>
1119 * <th align="center">Transition Cause</th>
1120 * <th align="center">New State</th>
1121 * <th align="center">Notes</th>
1122 * </tr>
1123 * </thead>
1124 * <tbody>
1125 * <tr>
1126 * <td align="center">INACTIVE</td>
1127 * <td align="center">AF_TRIGGER</td>
1128 * <td align="center">ACTIVE_SCAN</td>
1129 * <td align="center">Start AF sweep, Lens now moving</td>
1130 * </tr>
1131 * <tr>
1132 * <td align="center">ACTIVE_SCAN</td>
1133 * <td align="center">AF sweep done</td>
1134 * <td align="center">FOCUSED_LOCKED</td>
1135 * <td align="center">Focused, Lens now locked</td>
1136 * </tr>
1137 * <tr>
1138 * <td align="center">ACTIVE_SCAN</td>
1139 * <td align="center">AF sweep done</td>
1140 * <td align="center">NOT_FOCUSED_LOCKED</td>
1141 * <td align="center">Not focused, Lens now locked</td>
1142 * </tr>
1143 * <tr>
1144 * <td align="center">ACTIVE_SCAN</td>
1145 * <td align="center">AF_CANCEL</td>
1146 * <td align="center">INACTIVE</td>
1147 * <td align="center">Cancel/reset AF, Lens now locked</td>
1148 * </tr>
1149 * <tr>
1150 * <td align="center">FOCUSED_LOCKED</td>
1151 * <td align="center">AF_CANCEL</td>
1152 * <td align="center">INACTIVE</td>
1153 * <td align="center">Cancel/reset AF</td>
1154 * </tr>
1155 * <tr>
1156 * <td align="center">FOCUSED_LOCKED</td>
1157 * <td align="center">AF_TRIGGER</td>
1158 * <td align="center">ACTIVE_SCAN</td>
1159 * <td align="center">Start new sweep, Lens now moving</td>
1160 * </tr>
1161 * <tr>
1162 * <td align="center">NOT_FOCUSED_LOCKED</td>
1163 * <td align="center">AF_CANCEL</td>
1164 * <td align="center">INACTIVE</td>
1165 * <td align="center">Cancel/reset AF</td>
1166 * </tr>
1167 * <tr>
1168 * <td align="center">NOT_FOCUSED_LOCKED</td>
1169 * <td align="center">AF_TRIGGER</td>
1170 * <td align="center">ACTIVE_SCAN</td>
1171 * <td align="center">Start new sweep, Lens now moving</td>
1172 * </tr>
1173 * <tr>
1174 * <td align="center">Any state</td>
1175 * <td align="center">Mode change</td>
1176 * <td align="center">INACTIVE</td>
1177 * <td align="center"></td>
1178 * </tr>
1179 * </tbody>
1180 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001181 * <p>For the above table, the camera device may skip reporting any state changes that happen
1182 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1183 * can be skipped in that manner is called a transient state.</p>
1184 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1185 * state transitions listed in above table, it is also legal for the camera device to skip
1186 * one or more transient states between two results. See below table for examples:</p>
1187 * <table>
1188 * <thead>
1189 * <tr>
1190 * <th align="center">State</th>
1191 * <th align="center">Transition Cause</th>
1192 * <th align="center">New State</th>
1193 * <th align="center">Notes</th>
1194 * </tr>
1195 * </thead>
1196 * <tbody>
1197 * <tr>
1198 * <td align="center">INACTIVE</td>
1199 * <td align="center">AF_TRIGGER</td>
1200 * <td align="center">FOCUSED_LOCKED</td>
1201 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1202 * </tr>
1203 * <tr>
1204 * <td align="center">INACTIVE</td>
1205 * <td align="center">AF_TRIGGER</td>
1206 * <td align="center">NOT_FOCUSED_LOCKED</td>
1207 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1208 * </tr>
1209 * <tr>
1210 * <td align="center">FOCUSED_LOCKED</td>
1211 * <td align="center">AF_TRIGGER</td>
1212 * <td align="center">FOCUSED_LOCKED</td>
1213 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1214 * </tr>
1215 * <tr>
1216 * <td align="center">NOT_FOCUSED_LOCKED</td>
1217 * <td align="center">AF_TRIGGER</td>
1218 * <td align="center">FOCUSED_LOCKED</td>
1219 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1220 * </tr>
1221 * </tbody>
1222 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001223 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1224 * <table>
1225 * <thead>
1226 * <tr>
1227 * <th align="center">State</th>
1228 * <th align="center">Transition Cause</th>
1229 * <th align="center">New State</th>
1230 * <th align="center">Notes</th>
1231 * </tr>
1232 * </thead>
1233 * <tbody>
1234 * <tr>
1235 * <td align="center">INACTIVE</td>
1236 * <td align="center">Camera device initiates new scan</td>
1237 * <td align="center">PASSIVE_SCAN</td>
1238 * <td align="center">Start AF scan, Lens now moving</td>
1239 * </tr>
1240 * <tr>
1241 * <td align="center">INACTIVE</td>
1242 * <td align="center">AF_TRIGGER</td>
1243 * <td align="center">NOT_FOCUSED_LOCKED</td>
1244 * <td align="center">AF state query, Lens now locked</td>
1245 * </tr>
1246 * <tr>
1247 * <td align="center">PASSIVE_SCAN</td>
1248 * <td align="center">Camera device completes current scan</td>
1249 * <td align="center">PASSIVE_FOCUSED</td>
1250 * <td align="center">End AF scan, Lens now locked</td>
1251 * </tr>
1252 * <tr>
1253 * <td align="center">PASSIVE_SCAN</td>
1254 * <td align="center">Camera device fails current scan</td>
1255 * <td align="center">PASSIVE_UNFOCUSED</td>
1256 * <td align="center">End AF scan, Lens now locked</td>
1257 * </tr>
1258 * <tr>
1259 * <td align="center">PASSIVE_SCAN</td>
1260 * <td align="center">AF_TRIGGER</td>
1261 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001262 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001263 * </tr>
1264 * <tr>
1265 * <td align="center">PASSIVE_SCAN</td>
1266 * <td align="center">AF_TRIGGER</td>
1267 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001268 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001269 * </tr>
1270 * <tr>
1271 * <td align="center">PASSIVE_SCAN</td>
1272 * <td align="center">AF_CANCEL</td>
1273 * <td align="center">INACTIVE</td>
1274 * <td align="center">Reset lens position, Lens now locked</td>
1275 * </tr>
1276 * <tr>
1277 * <td align="center">PASSIVE_FOCUSED</td>
1278 * <td align="center">Camera device initiates new scan</td>
1279 * <td align="center">PASSIVE_SCAN</td>
1280 * <td align="center">Start AF scan, Lens now moving</td>
1281 * </tr>
1282 * <tr>
1283 * <td align="center">PASSIVE_UNFOCUSED</td>
1284 * <td align="center">Camera device initiates new scan</td>
1285 * <td align="center">PASSIVE_SCAN</td>
1286 * <td align="center">Start AF scan, Lens now moving</td>
1287 * </tr>
1288 * <tr>
1289 * <td align="center">PASSIVE_FOCUSED</td>
1290 * <td align="center">AF_TRIGGER</td>
1291 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001292 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001293 * </tr>
1294 * <tr>
1295 * <td align="center">PASSIVE_UNFOCUSED</td>
1296 * <td align="center">AF_TRIGGER</td>
1297 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001298 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001299 * </tr>
1300 * <tr>
1301 * <td align="center">FOCUSED_LOCKED</td>
1302 * <td align="center">AF_TRIGGER</td>
1303 * <td align="center">FOCUSED_LOCKED</td>
1304 * <td align="center">No effect</td>
1305 * </tr>
1306 * <tr>
1307 * <td align="center">FOCUSED_LOCKED</td>
1308 * <td align="center">AF_CANCEL</td>
1309 * <td align="center">INACTIVE</td>
1310 * <td align="center">Restart AF scan</td>
1311 * </tr>
1312 * <tr>
1313 * <td align="center">NOT_FOCUSED_LOCKED</td>
1314 * <td align="center">AF_TRIGGER</td>
1315 * <td align="center">NOT_FOCUSED_LOCKED</td>
1316 * <td align="center">No effect</td>
1317 * </tr>
1318 * <tr>
1319 * <td align="center">NOT_FOCUSED_LOCKED</td>
1320 * <td align="center">AF_CANCEL</td>
1321 * <td align="center">INACTIVE</td>
1322 * <td align="center">Restart AF scan</td>
1323 * </tr>
1324 * </tbody>
1325 * </table>
1326 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1327 * <table>
1328 * <thead>
1329 * <tr>
1330 * <th align="center">State</th>
1331 * <th align="center">Transition Cause</th>
1332 * <th align="center">New State</th>
1333 * <th align="center">Notes</th>
1334 * </tr>
1335 * </thead>
1336 * <tbody>
1337 * <tr>
1338 * <td align="center">INACTIVE</td>
1339 * <td align="center">Camera device initiates new scan</td>
1340 * <td align="center">PASSIVE_SCAN</td>
1341 * <td align="center">Start AF scan, Lens now moving</td>
1342 * </tr>
1343 * <tr>
1344 * <td align="center">INACTIVE</td>
1345 * <td align="center">AF_TRIGGER</td>
1346 * <td align="center">NOT_FOCUSED_LOCKED</td>
1347 * <td align="center">AF state query, Lens now locked</td>
1348 * </tr>
1349 * <tr>
1350 * <td align="center">PASSIVE_SCAN</td>
1351 * <td align="center">Camera device completes current scan</td>
1352 * <td align="center">PASSIVE_FOCUSED</td>
1353 * <td align="center">End AF scan, Lens now locked</td>
1354 * </tr>
1355 * <tr>
1356 * <td align="center">PASSIVE_SCAN</td>
1357 * <td align="center">Camera device fails current scan</td>
1358 * <td align="center">PASSIVE_UNFOCUSED</td>
1359 * <td align="center">End AF scan, Lens now locked</td>
1360 * </tr>
1361 * <tr>
1362 * <td align="center">PASSIVE_SCAN</td>
1363 * <td align="center">AF_TRIGGER</td>
1364 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001365 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001366 * </tr>
1367 * <tr>
1368 * <td align="center">PASSIVE_SCAN</td>
1369 * <td align="center">AF_TRIGGER</td>
1370 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001371 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001372 * </tr>
1373 * <tr>
1374 * <td align="center">PASSIVE_SCAN</td>
1375 * <td align="center">AF_CANCEL</td>
1376 * <td align="center">INACTIVE</td>
1377 * <td align="center">Reset lens position, Lens now locked</td>
1378 * </tr>
1379 * <tr>
1380 * <td align="center">PASSIVE_FOCUSED</td>
1381 * <td align="center">Camera device initiates new scan</td>
1382 * <td align="center">PASSIVE_SCAN</td>
1383 * <td align="center">Start AF scan, Lens now moving</td>
1384 * </tr>
1385 * <tr>
1386 * <td align="center">PASSIVE_UNFOCUSED</td>
1387 * <td align="center">Camera device initiates new scan</td>
1388 * <td align="center">PASSIVE_SCAN</td>
1389 * <td align="center">Start AF scan, Lens now moving</td>
1390 * </tr>
1391 * <tr>
1392 * <td align="center">PASSIVE_FOCUSED</td>
1393 * <td align="center">AF_TRIGGER</td>
1394 * <td align="center">FOCUSED_LOCKED</td>
1395 * <td align="center">Immediate trans. Lens now locked</td>
1396 * </tr>
1397 * <tr>
1398 * <td align="center">PASSIVE_UNFOCUSED</td>
1399 * <td align="center">AF_TRIGGER</td>
1400 * <td align="center">NOT_FOCUSED_LOCKED</td>
1401 * <td align="center">Immediate trans. Lens now locked</td>
1402 * </tr>
1403 * <tr>
1404 * <td align="center">FOCUSED_LOCKED</td>
1405 * <td align="center">AF_TRIGGER</td>
1406 * <td align="center">FOCUSED_LOCKED</td>
1407 * <td align="center">No effect</td>
1408 * </tr>
1409 * <tr>
1410 * <td align="center">FOCUSED_LOCKED</td>
1411 * <td align="center">AF_CANCEL</td>
1412 * <td align="center">INACTIVE</td>
1413 * <td align="center">Restart AF scan</td>
1414 * </tr>
1415 * <tr>
1416 * <td align="center">NOT_FOCUSED_LOCKED</td>
1417 * <td align="center">AF_TRIGGER</td>
1418 * <td align="center">NOT_FOCUSED_LOCKED</td>
1419 * <td align="center">No effect</td>
1420 * </tr>
1421 * <tr>
1422 * <td align="center">NOT_FOCUSED_LOCKED</td>
1423 * <td align="center">AF_CANCEL</td>
1424 * <td align="center">INACTIVE</td>
1425 * <td align="center">Restart AF scan</td>
1426 * </tr>
1427 * </tbody>
1428 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001429 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1430 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1431 * camera device. When a trigger is included in a mode switch request, the trigger
1432 * will be evaluated in the context of the new mode in the request.
1433 * See below table for examples:</p>
1434 * <table>
1435 * <thead>
1436 * <tr>
1437 * <th align="center">State</th>
1438 * <th align="center">Transition Cause</th>
1439 * <th align="center">New State</th>
1440 * <th align="center">Notes</th>
1441 * </tr>
1442 * </thead>
1443 * <tbody>
1444 * <tr>
1445 * <td align="center">any state</td>
1446 * <td align="center">CAF--&gt;AUTO mode switch</td>
1447 * <td align="center">INACTIVE</td>
1448 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1449 * </tr>
1450 * <tr>
1451 * <td align="center">any state</td>
1452 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1453 * <td align="center">trigger-reachable states from INACTIVE</td>
1454 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1455 * </tr>
1456 * <tr>
1457 * <td align="center">any state</td>
1458 * <td align="center">AUTO--&gt;CAF mode switch</td>
1459 * <td align="center">passively reachable states from INACTIVE</td>
1460 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1461 * </tr>
1462 * </tbody>
1463 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001464 * <p><b>Possible values:</b>
1465 * <ul>
1466 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1467 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1468 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1469 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1470 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1471 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1472 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1473 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001474 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001475 *
1476 * @see CaptureRequest#CONTROL_AF_MODE
1477 * @see CaptureRequest#CONTROL_MODE
1478 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001479 * @see #CONTROL_AF_STATE_INACTIVE
1480 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1481 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1482 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1483 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1484 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001485 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001486 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001487 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001488 public static final Key<Integer> CONTROL_AF_STATE =
1489 new Key<Integer>("android.control.afState", int.class);
1490
1491 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001492 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001493 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001494 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1495 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1496 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1497 * get locked do not necessarily correspond to the settings that were present in the
1498 * latest capture result received from the camera device, since additional captures
1499 * and AWB updates may have occurred even before the result was sent out. If an
1500 * application is switching between automatic and manual control and wishes to eliminate
1501 * any flicker during the switch, the following procedure is recommended:</p>
1502 * <ol>
1503 * <li>Starting in auto-AWB mode:</li>
1504 * <li>Lock AWB</li>
1505 * <li>Wait for the first result to be output that has the AWB locked</li>
1506 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1507 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1508 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001509 * <p>Note that AWB lock is only meaningful when
1510 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1511 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001512 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1513 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001514 *
1515 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001516 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001517 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001518 public static final Key<Boolean> CONTROL_AWB_LOCK =
1519 new Key<Boolean>("android.control.awbLock", boolean.class);
1520
1521 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001522 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001523 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001524 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001525 * <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 -07001526 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001527 * routine is enabled, overriding the application's selected
1528 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001529 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1530 * is OFF, the behavior of AWB is device dependent. It is recommened to
1531 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1532 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001533 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001534 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001535 * 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 -08001536 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001537 * <p>When set to any other modes, the camera device's auto-white
1538 * balance routine is disabled. The camera device uses each
1539 * particular illumination target for white balance
1540 * adjustment. The application's values for
1541 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1542 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1543 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001544 * <p><b>Possible values:</b>
1545 * <ul>
1546 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1547 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1548 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1549 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1550 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1551 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1552 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1553 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1554 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1555 * </ul></p>
1556 * <p><b>Available values for this device:</b><br>
1557 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001558 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001559 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001560 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001561 * @see CaptureRequest#COLOR_CORRECTION_MODE
1562 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001563 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001564 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001565 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001566 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001567 * @see #CONTROL_AWB_MODE_OFF
1568 * @see #CONTROL_AWB_MODE_AUTO
1569 * @see #CONTROL_AWB_MODE_INCANDESCENT
1570 * @see #CONTROL_AWB_MODE_FLUORESCENT
1571 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1572 * @see #CONTROL_AWB_MODE_DAYLIGHT
1573 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1574 * @see #CONTROL_AWB_MODE_TWILIGHT
1575 * @see #CONTROL_AWB_MODE_SHADE
1576 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001577 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001578 public static final Key<Integer> CONTROL_AWB_MODE =
1579 new Key<Integer>("android.control.awbMode", int.class);
1580
1581 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001582 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001583 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001584 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001585 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001586 * <p>The maximum number of regions supported by the device is determined by the value
1587 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001588 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001589 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001590 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1591 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001592 * bottom-right pixel in the active pixel array.</p>
1593 * <p>The weight must range from 0 to 1000, and represents a weight
1594 * for every pixel in the area. This means that a large metering area
1595 * with the same weight as a smaller area will have more effect in
1596 * the metering result. Metering areas can partially overlap and the
1597 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001598 * <p>The weights are relative to weights of other white balance metering regions, so if
1599 * only one region is used, all non-zero weights will have the same effect. A region with
1600 * 0 weight is ignored.</p>
1601 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1602 * camera device.</p>
1603 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1604 * capture result metadata, the camera device will ignore the sections outside the crop
1605 * region and output only the intersection rectangle as the metering region in the result
1606 * metadata. If the region is entirely outside the crop region, it will be ignored and
1607 * not reported in the result metadata.</p>
1608 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1609 * <p><b>Range of valid values:</b><br>
1610 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1611 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001612 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001613 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001614 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001615 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001616 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001617 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001618 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001619 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1620 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001621
1622 /**
Zhijun He379af012014-05-06 11:54:54 -07001623 * <p>Information to the camera device 3A (auto-exposure,
1624 * auto-focus, auto-white balance) routines about the purpose
1625 * of this capture, to help the camera device to decide optimal 3A
1626 * strategy.</p>
1627 * <p>This control (except for MANUAL) is only effective if
1628 * <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 -07001629 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Zhijun He0e99c222015-01-29 15:26:05 -08001630 * contains OPAQUE_REPROCESSING. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001631 * contains MANUAL_SENSOR. Other intent values are always supported.</p>
1632 * <p><b>Possible values:</b>
1633 * <ul>
1634 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1635 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1636 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1637 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1638 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1639 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1640 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1641 * </ul></p>
1642 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001643 *
1644 * @see CaptureRequest#CONTROL_MODE
1645 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1646 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1647 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1648 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1649 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1650 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1651 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1652 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1653 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001654 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001655 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1656 new Key<Integer>("android.control.captureIntent", int.class);
1657
1658 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001659 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001660 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1661 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1662 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1663 * the algorithm states to INACTIVE.</p>
1664 * <p>The camera device can do several state transitions between two results, if it is
1665 * allowed by the state transition table. So INACTIVE may never actually be seen in
1666 * a result.</p>
1667 * <p>The state in the result is the state for this image (in sync with this image): if
1668 * AWB state becomes CONVERGED, then the image data associated with this result should
1669 * be good to use.</p>
1670 * <p>Below are state transition tables for different AWB modes.</p>
1671 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1672 * <table>
1673 * <thead>
1674 * <tr>
1675 * <th align="center">State</th>
1676 * <th align="center">Transition Cause</th>
1677 * <th align="center">New State</th>
1678 * <th align="center">Notes</th>
1679 * </tr>
1680 * </thead>
1681 * <tbody>
1682 * <tr>
1683 * <td align="center">INACTIVE</td>
1684 * <td align="center"></td>
1685 * <td align="center">INACTIVE</td>
1686 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1687 * </tr>
1688 * </tbody>
1689 * </table>
1690 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1691 * <table>
1692 * <thead>
1693 * <tr>
1694 * <th align="center">State</th>
1695 * <th align="center">Transition Cause</th>
1696 * <th align="center">New State</th>
1697 * <th align="center">Notes</th>
1698 * </tr>
1699 * </thead>
1700 * <tbody>
1701 * <tr>
1702 * <td align="center">INACTIVE</td>
1703 * <td align="center">Camera device initiates AWB scan</td>
1704 * <td align="center">SEARCHING</td>
1705 * <td align="center">Values changing</td>
1706 * </tr>
1707 * <tr>
1708 * <td align="center">INACTIVE</td>
1709 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1710 * <td align="center">LOCKED</td>
1711 * <td align="center">Values locked</td>
1712 * </tr>
1713 * <tr>
1714 * <td align="center">SEARCHING</td>
1715 * <td align="center">Camera device finishes AWB scan</td>
1716 * <td align="center">CONVERGED</td>
1717 * <td align="center">Good values, not changing</td>
1718 * </tr>
1719 * <tr>
1720 * <td align="center">SEARCHING</td>
1721 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1722 * <td align="center">LOCKED</td>
1723 * <td align="center">Values locked</td>
1724 * </tr>
1725 * <tr>
1726 * <td align="center">CONVERGED</td>
1727 * <td align="center">Camera device initiates AWB scan</td>
1728 * <td align="center">SEARCHING</td>
1729 * <td align="center">Values changing</td>
1730 * </tr>
1731 * <tr>
1732 * <td align="center">CONVERGED</td>
1733 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1734 * <td align="center">LOCKED</td>
1735 * <td align="center">Values locked</td>
1736 * </tr>
1737 * <tr>
1738 * <td align="center">LOCKED</td>
1739 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1740 * <td align="center">SEARCHING</td>
1741 * <td align="center">Values not good after unlock</td>
1742 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001743 * </tbody>
1744 * </table>
1745 * <p>For the above table, the camera device may skip reporting any state changes that happen
1746 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1747 * can be skipped in that manner is called a transient state.</p>
1748 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1749 * listed in above table, it is also legal for the camera device to skip one or more
1750 * transient states between two results. See below table for examples:</p>
1751 * <table>
1752 * <thead>
1753 * <tr>
1754 * <th align="center">State</th>
1755 * <th align="center">Transition Cause</th>
1756 * <th align="center">New State</th>
1757 * <th align="center">Notes</th>
1758 * </tr>
1759 * </thead>
1760 * <tbody>
1761 * <tr>
1762 * <td align="center">INACTIVE</td>
1763 * <td align="center">Camera device finished AWB scan</td>
1764 * <td align="center">CONVERGED</td>
1765 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1766 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001767 * <tr>
1768 * <td align="center">LOCKED</td>
1769 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1770 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001771 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001772 * </tr>
1773 * </tbody>
1774 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001775 * <p><b>Possible values:</b>
1776 * <ul>
1777 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1778 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1779 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1780 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1781 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001782 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1783 * <p><b>Limited capability</b> -
1784 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1785 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001786 *
1787 * @see CaptureRequest#CONTROL_AWB_LOCK
1788 * @see CaptureRequest#CONTROL_AWB_MODE
1789 * @see CaptureRequest#CONTROL_MODE
1790 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001791 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001792 * @see #CONTROL_AWB_STATE_INACTIVE
1793 * @see #CONTROL_AWB_STATE_SEARCHING
1794 * @see #CONTROL_AWB_STATE_CONVERGED
1795 * @see #CONTROL_AWB_STATE_LOCKED
1796 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001797 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001798 public static final Key<Integer> CONTROL_AWB_STATE =
1799 new Key<Integer>("android.control.awbState", int.class);
1800
1801 /**
Zhijun He379af012014-05-06 11:54:54 -07001802 * <p>A special color effect to apply.</p>
1803 * <p>When this mode is set, a color effect will be applied
1804 * to images produced by the camera device. The interpretation
1805 * and implementation of these color effects is left to the
1806 * implementor of the camera device, and should not be
1807 * depended on to be consistent (or present) across all
1808 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001809 * <p><b>Possible values:</b>
1810 * <ul>
1811 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1812 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1813 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1814 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1815 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1816 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1817 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1818 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1819 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1820 * </ul></p>
1821 * <p><b>Available values for this device:</b><br>
1822 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001823 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001824 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001825 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07001826 * @see #CONTROL_EFFECT_MODE_OFF
1827 * @see #CONTROL_EFFECT_MODE_MONO
1828 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1829 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1830 * @see #CONTROL_EFFECT_MODE_SEPIA
1831 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1832 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1833 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1834 * @see #CONTROL_EFFECT_MODE_AQUA
1835 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001836 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001837 public static final Key<Integer> CONTROL_EFFECT_MODE =
1838 new Key<Integer>("android.control.effectMode", int.class);
1839
1840 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001841 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001842 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001843 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001844 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001845 * capture parameters itself.</p>
1846 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001847 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001848 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001849 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001850 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001851 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001852 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001853 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1854 * is that this frame will not be used by camera device background 3A statistics
1855 * update, as if this frame is never captured. This mode can be used in the scenario
1856 * where the application doesn't want a 3A manual control capture to affect
1857 * the subsequent auto 3A capture results.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001858 * <p>LEGACY mode devices will only support AUTO and USE_SCENE_MODE modes.
1859 * LIMITED mode devices will only support OFF and OFF_KEEP_STATE if they
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001860 * support the MANUAL_SENSOR and MANUAL_POST_PROCSESING capabilities.
1861 * FULL mode devices will always support OFF and OFF_KEEP_STATE.</p>
1862 * <p><b>Possible values:</b>
1863 * <ul>
1864 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
1865 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1866 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1867 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1868 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001869 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001870 *
1871 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001872 * @see #CONTROL_MODE_OFF
1873 * @see #CONTROL_MODE_AUTO
1874 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001875 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001876 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001877 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001878 public static final Key<Integer> CONTROL_MODE =
1879 new Key<Integer>("android.control.mode", int.class);
1880
1881 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001882 * <p>Control for which scene mode is currently active.</p>
1883 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1884 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07001885 * <p>This is the mode that that is active when
1886 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1887 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001888 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p>
Zhijun He379af012014-05-06 11:54:54 -07001889 * <p>The interpretation and implementation of these scene modes is left
1890 * to the implementor of the camera device. Their behavior will not be
1891 * consistent across all devices, and any given device may only implement
1892 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001893 * <p><b>Possible values:</b>
1894 * <ul>
1895 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1896 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1897 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1898 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1899 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1900 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1901 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1902 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1903 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1904 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1905 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1906 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1907 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1908 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1909 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1910 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1911 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1912 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001913 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001914 * </ul></p>
1915 * <p><b>Available values for this device:</b><br>
1916 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001917 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001918 *
1919 * @see CaptureRequest#CONTROL_AE_MODE
1920 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001921 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001922 * @see CaptureRequest#CONTROL_AWB_MODE
1923 * @see CaptureRequest#CONTROL_MODE
1924 * @see #CONTROL_SCENE_MODE_DISABLED
1925 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1926 * @see #CONTROL_SCENE_MODE_ACTION
1927 * @see #CONTROL_SCENE_MODE_PORTRAIT
1928 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1929 * @see #CONTROL_SCENE_MODE_NIGHT
1930 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1931 * @see #CONTROL_SCENE_MODE_THEATRE
1932 * @see #CONTROL_SCENE_MODE_BEACH
1933 * @see #CONTROL_SCENE_MODE_SNOW
1934 * @see #CONTROL_SCENE_MODE_SUNSET
1935 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1936 * @see #CONTROL_SCENE_MODE_FIREWORKS
1937 * @see #CONTROL_SCENE_MODE_SPORTS
1938 * @see #CONTROL_SCENE_MODE_PARTY
1939 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1940 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07001941 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001942 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07001943 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001944 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001945 public static final Key<Integer> CONTROL_SCENE_MODE =
1946 new Key<Integer>("android.control.sceneMode", int.class);
1947
1948 /**
1949 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001950 * active.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001951 * <p>Video stabilization automatically translates and scales images from
1952 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07001953 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001954 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001955 * <p>Switching between different video stabilization modes may take several
1956 * frames to initialize, the camera device will report the current mode
1957 * in capture result metadata. For example, When "ON" mode is requested,
1958 * the video stabilization modes in the first several capture results may
1959 * still be "OFF", and it will become "ON" when the initialization is
1960 * done.</p>
1961 * <p>If a camera device supports both this mode and OIS
1962 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
1963 * produce undesirable interaction, so it is recommended not to enable
1964 * both at the same time.</p>
1965 * <p><b>Possible values:</b>
1966 * <ul>
1967 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
1968 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
1969 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001970 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001971 *
Zhijun He45fa43a12014-06-13 18:29:37 -07001972 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07001973 * @see CaptureRequest#SCALER_CROP_REGION
1974 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1975 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1976 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001977 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001978 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1979 new Key<Integer>("android.control.videoStabilizationMode", int.class);
1980
1981 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001982 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001983 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001984 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
1985 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001986 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001987 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001988 * camera device will use the highest-quality enhancement algorithms,
1989 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08001990 * not slow down capture rate when applying edge enhancement.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08001991 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
1992 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
1993 * The camera device may adjust its internal noise reduction parameters for best
1994 * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001995 * <p><b>Possible values:</b>
1996 * <ul>
1997 * <li>{@link #EDGE_MODE_OFF OFF}</li>
1998 * <li>{@link #EDGE_MODE_FAST FAST}</li>
1999 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2000 * </ul></p>
2001 * <p><b>Available values for this device:</b><br>
2002 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002003 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2004 * <p><b>Full capability</b> -
2005 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2006 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002007 *
2008 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002009 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002010 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002011 * @see #EDGE_MODE_OFF
2012 * @see #EDGE_MODE_FAST
2013 * @see #EDGE_MODE_HIGH_QUALITY
2014 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002015 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002016 public static final Key<Integer> EDGE_MODE =
2017 new Key<Integer>("android.edge.mode", int.class);
2018
2019 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002020 * <p>The desired mode for for the camera device's flash control.</p>
2021 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002022 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002023 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2024 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2025 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2026 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2027 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2028 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002029 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002030 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2031 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2032 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002033 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002034 * <p><b>Possible values:</b>
2035 * <ul>
2036 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2037 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2038 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2039 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002040 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002041 *
2042 * @see CaptureRequest#CONTROL_AE_MODE
2043 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2044 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002045 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002046 * @see #FLASH_MODE_OFF
2047 * @see #FLASH_MODE_SINGLE
2048 * @see #FLASH_MODE_TORCH
2049 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002050 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002051 public static final Key<Integer> FLASH_MODE =
2052 new Key<Integer>("android.flash.mode", int.class);
2053
2054 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002055 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002056 * unit.</p>
2057 * <p>When the camera device doesn't have flash unit
2058 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2059 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002060 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2061 * <ul>
2062 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2063 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002064 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002065 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002066 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002067 * </ul>
2068 * <p>In all other conditions the state will not be available on
2069 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002070 * <p><b>Possible values:</b>
2071 * <ul>
2072 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2073 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2074 * <li>{@link #FLASH_STATE_READY READY}</li>
2075 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2076 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2077 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002078 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2079 * <p><b>Limited capability</b> -
2080 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2081 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002082 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002083 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002084 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002085 * @see CaptureRequest#FLASH_MODE
2086 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002087 * @see #FLASH_STATE_UNAVAILABLE
2088 * @see #FLASH_STATE_CHARGING
2089 * @see #FLASH_STATE_READY
2090 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002091 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002092 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002093 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002094 public static final Key<Integer> FLASH_STATE =
2095 new Key<Integer>("android.flash.state", int.class);
2096
2097 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002098 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002099 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002100 * that do not accurately measure the incoming light (i.e. pixels that
2101 * are stuck at an arbitrary value or are oversensitive).</p>
2102 * <p><b>Possible values:</b>
2103 * <ul>
2104 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2105 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2106 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2107 * </ul></p>
2108 * <p><b>Available values for this device:</b><br>
2109 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002110 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002111 *
2112 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002113 * @see #HOT_PIXEL_MODE_OFF
2114 * @see #HOT_PIXEL_MODE_FAST
2115 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2116 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002117 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002118 public static final Key<Integer> HOT_PIXEL_MODE =
2119 new Key<Integer>("android.hotPixel.mode", int.class);
2120
2121 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002122 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002123 * <p>Setting a location object in a request will include the GPS coordinates of the location
2124 * into any JPEG images captured based on the request. These coordinates can then be
2125 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002126 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002127 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002128 @PublicKey
2129 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002130 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2131 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2132
2133 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002134 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002135 * EXIF.</p>
2136 * <p><b>Range of valid values:</b><br>
2137 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002138 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002139 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002140 */
2141 public static final Key<double[]> JPEG_GPS_COORDINATES =
2142 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2143
2144 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002145 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002146 * include in EXIF.</p>
2147 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002148 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002149 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002150 */
2151 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2152 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2153
2154 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002155 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002156 * EXIF.</p>
2157 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002158 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002159 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002160 */
2161 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2162 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2163
2164 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002165 * <p>The orientation for a JPEG image.</p>
2166 * <p>The clockwise rotation angle in degrees, relative to the orientation
2167 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2168 * upright.</p>
2169 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
2170 * rotate the image data to match this orientation.</p>
2171 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2172 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
2173 * <p>To translate from the device orientation given by the Android sensor APIs, the following
2174 * sample code may be used:</p>
2175 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2176 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2177 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2178 *
2179 * // Round device orientation to a multiple of 90
2180 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2181 *
2182 * // Reverse device orientation for front-facing cameras
2183 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2184 * if (facingFront) deviceOrientation = -deviceOrientation;
2185 *
2186 * // Calculate desired JPEG orientation relative to camera orientation to make
2187 * // the image upright relative to the device orientation
2188 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2189 *
2190 * return jpegOrientation;
2191 * }
2192 * </code></pre>
2193 * <p><b>Units</b>: Degrees in multiples of 90</p>
2194 * <p><b>Range of valid values:</b><br>
2195 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002196 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002197 *
2198 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002199 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002200 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002201 public static final Key<Integer> JPEG_ORIENTATION =
2202 new Key<Integer>("android.jpeg.orientation", int.class);
2203
2204 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002205 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002206 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002207 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002208 * <p><b>Range of valid values:</b><br>
2209 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002210 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002211 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002212 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002213 public static final Key<Byte> JPEG_QUALITY =
2214 new Key<Byte>("android.jpeg.quality", byte.class);
2215
2216 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002217 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002218 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002219 * <p><b>Range of valid values:</b><br>
2220 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002221 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002222 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002223 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002224 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2225 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2226
2227 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002228 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002229 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2230 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002231 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2232 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002233 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2234 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2235 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2236 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2237 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2238 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002239 * <p><b>Range of valid values:</b><br>
2240 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002241 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002242 *
2243 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002244 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002245 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002246 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2247 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002248
2249 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002250 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2251 * effective aperture diameter.</p>
2252 * <p>Setting this value is only supported on the camera devices that have a variable
2253 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002254 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2255 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002256 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002257 * to achieve manual exposure control.</p>
2258 * <p>The requested aperture value may take several frames to reach the
2259 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002260 * aperture size in capture result metadata while the aperture is changing.
2261 * 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 -08002262 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2263 * the ON modes, this will be overridden by the camera device
2264 * auto-exposure algorithm, the overridden values are then provided
2265 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002266 * <p><b>Units</b>: The f-number (f/N)</p>
2267 * <p><b>Range of valid values:</b><br>
2268 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002269 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2270 * <p><b>Full capability</b> -
2271 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2272 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002273 *
Zhijun He399f05d2014-01-15 11:31:30 -08002274 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002275 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002276 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002277 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002278 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002279 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002280 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002281 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002282 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002283 public static final Key<Float> LENS_APERTURE =
2284 new Key<Float>("android.lens.aperture", float.class);
2285
2286 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002287 * <p>The desired setting for the lens neutral density filter(s).</p>
2288 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002289 * <p>Lens filters are typically used to lower the amount of light the
2290 * sensor is exposed to (measured in steps of EV). As used here, an EV
2291 * step is the standard logarithmic representation, which are
2292 * non-negative, and inversely proportional to the amount of light
2293 * hitting the sensor. For example, setting this to 0 would result
2294 * in no reduction of the incoming light, and setting this to 2 would
2295 * mean that the filter is set to reduce incoming light by two stops
2296 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002297 * <p>It may take several frames before the lens filter density changes
2298 * to the requested value. While the filter density is still changing,
2299 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002300 * <p><b>Units</b>: Exposure Value (EV)</p>
2301 * <p><b>Range of valid values:</b><br>
2302 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002303 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2304 * <p><b>Full capability</b> -
2305 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2306 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002307 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002308 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002309 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002310 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002311 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002312 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002313 public static final Key<Float> LENS_FILTER_DENSITY =
2314 new Key<Float>("android.lens.filterDensity", float.class);
2315
2316 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002317 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002318 * <p>This setting controls the physical focal length of the camera
2319 * device's lens. Changing the focal length changes the field of
2320 * view of the camera device, and is usually used for optical zoom.</p>
2321 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2322 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002323 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002324 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2325 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002326 * <p>Optical zoom will not be supported on most devices.</p>
2327 * <p><b>Units</b>: Millimeters</p>
2328 * <p><b>Range of valid values:</b><br>
2329 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002330 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002331 *
2332 * @see CaptureRequest#LENS_APERTURE
2333 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002334 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002335 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002336 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002337 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002338 public static final Key<Float> LENS_FOCAL_LENGTH =
2339 new Key<Float>("android.lens.focalLength", float.class);
2340
2341 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002342 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002343 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002344 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002345 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2346 * <p><b>Range of valid values:</b><br>
2347 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002348 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2349 * <p><b>Full capability</b> -
2350 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2351 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2352 *
2353 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002354 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002355 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002356 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002357 public static final Key<Float> LENS_FOCUS_DISTANCE =
2358 new Key<Float>("android.lens.focusDistance", float.class);
2359
2360 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002361 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002362 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002363 * <p>If variable focus not supported, can still report
2364 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002365 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2366 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2367 * <p><b>Range of valid values:</b><br>
2368 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002369 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2370 * <p><b>Limited capability</b> -
2371 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2372 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2373 *
2374 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002375 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002376 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002377 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002378 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2379 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 -07002380
2381 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002382 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2383 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002384 * <p>OIS is used to compensate for motion blur due to small
2385 * movements of the camera during capture. Unlike digital image
2386 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2387 * makes use of mechanical elements to stabilize the camera
2388 * sensor, and thus allows for longer exposure times before
2389 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002390 * <p>Switching between different optical stabilization modes may take several
2391 * frames to initialize, the camera device will report the current mode in
2392 * capture result metadata. For example, When "ON" mode is requested, the
2393 * optical stabilization modes in the first several capture results may still
2394 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002395 * <p>If a camera device supports both OIS and digital image stabilization
2396 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2397 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002398 * <p>Not all devices will support OIS; see
2399 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2400 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002401 * <p><b>Possible values:</b>
2402 * <ul>
2403 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2404 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2405 * </ul></p>
2406 * <p><b>Available values for this device:</b><br>
2407 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002408 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2409 * <p><b>Limited capability</b> -
2410 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2411 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002412 *
2413 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002414 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002415 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002416 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2417 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2418 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002419 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002420 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2421 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2422
2423 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002424 * <p>Current lens status.</p>
2425 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2426 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2427 * they may take several frames to reach the requested values. This state indicates
2428 * the current status of the lens parameters.</p>
2429 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2430 * either because the parameters are all fixed, or because the lens has had enough
2431 * time to reach the most recently-requested values.
2432 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2433 * <ul>
2434 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2435 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2436 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2437 * which means the optical zoom is not supported.</li>
2438 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2439 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2440 * </ul>
2441 * <p>Then this state will always be STATIONARY.</p>
2442 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2443 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002444 * <p><b>Possible values:</b>
2445 * <ul>
2446 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2447 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2448 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002449 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2450 * <p><b>Limited capability</b> -
2451 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2452 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002453 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002454 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002455 * @see CaptureRequest#LENS_APERTURE
2456 * @see CaptureRequest#LENS_FILTER_DENSITY
2457 * @see CaptureRequest#LENS_FOCAL_LENGTH
2458 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2459 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2460 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2461 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2462 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002463 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002464 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002465 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002466 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002467 public static final Key<Integer> LENS_STATE =
2468 new Key<Integer>("android.lens.state", int.class);
2469
2470 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002471 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002472 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08002473 * excessive noise added by the capture process, especially in dark conditions.</p>
2474 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
2475 * YUV domain.</p>
2476 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
2477 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
2478 * This mode is optional, may not be support by all devices. The application should check
2479 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002480 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2481 * will be applied. HIGH_QUALITY mode indicates that the camera device
2482 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002483 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08002484 * slow down capture rate when applying noise filtering.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002485 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
2486 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
2487 * may adjust the noise reduction parameters for best image quality based on the
2488 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002489 * <p><b>Possible values:</b>
2490 * <ul>
2491 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2492 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2493 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08002494 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002495 * </ul></p>
2496 * <p><b>Available values for this device:</b><br>
2497 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002498 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2499 * <p><b>Full capability</b> -
2500 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2501 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002502 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002503 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002504 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08002505 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002506 * @see #NOISE_REDUCTION_MODE_OFF
2507 * @see #NOISE_REDUCTION_MODE_FAST
2508 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08002509 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002510 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002511 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002512 public static final Key<Integer> NOISE_REDUCTION_MODE =
2513 new Key<Integer>("android.noiseReduction.mode", int.class);
2514
2515 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002516 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002517 * final one for the capture, or only a partial that contains a
2518 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002519 * values.</p>
2520 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002521 * single capture may not overlap, except for this entry. The
2522 * FINAL buffers must retain FIFO ordering relative to the
2523 * requests that generate them, so the FINAL buffer for frame 3 must
2524 * always be sent to the framework after the FINAL buffer for frame 2, and
2525 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2526 * in any order relative to other frames, but all PARTIAL buffers for a given
2527 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002528 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002529 * <p><b>Range of valid values:</b><br>
2530 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002531 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002532 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002533 * @hide
2534 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002535 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002536 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2537 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2538
2539 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002540 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002541 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002542 * frameCount value).</p>
2543 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002544 * <p><b>Units</b>: count of frames</p>
2545 * <p><b>Range of valid values:</b><br>
2546 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002547 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002548 * @deprecated
2549 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002550 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002551 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002552 public static final Key<Integer> REQUEST_FRAME_COUNT =
2553 new Key<Integer>("android.request.frameCount", int.class);
2554
2555 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002556 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002557 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002558 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002559 * <p><b>Units</b>: arbitrary integer assigned by application</p>
2560 * <p><b>Range of valid values:</b><br>
2561 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002562 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002563 * @hide
2564 */
2565 public static final Key<Integer> REQUEST_ID =
2566 new Key<Integer>("android.request.id", int.class);
2567
2568 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002569 * <p>Specifies the number of pipeline stages the frame went
2570 * through from when it was exposed to when the final completed result
2571 * was available to the framework.</p>
2572 * <p>Depending on what settings are used in the request, and
2573 * what streams are configured, the data may undergo less processing,
2574 * and some pipeline stages skipped.</p>
2575 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002576 * <p><b>Range of valid values:</b><br>
2577 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002578 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002579 *
2580 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2581 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002582 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002583 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2584 new Key<Byte>("android.request.pipelineDepth", byte.class);
2585
2586 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002587 * <p>The desired region of the sensor to read out for this capture.</p>
2588 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002589 * <p>The crop region coordinate system is based off
2590 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2591 * top-left corner of the sensor active array.</p>
2592 * <p>Output streams use this rectangle to produce their output,
2593 * cropping to a smaller region if necessary to maintain the
2594 * stream's aspect ratio, then scaling the sensor input to
2595 * match the output's configured resolution.</p>
2596 * <p>The crop region is applied after the RAW to other color
2597 * space (e.g. YUV) conversion. Since raw streams
2598 * (e.g. RAW16) don't have the conversion stage, they are not
2599 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002600 * <p>For non-raw streams, any additional per-stream cropping will
2601 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002602 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002603 * ratio, then 4:3 streams will use the exact crop
2604 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002605 * (letterbox).</p>
2606 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002607 * outputs will crop horizontally (pillarbox), and 16:9
2608 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002609 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002610 * <p>The width and height of the crop region cannot
2611 * be set to be smaller than
2612 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2613 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2614 * <p>The camera device may adjust the crop region to account
2615 * for rounding and other hardware requirements; the final
2616 * crop region used will be included in the output capture
2617 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002618 * <p><b>Units</b>: Pixel coordinates relative to
2619 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002620 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002621 *
2622 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002623 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002624 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002625 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002626 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2627 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2628
2629 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002630 * <p>Duration each pixel is exposed to
2631 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002632 * <p>If the sensor can't expose this exact duration, it will shorten the
2633 * duration exposed to the nearest possible value (rather than expose longer).
2634 * The final exposure time used will be available in the output capture result.</p>
2635 * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to
2636 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2637 * <p><b>Units</b>: Nanoseconds</p>
2638 * <p><b>Range of valid values:</b><br>
2639 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002640 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2641 * <p><b>Full capability</b> -
2642 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2643 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2644 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002645 * @see CaptureRequest#CONTROL_AE_MODE
2646 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002647 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002648 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002649 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002650 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002651 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2652 new Key<Long>("android.sensor.exposureTime", long.class);
2653
2654 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002655 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002656 * start of next frame exposure.</p>
2657 * <p>The maximum frame rate that can be supported by a camera subsystem is
2658 * a function of many factors:</p>
2659 * <ul>
2660 * <li>Requested resolutions of output image streams</li>
2661 * <li>Availability of binning / skipping modes on the imager</li>
2662 * <li>The bandwidth of the imager interface</li>
2663 * <li>The bandwidth of the various ISP processing blocks</li>
2664 * </ul>
2665 * <p>Since these factors can vary greatly between different ISPs and
2666 * sensors, the camera abstraction tries to represent the bandwidth
2667 * restrictions with as simple a model as possible.</p>
2668 * <p>The model presented has the following characteristics:</p>
2669 * <ul>
2670 * <li>The image sensor is always configured to output the smallest
2671 * resolution possible given the application's requested output stream
2672 * sizes. The smallest resolution is defined as being at least as large
2673 * as the largest requested output stream size; the camera pipeline must
2674 * never digitally upsample sensor data when the crop region covers the
2675 * whole sensor. In general, this means that if only small output stream
2676 * resolutions are configured, the sensor can provide a higher frame
2677 * rate.</li>
2678 * <li>Since any request may use any or all the currently configured
2679 * output streams, the sensor and ISP must be configured to support
2680 * scaling a single capture to all the streams at the same time. This
2681 * means the camera pipeline must be ready to produce the largest
2682 * requested output size without any delay. Therefore, the overall
2683 * frame rate of a given configured stream set is governed only by the
2684 * largest requested stream resolution.</li>
2685 * <li>Using more than one output stream in a request does not affect the
2686 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002687 * <li>Certain format-streams may need to do additional background processing
2688 * before data is consumed/produced by that stream. These processors
2689 * can run concurrently to the rest of the camera pipeline, but
2690 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002691 * </ul>
2692 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002693 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2694 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002695 * These are used to determine the maximum frame rate / minimum frame
2696 * duration that is possible for a given stream configuration.</p>
2697 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002698 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002699 * device:</p>
2700 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002701 * <li>Let the set of currently configured input/output streams
2702 * be called <code>S</code>.</li>
2703 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002704 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2705 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002706 * its respective size/format). Let this set of frame durations be called
2707 * <code>F</code>.</li>
2708 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2709 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2710 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002711 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002712 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002713 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2714 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002715 * <code>F</code> determines the steady state frame rate that the application will
2716 * get if it uses <code>R</code> as a repeating request. Let this special kind
2717 * of request be called <code>Rsimple</code>.</p>
2718 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2719 * by a single capture of a new request <code>Rstall</code> (which has at least
2720 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2721 * same minimum frame duration this will not cause a frame rate loss
2722 * if all buffers from the previous <code>Rstall</code> have already been
2723 * delivered.</p>
2724 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002725 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002726 * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to
2727 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2728 * <p><b>Units</b>: Nanoseconds</p>
2729 * <p><b>Range of valid values:</b><br>
2730 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
2731 * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
2732 * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002733 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2734 * <p><b>Full capability</b> -
2735 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2736 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002737 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002738 * @see CaptureRequest#CONTROL_AE_MODE
2739 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002740 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin9c595172014-05-12 13:56:20 -07002741 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002742 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002743 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002744 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002745 public static final Key<Long> SENSOR_FRAME_DURATION =
2746 new Key<Long>("android.sensor.frameDuration", long.class);
2747
2748 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002749 * <p>The amount of gain applied to sensor data
2750 * before processing.</p>
2751 * <p>The sensitivity is the standard ISO sensitivity value,
2752 * as defined in ISO 12232:2006.</p>
2753 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2754 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2755 * is guaranteed to use only analog amplification for applying the gain.</p>
2756 * <p>If the camera device cannot apply the exact sensitivity
2757 * requested, it will reduce the gain to the nearest supported
2758 * value. The final sensitivity used will be available in the
2759 * output capture result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002760 * <p><b>Units</b>: ISO arithmetic units</p>
2761 * <p><b>Range of valid values:</b><br>
2762 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002763 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2764 * <p><b>Full capability</b> -
2765 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2766 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002767 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002768 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002769 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2770 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002771 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002772 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002773 public static final Key<Integer> SENSOR_SENSITIVITY =
2774 new Key<Integer>("android.sensor.sensitivity", int.class);
2775
2776 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002777 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07002778 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002779 * <p>The timestamps are also included in all image
2780 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07002781 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002782 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07002783 * the timestamps measure time since an unspecified starting point,
2784 * and are monotonically increasing. They can be compared with the
2785 * timestamps for other captures from the same camera device, but are
2786 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002787 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME,
Zhijun He45fa43a12014-06-13 18:29:37 -07002788 * the timestamps measure time in the same timebase as
2789 * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2790 * compared to other timestamps from other subsystems that are using
2791 * that base.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002792 * <p><b>Units</b>: Nanoseconds</p>
2793 * <p><b>Range of valid values:</b><br>
2794 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002795 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002796 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002797 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002798 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002799 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002800 public static final Key<Long> SENSOR_TIMESTAMP =
2801 new Key<Long>("android.sensor.timestamp", long.class);
2802
2803 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002804 * <p>The estimated camera neutral color in the native sensor colorspace at
2805 * the time of capture.</p>
2806 * <p>This value gives the neutral color point encoded as an RGB value in the
2807 * native sensor color space. The neutral color point indicates the
2808 * currently estimated white point of the scene illumination. It can be
2809 * used to interpolate between the provided color transforms when
2810 * processing raw sensor data.</p>
2811 * <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 -08002812 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2813 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002814 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08002815 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2816 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2817
2818 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002819 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002820 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002821 * corresponding to the sensor amplification (S) and sensor readout
2822 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002823 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002824 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
2825 * represented as an array of Pair&lt;Double, Double&gt;, where
2826 * the first member of the Pair at index n is the S coefficient and the
2827 * second member is the O coefficient for the nth color channel in the CFA.</p>
2828 * <p>These coefficients are used in a two parameter noise model to describe
2829 * the amount of noise present in the image for each CFA channel. The
2830 * noise model used here is:</p>
2831 * <p>N(x) = sqrt(Sx + O)</p>
2832 * <p>Where x represents the recorded signal of a CFA channel normalized to
2833 * the range [0, 1], and S and O are the noise model coeffiecients for
2834 * that channel.</p>
2835 * <p>A more detailed description of the noise model can be found in the
2836 * Adobe DNG specification for the NoiseProfile tag.</p>
2837 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2838 *
2839 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2840 */
2841 @PublicKey
2842 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
2843 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
2844
2845 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002846 * <p>The worst-case divergence between Bayer green channels.</p>
2847 * <p>This value is an estimate of the worst case split between the
2848 * Bayer green channels in the red and blue rows in the sensor color
2849 * filter array.</p>
2850 * <p>The green split is calculated as follows:</p>
2851 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002852 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2853 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2854 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2855 * chosen is implementation defined, and should be chosen to provide a
2856 * green split estimate that is both representative of the entire image
2857 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002858 * <li>The arithmetic mean of the green channels from the red
2859 * rows (mean_Gr) within W is computed.</li>
2860 * <li>The arithmetic mean of the green channels from the blue
2861 * rows (mean_Gb) within W is computed.</li>
2862 * <li>The maximum ratio R of the two means is computed as follows:
2863 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2864 * </ol>
2865 * <p>The ratio R is the green split divergence reported for this property,
2866 * which represents how much the green channels differ in the mosaic
2867 * pattern. This value is typically used to determine the treatment of
2868 * the green mosaic channels when demosaicing.</p>
2869 * <p>The green split value can be roughly interpreted as follows:</p>
2870 * <ul>
2871 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2872 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2873 * correction to avoid demosaic errors (3-20% divergence).</li>
2874 * <li>R &gt; 1.20 will require strong software correction to produce
2875 * a usuable image (&gt;20% divergence).</li>
2876 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002877 * <p><b>Range of valid values:</b><br></p>
2878 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002879 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2880 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002881 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08002882 public static final Key<Float> SENSOR_GREEN_SPLIT =
2883 new Key<Float>("android.sensor.greenSplit", float.class);
2884
2885 /**
Zhijun He379af012014-05-06 11:54:54 -07002886 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2887 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2888 * <p>Each color channel is treated as an unsigned 32-bit integer.
2889 * The camera device then uses the most significant X bits
2890 * that correspond to how many bits are in its Bayer raw sensor
2891 * output.</p>
2892 * <p>For example, a sensor with RAW10 Bayer output would use the
2893 * 10 most significant bits from each color channel.</p>
2894 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2895 *
2896 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2897 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002898 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002899 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2900 new Key<int[]>("android.sensor.testPatternData", int[].class);
2901
2902 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002903 * <p>When enabled, the sensor sends a test pattern instead of
2904 * doing a real exposure from the camera.</p>
2905 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002906 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002907 * work as normal.</p>
2908 * <p>For example, if manual flash is enabled, flash firing should still
2909 * occur (and that the test pattern remain unmodified, since the flash
2910 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002911 * <p>Defaults to OFF.</p>
2912 * <p><b>Possible values:</b>
2913 * <ul>
2914 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
2915 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
2916 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
2917 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
2918 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
2919 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
2920 * </ul></p>
2921 * <p><b>Available values for this device:</b><br>
2922 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002923 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002924 *
2925 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08002926 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2927 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2928 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2929 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2930 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2931 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2932 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002933 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002934 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2935 new Key<Integer>("android.sensor.testPatternMode", int.class);
2936
2937 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07002938 * <p>Duration between the start of first row exposure
2939 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002940 * <p>This is the exposure time skew between the first and last
2941 * row exposure start times. The first row and the last row are
2942 * the first and last rows inside of the
2943 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07002944 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
2945 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002946 * <p><b>Units</b>: Nanoseconds</p>
2947 * <p><b>Range of valid values:</b><br>
2948 * &gt;= 0 and &lt;
2949 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002950 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2951 * <p><b>Limited capability</b> -
2952 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2953 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07002954 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002955 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07002956 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2957 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002958 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07002959 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
2960 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
2961
2962 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002963 * <p>Quality of lens shading correction applied
2964 * to the image data.</p>
2965 * <p>When set to OFF mode, no lens shading correction will be applied by the
2966 * camera device, and an identity lens shading map data will be provided
2967 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002968 * shading map with size of <code>[ 4, 3 ]</code>,
2969 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
2970 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002971 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002972 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2973 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2974 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2975 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2976 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08002977 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002978 * <p>When set to other modes, lens shading correction will be applied by the camera
2979 * device. Applications can request lens shading map data by setting
2980 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
2981 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
2982 * data will be the one applied by the camera device for this capture request.</p>
2983 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
2984 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
2985 * AWB are in AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code>
2986 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
2987 * to be converged before using the returned shading map data.</p>
2988 * <p><b>Possible values:</b>
2989 * <ul>
2990 * <li>{@link #SHADING_MODE_OFF OFF}</li>
2991 * <li>{@link #SHADING_MODE_FAST FAST}</li>
2992 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2993 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002994 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2995 * <p><b>Full capability</b> -
2996 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2997 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002998 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002999 * @see CaptureRequest#CONTROL_AE_MODE
3000 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003001 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003002 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08003003 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3004 * @see #SHADING_MODE_OFF
3005 * @see #SHADING_MODE_FAST
3006 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08003007 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003008 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08003009 public static final Key<Integer> SHADING_MODE =
3010 new Key<Integer>("android.shading.mode", int.class);
3011
3012 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003013 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003014 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003015 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003016 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003017 * fields.</p>
3018 * <p><b>Possible values:</b>
3019 * <ul>
3020 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3021 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3022 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3023 * </ul></p>
3024 * <p><b>Available values for this device:</b><br>
3025 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3026 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003027 *
3028 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003029 * @see #STATISTICS_FACE_DETECT_MODE_OFF
3030 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3031 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3032 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003033 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003034 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3035 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3036
3037 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003038 * <p>List of unique IDs for detected faces.</p>
3039 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3040 * to the camera device. A face that leaves the field of view and later returns may be
3041 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003042 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3043 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003044 *
3045 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003046 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003047 */
3048 public static final Key<int[]> STATISTICS_FACE_IDS =
3049 new Key<int[]>("android.statistics.faceIds", int[].class);
3050
3051 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003052 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003053 * faces.</p>
3054 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3055 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003056 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3057 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003058 *
3059 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3060 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003061 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003062 */
3063 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3064 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3065
3066 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003067 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003068 * faces.</p>
3069 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3070 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003071 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3072 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003073 *
3074 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3075 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003076 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003077 */
3078 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3079 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3080
3081 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003082 * <p>List of the face confidence scores for
3083 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003084 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003085 * <p><b>Range of valid values:</b><br>
3086 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003087 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003088 *
3089 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003090 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003091 */
3092 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3093 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3094
3095 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003096 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003097 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003098 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003099 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003100 *
3101 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3102 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003103 @PublicKey
3104 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003105 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3106 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3107
3108 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003109 * <p>The shading map is a low-resolution floating-point map
3110 * that lists the coefficients used to correct for vignetting, for each
3111 * Bayer color channel.</p>
3112 * <p>The least shaded section of the image should have a gain factor
3113 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003114 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08003115 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003116 * <p>The shading map is for the entire active pixel array, and is not
3117 * affected by the crop region specified in the request. Each shading map
3118 * entry is the value of the shading compensation map over a specific
3119 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3120 * map, and an active pixel array size (W x H), shading map entry
3121 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3122 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3123 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3124 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3125 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003126 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003127 * <p>The shading map should have on the order of 30-40 rows and columns,
3128 * and must be smaller than 64x64.</p>
3129 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003130 * <pre><code>width,height = [ 4, 3 ]
3131 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003132 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003133 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3134 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3135 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3136 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3137 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003138 * </code></pre>
3139 * <p>The low-resolution scaling map images for each channel are
3140 * (displayed using nearest-neighbor interpolation):</p>
3141 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3142 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3143 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3144 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3145 * <p>As a visualization only, inverting the full-color map to recover an
3146 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3147 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003148 * <p><b>Range of valid values:</b><br>
3149 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003150 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3151 * <p><b>Full capability</b> -
3152 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3153 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003154 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003155 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003156 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07003157 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003158 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003159 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3160 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3161
3162 /**
3163 * <p>The shading map is a low-resolution floating-point map
3164 * that lists the coefficients used to correct for vignetting, for each
3165 * Bayer color channel.</p>
3166 * <p>The least shaded section of the image should have a gain factor
3167 * of 1; all other sections should have gains above 1.</p>
3168 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
3169 * must take into account the colorCorrection settings.</p>
3170 * <p>The shading map is for the entire active pixel array, and is not
3171 * affected by the crop region specified in the request. Each shading map
3172 * entry is the value of the shading compensation map over a specific
3173 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3174 * map, and an active pixel array size (W x H), shading map entry
3175 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3176 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3177 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3178 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3179 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3180 * The shading map is stored in a fully interleaved format, and its size
3181 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
3182 * <p>The shading map should have on the order of 30-40 rows and columns,
3183 * and must be smaller than 64x64.</p>
3184 * <p>As an example, given a very small map defined as:</p>
3185 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3186 * android.statistics.lensShadingMap =
3187 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003188 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3189 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3190 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3191 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3192 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003193 * </code></pre>
3194 * <p>The low-resolution scaling map images for each channel are
3195 * (displayed using nearest-neighbor interpolation):</p>
3196 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3197 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3198 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3199 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3200 * <p>As a visualization only, inverting the full-color map to recover an
3201 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3202 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003203 * <p><b>Range of valid values:</b><br>
3204 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003205 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3206 * <p><b>Full capability</b> -
3207 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3208 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003209 *
3210 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003211 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07003212 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003213 */
3214 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3215 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3216
3217 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003218 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003219 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003220 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003221 * since statistics processing on data from a new frame
3222 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003223 * applied to that frame.</p>
3224 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003225 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003226 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003227 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003228 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003229 *
3230 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003231 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003232 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003233 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003234 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003235 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3236 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3237
3238 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003239 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08003240 * calculated by the camera device's statistics units for the current
3241 * output frame.</p>
3242 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003243 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08003244 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003245 * are the best fit for the current output frame. This may
3246 * be different than the transform used for this frame, since
3247 * statistics processing on data from a new frame typically
3248 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003249 * that frame.</p>
3250 * <p>These estimates must be provided for all frames, even if
3251 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003252 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003253 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003254 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003255 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003256 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003257 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003258 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003259 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3260 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3261
3262 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08003263 * <p>The camera device estimated scene illumination lighting
3264 * frequency.</p>
3265 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3266 * that depends on the local utility power standards. This flicker must be
3267 * accounted for by auto-exposure routines to avoid artifacts in captured images.
3268 * The camera device uses this entry to tell the application what the scene
3269 * illuminant frequency is.</p>
3270 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003271 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3272 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3273 * antibanding, and the application can ensure it selects
3274 * exposure times that do not cause banding issues by looking
3275 * into this metadata field. See
3276 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3277 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003278 * <p><b>Possible values:</b>
3279 * <ul>
3280 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3281 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3282 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3283 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003284 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3285 * <p><b>Full capability</b> -
3286 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3287 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08003288 *
3289 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3290 * @see CaptureRequest#CONTROL_AE_MODE
3291 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003292 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003293 * @see #STATISTICS_SCENE_FLICKER_NONE
3294 * @see #STATISTICS_SCENE_FLICKER_50HZ
3295 * @see #STATISTICS_SCENE_FLICKER_60HZ
3296 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003297 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003298 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
3299 new Key<Integer>("android.statistics.sceneFlicker", int.class);
3300
3301 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003302 * <p>Operating mode for hot pixel map generation.</p>
3303 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
3304 * If set to <code>false</code>, no hot pixel map will be returned.</p>
3305 * <p><b>Range of valid values:</b><br>
3306 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003307 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003308 *
3309 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
3310 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
3311 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003312 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003313 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
3314 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
3315
3316 /**
3317 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
3318 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
3319 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
3320 * bottom-right of the pixel array, respectively. The width and
3321 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
3322 * This may include hot pixels that lie outside of the active array
3323 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003324 * <p><b>Range of valid values:</b><br></p>
3325 * <p>n &lt;= number of pixels on the sensor.
3326 * The <code>(x, y)</code> coordinates must be bounded by
3327 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003328 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003329 *
3330 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3331 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3332 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003333 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003334 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
3335 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003336
3337 /**
Zhijun He379af012014-05-06 11:54:54 -07003338 * <p>Whether the camera device will output the lens
3339 * shading map in output result metadata.</p>
3340 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003341 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07003342 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003343 * <p>ON is always supported on devices with the RAW capability.</p>
3344 * <p><b>Possible values:</b>
3345 * <ul>
3346 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3347 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3348 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003349 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3350 * <p><b>Full capability</b> -
3351 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3352 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3353 *
3354 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -07003355 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3356 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3357 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003358 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003359 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3360 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3361
3362 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003363 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08003364 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3365 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003366 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003367 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3368 * <p><b>Full capability</b> -
3369 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3370 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003371 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003372 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003373 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003374 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003375 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003376 public static final Key<float[]> TONEMAP_CURVE_BLUE =
3377 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003378
3379 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003380 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08003381 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3382 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003383 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003384 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3385 * <p><b>Full capability</b> -
3386 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3387 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003388 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003389 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003390 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003391 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003392 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003393 public static final Key<float[]> TONEMAP_CURVE_GREEN =
3394 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003395
3396 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003397 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08003398 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3399 * CONTRAST_CURVE.</p>
3400 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003401 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003402 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08003403 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003404 * <p>These are sorted in order of increasing <code>Pin</code>; it is
3405 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08003406 * define a complete mapping. For input values between control points,
3407 * the camera device must linearly interpolate between the control
3408 * points.</p>
3409 * <p>Each curve can have an independent number of points, and the number
3410 * of points can be less than max (that is, the request doesn't have to
3411 * always provide a curve with number of points equivalent to
3412 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3413 * <p>A few examples, and their corresponding graphical mappings; these
3414 * only specify the red channel and the precision is limited to 4
3415 * digits, for conciseness.</p>
3416 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003417 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003418 * </code></pre>
3419 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3420 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003421 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003422 * </code></pre>
3423 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3424 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003425 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003426 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
3427 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
3428 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
3429 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003430 * </code></pre>
3431 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3432 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003433 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003434 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
3435 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
3436 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
3437 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003438 * </code></pre>
3439 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003440 * <p><b>Range of valid values:</b><br>
3441 * 0-1 on both input and output coordinates, normalized
3442 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003443 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3444 * <p><b>Full capability</b> -
3445 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3446 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003447 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003448 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08003449 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003450 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003451 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003452 */
3453 public static final Key<float[]> TONEMAP_CURVE_RED =
3454 new Key<float[]>("android.tonemap.curveRed", float[].class);
3455
3456 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003457 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
3458 * is CONTRAST_CURVE.</p>
3459 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
3460 * channels respectively. The following example uses the red channel as an
3461 * example. The same logic applies to green and blue channel.
3462 * Each channel's curve is defined by an array of control points:</p>
3463 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003464 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003465 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3466 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
3467 * guaranteed that input values 0.0 and 1.0 are included in the list to
3468 * define a complete mapping. For input values between control points,
3469 * the camera device must linearly interpolate between the control
3470 * points.</p>
3471 * <p>Each curve can have an independent number of points, and the number
3472 * of points can be less than max (that is, the request doesn't have to
3473 * always provide a curve with number of points equivalent to
3474 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3475 * <p>A few examples, and their corresponding graphical mappings; these
3476 * only specify the red channel and the precision is limited to 4
3477 * digits, for conciseness.</p>
3478 * <p>Linear mapping:</p>
3479 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
3480 * </code></pre>
3481 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3482 * <p>Invert mapping:</p>
3483 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
3484 * </code></pre>
3485 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3486 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
3487 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003488 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
3489 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
3490 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
3491 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003492 * </code></pre>
3493 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3494 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
3495 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003496 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
3497 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
3498 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
3499 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003500 * </code></pre>
3501 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003502 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3503 * <p><b>Full capability</b> -
3504 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3505 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003506 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003507 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003508 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
3509 * @see CaptureRequest#TONEMAP_MODE
3510 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003511 @PublicKey
3512 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003513 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
3514 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
3515
3516 /**
Igor Murashkine0060932014-01-17 17:24:11 -08003517 * <p>High-level global contrast/gamma/tonemapping control.</p>
3518 * <p>When switching to an application-defined contrast curve by setting
3519 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
3520 * per-channel with a set of <code>(in, out)</code> points that specify the
3521 * mapping from input high-bit-depth pixel value to the output
3522 * low-bit-depth value. Since the actual pixel ranges of both input
3523 * and output may change depending on the camera pipeline, the values
3524 * are specified by normalized floating-point numbers.</p>
3525 * <p>More-complex color mapping operations such as 3D color look-up
3526 * tables, selective chroma enhancement, or other non-linear color
3527 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3528 * CONTRAST_CURVE.</p>
3529 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003530 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08003531 * These values are always available, and as close as possible to the
3532 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07003533 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08003534 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
3535 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003536 * <p><b>Possible values:</b>
3537 * <ul>
3538 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
3539 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
3540 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3541 * </ul></p>
3542 * <p><b>Available values for this device:</b><br>
3543 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003544 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3545 * <p><b>Full capability</b> -
3546 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3547 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003548 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003549 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003550 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003551 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08003552 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003553 * @see #TONEMAP_MODE_CONTRAST_CURVE
3554 * @see #TONEMAP_MODE_FAST
3555 * @see #TONEMAP_MODE_HIGH_QUALITY
3556 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003557 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003558 public static final Key<Integer> TONEMAP_MODE =
3559 new Key<Integer>("android.tonemap.mode", int.class);
3560
3561 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003562 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003563 * that the camera is powered on and may be streaming images back to the
3564 * Application Processor. In certain rare circumstances, the OS may
3565 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003566 * any untrusted applications.</p>
3567 * <p>In particular, the LED <em>must</em> always be on when the data could be
3568 * transmitted off the device. The LED <em>should</em> always be on whenever
3569 * data is stored locally on the device.</p>
3570 * <p>The LED <em>may</em> be off if a trusted application is using the data that
3571 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003572 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003573 * @hide
3574 */
3575 public static final Key<Boolean> LED_TRANSMIT =
3576 new Key<Boolean>("android.led.transmit", boolean.class);
3577
3578 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003579 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003580 * to its current values, or is free to vary.</p>
3581 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003582 * 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 -08003583 * a change in other capture settings forced the camera device to
3584 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003585 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3586 * <p><b>Full capability</b> -
3587 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3588 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003589 *
3590 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003591 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003592 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003593 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003594 public static final Key<Boolean> BLACK_LEVEL_LOCK =
3595 new Key<Boolean>("android.blackLevel.lock", boolean.class);
3596
Igor Murashkin3865a842014-01-17 18:18:39 -08003597 /**
3598 * <p>The frame number corresponding to the last request
3599 * with which the output result (metadata + buffers) has been fully
3600 * synchronized.</p>
3601 * <p>When a request is submitted to the camera device, there is usually a
3602 * delay of several frames before the controls get applied. A camera
3603 * device may either choose to account for this delay by implementing a
3604 * pipeline and carefully submit well-timed atomic control updates, or
3605 * it may start streaming control changes that span over several frame
3606 * boundaries.</p>
3607 * <p>In the latter case, whenever a request's settings change relative to
3608 * the previous submitted request, the full set of changes may take
3609 * multiple frame durations to fully take effect. Some settings may
3610 * take effect sooner (in less frame durations) than others.</p>
3611 * <p>While a set of control changes are being propagated, this value
3612 * will be CONVERGING.</p>
3613 * <p>Once it is fully known that a set of control changes have been
3614 * finished propagating, and the resulting updated control settings
3615 * have been read back by the camera device, this value will be set
3616 * to a non-negative frame number (corresponding to the request to
3617 * which the results have synchronized to).</p>
3618 * <p>Older camera device implementations may not have a way to detect
3619 * when all camera controls have been applied, and will always set this
3620 * value to UNKNOWN.</p>
3621 * <p>FULL capability devices will always have this value set to the
3622 * frame number of the request corresponding to this result.</p>
3623 * <p><em>Further details</em>:</p>
3624 * <ul>
3625 * <li>Whenever a request differs from the last request, any future
3626 * results not yet returned may have this value set to CONVERGING (this
3627 * could include any in-progress captures not yet returned by the camera
3628 * device, for more details see pipeline considerations below).</li>
3629 * <li>Submitting a series of multiple requests that differ from the
3630 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
3631 * moves the new synchronization frame to the last non-repeating
3632 * request (using the smallest frame number from the contiguous list of
3633 * repeating requests).</li>
3634 * <li>Submitting the same request repeatedly will not change this value
3635 * to CONVERGING, if it was already a non-negative value.</li>
3636 * <li>When this value changes to non-negative, that means that all of the
3637 * metadata controls from the request have been applied, all of the
3638 * metadata controls from the camera device have been read to the
3639 * updated values (into the result), and all of the graphics buffers
3640 * corresponding to this result are also synchronized to the request.</li>
3641 * </ul>
3642 * <p><em>Pipeline considerations</em>:</p>
3643 * <p>Submitting a request with updated controls relative to the previously
3644 * submitted requests may also invalidate the synchronization state
3645 * of all the results corresponding to currently in-flight requests.</p>
3646 * <p>In other words, results for this current request and up to
3647 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
3648 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003649 * <p><b>Possible values:</b>
3650 * <ul>
3651 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
3652 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
3653 * </ul></p>
3654 * <p><b>Available values for this device:</b><br>
3655 * Either a non-negative value corresponding to a
3656 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003657 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003658 *
3659 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3660 * @see #SYNC_FRAME_NUMBER_CONVERGING
3661 * @see #SYNC_FRAME_NUMBER_UNKNOWN
3662 * @hide
3663 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07003664 public static final Key<Long> SYNC_FRAME_NUMBER =
3665 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08003666
Zhijun He0e99c222015-01-29 15:26:05 -08003667 /**
3668 * <p>The amount of exposure time increase factor applied to the original output
3669 * frame by the application processing before sending for reprocessing.</p>
3670 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
3671 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
3672 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
3673 * output frames to effectively reduce the noise to the same level as a frame that was
3674 * captured with longer exposure time. To be more specific, assuming the original captured
3675 * images were captured with a sensitivity of S and an exposure time of T, the model in
3676 * the camera device is that the amount of noise in the image would be approximately what
3677 * would be expected if the original capture parameters had been a sensitivity of
3678 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
3679 * than S and T respectively. If the captured images were processed by the application
3680 * before being sent for reprocessing, then the application may have used image processing
3681 * algorithms and/or multi-frame image fusion to reduce the noise in the
3682 * application-processed images (input images). By using the effectiveExposureFactor
3683 * control, the application can communicate to the camera device the actual noise level
3684 * improvement in the application-processed image. With this information, the camera
3685 * device can select appropriate noise reduction and edge enhancement parameters to avoid
3686 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
3687 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
3688 * <p>For example, for multi-frame image fusion use case, the application may fuse
3689 * multiple output frames together to a final frame for reprocessing. When N image are
3690 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
3691 * square root of N (based on a simple photon shot noise model). The camera device will
3692 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
3693 * produce the best quality images.</p>
3694 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
3695 * buffer in a way that affects its effective exposure time.</p>
3696 * <p>This control is only effective for YUV reprocessing capture request. For noise
3697 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
3698 * Similarly, for edge enhancement reprocessing, it is only effective when
3699 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
3700 * <p><b>Units</b>: Relative exposure time increase factor.</p>
3701 * <p><b>Range of valid values:</b><br>
3702 * &gt;= 1.0</p>
3703 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3704 *
3705 * @see CaptureRequest#EDGE_MODE
3706 * @see CaptureRequest#NOISE_REDUCTION_MODE
3707 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3708 */
3709 @PublicKey
3710 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
3711 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
3712
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003713 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3714 * End generated code
3715 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07003716
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003717
3718
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08003719}