blob: f17100d29eb0bd955457356d308040e62bb9d33f [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
Zhijun Hedd72be52015-02-06 13:49:51 -0800721 * set to START, the camera device will trigger the auto-exposure (AE)
Zhijun He379af012014-05-06 11:54:54 -0700722 * precapture metering sequence.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800723 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700724 * 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>
Zhijun Hedd72be52015-02-06 13:49:51 -0800731 * <p>When a precapture metering sequence is finished, the camera device
732 * may lock the auto-exposure routine internally to be able to accurately expose the
733 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
734 * For this case, the AE may not resume normal scan if no subsequent still capture is
735 * submitted. To ensure that the AE routine restarts normal scan, the application should
736 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
737 * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a
738 * still capture request after the precapture sequence completes.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700739 * <p>The exact effect of auto-exposure (AE) precapture trigger
740 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700741 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
742 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700743 * <p>On LEGACY-level devices, the precapture trigger is not supported;
744 * capturing a high-resolution JPEG image will automatically trigger a
745 * precapture sequence before the high-resolution capture, including
746 * potentially firing a pre-capture flash.</p>
747 * <p><b>Possible values:</b>
748 * <ul>
749 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
750 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
751 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700752 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
753 * <p><b>Limited capability</b> -
754 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
755 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700756 *
Zhijun Hedd72be52015-02-06 13:49:51 -0800757 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He379af012014-05-06 11:54:54 -0700758 * @see CaptureResult#CONTROL_AE_STATE
Zhijun Hedd72be52015-02-06 13:49:51 -0800759 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700760 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700761 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
762 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
763 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700764 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700765 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
766 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
767
768 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700769 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800770 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
771 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
772 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
773 * the algorithm states to INACTIVE.</p>
774 * <p>The camera device can do several state transitions between two results, if it is
775 * allowed by the state transition table. For example: INACTIVE may never actually be
776 * seen in a result.</p>
777 * <p>The state in the result is the state for this image (in sync with this image): if
778 * AE state becomes CONVERGED, then the image data associated with this result should
779 * be good to use.</p>
780 * <p>Below are state transition tables for different AE modes.</p>
781 * <table>
782 * <thead>
783 * <tr>
784 * <th align="center">State</th>
785 * <th align="center">Transition Cause</th>
786 * <th align="center">New State</th>
787 * <th align="center">Notes</th>
788 * </tr>
789 * </thead>
790 * <tbody>
791 * <tr>
792 * <td align="center">INACTIVE</td>
793 * <td align="center"></td>
794 * <td align="center">INACTIVE</td>
795 * <td align="center">Camera device auto exposure algorithm is disabled</td>
796 * </tr>
797 * </tbody>
798 * </table>
799 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
800 * <table>
801 * <thead>
802 * <tr>
803 * <th align="center">State</th>
804 * <th align="center">Transition Cause</th>
805 * <th align="center">New State</th>
806 * <th align="center">Notes</th>
807 * </tr>
808 * </thead>
809 * <tbody>
810 * <tr>
811 * <td align="center">INACTIVE</td>
812 * <td align="center">Camera device initiates AE scan</td>
813 * <td align="center">SEARCHING</td>
814 * <td align="center">Values changing</td>
815 * </tr>
816 * <tr>
817 * <td align="center">INACTIVE</td>
818 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
819 * <td align="center">LOCKED</td>
820 * <td align="center">Values locked</td>
821 * </tr>
822 * <tr>
823 * <td align="center">SEARCHING</td>
824 * <td align="center">Camera device finishes AE scan</td>
825 * <td align="center">CONVERGED</td>
826 * <td align="center">Good values, not changing</td>
827 * </tr>
828 * <tr>
829 * <td align="center">SEARCHING</td>
830 * <td align="center">Camera device finishes AE scan</td>
831 * <td align="center">FLASH_REQUIRED</td>
832 * <td align="center">Converged but too dark w/o flash</td>
833 * </tr>
834 * <tr>
835 * <td align="center">SEARCHING</td>
836 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
837 * <td align="center">LOCKED</td>
838 * <td align="center">Values locked</td>
839 * </tr>
840 * <tr>
841 * <td align="center">CONVERGED</td>
842 * <td align="center">Camera device initiates AE scan</td>
843 * <td align="center">SEARCHING</td>
844 * <td align="center">Values changing</td>
845 * </tr>
846 * <tr>
847 * <td align="center">CONVERGED</td>
848 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
849 * <td align="center">LOCKED</td>
850 * <td align="center">Values locked</td>
851 * </tr>
852 * <tr>
853 * <td align="center">FLASH_REQUIRED</td>
854 * <td align="center">Camera device initiates AE scan</td>
855 * <td align="center">SEARCHING</td>
856 * <td align="center">Values changing</td>
857 * </tr>
858 * <tr>
859 * <td align="center">FLASH_REQUIRED</td>
860 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
861 * <td align="center">LOCKED</td>
862 * <td align="center">Values locked</td>
863 * </tr>
864 * <tr>
865 * <td align="center">LOCKED</td>
866 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
867 * <td align="center">SEARCHING</td>
868 * <td align="center">Values not good after unlock</td>
869 * </tr>
870 * <tr>
871 * <td align="center">LOCKED</td>
872 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
873 * <td align="center">CONVERGED</td>
874 * <td align="center">Values good after unlock</td>
875 * </tr>
876 * <tr>
877 * <td align="center">LOCKED</td>
878 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
879 * <td align="center">FLASH_REQUIRED</td>
880 * <td align="center">Exposure good, but too dark</td>
881 * </tr>
882 * <tr>
883 * <td align="center">PRECAPTURE</td>
884 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
885 * <td align="center">CONVERGED</td>
886 * <td align="center">Ready for high-quality capture</td>
887 * </tr>
888 * <tr>
889 * <td align="center">PRECAPTURE</td>
890 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
891 * <td align="center">LOCKED</td>
892 * <td align="center">Ready for high-quality capture</td>
893 * </tr>
894 * <tr>
895 * <td align="center">Any state</td>
896 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
897 * <td align="center">PRECAPTURE</td>
898 * <td align="center">Start AE precapture metering sequence</td>
899 * </tr>
900 * </tbody>
901 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800902 * <p>For the above table, the camera device may skip reporting any state changes that happen
903 * without application intervention (i.e. mode switch, trigger, locking). Any state that
904 * can be skipped in that manner is called a transient state.</p>
905 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
906 * listed in above table, it is also legal for the camera device to skip one or more
907 * transient states between two results. See below table for examples:</p>
908 * <table>
909 * <thead>
910 * <tr>
911 * <th align="center">State</th>
912 * <th align="center">Transition Cause</th>
913 * <th align="center">New State</th>
914 * <th align="center">Notes</th>
915 * </tr>
916 * </thead>
917 * <tbody>
918 * <tr>
919 * <td align="center">INACTIVE</td>
920 * <td align="center">Camera device finished AE scan</td>
921 * <td align="center">CONVERGED</td>
922 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
923 * </tr>
924 * <tr>
925 * <td align="center">Any state</td>
926 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
927 * <td align="center">FLASH_REQUIRED</td>
928 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
929 * </tr>
930 * <tr>
931 * <td align="center">Any state</td>
932 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
933 * <td align="center">CONVERGED</td>
934 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
935 * </tr>
936 * <tr>
937 * <td align="center">CONVERGED</td>
938 * <td align="center">Camera device finished AE scan</td>
939 * <td align="center">FLASH_REQUIRED</td>
940 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
941 * </tr>
942 * <tr>
943 * <td align="center">FLASH_REQUIRED</td>
944 * <td align="center">Camera device finished AE scan</td>
945 * <td align="center">CONVERGED</td>
946 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
947 * </tr>
948 * </tbody>
949 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700950 * <p><b>Possible values:</b>
951 * <ul>
952 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
953 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
954 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
955 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
956 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
957 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
958 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700959 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
960 * <p><b>Limited capability</b> -
961 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
962 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800963 *
964 * @see CaptureRequest#CONTROL_AE_LOCK
965 * @see CaptureRequest#CONTROL_AE_MODE
966 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
967 * @see CaptureRequest#CONTROL_MODE
968 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700969 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700970 * @see #CONTROL_AE_STATE_INACTIVE
971 * @see #CONTROL_AE_STATE_SEARCHING
972 * @see #CONTROL_AE_STATE_CONVERGED
973 * @see #CONTROL_AE_STATE_LOCKED
974 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
975 * @see #CONTROL_AE_STATE_PRECAPTURE
976 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700977 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700978 public static final Key<Integer> CONTROL_AE_STATE =
979 new Key<Integer>("android.control.aeState", int.class);
980
981 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700982 * <p>Whether auto-focus (AF) is currently enabled, and what
983 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800984 * <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 -0800985 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
986 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
987 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
988 * 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 -0800989 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800990 * 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 -0700991 * in result metadata.</p>
992 * <p><b>Possible values:</b>
993 * <ul>
994 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
995 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
996 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
997 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
998 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
999 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1000 * </ul></p>
1001 * <p><b>Available values for this device:</b><br>
1002 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1003 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001004 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001005 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001006 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001007 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001008 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001009 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001010 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001011 * @see #CONTROL_AF_MODE_OFF
1012 * @see #CONTROL_AF_MODE_AUTO
1013 * @see #CONTROL_AF_MODE_MACRO
1014 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1015 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1016 * @see #CONTROL_AF_MODE_EDOF
1017 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001018 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001019 public static final Key<Integer> CONTROL_AF_MODE =
1020 new Key<Integer>("android.control.afMode", int.class);
1021
1022 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001023 * <p>List of metering areas to use for auto-focus.</p>
1024 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001025 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001026 * <p>The maximum number of focus areas supported by the device is determined by the value
1027 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001028 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001029 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001030 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1031 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001032 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001033 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001034 * for every pixel in the area. This means that a large metering area
1035 * with the same weight as a smaller area will have more effect in
1036 * the metering result. Metering areas can partially overlap and the
1037 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001038 * <p>The weights are relative to weights of other metering regions, so if only one region
1039 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1040 * ignored.</p>
1041 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1042 * camera device.</p>
1043 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1044 * capture result metadata, the camera device will ignore the sections outside the crop
1045 * region and output only the intersection rectangle as the metering region in the result
1046 * metadata. If the region is entirely outside the crop region, it will be ignored and
1047 * not reported in the result metadata.</p>
1048 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1049 * <p><b>Range of valid values:</b><br>
1050 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1051 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001052 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001053 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001054 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001055 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001056 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001057 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001058 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001059 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1060 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001061
1062 /**
Zhijun He379af012014-05-06 11:54:54 -07001063 * <p>Whether the camera device will trigger autofocus for this request.</p>
1064 * <p>This entry is normally set to IDLE, or is not
1065 * included at all in the request settings.</p>
1066 * <p>When included and set to START, the camera device will trigger the
1067 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1068 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1069 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001070 * <p>Generally, applications should set this entry to START or CANCEL for only a
1071 * single capture, and then return it to IDLE (or not set at all). Specifying
1072 * START for multiple captures in a row means restarting the AF operation over
1073 * and over again.</p>
1074 * <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 -07001075 * <p><b>Possible values:</b>
1076 * <ul>
1077 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1078 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1079 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1080 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001081 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001082 *
1083 * @see CaptureResult#CONTROL_AF_STATE
1084 * @see #CONTROL_AF_TRIGGER_IDLE
1085 * @see #CONTROL_AF_TRIGGER_START
1086 * @see #CONTROL_AF_TRIGGER_CANCEL
1087 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001088 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001089 public static final Key<Integer> CONTROL_AF_TRIGGER =
1090 new Key<Integer>("android.control.afTrigger", int.class);
1091
1092 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001093 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001094 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1095 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1096 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1097 * the algorithm states to INACTIVE.</p>
1098 * <p>The camera device can do several state transitions between two results, if it is
1099 * allowed by the state transition table. For example: INACTIVE may never actually be
1100 * seen in a result.</p>
1101 * <p>The state in the result is the state for this image (in sync with this image): if
1102 * AF state becomes FOCUSED, then the image data associated with this result should
1103 * be sharp.</p>
1104 * <p>Below are state transition tables for different AF modes.</p>
1105 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1106 * <table>
1107 * <thead>
1108 * <tr>
1109 * <th align="center">State</th>
1110 * <th align="center">Transition Cause</th>
1111 * <th align="center">New State</th>
1112 * <th align="center">Notes</th>
1113 * </tr>
1114 * </thead>
1115 * <tbody>
1116 * <tr>
1117 * <td align="center">INACTIVE</td>
1118 * <td align="center"></td>
1119 * <td align="center">INACTIVE</td>
1120 * <td align="center">Never changes</td>
1121 * </tr>
1122 * </tbody>
1123 * </table>
1124 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1125 * <table>
1126 * <thead>
1127 * <tr>
1128 * <th align="center">State</th>
1129 * <th align="center">Transition Cause</th>
1130 * <th align="center">New State</th>
1131 * <th align="center">Notes</th>
1132 * </tr>
1133 * </thead>
1134 * <tbody>
1135 * <tr>
1136 * <td align="center">INACTIVE</td>
1137 * <td align="center">AF_TRIGGER</td>
1138 * <td align="center">ACTIVE_SCAN</td>
1139 * <td align="center">Start AF sweep, Lens now moving</td>
1140 * </tr>
1141 * <tr>
1142 * <td align="center">ACTIVE_SCAN</td>
1143 * <td align="center">AF sweep done</td>
1144 * <td align="center">FOCUSED_LOCKED</td>
1145 * <td align="center">Focused, Lens now locked</td>
1146 * </tr>
1147 * <tr>
1148 * <td align="center">ACTIVE_SCAN</td>
1149 * <td align="center">AF sweep done</td>
1150 * <td align="center">NOT_FOCUSED_LOCKED</td>
1151 * <td align="center">Not focused, Lens now locked</td>
1152 * </tr>
1153 * <tr>
1154 * <td align="center">ACTIVE_SCAN</td>
1155 * <td align="center">AF_CANCEL</td>
1156 * <td align="center">INACTIVE</td>
1157 * <td align="center">Cancel/reset AF, Lens now locked</td>
1158 * </tr>
1159 * <tr>
1160 * <td align="center">FOCUSED_LOCKED</td>
1161 * <td align="center">AF_CANCEL</td>
1162 * <td align="center">INACTIVE</td>
1163 * <td align="center">Cancel/reset AF</td>
1164 * </tr>
1165 * <tr>
1166 * <td align="center">FOCUSED_LOCKED</td>
1167 * <td align="center">AF_TRIGGER</td>
1168 * <td align="center">ACTIVE_SCAN</td>
1169 * <td align="center">Start new sweep, Lens now moving</td>
1170 * </tr>
1171 * <tr>
1172 * <td align="center">NOT_FOCUSED_LOCKED</td>
1173 * <td align="center">AF_CANCEL</td>
1174 * <td align="center">INACTIVE</td>
1175 * <td align="center">Cancel/reset AF</td>
1176 * </tr>
1177 * <tr>
1178 * <td align="center">NOT_FOCUSED_LOCKED</td>
1179 * <td align="center">AF_TRIGGER</td>
1180 * <td align="center">ACTIVE_SCAN</td>
1181 * <td align="center">Start new sweep, Lens now moving</td>
1182 * </tr>
1183 * <tr>
1184 * <td align="center">Any state</td>
1185 * <td align="center">Mode change</td>
1186 * <td align="center">INACTIVE</td>
1187 * <td align="center"></td>
1188 * </tr>
1189 * </tbody>
1190 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001191 * <p>For the above table, the camera device may skip reporting any state changes that happen
1192 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1193 * can be skipped in that manner is called a transient state.</p>
1194 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1195 * state transitions listed in above table, it is also legal for the camera device to skip
1196 * one or more transient states between two results. See below table for examples:</p>
1197 * <table>
1198 * <thead>
1199 * <tr>
1200 * <th align="center">State</th>
1201 * <th align="center">Transition Cause</th>
1202 * <th align="center">New State</th>
1203 * <th align="center">Notes</th>
1204 * </tr>
1205 * </thead>
1206 * <tbody>
1207 * <tr>
1208 * <td align="center">INACTIVE</td>
1209 * <td align="center">AF_TRIGGER</td>
1210 * <td align="center">FOCUSED_LOCKED</td>
1211 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1212 * </tr>
1213 * <tr>
1214 * <td align="center">INACTIVE</td>
1215 * <td align="center">AF_TRIGGER</td>
1216 * <td align="center">NOT_FOCUSED_LOCKED</td>
1217 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1218 * </tr>
1219 * <tr>
1220 * <td align="center">FOCUSED_LOCKED</td>
1221 * <td align="center">AF_TRIGGER</td>
1222 * <td align="center">FOCUSED_LOCKED</td>
1223 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1224 * </tr>
1225 * <tr>
1226 * <td align="center">NOT_FOCUSED_LOCKED</td>
1227 * <td align="center">AF_TRIGGER</td>
1228 * <td align="center">FOCUSED_LOCKED</td>
1229 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1230 * </tr>
1231 * </tbody>
1232 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001233 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1234 * <table>
1235 * <thead>
1236 * <tr>
1237 * <th align="center">State</th>
1238 * <th align="center">Transition Cause</th>
1239 * <th align="center">New State</th>
1240 * <th align="center">Notes</th>
1241 * </tr>
1242 * </thead>
1243 * <tbody>
1244 * <tr>
1245 * <td align="center">INACTIVE</td>
1246 * <td align="center">Camera device initiates new scan</td>
1247 * <td align="center">PASSIVE_SCAN</td>
1248 * <td align="center">Start AF scan, Lens now moving</td>
1249 * </tr>
1250 * <tr>
1251 * <td align="center">INACTIVE</td>
1252 * <td align="center">AF_TRIGGER</td>
1253 * <td align="center">NOT_FOCUSED_LOCKED</td>
1254 * <td align="center">AF state query, Lens now locked</td>
1255 * </tr>
1256 * <tr>
1257 * <td align="center">PASSIVE_SCAN</td>
1258 * <td align="center">Camera device completes current scan</td>
1259 * <td align="center">PASSIVE_FOCUSED</td>
1260 * <td align="center">End AF scan, Lens now locked</td>
1261 * </tr>
1262 * <tr>
1263 * <td align="center">PASSIVE_SCAN</td>
1264 * <td align="center">Camera device fails current scan</td>
1265 * <td align="center">PASSIVE_UNFOCUSED</td>
1266 * <td align="center">End AF scan, Lens now locked</td>
1267 * </tr>
1268 * <tr>
1269 * <td align="center">PASSIVE_SCAN</td>
1270 * <td align="center">AF_TRIGGER</td>
1271 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001272 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001273 * </tr>
1274 * <tr>
1275 * <td align="center">PASSIVE_SCAN</td>
1276 * <td align="center">AF_TRIGGER</td>
1277 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001278 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001279 * </tr>
1280 * <tr>
1281 * <td align="center">PASSIVE_SCAN</td>
1282 * <td align="center">AF_CANCEL</td>
1283 * <td align="center">INACTIVE</td>
1284 * <td align="center">Reset lens position, Lens now locked</td>
1285 * </tr>
1286 * <tr>
1287 * <td align="center">PASSIVE_FOCUSED</td>
1288 * <td align="center">Camera device initiates new scan</td>
1289 * <td align="center">PASSIVE_SCAN</td>
1290 * <td align="center">Start AF scan, Lens now moving</td>
1291 * </tr>
1292 * <tr>
1293 * <td align="center">PASSIVE_UNFOCUSED</td>
1294 * <td align="center">Camera device initiates new scan</td>
1295 * <td align="center">PASSIVE_SCAN</td>
1296 * <td align="center">Start AF scan, Lens now moving</td>
1297 * </tr>
1298 * <tr>
1299 * <td align="center">PASSIVE_FOCUSED</td>
1300 * <td align="center">AF_TRIGGER</td>
1301 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001302 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001303 * </tr>
1304 * <tr>
1305 * <td align="center">PASSIVE_UNFOCUSED</td>
1306 * <td align="center">AF_TRIGGER</td>
1307 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001308 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001309 * </tr>
1310 * <tr>
1311 * <td align="center">FOCUSED_LOCKED</td>
1312 * <td align="center">AF_TRIGGER</td>
1313 * <td align="center">FOCUSED_LOCKED</td>
1314 * <td align="center">No effect</td>
1315 * </tr>
1316 * <tr>
1317 * <td align="center">FOCUSED_LOCKED</td>
1318 * <td align="center">AF_CANCEL</td>
1319 * <td align="center">INACTIVE</td>
1320 * <td align="center">Restart AF scan</td>
1321 * </tr>
1322 * <tr>
1323 * <td align="center">NOT_FOCUSED_LOCKED</td>
1324 * <td align="center">AF_TRIGGER</td>
1325 * <td align="center">NOT_FOCUSED_LOCKED</td>
1326 * <td align="center">No effect</td>
1327 * </tr>
1328 * <tr>
1329 * <td align="center">NOT_FOCUSED_LOCKED</td>
1330 * <td align="center">AF_CANCEL</td>
1331 * <td align="center">INACTIVE</td>
1332 * <td align="center">Restart AF scan</td>
1333 * </tr>
1334 * </tbody>
1335 * </table>
1336 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1337 * <table>
1338 * <thead>
1339 * <tr>
1340 * <th align="center">State</th>
1341 * <th align="center">Transition Cause</th>
1342 * <th align="center">New State</th>
1343 * <th align="center">Notes</th>
1344 * </tr>
1345 * </thead>
1346 * <tbody>
1347 * <tr>
1348 * <td align="center">INACTIVE</td>
1349 * <td align="center">Camera device initiates new scan</td>
1350 * <td align="center">PASSIVE_SCAN</td>
1351 * <td align="center">Start AF scan, Lens now moving</td>
1352 * </tr>
1353 * <tr>
1354 * <td align="center">INACTIVE</td>
1355 * <td align="center">AF_TRIGGER</td>
1356 * <td align="center">NOT_FOCUSED_LOCKED</td>
1357 * <td align="center">AF state query, Lens now locked</td>
1358 * </tr>
1359 * <tr>
1360 * <td align="center">PASSIVE_SCAN</td>
1361 * <td align="center">Camera device completes current scan</td>
1362 * <td align="center">PASSIVE_FOCUSED</td>
1363 * <td align="center">End AF scan, Lens now locked</td>
1364 * </tr>
1365 * <tr>
1366 * <td align="center">PASSIVE_SCAN</td>
1367 * <td align="center">Camera device fails current scan</td>
1368 * <td align="center">PASSIVE_UNFOCUSED</td>
1369 * <td align="center">End AF scan, Lens now locked</td>
1370 * </tr>
1371 * <tr>
1372 * <td align="center">PASSIVE_SCAN</td>
1373 * <td align="center">AF_TRIGGER</td>
1374 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001375 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001376 * </tr>
1377 * <tr>
1378 * <td align="center">PASSIVE_SCAN</td>
1379 * <td align="center">AF_TRIGGER</td>
1380 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001381 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001382 * </tr>
1383 * <tr>
1384 * <td align="center">PASSIVE_SCAN</td>
1385 * <td align="center">AF_CANCEL</td>
1386 * <td align="center">INACTIVE</td>
1387 * <td align="center">Reset lens position, Lens now locked</td>
1388 * </tr>
1389 * <tr>
1390 * <td align="center">PASSIVE_FOCUSED</td>
1391 * <td align="center">Camera device initiates new scan</td>
1392 * <td align="center">PASSIVE_SCAN</td>
1393 * <td align="center">Start AF scan, Lens now moving</td>
1394 * </tr>
1395 * <tr>
1396 * <td align="center">PASSIVE_UNFOCUSED</td>
1397 * <td align="center">Camera device initiates new scan</td>
1398 * <td align="center">PASSIVE_SCAN</td>
1399 * <td align="center">Start AF scan, Lens now moving</td>
1400 * </tr>
1401 * <tr>
1402 * <td align="center">PASSIVE_FOCUSED</td>
1403 * <td align="center">AF_TRIGGER</td>
1404 * <td align="center">FOCUSED_LOCKED</td>
1405 * <td align="center">Immediate trans. Lens now locked</td>
1406 * </tr>
1407 * <tr>
1408 * <td align="center">PASSIVE_UNFOCUSED</td>
1409 * <td align="center">AF_TRIGGER</td>
1410 * <td align="center">NOT_FOCUSED_LOCKED</td>
1411 * <td align="center">Immediate trans. Lens now locked</td>
1412 * </tr>
1413 * <tr>
1414 * <td align="center">FOCUSED_LOCKED</td>
1415 * <td align="center">AF_TRIGGER</td>
1416 * <td align="center">FOCUSED_LOCKED</td>
1417 * <td align="center">No effect</td>
1418 * </tr>
1419 * <tr>
1420 * <td align="center">FOCUSED_LOCKED</td>
1421 * <td align="center">AF_CANCEL</td>
1422 * <td align="center">INACTIVE</td>
1423 * <td align="center">Restart AF scan</td>
1424 * </tr>
1425 * <tr>
1426 * <td align="center">NOT_FOCUSED_LOCKED</td>
1427 * <td align="center">AF_TRIGGER</td>
1428 * <td align="center">NOT_FOCUSED_LOCKED</td>
1429 * <td align="center">No effect</td>
1430 * </tr>
1431 * <tr>
1432 * <td align="center">NOT_FOCUSED_LOCKED</td>
1433 * <td align="center">AF_CANCEL</td>
1434 * <td align="center">INACTIVE</td>
1435 * <td align="center">Restart AF scan</td>
1436 * </tr>
1437 * </tbody>
1438 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001439 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1440 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1441 * camera device. When a trigger is included in a mode switch request, the trigger
1442 * will be evaluated in the context of the new mode in the request.
1443 * See below table for examples:</p>
1444 * <table>
1445 * <thead>
1446 * <tr>
1447 * <th align="center">State</th>
1448 * <th align="center">Transition Cause</th>
1449 * <th align="center">New State</th>
1450 * <th align="center">Notes</th>
1451 * </tr>
1452 * </thead>
1453 * <tbody>
1454 * <tr>
1455 * <td align="center">any state</td>
1456 * <td align="center">CAF--&gt;AUTO mode switch</td>
1457 * <td align="center">INACTIVE</td>
1458 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1459 * </tr>
1460 * <tr>
1461 * <td align="center">any state</td>
1462 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1463 * <td align="center">trigger-reachable states from INACTIVE</td>
1464 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1465 * </tr>
1466 * <tr>
1467 * <td align="center">any state</td>
1468 * <td align="center">AUTO--&gt;CAF mode switch</td>
1469 * <td align="center">passively reachable states from INACTIVE</td>
1470 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1471 * </tr>
1472 * </tbody>
1473 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001474 * <p><b>Possible values:</b>
1475 * <ul>
1476 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1477 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1478 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1479 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1480 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1481 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1482 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1483 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001484 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001485 *
1486 * @see CaptureRequest#CONTROL_AF_MODE
1487 * @see CaptureRequest#CONTROL_MODE
1488 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001489 * @see #CONTROL_AF_STATE_INACTIVE
1490 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1491 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1492 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1493 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1494 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001495 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001496 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001497 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001498 public static final Key<Integer> CONTROL_AF_STATE =
1499 new Key<Integer>("android.control.afState", int.class);
1500
1501 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001502 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001503 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001504 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1505 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1506 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1507 * get locked do not necessarily correspond to the settings that were present in the
1508 * latest capture result received from the camera device, since additional captures
1509 * and AWB updates may have occurred even before the result was sent out. If an
1510 * application is switching between automatic and manual control and wishes to eliminate
1511 * any flicker during the switch, the following procedure is recommended:</p>
1512 * <ol>
1513 * <li>Starting in auto-AWB mode:</li>
1514 * <li>Lock AWB</li>
1515 * <li>Wait for the first result to be output that has the AWB locked</li>
1516 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1517 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1518 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001519 * <p>Note that AWB lock is only meaningful when
1520 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1521 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001522 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1523 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001524 *
1525 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001526 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001527 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001528 public static final Key<Boolean> CONTROL_AWB_LOCK =
1529 new Key<Boolean>("android.control.awbLock", boolean.class);
1530
1531 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001532 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001533 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001534 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001535 * <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 -07001536 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001537 * routine is enabled, overriding the application's selected
1538 * {@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 -08001539 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1540 * is OFF, the behavior of AWB is device dependent. It is recommened to
1541 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1542 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001543 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001544 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001545 * 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 -08001546 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001547 * <p>When set to any other modes, the camera device's auto-white
1548 * balance routine is disabled. The camera device uses each
1549 * particular illumination target for white balance
1550 * adjustment. The application's values for
1551 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1552 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1553 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001554 * <p><b>Possible values:</b>
1555 * <ul>
1556 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1557 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1558 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1559 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1560 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1561 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1562 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1563 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1564 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1565 * </ul></p>
1566 * <p><b>Available values for this device:</b><br>
1567 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001568 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001569 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001570 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001571 * @see CaptureRequest#COLOR_CORRECTION_MODE
1572 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001573 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001574 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001575 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001576 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001577 * @see #CONTROL_AWB_MODE_OFF
1578 * @see #CONTROL_AWB_MODE_AUTO
1579 * @see #CONTROL_AWB_MODE_INCANDESCENT
1580 * @see #CONTROL_AWB_MODE_FLUORESCENT
1581 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1582 * @see #CONTROL_AWB_MODE_DAYLIGHT
1583 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1584 * @see #CONTROL_AWB_MODE_TWILIGHT
1585 * @see #CONTROL_AWB_MODE_SHADE
1586 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001587 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001588 public static final Key<Integer> CONTROL_AWB_MODE =
1589 new Key<Integer>("android.control.awbMode", int.class);
1590
1591 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001592 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001593 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001594 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001595 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001596 * <p>The maximum number of regions supported by the device is determined by the value
1597 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001598 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001599 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001600 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1601 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001602 * bottom-right pixel in the active pixel array.</p>
1603 * <p>The weight must range from 0 to 1000, and represents a weight
1604 * for every pixel in the area. This means that a large metering area
1605 * with the same weight as a smaller area will have more effect in
1606 * the metering result. Metering areas can partially overlap and the
1607 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001608 * <p>The weights are relative to weights of other white balance metering regions, so if
1609 * only one region is used, all non-zero weights will have the same effect. A region with
1610 * 0 weight is ignored.</p>
1611 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1612 * camera device.</p>
1613 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1614 * capture result metadata, the camera device will ignore the sections outside the crop
1615 * region and output only the intersection rectangle as the metering region in the result
1616 * metadata. If the region is entirely outside the crop region, it will be ignored and
1617 * not reported in the result metadata.</p>
1618 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1619 * <p><b>Range of valid values:</b><br>
1620 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1621 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001622 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001623 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001624 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001625 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001626 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001627 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001628 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001629 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1630 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001631
1632 /**
Zhijun He379af012014-05-06 11:54:54 -07001633 * <p>Information to the camera device 3A (auto-exposure,
1634 * auto-focus, auto-white balance) routines about the purpose
1635 * of this capture, to help the camera device to decide optimal 3A
1636 * strategy.</p>
1637 * <p>This control (except for MANUAL) is only effective if
1638 * <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 -07001639 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1640 * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001641 * contains MANUAL_SENSOR. Other intent values are always supported.</p>
1642 * <p><b>Possible values:</b>
1643 * <ul>
1644 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1645 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1646 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1647 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1648 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1649 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1650 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1651 * </ul></p>
1652 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001653 *
1654 * @see CaptureRequest#CONTROL_MODE
1655 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1656 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1657 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1658 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1659 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1660 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1661 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1662 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1663 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001664 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001665 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1666 new Key<Integer>("android.control.captureIntent", int.class);
1667
1668 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001669 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001670 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1671 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1672 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1673 * the algorithm states to INACTIVE.</p>
1674 * <p>The camera device can do several state transitions between two results, if it is
1675 * allowed by the state transition table. So INACTIVE may never actually be seen in
1676 * a result.</p>
1677 * <p>The state in the result is the state for this image (in sync with this image): if
1678 * AWB state becomes CONVERGED, then the image data associated with this result should
1679 * be good to use.</p>
1680 * <p>Below are state transition tables for different AWB modes.</p>
1681 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1682 * <table>
1683 * <thead>
1684 * <tr>
1685 * <th align="center">State</th>
1686 * <th align="center">Transition Cause</th>
1687 * <th align="center">New State</th>
1688 * <th align="center">Notes</th>
1689 * </tr>
1690 * </thead>
1691 * <tbody>
1692 * <tr>
1693 * <td align="center">INACTIVE</td>
1694 * <td align="center"></td>
1695 * <td align="center">INACTIVE</td>
1696 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1697 * </tr>
1698 * </tbody>
1699 * </table>
1700 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1701 * <table>
1702 * <thead>
1703 * <tr>
1704 * <th align="center">State</th>
1705 * <th align="center">Transition Cause</th>
1706 * <th align="center">New State</th>
1707 * <th align="center">Notes</th>
1708 * </tr>
1709 * </thead>
1710 * <tbody>
1711 * <tr>
1712 * <td align="center">INACTIVE</td>
1713 * <td align="center">Camera device initiates AWB scan</td>
1714 * <td align="center">SEARCHING</td>
1715 * <td align="center">Values changing</td>
1716 * </tr>
1717 * <tr>
1718 * <td align="center">INACTIVE</td>
1719 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1720 * <td align="center">LOCKED</td>
1721 * <td align="center">Values locked</td>
1722 * </tr>
1723 * <tr>
1724 * <td align="center">SEARCHING</td>
1725 * <td align="center">Camera device finishes AWB scan</td>
1726 * <td align="center">CONVERGED</td>
1727 * <td align="center">Good values, not changing</td>
1728 * </tr>
1729 * <tr>
1730 * <td align="center">SEARCHING</td>
1731 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1732 * <td align="center">LOCKED</td>
1733 * <td align="center">Values locked</td>
1734 * </tr>
1735 * <tr>
1736 * <td align="center">CONVERGED</td>
1737 * <td align="center">Camera device initiates AWB scan</td>
1738 * <td align="center">SEARCHING</td>
1739 * <td align="center">Values changing</td>
1740 * </tr>
1741 * <tr>
1742 * <td align="center">CONVERGED</td>
1743 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1744 * <td align="center">LOCKED</td>
1745 * <td align="center">Values locked</td>
1746 * </tr>
1747 * <tr>
1748 * <td align="center">LOCKED</td>
1749 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1750 * <td align="center">SEARCHING</td>
1751 * <td align="center">Values not good after unlock</td>
1752 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001753 * </tbody>
1754 * </table>
1755 * <p>For the above table, the camera device may skip reporting any state changes that happen
1756 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1757 * can be skipped in that manner is called a transient state.</p>
1758 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1759 * listed in above table, it is also legal for the camera device to skip one or more
1760 * transient states between two results. See below table for examples:</p>
1761 * <table>
1762 * <thead>
1763 * <tr>
1764 * <th align="center">State</th>
1765 * <th align="center">Transition Cause</th>
1766 * <th align="center">New State</th>
1767 * <th align="center">Notes</th>
1768 * </tr>
1769 * </thead>
1770 * <tbody>
1771 * <tr>
1772 * <td align="center">INACTIVE</td>
1773 * <td align="center">Camera device finished AWB scan</td>
1774 * <td align="center">CONVERGED</td>
1775 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1776 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001777 * <tr>
1778 * <td align="center">LOCKED</td>
1779 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1780 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001781 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001782 * </tr>
1783 * </tbody>
1784 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001785 * <p><b>Possible values:</b>
1786 * <ul>
1787 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1788 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1789 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1790 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1791 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001792 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1793 * <p><b>Limited capability</b> -
1794 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1795 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001796 *
1797 * @see CaptureRequest#CONTROL_AWB_LOCK
1798 * @see CaptureRequest#CONTROL_AWB_MODE
1799 * @see CaptureRequest#CONTROL_MODE
1800 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001801 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001802 * @see #CONTROL_AWB_STATE_INACTIVE
1803 * @see #CONTROL_AWB_STATE_SEARCHING
1804 * @see #CONTROL_AWB_STATE_CONVERGED
1805 * @see #CONTROL_AWB_STATE_LOCKED
1806 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001807 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001808 public static final Key<Integer> CONTROL_AWB_STATE =
1809 new Key<Integer>("android.control.awbState", int.class);
1810
1811 /**
Zhijun He379af012014-05-06 11:54:54 -07001812 * <p>A special color effect to apply.</p>
1813 * <p>When this mode is set, a color effect will be applied
1814 * to images produced by the camera device. The interpretation
1815 * and implementation of these color effects is left to the
1816 * implementor of the camera device, and should not be
1817 * depended on to be consistent (or present) across all
1818 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001819 * <p><b>Possible values:</b>
1820 * <ul>
1821 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1822 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1823 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1824 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1825 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1826 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1827 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1828 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1829 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1830 * </ul></p>
1831 * <p><b>Available values for this device:</b><br>
1832 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001833 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001834 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001835 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07001836 * @see #CONTROL_EFFECT_MODE_OFF
1837 * @see #CONTROL_EFFECT_MODE_MONO
1838 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1839 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1840 * @see #CONTROL_EFFECT_MODE_SEPIA
1841 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1842 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1843 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1844 * @see #CONTROL_EFFECT_MODE_AQUA
1845 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001846 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001847 public static final Key<Integer> CONTROL_EFFECT_MODE =
1848 new Key<Integer>("android.control.effectMode", int.class);
1849
1850 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001851 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001852 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001853 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001854 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001855 * capture parameters itself.</p>
1856 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001857 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001858 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001859 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001860 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001861 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001862 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001863 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1864 * is that this frame will not be used by camera device background 3A statistics
1865 * update, as if this frame is never captured. This mode can be used in the scenario
1866 * where the application doesn't want a 3A manual control capture to affect
1867 * the subsequent auto 3A capture results.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001868 * <p>LEGACY mode devices will only support AUTO and USE_SCENE_MODE modes.
1869 * LIMITED mode devices will only support OFF and OFF_KEEP_STATE if they
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001870 * support the MANUAL_SENSOR and MANUAL_POST_PROCSESING capabilities.
1871 * FULL mode devices will always support OFF and OFF_KEEP_STATE.</p>
1872 * <p><b>Possible values:</b>
1873 * <ul>
1874 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
1875 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1876 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1877 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1878 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001879 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001880 *
1881 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001882 * @see #CONTROL_MODE_OFF
1883 * @see #CONTROL_MODE_AUTO
1884 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001885 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001886 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001887 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001888 public static final Key<Integer> CONTROL_MODE =
1889 new Key<Integer>("android.control.mode", int.class);
1890
1891 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001892 * <p>Control for which scene mode is currently active.</p>
1893 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1894 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07001895 * <p>This is the mode that that is active when
1896 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1897 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001898 * {@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 -07001899 * <p>The interpretation and implementation of these scene modes is left
1900 * to the implementor of the camera device. Their behavior will not be
1901 * consistent across all devices, and any given device may only implement
1902 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001903 * <p><b>Possible values:</b>
1904 * <ul>
1905 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1906 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1907 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1908 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1909 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1910 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1911 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1912 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1913 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1914 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1915 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1916 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1917 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1918 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1919 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1920 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1921 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1922 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001923 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001924 * </ul></p>
1925 * <p><b>Available values for this device:</b><br>
1926 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001927 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001928 *
1929 * @see CaptureRequest#CONTROL_AE_MODE
1930 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001931 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001932 * @see CaptureRequest#CONTROL_AWB_MODE
1933 * @see CaptureRequest#CONTROL_MODE
1934 * @see #CONTROL_SCENE_MODE_DISABLED
1935 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1936 * @see #CONTROL_SCENE_MODE_ACTION
1937 * @see #CONTROL_SCENE_MODE_PORTRAIT
1938 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1939 * @see #CONTROL_SCENE_MODE_NIGHT
1940 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1941 * @see #CONTROL_SCENE_MODE_THEATRE
1942 * @see #CONTROL_SCENE_MODE_BEACH
1943 * @see #CONTROL_SCENE_MODE_SNOW
1944 * @see #CONTROL_SCENE_MODE_SUNSET
1945 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1946 * @see #CONTROL_SCENE_MODE_FIREWORKS
1947 * @see #CONTROL_SCENE_MODE_SPORTS
1948 * @see #CONTROL_SCENE_MODE_PARTY
1949 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1950 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07001951 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001952 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07001953 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001954 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001955 public static final Key<Integer> CONTROL_SCENE_MODE =
1956 new Key<Integer>("android.control.sceneMode", int.class);
1957
1958 /**
1959 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001960 * active.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001961 * <p>Video stabilization automatically translates and scales images from
1962 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07001963 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001964 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001965 * <p>Switching between different video stabilization modes may take several
1966 * frames to initialize, the camera device will report the current mode
1967 * in capture result metadata. For example, When "ON" mode is requested,
1968 * the video stabilization modes in the first several capture results may
1969 * still be "OFF", and it will become "ON" when the initialization is
1970 * done.</p>
1971 * <p>If a camera device supports both this mode and OIS
1972 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
1973 * produce undesirable interaction, so it is recommended not to enable
1974 * both at the same time.</p>
1975 * <p><b>Possible values:</b>
1976 * <ul>
1977 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
1978 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
1979 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001980 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001981 *
Zhijun He45fa43a12014-06-13 18:29:37 -07001982 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07001983 * @see CaptureRequest#SCALER_CROP_REGION
1984 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1985 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1986 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001987 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001988 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1989 new Key<Integer>("android.control.videoStabilizationMode", int.class);
1990
1991 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001992 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001993 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001994 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
1995 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001996 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001997 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001998 * camera device will use the highest-quality enhancement algorithms,
1999 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08002000 * not slow down capture rate when applying edge enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002001 * <p><b>Possible values:</b>
2002 * <ul>
2003 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2004 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2005 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2006 * </ul></p>
2007 * <p><b>Available values for this device:</b><br>
2008 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002009 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2010 * <p><b>Full capability</b> -
2011 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2012 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002013 *
2014 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002015 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002016 * @see #EDGE_MODE_OFF
2017 * @see #EDGE_MODE_FAST
2018 * @see #EDGE_MODE_HIGH_QUALITY
2019 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002020 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002021 public static final Key<Integer> EDGE_MODE =
2022 new Key<Integer>("android.edge.mode", int.class);
2023
2024 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002025 * <p>The desired mode for for the camera device's flash control.</p>
2026 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002027 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002028 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2029 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2030 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2031 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2032 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2033 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002034 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002035 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2036 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2037 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002038 * <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 -07002039 * <p><b>Possible values:</b>
2040 * <ul>
2041 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2042 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2043 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2044 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002045 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002046 *
2047 * @see CaptureRequest#CONTROL_AE_MODE
2048 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2049 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002050 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002051 * @see #FLASH_MODE_OFF
2052 * @see #FLASH_MODE_SINGLE
2053 * @see #FLASH_MODE_TORCH
2054 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002055 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002056 public static final Key<Integer> FLASH_MODE =
2057 new Key<Integer>("android.flash.mode", int.class);
2058
2059 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002060 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002061 * unit.</p>
2062 * <p>When the camera device doesn't have flash unit
2063 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2064 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002065 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2066 * <ul>
2067 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2068 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002069 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002070 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002071 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002072 * </ul>
2073 * <p>In all other conditions the state will not be available on
2074 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002075 * <p><b>Possible values:</b>
2076 * <ul>
2077 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2078 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2079 * <li>{@link #FLASH_STATE_READY READY}</li>
2080 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2081 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2082 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002083 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2084 * <p><b>Limited capability</b> -
2085 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2086 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002087 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002088 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002089 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002090 * @see CaptureRequest#FLASH_MODE
2091 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002092 * @see #FLASH_STATE_UNAVAILABLE
2093 * @see #FLASH_STATE_CHARGING
2094 * @see #FLASH_STATE_READY
2095 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002096 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002097 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002098 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002099 public static final Key<Integer> FLASH_STATE =
2100 new Key<Integer>("android.flash.state", int.class);
2101
2102 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002103 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002104 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002105 * that do not accurately measure the incoming light (i.e. pixels that
2106 * are stuck at an arbitrary value or are oversensitive).</p>
2107 * <p><b>Possible values:</b>
2108 * <ul>
2109 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2110 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2111 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2112 * </ul></p>
2113 * <p><b>Available values for this device:</b><br>
2114 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002115 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002116 *
2117 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002118 * @see #HOT_PIXEL_MODE_OFF
2119 * @see #HOT_PIXEL_MODE_FAST
2120 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2121 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002122 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002123 public static final Key<Integer> HOT_PIXEL_MODE =
2124 new Key<Integer>("android.hotPixel.mode", int.class);
2125
2126 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002127 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002128 * <p>Setting a location object in a request will include the GPS coordinates of the location
2129 * into any JPEG images captured based on the request. These coordinates can then be
2130 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002131 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002132 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002133 @PublicKey
2134 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002135 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2136 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2137
2138 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002139 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002140 * EXIF.</p>
2141 * <p><b>Range of valid values:</b><br>
2142 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002143 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002144 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002145 */
2146 public static final Key<double[]> JPEG_GPS_COORDINATES =
2147 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2148
2149 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002150 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002151 * include in EXIF.</p>
2152 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002153 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002154 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002155 */
2156 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2157 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2158
2159 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002160 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002161 * EXIF.</p>
2162 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002163 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002164 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002165 */
2166 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2167 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2168
2169 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002170 * <p>The orientation for a JPEG image.</p>
2171 * <p>The clockwise rotation angle in degrees, relative to the orientation
2172 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2173 * upright.</p>
2174 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
2175 * rotate the image data to match this orientation.</p>
2176 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2177 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
2178 * <p>To translate from the device orientation given by the Android sensor APIs, the following
2179 * sample code may be used:</p>
2180 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2181 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2182 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2183 *
2184 * // Round device orientation to a multiple of 90
2185 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2186 *
2187 * // Reverse device orientation for front-facing cameras
2188 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2189 * if (facingFront) deviceOrientation = -deviceOrientation;
2190 *
2191 * // Calculate desired JPEG orientation relative to camera orientation to make
2192 * // the image upright relative to the device orientation
2193 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2194 *
2195 * return jpegOrientation;
2196 * }
2197 * </code></pre>
2198 * <p><b>Units</b>: Degrees in multiples of 90</p>
2199 * <p><b>Range of valid values:</b><br>
2200 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002201 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002202 *
2203 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002204 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002205 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002206 public static final Key<Integer> JPEG_ORIENTATION =
2207 new Key<Integer>("android.jpeg.orientation", int.class);
2208
2209 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002210 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002211 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002212 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002213 * <p><b>Range of valid values:</b><br>
2214 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002215 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002216 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002217 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002218 public static final Key<Byte> JPEG_QUALITY =
2219 new Key<Byte>("android.jpeg.quality", byte.class);
2220
2221 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002222 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002223 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002224 * <p><b>Range of valid values:</b><br>
2225 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002226 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002227 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002228 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002229 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2230 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2231
2232 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002233 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002234 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2235 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002236 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2237 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002238 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2239 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2240 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2241 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2242 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2243 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002244 * <p><b>Range of valid values:</b><br>
2245 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002246 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002247 *
2248 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002249 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002250 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002251 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2252 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002253
2254 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002255 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2256 * effective aperture diameter.</p>
2257 * <p>Setting this value is only supported on the camera devices that have a variable
2258 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002259 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2260 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002261 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002262 * to achieve manual exposure control.</p>
2263 * <p>The requested aperture value may take several frames to reach the
2264 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002265 * aperture size in capture result metadata while the aperture is changing.
2266 * 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 -08002267 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2268 * the ON modes, this will be overridden by the camera device
2269 * auto-exposure algorithm, the overridden values are then provided
2270 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002271 * <p><b>Units</b>: The f-number (f/N)</p>
2272 * <p><b>Range of valid values:</b><br>
2273 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002274 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2275 * <p><b>Full capability</b> -
2276 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2277 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002278 *
Zhijun He399f05d2014-01-15 11:31:30 -08002279 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002280 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002281 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002282 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002283 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002284 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002285 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002286 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002287 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002288 public static final Key<Float> LENS_APERTURE =
2289 new Key<Float>("android.lens.aperture", float.class);
2290
2291 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002292 * <p>The desired setting for the lens neutral density filter(s).</p>
2293 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002294 * <p>Lens filters are typically used to lower the amount of light the
2295 * sensor is exposed to (measured in steps of EV). As used here, an EV
2296 * step is the standard logarithmic representation, which are
2297 * non-negative, and inversely proportional to the amount of light
2298 * hitting the sensor. For example, setting this to 0 would result
2299 * in no reduction of the incoming light, and setting this to 2 would
2300 * mean that the filter is set to reduce incoming light by two stops
2301 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002302 * <p>It may take several frames before the lens filter density changes
2303 * to the requested value. While the filter density is still changing,
2304 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002305 * <p><b>Units</b>: Exposure Value (EV)</p>
2306 * <p><b>Range of valid values:</b><br>
2307 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002308 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2309 * <p><b>Full capability</b> -
2310 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2311 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002312 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002313 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002314 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002315 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002316 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002317 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002318 public static final Key<Float> LENS_FILTER_DENSITY =
2319 new Key<Float>("android.lens.filterDensity", float.class);
2320
2321 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002322 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002323 * <p>This setting controls the physical focal length of the camera
2324 * device's lens. Changing the focal length changes the field of
2325 * view of the camera device, and is usually used for optical zoom.</p>
2326 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2327 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002328 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002329 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2330 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002331 * <p>Optical zoom will not be supported on most devices.</p>
2332 * <p><b>Units</b>: Millimeters</p>
2333 * <p><b>Range of valid values:</b><br>
2334 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002335 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002336 *
2337 * @see CaptureRequest#LENS_APERTURE
2338 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002339 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002340 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002341 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002342 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002343 public static final Key<Float> LENS_FOCAL_LENGTH =
2344 new Key<Float>("android.lens.focalLength", float.class);
2345
2346 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002347 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002348 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002349 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002350 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2351 * <p><b>Range of valid values:</b><br>
2352 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002353 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2354 * <p><b>Full capability</b> -
2355 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2356 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2357 *
2358 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002359 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002360 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002361 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002362 public static final Key<Float> LENS_FOCUS_DISTANCE =
2363 new Key<Float>("android.lens.focusDistance", float.class);
2364
2365 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002366 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002367 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002368 * <p>If variable focus not supported, can still report
2369 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002370 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2371 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2372 * <p><b>Range of valid values:</b><br>
2373 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002374 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2375 * <p><b>Limited capability</b> -
2376 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2377 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2378 *
2379 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002380 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002381 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002382 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002383 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2384 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 -07002385
2386 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002387 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2388 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002389 * <p>OIS is used to compensate for motion blur due to small
2390 * movements of the camera during capture. Unlike digital image
2391 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2392 * makes use of mechanical elements to stabilize the camera
2393 * sensor, and thus allows for longer exposure times before
2394 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002395 * <p>Switching between different optical stabilization modes may take several
2396 * frames to initialize, the camera device will report the current mode in
2397 * capture result metadata. For example, When "ON" mode is requested, the
2398 * optical stabilization modes in the first several capture results may still
2399 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002400 * <p>If a camera device supports both OIS and digital image stabilization
2401 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2402 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002403 * <p>Not all devices will support OIS; see
2404 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2405 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002406 * <p><b>Possible values:</b>
2407 * <ul>
2408 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2409 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2410 * </ul></p>
2411 * <p><b>Available values for this device:</b><br>
2412 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002413 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2414 * <p><b>Limited capability</b> -
2415 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2416 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002417 *
2418 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002419 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002420 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002421 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2422 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2423 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002424 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002425 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2426 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2427
2428 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002429 * <p>Current lens status.</p>
2430 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2431 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2432 * they may take several frames to reach the requested values. This state indicates
2433 * the current status of the lens parameters.</p>
2434 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2435 * either because the parameters are all fixed, or because the lens has had enough
2436 * time to reach the most recently-requested values.
2437 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2438 * <ul>
2439 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2440 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2441 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2442 * which means the optical zoom is not supported.</li>
2443 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2444 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2445 * </ul>
2446 * <p>Then this state will always be STATIONARY.</p>
2447 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2448 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002449 * <p><b>Possible values:</b>
2450 * <ul>
2451 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2452 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2453 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002454 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2455 * <p><b>Limited capability</b> -
2456 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2457 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002458 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002459 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002460 * @see CaptureRequest#LENS_APERTURE
2461 * @see CaptureRequest#LENS_FILTER_DENSITY
2462 * @see CaptureRequest#LENS_FOCAL_LENGTH
2463 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2464 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2465 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2466 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2467 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002468 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002469 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002470 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002471 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002472 public static final Key<Integer> LENS_STATE =
2473 new Key<Integer>("android.lens.state", int.class);
2474
2475 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002476 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002477 * <p>The noise reduction algorithm attempts to improve image quality by removing
2478 * excessive noise added by the capture process, especially in dark conditions.
2479 * OFF means no noise reduction will be applied by the camera device.</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>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002485 * <p><b>Possible values:</b>
2486 * <ul>
2487 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2488 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2489 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2490 * </ul></p>
2491 * <p><b>Available values for this device:</b><br>
2492 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002493 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2494 * <p><b>Full capability</b> -
2495 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2496 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002497 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002498 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002499 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002500 * @see #NOISE_REDUCTION_MODE_OFF
2501 * @see #NOISE_REDUCTION_MODE_FAST
2502 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
2503 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002504 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002505 public static final Key<Integer> NOISE_REDUCTION_MODE =
2506 new Key<Integer>("android.noiseReduction.mode", int.class);
2507
2508 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002509 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002510 * final one for the capture, or only a partial that contains a
2511 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002512 * values.</p>
2513 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002514 * single capture may not overlap, except for this entry. The
2515 * FINAL buffers must retain FIFO ordering relative to the
2516 * requests that generate them, so the FINAL buffer for frame 3 must
2517 * always be sent to the framework after the FINAL buffer for frame 2, and
2518 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2519 * in any order relative to other frames, but all PARTIAL buffers for a given
2520 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002521 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002522 * <p><b>Range of valid values:</b><br>
2523 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002524 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002525 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002526 * @hide
2527 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002528 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002529 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2530 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2531
2532 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002533 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002534 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002535 * frameCount value).</p>
2536 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002537 * <p><b>Units</b>: count of frames</p>
2538 * <p><b>Range of valid values:</b><br>
2539 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002540 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002541 * @deprecated
2542 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002543 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002544 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002545 public static final Key<Integer> REQUEST_FRAME_COUNT =
2546 new Key<Integer>("android.request.frameCount", int.class);
2547
2548 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002549 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002550 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002551 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002552 * <p><b>Units</b>: arbitrary integer assigned by application</p>
2553 * <p><b>Range of valid values:</b><br>
2554 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002555 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002556 * @hide
2557 */
2558 public static final Key<Integer> REQUEST_ID =
2559 new Key<Integer>("android.request.id", int.class);
2560
2561 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002562 * <p>Specifies the number of pipeline stages the frame went
2563 * through from when it was exposed to when the final completed result
2564 * was available to the framework.</p>
2565 * <p>Depending on what settings are used in the request, and
2566 * what streams are configured, the data may undergo less processing,
2567 * and some pipeline stages skipped.</p>
2568 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002569 * <p><b>Range of valid values:</b><br>
2570 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002571 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002572 *
2573 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2574 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002575 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002576 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2577 new Key<Byte>("android.request.pipelineDepth", byte.class);
2578
2579 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002580 * <p>The desired region of the sensor to read out for this capture.</p>
2581 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002582 * <p>The crop region coordinate system is based off
2583 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2584 * top-left corner of the sensor active array.</p>
2585 * <p>Output streams use this rectangle to produce their output,
2586 * cropping to a smaller region if necessary to maintain the
2587 * stream's aspect ratio, then scaling the sensor input to
2588 * match the output's configured resolution.</p>
2589 * <p>The crop region is applied after the RAW to other color
2590 * space (e.g. YUV) conversion. Since raw streams
2591 * (e.g. RAW16) don't have the conversion stage, they are not
2592 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002593 * <p>For non-raw streams, any additional per-stream cropping will
2594 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002595 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002596 * ratio, then 4:3 streams will use the exact crop
2597 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002598 * (letterbox).</p>
2599 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002600 * outputs will crop horizontally (pillarbox), and 16:9
2601 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002602 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002603 * <p>The width and height of the crop region cannot
2604 * be set to be smaller than
2605 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2606 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2607 * <p>The camera device may adjust the crop region to account
2608 * for rounding and other hardware requirements; the final
2609 * crop region used will be included in the output capture
2610 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002611 * <p><b>Units</b>: Pixel coordinates relative to
2612 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002613 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002614 *
2615 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002616 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002617 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002618 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002619 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2620 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2621
2622 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002623 * <p>Duration each pixel is exposed to
2624 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002625 * <p>If the sensor can't expose this exact duration, it will shorten the
2626 * duration exposed to the nearest possible value (rather than expose longer).
2627 * The final exposure time used will be available in the output capture result.</p>
2628 * <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
2629 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2630 * <p><b>Units</b>: Nanoseconds</p>
2631 * <p><b>Range of valid values:</b><br>
2632 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002633 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2634 * <p><b>Full capability</b> -
2635 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2636 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2637 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002638 * @see CaptureRequest#CONTROL_AE_MODE
2639 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002640 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002641 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002642 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002643 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002644 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2645 new Key<Long>("android.sensor.exposureTime", long.class);
2646
2647 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002648 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002649 * start of next frame exposure.</p>
2650 * <p>The maximum frame rate that can be supported by a camera subsystem is
2651 * a function of many factors:</p>
2652 * <ul>
2653 * <li>Requested resolutions of output image streams</li>
2654 * <li>Availability of binning / skipping modes on the imager</li>
2655 * <li>The bandwidth of the imager interface</li>
2656 * <li>The bandwidth of the various ISP processing blocks</li>
2657 * </ul>
2658 * <p>Since these factors can vary greatly between different ISPs and
2659 * sensors, the camera abstraction tries to represent the bandwidth
2660 * restrictions with as simple a model as possible.</p>
2661 * <p>The model presented has the following characteristics:</p>
2662 * <ul>
2663 * <li>The image sensor is always configured to output the smallest
2664 * resolution possible given the application's requested output stream
2665 * sizes. The smallest resolution is defined as being at least as large
2666 * as the largest requested output stream size; the camera pipeline must
2667 * never digitally upsample sensor data when the crop region covers the
2668 * whole sensor. In general, this means that if only small output stream
2669 * resolutions are configured, the sensor can provide a higher frame
2670 * rate.</li>
2671 * <li>Since any request may use any or all the currently configured
2672 * output streams, the sensor and ISP must be configured to support
2673 * scaling a single capture to all the streams at the same time. This
2674 * means the camera pipeline must be ready to produce the largest
2675 * requested output size without any delay. Therefore, the overall
2676 * frame rate of a given configured stream set is governed only by the
2677 * largest requested stream resolution.</li>
2678 * <li>Using more than one output stream in a request does not affect the
2679 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002680 * <li>Certain format-streams may need to do additional background processing
2681 * before data is consumed/produced by that stream. These processors
2682 * can run concurrently to the rest of the camera pipeline, but
2683 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002684 * </ul>
2685 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002686 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2687 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002688 * These are used to determine the maximum frame rate / minimum frame
2689 * duration that is possible for a given stream configuration.</p>
2690 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002691 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002692 * device:</p>
2693 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002694 * <li>Let the set of currently configured input/output streams
2695 * be called <code>S</code>.</li>
2696 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002697 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2698 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002699 * its respective size/format). Let this set of frame durations be called
2700 * <code>F</code>.</li>
2701 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2702 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2703 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002704 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002705 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002706 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2707 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002708 * <code>F</code> determines the steady state frame rate that the application will
2709 * get if it uses <code>R</code> as a repeating request. Let this special kind
2710 * of request be called <code>Rsimple</code>.</p>
2711 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2712 * by a single capture of a new request <code>Rstall</code> (which has at least
2713 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2714 * same minimum frame duration this will not cause a frame rate loss
2715 * if all buffers from the previous <code>Rstall</code> have already been
2716 * delivered.</p>
2717 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002718 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002719 * <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
2720 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2721 * <p><b>Units</b>: Nanoseconds</p>
2722 * <p><b>Range of valid values:</b><br>
2723 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
2724 * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
2725 * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002726 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2727 * <p><b>Full capability</b> -
2728 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2729 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002730 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002731 * @see CaptureRequest#CONTROL_AE_MODE
2732 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002733 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin9c595172014-05-12 13:56:20 -07002734 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002735 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002736 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002737 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002738 public static final Key<Long> SENSOR_FRAME_DURATION =
2739 new Key<Long>("android.sensor.frameDuration", long.class);
2740
2741 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002742 * <p>The amount of gain applied to sensor data
2743 * before processing.</p>
2744 * <p>The sensitivity is the standard ISO sensitivity value,
2745 * as defined in ISO 12232:2006.</p>
2746 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2747 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2748 * is guaranteed to use only analog amplification for applying the gain.</p>
2749 * <p>If the camera device cannot apply the exact sensitivity
2750 * requested, it will reduce the gain to the nearest supported
2751 * value. The final sensitivity used will be available in the
2752 * output capture result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002753 * <p><b>Units</b>: ISO arithmetic units</p>
2754 * <p><b>Range of valid values:</b><br>
2755 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002756 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2757 * <p><b>Full capability</b> -
2758 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2759 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002760 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002761 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002762 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2763 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002764 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002765 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002766 public static final Key<Integer> SENSOR_SENSITIVITY =
2767 new Key<Integer>("android.sensor.sensitivity", int.class);
2768
2769 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002770 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07002771 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002772 * <p>The timestamps are also included in all image
2773 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07002774 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002775 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07002776 * the timestamps measure time since an unspecified starting point,
2777 * and are monotonically increasing. They can be compared with the
2778 * timestamps for other captures from the same camera device, but are
2779 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002780 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME,
Zhijun He45fa43a12014-06-13 18:29:37 -07002781 * the timestamps measure time in the same timebase as
2782 * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2783 * compared to other timestamps from other subsystems that are using
2784 * that base.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002785 * <p><b>Units</b>: Nanoseconds</p>
2786 * <p><b>Range of valid values:</b><br>
2787 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002788 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002789 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002790 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002791 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002792 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002793 public static final Key<Long> SENSOR_TIMESTAMP =
2794 new Key<Long>("android.sensor.timestamp", long.class);
2795
2796 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002797 * <p>The estimated camera neutral color in the native sensor colorspace at
2798 * the time of capture.</p>
2799 * <p>This value gives the neutral color point encoded as an RGB value in the
2800 * native sensor color space. The neutral color point indicates the
2801 * currently estimated white point of the scene illumination. It can be
2802 * used to interpolate between the provided color transforms when
2803 * processing raw sensor data.</p>
2804 * <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 -08002805 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2806 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002807 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08002808 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2809 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2810
2811 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002812 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002813 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002814 * corresponding to the sensor amplification (S) and sensor readout
2815 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002816 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002817 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
2818 * represented as an array of Pair&lt;Double, Double&gt;, where
2819 * the first member of the Pair at index n is the S coefficient and the
2820 * second member is the O coefficient for the nth color channel in the CFA.</p>
2821 * <p>These coefficients are used in a two parameter noise model to describe
2822 * the amount of noise present in the image for each CFA channel. The
2823 * noise model used here is:</p>
2824 * <p>N(x) = sqrt(Sx + O)</p>
2825 * <p>Where x represents the recorded signal of a CFA channel normalized to
2826 * the range [0, 1], and S and O are the noise model coeffiecients for
2827 * that channel.</p>
2828 * <p>A more detailed description of the noise model can be found in the
2829 * Adobe DNG specification for the NoiseProfile tag.</p>
2830 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2831 *
2832 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2833 */
2834 @PublicKey
2835 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
2836 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
2837
2838 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002839 * <p>The worst-case divergence between Bayer green channels.</p>
2840 * <p>This value is an estimate of the worst case split between the
2841 * Bayer green channels in the red and blue rows in the sensor color
2842 * filter array.</p>
2843 * <p>The green split is calculated as follows:</p>
2844 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002845 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2846 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2847 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2848 * chosen is implementation defined, and should be chosen to provide a
2849 * green split estimate that is both representative of the entire image
2850 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002851 * <li>The arithmetic mean of the green channels from the red
2852 * rows (mean_Gr) within W is computed.</li>
2853 * <li>The arithmetic mean of the green channels from the blue
2854 * rows (mean_Gb) within W is computed.</li>
2855 * <li>The maximum ratio R of the two means is computed as follows:
2856 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2857 * </ol>
2858 * <p>The ratio R is the green split divergence reported for this property,
2859 * which represents how much the green channels differ in the mosaic
2860 * pattern. This value is typically used to determine the treatment of
2861 * the green mosaic channels when demosaicing.</p>
2862 * <p>The green split value can be roughly interpreted as follows:</p>
2863 * <ul>
2864 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2865 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2866 * correction to avoid demosaic errors (3-20% divergence).</li>
2867 * <li>R &gt; 1.20 will require strong software correction to produce
2868 * a usuable image (&gt;20% divergence).</li>
2869 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002870 * <p><b>Range of valid values:</b><br></p>
2871 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002872 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2873 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002874 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08002875 public static final Key<Float> SENSOR_GREEN_SPLIT =
2876 new Key<Float>("android.sensor.greenSplit", float.class);
2877
2878 /**
Zhijun He379af012014-05-06 11:54:54 -07002879 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2880 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2881 * <p>Each color channel is treated as an unsigned 32-bit integer.
2882 * The camera device then uses the most significant X bits
2883 * that correspond to how many bits are in its Bayer raw sensor
2884 * output.</p>
2885 * <p>For example, a sensor with RAW10 Bayer output would use the
2886 * 10 most significant bits from each color channel.</p>
2887 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2888 *
2889 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2890 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002891 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002892 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2893 new Key<int[]>("android.sensor.testPatternData", int[].class);
2894
2895 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002896 * <p>When enabled, the sensor sends a test pattern instead of
2897 * doing a real exposure from the camera.</p>
2898 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002899 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002900 * work as normal.</p>
2901 * <p>For example, if manual flash is enabled, flash firing should still
2902 * occur (and that the test pattern remain unmodified, since the flash
2903 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002904 * <p>Defaults to OFF.</p>
2905 * <p><b>Possible values:</b>
2906 * <ul>
2907 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
2908 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
2909 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
2910 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
2911 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
2912 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
2913 * </ul></p>
2914 * <p><b>Available values for this device:</b><br>
2915 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002916 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002917 *
2918 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08002919 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2920 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2921 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2922 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2923 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2924 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2925 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002926 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002927 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2928 new Key<Integer>("android.sensor.testPatternMode", int.class);
2929
2930 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07002931 * <p>Duration between the start of first row exposure
2932 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002933 * <p>This is the exposure time skew between the first and last
2934 * row exposure start times. The first row and the last row are
2935 * the first and last rows inside of the
2936 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07002937 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
2938 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002939 * <p><b>Units</b>: Nanoseconds</p>
2940 * <p><b>Range of valid values:</b><br>
2941 * &gt;= 0 and &lt;
2942 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002943 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2944 * <p><b>Limited capability</b> -
2945 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2946 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07002947 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002948 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07002949 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2950 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002951 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07002952 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
2953 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
2954
2955 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002956 * <p>Quality of lens shading correction applied
2957 * to the image data.</p>
2958 * <p>When set to OFF mode, no lens shading correction will be applied by the
2959 * camera device, and an identity lens shading map data will be provided
2960 * 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 -07002961 * shading map with size of <code>[ 4, 3 ]</code>,
2962 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
2963 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002964 * <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 -07002965 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2966 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2967 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2968 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2969 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08002970 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002971 * <p>When set to other modes, lens shading correction will be applied by the camera
2972 * device. Applications can request lens shading map data by setting
2973 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
2974 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
2975 * data will be the one applied by the camera device for this capture request.</p>
2976 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
2977 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
2978 * 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>
2979 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
2980 * to be converged before using the returned shading map data.</p>
2981 * <p><b>Possible values:</b>
2982 * <ul>
2983 * <li>{@link #SHADING_MODE_OFF OFF}</li>
2984 * <li>{@link #SHADING_MODE_FAST FAST}</li>
2985 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2986 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002987 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2988 * <p><b>Full capability</b> -
2989 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2990 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002991 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002992 * @see CaptureRequest#CONTROL_AE_MODE
2993 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002994 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002995 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08002996 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2997 * @see #SHADING_MODE_OFF
2998 * @see #SHADING_MODE_FAST
2999 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08003000 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003001 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08003002 public static final Key<Integer> SHADING_MODE =
3003 new Key<Integer>("android.shading.mode", int.class);
3004
3005 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003006 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003007 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003008 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003009 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003010 * fields.</p>
3011 * <p><b>Possible values:</b>
3012 * <ul>
3013 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3014 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3015 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3016 * </ul></p>
3017 * <p><b>Available values for this device:</b><br>
3018 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3019 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003020 *
3021 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003022 * @see #STATISTICS_FACE_DETECT_MODE_OFF
3023 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3024 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3025 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003026 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003027 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3028 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3029
3030 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003031 * <p>List of unique IDs for detected faces.</p>
3032 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3033 * to the camera device. A face that leaves the field of view and later returns may be
3034 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003035 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3036 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003037 *
3038 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003039 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003040 */
3041 public static final Key<int[]> STATISTICS_FACE_IDS =
3042 new Key<int[]>("android.statistics.faceIds", int[].class);
3043
3044 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003045 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003046 * faces.</p>
3047 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3048 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003049 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3050 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003051 *
3052 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3053 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003054 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003055 */
3056 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3057 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3058
3059 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003060 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003061 * faces.</p>
3062 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3063 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003064 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3065 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003066 *
3067 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3068 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003069 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003070 */
3071 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3072 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3073
3074 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003075 * <p>List of the face confidence scores for
3076 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003077 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003078 * <p><b>Range of valid values:</b><br>
3079 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003080 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003081 *
3082 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003083 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003084 */
3085 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3086 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3087
3088 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003089 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003090 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003091 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003092 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003093 *
3094 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3095 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003096 @PublicKey
3097 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003098 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3099 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3100
3101 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003102 * <p>The shading map is a low-resolution floating-point map
3103 * that lists the coefficients used to correct for vignetting, for each
3104 * Bayer color channel.</p>
3105 * <p>The least shaded section of the image should have a gain factor
3106 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003107 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08003108 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003109 * <p>The shading map is for the entire active pixel array, and is not
3110 * affected by the crop region specified in the request. Each shading map
3111 * entry is the value of the shading compensation map over a specific
3112 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3113 * map, and an active pixel array size (W x H), shading map entry
3114 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3115 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3116 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3117 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3118 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003119 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003120 * <p>The shading map should have on the order of 30-40 rows and columns,
3121 * and must be smaller than 64x64.</p>
3122 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003123 * <pre><code>width,height = [ 4, 3 ]
3124 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003125 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003126 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3127 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3128 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3129 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3130 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003131 * </code></pre>
3132 * <p>The low-resolution scaling map images for each channel are
3133 * (displayed using nearest-neighbor interpolation):</p>
3134 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3135 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3136 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3137 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3138 * <p>As a visualization only, inverting the full-color map to recover an
3139 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3140 * <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 -07003141 * <p><b>Range of valid values:</b><br>
3142 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003143 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3144 * <p><b>Full capability</b> -
3145 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3146 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003147 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003148 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003149 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07003150 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003151 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003152 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3153 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3154
3155 /**
3156 * <p>The shading map is a low-resolution floating-point map
3157 * that lists the coefficients used to correct for vignetting, for each
3158 * Bayer color channel.</p>
3159 * <p>The least shaded section of the image should have a gain factor
3160 * of 1; all other sections should have gains above 1.</p>
3161 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
3162 * must take into account the colorCorrection settings.</p>
3163 * <p>The shading map is for the entire active pixel array, and is not
3164 * affected by the crop region specified in the request. Each shading map
3165 * entry is the value of the shading compensation map over a specific
3166 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3167 * map, and an active pixel array size (W x H), shading map entry
3168 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3169 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3170 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3171 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3172 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3173 * The shading map is stored in a fully interleaved format, and its size
3174 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
3175 * <p>The shading map should have on the order of 30-40 rows and columns,
3176 * and must be smaller than 64x64.</p>
3177 * <p>As an example, given a very small map defined as:</p>
3178 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3179 * android.statistics.lensShadingMap =
3180 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003181 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3182 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3183 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3184 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3185 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003186 * </code></pre>
3187 * <p>The low-resolution scaling map images for each channel are
3188 * (displayed using nearest-neighbor interpolation):</p>
3189 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3190 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3191 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3192 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3193 * <p>As a visualization only, inverting the full-color map to recover an
3194 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3195 * <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 -07003196 * <p><b>Range of valid values:</b><br>
3197 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003198 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3199 * <p><b>Full capability</b> -
3200 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3201 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003202 *
3203 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003204 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07003205 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003206 */
3207 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3208 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3209
3210 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003211 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003212 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003213 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003214 * since statistics processing on data from a new frame
3215 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003216 * applied to that frame.</p>
3217 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003218 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003219 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003220 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003221 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003222 *
3223 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003224 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003225 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003226 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003227 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003228 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3229 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3230
3231 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003232 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08003233 * calculated by the camera device's statistics units for the current
3234 * output frame.</p>
3235 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003236 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08003237 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003238 * are the best fit for the current output frame. This may
3239 * be different than the transform used for this frame, since
3240 * statistics processing on data from a new frame typically
3241 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003242 * that frame.</p>
3243 * <p>These estimates must be provided for all frames, even if
3244 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003245 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003246 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003247 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003248 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003249 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003250 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003251 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003252 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3253 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3254
3255 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08003256 * <p>The camera device estimated scene illumination lighting
3257 * frequency.</p>
3258 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3259 * that depends on the local utility power standards. This flicker must be
3260 * accounted for by auto-exposure routines to avoid artifacts in captured images.
3261 * The camera device uses this entry to tell the application what the scene
3262 * illuminant frequency is.</p>
3263 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003264 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3265 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3266 * antibanding, and the application can ensure it selects
3267 * exposure times that do not cause banding issues by looking
3268 * into this metadata field. See
3269 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3270 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003271 * <p><b>Possible values:</b>
3272 * <ul>
3273 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3274 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3275 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3276 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003277 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3278 * <p><b>Full capability</b> -
3279 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3280 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08003281 *
3282 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3283 * @see CaptureRequest#CONTROL_AE_MODE
3284 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003285 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003286 * @see #STATISTICS_SCENE_FLICKER_NONE
3287 * @see #STATISTICS_SCENE_FLICKER_50HZ
3288 * @see #STATISTICS_SCENE_FLICKER_60HZ
3289 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003290 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003291 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
3292 new Key<Integer>("android.statistics.sceneFlicker", int.class);
3293
3294 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003295 * <p>Operating mode for hot pixel map generation.</p>
3296 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
3297 * If set to <code>false</code>, no hot pixel map will be returned.</p>
3298 * <p><b>Range of valid values:</b><br>
3299 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003300 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003301 *
3302 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
3303 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
3304 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003305 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003306 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
3307 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
3308
3309 /**
3310 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
3311 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
3312 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
3313 * bottom-right of the pixel array, respectively. The width and
3314 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
3315 * This may include hot pixels that lie outside of the active array
3316 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003317 * <p><b>Range of valid values:</b><br></p>
3318 * <p>n &lt;= number of pixels on the sensor.
3319 * The <code>(x, y)</code> coordinates must be bounded by
3320 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003321 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003322 *
3323 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3324 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3325 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003326 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003327 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
3328 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003329
3330 /**
Zhijun He379af012014-05-06 11:54:54 -07003331 * <p>Whether the camera device will output the lens
3332 * shading map in output result metadata.</p>
3333 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003334 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07003335 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003336 * <p>ON is always supported on devices with the RAW capability.</p>
3337 * <p><b>Possible values:</b>
3338 * <ul>
3339 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3340 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3341 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003342 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3343 * <p><b>Full capability</b> -
3344 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3345 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3346 *
3347 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -07003348 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3349 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3350 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003351 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003352 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3353 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3354
3355 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003356 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08003357 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3358 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003359 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003360 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3361 * <p><b>Full capability</b> -
3362 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3363 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003364 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003365 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003366 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003367 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003368 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003369 public static final Key<float[]> TONEMAP_CURVE_BLUE =
3370 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003371
3372 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003373 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08003374 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3375 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003376 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003377 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3378 * <p><b>Full capability</b> -
3379 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3380 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003381 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003382 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003383 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003384 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003385 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003386 public static final Key<float[]> TONEMAP_CURVE_GREEN =
3387 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003388
3389 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003390 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08003391 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3392 * CONTRAST_CURVE.</p>
3393 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003394 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003395 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08003396 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003397 * <p>These are sorted in order of increasing <code>Pin</code>; it is
3398 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08003399 * define a complete mapping. For input values between control points,
3400 * the camera device must linearly interpolate between the control
3401 * points.</p>
3402 * <p>Each curve can have an independent number of points, and the number
3403 * of points can be less than max (that is, the request doesn't have to
3404 * always provide a curve with number of points equivalent to
3405 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3406 * <p>A few examples, and their corresponding graphical mappings; these
3407 * only specify the red channel and the precision is limited to 4
3408 * digits, for conciseness.</p>
3409 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003410 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003411 * </code></pre>
3412 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3413 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003414 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003415 * </code></pre>
3416 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3417 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003418 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003419 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
3420 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
3421 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
3422 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003423 * </code></pre>
3424 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3425 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003426 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003427 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
3428 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
3429 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
3430 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003431 * </code></pre>
3432 * <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 -07003433 * <p><b>Range of valid values:</b><br>
3434 * 0-1 on both input and output coordinates, normalized
3435 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003436 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3437 * <p><b>Full capability</b> -
3438 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3439 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003440 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003441 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08003442 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003443 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003444 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003445 */
3446 public static final Key<float[]> TONEMAP_CURVE_RED =
3447 new Key<float[]>("android.tonemap.curveRed", float[].class);
3448
3449 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003450 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
3451 * is CONTRAST_CURVE.</p>
3452 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
3453 * channels respectively. The following example uses the red channel as an
3454 * example. The same logic applies to green and blue channel.
3455 * Each channel's curve is defined by an array of control points:</p>
3456 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003457 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003458 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3459 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
3460 * guaranteed that input values 0.0 and 1.0 are included in the list to
3461 * define a complete mapping. For input values between control points,
3462 * the camera device must linearly interpolate between the control
3463 * points.</p>
3464 * <p>Each curve can have an independent number of points, and the number
3465 * of points can be less than max (that is, the request doesn't have to
3466 * always provide a curve with number of points equivalent to
3467 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3468 * <p>A few examples, and their corresponding graphical mappings; these
3469 * only specify the red channel and the precision is limited to 4
3470 * digits, for conciseness.</p>
3471 * <p>Linear mapping:</p>
3472 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
3473 * </code></pre>
3474 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3475 * <p>Invert mapping:</p>
3476 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
3477 * </code></pre>
3478 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3479 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
3480 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003481 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
3482 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
3483 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
3484 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003485 * </code></pre>
3486 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3487 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
3488 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003489 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
3490 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
3491 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
3492 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003493 * </code></pre>
3494 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003495 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3496 * <p><b>Full capability</b> -
3497 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3498 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003499 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003500 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003501 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
3502 * @see CaptureRequest#TONEMAP_MODE
3503 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003504 @PublicKey
3505 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003506 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
3507 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
3508
3509 /**
Igor Murashkine0060932014-01-17 17:24:11 -08003510 * <p>High-level global contrast/gamma/tonemapping control.</p>
3511 * <p>When switching to an application-defined contrast curve by setting
3512 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
3513 * per-channel with a set of <code>(in, out)</code> points that specify the
3514 * mapping from input high-bit-depth pixel value to the output
3515 * low-bit-depth value. Since the actual pixel ranges of both input
3516 * and output may change depending on the camera pipeline, the values
3517 * are specified by normalized floating-point numbers.</p>
3518 * <p>More-complex color mapping operations such as 3D color look-up
3519 * tables, selective chroma enhancement, or other non-linear color
3520 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3521 * CONTRAST_CURVE.</p>
3522 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003523 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08003524 * These values are always available, and as close as possible to the
3525 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07003526 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08003527 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
3528 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003529 * <p><b>Possible values:</b>
3530 * <ul>
3531 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
3532 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
3533 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3534 * </ul></p>
3535 * <p><b>Available values for this device:</b><br>
3536 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003537 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3538 * <p><b>Full capability</b> -
3539 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3540 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003541 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003542 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003543 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003544 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08003545 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003546 * @see #TONEMAP_MODE_CONTRAST_CURVE
3547 * @see #TONEMAP_MODE_FAST
3548 * @see #TONEMAP_MODE_HIGH_QUALITY
3549 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003550 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003551 public static final Key<Integer> TONEMAP_MODE =
3552 new Key<Integer>("android.tonemap.mode", int.class);
3553
3554 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003555 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003556 * that the camera is powered on and may be streaming images back to the
3557 * Application Processor. In certain rare circumstances, the OS may
3558 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003559 * any untrusted applications.</p>
3560 * <p>In particular, the LED <em>must</em> always be on when the data could be
3561 * transmitted off the device. The LED <em>should</em> always be on whenever
3562 * data is stored locally on the device.</p>
3563 * <p>The LED <em>may</em> be off if a trusted application is using the data that
3564 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003565 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003566 * @hide
3567 */
3568 public static final Key<Boolean> LED_TRANSMIT =
3569 new Key<Boolean>("android.led.transmit", boolean.class);
3570
3571 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003572 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003573 * to its current values, or is free to vary.</p>
3574 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003575 * 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 -08003576 * a change in other capture settings forced the camera device to
3577 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003578 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3579 * <p><b>Full capability</b> -
3580 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3581 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003582 *
3583 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003584 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003585 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003586 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003587 public static final Key<Boolean> BLACK_LEVEL_LOCK =
3588 new Key<Boolean>("android.blackLevel.lock", boolean.class);
3589
Igor Murashkin3865a842014-01-17 18:18:39 -08003590 /**
3591 * <p>The frame number corresponding to the last request
3592 * with which the output result (metadata + buffers) has been fully
3593 * synchronized.</p>
3594 * <p>When a request is submitted to the camera device, there is usually a
3595 * delay of several frames before the controls get applied. A camera
3596 * device may either choose to account for this delay by implementing a
3597 * pipeline and carefully submit well-timed atomic control updates, or
3598 * it may start streaming control changes that span over several frame
3599 * boundaries.</p>
3600 * <p>In the latter case, whenever a request's settings change relative to
3601 * the previous submitted request, the full set of changes may take
3602 * multiple frame durations to fully take effect. Some settings may
3603 * take effect sooner (in less frame durations) than others.</p>
3604 * <p>While a set of control changes are being propagated, this value
3605 * will be CONVERGING.</p>
3606 * <p>Once it is fully known that a set of control changes have been
3607 * finished propagating, and the resulting updated control settings
3608 * have been read back by the camera device, this value will be set
3609 * to a non-negative frame number (corresponding to the request to
3610 * which the results have synchronized to).</p>
3611 * <p>Older camera device implementations may not have a way to detect
3612 * when all camera controls have been applied, and will always set this
3613 * value to UNKNOWN.</p>
3614 * <p>FULL capability devices will always have this value set to the
3615 * frame number of the request corresponding to this result.</p>
3616 * <p><em>Further details</em>:</p>
3617 * <ul>
3618 * <li>Whenever a request differs from the last request, any future
3619 * results not yet returned may have this value set to CONVERGING (this
3620 * could include any in-progress captures not yet returned by the camera
3621 * device, for more details see pipeline considerations below).</li>
3622 * <li>Submitting a series of multiple requests that differ from the
3623 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
3624 * moves the new synchronization frame to the last non-repeating
3625 * request (using the smallest frame number from the contiguous list of
3626 * repeating requests).</li>
3627 * <li>Submitting the same request repeatedly will not change this value
3628 * to CONVERGING, if it was already a non-negative value.</li>
3629 * <li>When this value changes to non-negative, that means that all of the
3630 * metadata controls from the request have been applied, all of the
3631 * metadata controls from the camera device have been read to the
3632 * updated values (into the result), and all of the graphics buffers
3633 * corresponding to this result are also synchronized to the request.</li>
3634 * </ul>
3635 * <p><em>Pipeline considerations</em>:</p>
3636 * <p>Submitting a request with updated controls relative to the previously
3637 * submitted requests may also invalidate the synchronization state
3638 * of all the results corresponding to currently in-flight requests.</p>
3639 * <p>In other words, results for this current request and up to
3640 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
3641 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003642 * <p><b>Possible values:</b>
3643 * <ul>
3644 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
3645 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
3646 * </ul></p>
3647 * <p><b>Available values for this device:</b><br>
3648 * Either a non-negative value corresponding to a
3649 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003650 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003651 *
3652 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3653 * @see #SYNC_FRAME_NUMBER_CONVERGING
3654 * @see #SYNC_FRAME_NUMBER_UNKNOWN
3655 * @hide
3656 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07003657 public static final Key<Long> SYNC_FRAME_NUMBER =
3658 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08003659
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003660 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3661 * End generated code
3662 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07003663
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003664
3665
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08003666}