blob: 20a04f01a6387ae0d91706e759630d2f39488bdd [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 Murashkin6c76f582014-07-15 17:19:49 -070020import android.hardware.camera2.impl.PublicKey;
21import android.hardware.camera2.impl.SyntheticKey;
Igor Murashkind6d65152014-05-19 16:31:02 -070022import android.hardware.camera2.utils.TypeReference;
23import android.util.Log;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070024import android.util.Rational;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080025
Igor Murashkind6d65152014-05-19 16:31:02 -070026import java.util.List;
27
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080028/**
Igor Murashkindb075af2014-05-21 10:07:08 -070029 * <p>The subset of the results of a single image capture from the image sensor.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080030 *
Igor Murashkindb075af2014-05-21 10:07:08 -070031 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080032 * flash), the processing pipeline, the control algorithms, and the output
33 * buffers.</p>
34 *
35 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
36 * {@link CaptureRequest}. All properties listed for capture requests can also
37 * be queried on the capture result, to determine the final values used for
38 * capture. The result also includes additional metadata about the state of the
39 * camera device during the capture.</p>
40 *
Igor Murashkindb075af2014-05-21 10:07:08 -070041 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
42 * are necessarily available. Some results are {@link CaptureResult partial} and will
43 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
44 * every key available that was enabled by the request.</p>
45 *
46 * <p>{@link CaptureResult} objects are immutable.</p>
Ruben Brunkf967a542014-04-28 16:31:11 -070047 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080048 */
Igor Murashkindb075af2014-05-21 10:07:08 -070049public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
Igor Murashkind6d65152014-05-19 16:31:02 -070050
51 private static final String TAG = "CaptureResult";
52 private static final boolean VERBOSE = false;
53
54 /**
55 * A {@code Key} is used to do capture result field lookups with
56 * {@link CaptureResult#get}.
57 *
58 * <p>For example, to get the timestamp corresponding to the exposure of the first row:
59 * <code><pre>
60 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
61 * </pre></code>
62 * </p>
63 *
64 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
65 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
66 *
67 * @see CaptureResult#get
68 * @see CameraCharacteristics#getAvailableCaptureResultKeys
69 */
70 public final static class Key<T> {
71 private final CameraMetadataNative.Key<T> mKey;
72
73 /**
74 * Visible for testing and vendor extensions only.
75 *
76 * @hide
77 */
78 public Key(String name, Class<T> type) {
79 mKey = new CameraMetadataNative.Key<T>(name, type);
80 }
81
82 /**
83 * Visible for testing and vendor extensions only.
84 *
85 * @hide
86 */
87 public Key(String name, TypeReference<T> typeReference) {
88 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
89 }
90
91 /**
92 * Return a camelCase, period separated name formatted like:
93 * {@code "root.section[.subsections].name"}.
94 *
95 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
96 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
97 *
98 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
99 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
100 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
101 *
102 * @return String representation of the key name
103 */
104 public String getName() {
105 return mKey.getName();
106 }
107
108 /**
109 * {@inheritDoc}
110 */
111 @Override
112 public final int hashCode() {
113 return mKey.hashCode();
114 }
115
116 /**
117 * {@inheritDoc}
118 */
119 @SuppressWarnings("unchecked")
120 @Override
121 public final boolean equals(Object o) {
122 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
123 }
124
125 /**
126 * Visible for CameraMetadataNative implementation only; do not use.
127 *
128 * TODO: Make this private or remove it altogether.
129 *
130 * @hide
131 */
132 public CameraMetadataNative.Key<T> getNativeKey() {
133 return mKey;
134 }
135
136 @SuppressWarnings({ "unchecked" })
137 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
138 mKey = (CameraMetadataNative.Key<T>) nativeKey;
139 }
140 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700141
142 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700143 private final CaptureRequest mRequest;
144 private final int mSequenceId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700145
Igor Murashkin70725502013-06-25 20:27:06 +0000146 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700147 * Takes ownership of the passed-in properties object
Igor Murashkin70725502013-06-25 20:27:06 +0000148 * @hide
149 */
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700150 public CaptureResult(CameraMetadataNative results, CaptureRequest parent, int sequenceId) {
151 if (results == null) {
152 throw new IllegalArgumentException("results was null");
153 }
154
155 if (parent == null) {
156 throw new IllegalArgumentException("parent was null");
157 }
158
Igor Murashkind6d65152014-05-19 16:31:02 -0700159 mResults = CameraMetadataNative.move(results);
160 if (mResults.isEmpty()) {
161 throw new AssertionError("Results must not be empty");
162 }
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700163 mRequest = parent;
164 mSequenceId = sequenceId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700165 }
166
Ruben Brunkf967a542014-04-28 16:31:11 -0700167 /**
168 * Returns a copy of the underlying {@link CameraMetadataNative}.
169 * @hide
170 */
171 public CameraMetadataNative getNativeCopy() {
172 return new CameraMetadataNative(mResults);
173 }
174
Igor Murashkind6d65152014-05-19 16:31:02 -0700175 /**
176 * Creates a request-less result.
177 *
178 * <p><strong>For testing only.</strong></p>
179 * @hide
180 */
181 public CaptureResult(CameraMetadataNative results, int sequenceId) {
182 if (results == null) {
183 throw new IllegalArgumentException("results was null");
184 }
185
186 mResults = CameraMetadataNative.move(results);
187 if (mResults.isEmpty()) {
188 throw new AssertionError("Results must not be empty");
189 }
190
191 mRequest = null;
192 mSequenceId = sequenceId;
193 }
194
195 /**
196 * Get a capture result field value.
197 *
198 * <p>The field definitions can be found in {@link CaptureResult}.</p>
199 *
200 * <p>Querying the value for the same key more than once will return a value
201 * which is equal to the previous queried value.</p>
202 *
203 * @throws IllegalArgumentException if the key was not valid
204 *
205 * @param key The result field to read.
206 * @return The value of that key, or {@code null} if the field is not set.
207 */
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700208 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700209 T value = mResults.get(key);
210 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
211 return value;
212 }
213
214 /**
215 * {@inheritDoc}
216 * @hide
217 */
218 @SuppressWarnings("unchecked")
219 @Override
220 protected <T> T getProtected(Key<?> key) {
221 return (T) mResults.get(key);
222 }
223
224 /**
225 * {@inheritDoc}
226 * @hide
227 */
228 @SuppressWarnings("unchecked")
229 @Override
230 protected Class<Key<?>> getKeyClass() {
231 Object thisClass = Key.class;
232 return (Class<Key<?>>)thisClass;
233 }
234
235 /**
236 * Dumps the native metadata contents to logcat.
237 *
238 * <p>Visibility for testing/debugging only. The results will not
239 * include any synthesized keys, as they are invisible to the native layer.</p>
240 *
241 * @hide
242 */
243 public void dumpToLog() {
244 mResults.dumpToLog();
245 }
246
247 /**
248 * {@inheritDoc}
249 */
250 @Override
251 public List<Key<?>> getKeys() {
252 // Force the javadoc for this function to show up on the CaptureResult page
253 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800254 }
255
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700256 /**
257 * Get the request associated with this result.
258 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700259 * <p>Whenever a request has been fully or partially captured, with
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700260 * {@link CameraCaptureSession.CaptureListener#onCaptureCompleted} or
261 * {@link CameraCaptureSession.CaptureListener#onCaptureProgressed}, the {@code result}'s
Igor Murashkindb075af2014-05-21 10:07:08 -0700262 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700263 * </p>
264 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700265 * <p>For example,
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700266 * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() {
267 * {@literal @}Override
268 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
269 * assert(myResult.getRequest.equals(myRequest) == true);
270 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700271 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700272 * </code></pre>
273 * </p>
274 *
275 * @return The request associated with this result. Never {@code null}.
276 */
277 public CaptureRequest getRequest() {
278 return mRequest;
279 }
280
281 /**
282 * Get the frame number associated with this result.
283 *
284 * <p>Whenever a request has been processed, regardless of failure or success,
285 * it gets a unique frame number assigned to its future result/failure.</p>
286 *
287 * <p>This value monotonically increments, starting with 0,
288 * for every new result or failure; and the scope is the lifetime of the
289 * {@link CameraDevice}.</p>
290 *
291 * @return int frame number
292 */
293 public int getFrameNumber() {
Igor Murashkind6d65152014-05-19 16:31:02 -0700294 // TODO: @hide REQUEST_FRAME_COUNT
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700295 return get(REQUEST_FRAME_COUNT);
296 }
297
298 /**
299 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700300 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700301 *
302 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
303 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
304 *
305 * @return int The ID for the sequence of requests that this capture result is a part of
306 *
307 * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted
Igor Murashkindb075af2014-05-21 10:07:08 -0700308 * @see CameraDevice.CaptureListener#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700309 */
310 public int getSequenceId() {
311 return mSequenceId;
312 }
313
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700314 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
315 * The key entries below this point are generated from metadata
316 * definitions in /system/media/camera/docs. Do not modify by hand or
317 * modify the comment blocks at the start or end.
318 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
319
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800320
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700321 /**
Zhijun He379af012014-05-06 11:54:54 -0700322 * <p>The mode control selects how the image data is converted from the
323 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700324 * <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 -0700325 * control is overridden by the AWB routine. When AWB is disabled, the
326 * application controls how the color mapping is performed.</p>
327 * <p>We define the expected processing pipeline below. For consistency
328 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
329 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
330 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
331 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
332 * camera device (in the results) and be roughly correct.</p>
333 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
334 * FAST or HIGH_QUALITY will yield a picture with the same white point
335 * as what was produced by the camera device in the earlier frame.</p>
336 * <p>The expected processing pipeline is as follows:</p>
337 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
338 * <p>The white balance is encoded by two values, a 4-channel white-balance
339 * gain vector (applied in the Bayer domain), and a 3x3 color transform
340 * matrix (applied after demosaic).</p>
341 * <p>The 4-channel white-balance gains are defined as:</p>
342 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
343 * </code></pre>
344 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
345 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
346 * These may be identical for a given camera device implementation; if
347 * the camera device does not support a separate gain for even/odd green
348 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
349 * <code>G_even</code> in the output result metadata.</p>
350 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
351 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
352 * </code></pre>
353 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
354 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
355 * <p>with colors as follows:</p>
356 * <pre><code>r' = I0r + I1g + I2b
357 * g' = I3r + I4g + I5b
358 * b' = I6r + I7g + I8b
359 * </code></pre>
360 * <p>Both the input and output value ranges must match. Overflow/underflow
361 * values are clipped to fit within the range.</p>
362 *
363 * @see CaptureRequest#COLOR_CORRECTION_GAINS
364 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
365 * @see CaptureRequest#CONTROL_AWB_MODE
366 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
367 * @see #COLOR_CORRECTION_MODE_FAST
368 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
369 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700370 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700371 public static final Key<Integer> COLOR_CORRECTION_MODE =
372 new Key<Integer>("android.colorCorrection.mode", int.class);
373
374 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800375 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700376 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800377 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800378 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700379 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800380 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800381 * <p>In the latter case, the camera device may round the matrix to account
382 * for precision issues; the final rounded matrix should be reported back
383 * in this matrix result metadata. The transform should keep the magnitude
384 * of the output color values within <code>[0, 1.0]</code> (assuming input color
385 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800386 *
387 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700388 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700389 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700390 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
391 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700392
393 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800394 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800395 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700396 * <p>These per-channel gains are either set by the camera device
397 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
398 * TRANSFORM_MATRIX, or directly by the application in the
399 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
400 * TRANSFORM_MATRIX.</p>
401 * <p>The gains in the result metadata are the gains actually
402 * applied by the camera device to the current frame.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800403 *
404 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700405 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700406 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700407 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
408 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700409
410 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700411 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
412 * <p>This must be set to a valid mode from
413 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_CORRECTION_MODES android.colorCorrection.availableAberrationCorrectionModes}.</p>
414 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
415 * can not focus on the same point after exiting from the lens. This metadata defines
416 * the high level control of chromatic aberration correction algorithm, which aims to
417 * minimize the chromatic artifacts that may occur along the object boundaries in an
418 * image.</p>
419 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
420 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
421 * use the highest-quality aberration correction algorithms, even if it slows down
422 * capture rate. FAST means the camera device will not slow down capture rate when
423 * applying aberration correction.</p>
424 *
425 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_CORRECTION_MODES
426 * @see #COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_OFF
427 * @see #COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_FAST
428 * @see #COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_HIGH_QUALITY
429 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700430 @PublicKey
Zhijun Hea05e59d2014-07-08 18:27:47 -0700431 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_CORRECTION_MODE =
432 new Key<Integer>("android.colorCorrection.aberrationCorrectionMode", int.class);
433
434 /**
Zhijun He379af012014-05-06 11:54:54 -0700435 * <p>The desired setting for the camera device's auto-exposure
436 * algorithm's antibanding compensation.</p>
437 * <p>Some kinds of lighting fixtures, such as some fluorescent
438 * lights, flicker at the rate of the power supply frequency
439 * (60Hz or 50Hz, depending on country). While this is
440 * typically not noticeable to a person, it can be visible to
441 * a camera device. If a camera sets its exposure time to the
442 * wrong value, the flicker may become visible in the
443 * viewfinder as flicker or in a final captured image, as a
444 * set of variable-brightness bands across the image.</p>
445 * <p>Therefore, the auto-exposure routines of camera devices
446 * include antibanding routines that ensure that the chosen
447 * exposure value will not cause such banding. The choice of
448 * exposure time depends on the rate of flicker, which the
449 * camera device can detect automatically, or the expected
450 * rate can be selected by the application using this
451 * control.</p>
452 * <p>A given camera device may not support all of the possible
453 * options for the antibanding mode. The
454 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
455 * the available modes for a given camera device.</p>
456 * <p>The default mode is AUTO, which must be supported by all
457 * camera devices.</p>
458 * <p>If manual exposure control is enabled (by setting
459 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
460 * then this setting has no effect, and the application must
461 * ensure it selects exposure times that do not cause banding
462 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
463 * the application in this.</p>
464 *
465 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
466 * @see CaptureRequest#CONTROL_AE_MODE
467 * @see CaptureRequest#CONTROL_MODE
468 * @see CaptureResult#STATISTICS_SCENE_FLICKER
469 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
470 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
471 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
472 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
473 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700474 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700475 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
476 new Key<Integer>("android.control.aeAntibandingMode", int.class);
477
478 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700479 * <p>Adjustment to auto-exposure (AE) target image
480 * brightness.</p>
481 * <p>The adjustment is measured as a count of steps, with the
482 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
483 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
484 * <p>For example, if the exposure value (EV) step is 0.333, '6'
485 * will mean an exposure compensation of +2 EV; -3 will mean an
486 * exposure compensation of -1 EV. One EV represents a doubling
487 * of image brightness. Note that this control will only be
488 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
489 * 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 -0700490 * <p>In the event of exposure compensation value being changed, camera device
491 * may take several frames to reach the newly requested exposure target.
492 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
493 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
494 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
495 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
496 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700497 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
498 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700499 * @see CaptureRequest#CONTROL_AE_LOCK
500 * @see CaptureRequest#CONTROL_AE_MODE
501 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700502 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700503 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700504 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
505 new Key<Integer>("android.control.aeExposureCompensation", int.class);
506
507 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700508 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700509 * calculated values.</p>
510 * <p>Note that even when AE is locked, the flash may be
511 * fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / ON_ALWAYS_FLASH /
512 * ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700513 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
514 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700515 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
516 * when AE is already locked, the camera device will not change the exposure time
517 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
518 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
519 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
520 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
521 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
522 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700523 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700524 * @see CaptureRequest#CONTROL_AE_MODE
525 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
526 * @see CaptureResult#CONTROL_AE_STATE
527 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
528 * @see CaptureRequest#SENSOR_SENSITIVITY
529 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700530 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700531 public static final Key<Boolean> CONTROL_AE_LOCK =
532 new Key<Boolean>("android.control.aeLock", boolean.class);
533
534 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800535 * <p>The desired mode for the camera device's
536 * auto-exposure routine.</p>
537 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
538 * AUTO.</p>
539 * <p>When set to any of the ON modes, the camera device's
540 * auto-exposure routine is enabled, overriding the
541 * application's selected exposure time, sensor sensitivity,
542 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
543 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
544 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
545 * is selected, the camera device's flash unit controls are
546 * also overridden.</p>
547 * <p>The FLASH modes are only available if the camera device
548 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
549 * <p>If flash TORCH mode is desired, this field must be set to
550 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
551 * <p>When set to any of the ON modes, the values chosen by the
552 * camera device auto-exposure routine for the overridden
553 * fields for a given capture will be available in its
554 * CaptureResult.</p>
555 *
Zhijun He5f2a47f2014-01-16 15:44:41 -0800556 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800557 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
558 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800559 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
560 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800561 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800562 * @see #CONTROL_AE_MODE_OFF
563 * @see #CONTROL_AE_MODE_ON
564 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
565 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
566 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
567 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700568 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800569 public static final Key<Integer> CONTROL_AE_MODE =
570 new Key<Integer>("android.control.aeMode", int.class);
571
572 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800573 * <p>List of areas to use for
Ruben Brunkf59521d2014-02-03 17:14:33 -0800574 * metering.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800575 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700576 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800577 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
578 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700579 * bottom-right pixel in the active pixel array.</p>
580 * <p>The weight must range from 0 to 1000, and represents a weight
581 * for every pixel in the area. This means that a large metering area
582 * with the same weight as a smaller area will have more effect in
583 * the metering result. Metering areas can partially overlap and the
584 * camera device will add the weights in the overlap region.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800585 * <p>If all regions have 0 weight, then no specific metering area
Zhijun Hecc28a412014-02-24 15:11:23 -0800586 * needs to be used by the camera device. If the metering region is
Zhijun He14986152014-05-22 21:17:37 -0700587 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
588 * the camera device will ignore the sections outside the region and output the
589 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800590 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800591 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800592 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700593 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700594 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700595 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
596 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700597
598 /**
Zhijun He379af012014-05-06 11:54:54 -0700599 * <p>Range over which fps can be adjusted to
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700600 * maintain exposure.</p>
601 * <p>Only constrains auto-exposure (AE) algorithm, not
602 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p>
Zhijun He379af012014-05-06 11:54:54 -0700603 *
604 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
605 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700606 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700607 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
608 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700609
610 /**
611 * <p>Whether the camera device will trigger a precapture
612 * metering sequence when it processes this request.</p>
613 * <p>This entry is normally set to IDLE, or is not
614 * included at all in the request settings. When included and
615 * set to START, the camera device will trigger the autoexposure
616 * precapture metering sequence.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700617 * <p>The precapture sequence should triggered before starting a
618 * high-quality still capture for final metering decisions to
619 * be made, and for firing pre-capture flash pulses to estimate
620 * scene brightness and required final capture flash power, when
621 * the flash is enabled.</p>
622 * <p>Normally, this entry should be set to START for only a
623 * single request, and the application should wait until the
624 * sequence completes before starting a new one.</p>
625 * <p>The exact effect of auto-exposure (AE) precapture trigger
626 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700627 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
628 * details.</p>
Zhijun He379af012014-05-06 11:54:54 -0700629 *
630 * @see CaptureResult#CONTROL_AE_STATE
631 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
632 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
633 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700634 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700635 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
636 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
637
638 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700639 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800640 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
641 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
642 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
643 * the algorithm states to INACTIVE.</p>
644 * <p>The camera device can do several state transitions between two results, if it is
645 * allowed by the state transition table. For example: INACTIVE may never actually be
646 * seen in a result.</p>
647 * <p>The state in the result is the state for this image (in sync with this image): if
648 * AE state becomes CONVERGED, then the image data associated with this result should
649 * be good to use.</p>
650 * <p>Below are state transition tables for different AE modes.</p>
651 * <table>
652 * <thead>
653 * <tr>
654 * <th align="center">State</th>
655 * <th align="center">Transition Cause</th>
656 * <th align="center">New State</th>
657 * <th align="center">Notes</th>
658 * </tr>
659 * </thead>
660 * <tbody>
661 * <tr>
662 * <td align="center">INACTIVE</td>
663 * <td align="center"></td>
664 * <td align="center">INACTIVE</td>
665 * <td align="center">Camera device auto exposure algorithm is disabled</td>
666 * </tr>
667 * </tbody>
668 * </table>
669 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
670 * <table>
671 * <thead>
672 * <tr>
673 * <th align="center">State</th>
674 * <th align="center">Transition Cause</th>
675 * <th align="center">New State</th>
676 * <th align="center">Notes</th>
677 * </tr>
678 * </thead>
679 * <tbody>
680 * <tr>
681 * <td align="center">INACTIVE</td>
682 * <td align="center">Camera device initiates AE scan</td>
683 * <td align="center">SEARCHING</td>
684 * <td align="center">Values changing</td>
685 * </tr>
686 * <tr>
687 * <td align="center">INACTIVE</td>
688 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
689 * <td align="center">LOCKED</td>
690 * <td align="center">Values locked</td>
691 * </tr>
692 * <tr>
693 * <td align="center">SEARCHING</td>
694 * <td align="center">Camera device finishes AE scan</td>
695 * <td align="center">CONVERGED</td>
696 * <td align="center">Good values, not changing</td>
697 * </tr>
698 * <tr>
699 * <td align="center">SEARCHING</td>
700 * <td align="center">Camera device finishes AE scan</td>
701 * <td align="center">FLASH_REQUIRED</td>
702 * <td align="center">Converged but too dark w/o flash</td>
703 * </tr>
704 * <tr>
705 * <td align="center">SEARCHING</td>
706 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
707 * <td align="center">LOCKED</td>
708 * <td align="center">Values locked</td>
709 * </tr>
710 * <tr>
711 * <td align="center">CONVERGED</td>
712 * <td align="center">Camera device initiates AE scan</td>
713 * <td align="center">SEARCHING</td>
714 * <td align="center">Values changing</td>
715 * </tr>
716 * <tr>
717 * <td align="center">CONVERGED</td>
718 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
719 * <td align="center">LOCKED</td>
720 * <td align="center">Values locked</td>
721 * </tr>
722 * <tr>
723 * <td align="center">FLASH_REQUIRED</td>
724 * <td align="center">Camera device initiates AE scan</td>
725 * <td align="center">SEARCHING</td>
726 * <td align="center">Values changing</td>
727 * </tr>
728 * <tr>
729 * <td align="center">FLASH_REQUIRED</td>
730 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
731 * <td align="center">LOCKED</td>
732 * <td align="center">Values locked</td>
733 * </tr>
734 * <tr>
735 * <td align="center">LOCKED</td>
736 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
737 * <td align="center">SEARCHING</td>
738 * <td align="center">Values not good after unlock</td>
739 * </tr>
740 * <tr>
741 * <td align="center">LOCKED</td>
742 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
743 * <td align="center">CONVERGED</td>
744 * <td align="center">Values good after unlock</td>
745 * </tr>
746 * <tr>
747 * <td align="center">LOCKED</td>
748 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
749 * <td align="center">FLASH_REQUIRED</td>
750 * <td align="center">Exposure good, but too dark</td>
751 * </tr>
752 * <tr>
753 * <td align="center">PRECAPTURE</td>
754 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
755 * <td align="center">CONVERGED</td>
756 * <td align="center">Ready for high-quality capture</td>
757 * </tr>
758 * <tr>
759 * <td align="center">PRECAPTURE</td>
760 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
761 * <td align="center">LOCKED</td>
762 * <td align="center">Ready for high-quality capture</td>
763 * </tr>
764 * <tr>
765 * <td align="center">Any state</td>
766 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
767 * <td align="center">PRECAPTURE</td>
768 * <td align="center">Start AE precapture metering sequence</td>
769 * </tr>
770 * </tbody>
771 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800772 * <p>For the above table, the camera device may skip reporting any state changes that happen
773 * without application intervention (i.e. mode switch, trigger, locking). Any state that
774 * can be skipped in that manner is called a transient state.</p>
775 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
776 * listed in above table, it is also legal for the camera device to skip one or more
777 * transient states between two results. See below table for examples:</p>
778 * <table>
779 * <thead>
780 * <tr>
781 * <th align="center">State</th>
782 * <th align="center">Transition Cause</th>
783 * <th align="center">New State</th>
784 * <th align="center">Notes</th>
785 * </tr>
786 * </thead>
787 * <tbody>
788 * <tr>
789 * <td align="center">INACTIVE</td>
790 * <td align="center">Camera device finished AE scan</td>
791 * <td align="center">CONVERGED</td>
792 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
793 * </tr>
794 * <tr>
795 * <td align="center">Any state</td>
796 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
797 * <td align="center">FLASH_REQUIRED</td>
798 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
799 * </tr>
800 * <tr>
801 * <td align="center">Any state</td>
802 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
803 * <td align="center">CONVERGED</td>
804 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
805 * </tr>
806 * <tr>
807 * <td align="center">CONVERGED</td>
808 * <td align="center">Camera device finished AE scan</td>
809 * <td align="center">FLASH_REQUIRED</td>
810 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
811 * </tr>
812 * <tr>
813 * <td align="center">FLASH_REQUIRED</td>
814 * <td align="center">Camera device finished AE scan</td>
815 * <td align="center">CONVERGED</td>
816 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
817 * </tr>
818 * </tbody>
819 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -0800820 *
821 * @see CaptureRequest#CONTROL_AE_LOCK
822 * @see CaptureRequest#CONTROL_AE_MODE
823 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
824 * @see CaptureRequest#CONTROL_MODE
825 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700826 * @see #CONTROL_AE_STATE_INACTIVE
827 * @see #CONTROL_AE_STATE_SEARCHING
828 * @see #CONTROL_AE_STATE_CONVERGED
829 * @see #CONTROL_AE_STATE_LOCKED
830 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
831 * @see #CONTROL_AE_STATE_PRECAPTURE
832 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700833 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700834 public static final Key<Integer> CONTROL_AE_STATE =
835 new Key<Integer>("android.control.aeState", int.class);
836
837 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700838 * <p>Whether auto-focus (AF) is currently enabled, and what
839 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800840 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
841 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>).</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800842 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800843 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
Zhijun He78146ec2014-01-14 18:12:13 -0800844 * in result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800845 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800846 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800847 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -0800848 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700849 * @see #CONTROL_AF_MODE_OFF
850 * @see #CONTROL_AF_MODE_AUTO
851 * @see #CONTROL_AF_MODE_MACRO
852 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
853 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
854 * @see #CONTROL_AF_MODE_EDOF
855 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700856 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700857 public static final Key<Integer> CONTROL_AF_MODE =
858 new Key<Integer>("android.control.afMode", int.class);
859
860 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800861 * <p>List of areas to use for focus
Ruben Brunkf59521d2014-02-03 17:14:33 -0800862 * estimation.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800863 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700864 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800865 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
866 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700867 * bottom-right pixel in the active pixel array.</p>
868 * <p>The weight must range from 0 to 1000, and represents a weight
869 * for every pixel in the area. This means that a large metering area
870 * with the same weight as a smaller area will have more effect in
871 * the metering result. Metering areas can partially overlap and the
872 * camera device will add the weights in the overlap region.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700873 * <p>If all regions have 0 weight, then no specific metering area
874 * needs to be used by the camera device. If the metering region is
875 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
876 * the camera device will ignore the sections outside the region and output the
877 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800878 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800879 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800880 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700881 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700882 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700883 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
884 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700885
886 /**
Zhijun He379af012014-05-06 11:54:54 -0700887 * <p>Whether the camera device will trigger autofocus for this request.</p>
888 * <p>This entry is normally set to IDLE, or is not
889 * included at all in the request settings.</p>
890 * <p>When included and set to START, the camera device will trigger the
891 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
892 * <p>When set to CANCEL, the camera device will cancel any active trigger,
893 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700894 * <p>Generally, applications should set this entry to START or CANCEL for only a
895 * single capture, and then return it to IDLE (or not set at all). Specifying
896 * START for multiple captures in a row means restarting the AF operation over
897 * and over again.</p>
898 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
Zhijun He379af012014-05-06 11:54:54 -0700899 *
900 * @see CaptureResult#CONTROL_AF_STATE
901 * @see #CONTROL_AF_TRIGGER_IDLE
902 * @see #CONTROL_AF_TRIGGER_START
903 * @see #CONTROL_AF_TRIGGER_CANCEL
904 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700905 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700906 public static final Key<Integer> CONTROL_AF_TRIGGER =
907 new Key<Integer>("android.control.afTrigger", int.class);
908
909 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700910 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800911 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
912 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
913 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
914 * the algorithm states to INACTIVE.</p>
915 * <p>The camera device can do several state transitions between two results, if it is
916 * allowed by the state transition table. For example: INACTIVE may never actually be
917 * seen in a result.</p>
918 * <p>The state in the result is the state for this image (in sync with this image): if
919 * AF state becomes FOCUSED, then the image data associated with this result should
920 * be sharp.</p>
921 * <p>Below are state transition tables for different AF modes.</p>
922 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
923 * <table>
924 * <thead>
925 * <tr>
926 * <th align="center">State</th>
927 * <th align="center">Transition Cause</th>
928 * <th align="center">New State</th>
929 * <th align="center">Notes</th>
930 * </tr>
931 * </thead>
932 * <tbody>
933 * <tr>
934 * <td align="center">INACTIVE</td>
935 * <td align="center"></td>
936 * <td align="center">INACTIVE</td>
937 * <td align="center">Never changes</td>
938 * </tr>
939 * </tbody>
940 * </table>
941 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
942 * <table>
943 * <thead>
944 * <tr>
945 * <th align="center">State</th>
946 * <th align="center">Transition Cause</th>
947 * <th align="center">New State</th>
948 * <th align="center">Notes</th>
949 * </tr>
950 * </thead>
951 * <tbody>
952 * <tr>
953 * <td align="center">INACTIVE</td>
954 * <td align="center">AF_TRIGGER</td>
955 * <td align="center">ACTIVE_SCAN</td>
956 * <td align="center">Start AF sweep, Lens now moving</td>
957 * </tr>
958 * <tr>
959 * <td align="center">ACTIVE_SCAN</td>
960 * <td align="center">AF sweep done</td>
961 * <td align="center">FOCUSED_LOCKED</td>
962 * <td align="center">Focused, Lens now locked</td>
963 * </tr>
964 * <tr>
965 * <td align="center">ACTIVE_SCAN</td>
966 * <td align="center">AF sweep done</td>
967 * <td align="center">NOT_FOCUSED_LOCKED</td>
968 * <td align="center">Not focused, Lens now locked</td>
969 * </tr>
970 * <tr>
971 * <td align="center">ACTIVE_SCAN</td>
972 * <td align="center">AF_CANCEL</td>
973 * <td align="center">INACTIVE</td>
974 * <td align="center">Cancel/reset AF, Lens now locked</td>
975 * </tr>
976 * <tr>
977 * <td align="center">FOCUSED_LOCKED</td>
978 * <td align="center">AF_CANCEL</td>
979 * <td align="center">INACTIVE</td>
980 * <td align="center">Cancel/reset AF</td>
981 * </tr>
982 * <tr>
983 * <td align="center">FOCUSED_LOCKED</td>
984 * <td align="center">AF_TRIGGER</td>
985 * <td align="center">ACTIVE_SCAN</td>
986 * <td align="center">Start new sweep, Lens now moving</td>
987 * </tr>
988 * <tr>
989 * <td align="center">NOT_FOCUSED_LOCKED</td>
990 * <td align="center">AF_CANCEL</td>
991 * <td align="center">INACTIVE</td>
992 * <td align="center">Cancel/reset AF</td>
993 * </tr>
994 * <tr>
995 * <td align="center">NOT_FOCUSED_LOCKED</td>
996 * <td align="center">AF_TRIGGER</td>
997 * <td align="center">ACTIVE_SCAN</td>
998 * <td align="center">Start new sweep, Lens now moving</td>
999 * </tr>
1000 * <tr>
1001 * <td align="center">Any state</td>
1002 * <td align="center">Mode change</td>
1003 * <td align="center">INACTIVE</td>
1004 * <td align="center"></td>
1005 * </tr>
1006 * </tbody>
1007 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001008 * <p>For the above table, the camera device may skip reporting any state changes that happen
1009 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1010 * can be skipped in that manner is called a transient state.</p>
1011 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1012 * state transitions listed in above table, it is also legal for the camera device to skip
1013 * one or more transient states between two results. See below table for examples:</p>
1014 * <table>
1015 * <thead>
1016 * <tr>
1017 * <th align="center">State</th>
1018 * <th align="center">Transition Cause</th>
1019 * <th align="center">New State</th>
1020 * <th align="center">Notes</th>
1021 * </tr>
1022 * </thead>
1023 * <tbody>
1024 * <tr>
1025 * <td align="center">INACTIVE</td>
1026 * <td align="center">AF_TRIGGER</td>
1027 * <td align="center">FOCUSED_LOCKED</td>
1028 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1029 * </tr>
1030 * <tr>
1031 * <td align="center">INACTIVE</td>
1032 * <td align="center">AF_TRIGGER</td>
1033 * <td align="center">NOT_FOCUSED_LOCKED</td>
1034 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1035 * </tr>
1036 * <tr>
1037 * <td align="center">FOCUSED_LOCKED</td>
1038 * <td align="center">AF_TRIGGER</td>
1039 * <td align="center">FOCUSED_LOCKED</td>
1040 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1041 * </tr>
1042 * <tr>
1043 * <td align="center">NOT_FOCUSED_LOCKED</td>
1044 * <td align="center">AF_TRIGGER</td>
1045 * <td align="center">FOCUSED_LOCKED</td>
1046 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1047 * </tr>
1048 * </tbody>
1049 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001050 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1051 * <table>
1052 * <thead>
1053 * <tr>
1054 * <th align="center">State</th>
1055 * <th align="center">Transition Cause</th>
1056 * <th align="center">New State</th>
1057 * <th align="center">Notes</th>
1058 * </tr>
1059 * </thead>
1060 * <tbody>
1061 * <tr>
1062 * <td align="center">INACTIVE</td>
1063 * <td align="center">Camera device initiates new scan</td>
1064 * <td align="center">PASSIVE_SCAN</td>
1065 * <td align="center">Start AF scan, Lens now moving</td>
1066 * </tr>
1067 * <tr>
1068 * <td align="center">INACTIVE</td>
1069 * <td align="center">AF_TRIGGER</td>
1070 * <td align="center">NOT_FOCUSED_LOCKED</td>
1071 * <td align="center">AF state query, Lens now locked</td>
1072 * </tr>
1073 * <tr>
1074 * <td align="center">PASSIVE_SCAN</td>
1075 * <td align="center">Camera device completes current scan</td>
1076 * <td align="center">PASSIVE_FOCUSED</td>
1077 * <td align="center">End AF scan, Lens now locked</td>
1078 * </tr>
1079 * <tr>
1080 * <td align="center">PASSIVE_SCAN</td>
1081 * <td align="center">Camera device fails current scan</td>
1082 * <td align="center">PASSIVE_UNFOCUSED</td>
1083 * <td align="center">End AF scan, Lens now locked</td>
1084 * </tr>
1085 * <tr>
1086 * <td align="center">PASSIVE_SCAN</td>
1087 * <td align="center">AF_TRIGGER</td>
1088 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001089 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001090 * </tr>
1091 * <tr>
1092 * <td align="center">PASSIVE_SCAN</td>
1093 * <td align="center">AF_TRIGGER</td>
1094 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001095 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001096 * </tr>
1097 * <tr>
1098 * <td align="center">PASSIVE_SCAN</td>
1099 * <td align="center">AF_CANCEL</td>
1100 * <td align="center">INACTIVE</td>
1101 * <td align="center">Reset lens position, Lens now locked</td>
1102 * </tr>
1103 * <tr>
1104 * <td align="center">PASSIVE_FOCUSED</td>
1105 * <td align="center">Camera device initiates new scan</td>
1106 * <td align="center">PASSIVE_SCAN</td>
1107 * <td align="center">Start AF scan, Lens now moving</td>
1108 * </tr>
1109 * <tr>
1110 * <td align="center">PASSIVE_UNFOCUSED</td>
1111 * <td align="center">Camera device initiates new scan</td>
1112 * <td align="center">PASSIVE_SCAN</td>
1113 * <td align="center">Start AF scan, Lens now moving</td>
1114 * </tr>
1115 * <tr>
1116 * <td align="center">PASSIVE_FOCUSED</td>
1117 * <td align="center">AF_TRIGGER</td>
1118 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001119 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001120 * </tr>
1121 * <tr>
1122 * <td align="center">PASSIVE_UNFOCUSED</td>
1123 * <td align="center">AF_TRIGGER</td>
1124 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001125 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001126 * </tr>
1127 * <tr>
1128 * <td align="center">FOCUSED_LOCKED</td>
1129 * <td align="center">AF_TRIGGER</td>
1130 * <td align="center">FOCUSED_LOCKED</td>
1131 * <td align="center">No effect</td>
1132 * </tr>
1133 * <tr>
1134 * <td align="center">FOCUSED_LOCKED</td>
1135 * <td align="center">AF_CANCEL</td>
1136 * <td align="center">INACTIVE</td>
1137 * <td align="center">Restart AF scan</td>
1138 * </tr>
1139 * <tr>
1140 * <td align="center">NOT_FOCUSED_LOCKED</td>
1141 * <td align="center">AF_TRIGGER</td>
1142 * <td align="center">NOT_FOCUSED_LOCKED</td>
1143 * <td align="center">No effect</td>
1144 * </tr>
1145 * <tr>
1146 * <td align="center">NOT_FOCUSED_LOCKED</td>
1147 * <td align="center">AF_CANCEL</td>
1148 * <td align="center">INACTIVE</td>
1149 * <td align="center">Restart AF scan</td>
1150 * </tr>
1151 * </tbody>
1152 * </table>
1153 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1154 * <table>
1155 * <thead>
1156 * <tr>
1157 * <th align="center">State</th>
1158 * <th align="center">Transition Cause</th>
1159 * <th align="center">New State</th>
1160 * <th align="center">Notes</th>
1161 * </tr>
1162 * </thead>
1163 * <tbody>
1164 * <tr>
1165 * <td align="center">INACTIVE</td>
1166 * <td align="center">Camera device initiates new scan</td>
1167 * <td align="center">PASSIVE_SCAN</td>
1168 * <td align="center">Start AF scan, Lens now moving</td>
1169 * </tr>
1170 * <tr>
1171 * <td align="center">INACTIVE</td>
1172 * <td align="center">AF_TRIGGER</td>
1173 * <td align="center">NOT_FOCUSED_LOCKED</td>
1174 * <td align="center">AF state query, Lens now locked</td>
1175 * </tr>
1176 * <tr>
1177 * <td align="center">PASSIVE_SCAN</td>
1178 * <td align="center">Camera device completes current scan</td>
1179 * <td align="center">PASSIVE_FOCUSED</td>
1180 * <td align="center">End AF scan, Lens now locked</td>
1181 * </tr>
1182 * <tr>
1183 * <td align="center">PASSIVE_SCAN</td>
1184 * <td align="center">Camera device fails current scan</td>
1185 * <td align="center">PASSIVE_UNFOCUSED</td>
1186 * <td align="center">End AF scan, Lens now locked</td>
1187 * </tr>
1188 * <tr>
1189 * <td align="center">PASSIVE_SCAN</td>
1190 * <td align="center">AF_TRIGGER</td>
1191 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001192 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001193 * </tr>
1194 * <tr>
1195 * <td align="center">PASSIVE_SCAN</td>
1196 * <td align="center">AF_TRIGGER</td>
1197 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001198 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001199 * </tr>
1200 * <tr>
1201 * <td align="center">PASSIVE_SCAN</td>
1202 * <td align="center">AF_CANCEL</td>
1203 * <td align="center">INACTIVE</td>
1204 * <td align="center">Reset lens position, Lens now locked</td>
1205 * </tr>
1206 * <tr>
1207 * <td align="center">PASSIVE_FOCUSED</td>
1208 * <td align="center">Camera device initiates new scan</td>
1209 * <td align="center">PASSIVE_SCAN</td>
1210 * <td align="center">Start AF scan, Lens now moving</td>
1211 * </tr>
1212 * <tr>
1213 * <td align="center">PASSIVE_UNFOCUSED</td>
1214 * <td align="center">Camera device initiates new scan</td>
1215 * <td align="center">PASSIVE_SCAN</td>
1216 * <td align="center">Start AF scan, Lens now moving</td>
1217 * </tr>
1218 * <tr>
1219 * <td align="center">PASSIVE_FOCUSED</td>
1220 * <td align="center">AF_TRIGGER</td>
1221 * <td align="center">FOCUSED_LOCKED</td>
1222 * <td align="center">Immediate trans. Lens now locked</td>
1223 * </tr>
1224 * <tr>
1225 * <td align="center">PASSIVE_UNFOCUSED</td>
1226 * <td align="center">AF_TRIGGER</td>
1227 * <td align="center">NOT_FOCUSED_LOCKED</td>
1228 * <td align="center">Immediate trans. Lens now locked</td>
1229 * </tr>
1230 * <tr>
1231 * <td align="center">FOCUSED_LOCKED</td>
1232 * <td align="center">AF_TRIGGER</td>
1233 * <td align="center">FOCUSED_LOCKED</td>
1234 * <td align="center">No effect</td>
1235 * </tr>
1236 * <tr>
1237 * <td align="center">FOCUSED_LOCKED</td>
1238 * <td align="center">AF_CANCEL</td>
1239 * <td align="center">INACTIVE</td>
1240 * <td align="center">Restart AF scan</td>
1241 * </tr>
1242 * <tr>
1243 * <td align="center">NOT_FOCUSED_LOCKED</td>
1244 * <td align="center">AF_TRIGGER</td>
1245 * <td align="center">NOT_FOCUSED_LOCKED</td>
1246 * <td align="center">No effect</td>
1247 * </tr>
1248 * <tr>
1249 * <td align="center">NOT_FOCUSED_LOCKED</td>
1250 * <td align="center">AF_CANCEL</td>
1251 * <td align="center">INACTIVE</td>
1252 * <td align="center">Restart AF scan</td>
1253 * </tr>
1254 * </tbody>
1255 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001256 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1257 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1258 * camera device. When a trigger is included in a mode switch request, the trigger
1259 * will be evaluated in the context of the new mode in the request.
1260 * See below table for examples:</p>
1261 * <table>
1262 * <thead>
1263 * <tr>
1264 * <th align="center">State</th>
1265 * <th align="center">Transition Cause</th>
1266 * <th align="center">New State</th>
1267 * <th align="center">Notes</th>
1268 * </tr>
1269 * </thead>
1270 * <tbody>
1271 * <tr>
1272 * <td align="center">any state</td>
1273 * <td align="center">CAF--&gt;AUTO mode switch</td>
1274 * <td align="center">INACTIVE</td>
1275 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1276 * </tr>
1277 * <tr>
1278 * <td align="center">any state</td>
1279 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1280 * <td align="center">trigger-reachable states from INACTIVE</td>
1281 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1282 * </tr>
1283 * <tr>
1284 * <td align="center">any state</td>
1285 * <td align="center">AUTO--&gt;CAF mode switch</td>
1286 * <td align="center">passively reachable states from INACTIVE</td>
1287 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1288 * </tr>
1289 * </tbody>
1290 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001291 *
1292 * @see CaptureRequest#CONTROL_AF_MODE
1293 * @see CaptureRequest#CONTROL_MODE
1294 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001295 * @see #CONTROL_AF_STATE_INACTIVE
1296 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1297 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1298 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1299 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1300 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001301 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001302 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001303 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001304 public static final Key<Integer> CONTROL_AF_STATE =
1305 new Key<Integer>("android.control.afState", int.class);
1306
1307 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001308 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001309 * latest calculated values.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001310 * <p>Note that AWB lock is only meaningful when
1311 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1312 * AWB is already fixed to a specific setting.</p>
1313 *
1314 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001315 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001316 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001317 public static final Key<Boolean> CONTROL_AWB_LOCK =
1318 new Key<Boolean>("android.control.awbLock", boolean.class);
1319
1320 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001321 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001322 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001323 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001324 * <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 -07001325 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001326 * routine is enabled, overriding the application's selected
1327 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1328 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001329 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001330 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001331 * 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 -08001332 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001333 * <p>When set to any other modes, the camera device's auto-white
1334 * balance routine is disabled. The camera device uses each
1335 * particular illumination target for white balance
1336 * adjustment. The application's values for
1337 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1338 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1339 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001340 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001341 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001342 * @see CaptureRequest#COLOR_CORRECTION_MODE
1343 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001344 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001345 * @see #CONTROL_AWB_MODE_OFF
1346 * @see #CONTROL_AWB_MODE_AUTO
1347 * @see #CONTROL_AWB_MODE_INCANDESCENT
1348 * @see #CONTROL_AWB_MODE_FLUORESCENT
1349 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1350 * @see #CONTROL_AWB_MODE_DAYLIGHT
1351 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1352 * @see #CONTROL_AWB_MODE_TWILIGHT
1353 * @see #CONTROL_AWB_MODE_SHADE
1354 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001355 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001356 public static final Key<Integer> CONTROL_AWB_MODE =
1357 new Key<Integer>("android.control.awbMode", int.class);
1358
1359 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001360 * <p>List of areas to use for illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001361 * estimation.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001362 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001363 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001364 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1365 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001366 * bottom-right pixel in the active pixel array.</p>
1367 * <p>The weight must range from 0 to 1000, and represents a weight
1368 * for every pixel in the area. This means that a large metering area
1369 * with the same weight as a smaller area will have more effect in
1370 * the metering result. Metering areas can partially overlap and the
1371 * camera device will add the weights in the overlap region.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001372 * <p>If all regions have 0 weight, then no specific metering area
1373 * needs to be used by the camera device. If the metering region is
1374 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
Zhijun He14986152014-05-22 21:17:37 -07001375 * the camera device will ignore the sections outside the region and output the
1376 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001377 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001378 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001379 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001380 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001381 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001382 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1383 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001384
1385 /**
Zhijun He379af012014-05-06 11:54:54 -07001386 * <p>Information to the camera device 3A (auto-exposure,
1387 * auto-focus, auto-white balance) routines about the purpose
1388 * of this capture, to help the camera device to decide optimal 3A
1389 * strategy.</p>
1390 * <p>This control (except for MANUAL) is only effective if
1391 * <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 -07001392 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1393 * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Zhijun He379af012014-05-06 11:54:54 -07001394 * contains MANUAL_SENSOR.</p>
1395 *
1396 * @see CaptureRequest#CONTROL_MODE
1397 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1398 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1399 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1400 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1401 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1402 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1403 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1404 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1405 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001406 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001407 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1408 new Key<Integer>("android.control.captureIntent", int.class);
1409
1410 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001411 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001412 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1413 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1414 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1415 * the algorithm states to INACTIVE.</p>
1416 * <p>The camera device can do several state transitions between two results, if it is
1417 * allowed by the state transition table. So INACTIVE may never actually be seen in
1418 * a result.</p>
1419 * <p>The state in the result is the state for this image (in sync with this image): if
1420 * AWB state becomes CONVERGED, then the image data associated with this result should
1421 * be good to use.</p>
1422 * <p>Below are state transition tables for different AWB modes.</p>
1423 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1424 * <table>
1425 * <thead>
1426 * <tr>
1427 * <th align="center">State</th>
1428 * <th align="center">Transition Cause</th>
1429 * <th align="center">New State</th>
1430 * <th align="center">Notes</th>
1431 * </tr>
1432 * </thead>
1433 * <tbody>
1434 * <tr>
1435 * <td align="center">INACTIVE</td>
1436 * <td align="center"></td>
1437 * <td align="center">INACTIVE</td>
1438 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1439 * </tr>
1440 * </tbody>
1441 * </table>
1442 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1443 * <table>
1444 * <thead>
1445 * <tr>
1446 * <th align="center">State</th>
1447 * <th align="center">Transition Cause</th>
1448 * <th align="center">New State</th>
1449 * <th align="center">Notes</th>
1450 * </tr>
1451 * </thead>
1452 * <tbody>
1453 * <tr>
1454 * <td align="center">INACTIVE</td>
1455 * <td align="center">Camera device initiates AWB scan</td>
1456 * <td align="center">SEARCHING</td>
1457 * <td align="center">Values changing</td>
1458 * </tr>
1459 * <tr>
1460 * <td align="center">INACTIVE</td>
1461 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1462 * <td align="center">LOCKED</td>
1463 * <td align="center">Values locked</td>
1464 * </tr>
1465 * <tr>
1466 * <td align="center">SEARCHING</td>
1467 * <td align="center">Camera device finishes AWB scan</td>
1468 * <td align="center">CONVERGED</td>
1469 * <td align="center">Good values, not changing</td>
1470 * </tr>
1471 * <tr>
1472 * <td align="center">SEARCHING</td>
1473 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1474 * <td align="center">LOCKED</td>
1475 * <td align="center">Values locked</td>
1476 * </tr>
1477 * <tr>
1478 * <td align="center">CONVERGED</td>
1479 * <td align="center">Camera device initiates AWB scan</td>
1480 * <td align="center">SEARCHING</td>
1481 * <td align="center">Values changing</td>
1482 * </tr>
1483 * <tr>
1484 * <td align="center">CONVERGED</td>
1485 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1486 * <td align="center">LOCKED</td>
1487 * <td align="center">Values locked</td>
1488 * </tr>
1489 * <tr>
1490 * <td align="center">LOCKED</td>
1491 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1492 * <td align="center">SEARCHING</td>
1493 * <td align="center">Values not good after unlock</td>
1494 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001495 * </tbody>
1496 * </table>
1497 * <p>For the above table, the camera device may skip reporting any state changes that happen
1498 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1499 * can be skipped in that manner is called a transient state.</p>
1500 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1501 * listed in above table, it is also legal for the camera device to skip one or more
1502 * transient states between two results. See below table for examples:</p>
1503 * <table>
1504 * <thead>
1505 * <tr>
1506 * <th align="center">State</th>
1507 * <th align="center">Transition Cause</th>
1508 * <th align="center">New State</th>
1509 * <th align="center">Notes</th>
1510 * </tr>
1511 * </thead>
1512 * <tbody>
1513 * <tr>
1514 * <td align="center">INACTIVE</td>
1515 * <td align="center">Camera device finished AWB scan</td>
1516 * <td align="center">CONVERGED</td>
1517 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1518 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001519 * <tr>
1520 * <td align="center">LOCKED</td>
1521 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1522 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001523 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001524 * </tr>
1525 * </tbody>
1526 * </table>
1527 *
1528 * @see CaptureRequest#CONTROL_AWB_LOCK
1529 * @see CaptureRequest#CONTROL_AWB_MODE
1530 * @see CaptureRequest#CONTROL_MODE
1531 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001532 * @see #CONTROL_AWB_STATE_INACTIVE
1533 * @see #CONTROL_AWB_STATE_SEARCHING
1534 * @see #CONTROL_AWB_STATE_CONVERGED
1535 * @see #CONTROL_AWB_STATE_LOCKED
1536 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001537 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001538 public static final Key<Integer> CONTROL_AWB_STATE =
1539 new Key<Integer>("android.control.awbState", int.class);
1540
1541 /**
Zhijun He379af012014-05-06 11:54:54 -07001542 * <p>A special color effect to apply.</p>
1543 * <p>When this mode is set, a color effect will be applied
1544 * to images produced by the camera device. The interpretation
1545 * and implementation of these color effects is left to the
1546 * implementor of the camera device, and should not be
1547 * depended on to be consistent (or present) across all
1548 * devices.</p>
1549 * <p>A color effect will only be applied if
1550 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p>
1551 *
1552 * @see CaptureRequest#CONTROL_MODE
1553 * @see #CONTROL_EFFECT_MODE_OFF
1554 * @see #CONTROL_EFFECT_MODE_MONO
1555 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1556 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1557 * @see #CONTROL_EFFECT_MODE_SEPIA
1558 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1559 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1560 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1561 * @see #CONTROL_EFFECT_MODE_AQUA
1562 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001563 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001564 public static final Key<Integer> CONTROL_EFFECT_MODE =
1565 new Key<Integer>("android.control.effectMode", int.class);
1566
1567 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001568 * <p>Overall mode of 3A control
Zhijun Hecc28a412014-02-24 15:11:23 -08001569 * routines.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001570 * <p>High-level 3A control. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001571 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001572 * capture parameters itself.</p>
1573 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001574 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001575 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001576 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001577 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001578 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001579 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001580 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1581 * is that this frame will not be used by camera device background 3A statistics
1582 * update, as if this frame is never captured. This mode can be used in the scenario
1583 * where the application doesn't want a 3A manual control capture to affect
1584 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001585 *
1586 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001587 * @see #CONTROL_MODE_OFF
1588 * @see #CONTROL_MODE_AUTO
1589 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001590 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001591 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001592 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001593 public static final Key<Integer> CONTROL_MODE =
1594 new Key<Integer>("android.control.mode", int.class);
1595
1596 /**
Zhijun He379af012014-05-06 11:54:54 -07001597 * <p>A camera mode optimized for conditions typical in a particular
1598 * capture setting.</p>
1599 * <p>This is the mode that that is active when
1600 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1601 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001602 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.
1603 * The scene modes available for a given camera device are listed in
1604 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}.</p>
Zhijun He379af012014-05-06 11:54:54 -07001605 * <p>The interpretation and implementation of these scene modes is left
1606 * to the implementor of the camera device. Their behavior will not be
1607 * consistent across all devices, and any given device may only implement
1608 * a subset of these modes.</p>
1609 *
1610 * @see CaptureRequest#CONTROL_AE_MODE
1611 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001612 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001613 * @see CaptureRequest#CONTROL_AWB_MODE
1614 * @see CaptureRequest#CONTROL_MODE
1615 * @see #CONTROL_SCENE_MODE_DISABLED
1616 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1617 * @see #CONTROL_SCENE_MODE_ACTION
1618 * @see #CONTROL_SCENE_MODE_PORTRAIT
1619 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1620 * @see #CONTROL_SCENE_MODE_NIGHT
1621 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1622 * @see #CONTROL_SCENE_MODE_THEATRE
1623 * @see #CONTROL_SCENE_MODE_BEACH
1624 * @see #CONTROL_SCENE_MODE_SNOW
1625 * @see #CONTROL_SCENE_MODE_SUNSET
1626 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1627 * @see #CONTROL_SCENE_MODE_FIREWORKS
1628 * @see #CONTROL_SCENE_MODE_SPORTS
1629 * @see #CONTROL_SCENE_MODE_PARTY
1630 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1631 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07001632 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Zhijun He379af012014-05-06 11:54:54 -07001633 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001634 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001635 public static final Key<Integer> CONTROL_SCENE_MODE =
1636 new Key<Integer>("android.control.sceneMode", int.class);
1637
1638 /**
1639 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001640 * active.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001641 * <p>Video stabilization automatically translates and scales images from the camera
1642 * in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07001643 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001644 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
1645 * <p>Switching between different video stabilization modes may take several frames
1646 * to initialize, the camera device will report the current mode in capture result
1647 * metadata. For example, When "ON" mode is requested, the video stabilization modes
1648 * in the first several capture results may still be "OFF", and it will become "ON"
1649 * when the initialization is done.</p>
1650 * <p>If a camera device supports both this mode and OIS ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}),
1651 * turning both modes on may produce undesirable interaction, so it is recommended not to
1652 * enable both at the same time.</p>
Zhijun He379af012014-05-06 11:54:54 -07001653 *
Zhijun He45fa43a12014-06-13 18:29:37 -07001654 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07001655 * @see CaptureRequest#SCALER_CROP_REGION
1656 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1657 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1658 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001659 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001660 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1661 new Key<Integer>("android.control.videoStabilizationMode", int.class);
1662
1663 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001664 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001665 * enhancement.</p>
Zhijun He28079362013-12-17 10:35:40 -08001666 * <p>Edge/sharpness/detail enhancement. OFF means no
Zhijun Hecc28a412014-02-24 15:11:23 -08001667 * enhancement will be applied by the camera device.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001668 * <p>This must be set to one of the modes listed in {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001669 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001670 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001671 * camera device will use the highest-quality enhancement algorithms,
1672 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08001673 * not slow down capture rate when applying edge enhancement.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001674 *
1675 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001676 * @see #EDGE_MODE_OFF
1677 * @see #EDGE_MODE_FAST
1678 * @see #EDGE_MODE_HIGH_QUALITY
1679 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001680 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001681 public static final Key<Integer> EDGE_MODE =
1682 new Key<Integer>("android.edge.mode", int.class);
1683
1684 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001685 * <p>The desired mode for for the camera device's flash control.</p>
1686 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08001687 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001688 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
1689 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
1690 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
1691 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
1692 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
1693 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001694 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08001695 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
1696 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
1697 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001698 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001699 *
1700 * @see CaptureRequest#CONTROL_AE_MODE
1701 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1702 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08001703 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001704 * @see #FLASH_MODE_OFF
1705 * @see #FLASH_MODE_SINGLE
1706 * @see #FLASH_MODE_TORCH
1707 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001708 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001709 public static final Key<Integer> FLASH_MODE =
1710 new Key<Integer>("android.flash.mode", int.class);
1711
1712 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001713 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08001714 * unit.</p>
1715 * <p>When the camera device doesn't have flash unit
1716 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
1717 * Other states indicate the current flash status.</p>
1718 *
1719 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001720 * @see #FLASH_STATE_UNAVAILABLE
1721 * @see #FLASH_STATE_CHARGING
1722 * @see #FLASH_STATE_READY
1723 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07001724 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001725 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001726 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001727 public static final Key<Integer> FLASH_STATE =
1728 new Key<Integer>("android.flash.state", int.class);
1729
1730 /**
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001731 * <p>Set operational mode for hot pixel correction.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001732 * <p>Valid modes for this camera device are listed in
1733 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001734 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
1735 * that do not accurately encode the incoming light (i.e. pixels that
1736 * are stuck at an arbitrary value).</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001737 *
1738 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001739 * @see #HOT_PIXEL_MODE_OFF
1740 * @see #HOT_PIXEL_MODE_FAST
1741 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1742 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001743 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001744 public static final Key<Integer> HOT_PIXEL_MODE =
1745 new Key<Integer>("android.hotPixel.mode", int.class);
1746
1747 /**
Ruben Brunk57493682014-05-27 18:58:08 -07001748 * <p>A location object to use when generating image GPS metadata.</p>
1749 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001750 @PublicKey
1751 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07001752 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
1753 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
1754
1755 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001756 * <p>GPS coordinates to include in output JPEG
1757 * EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001758 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001759 */
1760 public static final Key<double[]> JPEG_GPS_COORDINATES =
1761 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
1762
1763 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001764 * <p>32 characters describing GPS algorithm to
1765 * include in EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001766 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001767 */
1768 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
1769 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
1770
1771 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001772 * <p>Time GPS fix was made to include in
1773 * EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001774 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001775 */
1776 public static final Key<Long> JPEG_GPS_TIMESTAMP =
1777 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
1778
1779 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001780 * <p>Orientation of JPEG image to
1781 * write</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001782 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001783 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001784 public static final Key<Integer> JPEG_ORIENTATION =
1785 new Key<Integer>("android.jpeg.orientation", int.class);
1786
1787 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001788 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001789 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001790 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001791 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001792 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001793 public static final Key<Byte> JPEG_QUALITY =
1794 new Key<Byte>("android.jpeg.quality", byte.class);
1795
1796 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001797 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001798 * thumbnail.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001799 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001800 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001801 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
1802 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
1803
1804 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001805 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001806 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
1807 * but the captured JPEG will still be a valid image.</p>
Zhijun He5a9ff372013-12-26 11:49:09 -08001808 * <p>When a jpeg image capture is issued, the thumbnail size selected should have
1809 * the same aspect ratio as the jpeg image.</p>
Zhijun He50f72432014-05-28 13:52:04 -07001810 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
1811 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
1812 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
1813 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
1814 * generate the thumbnail image. The thumbnail image will always have a smaller Field
1815 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001816 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001817 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001818 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
1819 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001820
1821 /**
Zhijun Hefb46c642014-01-14 17:57:23 -08001822 * <p>The ratio of lens focal length to the effective
1823 * aperture diameter.</p>
1824 * <p>This will only be supported on the camera devices that
1825 * have variable aperture lens. The aperture value can only be
1826 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
1827 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1828 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001829 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08001830 * to achieve manual exposure control.</p>
1831 * <p>The requested aperture value may take several frames to reach the
1832 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08001833 * aperture size in capture result metadata while the aperture is changing.
1834 * 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 -08001835 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1836 * the ON modes, this will be overridden by the camera device
1837 * auto-exposure algorithm, the overridden values are then provided
1838 * back to the user in the corresponding result.</p>
1839 *
Zhijun He399f05d2014-01-15 11:31:30 -08001840 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001841 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001842 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001843 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001844 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001845 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001846 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001847 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001848 public static final Key<Float> LENS_APERTURE =
1849 new Key<Float>("android.lens.aperture", float.class);
1850
1851 /**
Ruben Brunk855bae42014-01-17 10:30:32 -08001852 * <p>State of lens neutral density filter(s).</p>
1853 * <p>This will not be supported on most camera devices. On devices
1854 * where this is supported, this may only be set to one of the
1855 * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p>
1856 * <p>Lens filters are typically used to lower the amount of light the
1857 * sensor is exposed to (measured in steps of EV). As used here, an EV
1858 * step is the standard logarithmic representation, which are
1859 * non-negative, and inversely proportional to the amount of light
1860 * hitting the sensor. For example, setting this to 0 would result
1861 * in no reduction of the incoming light, and setting this to 2 would
1862 * mean that the filter is set to reduce incoming light by two stops
1863 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001864 * <p>It may take several frames before the lens filter density changes
1865 * to the requested value. While the filter density is still changing,
1866 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001867 *
1868 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001869 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001870 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001871 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001872 public static final Key<Float> LENS_FILTER_DENSITY =
1873 new Key<Float>("android.lens.filterDensity", float.class);
1874
1875 /**
Ruben Brunka20f4c22014-01-17 15:21:13 -08001876 * <p>The current lens focal length; used for optical zoom.</p>
1877 * <p>This setting controls the physical focal length of the camera
1878 * device's lens. Changing the focal length changes the field of
1879 * view of the camera device, and is usually used for optical zoom.</p>
1880 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1881 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08001882 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08001883 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1884 * be set to MOVING.</p>
1885 * <p>This is expected not to be supported on most devices.</p>
1886 *
1887 * @see CaptureRequest#LENS_APERTURE
1888 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1889 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001890 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001891 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001892 public static final Key<Float> LENS_FOCAL_LENGTH =
1893 new Key<Float>("android.lens.focalLength", float.class);
1894
1895 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001896 * <p>Distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001897 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001898 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001899 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001900 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001901 public static final Key<Float> LENS_FOCUS_DISTANCE =
1902 new Key<Float>("android.lens.focusDistance", float.class);
1903
1904 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001905 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001906 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001907 * <p>If variable focus not supported, can still report
1908 * fixed depth of field range</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001909 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001910 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07001911 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
1912 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 -07001913
1914 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08001915 * <p>Sets whether the camera device uses optical image stabilization (OIS)
1916 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001917 * <p>OIS is used to compensate for motion blur due to small
1918 * movements of the camera during capture. Unlike digital image
1919 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
1920 * makes use of mechanical elements to stabilize the camera
1921 * sensor, and thus allows for longer exposure times before
1922 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07001923 * <p>Switching between different optical stabilization modes may take several
1924 * frames to initialize, the camera device will report the current mode in
1925 * capture result metadata. For example, When "ON" mode is requested, the
1926 * optical stabilization modes in the first several capture results may still
1927 * be "OFF", and it will become "ON" when the initialization is done.</p>
1928 * <p>If a camera device supports both OIS and EIS ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}),
1929 * turning both modes on may produce undesirable interaction, so it is recommended not
1930 * to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001931 * <p>Not all devices will support OIS; see
1932 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
1933 * available controls.</p>
1934 *
1935 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
1936 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001937 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
1938 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
1939 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001940 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001941 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
1942 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
1943
1944 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08001945 * <p>Current lens status.</p>
1946 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1947 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
1948 * they may take several frames to reach the requested values. This state indicates
1949 * the current status of the lens parameters.</p>
1950 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
1951 * either because the parameters are all fixed, or because the lens has had enough
1952 * time to reach the most recently-requested values.
1953 * If all these lens parameters are not changable for a camera device, as listed below:</p>
1954 * <ul>
1955 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
1956 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
1957 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
1958 * which means the optical zoom is not supported.</li>
1959 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
1960 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
1961 * </ul>
1962 * <p>Then this state will always be STATIONARY.</p>
1963 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
1964 * is changing.</p>
1965 *
1966 * @see CaptureRequest#LENS_APERTURE
1967 * @see CaptureRequest#LENS_FILTER_DENSITY
1968 * @see CaptureRequest#LENS_FOCAL_LENGTH
1969 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1970 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1971 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1972 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
1973 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001974 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07001975 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001976 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001977 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001978 public static final Key<Integer> LENS_STATE =
1979 new Key<Integer>("android.lens.state", int.class);
1980
1981 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001982 * <p>Mode of operation for the noise reduction algorithm.</p>
Zhijun He28079362013-12-17 10:35:40 -08001983 * <p>Noise filtering control. OFF means no noise reduction
Zhijun Hecc28a412014-02-24 15:11:23 -08001984 * will be applied by the camera device.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001985 * <p>This must be set to a valid mode from
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001986 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001987 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
1988 * will be applied. HIGH_QUALITY mode indicates that the camera device
1989 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001990 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08001991 * slow down capture rate when applying noise filtering.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001992 *
1993 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001994 * @see #NOISE_REDUCTION_MODE_OFF
1995 * @see #NOISE_REDUCTION_MODE_FAST
1996 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
1997 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001998 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001999 public static final Key<Integer> NOISE_REDUCTION_MODE =
2000 new Key<Integer>("android.noiseReduction.mode", int.class);
2001
2002 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002003 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002004 * final one for the capture, or only a partial that contains a
2005 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002006 * values.</p>
2007 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002008 * single capture may not overlap, except for this entry. The
2009 * FINAL buffers must retain FIFO ordering relative to the
2010 * requests that generate them, so the FINAL buffer for frame 3 must
2011 * always be sent to the framework after the FINAL buffer for frame 2, and
2012 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2013 * in any order relative to other frames, but all PARTIAL buffers for a given
2014 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002015 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002016 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002017 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002018 * @hide
2019 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002020 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002021 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2022 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2023
2024 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002025 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002026 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002027 * frameCount value).</p>
2028 * <p>Reset on release()</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002029 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002030 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002031 public static final Key<Integer> REQUEST_FRAME_COUNT =
2032 new Key<Integer>("android.request.frameCount", int.class);
2033
2034 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002035 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002036 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002037 * frame</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002038 * @hide
2039 */
2040 public static final Key<Integer> REQUEST_ID =
2041 new Key<Integer>("android.request.id", int.class);
2042
2043 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002044 * <p>Specifies the number of pipeline stages the frame went
2045 * through from when it was exposed to when the final completed result
2046 * was available to the framework.</p>
2047 * <p>Depending on what settings are used in the request, and
2048 * what streams are configured, the data may undergo less processing,
2049 * and some pipeline stages skipped.</p>
2050 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
2051 *
2052 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2053 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002054 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002055 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2056 new Key<Byte>("android.request.pipelineDepth", byte.class);
2057
2058 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002059 * <p>The region of the sensor to read out for this capture.</p>
2060 * <p>The crop region coordinate system is based off
2061 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2062 * top-left corner of the sensor active array.</p>
2063 * <p>Output streams use this rectangle to produce their output,
2064 * cropping to a smaller region if necessary to maintain the
2065 * stream's aspect ratio, then scaling the sensor input to
2066 * match the output's configured resolution.</p>
2067 * <p>The crop region is applied after the RAW to other color
2068 * space (e.g. YUV) conversion. Since raw streams
2069 * (e.g. RAW16) don't have the conversion stage, they are not
2070 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002071 * <p>For non-raw streams, any additional per-stream cropping will
2072 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002073 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002074 * ratio, then 4:3 streams will use the exact crop
2075 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002076 * (letterbox).</p>
2077 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002078 * outputs will crop horizontally (pillarbox), and 16:9
2079 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002080 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002081 * <p>The width and height of the crop region cannot
2082 * be set to be smaller than
2083 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2084 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2085 * <p>The camera device may adjust the crop region to account
2086 * for rounding and other hardware requirements; the final
2087 * crop region used will be included in the output capture
2088 * result.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002089 *
2090 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002091 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002092 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002093 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002094 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2095 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2096
2097 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002098 * <p>Duration each pixel is exposed to
2099 * light.</p>
2100 * <p>If the sensor can't expose this exact duration, it should shorten the
2101 * duration exposed to the nearest possible value (rather than expose longer).</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002102 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002103 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002104 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2105 new Key<Long>("android.sensor.exposureTime", long.class);
2106
2107 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002108 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002109 * start of next frame exposure.</p>
2110 * <p>The maximum frame rate that can be supported by a camera subsystem is
2111 * a function of many factors:</p>
2112 * <ul>
2113 * <li>Requested resolutions of output image streams</li>
2114 * <li>Availability of binning / skipping modes on the imager</li>
2115 * <li>The bandwidth of the imager interface</li>
2116 * <li>The bandwidth of the various ISP processing blocks</li>
2117 * </ul>
2118 * <p>Since these factors can vary greatly between different ISPs and
2119 * sensors, the camera abstraction tries to represent the bandwidth
2120 * restrictions with as simple a model as possible.</p>
2121 * <p>The model presented has the following characteristics:</p>
2122 * <ul>
2123 * <li>The image sensor is always configured to output the smallest
2124 * resolution possible given the application's requested output stream
2125 * sizes. The smallest resolution is defined as being at least as large
2126 * as the largest requested output stream size; the camera pipeline must
2127 * never digitally upsample sensor data when the crop region covers the
2128 * whole sensor. In general, this means that if only small output stream
2129 * resolutions are configured, the sensor can provide a higher frame
2130 * rate.</li>
2131 * <li>Since any request may use any or all the currently configured
2132 * output streams, the sensor and ISP must be configured to support
2133 * scaling a single capture to all the streams at the same time. This
2134 * means the camera pipeline must be ready to produce the largest
2135 * requested output size without any delay. Therefore, the overall
2136 * frame rate of a given configured stream set is governed only by the
2137 * largest requested stream resolution.</li>
2138 * <li>Using more than one output stream in a request does not affect the
2139 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002140 * <li>Certain format-streams may need to do additional background processing
2141 * before data is consumed/produced by that stream. These processors
2142 * can run concurrently to the rest of the camera pipeline, but
2143 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002144 * </ul>
2145 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002146 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2147 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002148 * These are used to determine the maximum frame rate / minimum frame
2149 * duration that is possible for a given stream configuration.</p>
2150 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002151 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002152 * device:</p>
2153 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002154 * <li>Let the set of currently configured input/output streams
2155 * be called <code>S</code>.</li>
2156 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002157 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2158 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002159 * its respective size/format). Let this set of frame durations be called
2160 * <code>F</code>.</li>
2161 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2162 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2163 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002164 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002165 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002166 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2167 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002168 * <code>F</code> determines the steady state frame rate that the application will
2169 * get if it uses <code>R</code> as a repeating request. Let this special kind
2170 * of request be called <code>Rsimple</code>.</p>
2171 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2172 * by a single capture of a new request <code>Rstall</code> (which has at least
2173 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2174 * same minimum frame duration this will not cause a frame rate loss
2175 * if all buffers from the previous <code>Rstall</code> have already been
2176 * delivered.</p>
2177 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002178 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002179 *
Igor Murashkin9c595172014-05-12 13:56:20 -07002180 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002181 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002182 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002183 public static final Key<Long> SENSOR_FRAME_DURATION =
2184 new Key<Long>("android.sensor.frameDuration", long.class);
2185
2186 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002187 * <p>The amount of gain applied to sensor data
2188 * before processing.</p>
2189 * <p>The sensitivity is the standard ISO sensitivity value,
2190 * as defined in ISO 12232:2006.</p>
2191 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2192 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2193 * is guaranteed to use only analog amplification for applying the gain.</p>
2194 * <p>If the camera device cannot apply the exact sensitivity
2195 * requested, it will reduce the gain to the nearest supported
2196 * value. The final sensitivity used will be available in the
2197 * output capture result.</p>
2198 *
2199 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2200 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002201 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002202 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002203 public static final Key<Integer> SENSOR_SENSITIVITY =
2204 new Key<Integer>("android.sensor.sensitivity", int.class);
2205
2206 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002207 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07002208 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002209 * <p>The timestamps are also included in all image
2210 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07002211 * on all the outputs.</p>
2212 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION android.sensor.info.timestampCalibration} <code>==</code> UNCALIBRATED,
2213 * the timestamps measure time since an unspecified starting point,
2214 * and are monotonically increasing. They can be compared with the
2215 * timestamps for other captures from the same camera device, but are
2216 * not guaranteed to be comparable to any other time source.</p>
2217 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION android.sensor.info.timestampCalibration} <code>==</code> CALIBRATED,
2218 * the timestamps measure time in the same timebase as
2219 * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2220 * compared to other timestamps from other subsystems that are using
2221 * that base.</p>
2222 *
2223 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002224 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002225 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002226 public static final Key<Long> SENSOR_TIMESTAMP =
2227 new Key<Long>("android.sensor.timestamp", long.class);
2228
2229 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002230 * <p>The estimated camera neutral color in the native sensor colorspace at
2231 * the time of capture.</p>
2232 * <p>This value gives the neutral color point encoded as an RGB value in the
2233 * native sensor color space. The neutral color point indicates the
2234 * currently estimated white point of the scene illumination. It can be
2235 * used to interpolate between the provided color transforms when
2236 * processing raw sensor data.</p>
2237 * <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 -08002238 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2239 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002240 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08002241 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2242 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2243
2244 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002245 * <p>Noise model coefficients for each CFA mosaic channel.</p>
2246 * <p>This tag contains two noise model coefficients for each CFA channel
2247 * corresponding to the sensor amplification (S) and sensor readout
2248 * noise (O). These are given as pairs of coefficients for each channel
2249 * in the same order as channels listed for the CFA layout tag
2250 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
2251 * represented as an array of Pair&lt;Double, Double&gt;, where
2252 * the first member of the Pair at index n is the S coefficient and the
2253 * second member is the O coefficient for the nth color channel in the CFA.</p>
2254 * <p>These coefficients are used in a two parameter noise model to describe
2255 * the amount of noise present in the image for each CFA channel. The
2256 * noise model used here is:</p>
2257 * <p>N(x) = sqrt(Sx + O)</p>
2258 * <p>Where x represents the recorded signal of a CFA channel normalized to
2259 * the range [0, 1], and S and O are the noise model coeffiecients for
2260 * that channel.</p>
2261 * <p>A more detailed description of the noise model can be found in the
2262 * Adobe DNG specification for the NoiseProfile tag.</p>
2263 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2264 *
2265 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2266 */
2267 @PublicKey
2268 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
2269 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
2270
2271 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002272 * <p>The worst-case divergence between Bayer green channels.</p>
2273 * <p>This value is an estimate of the worst case split between the
2274 * Bayer green channels in the red and blue rows in the sensor color
2275 * filter array.</p>
2276 * <p>The green split is calculated as follows:</p>
2277 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002278 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2279 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2280 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2281 * chosen is implementation defined, and should be chosen to provide a
2282 * green split estimate that is both representative of the entire image
2283 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002284 * <li>The arithmetic mean of the green channels from the red
2285 * rows (mean_Gr) within W is computed.</li>
2286 * <li>The arithmetic mean of the green channels from the blue
2287 * rows (mean_Gb) within W is computed.</li>
2288 * <li>The maximum ratio R of the two means is computed as follows:
2289 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2290 * </ol>
2291 * <p>The ratio R is the green split divergence reported for this property,
2292 * which represents how much the green channels differ in the mosaic
2293 * pattern. This value is typically used to determine the treatment of
2294 * the green mosaic channels when demosaicing.</p>
2295 * <p>The green split value can be roughly interpreted as follows:</p>
2296 * <ul>
2297 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2298 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2299 * correction to avoid demosaic errors (3-20% divergence).</li>
2300 * <li>R &gt; 1.20 will require strong software correction to produce
2301 * a usuable image (&gt;20% divergence).</li>
2302 * </ul>
2303 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2304 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002305 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08002306 public static final Key<Float> SENSOR_GREEN_SPLIT =
2307 new Key<Float>("android.sensor.greenSplit", float.class);
2308
2309 /**
Zhijun He379af012014-05-06 11:54:54 -07002310 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2311 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2312 * <p>Each color channel is treated as an unsigned 32-bit integer.
2313 * The camera device then uses the most significant X bits
2314 * that correspond to how many bits are in its Bayer raw sensor
2315 * output.</p>
2316 * <p>For example, a sensor with RAW10 Bayer output would use the
2317 * 10 most significant bits from each color channel.</p>
2318 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2319 *
2320 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2321 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002322 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002323 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2324 new Key<int[]>("android.sensor.testPatternData", int[].class);
2325
2326 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002327 * <p>When enabled, the sensor sends a test pattern instead of
2328 * doing a real exposure from the camera.</p>
2329 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002330 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002331 * work as normal.</p>
2332 * <p>For example, if manual flash is enabled, flash firing should still
2333 * occur (and that the test pattern remain unmodified, since the flash
2334 * would not actually affect it).</p>
2335 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2336 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2337 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2338 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2339 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2340 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2341 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2342 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002343 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002344 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2345 new Key<Integer>("android.sensor.testPatternMode", int.class);
2346
2347 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07002348 * <p>Duration between the start of first row exposure
2349 * and the start of last row exposure.</p>
2350 * <p>This is the exposure time skew (in the unit of nanosecond) between the first and
2351 * last row exposure start times. The first row and the last row are the first
2352 * and last rows inside of the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2353 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
2354 * to the frame readout time.</p>
2355 *
2356 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2357 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002358 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07002359 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
2360 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
2361
2362 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002363 * <p>Quality of lens shading correction applied
2364 * to the image data.</p>
2365 * <p>When set to OFF mode, no lens shading correction will be applied by the
2366 * camera device, and an identity lens shading map data will be provided
2367 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
Ruben Brunk57493682014-05-27 18:58:08 -07002368 * shading map with size specified as <code>android.lens.info.shadingMapSize = [ 4, 3 ]</code>,
2369 * the output android.statistics.lensShadingMap for this case will be an identity map
Zhijun Heba93fe62014-01-17 16:43:05 -08002370 * shown below:</p>
2371 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2372 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2373 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2374 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2375 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2376 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
2377 * </code></pre>
2378 * <p>When set to other modes, lens shading correction will be applied by the
2379 * camera device. Applications can request lens shading map data by setting
2380 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide
Ruben Brunk57493682014-05-27 18:58:08 -07002381 * lens shading map data in android.statistics.lensShadingMap, with size specified
2382 * by android.lens.info.shadingMapSize; the returned shading map data will be the one
Zhijun Hefa7c7552014-05-22 16:36:02 -07002383 * applied by the camera device for this capture request.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002384 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore the reliability
Zhijun Hefa7c7552014-05-22 16:36:02 -07002385 * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in
2386 * AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code> OFF),
2387 * to get best results, it is recommended that the applications wait for the AE and AWB to
2388 * be converged before using the returned shading map data.</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002389 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002390 * @see CaptureRequest#CONTROL_AE_MODE
2391 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun Heba93fe62014-01-17 16:43:05 -08002392 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2393 * @see #SHADING_MODE_OFF
2394 * @see #SHADING_MODE_FAST
2395 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002396 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002397 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08002398 public static final Key<Integer> SHADING_MODE =
2399 new Key<Integer>("android.shading.mode", int.class);
2400
2401 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002402 * <p>Control for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002403 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002404 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002405 * should output just the basic fields or the full set of
2406 * fields. Value must be one of the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002407 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p>
2408 *
2409 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002410 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2411 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2412 * @see #STATISTICS_FACE_DETECT_MODE_FULL
2413 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002414 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002415 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2416 new Key<Integer>("android.statistics.faceDetectMode", int.class);
2417
2418 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002419 * <p>List of unique IDs for detected faces.</p>
2420 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
2421 * to the camera device. A face that leaves the field of view and later returns may be
2422 * assigned a new ID.</p>
2423 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL</p>
2424 *
2425 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002426 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002427 */
2428 public static final Key<int[]> STATISTICS_FACE_IDS =
2429 new Key<int[]>("android.statistics.faceIds", int[].class);
2430
2431 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002432 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002433 * faces.</p>
2434 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2435 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
2436 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL</p>
2437 *
2438 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2439 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002440 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002441 */
2442 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
2443 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
2444
2445 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002446 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002447 * faces.</p>
2448 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2449 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
2450 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF</p>
2451 *
2452 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2453 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002454 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002455 */
2456 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
2457 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
2458
2459 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002460 * <p>List of the face confidence scores for
2461 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002462 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
2463 *
2464 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002465 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002466 */
2467 public static final Key<byte[]> STATISTICS_FACE_SCORES =
2468 new Key<byte[]>("android.statistics.faceScores", byte[].class);
2469
2470 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002471 * <p>List of the faces detected through camera face detection
2472 * in this result.</p>
2473 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
2474 *
2475 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
2476 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002477 @PublicKey
2478 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002479 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
2480 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
2481
2482 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002483 * <p>The shading map is a low-resolution floating-point map
2484 * that lists the coefficients used to correct for vignetting, for each
2485 * Bayer color channel.</p>
2486 * <p>The least shaded section of the image should have a gain factor
2487 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002488 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08002489 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002490 * <p>The shading map is for the entire active pixel array, and is not
2491 * affected by the crop region specified in the request. Each shading map
2492 * entry is the value of the shading compensation map over a specific
2493 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2494 * map, and an active pixel array size (W x H), shading map entry
2495 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2496 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2497 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2498 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2499 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07002500 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002501 * <p>The shading map should have on the order of 30-40 rows and columns,
2502 * and must be smaller than 64x64.</p>
2503 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002504 * <pre><code>width,height = [ 4, 3 ]
2505 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002506 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002507 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2508 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2509 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2510 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2511 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002512 * </code></pre>
2513 * <p>The low-resolution scaling map images for each channel are
2514 * (displayed using nearest-neighbor interpolation):</p>
2515 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2516 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2517 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2518 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2519 * <p>As a visualization only, inverting the full-color map to recover an
2520 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2521 * <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 Talvala0da8bf52014-01-08 16:18:35 -08002522 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002523 * @see CaptureRequest#COLOR_CORRECTION_MODE
Ruben Brunk57493682014-05-27 18:58:08 -07002524 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002525 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07002526 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
2527 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
2528
2529 /**
2530 * <p>The shading map is a low-resolution floating-point map
2531 * that lists the coefficients used to correct for vignetting, for each
2532 * Bayer color channel.</p>
2533 * <p>The least shaded section of the image should have a gain factor
2534 * of 1; all other sections should have gains above 1.</p>
2535 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
2536 * must take into account the colorCorrection settings.</p>
2537 * <p>The shading map is for the entire active pixel array, and is not
2538 * affected by the crop region specified in the request. Each shading map
2539 * entry is the value of the shading compensation map over a specific
2540 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2541 * map, and an active pixel array size (W x H), shading map entry
2542 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2543 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2544 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2545 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2546 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
2547 * The shading map is stored in a fully interleaved format, and its size
2548 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
2549 * <p>The shading map should have on the order of 30-40 rows and columns,
2550 * and must be smaller than 64x64.</p>
2551 * <p>As an example, given a very small map defined as:</p>
2552 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
2553 * android.statistics.lensShadingMap =
2554 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
2555 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2556 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2557 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2558 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2559 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
2560 * </code></pre>
2561 * <p>The low-resolution scaling map images for each channel are
2562 * (displayed using nearest-neighbor interpolation):</p>
2563 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2564 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2565 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2566 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2567 * <p>As a visualization only, inverting the full-color map to recover an
2568 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2569 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
2570 *
2571 * @see CaptureRequest#COLOR_CORRECTION_MODE
2572 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002573 */
2574 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
2575 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
2576
2577 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002578 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08002579 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002580 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002581 * since statistics processing on data from a new frame
2582 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08002583 * applied to that frame.</p>
2584 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002585 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002586 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08002587 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002588 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002589 *
2590 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07002591 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002592 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002593 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002594 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002595 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
2596 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
2597
2598 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002599 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08002600 * calculated by the camera device's statistics units for the current
2601 * output frame.</p>
2602 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002603 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08002604 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002605 * are the best fit for the current output frame. This may
2606 * be different than the transform used for this frame, since
2607 * statistics processing on data from a new frame typically
2608 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002609 * that frame.</p>
2610 * <p>These estimates must be provided for all frames, even if
2611 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002612 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08002613 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002614 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002615 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002616 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002617 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002618 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002619 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
2620 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
2621
2622 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08002623 * <p>The camera device estimated scene illumination lighting
2624 * frequency.</p>
2625 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
2626 * that depends on the local utility power standards. This flicker must be
2627 * accounted for by auto-exposure routines to avoid artifacts in captured images.
2628 * The camera device uses this entry to tell the application what the scene
2629 * illuminant frequency is.</p>
2630 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002631 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
2632 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
2633 * antibanding, and the application can ensure it selects
2634 * exposure times that do not cause banding issues by looking
2635 * into this metadata field. See
2636 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
2637 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08002638 *
2639 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
2640 * @see CaptureRequest#CONTROL_AE_MODE
2641 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002642 * @see #STATISTICS_SCENE_FLICKER_NONE
2643 * @see #STATISTICS_SCENE_FLICKER_50HZ
2644 * @see #STATISTICS_SCENE_FLICKER_60HZ
2645 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002646 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002647 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
2648 new Key<Integer>("android.statistics.sceneFlicker", int.class);
2649
2650 /**
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002651 * <p>Operating mode for hotpixel map generation.</p>
2652 * <p>If set to ON, a hotpixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002653 * If set to OFF, no hotpixel map will be returned.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002654 * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p>
2655 *
2656 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2657 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2658 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002659 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002660 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2661 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2662
2663 /**
2664 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
2665 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
2666 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
2667 * bottom-right of the pixel array, respectively. The width and
2668 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
2669 * This may include hot pixels that lie outside of the active array
2670 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2671 *
2672 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2673 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2674 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002675 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002676 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
2677 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002678
2679 /**
Zhijun He379af012014-05-06 11:54:54 -07002680 * <p>Whether the camera device will output the lens
2681 * shading map in output result metadata.</p>
2682 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002683 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07002684 * the output result metadata.</p>
Zhijun He379af012014-05-06 11:54:54 -07002685 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2686 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2687 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002688 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002689 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2690 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2691
2692 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002693 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08002694 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2695 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002696 * <p>See android.tonemap.curveRed for more details.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002697 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002698 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002699 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002700 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002701 public static final Key<float[]> TONEMAP_CURVE_BLUE =
2702 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002703
2704 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002705 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08002706 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2707 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002708 * <p>See android.tonemap.curveRed for more details.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002709 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002710 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002711 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002712 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002713 public static final Key<float[]> TONEMAP_CURVE_GREEN =
2714 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002715
2716 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002717 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08002718 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2719 * CONTRAST_CURVE.</p>
2720 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002721 * <pre><code>android.tonemap.curveRed =
Igor Murashkine0060932014-01-17 17:24:11 -08002722 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08002723 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Igor Murashkine0060932014-01-17 17:24:11 -08002724 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2725 * guaranteed that input values 0.0 and 1.0 are included in the list to
2726 * define a complete mapping. For input values between control points,
2727 * the camera device must linearly interpolate between the control
2728 * points.</p>
2729 * <p>Each curve can have an independent number of points, and the number
2730 * of points can be less than max (that is, the request doesn't have to
2731 * always provide a curve with number of points equivalent to
2732 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2733 * <p>A few examples, and their corresponding graphical mappings; these
2734 * only specify the red channel and the precision is limited to 4
2735 * digits, for conciseness.</p>
2736 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002737 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002738 * </code></pre>
2739 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2740 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002741 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002742 * </code></pre>
2743 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2744 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002745 * <pre><code>android.tonemap.curveRed = [
Igor Murashkine0060932014-01-17 17:24:11 -08002746 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2747 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2748 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2749 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
2750 * </code></pre>
2751 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2752 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002753 * <pre><code>android.tonemap.curveRed = [
Igor Murashkine0060932014-01-17 17:24:11 -08002754 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2755 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2756 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2757 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
2758 * </code></pre>
2759 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002760 *
Igor Murashkine0060932014-01-17 17:24:11 -08002761 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002762 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002763 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002764 */
2765 public static final Key<float[]> TONEMAP_CURVE_RED =
2766 new Key<float[]>("android.tonemap.curveRed", float[].class);
2767
2768 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002769 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
2770 * is CONTRAST_CURVE.</p>
2771 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
2772 * channels respectively. The following example uses the red channel as an
2773 * example. The same logic applies to green and blue channel.
2774 * Each channel's curve is defined by an array of control points:</p>
2775 * <pre><code>curveRed =
2776 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
2777 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
2778 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2779 * guaranteed that input values 0.0 and 1.0 are included in the list to
2780 * define a complete mapping. For input values between control points,
2781 * the camera device must linearly interpolate between the control
2782 * points.</p>
2783 * <p>Each curve can have an independent number of points, and the number
2784 * of points can be less than max (that is, the request doesn't have to
2785 * always provide a curve with number of points equivalent to
2786 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2787 * <p>A few examples, and their corresponding graphical mappings; these
2788 * only specify the red channel and the precision is limited to 4
2789 * digits, for conciseness.</p>
2790 * <p>Linear mapping:</p>
2791 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
2792 * </code></pre>
2793 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2794 * <p>Invert mapping:</p>
2795 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
2796 * </code></pre>
2797 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2798 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2799 * <pre><code>curveRed = [
2800 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
2801 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
2802 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
2803 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
2804 * </code></pre>
2805 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2806 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2807 * <pre><code>curveRed = [
2808 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
2809 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
2810 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
2811 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
2812 * </code></pre>
2813 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
2814 *
2815 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
2816 * @see CaptureRequest#TONEMAP_MODE
2817 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002818 @PublicKey
2819 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002820 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
2821 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
2822
2823 /**
Igor Murashkine0060932014-01-17 17:24:11 -08002824 * <p>High-level global contrast/gamma/tonemapping control.</p>
2825 * <p>When switching to an application-defined contrast curve by setting
2826 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2827 * per-channel with a set of <code>(in, out)</code> points that specify the
2828 * mapping from input high-bit-depth pixel value to the output
2829 * low-bit-depth value. Since the actual pixel ranges of both input
2830 * and output may change depending on the camera pipeline, the values
2831 * are specified by normalized floating-point numbers.</p>
2832 * <p>More-complex color mapping operations such as 3D color look-up
2833 * tables, selective chroma enhancement, or other non-linear color
2834 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2835 * CONTRAST_CURVE.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002836 * <p>This must be set to a valid mode in
2837 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08002838 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002839 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08002840 * These values are always available, and as close as possible to the
2841 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07002842 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08002843 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2844 * roughly the same.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002845 *
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002846 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002847 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08002848 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002849 * @see #TONEMAP_MODE_CONTRAST_CURVE
2850 * @see #TONEMAP_MODE_FAST
2851 * @see #TONEMAP_MODE_HIGH_QUALITY
2852 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002853 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002854 public static final Key<Integer> TONEMAP_MODE =
2855 new Key<Integer>("android.tonemap.mode", int.class);
2856
2857 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002858 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002859 * that the camera is powered on and may be streaming images back to the
2860 * Application Processor. In certain rare circumstances, the OS may
2861 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002862 * any untrusted applications.</p>
2863 * <p>In particular, the LED <em>must</em> always be on when the data could be
2864 * transmitted off the device. The LED <em>should</em> always be on whenever
2865 * data is stored locally on the device.</p>
2866 * <p>The LED <em>may</em> be off if a trusted application is using the data that
2867 * doesn't violate the above rules.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002868 * @hide
2869 */
2870 public static final Key<Boolean> LED_TRANSMIT =
2871 new Key<Boolean>("android.led.transmit", boolean.class);
2872
2873 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002874 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002875 * to its current values, or is free to vary.</p>
2876 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002877 * 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 -08002878 * a change in other capture settings forced the camera device to
2879 * perform a black level reset.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002880 *
2881 * @see CaptureRequest#BLACK_LEVEL_LOCK
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002882 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002883 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002884 public static final Key<Boolean> BLACK_LEVEL_LOCK =
2885 new Key<Boolean>("android.blackLevel.lock", boolean.class);
2886
Igor Murashkin3865a842014-01-17 18:18:39 -08002887 /**
2888 * <p>The frame number corresponding to the last request
2889 * with which the output result (metadata + buffers) has been fully
2890 * synchronized.</p>
2891 * <p>When a request is submitted to the camera device, there is usually a
2892 * delay of several frames before the controls get applied. A camera
2893 * device may either choose to account for this delay by implementing a
2894 * pipeline and carefully submit well-timed atomic control updates, or
2895 * it may start streaming control changes that span over several frame
2896 * boundaries.</p>
2897 * <p>In the latter case, whenever a request's settings change relative to
2898 * the previous submitted request, the full set of changes may take
2899 * multiple frame durations to fully take effect. Some settings may
2900 * take effect sooner (in less frame durations) than others.</p>
2901 * <p>While a set of control changes are being propagated, this value
2902 * will be CONVERGING.</p>
2903 * <p>Once it is fully known that a set of control changes have been
2904 * finished propagating, and the resulting updated control settings
2905 * have been read back by the camera device, this value will be set
2906 * to a non-negative frame number (corresponding to the request to
2907 * which the results have synchronized to).</p>
2908 * <p>Older camera device implementations may not have a way to detect
2909 * when all camera controls have been applied, and will always set this
2910 * value to UNKNOWN.</p>
2911 * <p>FULL capability devices will always have this value set to the
2912 * frame number of the request corresponding to this result.</p>
2913 * <p><em>Further details</em>:</p>
2914 * <ul>
2915 * <li>Whenever a request differs from the last request, any future
2916 * results not yet returned may have this value set to CONVERGING (this
2917 * could include any in-progress captures not yet returned by the camera
2918 * device, for more details see pipeline considerations below).</li>
2919 * <li>Submitting a series of multiple requests that differ from the
2920 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
2921 * moves the new synchronization frame to the last non-repeating
2922 * request (using the smallest frame number from the contiguous list of
2923 * repeating requests).</li>
2924 * <li>Submitting the same request repeatedly will not change this value
2925 * to CONVERGING, if it was already a non-negative value.</li>
2926 * <li>When this value changes to non-negative, that means that all of the
2927 * metadata controls from the request have been applied, all of the
2928 * metadata controls from the camera device have been read to the
2929 * updated values (into the result), and all of the graphics buffers
2930 * corresponding to this result are also synchronized to the request.</li>
2931 * </ul>
2932 * <p><em>Pipeline considerations</em>:</p>
2933 * <p>Submitting a request with updated controls relative to the previously
2934 * submitted requests may also invalidate the synchronization state
2935 * of all the results corresponding to currently in-flight requests.</p>
2936 * <p>In other words, results for this current request and up to
2937 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
2938 * android.sync.frameNumber change to CONVERGING.</p>
2939 *
2940 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2941 * @see #SYNC_FRAME_NUMBER_CONVERGING
2942 * @see #SYNC_FRAME_NUMBER_UNKNOWN
2943 * @hide
2944 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07002945 public static final Key<Long> SYNC_FRAME_NUMBER =
2946 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08002947
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002948 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2949 * End generated code
2950 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07002951
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002952}