blob: 4f80bc43e642513cb3426b8e07c179afea4f0e39 [file] [log] [blame]
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Eino-Ville Talvala2f1a2e42013-07-25 17:12:05 -070017package android.hardware.camera2;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080018
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070019import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkinbdf366c2014-07-25 16:54:20 -070020import android.hardware.camera2.impl.CaptureResultExtras;
Igor Murashkin6c76f582014-07-15 17:19:49 -070021import android.hardware.camera2.impl.PublicKey;
22import android.hardware.camera2.impl.SyntheticKey;
Igor Murashkind6d65152014-05-19 16:31:02 -070023import android.hardware.camera2.utils.TypeReference;
24import android.util.Log;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070025import android.util.Rational;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080026
Igor Murashkind6d65152014-05-19 16:31:02 -070027import java.util.List;
28
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080029/**
Igor Murashkindb075af2014-05-21 10:07:08 -070030 * <p>The subset of the results of a single image capture from the image sensor.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080031 *
Igor Murashkindb075af2014-05-21 10:07:08 -070032 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080033 * flash), the processing pipeline, the control algorithms, and the output
34 * buffers.</p>
35 *
36 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
37 * {@link CaptureRequest}. All properties listed for capture requests can also
38 * be queried on the capture result, to determine the final values used for
39 * capture. The result also includes additional metadata about the state of the
40 * camera device during the capture.</p>
41 *
Igor Murashkindb075af2014-05-21 10:07:08 -070042 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
43 * are necessarily available. Some results are {@link CaptureResult partial} and will
44 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
45 * every key available that was enabled by the request.</p>
46 *
47 * <p>{@link CaptureResult} objects are immutable.</p>
Ruben Brunkf967a542014-04-28 16:31:11 -070048 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080049 */
Igor Murashkindb075af2014-05-21 10:07:08 -070050public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
Igor Murashkind6d65152014-05-19 16:31:02 -070051
52 private static final String TAG = "CaptureResult";
53 private static final boolean VERBOSE = false;
54
55 /**
56 * A {@code Key} is used to do capture result field lookups with
57 * {@link CaptureResult#get}.
58 *
59 * <p>For example, to get the timestamp corresponding to the exposure of the first row:
60 * <code><pre>
61 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
62 * </pre></code>
63 * </p>
64 *
65 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
66 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
67 *
68 * @see CaptureResult#get
69 * @see CameraCharacteristics#getAvailableCaptureResultKeys
70 */
71 public final static class Key<T> {
72 private final CameraMetadataNative.Key<T> mKey;
73
74 /**
75 * Visible for testing and vendor extensions only.
76 *
77 * @hide
78 */
79 public Key(String name, Class<T> type) {
80 mKey = new CameraMetadataNative.Key<T>(name, type);
81 }
82
83 /**
84 * Visible for testing and vendor extensions only.
85 *
86 * @hide
87 */
88 public Key(String name, TypeReference<T> typeReference) {
89 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
90 }
91
92 /**
93 * Return a camelCase, period separated name formatted like:
94 * {@code "root.section[.subsections].name"}.
95 *
96 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
97 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
98 *
99 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
100 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
101 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
102 *
103 * @return String representation of the key name
104 */
105 public String getName() {
106 return mKey.getName();
107 }
108
109 /**
110 * {@inheritDoc}
111 */
112 @Override
113 public final int hashCode() {
114 return mKey.hashCode();
115 }
116
117 /**
118 * {@inheritDoc}
119 */
120 @SuppressWarnings("unchecked")
121 @Override
122 public final boolean equals(Object o) {
123 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
124 }
125
126 /**
127 * Visible for CameraMetadataNative implementation only; do not use.
128 *
129 * TODO: Make this private or remove it altogether.
130 *
131 * @hide
132 */
133 public CameraMetadataNative.Key<T> getNativeKey() {
134 return mKey;
135 }
136
137 @SuppressWarnings({ "unchecked" })
138 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
139 mKey = (CameraMetadataNative.Key<T>) nativeKey;
140 }
141 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700142
143 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700144 private final CaptureRequest mRequest;
145 private final int mSequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700146 private final long mFrameNumber;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700147
Igor Murashkin70725502013-06-25 20:27:06 +0000148 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700149 * Takes ownership of the passed-in properties object
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700150 *
151 * <p>For internal use only</p>
Igor Murashkin70725502013-06-25 20:27:06 +0000152 * @hide
153 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700154 public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
155 CaptureResultExtras extras) {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700156 if (results == null) {
157 throw new IllegalArgumentException("results was null");
158 }
159
160 if (parent == null) {
161 throw new IllegalArgumentException("parent was null");
162 }
163
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700164 if (extras == null) {
165 throw new IllegalArgumentException("extras was null");
166 }
167
Igor Murashkind6d65152014-05-19 16:31:02 -0700168 mResults = CameraMetadataNative.move(results);
169 if (mResults.isEmpty()) {
170 throw new AssertionError("Results must not be empty");
171 }
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700172 mRequest = parent;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700173 mSequenceId = extras.getRequestId();
174 mFrameNumber = extras.getFrameNumber();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700175 }
176
Ruben Brunkf967a542014-04-28 16:31:11 -0700177 /**
178 * Returns a copy of the underlying {@link CameraMetadataNative}.
179 * @hide
180 */
181 public CameraMetadataNative getNativeCopy() {
182 return new CameraMetadataNative(mResults);
183 }
184
Igor Murashkind6d65152014-05-19 16:31:02 -0700185 /**
186 * Creates a request-less result.
187 *
188 * <p><strong>For testing only.</strong></p>
189 * @hide
190 */
191 public CaptureResult(CameraMetadataNative results, int sequenceId) {
192 if (results == null) {
193 throw new IllegalArgumentException("results was null");
194 }
195
196 mResults = CameraMetadataNative.move(results);
197 if (mResults.isEmpty()) {
198 throw new AssertionError("Results must not be empty");
199 }
200
201 mRequest = null;
202 mSequenceId = sequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700203 mFrameNumber = -1;
Igor Murashkind6d65152014-05-19 16:31:02 -0700204 }
205
206 /**
207 * Get a capture result field value.
208 *
209 * <p>The field definitions can be found in {@link CaptureResult}.</p>
210 *
211 * <p>Querying the value for the same key more than once will return a value
212 * which is equal to the previous queried value.</p>
213 *
214 * @throws IllegalArgumentException if the key was not valid
215 *
216 * @param key The result field to read.
217 * @return The value of that key, or {@code null} if the field is not set.
218 */
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700219 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700220 T value = mResults.get(key);
221 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
222 return value;
223 }
224
225 /**
226 * {@inheritDoc}
227 * @hide
228 */
229 @SuppressWarnings("unchecked")
230 @Override
231 protected <T> T getProtected(Key<?> key) {
232 return (T) mResults.get(key);
233 }
234
235 /**
236 * {@inheritDoc}
237 * @hide
238 */
239 @SuppressWarnings("unchecked")
240 @Override
241 protected Class<Key<?>> getKeyClass() {
242 Object thisClass = Key.class;
243 return (Class<Key<?>>)thisClass;
244 }
245
246 /**
247 * Dumps the native metadata contents to logcat.
248 *
249 * <p>Visibility for testing/debugging only. The results will not
250 * include any synthesized keys, as they are invisible to the native layer.</p>
251 *
252 * @hide
253 */
254 public void dumpToLog() {
255 mResults.dumpToLog();
256 }
257
258 /**
259 * {@inheritDoc}
260 */
261 @Override
262 public List<Key<?>> getKeys() {
263 // Force the javadoc for this function to show up on the CaptureResult page
264 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800265 }
266
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700267 /**
268 * Get the request associated with this result.
269 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700270 * <p>Whenever a request has been fully or partially captured, with
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700271 * {@link CameraCaptureSession.CaptureListener#onCaptureCompleted} or
272 * {@link CameraCaptureSession.CaptureListener#onCaptureProgressed}, the {@code result}'s
Igor Murashkindb075af2014-05-21 10:07:08 -0700273 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700274 * </p>
275 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700276 * <p>For example,
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700277 * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() {
278 * {@literal @}Override
279 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
280 * assert(myResult.getRequest.equals(myRequest) == true);
281 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700282 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700283 * </code></pre>
284 * </p>
285 *
286 * @return The request associated with this result. Never {@code null}.
287 */
288 public CaptureRequest getRequest() {
289 return mRequest;
290 }
291
292 /**
293 * Get the frame number associated with this result.
294 *
295 * <p>Whenever a request has been processed, regardless of failure or success,
296 * it gets a unique frame number assigned to its future result/failure.</p>
297 *
298 * <p>This value monotonically increments, starting with 0,
299 * for every new result or failure; and the scope is the lifetime of the
300 * {@link CameraDevice}.</p>
301 *
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700302 * @return The frame number
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700303 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700304 public long getFrameNumber() {
305 return mFrameNumber;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700306 }
307
308 /**
309 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700310 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700311 *
312 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
313 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
314 *
315 * @return int The ID for the sequence of requests that this capture result is a part of
316 *
317 * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted
Igor Murashkindb075af2014-05-21 10:07:08 -0700318 * @see CameraDevice.CaptureListener#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700319 */
320 public int getSequenceId() {
321 return mSequenceId;
322 }
323
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700324 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
325 * The key entries below this point are generated from metadata
326 * definitions in /system/media/camera/docs. Do not modify by hand or
327 * modify the comment blocks at the start or end.
328 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
329
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800330
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700331 /**
Zhijun He379af012014-05-06 11:54:54 -0700332 * <p>The mode control selects how the image data is converted from the
333 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700334 * <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 -0700335 * control is overridden by the AWB routine. When AWB is disabled, the
336 * application controls how the color mapping is performed.</p>
337 * <p>We define the expected processing pipeline below. For consistency
338 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
339 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
340 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
341 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
342 * camera device (in the results) and be roughly correct.</p>
343 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
344 * FAST or HIGH_QUALITY will yield a picture with the same white point
345 * as what was produced by the camera device in the earlier frame.</p>
346 * <p>The expected processing pipeline is as follows:</p>
347 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
348 * <p>The white balance is encoded by two values, a 4-channel white-balance
349 * gain vector (applied in the Bayer domain), and a 3x3 color transform
350 * matrix (applied after demosaic).</p>
351 * <p>The 4-channel white-balance gains are defined as:</p>
352 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
353 * </code></pre>
354 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
355 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
356 * These may be identical for a given camera device implementation; if
357 * the camera device does not support a separate gain for even/odd green
358 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
359 * <code>G_even</code> in the output result metadata.</p>
360 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
361 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
362 * </code></pre>
363 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
364 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
365 * <p>with colors as follows:</p>
366 * <pre><code>r' = I0r + I1g + I2b
367 * g' = I3r + I4g + I5b
368 * b' = I6r + I7g + I8b
369 * </code></pre>
370 * <p>Both the input and output value ranges must match. Overflow/underflow
371 * values are clipped to fit within the range.</p>
372 *
373 * @see CaptureRequest#COLOR_CORRECTION_GAINS
374 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
375 * @see CaptureRequest#CONTROL_AWB_MODE
376 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
377 * @see #COLOR_CORRECTION_MODE_FAST
378 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
379 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700380 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700381 public static final Key<Integer> COLOR_CORRECTION_MODE =
382 new Key<Integer>("android.colorCorrection.mode", int.class);
383
384 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800385 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700386 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800387 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800388 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700389 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800390 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800391 * <p>In the latter case, the camera device may round the matrix to account
392 * for precision issues; the final rounded matrix should be reported back
393 * in this matrix result metadata. The transform should keep the magnitude
394 * of the output color values within <code>[0, 1.0]</code> (assuming input color
395 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800396 *
397 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700398 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700399 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700400 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
401 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700402
403 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800404 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800405 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700406 * <p>These per-channel gains are either set by the camera device
407 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
408 * TRANSFORM_MATRIX, or directly by the application in the
409 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
410 * TRANSFORM_MATRIX.</p>
411 * <p>The gains in the result metadata are the gains actually
412 * applied by the camera device to the current frame.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800413 *
414 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700415 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700416 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700417 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
418 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700419
420 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700421 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
422 * <p>This must be set to a valid mode from
423 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_CORRECTION_MODES android.colorCorrection.availableAberrationCorrectionModes}.</p>
424 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
425 * can not focus on the same point after exiting from the lens. This metadata defines
426 * the high level control of chromatic aberration correction algorithm, which aims to
427 * minimize the chromatic artifacts that may occur along the object boundaries in an
428 * image.</p>
429 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
430 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
431 * use the highest-quality aberration correction algorithms, even if it slows down
432 * capture rate. FAST means the camera device will not slow down capture rate when
433 * applying aberration correction.</p>
434 *
435 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_CORRECTION_MODES
436 * @see #COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_OFF
437 * @see #COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_FAST
438 * @see #COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_HIGH_QUALITY
439 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700440 @PublicKey
Zhijun Hea05e59d2014-07-08 18:27:47 -0700441 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_CORRECTION_MODE =
442 new Key<Integer>("android.colorCorrection.aberrationCorrectionMode", int.class);
443
444 /**
Zhijun He379af012014-05-06 11:54:54 -0700445 * <p>The desired setting for the camera device's auto-exposure
446 * algorithm's antibanding compensation.</p>
447 * <p>Some kinds of lighting fixtures, such as some fluorescent
448 * lights, flicker at the rate of the power supply frequency
449 * (60Hz or 50Hz, depending on country). While this is
450 * typically not noticeable to a person, it can be visible to
451 * a camera device. If a camera sets its exposure time to the
452 * wrong value, the flicker may become visible in the
453 * viewfinder as flicker or in a final captured image, as a
454 * set of variable-brightness bands across the image.</p>
455 * <p>Therefore, the auto-exposure routines of camera devices
456 * include antibanding routines that ensure that the chosen
457 * exposure value will not cause such banding. The choice of
458 * exposure time depends on the rate of flicker, which the
459 * camera device can detect automatically, or the expected
460 * rate can be selected by the application using this
461 * control.</p>
462 * <p>A given camera device may not support all of the possible
463 * options for the antibanding mode. The
464 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
465 * the available modes for a given camera device.</p>
466 * <p>The default mode is AUTO, which must be supported by all
467 * camera devices.</p>
468 * <p>If manual exposure control is enabled (by setting
469 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
470 * then this setting has no effect, and the application must
471 * ensure it selects exposure times that do not cause banding
472 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
473 * the application in this.</p>
474 *
475 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
476 * @see CaptureRequest#CONTROL_AE_MODE
477 * @see CaptureRequest#CONTROL_MODE
478 * @see CaptureResult#STATISTICS_SCENE_FLICKER
479 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
480 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
481 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
482 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
483 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700484 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700485 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
486 new Key<Integer>("android.control.aeAntibandingMode", int.class);
487
488 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700489 * <p>Adjustment to auto-exposure (AE) target image
490 * brightness.</p>
491 * <p>The adjustment is measured as a count of steps, with the
492 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
493 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
494 * <p>For example, if the exposure value (EV) step is 0.333, '6'
495 * will mean an exposure compensation of +2 EV; -3 will mean an
496 * exposure compensation of -1 EV. One EV represents a doubling
497 * of image brightness. Note that this control will only be
498 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
499 * 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 -0700500 * <p>In the event of exposure compensation value being changed, camera device
501 * may take several frames to reach the newly requested exposure target.
502 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
503 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
504 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
505 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
506 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700507 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
508 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700509 * @see CaptureRequest#CONTROL_AE_LOCK
510 * @see CaptureRequest#CONTROL_AE_MODE
511 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700512 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700513 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700514 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
515 new Key<Integer>("android.control.aeExposureCompensation", int.class);
516
517 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700518 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700519 * calculated values.</p>
520 * <p>Note that even when AE is locked, the flash may be
521 * fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / ON_ALWAYS_FLASH /
522 * ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700523 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
524 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700525 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
526 * when AE is already locked, the camera device will not change the exposure time
527 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
528 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
529 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
530 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
531 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
532 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700533 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700534 * @see CaptureRequest#CONTROL_AE_MODE
535 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
536 * @see CaptureResult#CONTROL_AE_STATE
537 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
538 * @see CaptureRequest#SENSOR_SENSITIVITY
539 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700540 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700541 public static final Key<Boolean> CONTROL_AE_LOCK =
542 new Key<Boolean>("android.control.aeLock", boolean.class);
543
544 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800545 * <p>The desired mode for the camera device's
546 * auto-exposure routine.</p>
547 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
548 * AUTO.</p>
549 * <p>When set to any of the ON modes, the camera device's
550 * auto-exposure routine is enabled, overriding the
551 * application's selected exposure time, sensor sensitivity,
552 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
553 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
554 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
555 * is selected, the camera device's flash unit controls are
556 * also overridden.</p>
557 * <p>The FLASH modes are only available if the camera device
558 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
559 * <p>If flash TORCH mode is desired, this field must be set to
560 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
561 * <p>When set to any of the ON modes, the values chosen by the
562 * camera device auto-exposure routine for the overridden
563 * fields for a given capture will be available in its
564 * CaptureResult.</p>
565 *
Zhijun He5f2a47f2014-01-16 15:44:41 -0800566 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800567 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
568 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800569 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
570 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800571 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800572 * @see #CONTROL_AE_MODE_OFF
573 * @see #CONTROL_AE_MODE_ON
574 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
575 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
576 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
577 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700578 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800579 public static final Key<Integer> CONTROL_AE_MODE =
580 new Key<Integer>("android.control.aeMode", int.class);
581
582 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800583 * <p>List of areas to use for
Ruben Brunkf59521d2014-02-03 17:14:33 -0800584 * metering.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800585 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700586 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800587 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
588 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700589 * bottom-right pixel in the active pixel array.</p>
590 * <p>The weight must range from 0 to 1000, and represents a weight
591 * for every pixel in the area. This means that a large metering area
592 * with the same weight as a smaller area will have more effect in
593 * the metering result. Metering areas can partially overlap and the
594 * camera device will add the weights in the overlap region.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800595 * <p>If all regions have 0 weight, then no specific metering area
Zhijun Hecc28a412014-02-24 15:11:23 -0800596 * needs to be used by the camera device. If the metering region is
Zhijun He14986152014-05-22 21:17:37 -0700597 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
598 * the camera device will ignore the sections outside the region and output the
599 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800600 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800601 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800602 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700603 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700604 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700605 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
606 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700607
608 /**
Zhijun He379af012014-05-06 11:54:54 -0700609 * <p>Range over which fps can be adjusted to
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700610 * maintain exposure.</p>
611 * <p>Only constrains auto-exposure (AE) algorithm, not
612 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p>
Zhijun He379af012014-05-06 11:54:54 -0700613 *
614 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
615 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700616 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700617 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
618 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700619
620 /**
621 * <p>Whether the camera device will trigger a precapture
622 * metering sequence when it processes this request.</p>
623 * <p>This entry is normally set to IDLE, or is not
624 * included at all in the request settings. When included and
625 * set to START, the camera device will trigger the autoexposure
626 * precapture metering sequence.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700627 * <p>The precapture sequence should triggered before starting a
628 * high-quality still capture for final metering decisions to
629 * be made, and for firing pre-capture flash pulses to estimate
630 * scene brightness and required final capture flash power, when
631 * the flash is enabled.</p>
632 * <p>Normally, this entry should be set to START for only a
633 * single request, and the application should wait until the
634 * sequence completes before starting a new one.</p>
635 * <p>The exact effect of auto-exposure (AE) precapture trigger
636 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700637 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
638 * details.</p>
Zhijun He379af012014-05-06 11:54:54 -0700639 *
640 * @see CaptureResult#CONTROL_AE_STATE
641 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
642 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
643 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700644 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700645 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
646 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
647
648 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700649 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800650 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
651 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
652 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
653 * the algorithm states to INACTIVE.</p>
654 * <p>The camera device can do several state transitions between two results, if it is
655 * allowed by the state transition table. For example: INACTIVE may never actually be
656 * seen in a result.</p>
657 * <p>The state in the result is the state for this image (in sync with this image): if
658 * AE state becomes CONVERGED, then the image data associated with this result should
659 * be good to use.</p>
660 * <p>Below are state transition tables for different AE modes.</p>
661 * <table>
662 * <thead>
663 * <tr>
664 * <th align="center">State</th>
665 * <th align="center">Transition Cause</th>
666 * <th align="center">New State</th>
667 * <th align="center">Notes</th>
668 * </tr>
669 * </thead>
670 * <tbody>
671 * <tr>
672 * <td align="center">INACTIVE</td>
673 * <td align="center"></td>
674 * <td align="center">INACTIVE</td>
675 * <td align="center">Camera device auto exposure algorithm is disabled</td>
676 * </tr>
677 * </tbody>
678 * </table>
679 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
680 * <table>
681 * <thead>
682 * <tr>
683 * <th align="center">State</th>
684 * <th align="center">Transition Cause</th>
685 * <th align="center">New State</th>
686 * <th align="center">Notes</th>
687 * </tr>
688 * </thead>
689 * <tbody>
690 * <tr>
691 * <td align="center">INACTIVE</td>
692 * <td align="center">Camera device initiates AE scan</td>
693 * <td align="center">SEARCHING</td>
694 * <td align="center">Values changing</td>
695 * </tr>
696 * <tr>
697 * <td align="center">INACTIVE</td>
698 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
699 * <td align="center">LOCKED</td>
700 * <td align="center">Values locked</td>
701 * </tr>
702 * <tr>
703 * <td align="center">SEARCHING</td>
704 * <td align="center">Camera device finishes AE scan</td>
705 * <td align="center">CONVERGED</td>
706 * <td align="center">Good values, not changing</td>
707 * </tr>
708 * <tr>
709 * <td align="center">SEARCHING</td>
710 * <td align="center">Camera device finishes AE scan</td>
711 * <td align="center">FLASH_REQUIRED</td>
712 * <td align="center">Converged but too dark w/o flash</td>
713 * </tr>
714 * <tr>
715 * <td align="center">SEARCHING</td>
716 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
717 * <td align="center">LOCKED</td>
718 * <td align="center">Values locked</td>
719 * </tr>
720 * <tr>
721 * <td align="center">CONVERGED</td>
722 * <td align="center">Camera device initiates AE scan</td>
723 * <td align="center">SEARCHING</td>
724 * <td align="center">Values changing</td>
725 * </tr>
726 * <tr>
727 * <td align="center">CONVERGED</td>
728 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
729 * <td align="center">LOCKED</td>
730 * <td align="center">Values locked</td>
731 * </tr>
732 * <tr>
733 * <td align="center">FLASH_REQUIRED</td>
734 * <td align="center">Camera device initiates AE scan</td>
735 * <td align="center">SEARCHING</td>
736 * <td align="center">Values changing</td>
737 * </tr>
738 * <tr>
739 * <td align="center">FLASH_REQUIRED</td>
740 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
741 * <td align="center">LOCKED</td>
742 * <td align="center">Values locked</td>
743 * </tr>
744 * <tr>
745 * <td align="center">LOCKED</td>
746 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
747 * <td align="center">SEARCHING</td>
748 * <td align="center">Values not good after unlock</td>
749 * </tr>
750 * <tr>
751 * <td align="center">LOCKED</td>
752 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
753 * <td align="center">CONVERGED</td>
754 * <td align="center">Values good after unlock</td>
755 * </tr>
756 * <tr>
757 * <td align="center">LOCKED</td>
758 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
759 * <td align="center">FLASH_REQUIRED</td>
760 * <td align="center">Exposure good, but too dark</td>
761 * </tr>
762 * <tr>
763 * <td align="center">PRECAPTURE</td>
764 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
765 * <td align="center">CONVERGED</td>
766 * <td align="center">Ready for high-quality capture</td>
767 * </tr>
768 * <tr>
769 * <td align="center">PRECAPTURE</td>
770 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
771 * <td align="center">LOCKED</td>
772 * <td align="center">Ready for high-quality capture</td>
773 * </tr>
774 * <tr>
775 * <td align="center">Any state</td>
776 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
777 * <td align="center">PRECAPTURE</td>
778 * <td align="center">Start AE precapture metering sequence</td>
779 * </tr>
780 * </tbody>
781 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800782 * <p>For the above table, the camera device may skip reporting any state changes that happen
783 * without application intervention (i.e. mode switch, trigger, locking). Any state that
784 * can be skipped in that manner is called a transient state.</p>
785 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
786 * listed in above table, it is also legal for the camera device to skip one or more
787 * transient states between two results. See below table for examples:</p>
788 * <table>
789 * <thead>
790 * <tr>
791 * <th align="center">State</th>
792 * <th align="center">Transition Cause</th>
793 * <th align="center">New State</th>
794 * <th align="center">Notes</th>
795 * </tr>
796 * </thead>
797 * <tbody>
798 * <tr>
799 * <td align="center">INACTIVE</td>
800 * <td align="center">Camera device finished AE scan</td>
801 * <td align="center">CONVERGED</td>
802 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
803 * </tr>
804 * <tr>
805 * <td align="center">Any state</td>
806 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
807 * <td align="center">FLASH_REQUIRED</td>
808 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
809 * </tr>
810 * <tr>
811 * <td align="center">Any state</td>
812 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
813 * <td align="center">CONVERGED</td>
814 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
815 * </tr>
816 * <tr>
817 * <td align="center">CONVERGED</td>
818 * <td align="center">Camera device finished AE scan</td>
819 * <td align="center">FLASH_REQUIRED</td>
820 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
821 * </tr>
822 * <tr>
823 * <td align="center">FLASH_REQUIRED</td>
824 * <td align="center">Camera device finished AE scan</td>
825 * <td align="center">CONVERGED</td>
826 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
827 * </tr>
828 * </tbody>
829 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -0800830 *
831 * @see CaptureRequest#CONTROL_AE_LOCK
832 * @see CaptureRequest#CONTROL_AE_MODE
833 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
834 * @see CaptureRequest#CONTROL_MODE
835 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700836 * @see #CONTROL_AE_STATE_INACTIVE
837 * @see #CONTROL_AE_STATE_SEARCHING
838 * @see #CONTROL_AE_STATE_CONVERGED
839 * @see #CONTROL_AE_STATE_LOCKED
840 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
841 * @see #CONTROL_AE_STATE_PRECAPTURE
842 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700843 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700844 public static final Key<Integer> CONTROL_AE_STATE =
845 new Key<Integer>("android.control.aeState", int.class);
846
847 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700848 * <p>Whether auto-focus (AF) is currently enabled, and what
849 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800850 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
851 * (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 -0800852 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800853 * 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 -0800854 * in result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800855 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800856 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800857 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -0800858 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700859 * @see #CONTROL_AF_MODE_OFF
860 * @see #CONTROL_AF_MODE_AUTO
861 * @see #CONTROL_AF_MODE_MACRO
862 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
863 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
864 * @see #CONTROL_AF_MODE_EDOF
865 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700866 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700867 public static final Key<Integer> CONTROL_AF_MODE =
868 new Key<Integer>("android.control.afMode", int.class);
869
870 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800871 * <p>List of areas to use for focus
Ruben Brunkf59521d2014-02-03 17:14:33 -0800872 * estimation.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800873 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700874 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800875 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
876 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700877 * bottom-right pixel in the active pixel array.</p>
878 * <p>The weight must range from 0 to 1000, and represents a weight
879 * for every pixel in the area. This means that a large metering area
880 * with the same weight as a smaller area will have more effect in
881 * the metering result. Metering areas can partially overlap and the
882 * camera device will add the weights in the overlap region.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700883 * <p>If all regions have 0 weight, then no specific metering area
884 * needs to be used by the camera device. If the metering region is
885 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
886 * the camera device will ignore the sections outside the region and output the
887 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800888 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800889 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800890 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700891 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700892 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700893 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
894 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700895
896 /**
Zhijun He379af012014-05-06 11:54:54 -0700897 * <p>Whether the camera device will trigger autofocus for this request.</p>
898 * <p>This entry is normally set to IDLE, or is not
899 * included at all in the request settings.</p>
900 * <p>When included and set to START, the camera device will trigger the
901 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
902 * <p>When set to CANCEL, the camera device will cancel any active trigger,
903 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700904 * <p>Generally, applications should set this entry to START or CANCEL for only a
905 * single capture, and then return it to IDLE (or not set at all). Specifying
906 * START for multiple captures in a row means restarting the AF operation over
907 * and over again.</p>
908 * <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 -0700909 *
910 * @see CaptureResult#CONTROL_AF_STATE
911 * @see #CONTROL_AF_TRIGGER_IDLE
912 * @see #CONTROL_AF_TRIGGER_START
913 * @see #CONTROL_AF_TRIGGER_CANCEL
914 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700915 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700916 public static final Key<Integer> CONTROL_AF_TRIGGER =
917 new Key<Integer>("android.control.afTrigger", int.class);
918
919 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700920 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800921 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
922 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
923 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
924 * the algorithm states to INACTIVE.</p>
925 * <p>The camera device can do several state transitions between two results, if it is
926 * allowed by the state transition table. For example: INACTIVE may never actually be
927 * seen in a result.</p>
928 * <p>The state in the result is the state for this image (in sync with this image): if
929 * AF state becomes FOCUSED, then the image data associated with this result should
930 * be sharp.</p>
931 * <p>Below are state transition tables for different AF modes.</p>
932 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
933 * <table>
934 * <thead>
935 * <tr>
936 * <th align="center">State</th>
937 * <th align="center">Transition Cause</th>
938 * <th align="center">New State</th>
939 * <th align="center">Notes</th>
940 * </tr>
941 * </thead>
942 * <tbody>
943 * <tr>
944 * <td align="center">INACTIVE</td>
945 * <td align="center"></td>
946 * <td align="center">INACTIVE</td>
947 * <td align="center">Never changes</td>
948 * </tr>
949 * </tbody>
950 * </table>
951 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
952 * <table>
953 * <thead>
954 * <tr>
955 * <th align="center">State</th>
956 * <th align="center">Transition Cause</th>
957 * <th align="center">New State</th>
958 * <th align="center">Notes</th>
959 * </tr>
960 * </thead>
961 * <tbody>
962 * <tr>
963 * <td align="center">INACTIVE</td>
964 * <td align="center">AF_TRIGGER</td>
965 * <td align="center">ACTIVE_SCAN</td>
966 * <td align="center">Start AF sweep, Lens now moving</td>
967 * </tr>
968 * <tr>
969 * <td align="center">ACTIVE_SCAN</td>
970 * <td align="center">AF sweep done</td>
971 * <td align="center">FOCUSED_LOCKED</td>
972 * <td align="center">Focused, Lens now locked</td>
973 * </tr>
974 * <tr>
975 * <td align="center">ACTIVE_SCAN</td>
976 * <td align="center">AF sweep done</td>
977 * <td align="center">NOT_FOCUSED_LOCKED</td>
978 * <td align="center">Not focused, Lens now locked</td>
979 * </tr>
980 * <tr>
981 * <td align="center">ACTIVE_SCAN</td>
982 * <td align="center">AF_CANCEL</td>
983 * <td align="center">INACTIVE</td>
984 * <td align="center">Cancel/reset AF, Lens now locked</td>
985 * </tr>
986 * <tr>
987 * <td align="center">FOCUSED_LOCKED</td>
988 * <td align="center">AF_CANCEL</td>
989 * <td align="center">INACTIVE</td>
990 * <td align="center">Cancel/reset AF</td>
991 * </tr>
992 * <tr>
993 * <td align="center">FOCUSED_LOCKED</td>
994 * <td align="center">AF_TRIGGER</td>
995 * <td align="center">ACTIVE_SCAN</td>
996 * <td align="center">Start new sweep, Lens now moving</td>
997 * </tr>
998 * <tr>
999 * <td align="center">NOT_FOCUSED_LOCKED</td>
1000 * <td align="center">AF_CANCEL</td>
1001 * <td align="center">INACTIVE</td>
1002 * <td align="center">Cancel/reset AF</td>
1003 * </tr>
1004 * <tr>
1005 * <td align="center">NOT_FOCUSED_LOCKED</td>
1006 * <td align="center">AF_TRIGGER</td>
1007 * <td align="center">ACTIVE_SCAN</td>
1008 * <td align="center">Start new sweep, Lens now moving</td>
1009 * </tr>
1010 * <tr>
1011 * <td align="center">Any state</td>
1012 * <td align="center">Mode change</td>
1013 * <td align="center">INACTIVE</td>
1014 * <td align="center"></td>
1015 * </tr>
1016 * </tbody>
1017 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001018 * <p>For the above table, the camera device may skip reporting any state changes that happen
1019 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1020 * can be skipped in that manner is called a transient state.</p>
1021 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1022 * state transitions listed in above table, it is also legal for the camera device to skip
1023 * one or more transient states between two results. See below table for examples:</p>
1024 * <table>
1025 * <thead>
1026 * <tr>
1027 * <th align="center">State</th>
1028 * <th align="center">Transition Cause</th>
1029 * <th align="center">New State</th>
1030 * <th align="center">Notes</th>
1031 * </tr>
1032 * </thead>
1033 * <tbody>
1034 * <tr>
1035 * <td align="center">INACTIVE</td>
1036 * <td align="center">AF_TRIGGER</td>
1037 * <td align="center">FOCUSED_LOCKED</td>
1038 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1039 * </tr>
1040 * <tr>
1041 * <td align="center">INACTIVE</td>
1042 * <td align="center">AF_TRIGGER</td>
1043 * <td align="center">NOT_FOCUSED_LOCKED</td>
1044 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1045 * </tr>
1046 * <tr>
1047 * <td align="center">FOCUSED_LOCKED</td>
1048 * <td align="center">AF_TRIGGER</td>
1049 * <td align="center">FOCUSED_LOCKED</td>
1050 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1051 * </tr>
1052 * <tr>
1053 * <td align="center">NOT_FOCUSED_LOCKED</td>
1054 * <td align="center">AF_TRIGGER</td>
1055 * <td align="center">FOCUSED_LOCKED</td>
1056 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1057 * </tr>
1058 * </tbody>
1059 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001060 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1061 * <table>
1062 * <thead>
1063 * <tr>
1064 * <th align="center">State</th>
1065 * <th align="center">Transition Cause</th>
1066 * <th align="center">New State</th>
1067 * <th align="center">Notes</th>
1068 * </tr>
1069 * </thead>
1070 * <tbody>
1071 * <tr>
1072 * <td align="center">INACTIVE</td>
1073 * <td align="center">Camera device initiates new scan</td>
1074 * <td align="center">PASSIVE_SCAN</td>
1075 * <td align="center">Start AF scan, Lens now moving</td>
1076 * </tr>
1077 * <tr>
1078 * <td align="center">INACTIVE</td>
1079 * <td align="center">AF_TRIGGER</td>
1080 * <td align="center">NOT_FOCUSED_LOCKED</td>
1081 * <td align="center">AF state query, Lens now locked</td>
1082 * </tr>
1083 * <tr>
1084 * <td align="center">PASSIVE_SCAN</td>
1085 * <td align="center">Camera device completes current scan</td>
1086 * <td align="center">PASSIVE_FOCUSED</td>
1087 * <td align="center">End AF scan, Lens now locked</td>
1088 * </tr>
1089 * <tr>
1090 * <td align="center">PASSIVE_SCAN</td>
1091 * <td align="center">Camera device fails current scan</td>
1092 * <td align="center">PASSIVE_UNFOCUSED</td>
1093 * <td align="center">End AF scan, Lens now locked</td>
1094 * </tr>
1095 * <tr>
1096 * <td align="center">PASSIVE_SCAN</td>
1097 * <td align="center">AF_TRIGGER</td>
1098 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001099 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001100 * </tr>
1101 * <tr>
1102 * <td align="center">PASSIVE_SCAN</td>
1103 * <td align="center">AF_TRIGGER</td>
1104 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001105 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001106 * </tr>
1107 * <tr>
1108 * <td align="center">PASSIVE_SCAN</td>
1109 * <td align="center">AF_CANCEL</td>
1110 * <td align="center">INACTIVE</td>
1111 * <td align="center">Reset lens position, Lens now locked</td>
1112 * </tr>
1113 * <tr>
1114 * <td align="center">PASSIVE_FOCUSED</td>
1115 * <td align="center">Camera device initiates new scan</td>
1116 * <td align="center">PASSIVE_SCAN</td>
1117 * <td align="center">Start AF scan, Lens now moving</td>
1118 * </tr>
1119 * <tr>
1120 * <td align="center">PASSIVE_UNFOCUSED</td>
1121 * <td align="center">Camera device initiates new scan</td>
1122 * <td align="center">PASSIVE_SCAN</td>
1123 * <td align="center">Start AF scan, Lens now moving</td>
1124 * </tr>
1125 * <tr>
1126 * <td align="center">PASSIVE_FOCUSED</td>
1127 * <td align="center">AF_TRIGGER</td>
1128 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001129 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001130 * </tr>
1131 * <tr>
1132 * <td align="center">PASSIVE_UNFOCUSED</td>
1133 * <td align="center">AF_TRIGGER</td>
1134 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001135 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001136 * </tr>
1137 * <tr>
1138 * <td align="center">FOCUSED_LOCKED</td>
1139 * <td align="center">AF_TRIGGER</td>
1140 * <td align="center">FOCUSED_LOCKED</td>
1141 * <td align="center">No effect</td>
1142 * </tr>
1143 * <tr>
1144 * <td align="center">FOCUSED_LOCKED</td>
1145 * <td align="center">AF_CANCEL</td>
1146 * <td align="center">INACTIVE</td>
1147 * <td align="center">Restart AF scan</td>
1148 * </tr>
1149 * <tr>
1150 * <td align="center">NOT_FOCUSED_LOCKED</td>
1151 * <td align="center">AF_TRIGGER</td>
1152 * <td align="center">NOT_FOCUSED_LOCKED</td>
1153 * <td align="center">No effect</td>
1154 * </tr>
1155 * <tr>
1156 * <td align="center">NOT_FOCUSED_LOCKED</td>
1157 * <td align="center">AF_CANCEL</td>
1158 * <td align="center">INACTIVE</td>
1159 * <td align="center">Restart AF scan</td>
1160 * </tr>
1161 * </tbody>
1162 * </table>
1163 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1164 * <table>
1165 * <thead>
1166 * <tr>
1167 * <th align="center">State</th>
1168 * <th align="center">Transition Cause</th>
1169 * <th align="center">New State</th>
1170 * <th align="center">Notes</th>
1171 * </tr>
1172 * </thead>
1173 * <tbody>
1174 * <tr>
1175 * <td align="center">INACTIVE</td>
1176 * <td align="center">Camera device initiates new scan</td>
1177 * <td align="center">PASSIVE_SCAN</td>
1178 * <td align="center">Start AF scan, Lens now moving</td>
1179 * </tr>
1180 * <tr>
1181 * <td align="center">INACTIVE</td>
1182 * <td align="center">AF_TRIGGER</td>
1183 * <td align="center">NOT_FOCUSED_LOCKED</td>
1184 * <td align="center">AF state query, Lens now locked</td>
1185 * </tr>
1186 * <tr>
1187 * <td align="center">PASSIVE_SCAN</td>
1188 * <td align="center">Camera device completes current scan</td>
1189 * <td align="center">PASSIVE_FOCUSED</td>
1190 * <td align="center">End AF scan, Lens now locked</td>
1191 * </tr>
1192 * <tr>
1193 * <td align="center">PASSIVE_SCAN</td>
1194 * <td align="center">Camera device fails current scan</td>
1195 * <td align="center">PASSIVE_UNFOCUSED</td>
1196 * <td align="center">End AF scan, Lens now locked</td>
1197 * </tr>
1198 * <tr>
1199 * <td align="center">PASSIVE_SCAN</td>
1200 * <td align="center">AF_TRIGGER</td>
1201 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001202 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001203 * </tr>
1204 * <tr>
1205 * <td align="center">PASSIVE_SCAN</td>
1206 * <td align="center">AF_TRIGGER</td>
1207 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001208 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001209 * </tr>
1210 * <tr>
1211 * <td align="center">PASSIVE_SCAN</td>
1212 * <td align="center">AF_CANCEL</td>
1213 * <td align="center">INACTIVE</td>
1214 * <td align="center">Reset lens position, Lens now locked</td>
1215 * </tr>
1216 * <tr>
1217 * <td align="center">PASSIVE_FOCUSED</td>
1218 * <td align="center">Camera device initiates new scan</td>
1219 * <td align="center">PASSIVE_SCAN</td>
1220 * <td align="center">Start AF scan, Lens now moving</td>
1221 * </tr>
1222 * <tr>
1223 * <td align="center">PASSIVE_UNFOCUSED</td>
1224 * <td align="center">Camera device initiates new scan</td>
1225 * <td align="center">PASSIVE_SCAN</td>
1226 * <td align="center">Start AF scan, Lens now moving</td>
1227 * </tr>
1228 * <tr>
1229 * <td align="center">PASSIVE_FOCUSED</td>
1230 * <td align="center">AF_TRIGGER</td>
1231 * <td align="center">FOCUSED_LOCKED</td>
1232 * <td align="center">Immediate trans. Lens now locked</td>
1233 * </tr>
1234 * <tr>
1235 * <td align="center">PASSIVE_UNFOCUSED</td>
1236 * <td align="center">AF_TRIGGER</td>
1237 * <td align="center">NOT_FOCUSED_LOCKED</td>
1238 * <td align="center">Immediate trans. Lens now locked</td>
1239 * </tr>
1240 * <tr>
1241 * <td align="center">FOCUSED_LOCKED</td>
1242 * <td align="center">AF_TRIGGER</td>
1243 * <td align="center">FOCUSED_LOCKED</td>
1244 * <td align="center">No effect</td>
1245 * </tr>
1246 * <tr>
1247 * <td align="center">FOCUSED_LOCKED</td>
1248 * <td align="center">AF_CANCEL</td>
1249 * <td align="center">INACTIVE</td>
1250 * <td align="center">Restart AF scan</td>
1251 * </tr>
1252 * <tr>
1253 * <td align="center">NOT_FOCUSED_LOCKED</td>
1254 * <td align="center">AF_TRIGGER</td>
1255 * <td align="center">NOT_FOCUSED_LOCKED</td>
1256 * <td align="center">No effect</td>
1257 * </tr>
1258 * <tr>
1259 * <td align="center">NOT_FOCUSED_LOCKED</td>
1260 * <td align="center">AF_CANCEL</td>
1261 * <td align="center">INACTIVE</td>
1262 * <td align="center">Restart AF scan</td>
1263 * </tr>
1264 * </tbody>
1265 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001266 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1267 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1268 * camera device. When a trigger is included in a mode switch request, the trigger
1269 * will be evaluated in the context of the new mode in the request.
1270 * See below table for examples:</p>
1271 * <table>
1272 * <thead>
1273 * <tr>
1274 * <th align="center">State</th>
1275 * <th align="center">Transition Cause</th>
1276 * <th align="center">New State</th>
1277 * <th align="center">Notes</th>
1278 * </tr>
1279 * </thead>
1280 * <tbody>
1281 * <tr>
1282 * <td align="center">any state</td>
1283 * <td align="center">CAF--&gt;AUTO mode switch</td>
1284 * <td align="center">INACTIVE</td>
1285 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1286 * </tr>
1287 * <tr>
1288 * <td align="center">any state</td>
1289 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1290 * <td align="center">trigger-reachable states from INACTIVE</td>
1291 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1292 * </tr>
1293 * <tr>
1294 * <td align="center">any state</td>
1295 * <td align="center">AUTO--&gt;CAF mode switch</td>
1296 * <td align="center">passively reachable states from INACTIVE</td>
1297 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1298 * </tr>
1299 * </tbody>
1300 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001301 *
1302 * @see CaptureRequest#CONTROL_AF_MODE
1303 * @see CaptureRequest#CONTROL_MODE
1304 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001305 * @see #CONTROL_AF_STATE_INACTIVE
1306 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1307 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1308 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1309 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1310 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001311 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001312 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001313 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001314 public static final Key<Integer> CONTROL_AF_STATE =
1315 new Key<Integer>("android.control.afState", int.class);
1316
1317 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001318 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001319 * latest calculated values.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001320 * <p>Note that AWB lock is only meaningful when
1321 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1322 * AWB is already fixed to a specific setting.</p>
1323 *
1324 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001325 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001326 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001327 public static final Key<Boolean> CONTROL_AWB_LOCK =
1328 new Key<Boolean>("android.control.awbLock", boolean.class);
1329
1330 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001331 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001332 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001333 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001334 * <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 -07001335 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001336 * routine is enabled, overriding the application's selected
1337 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1338 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001339 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001340 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001341 * 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 -08001342 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001343 * <p>When set to any other modes, the camera device's auto-white
1344 * balance routine is disabled. The camera device uses each
1345 * particular illumination target for white balance
1346 * adjustment. The application's values for
1347 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1348 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1349 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001350 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001351 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001352 * @see CaptureRequest#COLOR_CORRECTION_MODE
1353 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001354 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001355 * @see #CONTROL_AWB_MODE_OFF
1356 * @see #CONTROL_AWB_MODE_AUTO
1357 * @see #CONTROL_AWB_MODE_INCANDESCENT
1358 * @see #CONTROL_AWB_MODE_FLUORESCENT
1359 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1360 * @see #CONTROL_AWB_MODE_DAYLIGHT
1361 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1362 * @see #CONTROL_AWB_MODE_TWILIGHT
1363 * @see #CONTROL_AWB_MODE_SHADE
1364 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001365 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001366 public static final Key<Integer> CONTROL_AWB_MODE =
1367 new Key<Integer>("android.control.awbMode", int.class);
1368
1369 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001370 * <p>List of areas to use for illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001371 * estimation.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001372 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001373 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001374 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1375 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001376 * bottom-right pixel in the active pixel array.</p>
1377 * <p>The weight must range from 0 to 1000, and represents a weight
1378 * for every pixel in the area. This means that a large metering area
1379 * with the same weight as a smaller area will have more effect in
1380 * the metering result. Metering areas can partially overlap and the
1381 * camera device will add the weights in the overlap region.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001382 * <p>If all regions have 0 weight, then no specific metering area
1383 * needs to be used by the camera device. If the metering region is
1384 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
Zhijun He14986152014-05-22 21:17:37 -07001385 * the camera device will ignore the sections outside the region and output the
1386 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001387 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001388 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001389 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001390 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001391 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001392 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1393 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001394
1395 /**
Zhijun He379af012014-05-06 11:54:54 -07001396 * <p>Information to the camera device 3A (auto-exposure,
1397 * auto-focus, auto-white balance) routines about the purpose
1398 * of this capture, to help the camera device to decide optimal 3A
1399 * strategy.</p>
1400 * <p>This control (except for MANUAL) is only effective if
1401 * <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 -07001402 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1403 * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Zhijun He379af012014-05-06 11:54:54 -07001404 * contains MANUAL_SENSOR.</p>
1405 *
1406 * @see CaptureRequest#CONTROL_MODE
1407 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1408 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1409 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1410 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1411 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1412 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1413 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1414 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1415 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001416 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001417 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1418 new Key<Integer>("android.control.captureIntent", int.class);
1419
1420 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001421 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001422 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1423 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1424 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1425 * the algorithm states to INACTIVE.</p>
1426 * <p>The camera device can do several state transitions between two results, if it is
1427 * allowed by the state transition table. So INACTIVE may never actually be seen in
1428 * a result.</p>
1429 * <p>The state in the result is the state for this image (in sync with this image): if
1430 * AWB state becomes CONVERGED, then the image data associated with this result should
1431 * be good to use.</p>
1432 * <p>Below are state transition tables for different AWB modes.</p>
1433 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1434 * <table>
1435 * <thead>
1436 * <tr>
1437 * <th align="center">State</th>
1438 * <th align="center">Transition Cause</th>
1439 * <th align="center">New State</th>
1440 * <th align="center">Notes</th>
1441 * </tr>
1442 * </thead>
1443 * <tbody>
1444 * <tr>
1445 * <td align="center">INACTIVE</td>
1446 * <td align="center"></td>
1447 * <td align="center">INACTIVE</td>
1448 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1449 * </tr>
1450 * </tbody>
1451 * </table>
1452 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1453 * <table>
1454 * <thead>
1455 * <tr>
1456 * <th align="center">State</th>
1457 * <th align="center">Transition Cause</th>
1458 * <th align="center">New State</th>
1459 * <th align="center">Notes</th>
1460 * </tr>
1461 * </thead>
1462 * <tbody>
1463 * <tr>
1464 * <td align="center">INACTIVE</td>
1465 * <td align="center">Camera device initiates AWB scan</td>
1466 * <td align="center">SEARCHING</td>
1467 * <td align="center">Values changing</td>
1468 * </tr>
1469 * <tr>
1470 * <td align="center">INACTIVE</td>
1471 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1472 * <td align="center">LOCKED</td>
1473 * <td align="center">Values locked</td>
1474 * </tr>
1475 * <tr>
1476 * <td align="center">SEARCHING</td>
1477 * <td align="center">Camera device finishes AWB scan</td>
1478 * <td align="center">CONVERGED</td>
1479 * <td align="center">Good values, not changing</td>
1480 * </tr>
1481 * <tr>
1482 * <td align="center">SEARCHING</td>
1483 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1484 * <td align="center">LOCKED</td>
1485 * <td align="center">Values locked</td>
1486 * </tr>
1487 * <tr>
1488 * <td align="center">CONVERGED</td>
1489 * <td align="center">Camera device initiates AWB scan</td>
1490 * <td align="center">SEARCHING</td>
1491 * <td align="center">Values changing</td>
1492 * </tr>
1493 * <tr>
1494 * <td align="center">CONVERGED</td>
1495 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1496 * <td align="center">LOCKED</td>
1497 * <td align="center">Values locked</td>
1498 * </tr>
1499 * <tr>
1500 * <td align="center">LOCKED</td>
1501 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1502 * <td align="center">SEARCHING</td>
1503 * <td align="center">Values not good after unlock</td>
1504 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001505 * </tbody>
1506 * </table>
1507 * <p>For the above table, the camera device may skip reporting any state changes that happen
1508 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1509 * can be skipped in that manner is called a transient state.</p>
1510 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1511 * listed in above table, it is also legal for the camera device to skip one or more
1512 * transient states between two results. See below table for examples:</p>
1513 * <table>
1514 * <thead>
1515 * <tr>
1516 * <th align="center">State</th>
1517 * <th align="center">Transition Cause</th>
1518 * <th align="center">New State</th>
1519 * <th align="center">Notes</th>
1520 * </tr>
1521 * </thead>
1522 * <tbody>
1523 * <tr>
1524 * <td align="center">INACTIVE</td>
1525 * <td align="center">Camera device finished AWB scan</td>
1526 * <td align="center">CONVERGED</td>
1527 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1528 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001529 * <tr>
1530 * <td align="center">LOCKED</td>
1531 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1532 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001533 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001534 * </tr>
1535 * </tbody>
1536 * </table>
1537 *
1538 * @see CaptureRequest#CONTROL_AWB_LOCK
1539 * @see CaptureRequest#CONTROL_AWB_MODE
1540 * @see CaptureRequest#CONTROL_MODE
1541 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001542 * @see #CONTROL_AWB_STATE_INACTIVE
1543 * @see #CONTROL_AWB_STATE_SEARCHING
1544 * @see #CONTROL_AWB_STATE_CONVERGED
1545 * @see #CONTROL_AWB_STATE_LOCKED
1546 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001547 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001548 public static final Key<Integer> CONTROL_AWB_STATE =
1549 new Key<Integer>("android.control.awbState", int.class);
1550
1551 /**
Zhijun He379af012014-05-06 11:54:54 -07001552 * <p>A special color effect to apply.</p>
1553 * <p>When this mode is set, a color effect will be applied
1554 * to images produced by the camera device. The interpretation
1555 * and implementation of these color effects is left to the
1556 * implementor of the camera device, and should not be
1557 * depended on to be consistent (or present) across all
1558 * devices.</p>
1559 * <p>A color effect will only be applied if
1560 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p>
1561 *
1562 * @see CaptureRequest#CONTROL_MODE
1563 * @see #CONTROL_EFFECT_MODE_OFF
1564 * @see #CONTROL_EFFECT_MODE_MONO
1565 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1566 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1567 * @see #CONTROL_EFFECT_MODE_SEPIA
1568 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1569 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1570 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1571 * @see #CONTROL_EFFECT_MODE_AQUA
1572 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001573 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001574 public static final Key<Integer> CONTROL_EFFECT_MODE =
1575 new Key<Integer>("android.control.effectMode", int.class);
1576
1577 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001578 * <p>Overall mode of 3A control
Zhijun Hecc28a412014-02-24 15:11:23 -08001579 * routines.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001580 * <p>High-level 3A control. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001581 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001582 * capture parameters itself.</p>
1583 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001584 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001585 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001586 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001587 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001588 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001589 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001590 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1591 * is that this frame will not be used by camera device background 3A statistics
1592 * update, as if this frame is never captured. This mode can be used in the scenario
1593 * where the application doesn't want a 3A manual control capture to affect
1594 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001595 *
1596 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001597 * @see #CONTROL_MODE_OFF
1598 * @see #CONTROL_MODE_AUTO
1599 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001600 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001601 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001602 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001603 public static final Key<Integer> CONTROL_MODE =
1604 new Key<Integer>("android.control.mode", int.class);
1605
1606 /**
Zhijun He379af012014-05-06 11:54:54 -07001607 * <p>A camera mode optimized for conditions typical in a particular
1608 * capture setting.</p>
1609 * <p>This is the mode that that is active when
1610 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1611 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001612 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.
1613 * The scene modes available for a given camera device are listed in
1614 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}.</p>
Zhijun He379af012014-05-06 11:54:54 -07001615 * <p>The interpretation and implementation of these scene modes is left
1616 * to the implementor of the camera device. Their behavior will not be
1617 * consistent across all devices, and any given device may only implement
1618 * a subset of these modes.</p>
1619 *
1620 * @see CaptureRequest#CONTROL_AE_MODE
1621 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001622 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001623 * @see CaptureRequest#CONTROL_AWB_MODE
1624 * @see CaptureRequest#CONTROL_MODE
1625 * @see #CONTROL_SCENE_MODE_DISABLED
1626 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1627 * @see #CONTROL_SCENE_MODE_ACTION
1628 * @see #CONTROL_SCENE_MODE_PORTRAIT
1629 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1630 * @see #CONTROL_SCENE_MODE_NIGHT
1631 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1632 * @see #CONTROL_SCENE_MODE_THEATRE
1633 * @see #CONTROL_SCENE_MODE_BEACH
1634 * @see #CONTROL_SCENE_MODE_SNOW
1635 * @see #CONTROL_SCENE_MODE_SUNSET
1636 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1637 * @see #CONTROL_SCENE_MODE_FIREWORKS
1638 * @see #CONTROL_SCENE_MODE_SPORTS
1639 * @see #CONTROL_SCENE_MODE_PARTY
1640 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1641 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07001642 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Zhijun He379af012014-05-06 11:54:54 -07001643 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001644 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001645 public static final Key<Integer> CONTROL_SCENE_MODE =
1646 new Key<Integer>("android.control.sceneMode", int.class);
1647
1648 /**
1649 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001650 * active.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001651 * <p>Video stabilization automatically translates and scales images from the camera
1652 * in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07001653 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001654 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
1655 * <p>Switching between different video stabilization modes may take several frames
1656 * to initialize, the camera device will report the current mode in capture result
1657 * metadata. For example, When "ON" mode is requested, the video stabilization modes
1658 * in the first several capture results may still be "OFF", and it will become "ON"
1659 * when the initialization is done.</p>
1660 * <p>If a camera device supports both this mode and OIS ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}),
1661 * turning both modes on may produce undesirable interaction, so it is recommended not to
1662 * enable both at the same time.</p>
Zhijun He379af012014-05-06 11:54:54 -07001663 *
Zhijun He45fa43a12014-06-13 18:29:37 -07001664 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07001665 * @see CaptureRequest#SCALER_CROP_REGION
1666 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1667 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1668 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001669 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001670 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1671 new Key<Integer>("android.control.videoStabilizationMode", int.class);
1672
1673 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001674 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001675 * enhancement.</p>
Zhijun He28079362013-12-17 10:35:40 -08001676 * <p>Edge/sharpness/detail enhancement. OFF means no
Zhijun Hecc28a412014-02-24 15:11:23 -08001677 * enhancement will be applied by the camera device.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001678 * <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 -08001679 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001680 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001681 * camera device will use the highest-quality enhancement algorithms,
1682 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08001683 * not slow down capture rate when applying edge enhancement.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001684 *
1685 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001686 * @see #EDGE_MODE_OFF
1687 * @see #EDGE_MODE_FAST
1688 * @see #EDGE_MODE_HIGH_QUALITY
1689 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001690 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001691 public static final Key<Integer> EDGE_MODE =
1692 new Key<Integer>("android.edge.mode", int.class);
1693
1694 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001695 * <p>The desired mode for for the camera device's flash control.</p>
1696 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08001697 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001698 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
1699 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
1700 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
1701 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
1702 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
1703 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001704 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08001705 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
1706 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
1707 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001708 * <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 -08001709 *
1710 * @see CaptureRequest#CONTROL_AE_MODE
1711 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1712 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08001713 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001714 * @see #FLASH_MODE_OFF
1715 * @see #FLASH_MODE_SINGLE
1716 * @see #FLASH_MODE_TORCH
1717 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001718 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001719 public static final Key<Integer> FLASH_MODE =
1720 new Key<Integer>("android.flash.mode", int.class);
1721
1722 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001723 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08001724 * unit.</p>
1725 * <p>When the camera device doesn't have flash unit
1726 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
1727 * Other states indicate the current flash status.</p>
1728 *
1729 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001730 * @see #FLASH_STATE_UNAVAILABLE
1731 * @see #FLASH_STATE_CHARGING
1732 * @see #FLASH_STATE_READY
1733 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07001734 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001735 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001736 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001737 public static final Key<Integer> FLASH_STATE =
1738 new Key<Integer>("android.flash.state", int.class);
1739
1740 /**
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001741 * <p>Set operational mode for hot pixel correction.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001742 * <p>Valid modes for this camera device are listed in
1743 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001744 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
1745 * that do not accurately encode the incoming light (i.e. pixels that
1746 * are stuck at an arbitrary value).</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001747 *
1748 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001749 * @see #HOT_PIXEL_MODE_OFF
1750 * @see #HOT_PIXEL_MODE_FAST
1751 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1752 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001753 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001754 public static final Key<Integer> HOT_PIXEL_MODE =
1755 new Key<Integer>("android.hotPixel.mode", int.class);
1756
1757 /**
Ruben Brunk57493682014-05-27 18:58:08 -07001758 * <p>A location object to use when generating image GPS metadata.</p>
1759 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001760 @PublicKey
1761 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07001762 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
1763 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
1764
1765 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001766 * <p>GPS coordinates to include in output JPEG
1767 * EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001768 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001769 */
1770 public static final Key<double[]> JPEG_GPS_COORDINATES =
1771 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
1772
1773 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001774 * <p>32 characters describing GPS algorithm to
1775 * include in EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001776 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001777 */
1778 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
1779 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
1780
1781 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001782 * <p>Time GPS fix was made to include in
1783 * EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001784 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001785 */
1786 public static final Key<Long> JPEG_GPS_TIMESTAMP =
1787 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
1788
1789 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001790 * <p>Orientation of JPEG image to
1791 * write</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001792 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001793 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001794 public static final Key<Integer> JPEG_ORIENTATION =
1795 new Key<Integer>("android.jpeg.orientation", int.class);
1796
1797 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001798 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001799 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001800 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001801 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001802 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001803 public static final Key<Byte> JPEG_QUALITY =
1804 new Key<Byte>("android.jpeg.quality", byte.class);
1805
1806 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001807 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001808 * thumbnail.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001809 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001810 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001811 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
1812 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
1813
1814 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001815 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001816 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
1817 * but the captured JPEG will still be a valid image.</p>
Zhijun He5a9ff372013-12-26 11:49:09 -08001818 * <p>When a jpeg image capture is issued, the thumbnail size selected should have
1819 * the same aspect ratio as the jpeg image.</p>
Zhijun He50f72432014-05-28 13:52:04 -07001820 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
1821 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
1822 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
1823 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
1824 * generate the thumbnail image. The thumbnail image will always have a smaller Field
1825 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001826 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001827 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001828 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
1829 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001830
1831 /**
Zhijun Hefb46c642014-01-14 17:57:23 -08001832 * <p>The ratio of lens focal length to the effective
1833 * aperture diameter.</p>
1834 * <p>This will only be supported on the camera devices that
1835 * have variable aperture lens. The aperture value can only be
1836 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
1837 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1838 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001839 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08001840 * to achieve manual exposure control.</p>
1841 * <p>The requested aperture value may take several frames to reach the
1842 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08001843 * aperture size in capture result metadata while the aperture is changing.
1844 * 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 -08001845 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1846 * the ON modes, this will be overridden by the camera device
1847 * auto-exposure algorithm, the overridden values are then provided
1848 * back to the user in the corresponding result.</p>
1849 *
Zhijun He399f05d2014-01-15 11:31:30 -08001850 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001851 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001852 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001853 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001854 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001855 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001856 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001857 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001858 public static final Key<Float> LENS_APERTURE =
1859 new Key<Float>("android.lens.aperture", float.class);
1860
1861 /**
Ruben Brunk855bae42014-01-17 10:30:32 -08001862 * <p>State of lens neutral density filter(s).</p>
1863 * <p>This will not be supported on most camera devices. On devices
1864 * where this is supported, this may only be set to one of the
1865 * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p>
1866 * <p>Lens filters are typically used to lower the amount of light the
1867 * sensor is exposed to (measured in steps of EV). As used here, an EV
1868 * step is the standard logarithmic representation, which are
1869 * non-negative, and inversely proportional to the amount of light
1870 * hitting the sensor. For example, setting this to 0 would result
1871 * in no reduction of the incoming light, and setting this to 2 would
1872 * mean that the filter is set to reduce incoming light by two stops
1873 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001874 * <p>It may take several frames before the lens filter density changes
1875 * to the requested value. While the filter density is still changing,
1876 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001877 *
1878 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001879 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001880 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001881 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001882 public static final Key<Float> LENS_FILTER_DENSITY =
1883 new Key<Float>("android.lens.filterDensity", float.class);
1884
1885 /**
Ruben Brunka20f4c22014-01-17 15:21:13 -08001886 * <p>The current lens focal length; used for optical zoom.</p>
1887 * <p>This setting controls the physical focal length of the camera
1888 * device's lens. Changing the focal length changes the field of
1889 * view of the camera device, and is usually used for optical zoom.</p>
1890 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1891 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08001892 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08001893 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1894 * be set to MOVING.</p>
1895 * <p>This is expected not to be supported on most devices.</p>
1896 *
1897 * @see CaptureRequest#LENS_APERTURE
1898 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1899 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001900 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001901 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001902 public static final Key<Float> LENS_FOCAL_LENGTH =
1903 new Key<Float>("android.lens.focalLength", float.class);
1904
1905 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001906 * <p>Distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001907 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001908 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001909 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001910 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001911 public static final Key<Float> LENS_FOCUS_DISTANCE =
1912 new Key<Float>("android.lens.focusDistance", float.class);
1913
1914 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001915 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001916 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001917 * <p>If variable focus not supported, can still report
1918 * fixed depth of field range</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001919 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001920 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07001921 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
1922 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 -07001923
1924 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08001925 * <p>Sets whether the camera device uses optical image stabilization (OIS)
1926 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001927 * <p>OIS is used to compensate for motion blur due to small
1928 * movements of the camera during capture. Unlike digital image
1929 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
1930 * makes use of mechanical elements to stabilize the camera
1931 * sensor, and thus allows for longer exposure times before
1932 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07001933 * <p>Switching between different optical stabilization modes may take several
1934 * frames to initialize, the camera device will report the current mode in
1935 * capture result metadata. For example, When "ON" mode is requested, the
1936 * optical stabilization modes in the first several capture results may still
1937 * be "OFF", and it will become "ON" when the initialization is done.</p>
1938 * <p>If a camera device supports both OIS and EIS ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}),
1939 * turning both modes on may produce undesirable interaction, so it is recommended not
1940 * to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001941 * <p>Not all devices will support OIS; see
1942 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
1943 * available controls.</p>
1944 *
1945 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
1946 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001947 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
1948 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
1949 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001950 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001951 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
1952 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
1953
1954 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08001955 * <p>Current lens status.</p>
1956 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1957 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
1958 * they may take several frames to reach the requested values. This state indicates
1959 * the current status of the lens parameters.</p>
1960 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
1961 * either because the parameters are all fixed, or because the lens has had enough
1962 * time to reach the most recently-requested values.
1963 * If all these lens parameters are not changable for a camera device, as listed below:</p>
1964 * <ul>
1965 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
1966 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
1967 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
1968 * which means the optical zoom is not supported.</li>
1969 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
1970 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
1971 * </ul>
1972 * <p>Then this state will always be STATIONARY.</p>
1973 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
1974 * is changing.</p>
1975 *
1976 * @see CaptureRequest#LENS_APERTURE
1977 * @see CaptureRequest#LENS_FILTER_DENSITY
1978 * @see CaptureRequest#LENS_FOCAL_LENGTH
1979 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1980 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1981 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1982 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
1983 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001984 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07001985 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001986 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001987 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001988 public static final Key<Integer> LENS_STATE =
1989 new Key<Integer>("android.lens.state", int.class);
1990
1991 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001992 * <p>Mode of operation for the noise reduction algorithm.</p>
Zhijun He28079362013-12-17 10:35:40 -08001993 * <p>Noise filtering control. OFF means no noise reduction
Zhijun Hecc28a412014-02-24 15:11:23 -08001994 * will be applied by the camera device.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001995 * <p>This must be set to a valid mode from
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001996 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001997 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
1998 * will be applied. HIGH_QUALITY mode indicates that the camera device
1999 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002000 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08002001 * slow down capture rate when applying noise filtering.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002002 *
2003 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002004 * @see #NOISE_REDUCTION_MODE_OFF
2005 * @see #NOISE_REDUCTION_MODE_FAST
2006 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
2007 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002008 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002009 public static final Key<Integer> NOISE_REDUCTION_MODE =
2010 new Key<Integer>("android.noiseReduction.mode", int.class);
2011
2012 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002013 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002014 * final one for the capture, or only a partial that contains a
2015 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002016 * values.</p>
2017 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002018 * single capture may not overlap, except for this entry. The
2019 * FINAL buffers must retain FIFO ordering relative to the
2020 * requests that generate them, so the FINAL buffer for frame 3 must
2021 * always be sent to the framework after the FINAL buffer for frame 2, and
2022 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2023 * in any order relative to other frames, but all PARTIAL buffers for a given
2024 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002025 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002026 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002027 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002028 * @hide
2029 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002030 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002031 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2032 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2033
2034 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002035 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002036 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002037 * frameCount value).</p>
2038 * <p>Reset on release()</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002039 * @deprecated
2040 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002041 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002042 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002043 public static final Key<Integer> REQUEST_FRAME_COUNT =
2044 new Key<Integer>("android.request.frameCount", int.class);
2045
2046 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002047 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002048 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002049 * frame</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002050 * @hide
2051 */
2052 public static final Key<Integer> REQUEST_ID =
2053 new Key<Integer>("android.request.id", int.class);
2054
2055 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002056 * <p>Specifies the number of pipeline stages the frame went
2057 * through from when it was exposed to when the final completed result
2058 * was available to the framework.</p>
2059 * <p>Depending on what settings are used in the request, and
2060 * what streams are configured, the data may undergo less processing,
2061 * and some pipeline stages skipped.</p>
2062 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
2063 *
2064 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2065 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002066 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002067 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2068 new Key<Byte>("android.request.pipelineDepth", byte.class);
2069
2070 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002071 * <p>The region of the sensor to read out for this capture.</p>
2072 * <p>The crop region coordinate system is based off
2073 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2074 * top-left corner of the sensor active array.</p>
2075 * <p>Output streams use this rectangle to produce their output,
2076 * cropping to a smaller region if necessary to maintain the
2077 * stream's aspect ratio, then scaling the sensor input to
2078 * match the output's configured resolution.</p>
2079 * <p>The crop region is applied after the RAW to other color
2080 * space (e.g. YUV) conversion. Since raw streams
2081 * (e.g. RAW16) don't have the conversion stage, they are not
2082 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002083 * <p>For non-raw streams, any additional per-stream cropping will
2084 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002085 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002086 * ratio, then 4:3 streams will use the exact crop
2087 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002088 * (letterbox).</p>
2089 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002090 * outputs will crop horizontally (pillarbox), and 16:9
2091 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002092 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002093 * <p>The width and height of the crop region cannot
2094 * be set to be smaller than
2095 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2096 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2097 * <p>The camera device may adjust the crop region to account
2098 * for rounding and other hardware requirements; the final
2099 * crop region used will be included in the output capture
2100 * result.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002101 *
2102 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002103 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002104 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002105 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002106 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2107 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2108
2109 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002110 * <p>Duration each pixel is exposed to
2111 * light.</p>
2112 * <p>If the sensor can't expose this exact duration, it should shorten the
2113 * duration exposed to the nearest possible value (rather than expose longer).</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002114 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002115 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002116 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2117 new Key<Long>("android.sensor.exposureTime", long.class);
2118
2119 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002120 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002121 * start of next frame exposure.</p>
2122 * <p>The maximum frame rate that can be supported by a camera subsystem is
2123 * a function of many factors:</p>
2124 * <ul>
2125 * <li>Requested resolutions of output image streams</li>
2126 * <li>Availability of binning / skipping modes on the imager</li>
2127 * <li>The bandwidth of the imager interface</li>
2128 * <li>The bandwidth of the various ISP processing blocks</li>
2129 * </ul>
2130 * <p>Since these factors can vary greatly between different ISPs and
2131 * sensors, the camera abstraction tries to represent the bandwidth
2132 * restrictions with as simple a model as possible.</p>
2133 * <p>The model presented has the following characteristics:</p>
2134 * <ul>
2135 * <li>The image sensor is always configured to output the smallest
2136 * resolution possible given the application's requested output stream
2137 * sizes. The smallest resolution is defined as being at least as large
2138 * as the largest requested output stream size; the camera pipeline must
2139 * never digitally upsample sensor data when the crop region covers the
2140 * whole sensor. In general, this means that if only small output stream
2141 * resolutions are configured, the sensor can provide a higher frame
2142 * rate.</li>
2143 * <li>Since any request may use any or all the currently configured
2144 * output streams, the sensor and ISP must be configured to support
2145 * scaling a single capture to all the streams at the same time. This
2146 * means the camera pipeline must be ready to produce the largest
2147 * requested output size without any delay. Therefore, the overall
2148 * frame rate of a given configured stream set is governed only by the
2149 * largest requested stream resolution.</li>
2150 * <li>Using more than one output stream in a request does not affect the
2151 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002152 * <li>Certain format-streams may need to do additional background processing
2153 * before data is consumed/produced by that stream. These processors
2154 * can run concurrently to the rest of the camera pipeline, but
2155 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002156 * </ul>
2157 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002158 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2159 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002160 * These are used to determine the maximum frame rate / minimum frame
2161 * duration that is possible for a given stream configuration.</p>
2162 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002163 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002164 * device:</p>
2165 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002166 * <li>Let the set of currently configured input/output streams
2167 * be called <code>S</code>.</li>
2168 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002169 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2170 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002171 * its respective size/format). Let this set of frame durations be called
2172 * <code>F</code>.</li>
2173 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2174 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2175 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002176 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002177 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002178 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2179 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002180 * <code>F</code> determines the steady state frame rate that the application will
2181 * get if it uses <code>R</code> as a repeating request. Let this special kind
2182 * of request be called <code>Rsimple</code>.</p>
2183 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2184 * by a single capture of a new request <code>Rstall</code> (which has at least
2185 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2186 * same minimum frame duration this will not cause a frame rate loss
2187 * if all buffers from the previous <code>Rstall</code> have already been
2188 * delivered.</p>
2189 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002190 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002191 *
Igor Murashkin9c595172014-05-12 13:56:20 -07002192 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002193 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002194 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002195 public static final Key<Long> SENSOR_FRAME_DURATION =
2196 new Key<Long>("android.sensor.frameDuration", long.class);
2197
2198 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002199 * <p>The amount of gain applied to sensor data
2200 * before processing.</p>
2201 * <p>The sensitivity is the standard ISO sensitivity value,
2202 * as defined in ISO 12232:2006.</p>
2203 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2204 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2205 * is guaranteed to use only analog amplification for applying the gain.</p>
2206 * <p>If the camera device cannot apply the exact sensitivity
2207 * requested, it will reduce the gain to the nearest supported
2208 * value. The final sensitivity used will be available in the
2209 * output capture result.</p>
2210 *
2211 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2212 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002213 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002214 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002215 public static final Key<Integer> SENSOR_SENSITIVITY =
2216 new Key<Integer>("android.sensor.sensitivity", int.class);
2217
2218 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002219 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07002220 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002221 * <p>The timestamps are also included in all image
2222 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07002223 * on all the outputs.</p>
2224 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION android.sensor.info.timestampCalibration} <code>==</code> UNCALIBRATED,
2225 * the timestamps measure time since an unspecified starting point,
2226 * and are monotonically increasing. They can be compared with the
2227 * timestamps for other captures from the same camera device, but are
2228 * not guaranteed to be comparable to any other time source.</p>
2229 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION android.sensor.info.timestampCalibration} <code>==</code> CALIBRATED,
2230 * the timestamps measure time in the same timebase as
2231 * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2232 * compared to other timestamps from other subsystems that are using
2233 * that base.</p>
2234 *
2235 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002236 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002237 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002238 public static final Key<Long> SENSOR_TIMESTAMP =
2239 new Key<Long>("android.sensor.timestamp", long.class);
2240
2241 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002242 * <p>The estimated camera neutral color in the native sensor colorspace at
2243 * the time of capture.</p>
2244 * <p>This value gives the neutral color point encoded as an RGB value in the
2245 * native sensor color space. The neutral color point indicates the
2246 * currently estimated white point of the scene illumination. It can be
2247 * used to interpolate between the provided color transforms when
2248 * processing raw sensor data.</p>
2249 * <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 -08002250 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2251 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002252 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08002253 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2254 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2255
2256 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002257 * <p>Noise model coefficients for each CFA mosaic channel.</p>
2258 * <p>This tag contains two noise model coefficients for each CFA channel
2259 * corresponding to the sensor amplification (S) and sensor readout
2260 * noise (O). These are given as pairs of coefficients for each channel
2261 * in the same order as channels listed for the CFA layout tag
2262 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
2263 * represented as an array of Pair&lt;Double, Double&gt;, where
2264 * the first member of the Pair at index n is the S coefficient and the
2265 * second member is the O coefficient for the nth color channel in the CFA.</p>
2266 * <p>These coefficients are used in a two parameter noise model to describe
2267 * the amount of noise present in the image for each CFA channel. The
2268 * noise model used here is:</p>
2269 * <p>N(x) = sqrt(Sx + O)</p>
2270 * <p>Where x represents the recorded signal of a CFA channel normalized to
2271 * the range [0, 1], and S and O are the noise model coeffiecients for
2272 * that channel.</p>
2273 * <p>A more detailed description of the noise model can be found in the
2274 * Adobe DNG specification for the NoiseProfile tag.</p>
2275 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2276 *
2277 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2278 */
2279 @PublicKey
2280 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
2281 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
2282
2283 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002284 * <p>The worst-case divergence between Bayer green channels.</p>
2285 * <p>This value is an estimate of the worst case split between the
2286 * Bayer green channels in the red and blue rows in the sensor color
2287 * filter array.</p>
2288 * <p>The green split is calculated as follows:</p>
2289 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002290 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2291 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2292 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2293 * chosen is implementation defined, and should be chosen to provide a
2294 * green split estimate that is both representative of the entire image
2295 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002296 * <li>The arithmetic mean of the green channels from the red
2297 * rows (mean_Gr) within W is computed.</li>
2298 * <li>The arithmetic mean of the green channels from the blue
2299 * rows (mean_Gb) within W is computed.</li>
2300 * <li>The maximum ratio R of the two means is computed as follows:
2301 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2302 * </ol>
2303 * <p>The ratio R is the green split divergence reported for this property,
2304 * which represents how much the green channels differ in the mosaic
2305 * pattern. This value is typically used to determine the treatment of
2306 * the green mosaic channels when demosaicing.</p>
2307 * <p>The green split value can be roughly interpreted as follows:</p>
2308 * <ul>
2309 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2310 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2311 * correction to avoid demosaic errors (3-20% divergence).</li>
2312 * <li>R &gt; 1.20 will require strong software correction to produce
2313 * a usuable image (&gt;20% divergence).</li>
2314 * </ul>
2315 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2316 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002317 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08002318 public static final Key<Float> SENSOR_GREEN_SPLIT =
2319 new Key<Float>("android.sensor.greenSplit", float.class);
2320
2321 /**
Zhijun He379af012014-05-06 11:54:54 -07002322 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2323 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2324 * <p>Each color channel is treated as an unsigned 32-bit integer.
2325 * The camera device then uses the most significant X bits
2326 * that correspond to how many bits are in its Bayer raw sensor
2327 * output.</p>
2328 * <p>For example, a sensor with RAW10 Bayer output would use the
2329 * 10 most significant bits from each color channel.</p>
2330 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2331 *
2332 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2333 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002334 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002335 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2336 new Key<int[]>("android.sensor.testPatternData", int[].class);
2337
2338 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002339 * <p>When enabled, the sensor sends a test pattern instead of
2340 * doing a real exposure from the camera.</p>
2341 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002342 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002343 * work as normal.</p>
2344 * <p>For example, if manual flash is enabled, flash firing should still
2345 * occur (and that the test pattern remain unmodified, since the flash
2346 * would not actually affect it).</p>
2347 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2348 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2349 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2350 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2351 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2352 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2353 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2354 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002355 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002356 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2357 new Key<Integer>("android.sensor.testPatternMode", int.class);
2358
2359 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07002360 * <p>Duration between the start of first row exposure
2361 * and the start of last row exposure.</p>
2362 * <p>This is the exposure time skew (in the unit of nanosecond) between the first and
2363 * last row exposure start times. The first row and the last row are the first
2364 * and last rows inside of the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2365 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
2366 * to the frame readout time.</p>
2367 *
2368 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2369 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002370 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07002371 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
2372 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
2373
2374 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002375 * <p>Quality of lens shading correction applied
2376 * to the image data.</p>
2377 * <p>When set to OFF mode, no lens shading correction will be applied by the
2378 * camera device, and an identity lens shading map data will be provided
2379 * 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 -07002380 * shading map with size specified as <code>android.lens.info.shadingMapSize = [ 4, 3 ]</code>,
2381 * the output android.statistics.lensShadingMap for this case will be an identity map
Zhijun Heba93fe62014-01-17 16:43:05 -08002382 * shown below:</p>
2383 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2384 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2385 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2386 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2387 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2388 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
2389 * </code></pre>
2390 * <p>When set to other modes, lens shading correction will be applied by the
2391 * camera device. Applications can request lens shading map data by setting
2392 * {@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 -07002393 * lens shading map data in android.statistics.lensShadingMap, with size specified
2394 * by android.lens.info.shadingMapSize; the returned shading map data will be the one
Zhijun Hefa7c7552014-05-22 16:36:02 -07002395 * applied by the camera device for this capture request.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002396 * <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 -07002397 * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in
2398 * 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),
2399 * to get best results, it is recommended that the applications wait for the AE and AWB to
2400 * be converged before using the returned shading map data.</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002401 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002402 * @see CaptureRequest#CONTROL_AE_MODE
2403 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun Heba93fe62014-01-17 16:43:05 -08002404 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2405 * @see #SHADING_MODE_OFF
2406 * @see #SHADING_MODE_FAST
2407 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002408 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002409 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08002410 public static final Key<Integer> SHADING_MODE =
2411 new Key<Integer>("android.shading.mode", int.class);
2412
2413 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002414 * <p>Control for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002415 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002416 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002417 * should output just the basic fields or the full set of
2418 * fields. Value must be one of the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002419 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p>
2420 *
2421 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002422 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2423 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2424 * @see #STATISTICS_FACE_DETECT_MODE_FULL
2425 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002426 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002427 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2428 new Key<Integer>("android.statistics.faceDetectMode", int.class);
2429
2430 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002431 * <p>List of unique IDs for detected faces.</p>
2432 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
2433 * to the camera device. A face that leaves the field of view and later returns may be
2434 * assigned a new ID.</p>
2435 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL</p>
2436 *
2437 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002438 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002439 */
2440 public static final Key<int[]> STATISTICS_FACE_IDS =
2441 new Key<int[]>("android.statistics.faceIds", int[].class);
2442
2443 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002444 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002445 * faces.</p>
2446 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2447 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
2448 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL</p>
2449 *
2450 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2451 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002452 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002453 */
2454 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
2455 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
2456
2457 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002458 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002459 * faces.</p>
2460 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2461 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
2462 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF</p>
2463 *
2464 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2465 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002466 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002467 */
2468 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
2469 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
2470
2471 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002472 * <p>List of the face confidence scores for
2473 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002474 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
2475 *
2476 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002477 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002478 */
2479 public static final Key<byte[]> STATISTICS_FACE_SCORES =
2480 new Key<byte[]>("android.statistics.faceScores", byte[].class);
2481
2482 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002483 * <p>List of the faces detected through camera face detection
2484 * in this result.</p>
2485 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
2486 *
2487 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
2488 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002489 @PublicKey
2490 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002491 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
2492 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
2493
2494 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002495 * <p>The shading map is a low-resolution floating-point map
2496 * that lists the coefficients used to correct for vignetting, for each
2497 * Bayer color channel.</p>
2498 * <p>The least shaded section of the image should have a gain factor
2499 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002500 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08002501 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002502 * <p>The shading map is for the entire active pixel array, and is not
2503 * affected by the crop region specified in the request. Each shading map
2504 * entry is the value of the shading compensation map over a specific
2505 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2506 * map, and an active pixel array size (W x H), shading map entry
2507 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2508 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2509 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2510 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2511 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07002512 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002513 * <p>The shading map should have on the order of 30-40 rows and columns,
2514 * and must be smaller than 64x64.</p>
2515 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002516 * <pre><code>width,height = [ 4, 3 ]
2517 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002518 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002519 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2520 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2521 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2522 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2523 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002524 * </code></pre>
2525 * <p>The low-resolution scaling map images for each channel are
2526 * (displayed using nearest-neighbor interpolation):</p>
2527 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2528 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2529 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2530 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2531 * <p>As a visualization only, inverting the full-color map to recover an
2532 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2533 * <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 -08002534 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002535 * @see CaptureRequest#COLOR_CORRECTION_MODE
Ruben Brunk57493682014-05-27 18:58:08 -07002536 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002537 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07002538 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
2539 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
2540
2541 /**
2542 * <p>The shading map is a low-resolution floating-point map
2543 * that lists the coefficients used to correct for vignetting, for each
2544 * Bayer color channel.</p>
2545 * <p>The least shaded section of the image should have a gain factor
2546 * of 1; all other sections should have gains above 1.</p>
2547 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
2548 * must take into account the colorCorrection settings.</p>
2549 * <p>The shading map is for the entire active pixel array, and is not
2550 * affected by the crop region specified in the request. Each shading map
2551 * entry is the value of the shading compensation map over a specific
2552 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2553 * map, and an active pixel array size (W x H), shading map entry
2554 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2555 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2556 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2557 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2558 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
2559 * The shading map is stored in a fully interleaved format, and its size
2560 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
2561 * <p>The shading map should have on the order of 30-40 rows and columns,
2562 * and must be smaller than 64x64.</p>
2563 * <p>As an example, given a very small map defined as:</p>
2564 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
2565 * android.statistics.lensShadingMap =
2566 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
2567 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2568 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2569 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2570 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2571 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
2572 * </code></pre>
2573 * <p>The low-resolution scaling map images for each channel are
2574 * (displayed using nearest-neighbor interpolation):</p>
2575 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2576 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2577 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2578 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2579 * <p>As a visualization only, inverting the full-color map to recover an
2580 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2581 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
2582 *
2583 * @see CaptureRequest#COLOR_CORRECTION_MODE
2584 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002585 */
2586 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
2587 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
2588
2589 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002590 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08002591 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002592 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002593 * since statistics processing on data from a new frame
2594 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08002595 * applied to that frame.</p>
2596 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002597 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002598 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08002599 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002600 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002601 *
2602 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07002603 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002604 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002605 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002606 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002607 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
2608 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
2609
2610 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002611 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08002612 * calculated by the camera device's statistics units for the current
2613 * output frame.</p>
2614 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002615 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08002616 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002617 * are the best fit for the current output frame. This may
2618 * be different than the transform used for this frame, since
2619 * statistics processing on data from a new frame typically
2620 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002621 * that frame.</p>
2622 * <p>These estimates must be provided for all frames, even if
2623 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002624 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08002625 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002626 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002627 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002628 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002629 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002630 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002631 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
2632 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
2633
2634 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08002635 * <p>The camera device estimated scene illumination lighting
2636 * frequency.</p>
2637 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
2638 * that depends on the local utility power standards. This flicker must be
2639 * accounted for by auto-exposure routines to avoid artifacts in captured images.
2640 * The camera device uses this entry to tell the application what the scene
2641 * illuminant frequency is.</p>
2642 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002643 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
2644 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
2645 * antibanding, and the application can ensure it selects
2646 * exposure times that do not cause banding issues by looking
2647 * into this metadata field. See
2648 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
2649 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08002650 *
2651 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
2652 * @see CaptureRequest#CONTROL_AE_MODE
2653 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002654 * @see #STATISTICS_SCENE_FLICKER_NONE
2655 * @see #STATISTICS_SCENE_FLICKER_50HZ
2656 * @see #STATISTICS_SCENE_FLICKER_60HZ
2657 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002658 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002659 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
2660 new Key<Integer>("android.statistics.sceneFlicker", int.class);
2661
2662 /**
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002663 * <p>Operating mode for hotpixel map generation.</p>
2664 * <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 -07002665 * If set to OFF, no hotpixel map will be returned.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002666 * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p>
2667 *
2668 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2669 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2670 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002671 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002672 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2673 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2674
2675 /**
2676 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
2677 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
2678 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
2679 * bottom-right of the pixel array, respectively. The width and
2680 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
2681 * This may include hot pixels that lie outside of the active array
2682 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2683 *
2684 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2685 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2686 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002687 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002688 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
2689 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002690
2691 /**
Zhijun He379af012014-05-06 11:54:54 -07002692 * <p>Whether the camera device will output the lens
2693 * shading map in output result metadata.</p>
2694 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002695 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07002696 * the output result metadata.</p>
Zhijun He379af012014-05-06 11:54:54 -07002697 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2698 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2699 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002700 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002701 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2702 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2703
2704 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002705 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08002706 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2707 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002708 * <p>See android.tonemap.curveRed for more details.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002709 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002710 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002711 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002712 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002713 public static final Key<float[]> TONEMAP_CURVE_BLUE =
2714 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002715
2716 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002717 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08002718 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2719 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002720 * <p>See android.tonemap.curveRed for more details.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002721 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002722 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002723 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002724 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002725 public static final Key<float[]> TONEMAP_CURVE_GREEN =
2726 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002727
2728 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002729 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08002730 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2731 * CONTRAST_CURVE.</p>
2732 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002733 * <pre><code>android.tonemap.curveRed =
Igor Murashkine0060932014-01-17 17:24:11 -08002734 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08002735 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Igor Murashkine0060932014-01-17 17:24:11 -08002736 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2737 * guaranteed that input values 0.0 and 1.0 are included in the list to
2738 * define a complete mapping. For input values between control points,
2739 * the camera device must linearly interpolate between the control
2740 * points.</p>
2741 * <p>Each curve can have an independent number of points, and the number
2742 * of points can be less than max (that is, the request doesn't have to
2743 * always provide a curve with number of points equivalent to
2744 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2745 * <p>A few examples, and their corresponding graphical mappings; these
2746 * only specify the red channel and the precision is limited to 4
2747 * digits, for conciseness.</p>
2748 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002749 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002750 * </code></pre>
2751 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2752 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002753 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002754 * </code></pre>
2755 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2756 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002757 * <pre><code>android.tonemap.curveRed = [
Igor Murashkine0060932014-01-17 17:24:11 -08002758 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2759 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2760 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2761 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
2762 * </code></pre>
2763 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2764 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002765 * <pre><code>android.tonemap.curveRed = [
Igor Murashkine0060932014-01-17 17:24:11 -08002766 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2767 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2768 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2769 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
2770 * </code></pre>
2771 * <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 -08002772 *
Igor Murashkine0060932014-01-17 17:24:11 -08002773 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002774 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002775 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002776 */
2777 public static final Key<float[]> TONEMAP_CURVE_RED =
2778 new Key<float[]>("android.tonemap.curveRed", float[].class);
2779
2780 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002781 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
2782 * is CONTRAST_CURVE.</p>
2783 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
2784 * channels respectively. The following example uses the red channel as an
2785 * example. The same logic applies to green and blue channel.
2786 * Each channel's curve is defined by an array of control points:</p>
2787 * <pre><code>curveRed =
2788 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
2789 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
2790 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2791 * guaranteed that input values 0.0 and 1.0 are included in the list to
2792 * define a complete mapping. For input values between control points,
2793 * the camera device must linearly interpolate between the control
2794 * points.</p>
2795 * <p>Each curve can have an independent number of points, and the number
2796 * of points can be less than max (that is, the request doesn't have to
2797 * always provide a curve with number of points equivalent to
2798 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2799 * <p>A few examples, and their corresponding graphical mappings; these
2800 * only specify the red channel and the precision is limited to 4
2801 * digits, for conciseness.</p>
2802 * <p>Linear mapping:</p>
2803 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
2804 * </code></pre>
2805 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2806 * <p>Invert mapping:</p>
2807 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
2808 * </code></pre>
2809 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2810 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2811 * <pre><code>curveRed = [
2812 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
2813 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
2814 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
2815 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
2816 * </code></pre>
2817 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2818 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2819 * <pre><code>curveRed = [
2820 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
2821 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
2822 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
2823 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
2824 * </code></pre>
2825 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
2826 *
2827 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
2828 * @see CaptureRequest#TONEMAP_MODE
2829 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002830 @PublicKey
2831 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002832 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
2833 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
2834
2835 /**
Igor Murashkine0060932014-01-17 17:24:11 -08002836 * <p>High-level global contrast/gamma/tonemapping control.</p>
2837 * <p>When switching to an application-defined contrast curve by setting
2838 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2839 * per-channel with a set of <code>(in, out)</code> points that specify the
2840 * mapping from input high-bit-depth pixel value to the output
2841 * low-bit-depth value. Since the actual pixel ranges of both input
2842 * and output may change depending on the camera pipeline, the values
2843 * are specified by normalized floating-point numbers.</p>
2844 * <p>More-complex color mapping operations such as 3D color look-up
2845 * tables, selective chroma enhancement, or other non-linear color
2846 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2847 * CONTRAST_CURVE.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002848 * <p>This must be set to a valid mode in
2849 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08002850 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002851 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08002852 * These values are always available, and as close as possible to the
2853 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07002854 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08002855 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2856 * roughly the same.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002857 *
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002858 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002859 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08002860 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002861 * @see #TONEMAP_MODE_CONTRAST_CURVE
2862 * @see #TONEMAP_MODE_FAST
2863 * @see #TONEMAP_MODE_HIGH_QUALITY
2864 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002865 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002866 public static final Key<Integer> TONEMAP_MODE =
2867 new Key<Integer>("android.tonemap.mode", int.class);
2868
2869 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002870 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002871 * that the camera is powered on and may be streaming images back to the
2872 * Application Processor. In certain rare circumstances, the OS may
2873 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002874 * any untrusted applications.</p>
2875 * <p>In particular, the LED <em>must</em> always be on when the data could be
2876 * transmitted off the device. The LED <em>should</em> always be on whenever
2877 * data is stored locally on the device.</p>
2878 * <p>The LED <em>may</em> be off if a trusted application is using the data that
2879 * doesn't violate the above rules.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002880 * @hide
2881 */
2882 public static final Key<Boolean> LED_TRANSMIT =
2883 new Key<Boolean>("android.led.transmit", boolean.class);
2884
2885 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002886 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002887 * to its current values, or is free to vary.</p>
2888 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002889 * 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 -08002890 * a change in other capture settings forced the camera device to
2891 * perform a black level reset.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002892 *
2893 * @see CaptureRequest#BLACK_LEVEL_LOCK
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002894 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002895 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002896 public static final Key<Boolean> BLACK_LEVEL_LOCK =
2897 new Key<Boolean>("android.blackLevel.lock", boolean.class);
2898
Igor Murashkin3865a842014-01-17 18:18:39 -08002899 /**
2900 * <p>The frame number corresponding to the last request
2901 * with which the output result (metadata + buffers) has been fully
2902 * synchronized.</p>
2903 * <p>When a request is submitted to the camera device, there is usually a
2904 * delay of several frames before the controls get applied. A camera
2905 * device may either choose to account for this delay by implementing a
2906 * pipeline and carefully submit well-timed atomic control updates, or
2907 * it may start streaming control changes that span over several frame
2908 * boundaries.</p>
2909 * <p>In the latter case, whenever a request's settings change relative to
2910 * the previous submitted request, the full set of changes may take
2911 * multiple frame durations to fully take effect. Some settings may
2912 * take effect sooner (in less frame durations) than others.</p>
2913 * <p>While a set of control changes are being propagated, this value
2914 * will be CONVERGING.</p>
2915 * <p>Once it is fully known that a set of control changes have been
2916 * finished propagating, and the resulting updated control settings
2917 * have been read back by the camera device, this value will be set
2918 * to a non-negative frame number (corresponding to the request to
2919 * which the results have synchronized to).</p>
2920 * <p>Older camera device implementations may not have a way to detect
2921 * when all camera controls have been applied, and will always set this
2922 * value to UNKNOWN.</p>
2923 * <p>FULL capability devices will always have this value set to the
2924 * frame number of the request corresponding to this result.</p>
2925 * <p><em>Further details</em>:</p>
2926 * <ul>
2927 * <li>Whenever a request differs from the last request, any future
2928 * results not yet returned may have this value set to CONVERGING (this
2929 * could include any in-progress captures not yet returned by the camera
2930 * device, for more details see pipeline considerations below).</li>
2931 * <li>Submitting a series of multiple requests that differ from the
2932 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
2933 * moves the new synchronization frame to the last non-repeating
2934 * request (using the smallest frame number from the contiguous list of
2935 * repeating requests).</li>
2936 * <li>Submitting the same request repeatedly will not change this value
2937 * to CONVERGING, if it was already a non-negative value.</li>
2938 * <li>When this value changes to non-negative, that means that all of the
2939 * metadata controls from the request have been applied, all of the
2940 * metadata controls from the camera device have been read to the
2941 * updated values (into the result), and all of the graphics buffers
2942 * corresponding to this result are also synchronized to the request.</li>
2943 * </ul>
2944 * <p><em>Pipeline considerations</em>:</p>
2945 * <p>Submitting a request with updated controls relative to the previously
2946 * submitted requests may also invalidate the synchronization state
2947 * of all the results corresponding to currently in-flight requests.</p>
2948 * <p>In other words, results for this current request and up to
2949 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
2950 * android.sync.frameNumber change to CONVERGING.</p>
2951 *
2952 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2953 * @see #SYNC_FRAME_NUMBER_CONVERGING
2954 * @see #SYNC_FRAME_NUMBER_UNKNOWN
2955 * @hide
2956 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07002957 public static final Key<Long> SYNC_FRAME_NUMBER =
2958 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08002959
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002960 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2961 * End generated code
2962 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07002963
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002964}