blob: 6f6651d54c423dba78e6d33a3f83656971f7dbc4 [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>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800406 * <p>The valid range of each matrix element varies on different devices, but
407 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700408 * <p><b>Units</b>: Unitless scale factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700409 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
410 * <p><b>Full capability</b> -
411 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
412 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800413 *
414 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700415 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700416 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700417 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700418 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
419 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700420
421 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800422 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800423 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700424 * <p>These per-channel gains are either set by the camera device
425 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
426 * TRANSFORM_MATRIX, or directly by the application in the
427 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
428 * TRANSFORM_MATRIX.</p>
429 * <p>The gains in the result metadata are the gains actually
430 * applied by the camera device to the current frame.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800431 * <p>The valid range of gains varies on different devices, but gains
432 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
433 * device allows gains below 1.0, this is usually not recommended because
434 * this can create color artifacts.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700435 * <p><b>Units</b>: Unitless gain factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700436 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
437 * <p><b>Full capability</b> -
438 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
439 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800440 *
441 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700442 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700443 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700444 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700445 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
446 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700447
448 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700449 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700450 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
451 * can not focus on the same point after exiting from the lens. This metadata defines
452 * the high level control of chromatic aberration correction algorithm, which aims to
453 * minimize the chromatic artifacts that may occur along the object boundaries in an
454 * image.</p>
455 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
456 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
457 * use the highest-quality aberration correction algorithms, even if it slows down
458 * capture rate. FAST means the camera device will not slow down capture rate when
459 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700460 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700461 * <p><b>Possible values:</b>
462 * <ul>
463 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
464 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
465 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
466 * </ul></p>
467 * <p><b>Available values for this device:</b><br>
468 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700469 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700470 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700471 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
472 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
473 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
474 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700475 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700476 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700477 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
478 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700479
480 /**
Zhijun He379af012014-05-06 11:54:54 -0700481 * <p>The desired setting for the camera device's auto-exposure
482 * algorithm's antibanding compensation.</p>
483 * <p>Some kinds of lighting fixtures, such as some fluorescent
484 * lights, flicker at the rate of the power supply frequency
485 * (60Hz or 50Hz, depending on country). While this is
486 * typically not noticeable to a person, it can be visible to
487 * a camera device. If a camera sets its exposure time to the
488 * wrong value, the flicker may become visible in the
489 * viewfinder as flicker or in a final captured image, as a
490 * set of variable-brightness bands across the image.</p>
491 * <p>Therefore, the auto-exposure routines of camera devices
492 * include antibanding routines that ensure that the chosen
493 * exposure value will not cause such banding. The choice of
494 * exposure time depends on the rate of flicker, which the
495 * camera device can detect automatically, or the expected
496 * rate can be selected by the application using this
497 * control.</p>
498 * <p>A given camera device may not support all of the possible
499 * options for the antibanding mode. The
500 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
501 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800502 * <p>AUTO mode is the default if it is available on given
503 * camera device. When AUTO mode is not available, the
504 * default will be either 50HZ or 60HZ, and both 50HZ
505 * and 60HZ will be available.</p>
Zhijun He379af012014-05-06 11:54:54 -0700506 * <p>If manual exposure control is enabled (by setting
507 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
508 * then this setting has no effect, and the application must
509 * ensure it selects exposure times that do not cause banding
510 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
511 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700512 * <p><b>Possible values:</b>
513 * <ul>
514 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
515 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
516 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
517 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
518 * </ul></p>
519 * <p><b>Available values for this device:</b><br></p>
520 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700521 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700522 *
523 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
524 * @see CaptureRequest#CONTROL_AE_MODE
525 * @see CaptureRequest#CONTROL_MODE
526 * @see CaptureResult#STATISTICS_SCENE_FLICKER
527 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
528 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
529 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
530 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
531 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700532 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700533 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
534 new Key<Integer>("android.control.aeAntibandingMode", int.class);
535
536 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700537 * <p>Adjustment to auto-exposure (AE) target image
538 * brightness.</p>
539 * <p>The adjustment is measured as a count of steps, with the
540 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
541 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
542 * <p>For example, if the exposure value (EV) step is 0.333, '6'
543 * will mean an exposure compensation of +2 EV; -3 will mean an
544 * exposure compensation of -1 EV. One EV represents a doubling
545 * of image brightness. Note that this control will only be
546 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
547 * 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 -0700548 * <p>In the event of exposure compensation value being changed, camera device
549 * may take several frames to reach the newly requested exposure target.
550 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
551 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
552 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
553 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700554 * <p><b>Units</b>: Compensation steps</p>
555 * <p><b>Range of valid values:</b><br>
556 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700557 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700558 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700559 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
560 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700561 * @see CaptureRequest#CONTROL_AE_LOCK
562 * @see CaptureRequest#CONTROL_AE_MODE
563 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700564 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700565 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700566 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
567 new Key<Integer>("android.control.aeExposureCompensation", int.class);
568
569 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700570 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700571 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700572 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
573 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
574 * <p>Note that even when AE is locked, the flash may be fired if
575 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
576 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700577 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
578 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700579 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
580 * when AE is already locked, the camera device will not change the exposure time
581 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
582 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
583 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
Zhijun Hefa95b042015-02-09 10:40:49 -0800584 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
585 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
586 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
587 * the AE if AE is locked by the camera device internally during precapture metering
588 * sequence In other words, submitting requests with AE unlock has no effect for an
589 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
590 * will never succeed in a sequence of preview requests where AE lock is always set
591 * to <code>false</code>.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700592 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
593 * get locked do not necessarily correspond to the settings that were present in the
594 * latest capture result received from the camera device, since additional captures
595 * and AE updates may have occurred even before the result was sent out. If an
596 * application is switching between automatic and manual control and wishes to eliminate
597 * any flicker during the switch, the following procedure is recommended:</p>
598 * <ol>
599 * <li>Starting in auto-AE mode:</li>
600 * <li>Lock AE</li>
601 * <li>Wait for the first result to be output that has the AE locked</li>
602 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
603 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
604 * </ol>
Zhijun He379af012014-05-06 11:54:54 -0700605 * <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 -0700606 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700607 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700608 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700609 * @see CaptureRequest#CONTROL_AE_MODE
610 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
611 * @see CaptureResult#CONTROL_AE_STATE
612 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
613 * @see CaptureRequest#SENSOR_SENSITIVITY
614 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700615 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700616 public static final Key<Boolean> CONTROL_AE_LOCK =
617 new Key<Boolean>("android.control.aeLock", boolean.class);
618
619 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800620 * <p>The desired mode for the camera device's
621 * auto-exposure routine.</p>
622 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
623 * AUTO.</p>
624 * <p>When set to any of the ON modes, the camera device's
625 * auto-exposure routine is enabled, overriding the
626 * application's selected exposure time, sensor sensitivity,
627 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
628 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
629 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
630 * is selected, the camera device's flash unit controls are
631 * also overridden.</p>
632 * <p>The FLASH modes are only available if the camera device
633 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
634 * <p>If flash TORCH mode is desired, this field must be set to
635 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
636 * <p>When set to any of the ON modes, the values chosen by the
637 * camera device auto-exposure routine for the overridden
638 * fields for a given capture will be available in its
639 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700640 * <p><b>Possible values:</b>
641 * <ul>
642 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
643 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
644 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
645 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
646 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
647 * </ul></p>
648 * <p><b>Available values for this device:</b><br>
649 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700650 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800651 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700652 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -0800653 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800654 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
655 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800656 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
657 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800658 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800659 * @see #CONTROL_AE_MODE_OFF
660 * @see #CONTROL_AE_MODE_ON
661 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
662 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
663 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
664 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700665 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800666 public static final Key<Integer> CONTROL_AE_MODE =
667 new Key<Integer>("android.control.aeMode", int.class);
668
669 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700670 * <p>List of metering areas to use for auto-exposure adjustment.</p>
671 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700672 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700673 * <p>The maximum number of regions supported by the device is determined by the value
674 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800675 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700676 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800677 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
678 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700679 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700680 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700681 * for every pixel in the area. This means that a large metering area
682 * with the same weight as a smaller area will have more effect in
683 * the metering result. Metering areas can partially overlap and the
684 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700685 * <p>The weights are relative to weights of other exposure metering regions, so if only one
686 * region is used, all non-zero weights will have the same effect. A region with 0
687 * weight is ignored.</p>
688 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
689 * camera device.</p>
690 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
691 * capture result metadata, the camera device will ignore the sections outside the crop
692 * region and output only the intersection rectangle as the metering region in the result
693 * metadata. If the region is entirely outside the crop region, it will be ignored and
694 * not reported in the result metadata.</p>
695 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
696 * <p><b>Range of valid values:</b><br>
697 * Coordinates must be between <code>[(0,0), (width, height))</code> of
698 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700699 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800700 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700701 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800702 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800703 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700704 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700705 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700706 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
707 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700708
709 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700710 * <p>Range over which the auto-exposure routine can
711 * adjust the capture frame rate to maintain good
712 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700713 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700714 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
715 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
716 * <p><b>Units</b>: Frames per second (FPS)</p>
717 * <p><b>Range of valid values:</b><br>
718 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
719 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700720 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700721 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Zhijun He379af012014-05-06 11:54:54 -0700722 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700723 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He379af012014-05-06 11:54:54 -0700724 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700725 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700726 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
727 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700728
729 /**
730 * <p>Whether the camera device will trigger a precapture
731 * metering sequence when it processes this request.</p>
732 * <p>This entry is normally set to IDLE, or is not
733 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -0800734 * set to START, the camera device will trigger the auto-exposure (AE)
Zhijun He379af012014-05-06 11:54:54 -0700735 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -0800736 * <p>When set to CANCEL, the camera device will cancel any active
737 * precapture metering trigger, and return to its initial AE state.
738 * If a precapture metering sequence is already completed, and the camera
739 * device has implicitly locked the AE for subsequent still capture, the
740 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800741 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700742 * high-quality still capture for final metering decisions to
743 * be made, and for firing pre-capture flash pulses to estimate
744 * scene brightness and required final capture flash power, when
745 * the flash is enabled.</p>
746 * <p>Normally, this entry should be set to START for only a
747 * single request, and the application should wait until the
748 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800749 * <p>When a precapture metering sequence is finished, the camera device
750 * may lock the auto-exposure routine internally to be able to accurately expose the
751 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
752 * For this case, the AE may not resume normal scan if no subsequent still capture is
753 * submitted. To ensure that the AE routine restarts normal scan, the application should
754 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
755 * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a
Zhijun Hefa95b042015-02-09 10:40:49 -0800756 * still capture request after the precapture sequence completes. Alternatively, for
757 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
758 * internally locked AE if the application doesn't submit a still capture request after
759 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
760 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700761 * <p>The exact effect of auto-exposure (AE) precapture trigger
762 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700763 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
764 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700765 * <p>On LEGACY-level devices, the precapture trigger is not supported;
766 * capturing a high-resolution JPEG image will automatically trigger a
767 * precapture sequence before the high-resolution capture, including
768 * potentially firing a pre-capture flash.</p>
769 * <p><b>Possible values:</b>
770 * <ul>
771 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
772 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -0800773 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700774 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700775 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
776 * <p><b>Limited capability</b> -
777 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
778 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700779 *
Zhijun Hedd72be52015-02-06 13:49:51 -0800780 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He379af012014-05-06 11:54:54 -0700781 * @see CaptureResult#CONTROL_AE_STATE
Zhijun Hedd72be52015-02-06 13:49:51 -0800782 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700783 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700784 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
785 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -0800786 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Zhijun He379af012014-05-06 11:54:54 -0700787 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700788 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700789 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
790 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
791
792 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700793 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800794 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
795 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
796 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
797 * the algorithm states to INACTIVE.</p>
798 * <p>The camera device can do several state transitions between two results, if it is
799 * allowed by the state transition table. For example: INACTIVE may never actually be
800 * seen in a result.</p>
801 * <p>The state in the result is the state for this image (in sync with this image): if
802 * AE state becomes CONVERGED, then the image data associated with this result should
803 * be good to use.</p>
804 * <p>Below are state transition tables for different AE modes.</p>
805 * <table>
806 * <thead>
807 * <tr>
808 * <th align="center">State</th>
809 * <th align="center">Transition Cause</th>
810 * <th align="center">New State</th>
811 * <th align="center">Notes</th>
812 * </tr>
813 * </thead>
814 * <tbody>
815 * <tr>
816 * <td align="center">INACTIVE</td>
817 * <td align="center"></td>
818 * <td align="center">INACTIVE</td>
819 * <td align="center">Camera device auto exposure algorithm is disabled</td>
820 * </tr>
821 * </tbody>
822 * </table>
823 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
824 * <table>
825 * <thead>
826 * <tr>
827 * <th align="center">State</th>
828 * <th align="center">Transition Cause</th>
829 * <th align="center">New State</th>
830 * <th align="center">Notes</th>
831 * </tr>
832 * </thead>
833 * <tbody>
834 * <tr>
835 * <td align="center">INACTIVE</td>
836 * <td align="center">Camera device initiates AE scan</td>
837 * <td align="center">SEARCHING</td>
838 * <td align="center">Values changing</td>
839 * </tr>
840 * <tr>
841 * <td align="center">INACTIVE</td>
842 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
843 * <td align="center">LOCKED</td>
844 * <td align="center">Values locked</td>
845 * </tr>
846 * <tr>
847 * <td align="center">SEARCHING</td>
848 * <td align="center">Camera device finishes AE scan</td>
849 * <td align="center">CONVERGED</td>
850 * <td align="center">Good values, not changing</td>
851 * </tr>
852 * <tr>
853 * <td align="center">SEARCHING</td>
854 * <td align="center">Camera device finishes AE scan</td>
855 * <td align="center">FLASH_REQUIRED</td>
856 * <td align="center">Converged but too dark w/o flash</td>
857 * </tr>
858 * <tr>
859 * <td align="center">SEARCHING</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">CONVERGED</td>
866 * <td align="center">Camera device initiates AE scan</td>
867 * <td align="center">SEARCHING</td>
868 * <td align="center">Values changing</td>
869 * </tr>
870 * <tr>
871 * <td align="center">CONVERGED</td>
872 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
873 * <td align="center">LOCKED</td>
874 * <td align="center">Values locked</td>
875 * </tr>
876 * <tr>
877 * <td align="center">FLASH_REQUIRED</td>
878 * <td align="center">Camera device initiates AE scan</td>
879 * <td align="center">SEARCHING</td>
880 * <td align="center">Values changing</td>
881 * </tr>
882 * <tr>
883 * <td align="center">FLASH_REQUIRED</td>
884 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
885 * <td align="center">LOCKED</td>
886 * <td align="center">Values locked</td>
887 * </tr>
888 * <tr>
889 * <td align="center">LOCKED</td>
890 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
891 * <td align="center">SEARCHING</td>
892 * <td align="center">Values not good after unlock</td>
893 * </tr>
894 * <tr>
895 * <td align="center">LOCKED</td>
896 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
897 * <td align="center">CONVERGED</td>
898 * <td align="center">Values good after unlock</td>
899 * </tr>
900 * <tr>
901 * <td align="center">LOCKED</td>
902 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
903 * <td align="center">FLASH_REQUIRED</td>
904 * <td align="center">Exposure good, but too dark</td>
905 * </tr>
906 * <tr>
907 * <td align="center">PRECAPTURE</td>
908 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
909 * <td align="center">CONVERGED</td>
910 * <td align="center">Ready for high-quality capture</td>
911 * </tr>
912 * <tr>
913 * <td align="center">PRECAPTURE</td>
914 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
915 * <td align="center">LOCKED</td>
916 * <td align="center">Ready for high-quality capture</td>
917 * </tr>
918 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800919 * <td align="center">LOCKED</td>
920 * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td>
921 * <td align="center">LOCKED</td>
922 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
923 * </tr>
924 * <tr>
925 * <td align="center">LOCKED</td>
926 * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</td>
927 * <td align="center">LOCKED</td>
928 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
929 * </tr>
930 * <tr>
931 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He228f4f92014-01-16 17:22:05 -0800932 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
933 * <td align="center">PRECAPTURE</td>
934 * <td align="center">Start AE precapture metering sequence</td>
935 * </tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800936 * <tr>
937 * <td align="center">Any state (excluding LOCKED)</td>
938 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td>
939 * <td align="center">INACTIVE</td>
940 * <td align="center">Currently active precapture metering sequence is canceled</td>
941 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -0800942 * </tbody>
943 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800944 * <p>For the above table, the camera device may skip reporting any state changes that happen
945 * without application intervention (i.e. mode switch, trigger, locking). Any state that
946 * can be skipped in that manner is called a transient state.</p>
947 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
948 * listed in above table, it is also legal for the camera device to skip one or more
949 * transient states between two results. See below table for examples:</p>
950 * <table>
951 * <thead>
952 * <tr>
953 * <th align="center">State</th>
954 * <th align="center">Transition Cause</th>
955 * <th align="center">New State</th>
956 * <th align="center">Notes</th>
957 * </tr>
958 * </thead>
959 * <tbody>
960 * <tr>
961 * <td align="center">INACTIVE</td>
962 * <td align="center">Camera device finished AE scan</td>
963 * <td align="center">CONVERGED</td>
964 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
965 * </tr>
966 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800967 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -0800968 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
969 * <td align="center">FLASH_REQUIRED</td>
970 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
971 * </tr>
972 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800973 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -0800974 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
975 * <td align="center">CONVERGED</td>
976 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
977 * </tr>
978 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800979 * <td align="center">Any state (excluding LOCKED)</td>
980 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
981 * <td align="center">FLASH_REQUIRED</td>
982 * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td>
983 * </tr>
984 * <tr>
985 * <td align="center">Any state (excluding LOCKED)</td>
986 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
987 * <td align="center">CONVERGED</td>
988 * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td>
989 * </tr>
990 * <tr>
Zhijun He60b19dc2014-02-24 10:19:20 -0800991 * <td align="center">CONVERGED</td>
992 * <td align="center">Camera device finished AE scan</td>
993 * <td align="center">FLASH_REQUIRED</td>
994 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
995 * </tr>
996 * <tr>
997 * <td align="center">FLASH_REQUIRED</td>
998 * <td align="center">Camera device finished AE scan</td>
999 * <td align="center">CONVERGED</td>
1000 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
1001 * </tr>
1002 * </tbody>
1003 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001004 * <p><b>Possible values:</b>
1005 * <ul>
1006 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
1007 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
1008 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
1009 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
1010 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
1011 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
1012 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001013 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1014 * <p><b>Limited capability</b> -
1015 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1016 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001017 *
1018 * @see CaptureRequest#CONTROL_AE_LOCK
1019 * @see CaptureRequest#CONTROL_AE_MODE
1020 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1021 * @see CaptureRequest#CONTROL_MODE
1022 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001023 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001024 * @see #CONTROL_AE_STATE_INACTIVE
1025 * @see #CONTROL_AE_STATE_SEARCHING
1026 * @see #CONTROL_AE_STATE_CONVERGED
1027 * @see #CONTROL_AE_STATE_LOCKED
1028 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
1029 * @see #CONTROL_AE_STATE_PRECAPTURE
1030 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001031 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001032 public static final Key<Integer> CONTROL_AE_STATE =
1033 new Key<Integer>("android.control.aeState", int.class);
1034
1035 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001036 * <p>Whether auto-focus (AF) is currently enabled, and what
1037 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001038 * <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 -08001039 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1040 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1041 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1042 * 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 -08001043 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001044 * 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 -07001045 * in result metadata.</p>
1046 * <p><b>Possible values:</b>
1047 * <ul>
1048 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1049 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1050 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1051 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1052 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1053 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1054 * </ul></p>
1055 * <p><b>Available values for this device:</b><br>
1056 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1057 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001058 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001059 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001060 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001061 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001062 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001063 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001064 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001065 * @see #CONTROL_AF_MODE_OFF
1066 * @see #CONTROL_AF_MODE_AUTO
1067 * @see #CONTROL_AF_MODE_MACRO
1068 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1069 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1070 * @see #CONTROL_AF_MODE_EDOF
1071 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001072 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001073 public static final Key<Integer> CONTROL_AF_MODE =
1074 new Key<Integer>("android.control.afMode", int.class);
1075
1076 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001077 * <p>List of metering areas to use for auto-focus.</p>
1078 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001079 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001080 * <p>The maximum number of focus areas supported by the device is determined by the value
1081 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001082 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001083 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001084 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1085 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001086 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001087 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001088 * for every pixel in the area. This means that a large metering area
1089 * with the same weight as a smaller area will have more effect in
1090 * the metering result. Metering areas can partially overlap and the
1091 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001092 * <p>The weights are relative to weights of other metering regions, so if only one region
1093 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1094 * ignored.</p>
1095 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1096 * camera device.</p>
1097 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1098 * capture result metadata, the camera device will ignore the sections outside the crop
1099 * region and output only the intersection rectangle as the metering region in the result
1100 * metadata. If the region is entirely outside the crop region, it will be ignored and
1101 * not reported in the result metadata.</p>
1102 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1103 * <p><b>Range of valid values:</b><br>
1104 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1105 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001106 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001107 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001108 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001109 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001110 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001111 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001112 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001113 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1114 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001115
1116 /**
Zhijun He379af012014-05-06 11:54:54 -07001117 * <p>Whether the camera device will trigger autofocus for this request.</p>
1118 * <p>This entry is normally set to IDLE, or is not
1119 * included at all in the request settings.</p>
1120 * <p>When included and set to START, the camera device will trigger the
1121 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1122 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1123 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001124 * <p>Generally, applications should set this entry to START or CANCEL for only a
1125 * single capture, and then return it to IDLE (or not set at all). Specifying
1126 * START for multiple captures in a row means restarting the AF operation over
1127 * and over again.</p>
1128 * <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 -07001129 * <p><b>Possible values:</b>
1130 * <ul>
1131 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1132 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1133 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1134 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001135 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001136 *
1137 * @see CaptureResult#CONTROL_AF_STATE
1138 * @see #CONTROL_AF_TRIGGER_IDLE
1139 * @see #CONTROL_AF_TRIGGER_START
1140 * @see #CONTROL_AF_TRIGGER_CANCEL
1141 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001142 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001143 public static final Key<Integer> CONTROL_AF_TRIGGER =
1144 new Key<Integer>("android.control.afTrigger", int.class);
1145
1146 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001147 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001148 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1149 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1150 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1151 * the algorithm states to INACTIVE.</p>
1152 * <p>The camera device can do several state transitions between two results, if it is
1153 * allowed by the state transition table. For example: INACTIVE may never actually be
1154 * seen in a result.</p>
1155 * <p>The state in the result is the state for this image (in sync with this image): if
1156 * AF state becomes FOCUSED, then the image data associated with this result should
1157 * be sharp.</p>
1158 * <p>Below are state transition tables for different AF modes.</p>
1159 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1160 * <table>
1161 * <thead>
1162 * <tr>
1163 * <th align="center">State</th>
1164 * <th align="center">Transition Cause</th>
1165 * <th align="center">New State</th>
1166 * <th align="center">Notes</th>
1167 * </tr>
1168 * </thead>
1169 * <tbody>
1170 * <tr>
1171 * <td align="center">INACTIVE</td>
1172 * <td align="center"></td>
1173 * <td align="center">INACTIVE</td>
1174 * <td align="center">Never changes</td>
1175 * </tr>
1176 * </tbody>
1177 * </table>
1178 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1179 * <table>
1180 * <thead>
1181 * <tr>
1182 * <th align="center">State</th>
1183 * <th align="center">Transition Cause</th>
1184 * <th align="center">New State</th>
1185 * <th align="center">Notes</th>
1186 * </tr>
1187 * </thead>
1188 * <tbody>
1189 * <tr>
1190 * <td align="center">INACTIVE</td>
1191 * <td align="center">AF_TRIGGER</td>
1192 * <td align="center">ACTIVE_SCAN</td>
1193 * <td align="center">Start AF sweep, Lens now moving</td>
1194 * </tr>
1195 * <tr>
1196 * <td align="center">ACTIVE_SCAN</td>
1197 * <td align="center">AF sweep done</td>
1198 * <td align="center">FOCUSED_LOCKED</td>
1199 * <td align="center">Focused, Lens now locked</td>
1200 * </tr>
1201 * <tr>
1202 * <td align="center">ACTIVE_SCAN</td>
1203 * <td align="center">AF sweep done</td>
1204 * <td align="center">NOT_FOCUSED_LOCKED</td>
1205 * <td align="center">Not focused, Lens now locked</td>
1206 * </tr>
1207 * <tr>
1208 * <td align="center">ACTIVE_SCAN</td>
1209 * <td align="center">AF_CANCEL</td>
1210 * <td align="center">INACTIVE</td>
1211 * <td align="center">Cancel/reset AF, Lens now locked</td>
1212 * </tr>
1213 * <tr>
1214 * <td align="center">FOCUSED_LOCKED</td>
1215 * <td align="center">AF_CANCEL</td>
1216 * <td align="center">INACTIVE</td>
1217 * <td align="center">Cancel/reset AF</td>
1218 * </tr>
1219 * <tr>
1220 * <td align="center">FOCUSED_LOCKED</td>
1221 * <td align="center">AF_TRIGGER</td>
1222 * <td align="center">ACTIVE_SCAN</td>
1223 * <td align="center">Start new sweep, Lens now moving</td>
1224 * </tr>
1225 * <tr>
1226 * <td align="center">NOT_FOCUSED_LOCKED</td>
1227 * <td align="center">AF_CANCEL</td>
1228 * <td align="center">INACTIVE</td>
1229 * <td align="center">Cancel/reset AF</td>
1230 * </tr>
1231 * <tr>
1232 * <td align="center">NOT_FOCUSED_LOCKED</td>
1233 * <td align="center">AF_TRIGGER</td>
1234 * <td align="center">ACTIVE_SCAN</td>
1235 * <td align="center">Start new sweep, Lens now moving</td>
1236 * </tr>
1237 * <tr>
1238 * <td align="center">Any state</td>
1239 * <td align="center">Mode change</td>
1240 * <td align="center">INACTIVE</td>
1241 * <td align="center"></td>
1242 * </tr>
1243 * </tbody>
1244 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001245 * <p>For the above table, the camera device may skip reporting any state changes that happen
1246 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1247 * can be skipped in that manner is called a transient state.</p>
1248 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1249 * state transitions listed in above table, it is also legal for the camera device to skip
1250 * one or more transient states between two results. See below table for examples:</p>
1251 * <table>
1252 * <thead>
1253 * <tr>
1254 * <th align="center">State</th>
1255 * <th align="center">Transition Cause</th>
1256 * <th align="center">New State</th>
1257 * <th align="center">Notes</th>
1258 * </tr>
1259 * </thead>
1260 * <tbody>
1261 * <tr>
1262 * <td align="center">INACTIVE</td>
1263 * <td align="center">AF_TRIGGER</td>
1264 * <td align="center">FOCUSED_LOCKED</td>
1265 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1266 * </tr>
1267 * <tr>
1268 * <td align="center">INACTIVE</td>
1269 * <td align="center">AF_TRIGGER</td>
1270 * <td align="center">NOT_FOCUSED_LOCKED</td>
1271 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1272 * </tr>
1273 * <tr>
1274 * <td align="center">FOCUSED_LOCKED</td>
1275 * <td align="center">AF_TRIGGER</td>
1276 * <td align="center">FOCUSED_LOCKED</td>
1277 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1278 * </tr>
1279 * <tr>
1280 * <td align="center">NOT_FOCUSED_LOCKED</td>
1281 * <td align="center">AF_TRIGGER</td>
1282 * <td align="center">FOCUSED_LOCKED</td>
1283 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1284 * </tr>
1285 * </tbody>
1286 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001287 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1288 * <table>
1289 * <thead>
1290 * <tr>
1291 * <th align="center">State</th>
1292 * <th align="center">Transition Cause</th>
1293 * <th align="center">New State</th>
1294 * <th align="center">Notes</th>
1295 * </tr>
1296 * </thead>
1297 * <tbody>
1298 * <tr>
1299 * <td align="center">INACTIVE</td>
1300 * <td align="center">Camera device initiates new scan</td>
1301 * <td align="center">PASSIVE_SCAN</td>
1302 * <td align="center">Start AF scan, Lens now moving</td>
1303 * </tr>
1304 * <tr>
1305 * <td align="center">INACTIVE</td>
1306 * <td align="center">AF_TRIGGER</td>
1307 * <td align="center">NOT_FOCUSED_LOCKED</td>
1308 * <td align="center">AF state query, Lens now locked</td>
1309 * </tr>
1310 * <tr>
1311 * <td align="center">PASSIVE_SCAN</td>
1312 * <td align="center">Camera device completes current scan</td>
1313 * <td align="center">PASSIVE_FOCUSED</td>
1314 * <td align="center">End AF scan, Lens now locked</td>
1315 * </tr>
1316 * <tr>
1317 * <td align="center">PASSIVE_SCAN</td>
1318 * <td align="center">Camera device fails current scan</td>
1319 * <td align="center">PASSIVE_UNFOCUSED</td>
1320 * <td align="center">End AF scan, Lens now locked</td>
1321 * </tr>
1322 * <tr>
1323 * <td align="center">PASSIVE_SCAN</td>
1324 * <td align="center">AF_TRIGGER</td>
1325 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001326 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001327 * </tr>
1328 * <tr>
1329 * <td align="center">PASSIVE_SCAN</td>
1330 * <td align="center">AF_TRIGGER</td>
1331 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001332 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001333 * </tr>
1334 * <tr>
1335 * <td align="center">PASSIVE_SCAN</td>
1336 * <td align="center">AF_CANCEL</td>
1337 * <td align="center">INACTIVE</td>
1338 * <td align="center">Reset lens position, Lens now locked</td>
1339 * </tr>
1340 * <tr>
1341 * <td align="center">PASSIVE_FOCUSED</td>
1342 * <td align="center">Camera device initiates new scan</td>
1343 * <td align="center">PASSIVE_SCAN</td>
1344 * <td align="center">Start AF scan, Lens now moving</td>
1345 * </tr>
1346 * <tr>
1347 * <td align="center">PASSIVE_UNFOCUSED</td>
1348 * <td align="center">Camera device initiates new scan</td>
1349 * <td align="center">PASSIVE_SCAN</td>
1350 * <td align="center">Start AF scan, Lens now moving</td>
1351 * </tr>
1352 * <tr>
1353 * <td align="center">PASSIVE_FOCUSED</td>
1354 * <td align="center">AF_TRIGGER</td>
1355 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001356 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001357 * </tr>
1358 * <tr>
1359 * <td align="center">PASSIVE_UNFOCUSED</td>
1360 * <td align="center">AF_TRIGGER</td>
1361 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001362 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001363 * </tr>
1364 * <tr>
1365 * <td align="center">FOCUSED_LOCKED</td>
1366 * <td align="center">AF_TRIGGER</td>
1367 * <td align="center">FOCUSED_LOCKED</td>
1368 * <td align="center">No effect</td>
1369 * </tr>
1370 * <tr>
1371 * <td align="center">FOCUSED_LOCKED</td>
1372 * <td align="center">AF_CANCEL</td>
1373 * <td align="center">INACTIVE</td>
1374 * <td align="center">Restart AF scan</td>
1375 * </tr>
1376 * <tr>
1377 * <td align="center">NOT_FOCUSED_LOCKED</td>
1378 * <td align="center">AF_TRIGGER</td>
1379 * <td align="center">NOT_FOCUSED_LOCKED</td>
1380 * <td align="center">No effect</td>
1381 * </tr>
1382 * <tr>
1383 * <td align="center">NOT_FOCUSED_LOCKED</td>
1384 * <td align="center">AF_CANCEL</td>
1385 * <td align="center">INACTIVE</td>
1386 * <td align="center">Restart AF scan</td>
1387 * </tr>
1388 * </tbody>
1389 * </table>
1390 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1391 * <table>
1392 * <thead>
1393 * <tr>
1394 * <th align="center">State</th>
1395 * <th align="center">Transition Cause</th>
1396 * <th align="center">New State</th>
1397 * <th align="center">Notes</th>
1398 * </tr>
1399 * </thead>
1400 * <tbody>
1401 * <tr>
1402 * <td align="center">INACTIVE</td>
1403 * <td align="center">Camera device initiates new scan</td>
1404 * <td align="center">PASSIVE_SCAN</td>
1405 * <td align="center">Start AF scan, Lens now moving</td>
1406 * </tr>
1407 * <tr>
1408 * <td align="center">INACTIVE</td>
1409 * <td align="center">AF_TRIGGER</td>
1410 * <td align="center">NOT_FOCUSED_LOCKED</td>
1411 * <td align="center">AF state query, Lens now locked</td>
1412 * </tr>
1413 * <tr>
1414 * <td align="center">PASSIVE_SCAN</td>
1415 * <td align="center">Camera device completes current scan</td>
1416 * <td align="center">PASSIVE_FOCUSED</td>
1417 * <td align="center">End AF scan, Lens now locked</td>
1418 * </tr>
1419 * <tr>
1420 * <td align="center">PASSIVE_SCAN</td>
1421 * <td align="center">Camera device fails current scan</td>
1422 * <td align="center">PASSIVE_UNFOCUSED</td>
1423 * <td align="center">End AF scan, Lens now locked</td>
1424 * </tr>
1425 * <tr>
1426 * <td align="center">PASSIVE_SCAN</td>
1427 * <td align="center">AF_TRIGGER</td>
1428 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001429 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001430 * </tr>
1431 * <tr>
1432 * <td align="center">PASSIVE_SCAN</td>
1433 * <td align="center">AF_TRIGGER</td>
1434 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001435 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001436 * </tr>
1437 * <tr>
1438 * <td align="center">PASSIVE_SCAN</td>
1439 * <td align="center">AF_CANCEL</td>
1440 * <td align="center">INACTIVE</td>
1441 * <td align="center">Reset lens position, Lens now locked</td>
1442 * </tr>
1443 * <tr>
1444 * <td align="center">PASSIVE_FOCUSED</td>
1445 * <td align="center">Camera device initiates new scan</td>
1446 * <td align="center">PASSIVE_SCAN</td>
1447 * <td align="center">Start AF scan, Lens now moving</td>
1448 * </tr>
1449 * <tr>
1450 * <td align="center">PASSIVE_UNFOCUSED</td>
1451 * <td align="center">Camera device initiates new scan</td>
1452 * <td align="center">PASSIVE_SCAN</td>
1453 * <td align="center">Start AF scan, Lens now moving</td>
1454 * </tr>
1455 * <tr>
1456 * <td align="center">PASSIVE_FOCUSED</td>
1457 * <td align="center">AF_TRIGGER</td>
1458 * <td align="center">FOCUSED_LOCKED</td>
1459 * <td align="center">Immediate trans. Lens now locked</td>
1460 * </tr>
1461 * <tr>
1462 * <td align="center">PASSIVE_UNFOCUSED</td>
1463 * <td align="center">AF_TRIGGER</td>
1464 * <td align="center">NOT_FOCUSED_LOCKED</td>
1465 * <td align="center">Immediate trans. Lens now locked</td>
1466 * </tr>
1467 * <tr>
1468 * <td align="center">FOCUSED_LOCKED</td>
1469 * <td align="center">AF_TRIGGER</td>
1470 * <td align="center">FOCUSED_LOCKED</td>
1471 * <td align="center">No effect</td>
1472 * </tr>
1473 * <tr>
1474 * <td align="center">FOCUSED_LOCKED</td>
1475 * <td align="center">AF_CANCEL</td>
1476 * <td align="center">INACTIVE</td>
1477 * <td align="center">Restart AF scan</td>
1478 * </tr>
1479 * <tr>
1480 * <td align="center">NOT_FOCUSED_LOCKED</td>
1481 * <td align="center">AF_TRIGGER</td>
1482 * <td align="center">NOT_FOCUSED_LOCKED</td>
1483 * <td align="center">No effect</td>
1484 * </tr>
1485 * <tr>
1486 * <td align="center">NOT_FOCUSED_LOCKED</td>
1487 * <td align="center">AF_CANCEL</td>
1488 * <td align="center">INACTIVE</td>
1489 * <td align="center">Restart AF scan</td>
1490 * </tr>
1491 * </tbody>
1492 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001493 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1494 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1495 * camera device. When a trigger is included in a mode switch request, the trigger
1496 * will be evaluated in the context of the new mode in the request.
1497 * See below table for examples:</p>
1498 * <table>
1499 * <thead>
1500 * <tr>
1501 * <th align="center">State</th>
1502 * <th align="center">Transition Cause</th>
1503 * <th align="center">New State</th>
1504 * <th align="center">Notes</th>
1505 * </tr>
1506 * </thead>
1507 * <tbody>
1508 * <tr>
1509 * <td align="center">any state</td>
1510 * <td align="center">CAF--&gt;AUTO mode switch</td>
1511 * <td align="center">INACTIVE</td>
1512 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1513 * </tr>
1514 * <tr>
1515 * <td align="center">any state</td>
1516 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1517 * <td align="center">trigger-reachable states from INACTIVE</td>
1518 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1519 * </tr>
1520 * <tr>
1521 * <td align="center">any state</td>
1522 * <td align="center">AUTO--&gt;CAF mode switch</td>
1523 * <td align="center">passively reachable states from INACTIVE</td>
1524 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1525 * </tr>
1526 * </tbody>
1527 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001528 * <p><b>Possible values:</b>
1529 * <ul>
1530 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1531 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1532 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1533 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1534 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1535 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1536 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1537 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001538 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001539 *
1540 * @see CaptureRequest#CONTROL_AF_MODE
1541 * @see CaptureRequest#CONTROL_MODE
1542 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001543 * @see #CONTROL_AF_STATE_INACTIVE
1544 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1545 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1546 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1547 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1548 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001549 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001550 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001551 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001552 public static final Key<Integer> CONTROL_AF_STATE =
1553 new Key<Integer>("android.control.afState", int.class);
1554
1555 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001556 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001557 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001558 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1559 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1560 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1561 * get locked do not necessarily correspond to the settings that were present in the
1562 * latest capture result received from the camera device, since additional captures
1563 * and AWB updates may have occurred even before the result was sent out. If an
1564 * application is switching between automatic and manual control and wishes to eliminate
1565 * any flicker during the switch, the following procedure is recommended:</p>
1566 * <ol>
1567 * <li>Starting in auto-AWB mode:</li>
1568 * <li>Lock AWB</li>
1569 * <li>Wait for the first result to be output that has the AWB locked</li>
1570 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1571 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1572 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001573 * <p>Note that AWB lock is only meaningful when
1574 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1575 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001576 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1577 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001578 *
1579 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001580 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001581 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001582 public static final Key<Boolean> CONTROL_AWB_LOCK =
1583 new Key<Boolean>("android.control.awbLock", boolean.class);
1584
1585 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001586 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001587 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001588 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001589 * <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 -07001590 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001591 * routine is enabled, overriding the application's selected
1592 * {@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 -08001593 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1594 * is OFF, the behavior of AWB is device dependent. It is recommened to
1595 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1596 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001597 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001598 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001599 * 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 -08001600 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001601 * <p>When set to any other modes, the camera device's auto-white
1602 * balance routine is disabled. The camera device uses each
1603 * particular illumination target for white balance
1604 * adjustment. The application's values for
1605 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1606 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1607 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001608 * <p><b>Possible values:</b>
1609 * <ul>
1610 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1611 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1612 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1613 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1614 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1615 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1616 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1617 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1618 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1619 * </ul></p>
1620 * <p><b>Available values for this device:</b><br>
1621 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001622 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001623 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001624 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001625 * @see CaptureRequest#COLOR_CORRECTION_MODE
1626 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001627 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001628 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001629 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001630 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001631 * @see #CONTROL_AWB_MODE_OFF
1632 * @see #CONTROL_AWB_MODE_AUTO
1633 * @see #CONTROL_AWB_MODE_INCANDESCENT
1634 * @see #CONTROL_AWB_MODE_FLUORESCENT
1635 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1636 * @see #CONTROL_AWB_MODE_DAYLIGHT
1637 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1638 * @see #CONTROL_AWB_MODE_TWILIGHT
1639 * @see #CONTROL_AWB_MODE_SHADE
1640 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001641 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001642 public static final Key<Integer> CONTROL_AWB_MODE =
1643 new Key<Integer>("android.control.awbMode", int.class);
1644
1645 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001646 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001647 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001648 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001649 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001650 * <p>The maximum number of regions supported by the device is determined by the value
1651 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001652 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001653 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001654 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1655 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001656 * bottom-right pixel in the active pixel array.</p>
1657 * <p>The weight must range from 0 to 1000, and represents a weight
1658 * for every pixel in the area. This means that a large metering area
1659 * with the same weight as a smaller area will have more effect in
1660 * the metering result. Metering areas can partially overlap and the
1661 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001662 * <p>The weights are relative to weights of other white balance metering regions, so if
1663 * only one region is used, all non-zero weights will have the same effect. A region with
1664 * 0 weight is ignored.</p>
1665 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1666 * camera device.</p>
1667 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1668 * capture result metadata, the camera device will ignore the sections outside the crop
1669 * region and output only the intersection rectangle as the metering region in the result
1670 * metadata. If the region is entirely outside the crop region, it will be ignored and
1671 * not reported in the result metadata.</p>
1672 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1673 * <p><b>Range of valid values:</b><br>
1674 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1675 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001676 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001677 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001678 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001679 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001680 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001681 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001682 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001683 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1684 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001685
1686 /**
Zhijun He379af012014-05-06 11:54:54 -07001687 * <p>Information to the camera device 3A (auto-exposure,
1688 * auto-focus, auto-white balance) routines about the purpose
1689 * of this capture, to help the camera device to decide optimal 3A
1690 * strategy.</p>
1691 * <p>This control (except for MANUAL) is only effective if
1692 * <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 -07001693 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Zhijun He0e99c222015-01-29 15:26:05 -08001694 * contains OPAQUE_REPROCESSING. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001695 * contains MANUAL_SENSOR. Other intent values are always supported.</p>
1696 * <p><b>Possible values:</b>
1697 * <ul>
1698 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1699 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1700 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1701 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1702 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1703 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1704 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1705 * </ul></p>
1706 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001707 *
1708 * @see CaptureRequest#CONTROL_MODE
1709 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1710 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1711 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1712 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1713 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1714 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1715 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1716 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1717 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001718 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001719 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1720 new Key<Integer>("android.control.captureIntent", int.class);
1721
1722 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001723 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001724 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1725 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1726 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1727 * the algorithm states to INACTIVE.</p>
1728 * <p>The camera device can do several state transitions between two results, if it is
1729 * allowed by the state transition table. So INACTIVE may never actually be seen in
1730 * a result.</p>
1731 * <p>The state in the result is the state for this image (in sync with this image): if
1732 * AWB state becomes CONVERGED, then the image data associated with this result should
1733 * be good to use.</p>
1734 * <p>Below are state transition tables for different AWB modes.</p>
1735 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1736 * <table>
1737 * <thead>
1738 * <tr>
1739 * <th align="center">State</th>
1740 * <th align="center">Transition Cause</th>
1741 * <th align="center">New State</th>
1742 * <th align="center">Notes</th>
1743 * </tr>
1744 * </thead>
1745 * <tbody>
1746 * <tr>
1747 * <td align="center">INACTIVE</td>
1748 * <td align="center"></td>
1749 * <td align="center">INACTIVE</td>
1750 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1751 * </tr>
1752 * </tbody>
1753 * </table>
1754 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1755 * <table>
1756 * <thead>
1757 * <tr>
1758 * <th align="center">State</th>
1759 * <th align="center">Transition Cause</th>
1760 * <th align="center">New State</th>
1761 * <th align="center">Notes</th>
1762 * </tr>
1763 * </thead>
1764 * <tbody>
1765 * <tr>
1766 * <td align="center">INACTIVE</td>
1767 * <td align="center">Camera device initiates AWB scan</td>
1768 * <td align="center">SEARCHING</td>
1769 * <td align="center">Values changing</td>
1770 * </tr>
1771 * <tr>
1772 * <td align="center">INACTIVE</td>
1773 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1774 * <td align="center">LOCKED</td>
1775 * <td align="center">Values locked</td>
1776 * </tr>
1777 * <tr>
1778 * <td align="center">SEARCHING</td>
1779 * <td align="center">Camera device finishes AWB scan</td>
1780 * <td align="center">CONVERGED</td>
1781 * <td align="center">Good values, not changing</td>
1782 * </tr>
1783 * <tr>
1784 * <td align="center">SEARCHING</td>
1785 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1786 * <td align="center">LOCKED</td>
1787 * <td align="center">Values locked</td>
1788 * </tr>
1789 * <tr>
1790 * <td align="center">CONVERGED</td>
1791 * <td align="center">Camera device initiates AWB scan</td>
1792 * <td align="center">SEARCHING</td>
1793 * <td align="center">Values changing</td>
1794 * </tr>
1795 * <tr>
1796 * <td align="center">CONVERGED</td>
1797 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1798 * <td align="center">LOCKED</td>
1799 * <td align="center">Values locked</td>
1800 * </tr>
1801 * <tr>
1802 * <td align="center">LOCKED</td>
1803 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1804 * <td align="center">SEARCHING</td>
1805 * <td align="center">Values not good after unlock</td>
1806 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001807 * </tbody>
1808 * </table>
1809 * <p>For the above table, the camera device may skip reporting any state changes that happen
1810 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1811 * can be skipped in that manner is called a transient state.</p>
1812 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1813 * listed in above table, it is also legal for the camera device to skip one or more
1814 * transient states between two results. See below table for examples:</p>
1815 * <table>
1816 * <thead>
1817 * <tr>
1818 * <th align="center">State</th>
1819 * <th align="center">Transition Cause</th>
1820 * <th align="center">New State</th>
1821 * <th align="center">Notes</th>
1822 * </tr>
1823 * </thead>
1824 * <tbody>
1825 * <tr>
1826 * <td align="center">INACTIVE</td>
1827 * <td align="center">Camera device finished AWB scan</td>
1828 * <td align="center">CONVERGED</td>
1829 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1830 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001831 * <tr>
1832 * <td align="center">LOCKED</td>
1833 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1834 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001835 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001836 * </tr>
1837 * </tbody>
1838 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001839 * <p><b>Possible values:</b>
1840 * <ul>
1841 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1842 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1843 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1844 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1845 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001846 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1847 * <p><b>Limited capability</b> -
1848 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1849 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001850 *
1851 * @see CaptureRequest#CONTROL_AWB_LOCK
1852 * @see CaptureRequest#CONTROL_AWB_MODE
1853 * @see CaptureRequest#CONTROL_MODE
1854 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001855 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001856 * @see #CONTROL_AWB_STATE_INACTIVE
1857 * @see #CONTROL_AWB_STATE_SEARCHING
1858 * @see #CONTROL_AWB_STATE_CONVERGED
1859 * @see #CONTROL_AWB_STATE_LOCKED
1860 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001861 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001862 public static final Key<Integer> CONTROL_AWB_STATE =
1863 new Key<Integer>("android.control.awbState", int.class);
1864
1865 /**
Zhijun He379af012014-05-06 11:54:54 -07001866 * <p>A special color effect to apply.</p>
1867 * <p>When this mode is set, a color effect will be applied
1868 * to images produced by the camera device. The interpretation
1869 * and implementation of these color effects is left to the
1870 * implementor of the camera device, and should not be
1871 * depended on to be consistent (or present) across all
1872 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001873 * <p><b>Possible values:</b>
1874 * <ul>
1875 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1876 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1877 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1878 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1879 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1880 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1881 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1882 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1883 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1884 * </ul></p>
1885 * <p><b>Available values for this device:</b><br>
1886 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001887 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001888 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001889 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07001890 * @see #CONTROL_EFFECT_MODE_OFF
1891 * @see #CONTROL_EFFECT_MODE_MONO
1892 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1893 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1894 * @see #CONTROL_EFFECT_MODE_SEPIA
1895 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1896 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1897 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1898 * @see #CONTROL_EFFECT_MODE_AQUA
1899 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001900 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001901 public static final Key<Integer> CONTROL_EFFECT_MODE =
1902 new Key<Integer>("android.control.effectMode", int.class);
1903
1904 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001905 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001906 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001907 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001908 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001909 * capture parameters itself.</p>
1910 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001911 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001912 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001913 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001914 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001915 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001916 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001917 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1918 * is that this frame will not be used by camera device background 3A statistics
1919 * update, as if this frame is never captured. This mode can be used in the scenario
1920 * where the application doesn't want a 3A manual control capture to affect
1921 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001922 * <p><b>Possible values:</b>
1923 * <ul>
1924 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
1925 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1926 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1927 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1928 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001929 * <p><b>Available values for this device:</b><br>
1930 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001931 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001932 *
1933 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001934 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001935 * @see #CONTROL_MODE_OFF
1936 * @see #CONTROL_MODE_AUTO
1937 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001938 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001939 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001940 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001941 public static final Key<Integer> CONTROL_MODE =
1942 new Key<Integer>("android.control.mode", int.class);
1943
1944 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001945 * <p>Control for which scene mode is currently active.</p>
1946 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1947 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07001948 * <p>This is the mode that that is active when
1949 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1950 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001951 * {@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 -07001952 * <p>The interpretation and implementation of these scene modes is left
1953 * to the implementor of the camera device. Their behavior will not be
1954 * consistent across all devices, and any given device may only implement
1955 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001956 * <p><b>Possible values:</b>
1957 * <ul>
1958 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1959 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1960 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1961 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1962 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1963 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1964 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1965 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1966 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1967 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1968 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1969 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1970 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1971 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1972 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1973 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1974 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1975 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001976 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001977 * </ul></p>
1978 * <p><b>Available values for this device:</b><br>
1979 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</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 *
1982 * @see CaptureRequest#CONTROL_AE_MODE
1983 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001984 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001985 * @see CaptureRequest#CONTROL_AWB_MODE
1986 * @see CaptureRequest#CONTROL_MODE
1987 * @see #CONTROL_SCENE_MODE_DISABLED
1988 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1989 * @see #CONTROL_SCENE_MODE_ACTION
1990 * @see #CONTROL_SCENE_MODE_PORTRAIT
1991 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1992 * @see #CONTROL_SCENE_MODE_NIGHT
1993 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1994 * @see #CONTROL_SCENE_MODE_THEATRE
1995 * @see #CONTROL_SCENE_MODE_BEACH
1996 * @see #CONTROL_SCENE_MODE_SNOW
1997 * @see #CONTROL_SCENE_MODE_SUNSET
1998 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1999 * @see #CONTROL_SCENE_MODE_FIREWORKS
2000 * @see #CONTROL_SCENE_MODE_SPORTS
2001 * @see #CONTROL_SCENE_MODE_PARTY
2002 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
2003 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07002004 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002005 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07002006 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002007 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002008 public static final Key<Integer> CONTROL_SCENE_MODE =
2009 new Key<Integer>("android.control.sceneMode", int.class);
2010
2011 /**
2012 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002013 * active.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002014 * <p>Video stabilization automatically translates and scales images from
2015 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07002016 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07002017 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002018 * <p>Switching between different video stabilization modes may take several
2019 * frames to initialize, the camera device will report the current mode
2020 * in capture result metadata. For example, When "ON" mode is requested,
2021 * the video stabilization modes in the first several capture results may
2022 * still be "OFF", and it will become "ON" when the initialization is
2023 * done.</p>
2024 * <p>If a camera device supports both this mode and OIS
2025 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
2026 * produce undesirable interaction, so it is recommended not to enable
2027 * both at the same time.</p>
2028 * <p><b>Possible values:</b>
2029 * <ul>
2030 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
2031 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
2032 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002033 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002034 *
Zhijun He45fa43a12014-06-13 18:29:37 -07002035 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07002036 * @see CaptureRequest#SCALER_CROP_REGION
2037 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
2038 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
2039 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002040 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002041 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
2042 new Key<Integer>("android.control.videoStabilizationMode", int.class);
2043
2044 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002045 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08002046 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002047 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2048 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002049 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08002050 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08002051 * camera device will use the highest-quality enhancement algorithms,
2052 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08002053 * not slow down capture rate when applying edge enhancement.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002054 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2055 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
2056 * The camera device may adjust its internal noise reduction parameters for best
2057 * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002058 * <p><b>Possible values:</b>
2059 * <ul>
2060 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2061 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2062 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2063 * </ul></p>
2064 * <p><b>Available values for this device:</b><br>
2065 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002066 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2067 * <p><b>Full capability</b> -
2068 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2069 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002070 *
2071 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002072 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002073 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002074 * @see #EDGE_MODE_OFF
2075 * @see #EDGE_MODE_FAST
2076 * @see #EDGE_MODE_HIGH_QUALITY
2077 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002078 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002079 public static final Key<Integer> EDGE_MODE =
2080 new Key<Integer>("android.edge.mode", int.class);
2081
2082 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002083 * <p>The desired mode for for the camera device's flash control.</p>
2084 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002085 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002086 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2087 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2088 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2089 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2090 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2091 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002092 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002093 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2094 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2095 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002096 * <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 -07002097 * <p><b>Possible values:</b>
2098 * <ul>
2099 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2100 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2101 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2102 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002103 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002104 *
2105 * @see CaptureRequest#CONTROL_AE_MODE
2106 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2107 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002108 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002109 * @see #FLASH_MODE_OFF
2110 * @see #FLASH_MODE_SINGLE
2111 * @see #FLASH_MODE_TORCH
2112 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002113 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002114 public static final Key<Integer> FLASH_MODE =
2115 new Key<Integer>("android.flash.mode", int.class);
2116
2117 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002118 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002119 * unit.</p>
2120 * <p>When the camera device doesn't have flash unit
2121 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2122 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002123 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2124 * <ul>
2125 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2126 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002127 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002128 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002129 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002130 * </ul>
2131 * <p>In all other conditions the state will not be available on
2132 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002133 * <p><b>Possible values:</b>
2134 * <ul>
2135 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2136 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2137 * <li>{@link #FLASH_STATE_READY READY}</li>
2138 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2139 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2140 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002141 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2142 * <p><b>Limited capability</b> -
2143 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2144 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002145 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002146 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002147 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002148 * @see CaptureRequest#FLASH_MODE
2149 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002150 * @see #FLASH_STATE_UNAVAILABLE
2151 * @see #FLASH_STATE_CHARGING
2152 * @see #FLASH_STATE_READY
2153 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002154 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002155 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002156 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002157 public static final Key<Integer> FLASH_STATE =
2158 new Key<Integer>("android.flash.state", int.class);
2159
2160 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002161 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002162 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002163 * that do not accurately measure the incoming light (i.e. pixels that
2164 * are stuck at an arbitrary value or are oversensitive).</p>
2165 * <p><b>Possible values:</b>
2166 * <ul>
2167 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2168 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2169 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2170 * </ul></p>
2171 * <p><b>Available values for this device:</b><br>
2172 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002173 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002174 *
2175 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002176 * @see #HOT_PIXEL_MODE_OFF
2177 * @see #HOT_PIXEL_MODE_FAST
2178 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2179 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002180 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002181 public static final Key<Integer> HOT_PIXEL_MODE =
2182 new Key<Integer>("android.hotPixel.mode", int.class);
2183
2184 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002185 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002186 * <p>Setting a location object in a request will include the GPS coordinates of the location
2187 * into any JPEG images captured based on the request. These coordinates can then be
2188 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002189 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002190 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002191 @PublicKey
2192 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002193 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2194 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2195
2196 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002197 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002198 * EXIF.</p>
2199 * <p><b>Range of valid values:</b><br>
2200 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002201 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002202 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002203 */
2204 public static final Key<double[]> JPEG_GPS_COORDINATES =
2205 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2206
2207 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002208 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002209 * include in EXIF.</p>
2210 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002211 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002212 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002213 */
2214 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2215 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2216
2217 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002218 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002219 * EXIF.</p>
2220 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002221 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002222 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002223 */
2224 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2225 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2226
2227 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002228 * <p>The orientation for a JPEG image.</p>
2229 * <p>The clockwise rotation angle in degrees, relative to the orientation
2230 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2231 * upright.</p>
2232 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
2233 * rotate the image data to match this orientation.</p>
2234 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2235 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
2236 * <p>To translate from the device orientation given by the Android sensor APIs, the following
2237 * sample code may be used:</p>
2238 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2239 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2240 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2241 *
2242 * // Round device orientation to a multiple of 90
2243 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2244 *
2245 * // Reverse device orientation for front-facing cameras
2246 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2247 * if (facingFront) deviceOrientation = -deviceOrientation;
2248 *
2249 * // Calculate desired JPEG orientation relative to camera orientation to make
2250 * // the image upright relative to the device orientation
2251 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2252 *
2253 * return jpegOrientation;
2254 * }
2255 * </code></pre>
2256 * <p><b>Units</b>: Degrees in multiples of 90</p>
2257 * <p><b>Range of valid values:</b><br>
2258 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002259 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002260 *
2261 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002262 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002263 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002264 public static final Key<Integer> JPEG_ORIENTATION =
2265 new Key<Integer>("android.jpeg.orientation", int.class);
2266
2267 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002268 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002269 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002270 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002271 * <p><b>Range of valid values:</b><br>
2272 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002273 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002274 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002275 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002276 public static final Key<Byte> JPEG_QUALITY =
2277 new Key<Byte>("android.jpeg.quality", byte.class);
2278
2279 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002280 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002281 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002282 * <p><b>Range of valid values:</b><br>
2283 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002284 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002285 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002286 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002287 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2288 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2289
2290 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002291 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002292 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2293 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002294 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2295 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002296 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2297 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2298 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2299 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2300 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2301 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002302 * <p><b>Range of valid values:</b><br>
2303 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002304 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002305 *
2306 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002307 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002308 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002309 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2310 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002311
2312 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002313 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2314 * effective aperture diameter.</p>
2315 * <p>Setting this value is only supported on the camera devices that have a variable
2316 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002317 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2318 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002319 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002320 * to achieve manual exposure control.</p>
2321 * <p>The requested aperture value may take several frames to reach the
2322 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002323 * aperture size in capture result metadata while the aperture is changing.
2324 * 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 -08002325 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2326 * the ON modes, this will be overridden by the camera device
2327 * auto-exposure algorithm, the overridden values are then provided
2328 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002329 * <p><b>Units</b>: The f-number (f/N)</p>
2330 * <p><b>Range of valid values:</b><br>
2331 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002332 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2333 * <p><b>Full capability</b> -
2334 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2335 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002336 *
Zhijun He399f05d2014-01-15 11:31:30 -08002337 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002338 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002339 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002340 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002341 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002342 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002343 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002344 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002345 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002346 public static final Key<Float> LENS_APERTURE =
2347 new Key<Float>("android.lens.aperture", float.class);
2348
2349 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002350 * <p>The desired setting for the lens neutral density filter(s).</p>
2351 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002352 * <p>Lens filters are typically used to lower the amount of light the
2353 * sensor is exposed to (measured in steps of EV). As used here, an EV
2354 * step is the standard logarithmic representation, which are
2355 * non-negative, and inversely proportional to the amount of light
2356 * hitting the sensor. For example, setting this to 0 would result
2357 * in no reduction of the incoming light, and setting this to 2 would
2358 * mean that the filter is set to reduce incoming light by two stops
2359 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002360 * <p>It may take several frames before the lens filter density changes
2361 * to the requested value. While the filter density is still changing,
2362 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002363 * <p><b>Units</b>: Exposure Value (EV)</p>
2364 * <p><b>Range of valid values:</b><br>
2365 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002366 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2367 * <p><b>Full capability</b> -
2368 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2369 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002370 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002371 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002372 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002373 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002374 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002375 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002376 public static final Key<Float> LENS_FILTER_DENSITY =
2377 new Key<Float>("android.lens.filterDensity", float.class);
2378
2379 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002380 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002381 * <p>This setting controls the physical focal length of the camera
2382 * device's lens. Changing the focal length changes the field of
2383 * view of the camera device, and is usually used for optical zoom.</p>
2384 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2385 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002386 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002387 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2388 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002389 * <p>Optical zoom will not be supported on most devices.</p>
2390 * <p><b>Units</b>: Millimeters</p>
2391 * <p><b>Range of valid values:</b><br>
2392 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002393 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002394 *
2395 * @see CaptureRequest#LENS_APERTURE
2396 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002397 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002398 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002399 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002400 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002401 public static final Key<Float> LENS_FOCAL_LENGTH =
2402 new Key<Float>("android.lens.focalLength", float.class);
2403
2404 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002405 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002406 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002407 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002408 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2409 * <p><b>Range of valid values:</b><br>
2410 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002411 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2412 * <p><b>Full capability</b> -
2413 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2414 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2415 *
2416 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002417 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002418 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002419 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002420 public static final Key<Float> LENS_FOCUS_DISTANCE =
2421 new Key<Float>("android.lens.focusDistance", float.class);
2422
2423 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002424 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002425 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002426 * <p>If variable focus not supported, can still report
2427 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002428 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2429 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2430 * <p><b>Range of valid values:</b><br>
2431 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002432 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2433 * <p><b>Limited capability</b> -
2434 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2435 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2436 *
2437 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002438 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002439 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002440 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002441 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2442 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 -07002443
2444 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002445 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2446 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002447 * <p>OIS is used to compensate for motion blur due to small
2448 * movements of the camera during capture. Unlike digital image
2449 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2450 * makes use of mechanical elements to stabilize the camera
2451 * sensor, and thus allows for longer exposure times before
2452 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002453 * <p>Switching between different optical stabilization modes may take several
2454 * frames to initialize, the camera device will report the current mode in
2455 * capture result metadata. For example, When "ON" mode is requested, the
2456 * optical stabilization modes in the first several capture results may still
2457 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002458 * <p>If a camera device supports both OIS and digital image stabilization
2459 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2460 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002461 * <p>Not all devices will support OIS; see
2462 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2463 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002464 * <p><b>Possible values:</b>
2465 * <ul>
2466 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2467 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2468 * </ul></p>
2469 * <p><b>Available values for this device:</b><br>
2470 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002471 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2472 * <p><b>Limited capability</b> -
2473 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2474 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002475 *
2476 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002477 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002478 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002479 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2480 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2481 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002482 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002483 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2484 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2485
2486 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002487 * <p>Current lens status.</p>
2488 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2489 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2490 * they may take several frames to reach the requested values. This state indicates
2491 * the current status of the lens parameters.</p>
2492 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2493 * either because the parameters are all fixed, or because the lens has had enough
2494 * time to reach the most recently-requested values.
2495 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2496 * <ul>
2497 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2498 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2499 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2500 * which means the optical zoom is not supported.</li>
2501 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2502 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2503 * </ul>
2504 * <p>Then this state will always be STATIONARY.</p>
2505 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2506 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002507 * <p><b>Possible values:</b>
2508 * <ul>
2509 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2510 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2511 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002512 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2513 * <p><b>Limited capability</b> -
2514 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2515 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002516 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002517 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002518 * @see CaptureRequest#LENS_APERTURE
2519 * @see CaptureRequest#LENS_FILTER_DENSITY
2520 * @see CaptureRequest#LENS_FOCAL_LENGTH
2521 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2522 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2523 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2524 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2525 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002526 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002527 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002528 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002529 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002530 public static final Key<Integer> LENS_STATE =
2531 new Key<Integer>("android.lens.state", int.class);
2532
2533 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002534 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002535 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08002536 * excessive noise added by the capture process, especially in dark conditions.</p>
2537 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
2538 * YUV domain.</p>
2539 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
2540 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
2541 * This mode is optional, may not be support by all devices. The application should check
2542 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002543 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2544 * will be applied. HIGH_QUALITY mode indicates that the camera device
2545 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002546 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08002547 * slow down capture rate when applying noise filtering.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002548 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
2549 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
2550 * may adjust the noise reduction parameters for best image quality based on the
2551 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002552 * <p><b>Possible values:</b>
2553 * <ul>
2554 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2555 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2556 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08002557 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002558 * </ul></p>
2559 * <p><b>Available values for this device:</b><br>
2560 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002561 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2562 * <p><b>Full capability</b> -
2563 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2564 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002565 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002566 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002567 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08002568 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002569 * @see #NOISE_REDUCTION_MODE_OFF
2570 * @see #NOISE_REDUCTION_MODE_FAST
2571 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08002572 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002573 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002574 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002575 public static final Key<Integer> NOISE_REDUCTION_MODE =
2576 new Key<Integer>("android.noiseReduction.mode", int.class);
2577
2578 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002579 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002580 * final one for the capture, or only a partial that contains a
2581 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002582 * values.</p>
2583 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002584 * single capture may not overlap, except for this entry. The
2585 * FINAL buffers must retain FIFO ordering relative to the
2586 * requests that generate them, so the FINAL buffer for frame 3 must
2587 * always be sent to the framework after the FINAL buffer for frame 2, and
2588 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2589 * in any order relative to other frames, but all PARTIAL buffers for a given
2590 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002591 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002592 * <p><b>Range of valid values:</b><br>
2593 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002594 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002595 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002596 * @hide
2597 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002598 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002599 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2600 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2601
2602 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002603 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002604 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002605 * frameCount value).</p>
2606 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002607 * <p><b>Units</b>: count of frames</p>
2608 * <p><b>Range of valid values:</b><br>
2609 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002610 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002611 * @deprecated
2612 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002613 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002614 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002615 public static final Key<Integer> REQUEST_FRAME_COUNT =
2616 new Key<Integer>("android.request.frameCount", int.class);
2617
2618 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002619 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002620 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002621 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002622 * <p><b>Units</b>: arbitrary integer assigned by application</p>
2623 * <p><b>Range of valid values:</b><br>
2624 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002625 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002626 * @hide
2627 */
2628 public static final Key<Integer> REQUEST_ID =
2629 new Key<Integer>("android.request.id", int.class);
2630
2631 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002632 * <p>Specifies the number of pipeline stages the frame went
2633 * through from when it was exposed to when the final completed result
2634 * was available to the framework.</p>
2635 * <p>Depending on what settings are used in the request, and
2636 * what streams are configured, the data may undergo less processing,
2637 * and some pipeline stages skipped.</p>
2638 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002639 * <p><b>Range of valid values:</b><br>
2640 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002641 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002642 *
2643 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2644 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002645 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002646 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2647 new Key<Byte>("android.request.pipelineDepth", byte.class);
2648
2649 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002650 * <p>The desired region of the sensor to read out for this capture.</p>
2651 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002652 * <p>The crop region coordinate system is based off
2653 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2654 * top-left corner of the sensor active array.</p>
2655 * <p>Output streams use this rectangle to produce their output,
2656 * cropping to a smaller region if necessary to maintain the
2657 * stream's aspect ratio, then scaling the sensor input to
2658 * match the output's configured resolution.</p>
2659 * <p>The crop region is applied after the RAW to other color
2660 * space (e.g. YUV) conversion. Since raw streams
2661 * (e.g. RAW16) don't have the conversion stage, they are not
2662 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002663 * <p>For non-raw streams, any additional per-stream cropping will
2664 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002665 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002666 * ratio, then 4:3 streams will use the exact crop
2667 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002668 * (letterbox).</p>
2669 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002670 * outputs will crop horizontally (pillarbox), and 16:9
2671 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002672 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002673 * <p>The width and height of the crop region cannot
2674 * be set to be smaller than
2675 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2676 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2677 * <p>The camera device may adjust the crop region to account
2678 * for rounding and other hardware requirements; the final
2679 * crop region used will be included in the output capture
2680 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002681 * <p><b>Units</b>: Pixel coordinates relative to
2682 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002683 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002684 *
2685 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002686 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002687 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002688 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002689 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2690 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2691
2692 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002693 * <p>Duration each pixel is exposed to
2694 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002695 * <p>If the sensor can't expose this exact duration, it will shorten the
2696 * duration exposed to the nearest possible value (rather than expose longer).
2697 * The final exposure time used will be available in the output capture result.</p>
2698 * <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
2699 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2700 * <p><b>Units</b>: Nanoseconds</p>
2701 * <p><b>Range of valid values:</b><br>
2702 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002703 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2704 * <p><b>Full capability</b> -
2705 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2706 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2707 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002708 * @see CaptureRequest#CONTROL_AE_MODE
2709 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002710 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002711 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002712 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002713 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002714 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2715 new Key<Long>("android.sensor.exposureTime", long.class);
2716
2717 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002718 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002719 * start of next frame exposure.</p>
2720 * <p>The maximum frame rate that can be supported by a camera subsystem is
2721 * a function of many factors:</p>
2722 * <ul>
2723 * <li>Requested resolutions of output image streams</li>
2724 * <li>Availability of binning / skipping modes on the imager</li>
2725 * <li>The bandwidth of the imager interface</li>
2726 * <li>The bandwidth of the various ISP processing blocks</li>
2727 * </ul>
2728 * <p>Since these factors can vary greatly between different ISPs and
2729 * sensors, the camera abstraction tries to represent the bandwidth
2730 * restrictions with as simple a model as possible.</p>
2731 * <p>The model presented has the following characteristics:</p>
2732 * <ul>
2733 * <li>The image sensor is always configured to output the smallest
2734 * resolution possible given the application's requested output stream
2735 * sizes. The smallest resolution is defined as being at least as large
2736 * as the largest requested output stream size; the camera pipeline must
2737 * never digitally upsample sensor data when the crop region covers the
2738 * whole sensor. In general, this means that if only small output stream
2739 * resolutions are configured, the sensor can provide a higher frame
2740 * rate.</li>
2741 * <li>Since any request may use any or all the currently configured
2742 * output streams, the sensor and ISP must be configured to support
2743 * scaling a single capture to all the streams at the same time. This
2744 * means the camera pipeline must be ready to produce the largest
2745 * requested output size without any delay. Therefore, the overall
2746 * frame rate of a given configured stream set is governed only by the
2747 * largest requested stream resolution.</li>
2748 * <li>Using more than one output stream in a request does not affect the
2749 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002750 * <li>Certain format-streams may need to do additional background processing
2751 * before data is consumed/produced by that stream. These processors
2752 * can run concurrently to the rest of the camera pipeline, but
2753 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002754 * </ul>
2755 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002756 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2757 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002758 * These are used to determine the maximum frame rate / minimum frame
2759 * duration that is possible for a given stream configuration.</p>
2760 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002761 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002762 * device:</p>
2763 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002764 * <li>Let the set of currently configured input/output streams
2765 * be called <code>S</code>.</li>
2766 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002767 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2768 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002769 * its respective size/format). Let this set of frame durations be called
2770 * <code>F</code>.</li>
2771 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2772 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2773 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002774 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002775 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002776 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2777 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002778 * <code>F</code> determines the steady state frame rate that the application will
2779 * get if it uses <code>R</code> as a repeating request. Let this special kind
2780 * of request be called <code>Rsimple</code>.</p>
2781 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2782 * by a single capture of a new request <code>Rstall</code> (which has at least
2783 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2784 * same minimum frame duration this will not cause a frame rate loss
2785 * if all buffers from the previous <code>Rstall</code> have already been
2786 * delivered.</p>
2787 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002788 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002789 * <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
2790 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2791 * <p><b>Units</b>: Nanoseconds</p>
2792 * <p><b>Range of valid values:</b><br>
2793 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
2794 * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
2795 * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002796 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2797 * <p><b>Full capability</b> -
2798 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2799 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002800 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002801 * @see CaptureRequest#CONTROL_AE_MODE
2802 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002803 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin9c595172014-05-12 13:56:20 -07002804 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002805 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002806 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002807 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002808 public static final Key<Long> SENSOR_FRAME_DURATION =
2809 new Key<Long>("android.sensor.frameDuration", long.class);
2810
2811 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002812 * <p>The amount of gain applied to sensor data
2813 * before processing.</p>
2814 * <p>The sensitivity is the standard ISO sensitivity value,
2815 * as defined in ISO 12232:2006.</p>
2816 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2817 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2818 * is guaranteed to use only analog amplification for applying the gain.</p>
2819 * <p>If the camera device cannot apply the exact sensitivity
2820 * requested, it will reduce the gain to the nearest supported
2821 * value. The final sensitivity used will be available in the
2822 * output capture result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002823 * <p><b>Units</b>: ISO arithmetic units</p>
2824 * <p><b>Range of valid values:</b><br>
2825 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002826 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2827 * <p><b>Full capability</b> -
2828 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2829 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002830 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002831 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002832 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2833 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002834 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002835 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002836 public static final Key<Integer> SENSOR_SENSITIVITY =
2837 new Key<Integer>("android.sensor.sensitivity", int.class);
2838
2839 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002840 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07002841 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002842 * <p>The timestamps are also included in all image
2843 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07002844 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002845 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07002846 * the timestamps measure time since an unspecified starting point,
2847 * and are monotonically increasing. They can be compared with the
2848 * timestamps for other captures from the same camera device, but are
2849 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002850 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME,
Zhijun He45fa43a12014-06-13 18:29:37 -07002851 * the timestamps measure time in the same timebase as
2852 * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2853 * compared to other timestamps from other subsystems that are using
2854 * that base.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002855 * <p><b>Units</b>: Nanoseconds</p>
2856 * <p><b>Range of valid values:</b><br>
2857 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002858 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002859 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002860 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002861 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002862 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002863 public static final Key<Long> SENSOR_TIMESTAMP =
2864 new Key<Long>("android.sensor.timestamp", long.class);
2865
2866 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002867 * <p>The estimated camera neutral color in the native sensor colorspace at
2868 * the time of capture.</p>
2869 * <p>This value gives the neutral color point encoded as an RGB value in the
2870 * native sensor color space. The neutral color point indicates the
2871 * currently estimated white point of the scene illumination. It can be
2872 * used to interpolate between the provided color transforms when
2873 * processing raw sensor data.</p>
2874 * <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 -08002875 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2876 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002877 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08002878 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2879 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2880
2881 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002882 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002883 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002884 * corresponding to the sensor amplification (S) and sensor readout
2885 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002886 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002887 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
2888 * represented as an array of Pair&lt;Double, Double&gt;, where
2889 * the first member of the Pair at index n is the S coefficient and the
2890 * second member is the O coefficient for the nth color channel in the CFA.</p>
2891 * <p>These coefficients are used in a two parameter noise model to describe
2892 * the amount of noise present in the image for each CFA channel. The
2893 * noise model used here is:</p>
2894 * <p>N(x) = sqrt(Sx + O)</p>
2895 * <p>Where x represents the recorded signal of a CFA channel normalized to
2896 * the range [0, 1], and S and O are the noise model coeffiecients for
2897 * that channel.</p>
2898 * <p>A more detailed description of the noise model can be found in the
2899 * Adobe DNG specification for the NoiseProfile tag.</p>
2900 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2901 *
2902 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2903 */
2904 @PublicKey
2905 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
2906 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
2907
2908 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002909 * <p>The worst-case divergence between Bayer green channels.</p>
2910 * <p>This value is an estimate of the worst case split between the
2911 * Bayer green channels in the red and blue rows in the sensor color
2912 * filter array.</p>
2913 * <p>The green split is calculated as follows:</p>
2914 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002915 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2916 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2917 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2918 * chosen is implementation defined, and should be chosen to provide a
2919 * green split estimate that is both representative of the entire image
2920 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002921 * <li>The arithmetic mean of the green channels from the red
2922 * rows (mean_Gr) within W is computed.</li>
2923 * <li>The arithmetic mean of the green channels from the blue
2924 * rows (mean_Gb) within W is computed.</li>
2925 * <li>The maximum ratio R of the two means is computed as follows:
2926 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2927 * </ol>
2928 * <p>The ratio R is the green split divergence reported for this property,
2929 * which represents how much the green channels differ in the mosaic
2930 * pattern. This value is typically used to determine the treatment of
2931 * the green mosaic channels when demosaicing.</p>
2932 * <p>The green split value can be roughly interpreted as follows:</p>
2933 * <ul>
2934 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2935 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2936 * correction to avoid demosaic errors (3-20% divergence).</li>
2937 * <li>R &gt; 1.20 will require strong software correction to produce
2938 * a usuable image (&gt;20% divergence).</li>
2939 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002940 * <p><b>Range of valid values:</b><br></p>
2941 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002942 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2943 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002944 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08002945 public static final Key<Float> SENSOR_GREEN_SPLIT =
2946 new Key<Float>("android.sensor.greenSplit", float.class);
2947
2948 /**
Zhijun He379af012014-05-06 11:54:54 -07002949 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2950 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2951 * <p>Each color channel is treated as an unsigned 32-bit integer.
2952 * The camera device then uses the most significant X bits
2953 * that correspond to how many bits are in its Bayer raw sensor
2954 * output.</p>
2955 * <p>For example, a sensor with RAW10 Bayer output would use the
2956 * 10 most significant bits from each color channel.</p>
2957 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2958 *
2959 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2960 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002961 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002962 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2963 new Key<int[]>("android.sensor.testPatternData", int[].class);
2964
2965 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002966 * <p>When enabled, the sensor sends a test pattern instead of
2967 * doing a real exposure from the camera.</p>
2968 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002969 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002970 * work as normal.</p>
2971 * <p>For example, if manual flash is enabled, flash firing should still
2972 * occur (and that the test pattern remain unmodified, since the flash
2973 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002974 * <p>Defaults to OFF.</p>
2975 * <p><b>Possible values:</b>
2976 * <ul>
2977 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
2978 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
2979 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
2980 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
2981 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
2982 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
2983 * </ul></p>
2984 * <p><b>Available values for this device:</b><br>
2985 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002986 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002987 *
2988 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08002989 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2990 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2991 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2992 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2993 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2994 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2995 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002996 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002997 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2998 new Key<Integer>("android.sensor.testPatternMode", int.class);
2999
3000 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07003001 * <p>Duration between the start of first row exposure
3002 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003003 * <p>This is the exposure time skew between the first and last
3004 * row exposure start times. The first row and the last row are
3005 * the first and last rows inside of the
3006 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003007 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
3008 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003009 * <p><b>Units</b>: Nanoseconds</p>
3010 * <p><b>Range of valid values:</b><br>
3011 * &gt;= 0 and &lt;
3012 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003013 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3014 * <p><b>Limited capability</b> -
3015 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3016 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003017 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003018 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07003019 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3020 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003021 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07003022 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
3023 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
3024
3025 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08003026 * <p>Quality of lens shading correction applied
3027 * to the image data.</p>
3028 * <p>When set to OFF mode, no lens shading correction will be applied by the
3029 * camera device, and an identity lens shading map data will be provided
3030 * 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 -07003031 * shading map with size of <code>[ 4, 3 ]</code>,
3032 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
3033 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003034 * <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 -07003035 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3036 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3037 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3038 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3039 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08003040 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003041 * <p>When set to other modes, lens shading correction will be applied by the camera
3042 * device. Applications can request lens shading map data by setting
3043 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
3044 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
3045 * data will be the one applied by the camera device for this capture request.</p>
3046 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
3047 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
3048 * 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>
3049 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
3050 * to be converged before using the returned shading map data.</p>
3051 * <p><b>Possible values:</b>
3052 * <ul>
3053 * <li>{@link #SHADING_MODE_OFF OFF}</li>
3054 * <li>{@link #SHADING_MODE_FAST FAST}</li>
3055 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3056 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003057 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3058 * <p><b>Full capability</b> -
3059 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3060 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003061 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07003062 * @see CaptureRequest#CONTROL_AE_MODE
3063 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003064 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003065 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08003066 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3067 * @see #SHADING_MODE_OFF
3068 * @see #SHADING_MODE_FAST
3069 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08003070 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003071 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08003072 public static final Key<Integer> SHADING_MODE =
3073 new Key<Integer>("android.shading.mode", int.class);
3074
3075 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003076 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003077 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003078 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003079 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003080 * fields.</p>
3081 * <p><b>Possible values:</b>
3082 * <ul>
3083 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3084 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3085 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3086 * </ul></p>
3087 * <p><b>Available values for this device:</b><br>
3088 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3089 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003090 *
3091 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003092 * @see #STATISTICS_FACE_DETECT_MODE_OFF
3093 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3094 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3095 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003096 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003097 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3098 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3099
3100 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003101 * <p>List of unique IDs for detected faces.</p>
3102 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3103 * to the camera device. A face that leaves the field of view and later returns may be
3104 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003105 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3106 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003107 *
3108 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003109 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003110 */
3111 public static final Key<int[]> STATISTICS_FACE_IDS =
3112 new Key<int[]>("android.statistics.faceIds", int[].class);
3113
3114 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003115 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003116 * faces.</p>
3117 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3118 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003119 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3120 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003121 *
3122 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3123 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003124 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003125 */
3126 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3127 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3128
3129 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003130 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003131 * faces.</p>
3132 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3133 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003134 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3135 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003136 *
3137 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3138 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003139 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003140 */
3141 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3142 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3143
3144 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003145 * <p>List of the face confidence scores for
3146 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003147 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003148 * <p><b>Range of valid values:</b><br>
3149 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003150 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003151 *
3152 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003153 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003154 */
3155 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3156 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3157
3158 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003159 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003160 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003161 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003162 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003163 *
3164 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3165 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003166 @PublicKey
3167 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003168 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3169 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3170
3171 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003172 * <p>The shading map is a low-resolution floating-point map
3173 * that lists the coefficients used to correct for vignetting, for each
3174 * Bayer color channel.</p>
3175 * <p>The least shaded section of the image should have a gain factor
3176 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003177 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08003178 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003179 * <p>The shading map is for the entire active pixel array, and is not
3180 * affected by the crop region specified in the request. Each shading map
3181 * entry is the value of the shading compensation map over a specific
3182 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3183 * map, and an active pixel array size (W x H), shading map entry
3184 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3185 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3186 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3187 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3188 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003189 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003190 * <p>The shading map should have on the order of 30-40 rows and columns,
3191 * and must be smaller than 64x64.</p>
3192 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003193 * <pre><code>width,height = [ 4, 3 ]
3194 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003195 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003196 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3197 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3198 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3199 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3200 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003201 * </code></pre>
3202 * <p>The low-resolution scaling map images for each channel are
3203 * (displayed using nearest-neighbor interpolation):</p>
3204 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3205 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3206 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3207 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3208 * <p>As a visualization only, inverting the full-color map to recover an
3209 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3210 * <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 -07003211 * <p><b>Range of valid values:</b><br>
3212 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003213 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3214 * <p><b>Full capability</b> -
3215 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3216 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003217 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003218 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003219 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07003220 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003221 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003222 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3223 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3224
3225 /**
3226 * <p>The shading map is a low-resolution floating-point map
3227 * that lists the coefficients used to correct for vignetting, for each
3228 * Bayer color channel.</p>
3229 * <p>The least shaded section of the image should have a gain factor
3230 * of 1; all other sections should have gains above 1.</p>
3231 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
3232 * must take into account the colorCorrection settings.</p>
3233 * <p>The shading map is for the entire active pixel array, and is not
3234 * affected by the crop region specified in the request. Each shading map
3235 * entry is the value of the shading compensation map over a specific
3236 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3237 * map, and an active pixel array size (W x H), shading map entry
3238 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3239 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3240 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3241 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3242 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3243 * The shading map is stored in a fully interleaved format, and its size
3244 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
3245 * <p>The shading map should have on the order of 30-40 rows and columns,
3246 * and must be smaller than 64x64.</p>
3247 * <p>As an example, given a very small map defined as:</p>
3248 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3249 * android.statistics.lensShadingMap =
3250 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003251 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3252 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3253 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3254 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3255 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003256 * </code></pre>
3257 * <p>The low-resolution scaling map images for each channel are
3258 * (displayed using nearest-neighbor interpolation):</p>
3259 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3260 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3261 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3262 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3263 * <p>As a visualization only, inverting the full-color map to recover an
3264 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3265 * <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 -07003266 * <p><b>Range of valid values:</b><br>
3267 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003268 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3269 * <p><b>Full capability</b> -
3270 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3271 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003272 *
3273 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003274 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07003275 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003276 */
3277 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3278 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3279
3280 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003281 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003282 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003283 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003284 * since statistics processing on data from a new frame
3285 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003286 * applied to that frame.</p>
3287 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003288 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003289 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003290 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003291 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003292 *
3293 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003294 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003295 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003296 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003297 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003298 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3299 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3300
3301 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003302 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08003303 * calculated by the camera device's statistics units for the current
3304 * output frame.</p>
3305 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003306 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08003307 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003308 * are the best fit for the current output frame. This may
3309 * be different than the transform used for this frame, since
3310 * statistics processing on data from a new frame typically
3311 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003312 * that frame.</p>
3313 * <p>These estimates must be provided for all frames, even if
3314 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003315 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003316 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003317 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003318 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003319 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003320 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003321 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003322 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3323 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3324
3325 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08003326 * <p>The camera device estimated scene illumination lighting
3327 * frequency.</p>
3328 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3329 * that depends on the local utility power standards. This flicker must be
3330 * accounted for by auto-exposure routines to avoid artifacts in captured images.
3331 * The camera device uses this entry to tell the application what the scene
3332 * illuminant frequency is.</p>
3333 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003334 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3335 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3336 * antibanding, and the application can ensure it selects
3337 * exposure times that do not cause banding issues by looking
3338 * into this metadata field. See
3339 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3340 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003341 * <p><b>Possible values:</b>
3342 * <ul>
3343 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3344 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3345 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3346 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003347 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3348 * <p><b>Full capability</b> -
3349 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3350 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08003351 *
3352 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3353 * @see CaptureRequest#CONTROL_AE_MODE
3354 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003355 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003356 * @see #STATISTICS_SCENE_FLICKER_NONE
3357 * @see #STATISTICS_SCENE_FLICKER_50HZ
3358 * @see #STATISTICS_SCENE_FLICKER_60HZ
3359 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003360 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003361 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
3362 new Key<Integer>("android.statistics.sceneFlicker", int.class);
3363
3364 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003365 * <p>Operating mode for hot pixel map generation.</p>
3366 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
3367 * If set to <code>false</code>, no hot pixel map will be returned.</p>
3368 * <p><b>Range of valid values:</b><br>
3369 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003370 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003371 *
3372 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
3373 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
3374 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003375 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003376 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
3377 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
3378
3379 /**
3380 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
3381 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
3382 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
3383 * bottom-right of the pixel array, respectively. The width and
3384 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
3385 * This may include hot pixels that lie outside of the active array
3386 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003387 * <p><b>Range of valid values:</b><br></p>
3388 * <p>n &lt;= number of pixels on the sensor.
3389 * The <code>(x, y)</code> coordinates must be bounded by
3390 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003391 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003392 *
3393 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3394 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3395 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003396 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003397 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
3398 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003399
3400 /**
Zhijun He379af012014-05-06 11:54:54 -07003401 * <p>Whether the camera device will output the lens
3402 * shading map in output result metadata.</p>
3403 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003404 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07003405 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003406 * <p>ON is always supported on devices with the RAW capability.</p>
3407 * <p><b>Possible values:</b>
3408 * <ul>
3409 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3410 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3411 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003412 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3413 * <p><b>Full capability</b> -
3414 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3415 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3416 *
3417 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -07003418 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3419 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3420 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003421 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003422 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3423 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3424
3425 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003426 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08003427 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3428 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003429 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003430 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3431 * <p><b>Full capability</b> -
3432 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3433 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003434 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003435 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003436 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003437 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003438 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003439 public static final Key<float[]> TONEMAP_CURVE_BLUE =
3440 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003441
3442 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003443 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08003444 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3445 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003446 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003447 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3448 * <p><b>Full capability</b> -
3449 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3450 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003451 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003452 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003453 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003454 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003455 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003456 public static final Key<float[]> TONEMAP_CURVE_GREEN =
3457 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003458
3459 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003460 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08003461 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3462 * CONTRAST_CURVE.</p>
3463 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003464 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003465 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08003466 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003467 * <p>These are sorted in order of increasing <code>Pin</code>; it is
3468 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08003469 * define a complete mapping. For input values between control points,
3470 * the camera device must linearly interpolate between the control
3471 * points.</p>
3472 * <p>Each curve can have an independent number of points, and the number
3473 * of points can be less than max (that is, the request doesn't have to
3474 * always provide a curve with number of points equivalent to
3475 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3476 * <p>A few examples, and their corresponding graphical mappings; these
3477 * only specify the red channel and the precision is limited to 4
3478 * digits, for conciseness.</p>
3479 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003480 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003481 * </code></pre>
3482 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3483 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003484 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003485 * </code></pre>
3486 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3487 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003488 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003489 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
3490 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
3491 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
3492 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003493 * </code></pre>
3494 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3495 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003496 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003497 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
3498 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
3499 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
3500 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003501 * </code></pre>
3502 * <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 -07003503 * <p><b>Range of valid values:</b><br>
3504 * 0-1 on both input and output coordinates, normalized
3505 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003506 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3507 * <p><b>Full capability</b> -
3508 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3509 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003510 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003511 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08003512 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003513 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003514 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003515 */
3516 public static final Key<float[]> TONEMAP_CURVE_RED =
3517 new Key<float[]>("android.tonemap.curveRed", float[].class);
3518
3519 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003520 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
3521 * is CONTRAST_CURVE.</p>
3522 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
3523 * channels respectively. The following example uses the red channel as an
3524 * example. The same logic applies to green and blue channel.
3525 * Each channel's curve is defined by an array of control points:</p>
3526 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003527 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003528 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3529 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
3530 * guaranteed that input values 0.0 and 1.0 are included in the list to
3531 * define a complete mapping. For input values between control points,
3532 * the camera device must linearly interpolate between the control
3533 * points.</p>
3534 * <p>Each curve can have an independent number of points, and the number
3535 * of points can be less than max (that is, the request doesn't have to
3536 * always provide a curve with number of points equivalent to
3537 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3538 * <p>A few examples, and their corresponding graphical mappings; these
3539 * only specify the red channel and the precision is limited to 4
3540 * digits, for conciseness.</p>
3541 * <p>Linear mapping:</p>
3542 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
3543 * </code></pre>
3544 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3545 * <p>Invert mapping:</p>
3546 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
3547 * </code></pre>
3548 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3549 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
3550 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003551 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
3552 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
3553 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
3554 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003555 * </code></pre>
3556 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3557 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
3558 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003559 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
3560 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
3561 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
3562 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003563 * </code></pre>
3564 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003565 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3566 * <p><b>Full capability</b> -
3567 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3568 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003569 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003570 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003571 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
3572 * @see CaptureRequest#TONEMAP_MODE
3573 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003574 @PublicKey
3575 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003576 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
3577 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
3578
3579 /**
Igor Murashkine0060932014-01-17 17:24:11 -08003580 * <p>High-level global contrast/gamma/tonemapping control.</p>
3581 * <p>When switching to an application-defined contrast curve by setting
3582 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
3583 * per-channel with a set of <code>(in, out)</code> points that specify the
3584 * mapping from input high-bit-depth pixel value to the output
3585 * low-bit-depth value. Since the actual pixel ranges of both input
3586 * and output may change depending on the camera pipeline, the values
3587 * are specified by normalized floating-point numbers.</p>
3588 * <p>More-complex color mapping operations such as 3D color look-up
3589 * tables, selective chroma enhancement, or other non-linear color
3590 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3591 * CONTRAST_CURVE.</p>
3592 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003593 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08003594 * These values are always available, and as close as possible to the
3595 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07003596 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08003597 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
3598 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003599 * <p><b>Possible values:</b>
3600 * <ul>
3601 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
3602 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
3603 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3604 * </ul></p>
3605 * <p><b>Available values for this device:</b><br>
3606 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003607 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3608 * <p><b>Full capability</b> -
3609 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3610 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003611 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003612 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003613 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003614 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08003615 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003616 * @see #TONEMAP_MODE_CONTRAST_CURVE
3617 * @see #TONEMAP_MODE_FAST
3618 * @see #TONEMAP_MODE_HIGH_QUALITY
3619 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003620 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003621 public static final Key<Integer> TONEMAP_MODE =
3622 new Key<Integer>("android.tonemap.mode", int.class);
3623
3624 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003625 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003626 * that the camera is powered on and may be streaming images back to the
3627 * Application Processor. In certain rare circumstances, the OS may
3628 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003629 * any untrusted applications.</p>
3630 * <p>In particular, the LED <em>must</em> always be on when the data could be
3631 * transmitted off the device. The LED <em>should</em> always be on whenever
3632 * data is stored locally on the device.</p>
3633 * <p>The LED <em>may</em> be off if a trusted application is using the data that
3634 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003635 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003636 * @hide
3637 */
3638 public static final Key<Boolean> LED_TRANSMIT =
3639 new Key<Boolean>("android.led.transmit", boolean.class);
3640
3641 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003642 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003643 * to its current values, or is free to vary.</p>
3644 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003645 * 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 -08003646 * a change in other capture settings forced the camera device to
3647 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003648 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3649 * <p><b>Full capability</b> -
3650 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3651 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003652 *
3653 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003654 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003655 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003656 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003657 public static final Key<Boolean> BLACK_LEVEL_LOCK =
3658 new Key<Boolean>("android.blackLevel.lock", boolean.class);
3659
Igor Murashkin3865a842014-01-17 18:18:39 -08003660 /**
3661 * <p>The frame number corresponding to the last request
3662 * with which the output result (metadata + buffers) has been fully
3663 * synchronized.</p>
3664 * <p>When a request is submitted to the camera device, there is usually a
3665 * delay of several frames before the controls get applied. A camera
3666 * device may either choose to account for this delay by implementing a
3667 * pipeline and carefully submit well-timed atomic control updates, or
3668 * it may start streaming control changes that span over several frame
3669 * boundaries.</p>
3670 * <p>In the latter case, whenever a request's settings change relative to
3671 * the previous submitted request, the full set of changes may take
3672 * multiple frame durations to fully take effect. Some settings may
3673 * take effect sooner (in less frame durations) than others.</p>
3674 * <p>While a set of control changes are being propagated, this value
3675 * will be CONVERGING.</p>
3676 * <p>Once it is fully known that a set of control changes have been
3677 * finished propagating, and the resulting updated control settings
3678 * have been read back by the camera device, this value will be set
3679 * to a non-negative frame number (corresponding to the request to
3680 * which the results have synchronized to).</p>
3681 * <p>Older camera device implementations may not have a way to detect
3682 * when all camera controls have been applied, and will always set this
3683 * value to UNKNOWN.</p>
3684 * <p>FULL capability devices will always have this value set to the
3685 * frame number of the request corresponding to this result.</p>
3686 * <p><em>Further details</em>:</p>
3687 * <ul>
3688 * <li>Whenever a request differs from the last request, any future
3689 * results not yet returned may have this value set to CONVERGING (this
3690 * could include any in-progress captures not yet returned by the camera
3691 * device, for more details see pipeline considerations below).</li>
3692 * <li>Submitting a series of multiple requests that differ from the
3693 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
3694 * moves the new synchronization frame to the last non-repeating
3695 * request (using the smallest frame number from the contiguous list of
3696 * repeating requests).</li>
3697 * <li>Submitting the same request repeatedly will not change this value
3698 * to CONVERGING, if it was already a non-negative value.</li>
3699 * <li>When this value changes to non-negative, that means that all of the
3700 * metadata controls from the request have been applied, all of the
3701 * metadata controls from the camera device have been read to the
3702 * updated values (into the result), and all of the graphics buffers
3703 * corresponding to this result are also synchronized to the request.</li>
3704 * </ul>
3705 * <p><em>Pipeline considerations</em>:</p>
3706 * <p>Submitting a request with updated controls relative to the previously
3707 * submitted requests may also invalidate the synchronization state
3708 * of all the results corresponding to currently in-flight requests.</p>
3709 * <p>In other words, results for this current request and up to
3710 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
3711 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003712 * <p><b>Possible values:</b>
3713 * <ul>
3714 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
3715 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
3716 * </ul></p>
3717 * <p><b>Available values for this device:</b><br>
3718 * Either a non-negative value corresponding to a
3719 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003720 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003721 *
3722 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3723 * @see #SYNC_FRAME_NUMBER_CONVERGING
3724 * @see #SYNC_FRAME_NUMBER_UNKNOWN
3725 * @hide
3726 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07003727 public static final Key<Long> SYNC_FRAME_NUMBER =
3728 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08003729
Zhijun He0e99c222015-01-29 15:26:05 -08003730 /**
3731 * <p>The amount of exposure time increase factor applied to the original output
3732 * frame by the application processing before sending for reprocessing.</p>
3733 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
3734 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
3735 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
3736 * output frames to effectively reduce the noise to the same level as a frame that was
3737 * captured with longer exposure time. To be more specific, assuming the original captured
3738 * images were captured with a sensitivity of S and an exposure time of T, the model in
3739 * the camera device is that the amount of noise in the image would be approximately what
3740 * would be expected if the original capture parameters had been a sensitivity of
3741 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
3742 * than S and T respectively. If the captured images were processed by the application
3743 * before being sent for reprocessing, then the application may have used image processing
3744 * algorithms and/or multi-frame image fusion to reduce the noise in the
3745 * application-processed images (input images). By using the effectiveExposureFactor
3746 * control, the application can communicate to the camera device the actual noise level
3747 * improvement in the application-processed image. With this information, the camera
3748 * device can select appropriate noise reduction and edge enhancement parameters to avoid
3749 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
3750 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
3751 * <p>For example, for multi-frame image fusion use case, the application may fuse
3752 * multiple output frames together to a final frame for reprocessing. When N image are
3753 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
3754 * square root of N (based on a simple photon shot noise model). The camera device will
3755 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
3756 * produce the best quality images.</p>
3757 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
3758 * buffer in a way that affects its effective exposure time.</p>
3759 * <p>This control is only effective for YUV reprocessing capture request. For noise
3760 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
3761 * Similarly, for edge enhancement reprocessing, it is only effective when
3762 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
3763 * <p><b>Units</b>: Relative exposure time increase factor.</p>
3764 * <p><b>Range of valid values:</b><br>
3765 * &gt;= 1.0</p>
3766 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3767 *
3768 * @see CaptureRequest#EDGE_MODE
3769 * @see CaptureRequest#NOISE_REDUCTION_MODE
3770 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3771 */
3772 @PublicKey
3773 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
3774 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
3775
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003776 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3777 * End generated code
3778 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07003779
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003780
3781
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08003782}