blob: 65b662763f8fe0bbc9f1aa1591dbac37ba6dd4ce [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 Murashkind6d65152014-05-19 16:31:02 -070020import android.hardware.camera2.utils.TypeReference;
21import android.util.Log;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070022import android.util.Rational;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080023
Igor Murashkind6d65152014-05-19 16:31:02 -070024import java.util.List;
25
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080026/**
Igor Murashkindb075af2014-05-21 10:07:08 -070027 * <p>The subset of the results of a single image capture from the image sensor.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080028 *
Igor Murashkindb075af2014-05-21 10:07:08 -070029 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080030 * flash), the processing pipeline, the control algorithms, and the output
31 * buffers.</p>
32 *
33 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
34 * {@link CaptureRequest}. All properties listed for capture requests can also
35 * be queried on the capture result, to determine the final values used for
36 * capture. The result also includes additional metadata about the state of the
37 * camera device during the capture.</p>
38 *
Igor Murashkindb075af2014-05-21 10:07:08 -070039 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
40 * are necessarily available. Some results are {@link CaptureResult partial} and will
41 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
42 * every key available that was enabled by the request.</p>
43 *
44 * <p>{@link CaptureResult} objects are immutable.</p>
Ruben Brunkf967a542014-04-28 16:31:11 -070045 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080046 */
Igor Murashkindb075af2014-05-21 10:07:08 -070047public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
Igor Murashkind6d65152014-05-19 16:31:02 -070048
49 private static final String TAG = "CaptureResult";
50 private static final boolean VERBOSE = false;
51
52 /**
53 * A {@code Key} is used to do capture result field lookups with
54 * {@link CaptureResult#get}.
55 *
56 * <p>For example, to get the timestamp corresponding to the exposure of the first row:
57 * <code><pre>
58 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
59 * </pre></code>
60 * </p>
61 *
62 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
63 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
64 *
65 * @see CaptureResult#get
66 * @see CameraCharacteristics#getAvailableCaptureResultKeys
67 */
68 public final static class Key<T> {
69 private final CameraMetadataNative.Key<T> mKey;
70
71 /**
72 * Visible for testing and vendor extensions only.
73 *
74 * @hide
75 */
76 public Key(String name, Class<T> type) {
77 mKey = new CameraMetadataNative.Key<T>(name, type);
78 }
79
80 /**
81 * Visible for testing and vendor extensions only.
82 *
83 * @hide
84 */
85 public Key(String name, TypeReference<T> typeReference) {
86 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
87 }
88
89 /**
90 * Return a camelCase, period separated name formatted like:
91 * {@code "root.section[.subsections].name"}.
92 *
93 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
94 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
95 *
96 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
97 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
98 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
99 *
100 * @return String representation of the key name
101 */
102 public String getName() {
103 return mKey.getName();
104 }
105
106 /**
107 * {@inheritDoc}
108 */
109 @Override
110 public final int hashCode() {
111 return mKey.hashCode();
112 }
113
114 /**
115 * {@inheritDoc}
116 */
117 @SuppressWarnings("unchecked")
118 @Override
119 public final boolean equals(Object o) {
120 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
121 }
122
123 /**
124 * Visible for CameraMetadataNative implementation only; do not use.
125 *
126 * TODO: Make this private or remove it altogether.
127 *
128 * @hide
129 */
130 public CameraMetadataNative.Key<T> getNativeKey() {
131 return mKey;
132 }
133
134 @SuppressWarnings({ "unchecked" })
135 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
136 mKey = (CameraMetadataNative.Key<T>) nativeKey;
137 }
138 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700139
140 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700141 private final CaptureRequest mRequest;
142 private final int mSequenceId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700143
Igor Murashkin70725502013-06-25 20:27:06 +0000144 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700145 * Takes ownership of the passed-in properties object
Igor Murashkin70725502013-06-25 20:27:06 +0000146 * @hide
147 */
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700148 public CaptureResult(CameraMetadataNative results, CaptureRequest parent, int sequenceId) {
149 if (results == null) {
150 throw new IllegalArgumentException("results was null");
151 }
152
153 if (parent == null) {
154 throw new IllegalArgumentException("parent was null");
155 }
156
Igor Murashkind6d65152014-05-19 16:31:02 -0700157 mResults = CameraMetadataNative.move(results);
158 if (mResults.isEmpty()) {
159 throw new AssertionError("Results must not be empty");
160 }
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700161 mRequest = parent;
162 mSequenceId = sequenceId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700163 }
164
Ruben Brunkf967a542014-04-28 16:31:11 -0700165 /**
166 * Returns a copy of the underlying {@link CameraMetadataNative}.
167 * @hide
168 */
169 public CameraMetadataNative getNativeCopy() {
170 return new CameraMetadataNative(mResults);
171 }
172
Igor Murashkind6d65152014-05-19 16:31:02 -0700173 /**
174 * Creates a request-less result.
175 *
176 * <p><strong>For testing only.</strong></p>
177 * @hide
178 */
179 public CaptureResult(CameraMetadataNative results, int sequenceId) {
180 if (results == null) {
181 throw new IllegalArgumentException("results was null");
182 }
183
184 mResults = CameraMetadataNative.move(results);
185 if (mResults.isEmpty()) {
186 throw new AssertionError("Results must not be empty");
187 }
188
189 mRequest = null;
190 mSequenceId = sequenceId;
191 }
192
193 /**
194 * Get a capture result field value.
195 *
196 * <p>The field definitions can be found in {@link CaptureResult}.</p>
197 *
198 * <p>Querying the value for the same key more than once will return a value
199 * which is equal to the previous queried value.</p>
200 *
201 * @throws IllegalArgumentException if the key was not valid
202 *
203 * @param key The result field to read.
204 * @return The value of that key, or {@code null} if the field is not set.
205 */
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700206 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700207 T value = mResults.get(key);
208 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
209 return value;
210 }
211
212 /**
213 * {@inheritDoc}
214 * @hide
215 */
216 @SuppressWarnings("unchecked")
217 @Override
218 protected <T> T getProtected(Key<?> key) {
219 return (T) mResults.get(key);
220 }
221
222 /**
223 * {@inheritDoc}
224 * @hide
225 */
226 @SuppressWarnings("unchecked")
227 @Override
228 protected Class<Key<?>> getKeyClass() {
229 Object thisClass = Key.class;
230 return (Class<Key<?>>)thisClass;
231 }
232
233 /**
234 * Dumps the native metadata contents to logcat.
235 *
236 * <p>Visibility for testing/debugging only. The results will not
237 * include any synthesized keys, as they are invisible to the native layer.</p>
238 *
239 * @hide
240 */
241 public void dumpToLog() {
242 mResults.dumpToLog();
243 }
244
245 /**
246 * {@inheritDoc}
247 */
248 @Override
249 public List<Key<?>> getKeys() {
250 // Force the javadoc for this function to show up on the CaptureResult page
251 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800252 }
253
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700254 /**
255 * Get the request associated with this result.
256 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700257 * <p>Whenever a request has been fully or partially captured, with
258 * {@link CameraDevice.CaptureListener#onCaptureCompleted} or
259 * {@link CameraDevice.CaptureListener#onCaptureProgressed}, the {@code result}'s
260 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700261 * </p>
262 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700263 * <p>For example,
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700264 * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() {
265 * {@literal @}Override
266 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
267 * assert(myResult.getRequest.equals(myRequest) == true);
268 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700269 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700270 * </code></pre>
271 * </p>
272 *
273 * @return The request associated with this result. Never {@code null}.
274 */
275 public CaptureRequest getRequest() {
276 return mRequest;
277 }
278
279 /**
280 * Get the frame number associated with this result.
281 *
282 * <p>Whenever a request has been processed, regardless of failure or success,
283 * it gets a unique frame number assigned to its future result/failure.</p>
284 *
285 * <p>This value monotonically increments, starting with 0,
286 * for every new result or failure; and the scope is the lifetime of the
287 * {@link CameraDevice}.</p>
288 *
289 * @return int frame number
290 */
291 public int getFrameNumber() {
Igor Murashkind6d65152014-05-19 16:31:02 -0700292 // TODO: @hide REQUEST_FRAME_COUNT
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700293 return get(REQUEST_FRAME_COUNT);
294 }
295
296 /**
297 * The sequence ID for this failure that was returned by the
298 * {@link CameraDevice#capture} family of functions.
299 *
300 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
301 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
302 *
303 * @return int The ID for the sequence of requests that this capture result is a part of
304 *
305 * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted
Igor Murashkindb075af2014-05-21 10:07:08 -0700306 * @see CameraDevice.CaptureListener#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700307 */
308 public int getSequenceId() {
309 return mSequenceId;
310 }
311
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700312 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
313 * The key entries below this point are generated from metadata
314 * definitions in /system/media/camera/docs. Do not modify by hand or
315 * modify the comment blocks at the start or end.
316 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
317
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800318
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700319 /**
Zhijun He379af012014-05-06 11:54:54 -0700320 * <p>The mode control selects how the image data is converted from the
321 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700322 * <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 -0700323 * control is overridden by the AWB routine. When AWB is disabled, the
324 * application controls how the color mapping is performed.</p>
325 * <p>We define the expected processing pipeline below. For consistency
326 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
327 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
328 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
329 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
330 * camera device (in the results) and be roughly correct.</p>
331 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
332 * FAST or HIGH_QUALITY will yield a picture with the same white point
333 * as what was produced by the camera device in the earlier frame.</p>
334 * <p>The expected processing pipeline is as follows:</p>
335 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
336 * <p>The white balance is encoded by two values, a 4-channel white-balance
337 * gain vector (applied in the Bayer domain), and a 3x3 color transform
338 * matrix (applied after demosaic).</p>
339 * <p>The 4-channel white-balance gains are defined as:</p>
340 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
341 * </code></pre>
342 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
343 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
344 * These may be identical for a given camera device implementation; if
345 * the camera device does not support a separate gain for even/odd green
346 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
347 * <code>G_even</code> in the output result metadata.</p>
348 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
349 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
350 * </code></pre>
351 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
352 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
353 * <p>with colors as follows:</p>
354 * <pre><code>r' = I0r + I1g + I2b
355 * g' = I3r + I4g + I5b
356 * b' = I6r + I7g + I8b
357 * </code></pre>
358 * <p>Both the input and output value ranges must match. Overflow/underflow
359 * values are clipped to fit within the range.</p>
360 *
361 * @see CaptureRequest#COLOR_CORRECTION_GAINS
362 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
363 * @see CaptureRequest#CONTROL_AWB_MODE
364 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
365 * @see #COLOR_CORRECTION_MODE_FAST
366 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
367 */
368 public static final Key<Integer> COLOR_CORRECTION_MODE =
369 new Key<Integer>("android.colorCorrection.mode", int.class);
370
371 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800372 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700373 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800374 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800375 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700376 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800377 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800378 * <p>In the latter case, the camera device may round the matrix to account
379 * for precision issues; the final rounded matrix should be reported back
380 * in this matrix result metadata. The transform should keep the magnitude
381 * of the output color values within <code>[0, 1.0]</code> (assuming input color
382 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800383 *
384 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700385 */
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700386 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
387 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700388
389 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800390 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800391 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700392 * <p>These per-channel gains are either set by the camera device
393 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
394 * TRANSFORM_MATRIX, or directly by the application in the
395 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
396 * TRANSFORM_MATRIX.</p>
397 * <p>The gains in the result metadata are the gains actually
398 * applied by the camera device to the current frame.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800399 *
400 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700401 */
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700402 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
403 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700404
405 /**
Zhijun He379af012014-05-06 11:54:54 -0700406 * <p>The desired setting for the camera device's auto-exposure
407 * algorithm's antibanding compensation.</p>
408 * <p>Some kinds of lighting fixtures, such as some fluorescent
409 * lights, flicker at the rate of the power supply frequency
410 * (60Hz or 50Hz, depending on country). While this is
411 * typically not noticeable to a person, it can be visible to
412 * a camera device. If a camera sets its exposure time to the
413 * wrong value, the flicker may become visible in the
414 * viewfinder as flicker or in a final captured image, as a
415 * set of variable-brightness bands across the image.</p>
416 * <p>Therefore, the auto-exposure routines of camera devices
417 * include antibanding routines that ensure that the chosen
418 * exposure value will not cause such banding. The choice of
419 * exposure time depends on the rate of flicker, which the
420 * camera device can detect automatically, or the expected
421 * rate can be selected by the application using this
422 * control.</p>
423 * <p>A given camera device may not support all of the possible
424 * options for the antibanding mode. The
425 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
426 * the available modes for a given camera device.</p>
427 * <p>The default mode is AUTO, which must be supported by all
428 * camera devices.</p>
429 * <p>If manual exposure control is enabled (by setting
430 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
431 * then this setting has no effect, and the application must
432 * ensure it selects exposure times that do not cause banding
433 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
434 * the application in this.</p>
435 *
436 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
437 * @see CaptureRequest#CONTROL_AE_MODE
438 * @see CaptureRequest#CONTROL_MODE
439 * @see CaptureResult#STATISTICS_SCENE_FLICKER
440 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
441 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
442 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
443 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
444 */
445 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
446 new Key<Integer>("android.control.aeAntibandingMode", int.class);
447
448 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700449 * <p>Adjustment to auto-exposure (AE) target image
450 * brightness.</p>
451 * <p>The adjustment is measured as a count of steps, with the
452 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
453 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
454 * <p>For example, if the exposure value (EV) step is 0.333, '6'
455 * will mean an exposure compensation of +2 EV; -3 will mean an
456 * exposure compensation of -1 EV. One EV represents a doubling
457 * of image brightness. Note that this control will only be
458 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
459 * 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 -0700460 * <p>In the event of exposure compensation value being changed, camera device
461 * may take several frames to reach the newly requested exposure target.
462 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
463 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
464 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
465 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
466 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700467 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
468 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700469 * @see CaptureRequest#CONTROL_AE_LOCK
470 * @see CaptureRequest#CONTROL_AE_MODE
471 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700472 */
473 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
474 new Key<Integer>("android.control.aeExposureCompensation", int.class);
475
476 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700477 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700478 * calculated values.</p>
479 * <p>Note that even when AE is locked, the flash may be
480 * fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / ON_ALWAYS_FLASH /
481 * ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700482 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
483 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700484 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
485 * when AE is already locked, the camera device will not change the exposure time
486 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
487 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
488 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
489 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
490 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
491 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700492 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700493 * @see CaptureRequest#CONTROL_AE_MODE
494 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
495 * @see CaptureResult#CONTROL_AE_STATE
496 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
497 * @see CaptureRequest#SENSOR_SENSITIVITY
498 */
499 public static final Key<Boolean> CONTROL_AE_LOCK =
500 new Key<Boolean>("android.control.aeLock", boolean.class);
501
502 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800503 * <p>The desired mode for the camera device's
504 * auto-exposure routine.</p>
505 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
506 * AUTO.</p>
507 * <p>When set to any of the ON modes, the camera device's
508 * auto-exposure routine is enabled, overriding the
509 * application's selected exposure time, sensor sensitivity,
510 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
511 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
512 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
513 * is selected, the camera device's flash unit controls are
514 * also overridden.</p>
515 * <p>The FLASH modes are only available if the camera device
516 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
517 * <p>If flash TORCH mode is desired, this field must be set to
518 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
519 * <p>When set to any of the ON modes, the values chosen by the
520 * camera device auto-exposure routine for the overridden
521 * fields for a given capture will be available in its
522 * CaptureResult.</p>
523 *
Zhijun He5f2a47f2014-01-16 15:44:41 -0800524 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800525 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
526 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800527 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
528 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800529 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800530 * @see #CONTROL_AE_MODE_OFF
531 * @see #CONTROL_AE_MODE_ON
532 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
533 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
534 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
535 */
536 public static final Key<Integer> CONTROL_AE_MODE =
537 new Key<Integer>("android.control.aeMode", int.class);
538
539 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800540 * <p>List of areas to use for
Ruben Brunkf59521d2014-02-03 17:14:33 -0800541 * metering.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800542 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700543 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800544 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
545 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700546 * bottom-right pixel in the active pixel array.</p>
547 * <p>The weight must range from 0 to 1000, and represents a weight
548 * for every pixel in the area. This means that a large metering area
549 * with the same weight as a smaller area will have more effect in
550 * the metering result. Metering areas can partially overlap and the
551 * camera device will add the weights in the overlap region.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800552 * <p>If all regions have 0 weight, then no specific metering area
Zhijun Hecc28a412014-02-24 15:11:23 -0800553 * needs to be used by the camera device. If the metering region is
Zhijun He14986152014-05-22 21:17:37 -0700554 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
555 * the camera device will ignore the sections outside the region and output the
556 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800557 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800558 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800559 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700560 */
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700561 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
562 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700563
564 /**
Zhijun He379af012014-05-06 11:54:54 -0700565 * <p>Range over which fps can be adjusted to
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700566 * maintain exposure.</p>
567 * <p>Only constrains auto-exposure (AE) algorithm, not
568 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p>
Zhijun He379af012014-05-06 11:54:54 -0700569 *
570 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
571 */
Igor Murashkin78712a82014-05-27 18:32:18 -0700572 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
573 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700574
575 /**
576 * <p>Whether the camera device will trigger a precapture
577 * metering sequence when it processes this request.</p>
578 * <p>This entry is normally set to IDLE, or is not
579 * included at all in the request settings. When included and
580 * set to START, the camera device will trigger the autoexposure
581 * precapture metering sequence.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700582 * <p>The precapture sequence should triggered before starting a
583 * high-quality still capture for final metering decisions to
584 * be made, and for firing pre-capture flash pulses to estimate
585 * scene brightness and required final capture flash power, when
586 * the flash is enabled.</p>
587 * <p>Normally, this entry should be set to START for only a
588 * single request, and the application should wait until the
589 * sequence completes before starting a new one.</p>
590 * <p>The exact effect of auto-exposure (AE) precapture trigger
591 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700592 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
593 * details.</p>
Zhijun He379af012014-05-06 11:54:54 -0700594 *
595 * @see CaptureResult#CONTROL_AE_STATE
596 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
597 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
598 */
599 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
600 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
601
602 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700603 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800604 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
605 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
606 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
607 * the algorithm states to INACTIVE.</p>
608 * <p>The camera device can do several state transitions between two results, if it is
609 * allowed by the state transition table. For example: INACTIVE may never actually be
610 * seen in a result.</p>
611 * <p>The state in the result is the state for this image (in sync with this image): if
612 * AE state becomes CONVERGED, then the image data associated with this result should
613 * be good to use.</p>
614 * <p>Below are state transition tables for different AE modes.</p>
615 * <table>
616 * <thead>
617 * <tr>
618 * <th align="center">State</th>
619 * <th align="center">Transition Cause</th>
620 * <th align="center">New State</th>
621 * <th align="center">Notes</th>
622 * </tr>
623 * </thead>
624 * <tbody>
625 * <tr>
626 * <td align="center">INACTIVE</td>
627 * <td align="center"></td>
628 * <td align="center">INACTIVE</td>
629 * <td align="center">Camera device auto exposure algorithm is disabled</td>
630 * </tr>
631 * </tbody>
632 * </table>
633 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
634 * <table>
635 * <thead>
636 * <tr>
637 * <th align="center">State</th>
638 * <th align="center">Transition Cause</th>
639 * <th align="center">New State</th>
640 * <th align="center">Notes</th>
641 * </tr>
642 * </thead>
643 * <tbody>
644 * <tr>
645 * <td align="center">INACTIVE</td>
646 * <td align="center">Camera device initiates AE scan</td>
647 * <td align="center">SEARCHING</td>
648 * <td align="center">Values changing</td>
649 * </tr>
650 * <tr>
651 * <td align="center">INACTIVE</td>
652 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
653 * <td align="center">LOCKED</td>
654 * <td align="center">Values locked</td>
655 * </tr>
656 * <tr>
657 * <td align="center">SEARCHING</td>
658 * <td align="center">Camera device finishes AE scan</td>
659 * <td align="center">CONVERGED</td>
660 * <td align="center">Good values, not changing</td>
661 * </tr>
662 * <tr>
663 * <td align="center">SEARCHING</td>
664 * <td align="center">Camera device finishes AE scan</td>
665 * <td align="center">FLASH_REQUIRED</td>
666 * <td align="center">Converged but too dark w/o flash</td>
667 * </tr>
668 * <tr>
669 * <td align="center">SEARCHING</td>
670 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
671 * <td align="center">LOCKED</td>
672 * <td align="center">Values locked</td>
673 * </tr>
674 * <tr>
675 * <td align="center">CONVERGED</td>
676 * <td align="center">Camera device initiates AE scan</td>
677 * <td align="center">SEARCHING</td>
678 * <td align="center">Values changing</td>
679 * </tr>
680 * <tr>
681 * <td align="center">CONVERGED</td>
682 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
683 * <td align="center">LOCKED</td>
684 * <td align="center">Values locked</td>
685 * </tr>
686 * <tr>
687 * <td align="center">FLASH_REQUIRED</td>
688 * <td align="center">Camera device initiates AE scan</td>
689 * <td align="center">SEARCHING</td>
690 * <td align="center">Values changing</td>
691 * </tr>
692 * <tr>
693 * <td align="center">FLASH_REQUIRED</td>
694 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
695 * <td align="center">LOCKED</td>
696 * <td align="center">Values locked</td>
697 * </tr>
698 * <tr>
699 * <td align="center">LOCKED</td>
700 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
701 * <td align="center">SEARCHING</td>
702 * <td align="center">Values not good after unlock</td>
703 * </tr>
704 * <tr>
705 * <td align="center">LOCKED</td>
706 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
707 * <td align="center">CONVERGED</td>
708 * <td align="center">Values good after unlock</td>
709 * </tr>
710 * <tr>
711 * <td align="center">LOCKED</td>
712 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
713 * <td align="center">FLASH_REQUIRED</td>
714 * <td align="center">Exposure good, but too dark</td>
715 * </tr>
716 * <tr>
717 * <td align="center">PRECAPTURE</td>
718 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
719 * <td align="center">CONVERGED</td>
720 * <td align="center">Ready for high-quality capture</td>
721 * </tr>
722 * <tr>
723 * <td align="center">PRECAPTURE</td>
724 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
725 * <td align="center">LOCKED</td>
726 * <td align="center">Ready for high-quality capture</td>
727 * </tr>
728 * <tr>
729 * <td align="center">Any state</td>
730 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
731 * <td align="center">PRECAPTURE</td>
732 * <td align="center">Start AE precapture metering sequence</td>
733 * </tr>
734 * </tbody>
735 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800736 * <p>For the above table, the camera device may skip reporting any state changes that happen
737 * without application intervention (i.e. mode switch, trigger, locking). Any state that
738 * can be skipped in that manner is called a transient state.</p>
739 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
740 * listed in above table, it is also legal for the camera device to skip one or more
741 * transient states between two results. See below table for examples:</p>
742 * <table>
743 * <thead>
744 * <tr>
745 * <th align="center">State</th>
746 * <th align="center">Transition Cause</th>
747 * <th align="center">New State</th>
748 * <th align="center">Notes</th>
749 * </tr>
750 * </thead>
751 * <tbody>
752 * <tr>
753 * <td align="center">INACTIVE</td>
754 * <td align="center">Camera device finished AE scan</td>
755 * <td align="center">CONVERGED</td>
756 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
757 * </tr>
758 * <tr>
759 * <td align="center">Any state</td>
760 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
761 * <td align="center">FLASH_REQUIRED</td>
762 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</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, sequence done</td>
767 * <td align="center">CONVERGED</td>
768 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
769 * </tr>
770 * <tr>
771 * <td align="center">CONVERGED</td>
772 * <td align="center">Camera device finished AE scan</td>
773 * <td align="center">FLASH_REQUIRED</td>
774 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
775 * </tr>
776 * <tr>
777 * <td align="center">FLASH_REQUIRED</td>
778 * <td align="center">Camera device finished AE scan</td>
779 * <td align="center">CONVERGED</td>
780 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
781 * </tr>
782 * </tbody>
783 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -0800784 *
785 * @see CaptureRequest#CONTROL_AE_LOCK
786 * @see CaptureRequest#CONTROL_AE_MODE
787 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
788 * @see CaptureRequest#CONTROL_MODE
789 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700790 * @see #CONTROL_AE_STATE_INACTIVE
791 * @see #CONTROL_AE_STATE_SEARCHING
792 * @see #CONTROL_AE_STATE_CONVERGED
793 * @see #CONTROL_AE_STATE_LOCKED
794 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
795 * @see #CONTROL_AE_STATE_PRECAPTURE
796 */
797 public static final Key<Integer> CONTROL_AE_STATE =
798 new Key<Integer>("android.control.aeState", int.class);
799
800 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700801 * <p>Whether auto-focus (AF) is currently enabled, and what
802 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800803 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
804 * (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 -0800805 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800806 * 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 -0800807 * in result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800808 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800809 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800810 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -0800811 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700812 * @see #CONTROL_AF_MODE_OFF
813 * @see #CONTROL_AF_MODE_AUTO
814 * @see #CONTROL_AF_MODE_MACRO
815 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
816 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
817 * @see #CONTROL_AF_MODE_EDOF
818 */
819 public static final Key<Integer> CONTROL_AF_MODE =
820 new Key<Integer>("android.control.afMode", int.class);
821
822 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800823 * <p>List of areas to use for focus
Ruben Brunkf59521d2014-02-03 17:14:33 -0800824 * estimation.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800825 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700826 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800827 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
828 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700829 * bottom-right pixel in the active pixel array.</p>
830 * <p>The weight must range from 0 to 1000, and represents a weight
831 * for every pixel in the area. This means that a large metering area
832 * with the same weight as a smaller area will have more effect in
833 * the metering result. Metering areas can partially overlap and the
834 * camera device will add the weights in the overlap region.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700835 * <p>If all regions have 0 weight, then no specific metering area
836 * needs to be used by the camera device. If the metering region is
837 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
838 * the camera device will ignore the sections outside the region and output the
839 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800840 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800841 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800842 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700843 */
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700844 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
845 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700846
847 /**
Zhijun He379af012014-05-06 11:54:54 -0700848 * <p>Whether the camera device will trigger autofocus for this request.</p>
849 * <p>This entry is normally set to IDLE, or is not
850 * included at all in the request settings.</p>
851 * <p>When included and set to START, the camera device will trigger the
852 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
853 * <p>When set to CANCEL, the camera device will cancel any active trigger,
854 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700855 * <p>Generally, applications should set this entry to START or CANCEL for only a
856 * single capture, and then return it to IDLE (or not set at all). Specifying
857 * START for multiple captures in a row means restarting the AF operation over
858 * and over again.</p>
859 * <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 -0700860 *
861 * @see CaptureResult#CONTROL_AF_STATE
862 * @see #CONTROL_AF_TRIGGER_IDLE
863 * @see #CONTROL_AF_TRIGGER_START
864 * @see #CONTROL_AF_TRIGGER_CANCEL
865 */
866 public static final Key<Integer> CONTROL_AF_TRIGGER =
867 new Key<Integer>("android.control.afTrigger", int.class);
868
869 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700870 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800871 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
872 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
873 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
874 * the algorithm states to INACTIVE.</p>
875 * <p>The camera device can do several state transitions between two results, if it is
876 * allowed by the state transition table. For example: INACTIVE may never actually be
877 * seen in a result.</p>
878 * <p>The state in the result is the state for this image (in sync with this image): if
879 * AF state becomes FOCUSED, then the image data associated with this result should
880 * be sharp.</p>
881 * <p>Below are state transition tables for different AF modes.</p>
882 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
883 * <table>
884 * <thead>
885 * <tr>
886 * <th align="center">State</th>
887 * <th align="center">Transition Cause</th>
888 * <th align="center">New State</th>
889 * <th align="center">Notes</th>
890 * </tr>
891 * </thead>
892 * <tbody>
893 * <tr>
894 * <td align="center">INACTIVE</td>
895 * <td align="center"></td>
896 * <td align="center">INACTIVE</td>
897 * <td align="center">Never changes</td>
898 * </tr>
899 * </tbody>
900 * </table>
901 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
902 * <table>
903 * <thead>
904 * <tr>
905 * <th align="center">State</th>
906 * <th align="center">Transition Cause</th>
907 * <th align="center">New State</th>
908 * <th align="center">Notes</th>
909 * </tr>
910 * </thead>
911 * <tbody>
912 * <tr>
913 * <td align="center">INACTIVE</td>
914 * <td align="center">AF_TRIGGER</td>
915 * <td align="center">ACTIVE_SCAN</td>
916 * <td align="center">Start AF sweep, Lens now moving</td>
917 * </tr>
918 * <tr>
919 * <td align="center">ACTIVE_SCAN</td>
920 * <td align="center">AF sweep done</td>
921 * <td align="center">FOCUSED_LOCKED</td>
922 * <td align="center">Focused, Lens now locked</td>
923 * </tr>
924 * <tr>
925 * <td align="center">ACTIVE_SCAN</td>
926 * <td align="center">AF sweep done</td>
927 * <td align="center">NOT_FOCUSED_LOCKED</td>
928 * <td align="center">Not focused, Lens now locked</td>
929 * </tr>
930 * <tr>
931 * <td align="center">ACTIVE_SCAN</td>
932 * <td align="center">AF_CANCEL</td>
933 * <td align="center">INACTIVE</td>
934 * <td align="center">Cancel/reset AF, Lens now locked</td>
935 * </tr>
936 * <tr>
937 * <td align="center">FOCUSED_LOCKED</td>
938 * <td align="center">AF_CANCEL</td>
939 * <td align="center">INACTIVE</td>
940 * <td align="center">Cancel/reset AF</td>
941 * </tr>
942 * <tr>
943 * <td align="center">FOCUSED_LOCKED</td>
944 * <td align="center">AF_TRIGGER</td>
945 * <td align="center">ACTIVE_SCAN</td>
946 * <td align="center">Start new sweep, Lens now moving</td>
947 * </tr>
948 * <tr>
949 * <td align="center">NOT_FOCUSED_LOCKED</td>
950 * <td align="center">AF_CANCEL</td>
951 * <td align="center">INACTIVE</td>
952 * <td align="center">Cancel/reset AF</td>
953 * </tr>
954 * <tr>
955 * <td align="center">NOT_FOCUSED_LOCKED</td>
956 * <td align="center">AF_TRIGGER</td>
957 * <td align="center">ACTIVE_SCAN</td>
958 * <td align="center">Start new sweep, Lens now moving</td>
959 * </tr>
960 * <tr>
961 * <td align="center">Any state</td>
962 * <td align="center">Mode change</td>
963 * <td align="center">INACTIVE</td>
964 * <td align="center"></td>
965 * </tr>
966 * </tbody>
967 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800968 * <p>For the above table, the camera device may skip reporting any state changes that happen
969 * without application intervention (i.e. mode switch, trigger, locking). Any state that
970 * can be skipped in that manner is called a transient state.</p>
971 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
972 * state transitions listed in above table, it is also legal for the camera device to skip
973 * one or more transient states between two results. See below table for examples:</p>
974 * <table>
975 * <thead>
976 * <tr>
977 * <th align="center">State</th>
978 * <th align="center">Transition Cause</th>
979 * <th align="center">New State</th>
980 * <th align="center">Notes</th>
981 * </tr>
982 * </thead>
983 * <tbody>
984 * <tr>
985 * <td align="center">INACTIVE</td>
986 * <td align="center">AF_TRIGGER</td>
987 * <td align="center">FOCUSED_LOCKED</td>
988 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
989 * </tr>
990 * <tr>
991 * <td align="center">INACTIVE</td>
992 * <td align="center">AF_TRIGGER</td>
993 * <td align="center">NOT_FOCUSED_LOCKED</td>
994 * <td align="center">Focus failed after a scan, lens is now locked.</td>
995 * </tr>
996 * <tr>
997 * <td align="center">FOCUSED_LOCKED</td>
998 * <td align="center">AF_TRIGGER</td>
999 * <td align="center">FOCUSED_LOCKED</td>
1000 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1001 * </tr>
1002 * <tr>
1003 * <td align="center">NOT_FOCUSED_LOCKED</td>
1004 * <td align="center">AF_TRIGGER</td>
1005 * <td align="center">FOCUSED_LOCKED</td>
1006 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1007 * </tr>
1008 * </tbody>
1009 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001010 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1011 * <table>
1012 * <thead>
1013 * <tr>
1014 * <th align="center">State</th>
1015 * <th align="center">Transition Cause</th>
1016 * <th align="center">New State</th>
1017 * <th align="center">Notes</th>
1018 * </tr>
1019 * </thead>
1020 * <tbody>
1021 * <tr>
1022 * <td align="center">INACTIVE</td>
1023 * <td align="center">Camera device initiates new scan</td>
1024 * <td align="center">PASSIVE_SCAN</td>
1025 * <td align="center">Start AF scan, Lens now moving</td>
1026 * </tr>
1027 * <tr>
1028 * <td align="center">INACTIVE</td>
1029 * <td align="center">AF_TRIGGER</td>
1030 * <td align="center">NOT_FOCUSED_LOCKED</td>
1031 * <td align="center">AF state query, Lens now locked</td>
1032 * </tr>
1033 * <tr>
1034 * <td align="center">PASSIVE_SCAN</td>
1035 * <td align="center">Camera device completes current scan</td>
1036 * <td align="center">PASSIVE_FOCUSED</td>
1037 * <td align="center">End AF scan, Lens now locked</td>
1038 * </tr>
1039 * <tr>
1040 * <td align="center">PASSIVE_SCAN</td>
1041 * <td align="center">Camera device fails current scan</td>
1042 * <td align="center">PASSIVE_UNFOCUSED</td>
1043 * <td align="center">End AF scan, Lens now locked</td>
1044 * </tr>
1045 * <tr>
1046 * <td align="center">PASSIVE_SCAN</td>
1047 * <td align="center">AF_TRIGGER</td>
1048 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001049 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001050 * </tr>
1051 * <tr>
1052 * <td align="center">PASSIVE_SCAN</td>
1053 * <td align="center">AF_TRIGGER</td>
1054 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001055 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001056 * </tr>
1057 * <tr>
1058 * <td align="center">PASSIVE_SCAN</td>
1059 * <td align="center">AF_CANCEL</td>
1060 * <td align="center">INACTIVE</td>
1061 * <td align="center">Reset lens position, Lens now locked</td>
1062 * </tr>
1063 * <tr>
1064 * <td align="center">PASSIVE_FOCUSED</td>
1065 * <td align="center">Camera device initiates new scan</td>
1066 * <td align="center">PASSIVE_SCAN</td>
1067 * <td align="center">Start AF scan, Lens now moving</td>
1068 * </tr>
1069 * <tr>
1070 * <td align="center">PASSIVE_UNFOCUSED</td>
1071 * <td align="center">Camera device initiates new scan</td>
1072 * <td align="center">PASSIVE_SCAN</td>
1073 * <td align="center">Start AF scan, Lens now moving</td>
1074 * </tr>
1075 * <tr>
1076 * <td align="center">PASSIVE_FOCUSED</td>
1077 * <td align="center">AF_TRIGGER</td>
1078 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001079 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001080 * </tr>
1081 * <tr>
1082 * <td align="center">PASSIVE_UNFOCUSED</td>
1083 * <td align="center">AF_TRIGGER</td>
1084 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001085 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001086 * </tr>
1087 * <tr>
1088 * <td align="center">FOCUSED_LOCKED</td>
1089 * <td align="center">AF_TRIGGER</td>
1090 * <td align="center">FOCUSED_LOCKED</td>
1091 * <td align="center">No effect</td>
1092 * </tr>
1093 * <tr>
1094 * <td align="center">FOCUSED_LOCKED</td>
1095 * <td align="center">AF_CANCEL</td>
1096 * <td align="center">INACTIVE</td>
1097 * <td align="center">Restart AF scan</td>
1098 * </tr>
1099 * <tr>
1100 * <td align="center">NOT_FOCUSED_LOCKED</td>
1101 * <td align="center">AF_TRIGGER</td>
1102 * <td align="center">NOT_FOCUSED_LOCKED</td>
1103 * <td align="center">No effect</td>
1104 * </tr>
1105 * <tr>
1106 * <td align="center">NOT_FOCUSED_LOCKED</td>
1107 * <td align="center">AF_CANCEL</td>
1108 * <td align="center">INACTIVE</td>
1109 * <td align="center">Restart AF scan</td>
1110 * </tr>
1111 * </tbody>
1112 * </table>
1113 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1114 * <table>
1115 * <thead>
1116 * <tr>
1117 * <th align="center">State</th>
1118 * <th align="center">Transition Cause</th>
1119 * <th align="center">New State</th>
1120 * <th align="center">Notes</th>
1121 * </tr>
1122 * </thead>
1123 * <tbody>
1124 * <tr>
1125 * <td align="center">INACTIVE</td>
1126 * <td align="center">Camera device initiates new scan</td>
1127 * <td align="center">PASSIVE_SCAN</td>
1128 * <td align="center">Start AF scan, Lens now moving</td>
1129 * </tr>
1130 * <tr>
1131 * <td align="center">INACTIVE</td>
1132 * <td align="center">AF_TRIGGER</td>
1133 * <td align="center">NOT_FOCUSED_LOCKED</td>
1134 * <td align="center">AF state query, Lens now locked</td>
1135 * </tr>
1136 * <tr>
1137 * <td align="center">PASSIVE_SCAN</td>
1138 * <td align="center">Camera device completes current scan</td>
1139 * <td align="center">PASSIVE_FOCUSED</td>
1140 * <td align="center">End AF scan, Lens now locked</td>
1141 * </tr>
1142 * <tr>
1143 * <td align="center">PASSIVE_SCAN</td>
1144 * <td align="center">Camera device fails current scan</td>
1145 * <td align="center">PASSIVE_UNFOCUSED</td>
1146 * <td align="center">End AF scan, Lens now locked</td>
1147 * </tr>
1148 * <tr>
1149 * <td align="center">PASSIVE_SCAN</td>
1150 * <td align="center">AF_TRIGGER</td>
1151 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001152 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001153 * </tr>
1154 * <tr>
1155 * <td align="center">PASSIVE_SCAN</td>
1156 * <td align="center">AF_TRIGGER</td>
1157 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001158 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001159 * </tr>
1160 * <tr>
1161 * <td align="center">PASSIVE_SCAN</td>
1162 * <td align="center">AF_CANCEL</td>
1163 * <td align="center">INACTIVE</td>
1164 * <td align="center">Reset lens position, Lens now locked</td>
1165 * </tr>
1166 * <tr>
1167 * <td align="center">PASSIVE_FOCUSED</td>
1168 * <td align="center">Camera device initiates new scan</td>
1169 * <td align="center">PASSIVE_SCAN</td>
1170 * <td align="center">Start AF scan, Lens now moving</td>
1171 * </tr>
1172 * <tr>
1173 * <td align="center">PASSIVE_UNFOCUSED</td>
1174 * <td align="center">Camera device initiates new scan</td>
1175 * <td align="center">PASSIVE_SCAN</td>
1176 * <td align="center">Start AF scan, Lens now moving</td>
1177 * </tr>
1178 * <tr>
1179 * <td align="center">PASSIVE_FOCUSED</td>
1180 * <td align="center">AF_TRIGGER</td>
1181 * <td align="center">FOCUSED_LOCKED</td>
1182 * <td align="center">Immediate trans. Lens now locked</td>
1183 * </tr>
1184 * <tr>
1185 * <td align="center">PASSIVE_UNFOCUSED</td>
1186 * <td align="center">AF_TRIGGER</td>
1187 * <td align="center">NOT_FOCUSED_LOCKED</td>
1188 * <td align="center">Immediate trans. Lens now locked</td>
1189 * </tr>
1190 * <tr>
1191 * <td align="center">FOCUSED_LOCKED</td>
1192 * <td align="center">AF_TRIGGER</td>
1193 * <td align="center">FOCUSED_LOCKED</td>
1194 * <td align="center">No effect</td>
1195 * </tr>
1196 * <tr>
1197 * <td align="center">FOCUSED_LOCKED</td>
1198 * <td align="center">AF_CANCEL</td>
1199 * <td align="center">INACTIVE</td>
1200 * <td align="center">Restart AF scan</td>
1201 * </tr>
1202 * <tr>
1203 * <td align="center">NOT_FOCUSED_LOCKED</td>
1204 * <td align="center">AF_TRIGGER</td>
1205 * <td align="center">NOT_FOCUSED_LOCKED</td>
1206 * <td align="center">No effect</td>
1207 * </tr>
1208 * <tr>
1209 * <td align="center">NOT_FOCUSED_LOCKED</td>
1210 * <td align="center">AF_CANCEL</td>
1211 * <td align="center">INACTIVE</td>
1212 * <td align="center">Restart AF scan</td>
1213 * </tr>
1214 * </tbody>
1215 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001216 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1217 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1218 * camera device. When a trigger is included in a mode switch request, the trigger
1219 * will be evaluated in the context of the new mode in the request.
1220 * See below table for examples:</p>
1221 * <table>
1222 * <thead>
1223 * <tr>
1224 * <th align="center">State</th>
1225 * <th align="center">Transition Cause</th>
1226 * <th align="center">New State</th>
1227 * <th align="center">Notes</th>
1228 * </tr>
1229 * </thead>
1230 * <tbody>
1231 * <tr>
1232 * <td align="center">any state</td>
1233 * <td align="center">CAF--&gt;AUTO mode switch</td>
1234 * <td align="center">INACTIVE</td>
1235 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1236 * </tr>
1237 * <tr>
1238 * <td align="center">any state</td>
1239 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1240 * <td align="center">trigger-reachable states from INACTIVE</td>
1241 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1242 * </tr>
1243 * <tr>
1244 * <td align="center">any state</td>
1245 * <td align="center">AUTO--&gt;CAF mode switch</td>
1246 * <td align="center">passively reachable states from INACTIVE</td>
1247 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1248 * </tr>
1249 * </tbody>
1250 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001251 *
1252 * @see CaptureRequest#CONTROL_AF_MODE
1253 * @see CaptureRequest#CONTROL_MODE
1254 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001255 * @see #CONTROL_AF_STATE_INACTIVE
1256 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1257 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1258 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1259 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1260 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001261 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001262 */
1263 public static final Key<Integer> CONTROL_AF_STATE =
1264 new Key<Integer>("android.control.afState", int.class);
1265
1266 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001267 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001268 * latest calculated values.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001269 * <p>Note that AWB lock is only meaningful when
1270 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1271 * AWB is already fixed to a specific setting.</p>
1272 *
1273 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001274 */
1275 public static final Key<Boolean> CONTROL_AWB_LOCK =
1276 new Key<Boolean>("android.control.awbLock", boolean.class);
1277
1278 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001279 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001280 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001281 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001282 * <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 -07001283 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001284 * routine is enabled, overriding the application's selected
1285 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1286 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001287 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001288 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001289 * 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 -08001290 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001291 * <p>When set to any other modes, the camera device's auto-white
1292 * balance routine is disabled. The camera device uses each
1293 * particular illumination target for white balance
1294 * adjustment. The application's values for
1295 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1296 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1297 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001298 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001299 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001300 * @see CaptureRequest#COLOR_CORRECTION_MODE
1301 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001302 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001303 * @see #CONTROL_AWB_MODE_OFF
1304 * @see #CONTROL_AWB_MODE_AUTO
1305 * @see #CONTROL_AWB_MODE_INCANDESCENT
1306 * @see #CONTROL_AWB_MODE_FLUORESCENT
1307 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1308 * @see #CONTROL_AWB_MODE_DAYLIGHT
1309 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1310 * @see #CONTROL_AWB_MODE_TWILIGHT
1311 * @see #CONTROL_AWB_MODE_SHADE
1312 */
1313 public static final Key<Integer> CONTROL_AWB_MODE =
1314 new Key<Integer>("android.control.awbMode", int.class);
1315
1316 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001317 * <p>List of areas to use for illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001318 * estimation.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001319 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001320 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001321 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1322 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001323 * bottom-right pixel in the active pixel array.</p>
1324 * <p>The weight must range from 0 to 1000, and represents a weight
1325 * for every pixel in the area. This means that a large metering area
1326 * with the same weight as a smaller area will have more effect in
1327 * the metering result. Metering areas can partially overlap and the
1328 * camera device will add the weights in the overlap region.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001329 * <p>If all regions have 0 weight, then no specific metering area
1330 * needs to be used by the camera device. If the metering region is
1331 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
Zhijun He14986152014-05-22 21:17:37 -07001332 * the camera device will ignore the sections outside the region and output the
1333 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001334 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001335 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001336 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001337 */
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001338 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1339 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001340
1341 /**
Zhijun He379af012014-05-06 11:54:54 -07001342 * <p>Information to the camera device 3A (auto-exposure,
1343 * auto-focus, auto-white balance) routines about the purpose
1344 * of this capture, to help the camera device to decide optimal 3A
1345 * strategy.</p>
1346 * <p>This control (except for MANUAL) is only effective if
1347 * <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 -07001348 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1349 * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Zhijun He379af012014-05-06 11:54:54 -07001350 * contains MANUAL_SENSOR.</p>
1351 *
1352 * @see CaptureRequest#CONTROL_MODE
1353 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1354 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1355 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1356 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1357 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1358 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1359 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1360 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1361 */
1362 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1363 new Key<Integer>("android.control.captureIntent", int.class);
1364
1365 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001366 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001367 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1368 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1369 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1370 * the algorithm states to INACTIVE.</p>
1371 * <p>The camera device can do several state transitions between two results, if it is
1372 * allowed by the state transition table. So INACTIVE may never actually be seen in
1373 * a result.</p>
1374 * <p>The state in the result is the state for this image (in sync with this image): if
1375 * AWB state becomes CONVERGED, then the image data associated with this result should
1376 * be good to use.</p>
1377 * <p>Below are state transition tables for different AWB modes.</p>
1378 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1379 * <table>
1380 * <thead>
1381 * <tr>
1382 * <th align="center">State</th>
1383 * <th align="center">Transition Cause</th>
1384 * <th align="center">New State</th>
1385 * <th align="center">Notes</th>
1386 * </tr>
1387 * </thead>
1388 * <tbody>
1389 * <tr>
1390 * <td align="center">INACTIVE</td>
1391 * <td align="center"></td>
1392 * <td align="center">INACTIVE</td>
1393 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1394 * </tr>
1395 * </tbody>
1396 * </table>
1397 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1398 * <table>
1399 * <thead>
1400 * <tr>
1401 * <th align="center">State</th>
1402 * <th align="center">Transition Cause</th>
1403 * <th align="center">New State</th>
1404 * <th align="center">Notes</th>
1405 * </tr>
1406 * </thead>
1407 * <tbody>
1408 * <tr>
1409 * <td align="center">INACTIVE</td>
1410 * <td align="center">Camera device initiates AWB scan</td>
1411 * <td align="center">SEARCHING</td>
1412 * <td align="center">Values changing</td>
1413 * </tr>
1414 * <tr>
1415 * <td align="center">INACTIVE</td>
1416 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1417 * <td align="center">LOCKED</td>
1418 * <td align="center">Values locked</td>
1419 * </tr>
1420 * <tr>
1421 * <td align="center">SEARCHING</td>
1422 * <td align="center">Camera device finishes AWB scan</td>
1423 * <td align="center">CONVERGED</td>
1424 * <td align="center">Good values, not changing</td>
1425 * </tr>
1426 * <tr>
1427 * <td align="center">SEARCHING</td>
1428 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1429 * <td align="center">LOCKED</td>
1430 * <td align="center">Values locked</td>
1431 * </tr>
1432 * <tr>
1433 * <td align="center">CONVERGED</td>
1434 * <td align="center">Camera device initiates AWB scan</td>
1435 * <td align="center">SEARCHING</td>
1436 * <td align="center">Values changing</td>
1437 * </tr>
1438 * <tr>
1439 * <td align="center">CONVERGED</td>
1440 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1441 * <td align="center">LOCKED</td>
1442 * <td align="center">Values locked</td>
1443 * </tr>
1444 * <tr>
1445 * <td align="center">LOCKED</td>
1446 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1447 * <td align="center">SEARCHING</td>
1448 * <td align="center">Values not good after unlock</td>
1449 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001450 * </tbody>
1451 * </table>
1452 * <p>For the above table, the camera device may skip reporting any state changes that happen
1453 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1454 * can be skipped in that manner is called a transient state.</p>
1455 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1456 * listed in above table, it is also legal for the camera device to skip one or more
1457 * transient states between two results. See below table for examples:</p>
1458 * <table>
1459 * <thead>
1460 * <tr>
1461 * <th align="center">State</th>
1462 * <th align="center">Transition Cause</th>
1463 * <th align="center">New State</th>
1464 * <th align="center">Notes</th>
1465 * </tr>
1466 * </thead>
1467 * <tbody>
1468 * <tr>
1469 * <td align="center">INACTIVE</td>
1470 * <td align="center">Camera device finished AWB scan</td>
1471 * <td align="center">CONVERGED</td>
1472 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1473 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001474 * <tr>
1475 * <td align="center">LOCKED</td>
1476 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1477 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001478 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001479 * </tr>
1480 * </tbody>
1481 * </table>
1482 *
1483 * @see CaptureRequest#CONTROL_AWB_LOCK
1484 * @see CaptureRequest#CONTROL_AWB_MODE
1485 * @see CaptureRequest#CONTROL_MODE
1486 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001487 * @see #CONTROL_AWB_STATE_INACTIVE
1488 * @see #CONTROL_AWB_STATE_SEARCHING
1489 * @see #CONTROL_AWB_STATE_CONVERGED
1490 * @see #CONTROL_AWB_STATE_LOCKED
1491 */
1492 public static final Key<Integer> CONTROL_AWB_STATE =
1493 new Key<Integer>("android.control.awbState", int.class);
1494
1495 /**
Zhijun He379af012014-05-06 11:54:54 -07001496 * <p>A special color effect to apply.</p>
1497 * <p>When this mode is set, a color effect will be applied
1498 * to images produced by the camera device. The interpretation
1499 * and implementation of these color effects is left to the
1500 * implementor of the camera device, and should not be
1501 * depended on to be consistent (or present) across all
1502 * devices.</p>
1503 * <p>A color effect will only be applied if
1504 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p>
1505 *
1506 * @see CaptureRequest#CONTROL_MODE
1507 * @see #CONTROL_EFFECT_MODE_OFF
1508 * @see #CONTROL_EFFECT_MODE_MONO
1509 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1510 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1511 * @see #CONTROL_EFFECT_MODE_SEPIA
1512 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1513 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1514 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1515 * @see #CONTROL_EFFECT_MODE_AQUA
1516 */
1517 public static final Key<Integer> CONTROL_EFFECT_MODE =
1518 new Key<Integer>("android.control.effectMode", int.class);
1519
1520 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001521 * <p>Overall mode of 3A control
Zhijun Hecc28a412014-02-24 15:11:23 -08001522 * routines.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001523 * <p>High-level 3A control. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001524 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001525 * capture parameters itself.</p>
1526 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001527 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001528 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001529 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001530 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001531 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001532 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001533 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1534 * is that this frame will not be used by camera device background 3A statistics
1535 * update, as if this frame is never captured. This mode can be used in the scenario
1536 * where the application doesn't want a 3A manual control capture to affect
1537 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001538 *
1539 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001540 * @see #CONTROL_MODE_OFF
1541 * @see #CONTROL_MODE_AUTO
1542 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001543 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001544 */
1545 public static final Key<Integer> CONTROL_MODE =
1546 new Key<Integer>("android.control.mode", int.class);
1547
1548 /**
Zhijun He379af012014-05-06 11:54:54 -07001549 * <p>A camera mode optimized for conditions typical in a particular
1550 * capture setting.</p>
1551 * <p>This is the mode that that is active when
1552 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1553 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001554 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.
1555 * The scene modes available for a given camera device are listed in
1556 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}.</p>
Zhijun He379af012014-05-06 11:54:54 -07001557 * <p>The interpretation and implementation of these scene modes is left
1558 * to the implementor of the camera device. Their behavior will not be
1559 * consistent across all devices, and any given device may only implement
1560 * a subset of these modes.</p>
1561 *
1562 * @see CaptureRequest#CONTROL_AE_MODE
1563 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001564 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001565 * @see CaptureRequest#CONTROL_AWB_MODE
1566 * @see CaptureRequest#CONTROL_MODE
1567 * @see #CONTROL_SCENE_MODE_DISABLED
1568 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1569 * @see #CONTROL_SCENE_MODE_ACTION
1570 * @see #CONTROL_SCENE_MODE_PORTRAIT
1571 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1572 * @see #CONTROL_SCENE_MODE_NIGHT
1573 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1574 * @see #CONTROL_SCENE_MODE_THEATRE
1575 * @see #CONTROL_SCENE_MODE_BEACH
1576 * @see #CONTROL_SCENE_MODE_SNOW
1577 * @see #CONTROL_SCENE_MODE_SUNSET
1578 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1579 * @see #CONTROL_SCENE_MODE_FIREWORKS
1580 * @see #CONTROL_SCENE_MODE_SPORTS
1581 * @see #CONTROL_SCENE_MODE_PARTY
1582 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1583 * @see #CONTROL_SCENE_MODE_BARCODE
1584 */
1585 public static final Key<Integer> CONTROL_SCENE_MODE =
1586 new Key<Integer>("android.control.sceneMode", int.class);
1587
1588 /**
1589 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001590 * active.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001591 * <p>Video stabilization automatically translates and scales images from the camera
1592 * in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07001593 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001594 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
1595 * <p>Switching between different video stabilization modes may take several frames
1596 * to initialize, the camera device will report the current mode in capture result
1597 * metadata. For example, When "ON" mode is requested, the video stabilization modes
1598 * in the first several capture results may still be "OFF", and it will become "ON"
1599 * when the initialization is done.</p>
1600 * <p>If a camera device supports both this mode and OIS ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}),
1601 * turning both modes on may produce undesirable interaction, so it is recommended not to
1602 * enable both at the same time.</p>
Zhijun He379af012014-05-06 11:54:54 -07001603 *
Zhijun He45fa43a12014-06-13 18:29:37 -07001604 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07001605 * @see CaptureRequest#SCALER_CROP_REGION
1606 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1607 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1608 */
1609 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1610 new Key<Integer>("android.control.videoStabilizationMode", int.class);
1611
1612 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001613 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001614 * enhancement.</p>
Zhijun He28079362013-12-17 10:35:40 -08001615 * <p>Edge/sharpness/detail enhancement. OFF means no
Zhijun Hecc28a412014-02-24 15:11:23 -08001616 * enhancement will be applied by the camera device.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001617 * <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 -08001618 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001619 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001620 * camera device will use the highest-quality enhancement algorithms,
1621 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08001622 * not slow down capture rate when applying edge enhancement.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001623 *
1624 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001625 * @see #EDGE_MODE_OFF
1626 * @see #EDGE_MODE_FAST
1627 * @see #EDGE_MODE_HIGH_QUALITY
1628 */
1629 public static final Key<Integer> EDGE_MODE =
1630 new Key<Integer>("android.edge.mode", int.class);
1631
1632 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001633 * <p>The desired mode for for the camera device's flash control.</p>
1634 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08001635 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001636 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
1637 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
1638 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
1639 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
1640 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
1641 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001642 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08001643 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
1644 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
1645 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001646 * <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 -08001647 *
1648 * @see CaptureRequest#CONTROL_AE_MODE
1649 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1650 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08001651 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001652 * @see #FLASH_MODE_OFF
1653 * @see #FLASH_MODE_SINGLE
1654 * @see #FLASH_MODE_TORCH
1655 */
1656 public static final Key<Integer> FLASH_MODE =
1657 new Key<Integer>("android.flash.mode", int.class);
1658
1659 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001660 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08001661 * unit.</p>
1662 * <p>When the camera device doesn't have flash unit
1663 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
1664 * Other states indicate the current flash status.</p>
1665 *
1666 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001667 * @see #FLASH_STATE_UNAVAILABLE
1668 * @see #FLASH_STATE_CHARGING
1669 * @see #FLASH_STATE_READY
1670 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07001671 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001672 */
1673 public static final Key<Integer> FLASH_STATE =
1674 new Key<Integer>("android.flash.state", int.class);
1675
1676 /**
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001677 * <p>Set operational mode for hot pixel correction.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001678 * <p>Valid modes for this camera device are listed in
1679 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001680 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
1681 * that do not accurately encode the incoming light (i.e. pixels that
1682 * are stuck at an arbitrary value).</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001683 *
1684 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001685 * @see #HOT_PIXEL_MODE_OFF
1686 * @see #HOT_PIXEL_MODE_FAST
1687 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1688 */
1689 public static final Key<Integer> HOT_PIXEL_MODE =
1690 new Key<Integer>("android.hotPixel.mode", int.class);
1691
1692 /**
Ruben Brunk57493682014-05-27 18:58:08 -07001693 * <p>A location object to use when generating image GPS metadata.</p>
1694 */
1695 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
1696 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
1697
1698 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001699 * <p>GPS coordinates to include in output JPEG
1700 * EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001701 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001702 */
1703 public static final Key<double[]> JPEG_GPS_COORDINATES =
1704 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
1705
1706 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001707 * <p>32 characters describing GPS algorithm to
1708 * include in EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001709 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001710 */
1711 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
1712 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
1713
1714 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001715 * <p>Time GPS fix was made to include in
1716 * EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001717 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001718 */
1719 public static final Key<Long> JPEG_GPS_TIMESTAMP =
1720 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
1721
1722 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001723 * <p>Orientation of JPEG image to
1724 * write</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001725 */
1726 public static final Key<Integer> JPEG_ORIENTATION =
1727 new Key<Integer>("android.jpeg.orientation", int.class);
1728
1729 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001730 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001731 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001732 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001733 */
1734 public static final Key<Byte> JPEG_QUALITY =
1735 new Key<Byte>("android.jpeg.quality", byte.class);
1736
1737 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001738 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001739 * thumbnail.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001740 */
1741 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
1742 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
1743
1744 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001745 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001746 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
1747 * but the captured JPEG will still be a valid image.</p>
Zhijun He5a9ff372013-12-26 11:49:09 -08001748 * <p>When a jpeg image capture is issued, the thumbnail size selected should have
1749 * the same aspect ratio as the jpeg image.</p>
Zhijun He50f72432014-05-28 13:52:04 -07001750 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
1751 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
1752 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
1753 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
1754 * generate the thumbnail image. The thumbnail image will always have a smaller Field
1755 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001756 */
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001757 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
1758 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001759
1760 /**
Zhijun Hefb46c642014-01-14 17:57:23 -08001761 * <p>The ratio of lens focal length to the effective
1762 * aperture diameter.</p>
1763 * <p>This will only be supported on the camera devices that
1764 * have variable aperture lens. The aperture value can only be
1765 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
1766 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1767 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001768 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08001769 * to achieve manual exposure control.</p>
1770 * <p>The requested aperture value may take several frames to reach the
1771 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08001772 * aperture size in capture result metadata while the aperture is changing.
1773 * 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 -08001774 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1775 * the ON modes, this will be overridden by the camera device
1776 * auto-exposure algorithm, the overridden values are then provided
1777 * back to the user in the corresponding result.</p>
1778 *
Zhijun He399f05d2014-01-15 11:31:30 -08001779 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001780 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001781 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001782 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001783 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001784 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001785 */
1786 public static final Key<Float> LENS_APERTURE =
1787 new Key<Float>("android.lens.aperture", float.class);
1788
1789 /**
Ruben Brunk855bae42014-01-17 10:30:32 -08001790 * <p>State of lens neutral density filter(s).</p>
1791 * <p>This will not be supported on most camera devices. On devices
1792 * where this is supported, this may only be set to one of the
1793 * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p>
1794 * <p>Lens filters are typically used to lower the amount of light the
1795 * sensor is exposed to (measured in steps of EV). As used here, an EV
1796 * step is the standard logarithmic representation, which are
1797 * non-negative, and inversely proportional to the amount of light
1798 * hitting the sensor. For example, setting this to 0 would result
1799 * in no reduction of the incoming light, and setting this to 2 would
1800 * mean that the filter is set to reduce incoming light by two stops
1801 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001802 * <p>It may take several frames before the lens filter density changes
1803 * to the requested value. While the filter density is still changing,
1804 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001805 *
1806 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001807 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001808 */
1809 public static final Key<Float> LENS_FILTER_DENSITY =
1810 new Key<Float>("android.lens.filterDensity", float.class);
1811
1812 /**
Ruben Brunka20f4c22014-01-17 15:21:13 -08001813 * <p>The current lens focal length; used for optical zoom.</p>
1814 * <p>This setting controls the physical focal length of the camera
1815 * device's lens. Changing the focal length changes the field of
1816 * view of the camera device, and is usually used for optical zoom.</p>
1817 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1818 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08001819 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08001820 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1821 * be set to MOVING.</p>
1822 * <p>This is expected not to be supported on most devices.</p>
1823 *
1824 * @see CaptureRequest#LENS_APERTURE
1825 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1826 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001827 */
1828 public static final Key<Float> LENS_FOCAL_LENGTH =
1829 new Key<Float>("android.lens.focalLength", float.class);
1830
1831 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001832 * <p>Distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001833 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001834 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001835 */
1836 public static final Key<Float> LENS_FOCUS_DISTANCE =
1837 new Key<Float>("android.lens.focusDistance", float.class);
1838
1839 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001840 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001841 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001842 * <p>If variable focus not supported, can still report
1843 * fixed depth of field range</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001844 */
Igor Murashkin57438682014-05-30 10:49:00 -07001845 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
1846 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 -07001847
1848 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08001849 * <p>Sets whether the camera device uses optical image stabilization (OIS)
1850 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001851 * <p>OIS is used to compensate for motion blur due to small
1852 * movements of the camera during capture. Unlike digital image
1853 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
1854 * makes use of mechanical elements to stabilize the camera
1855 * sensor, and thus allows for longer exposure times before
1856 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07001857 * <p>Switching between different optical stabilization modes may take several
1858 * frames to initialize, the camera device will report the current mode in
1859 * capture result metadata. For example, When "ON" mode is requested, the
1860 * optical stabilization modes in the first several capture results may still
1861 * be "OFF", and it will become "ON" when the initialization is done.</p>
1862 * <p>If a camera device supports both OIS and EIS ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}),
1863 * turning both modes on may produce undesirable interaction, so it is recommended not
1864 * to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001865 * <p>Not all devices will support OIS; see
1866 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
1867 * available controls.</p>
1868 *
1869 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
1870 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001871 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
1872 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
1873 */
1874 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
1875 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
1876
1877 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08001878 * <p>Current lens status.</p>
1879 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1880 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
1881 * they may take several frames to reach the requested values. This state indicates
1882 * the current status of the lens parameters.</p>
1883 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
1884 * either because the parameters are all fixed, or because the lens has had enough
1885 * time to reach the most recently-requested values.
1886 * If all these lens parameters are not changable for a camera device, as listed below:</p>
1887 * <ul>
1888 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
1889 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
1890 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
1891 * which means the optical zoom is not supported.</li>
1892 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
1893 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
1894 * </ul>
1895 * <p>Then this state will always be STATIONARY.</p>
1896 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
1897 * is changing.</p>
1898 *
1899 * @see CaptureRequest#LENS_APERTURE
1900 * @see CaptureRequest#LENS_FILTER_DENSITY
1901 * @see CaptureRequest#LENS_FOCAL_LENGTH
1902 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1903 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1904 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1905 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
1906 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001907 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07001908 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001909 */
1910 public static final Key<Integer> LENS_STATE =
1911 new Key<Integer>("android.lens.state", int.class);
1912
1913 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001914 * <p>Mode of operation for the noise reduction algorithm.</p>
Zhijun He28079362013-12-17 10:35:40 -08001915 * <p>Noise filtering control. OFF means no noise reduction
Zhijun Hecc28a412014-02-24 15:11:23 -08001916 * will be applied by the camera device.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001917 * <p>This must be set to a valid mode from
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001918 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001919 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
1920 * will be applied. HIGH_QUALITY mode indicates that the camera device
1921 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001922 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08001923 * slow down capture rate when applying noise filtering.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001924 *
1925 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001926 * @see #NOISE_REDUCTION_MODE_OFF
1927 * @see #NOISE_REDUCTION_MODE_FAST
1928 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
1929 */
1930 public static final Key<Integer> NOISE_REDUCTION_MODE =
1931 new Key<Integer>("android.noiseReduction.mode", int.class);
1932
1933 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001934 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001935 * final one for the capture, or only a partial that contains a
1936 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08001937 * values.</p>
1938 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001939 * single capture may not overlap, except for this entry. The
1940 * FINAL buffers must retain FIFO ordering relative to the
1941 * requests that generate them, so the FINAL buffer for frame 3 must
1942 * always be sent to the framework after the FINAL buffer for frame 2, and
1943 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
1944 * in any order relative to other frames, but all PARTIAL buffers for a given
1945 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08001946 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08001947 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001948 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001949 * @hide
1950 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001951 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001952 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
1953 new Key<Boolean>("android.quirks.partialResult", boolean.class);
1954
1955 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001956 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07001957 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08001958 * frameCount value).</p>
1959 * <p>Reset on release()</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001960 */
1961 public static final Key<Integer> REQUEST_FRAME_COUNT =
1962 new Key<Integer>("android.request.frameCount", int.class);
1963
1964 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001965 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001966 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08001967 * frame</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001968 * @hide
1969 */
1970 public static final Key<Integer> REQUEST_ID =
1971 new Key<Integer>("android.request.id", int.class);
1972
1973 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08001974 * <p>Specifies the number of pipeline stages the frame went
1975 * through from when it was exposed to when the final completed result
1976 * was available to the framework.</p>
1977 * <p>Depending on what settings are used in the request, and
1978 * what streams are configured, the data may undergo less processing,
1979 * and some pipeline stages skipped.</p>
1980 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
1981 *
1982 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
1983 */
1984 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
1985 new Key<Byte>("android.request.pipelineDepth", byte.class);
1986
1987 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001988 * <p>The region of the sensor to read out for this capture.</p>
1989 * <p>The crop region coordinate system is based off
1990 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
1991 * top-left corner of the sensor active array.</p>
1992 * <p>Output streams use this rectangle to produce their output,
1993 * cropping to a smaller region if necessary to maintain the
1994 * stream's aspect ratio, then scaling the sensor input to
1995 * match the output's configured resolution.</p>
1996 * <p>The crop region is applied after the RAW to other color
1997 * space (e.g. YUV) conversion. Since raw streams
1998 * (e.g. RAW16) don't have the conversion stage, they are not
1999 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002000 * <p>For non-raw streams, any additional per-stream cropping will
2001 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002002 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002003 * ratio, then 4:3 streams will use the exact crop
2004 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002005 * (letterbox).</p>
2006 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002007 * outputs will crop horizontally (pillarbox), and 16:9
2008 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002009 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002010 * <p>The width and height of the crop region cannot
2011 * be set to be smaller than
2012 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2013 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2014 * <p>The camera device may adjust the crop region to account
2015 * for rounding and other hardware requirements; the final
2016 * crop region used will be included in the output capture
2017 * result.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002018 *
2019 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002020 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002021 */
2022 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2023 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2024
2025 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002026 * <p>Duration each pixel is exposed to
2027 * light.</p>
2028 * <p>If the sensor can't expose this exact duration, it should shorten the
2029 * duration exposed to the nearest possible value (rather than expose longer).</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002030 */
2031 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2032 new Key<Long>("android.sensor.exposureTime", long.class);
2033
2034 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002035 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002036 * start of next frame exposure.</p>
2037 * <p>The maximum frame rate that can be supported by a camera subsystem is
2038 * a function of many factors:</p>
2039 * <ul>
2040 * <li>Requested resolutions of output image streams</li>
2041 * <li>Availability of binning / skipping modes on the imager</li>
2042 * <li>The bandwidth of the imager interface</li>
2043 * <li>The bandwidth of the various ISP processing blocks</li>
2044 * </ul>
2045 * <p>Since these factors can vary greatly between different ISPs and
2046 * sensors, the camera abstraction tries to represent the bandwidth
2047 * restrictions with as simple a model as possible.</p>
2048 * <p>The model presented has the following characteristics:</p>
2049 * <ul>
2050 * <li>The image sensor is always configured to output the smallest
2051 * resolution possible given the application's requested output stream
2052 * sizes. The smallest resolution is defined as being at least as large
2053 * as the largest requested output stream size; the camera pipeline must
2054 * never digitally upsample sensor data when the crop region covers the
2055 * whole sensor. In general, this means that if only small output stream
2056 * resolutions are configured, the sensor can provide a higher frame
2057 * rate.</li>
2058 * <li>Since any request may use any or all the currently configured
2059 * output streams, the sensor and ISP must be configured to support
2060 * scaling a single capture to all the streams at the same time. This
2061 * means the camera pipeline must be ready to produce the largest
2062 * requested output size without any delay. Therefore, the overall
2063 * frame rate of a given configured stream set is governed only by the
2064 * largest requested stream resolution.</li>
2065 * <li>Using more than one output stream in a request does not affect the
2066 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002067 * <li>Certain format-streams may need to do additional background processing
2068 * before data is consumed/produced by that stream. These processors
2069 * can run concurrently to the rest of the camera pipeline, but
2070 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002071 * </ul>
2072 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002073 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2074 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002075 * These are used to determine the maximum frame rate / minimum frame
2076 * duration that is possible for a given stream configuration.</p>
2077 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002078 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002079 * device:</p>
2080 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002081 * <li>Let the set of currently configured input/output streams
2082 * be called <code>S</code>.</li>
2083 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002084 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2085 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002086 * its respective size/format). Let this set of frame durations be called
2087 * <code>F</code>.</li>
2088 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2089 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2090 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002091 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002092 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002093 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2094 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002095 * <code>F</code> determines the steady state frame rate that the application will
2096 * get if it uses <code>R</code> as a repeating request. Let this special kind
2097 * of request be called <code>Rsimple</code>.</p>
2098 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2099 * by a single capture of a new request <code>Rstall</code> (which has at least
2100 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2101 * same minimum frame duration this will not cause a frame rate loss
2102 * if all buffers from the previous <code>Rstall</code> have already been
2103 * delivered.</p>
2104 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002105 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002106 *
Igor Murashkin9c595172014-05-12 13:56:20 -07002107 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002108 */
2109 public static final Key<Long> SENSOR_FRAME_DURATION =
2110 new Key<Long>("android.sensor.frameDuration", long.class);
2111
2112 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002113 * <p>The amount of gain applied to sensor data
2114 * before processing.</p>
2115 * <p>The sensitivity is the standard ISO sensitivity value,
2116 * as defined in ISO 12232:2006.</p>
2117 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2118 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2119 * is guaranteed to use only analog amplification for applying the gain.</p>
2120 * <p>If the camera device cannot apply the exact sensitivity
2121 * requested, it will reduce the gain to the nearest supported
2122 * value. The final sensitivity used will be available in the
2123 * output capture result.</p>
2124 *
2125 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2126 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002127 */
2128 public static final Key<Integer> SENSOR_SENSITIVITY =
2129 new Key<Integer>("android.sensor.sensitivity", int.class);
2130
2131 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002132 * <p>Time at start of exposure of first
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002133 * row of the image sensor, in nanoseconds.</p>
2134 * <p>The timestamps are also included in all image
2135 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07002136 * on all the outputs.</p>
2137 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION android.sensor.info.timestampCalibration} <code>==</code> UNCALIBRATED,
2138 * the timestamps measure time since an unspecified starting point,
2139 * and are monotonically increasing. They can be compared with the
2140 * timestamps for other captures from the same camera device, but are
2141 * not guaranteed to be comparable to any other time source.</p>
2142 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION android.sensor.info.timestampCalibration} <code>==</code> CALIBRATED,
2143 * the timestamps measure time in the same timebase as
2144 * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2145 * compared to other timestamps from other subsystems that are using
2146 * that base.</p>
2147 *
2148 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002149 */
2150 public static final Key<Long> SENSOR_TIMESTAMP =
2151 new Key<Long>("android.sensor.timestamp", long.class);
2152
2153 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002154 * <p>The estimated camera neutral color in the native sensor colorspace at
2155 * the time of capture.</p>
2156 * <p>This value gives the neutral color point encoded as an RGB value in the
2157 * native sensor color space. The neutral color point indicates the
2158 * currently estimated white point of the scene illumination. It can be
2159 * used to interpolate between the provided color transforms when
2160 * processing raw sensor data.</p>
2161 * <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 -08002162 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2163 */
2164 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2165 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2166
2167 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002168 * <p>The worst-case divergence between Bayer green channels.</p>
2169 * <p>This value is an estimate of the worst case split between the
2170 * Bayer green channels in the red and blue rows in the sensor color
2171 * filter array.</p>
2172 * <p>The green split is calculated as follows:</p>
2173 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002174 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2175 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2176 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2177 * chosen is implementation defined, and should be chosen to provide a
2178 * green split estimate that is both representative of the entire image
2179 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002180 * <li>The arithmetic mean of the green channels from the red
2181 * rows (mean_Gr) within W is computed.</li>
2182 * <li>The arithmetic mean of the green channels from the blue
2183 * rows (mean_Gb) within W is computed.</li>
2184 * <li>The maximum ratio R of the two means is computed as follows:
2185 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2186 * </ol>
2187 * <p>The ratio R is the green split divergence reported for this property,
2188 * which represents how much the green channels differ in the mosaic
2189 * pattern. This value is typically used to determine the treatment of
2190 * the green mosaic channels when demosaicing.</p>
2191 * <p>The green split value can be roughly interpreted as follows:</p>
2192 * <ul>
2193 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2194 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2195 * correction to avoid demosaic errors (3-20% divergence).</li>
2196 * <li>R &gt; 1.20 will require strong software correction to produce
2197 * a usuable image (&gt;20% divergence).</li>
2198 * </ul>
2199 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2200 */
2201 public static final Key<Float> SENSOR_GREEN_SPLIT =
2202 new Key<Float>("android.sensor.greenSplit", float.class);
2203
2204 /**
Zhijun He379af012014-05-06 11:54:54 -07002205 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2206 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2207 * <p>Each color channel is treated as an unsigned 32-bit integer.
2208 * The camera device then uses the most significant X bits
2209 * that correspond to how many bits are in its Bayer raw sensor
2210 * output.</p>
2211 * <p>For example, a sensor with RAW10 Bayer output would use the
2212 * 10 most significant bits from each color channel.</p>
2213 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2214 *
2215 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2216 */
2217 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2218 new Key<int[]>("android.sensor.testPatternData", int[].class);
2219
2220 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002221 * <p>When enabled, the sensor sends a test pattern instead of
2222 * doing a real exposure from the camera.</p>
2223 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002224 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002225 * work as normal.</p>
2226 * <p>For example, if manual flash is enabled, flash firing should still
2227 * occur (and that the test pattern remain unmodified, since the flash
2228 * would not actually affect it).</p>
2229 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2230 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2231 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2232 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2233 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2234 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2235 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2236 */
2237 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2238 new Key<Integer>("android.sensor.testPatternMode", int.class);
2239
2240 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002241 * <p>Quality of lens shading correction applied
2242 * to the image data.</p>
2243 * <p>When set to OFF mode, no lens shading correction will be applied by the
2244 * camera device, and an identity lens shading map data will be provided
2245 * 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 -07002246 * shading map with size specified as <code>android.lens.info.shadingMapSize = [ 4, 3 ]</code>,
2247 * the output android.statistics.lensShadingMap for this case will be an identity map
Zhijun Heba93fe62014-01-17 16:43:05 -08002248 * shown below:</p>
2249 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2250 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2251 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2252 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2253 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2254 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
2255 * </code></pre>
2256 * <p>When set to other modes, lens shading correction will be applied by the
2257 * camera device. Applications can request lens shading map data by setting
2258 * {@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 -07002259 * lens shading map data in android.statistics.lensShadingMap, with size specified
2260 * by android.lens.info.shadingMapSize; the returned shading map data will be the one
Zhijun Hefa7c7552014-05-22 16:36:02 -07002261 * applied by the camera device for this capture request.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002262 * <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 -07002263 * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in
2264 * 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),
2265 * to get best results, it is recommended that the applications wait for the AE and AWB to
2266 * be converged before using the returned shading map data.</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002267 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002268 * @see CaptureRequest#CONTROL_AE_MODE
2269 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun Heba93fe62014-01-17 16:43:05 -08002270 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2271 * @see #SHADING_MODE_OFF
2272 * @see #SHADING_MODE_FAST
2273 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002274 */
2275 public static final Key<Integer> SHADING_MODE =
2276 new Key<Integer>("android.shading.mode", int.class);
2277
2278 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002279 * <p>Control for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002280 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002281 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002282 * should output just the basic fields or the full set of
2283 * fields. Value must be one of the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002284 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p>
2285 *
2286 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002287 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2288 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2289 * @see #STATISTICS_FACE_DETECT_MODE_FULL
2290 */
2291 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2292 new Key<Integer>("android.statistics.faceDetectMode", int.class);
2293
2294 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002295 * <p>List of unique IDs for detected faces.</p>
2296 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
2297 * to the camera device. A face that leaves the field of view and later returns may be
2298 * assigned a new ID.</p>
2299 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL</p>
2300 *
2301 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002302 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002303 */
2304 public static final Key<int[]> STATISTICS_FACE_IDS =
2305 new Key<int[]>("android.statistics.faceIds", int[].class);
2306
2307 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002308 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002309 * faces.</p>
2310 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2311 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
2312 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL</p>
2313 *
2314 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2315 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002316 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002317 */
2318 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
2319 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
2320
2321 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002322 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002323 * faces.</p>
2324 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2325 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
2326 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF</p>
2327 *
2328 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2329 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002330 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002331 */
2332 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
2333 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
2334
2335 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002336 * <p>List of the face confidence scores for
2337 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002338 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
2339 *
2340 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002341 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002342 */
2343 public static final Key<byte[]> STATISTICS_FACE_SCORES =
2344 new Key<byte[]>("android.statistics.faceScores", byte[].class);
2345
2346 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002347 * <p>List of the faces detected through camera face detection
2348 * in this result.</p>
2349 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
2350 *
2351 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
2352 */
2353 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
2354 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
2355
2356 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002357 * <p>The shading map is a low-resolution floating-point map
2358 * that lists the coefficients used to correct for vignetting, for each
2359 * Bayer color channel.</p>
2360 * <p>The least shaded section of the image should have a gain factor
2361 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002362 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08002363 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002364 * <p>The shading map is for the entire active pixel array, and is not
2365 * affected by the crop region specified in the request. Each shading map
2366 * entry is the value of the shading compensation map over a specific
2367 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2368 * map, and an active pixel array size (W x H), shading map entry
2369 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2370 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2371 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2372 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2373 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07002374 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002375 * <p>The shading map should have on the order of 30-40 rows and columns,
2376 * and must be smaller than 64x64.</p>
2377 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002378 * <pre><code>width,height = [ 4, 3 ]
2379 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002380 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002381 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2382 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2383 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2384 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2385 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002386 * </code></pre>
2387 * <p>The low-resolution scaling map images for each channel are
2388 * (displayed using nearest-neighbor interpolation):</p>
2389 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2390 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2391 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2392 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2393 * <p>As a visualization only, inverting the full-color map to recover an
2394 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2395 * <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 -08002396 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002397 * @see CaptureRequest#COLOR_CORRECTION_MODE
Ruben Brunk57493682014-05-27 18:58:08 -07002398 */
2399 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
2400 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
2401
2402 /**
2403 * <p>The shading map is a low-resolution floating-point map
2404 * that lists the coefficients used to correct for vignetting, for each
2405 * Bayer color channel.</p>
2406 * <p>The least shaded section of the image should have a gain factor
2407 * of 1; all other sections should have gains above 1.</p>
2408 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
2409 * must take into account the colorCorrection settings.</p>
2410 * <p>The shading map is for the entire active pixel array, and is not
2411 * affected by the crop region specified in the request. Each shading map
2412 * entry is the value of the shading compensation map over a specific
2413 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2414 * map, and an active pixel array size (W x H), shading map entry
2415 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2416 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2417 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2418 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2419 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
2420 * The shading map is stored in a fully interleaved format, and its size
2421 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
2422 * <p>The shading map should have on the order of 30-40 rows and columns,
2423 * and must be smaller than 64x64.</p>
2424 * <p>As an example, given a very small map defined as:</p>
2425 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
2426 * android.statistics.lensShadingMap =
2427 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
2428 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2429 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2430 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2431 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2432 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
2433 * </code></pre>
2434 * <p>The low-resolution scaling map images for each channel are
2435 * (displayed using nearest-neighbor interpolation):</p>
2436 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2437 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2438 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2439 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2440 * <p>As a visualization only, inverting the full-color map to recover an
2441 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2442 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
2443 *
2444 * @see CaptureRequest#COLOR_CORRECTION_MODE
2445 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002446 */
2447 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
2448 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
2449
2450 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002451 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08002452 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002453 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002454 * since statistics processing on data from a new frame
2455 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08002456 * applied to that frame.</p>
2457 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002458 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002459 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08002460 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002461 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002462 *
2463 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07002464 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002465 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002466 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002467 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002468 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
2469 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
2470
2471 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002472 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08002473 * calculated by the camera device's statistics units for the current
2474 * output frame.</p>
2475 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002476 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08002477 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002478 * are the best fit for the current output frame. This may
2479 * be different than the transform used for this frame, since
2480 * statistics processing on data from a new frame typically
2481 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002482 * that frame.</p>
2483 * <p>These estimates must be provided for all frames, even if
2484 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002485 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08002486 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002487 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002488 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002489 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002490 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002491 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002492 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
2493 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
2494
2495 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08002496 * <p>The camera device estimated scene illumination lighting
2497 * frequency.</p>
2498 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
2499 * that depends on the local utility power standards. This flicker must be
2500 * accounted for by auto-exposure routines to avoid artifacts in captured images.
2501 * The camera device uses this entry to tell the application what the scene
2502 * illuminant frequency is.</p>
2503 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002504 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
2505 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
2506 * antibanding, and the application can ensure it selects
2507 * exposure times that do not cause banding issues by looking
2508 * into this metadata field. See
2509 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
2510 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08002511 *
2512 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
2513 * @see CaptureRequest#CONTROL_AE_MODE
2514 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002515 * @see #STATISTICS_SCENE_FLICKER_NONE
2516 * @see #STATISTICS_SCENE_FLICKER_50HZ
2517 * @see #STATISTICS_SCENE_FLICKER_60HZ
2518 */
2519 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
2520 new Key<Integer>("android.statistics.sceneFlicker", int.class);
2521
2522 /**
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002523 * <p>Operating mode for hotpixel map generation.</p>
2524 * <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 -07002525 * If set to OFF, no hotpixel map will be returned.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002526 * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p>
2527 *
2528 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2529 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2530 */
2531 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2532 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2533
2534 /**
2535 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
2536 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
2537 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
2538 * bottom-right of the pixel array, respectively. The width and
2539 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
2540 * This may include hot pixels that lie outside of the active array
2541 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2542 *
2543 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2544 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2545 */
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002546 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
2547 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002548
2549 /**
Zhijun He379af012014-05-06 11:54:54 -07002550 * <p>Whether the camera device will output the lens
2551 * shading map in output result metadata.</p>
2552 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002553 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07002554 * the output result metadata.</p>
Zhijun He379af012014-05-06 11:54:54 -07002555 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2556 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2557 */
2558 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2559 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2560
2561 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002562 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08002563 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2564 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002565 * <p>See android.tonemap.curveRed for more details.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002566 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002567 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002568 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002569 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002570 public static final Key<float[]> TONEMAP_CURVE_BLUE =
2571 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002572
2573 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002574 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08002575 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2576 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002577 * <p>See android.tonemap.curveRed for more details.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002578 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002579 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002580 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002581 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002582 public static final Key<float[]> TONEMAP_CURVE_GREEN =
2583 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002584
2585 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002586 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08002587 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2588 * CONTRAST_CURVE.</p>
2589 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002590 * <pre><code>android.tonemap.curveRed =
Igor Murashkine0060932014-01-17 17:24:11 -08002591 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08002592 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Igor Murashkine0060932014-01-17 17:24:11 -08002593 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2594 * guaranteed that input values 0.0 and 1.0 are included in the list to
2595 * define a complete mapping. For input values between control points,
2596 * the camera device must linearly interpolate between the control
2597 * points.</p>
2598 * <p>Each curve can have an independent number of points, and the number
2599 * of points can be less than max (that is, the request doesn't have to
2600 * always provide a curve with number of points equivalent to
2601 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2602 * <p>A few examples, and their corresponding graphical mappings; these
2603 * only specify the red channel and the precision is limited to 4
2604 * digits, for conciseness.</p>
2605 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002606 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002607 * </code></pre>
2608 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2609 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002610 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002611 * </code></pre>
2612 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2613 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002614 * <pre><code>android.tonemap.curveRed = [
Igor Murashkine0060932014-01-17 17:24:11 -08002615 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2616 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2617 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2618 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
2619 * </code></pre>
2620 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2621 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002622 * <pre><code>android.tonemap.curveRed = [
Igor Murashkine0060932014-01-17 17:24:11 -08002623 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2624 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2625 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2626 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
2627 * </code></pre>
2628 * <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 -08002629 *
Igor Murashkine0060932014-01-17 17:24:11 -08002630 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002631 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002632 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002633 */
2634 public static final Key<float[]> TONEMAP_CURVE_RED =
2635 new Key<float[]>("android.tonemap.curveRed", float[].class);
2636
2637 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002638 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
2639 * is CONTRAST_CURVE.</p>
2640 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
2641 * channels respectively. The following example uses the red channel as an
2642 * example. The same logic applies to green and blue channel.
2643 * Each channel's curve is defined by an array of control points:</p>
2644 * <pre><code>curveRed =
2645 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
2646 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
2647 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2648 * guaranteed that input values 0.0 and 1.0 are included in the list to
2649 * define a complete mapping. For input values between control points,
2650 * the camera device must linearly interpolate between the control
2651 * points.</p>
2652 * <p>Each curve can have an independent number of points, and the number
2653 * of points can be less than max (that is, the request doesn't have to
2654 * always provide a curve with number of points equivalent to
2655 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2656 * <p>A few examples, and their corresponding graphical mappings; these
2657 * only specify the red channel and the precision is limited to 4
2658 * digits, for conciseness.</p>
2659 * <p>Linear mapping:</p>
2660 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
2661 * </code></pre>
2662 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2663 * <p>Invert mapping:</p>
2664 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
2665 * </code></pre>
2666 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2667 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2668 * <pre><code>curveRed = [
2669 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
2670 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
2671 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
2672 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
2673 * </code></pre>
2674 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2675 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2676 * <pre><code>curveRed = [
2677 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
2678 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
2679 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
2680 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
2681 * </code></pre>
2682 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
2683 *
2684 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
2685 * @see CaptureRequest#TONEMAP_MODE
2686 */
2687 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
2688 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
2689
2690 /**
Igor Murashkine0060932014-01-17 17:24:11 -08002691 * <p>High-level global contrast/gamma/tonemapping control.</p>
2692 * <p>When switching to an application-defined contrast curve by setting
2693 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2694 * per-channel with a set of <code>(in, out)</code> points that specify the
2695 * mapping from input high-bit-depth pixel value to the output
2696 * low-bit-depth value. Since the actual pixel ranges of both input
2697 * and output may change depending on the camera pipeline, the values
2698 * are specified by normalized floating-point numbers.</p>
2699 * <p>More-complex color mapping operations such as 3D color look-up
2700 * tables, selective chroma enhancement, or other non-linear color
2701 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2702 * CONTRAST_CURVE.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002703 * <p>This must be set to a valid mode in
2704 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08002705 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002706 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08002707 * These values are always available, and as close as possible to the
2708 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07002709 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08002710 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2711 * roughly the same.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002712 *
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002713 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002714 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08002715 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002716 * @see #TONEMAP_MODE_CONTRAST_CURVE
2717 * @see #TONEMAP_MODE_FAST
2718 * @see #TONEMAP_MODE_HIGH_QUALITY
2719 */
2720 public static final Key<Integer> TONEMAP_MODE =
2721 new Key<Integer>("android.tonemap.mode", int.class);
2722
2723 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002724 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002725 * that the camera is powered on and may be streaming images back to the
2726 * Application Processor. In certain rare circumstances, the OS may
2727 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002728 * any untrusted applications.</p>
2729 * <p>In particular, the LED <em>must</em> always be on when the data could be
2730 * transmitted off the device. The LED <em>should</em> always be on whenever
2731 * data is stored locally on the device.</p>
2732 * <p>The LED <em>may</em> be off if a trusted application is using the data that
2733 * doesn't violate the above rules.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002734 * @hide
2735 */
2736 public static final Key<Boolean> LED_TRANSMIT =
2737 new Key<Boolean>("android.led.transmit", boolean.class);
2738
2739 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002740 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002741 * to its current values, or is free to vary.</p>
2742 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002743 * 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 -08002744 * a change in other capture settings forced the camera device to
2745 * perform a black level reset.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002746 *
2747 * @see CaptureRequest#BLACK_LEVEL_LOCK
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002748 */
2749 public static final Key<Boolean> BLACK_LEVEL_LOCK =
2750 new Key<Boolean>("android.blackLevel.lock", boolean.class);
2751
Igor Murashkin3865a842014-01-17 18:18:39 -08002752 /**
2753 * <p>The frame number corresponding to the last request
2754 * with which the output result (metadata + buffers) has been fully
2755 * synchronized.</p>
2756 * <p>When a request is submitted to the camera device, there is usually a
2757 * delay of several frames before the controls get applied. A camera
2758 * device may either choose to account for this delay by implementing a
2759 * pipeline and carefully submit well-timed atomic control updates, or
2760 * it may start streaming control changes that span over several frame
2761 * boundaries.</p>
2762 * <p>In the latter case, whenever a request's settings change relative to
2763 * the previous submitted request, the full set of changes may take
2764 * multiple frame durations to fully take effect. Some settings may
2765 * take effect sooner (in less frame durations) than others.</p>
2766 * <p>While a set of control changes are being propagated, this value
2767 * will be CONVERGING.</p>
2768 * <p>Once it is fully known that a set of control changes have been
2769 * finished propagating, and the resulting updated control settings
2770 * have been read back by the camera device, this value will be set
2771 * to a non-negative frame number (corresponding to the request to
2772 * which the results have synchronized to).</p>
2773 * <p>Older camera device implementations may not have a way to detect
2774 * when all camera controls have been applied, and will always set this
2775 * value to UNKNOWN.</p>
2776 * <p>FULL capability devices will always have this value set to the
2777 * frame number of the request corresponding to this result.</p>
2778 * <p><em>Further details</em>:</p>
2779 * <ul>
2780 * <li>Whenever a request differs from the last request, any future
2781 * results not yet returned may have this value set to CONVERGING (this
2782 * could include any in-progress captures not yet returned by the camera
2783 * device, for more details see pipeline considerations below).</li>
2784 * <li>Submitting a series of multiple requests that differ from the
2785 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
2786 * moves the new synchronization frame to the last non-repeating
2787 * request (using the smallest frame number from the contiguous list of
2788 * repeating requests).</li>
2789 * <li>Submitting the same request repeatedly will not change this value
2790 * to CONVERGING, if it was already a non-negative value.</li>
2791 * <li>When this value changes to non-negative, that means that all of the
2792 * metadata controls from the request have been applied, all of the
2793 * metadata controls from the camera device have been read to the
2794 * updated values (into the result), and all of the graphics buffers
2795 * corresponding to this result are also synchronized to the request.</li>
2796 * </ul>
2797 * <p><em>Pipeline considerations</em>:</p>
2798 * <p>Submitting a request with updated controls relative to the previously
2799 * submitted requests may also invalidate the synchronization state
2800 * of all the results corresponding to currently in-flight requests.</p>
2801 * <p>In other words, results for this current request and up to
2802 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
2803 * android.sync.frameNumber change to CONVERGING.</p>
2804 *
2805 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2806 * @see #SYNC_FRAME_NUMBER_CONVERGING
2807 * @see #SYNC_FRAME_NUMBER_UNKNOWN
2808 * @hide
2809 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07002810 public static final Key<Long> SYNC_FRAME_NUMBER =
2811 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08002812
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002813 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2814 * End generated code
2815 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002816}