blob: 01276a28e320f8ac644acfd4ce1657f5cada6a0a [file] [log] [blame]
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Eino-Ville Talvala2f1a2e42013-07-25 17:12:05 -070017package android.hardware.camera2;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080018
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070019import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkinbdf366c2014-07-25 16:54:20 -070020import android.hardware.camera2.impl.CaptureResultExtras;
Igor Murashkin6c76f582014-07-15 17:19:49 -070021import android.hardware.camera2.impl.PublicKey;
22import android.hardware.camera2.impl.SyntheticKey;
Igor Murashkind6d65152014-05-19 16:31:02 -070023import android.hardware.camera2.utils.TypeReference;
24import android.util.Log;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070025import android.util.Rational;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080026
Igor Murashkind6d65152014-05-19 16:31:02 -070027import java.util.List;
28
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080029/**
Igor Murashkindb075af2014-05-21 10:07:08 -070030 * <p>The subset of the results of a single image capture from the image sensor.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080031 *
Igor Murashkindb075af2014-05-21 10:07:08 -070032 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080033 * flash), the processing pipeline, the control algorithms, and the output
34 * buffers.</p>
35 *
36 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
37 * {@link CaptureRequest}. All properties listed for capture requests can also
38 * be queried on the capture result, to determine the final values used for
39 * capture. The result also includes additional metadata about the state of the
40 * camera device during the capture.</p>
41 *
Igor Murashkindb075af2014-05-21 10:07:08 -070042 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
43 * are necessarily available. Some results are {@link CaptureResult partial} and will
44 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
45 * every key available that was enabled by the request.</p>
46 *
47 * <p>{@link CaptureResult} objects are immutable.</p>
Ruben Brunkf967a542014-04-28 16:31:11 -070048 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080049 */
Igor Murashkindb075af2014-05-21 10:07:08 -070050public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
Igor Murashkind6d65152014-05-19 16:31:02 -070051
52 private static final String TAG = "CaptureResult";
53 private static final boolean VERBOSE = false;
54
55 /**
56 * A {@code Key} is used to do capture result field lookups with
57 * {@link CaptureResult#get}.
58 *
59 * <p>For example, to get the timestamp corresponding to the exposure of the first row:
60 * <code><pre>
61 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
62 * </pre></code>
63 * </p>
64 *
65 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
66 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
67 *
68 * @see CaptureResult#get
69 * @see CameraCharacteristics#getAvailableCaptureResultKeys
70 */
71 public final static class Key<T> {
72 private final CameraMetadataNative.Key<T> mKey;
73
74 /**
75 * Visible for testing and vendor extensions only.
76 *
77 * @hide
78 */
79 public Key(String name, Class<T> type) {
80 mKey = new CameraMetadataNative.Key<T>(name, type);
81 }
82
83 /**
84 * Visible for testing and vendor extensions only.
85 *
86 * @hide
87 */
88 public Key(String name, TypeReference<T> typeReference) {
89 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
90 }
91
92 /**
93 * Return a camelCase, period separated name formatted like:
94 * {@code "root.section[.subsections].name"}.
95 *
96 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
97 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
98 *
99 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
100 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
101 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
102 *
103 * @return String representation of the key name
104 */
105 public String getName() {
106 return mKey.getName();
107 }
108
109 /**
110 * {@inheritDoc}
111 */
112 @Override
113 public final int hashCode() {
114 return mKey.hashCode();
115 }
116
117 /**
118 * {@inheritDoc}
119 */
120 @SuppressWarnings("unchecked")
121 @Override
122 public final boolean equals(Object o) {
123 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
124 }
125
126 /**
127 * Visible for CameraMetadataNative implementation only; do not use.
128 *
129 * TODO: Make this private or remove it altogether.
130 *
131 * @hide
132 */
133 public CameraMetadataNative.Key<T> getNativeKey() {
134 return mKey;
135 }
136
137 @SuppressWarnings({ "unchecked" })
138 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
139 mKey = (CameraMetadataNative.Key<T>) nativeKey;
140 }
141 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700142
143 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700144 private final CaptureRequest mRequest;
145 private final int mSequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700146 private final long mFrameNumber;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700147
Igor Murashkin70725502013-06-25 20:27:06 +0000148 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700149 * Takes ownership of the passed-in properties object
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700150 *
151 * <p>For internal use only</p>
Igor Murashkin70725502013-06-25 20:27:06 +0000152 * @hide
153 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700154 public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
155 CaptureResultExtras extras) {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700156 if (results == null) {
157 throw new IllegalArgumentException("results was null");
158 }
159
160 if (parent == null) {
161 throw new IllegalArgumentException("parent was null");
162 }
163
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700164 if (extras == null) {
165 throw new IllegalArgumentException("extras was null");
166 }
167
Igor Murashkind6d65152014-05-19 16:31:02 -0700168 mResults = CameraMetadataNative.move(results);
169 if (mResults.isEmpty()) {
170 throw new AssertionError("Results must not be empty");
171 }
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700172 mRequest = parent;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700173 mSequenceId = extras.getRequestId();
174 mFrameNumber = extras.getFrameNumber();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700175 }
176
Ruben Brunkf967a542014-04-28 16:31:11 -0700177 /**
178 * Returns a copy of the underlying {@link CameraMetadataNative}.
179 * @hide
180 */
181 public CameraMetadataNative getNativeCopy() {
182 return new CameraMetadataNative(mResults);
183 }
184
Igor Murashkind6d65152014-05-19 16:31:02 -0700185 /**
186 * Creates a request-less result.
187 *
188 * <p><strong>For testing only.</strong></p>
189 * @hide
190 */
191 public CaptureResult(CameraMetadataNative results, int sequenceId) {
192 if (results == null) {
193 throw new IllegalArgumentException("results was null");
194 }
195
196 mResults = CameraMetadataNative.move(results);
197 if (mResults.isEmpty()) {
198 throw new AssertionError("Results must not be empty");
199 }
200
201 mRequest = null;
202 mSequenceId = sequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700203 mFrameNumber = -1;
Igor Murashkind6d65152014-05-19 16:31:02 -0700204 }
205
206 /**
207 * Get a capture result field value.
208 *
209 * <p>The field definitions can be found in {@link CaptureResult}.</p>
210 *
211 * <p>Querying the value for the same key more than once will return a value
212 * which is equal to the previous queried value.</p>
213 *
214 * @throws IllegalArgumentException if the key was not valid
215 *
216 * @param key The result field to read.
217 * @return The value of that key, or {@code null} if the field is not set.
218 */
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700219 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700220 T value = mResults.get(key);
221 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
222 return value;
223 }
224
225 /**
226 * {@inheritDoc}
227 * @hide
228 */
229 @SuppressWarnings("unchecked")
230 @Override
231 protected <T> T getProtected(Key<?> key) {
232 return (T) mResults.get(key);
233 }
234
235 /**
236 * {@inheritDoc}
237 * @hide
238 */
239 @SuppressWarnings("unchecked")
240 @Override
241 protected Class<Key<?>> getKeyClass() {
242 Object thisClass = Key.class;
243 return (Class<Key<?>>)thisClass;
244 }
245
246 /**
247 * Dumps the native metadata contents to logcat.
248 *
249 * <p>Visibility for testing/debugging only. The results will not
250 * include any synthesized keys, as they are invisible to the native layer.</p>
251 *
252 * @hide
253 */
254 public void dumpToLog() {
255 mResults.dumpToLog();
256 }
257
258 /**
259 * {@inheritDoc}
260 */
261 @Override
262 public List<Key<?>> getKeys() {
263 // Force the javadoc for this function to show up on the CaptureResult page
264 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800265 }
266
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700267 /**
268 * Get the request associated with this result.
269 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700270 * <p>Whenever a request has been fully or partially captured, with
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700271 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or
272 * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s
Igor Murashkindb075af2014-05-21 10:07:08 -0700273 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700274 * </p>
275 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700276 * <p>For example,
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700277 * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700278 * {@literal @}Override
279 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
280 * assert(myResult.getRequest.equals(myRequest) == true);
281 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700282 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700283 * </code></pre>
284 * </p>
285 *
286 * @return The request associated with this result. Never {@code null}.
287 */
288 public CaptureRequest getRequest() {
289 return mRequest;
290 }
291
292 /**
293 * Get the frame number associated with this result.
294 *
295 * <p>Whenever a request has been processed, regardless of failure or success,
296 * it gets a unique frame number assigned to its future result/failure.</p>
297 *
298 * <p>This value monotonically increments, starting with 0,
299 * for every new result or failure; and the scope is the lifetime of the
300 * {@link CameraDevice}.</p>
301 *
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700302 * @return The frame number
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700303 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700304 public long getFrameNumber() {
305 return mFrameNumber;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700306 }
307
308 /**
309 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700310 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700311 *
312 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
313 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
314 *
315 * @return int The ID for the sequence of requests that this capture result is a part of
316 *
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700317 * @see CameraDevice.CaptureCallback#onCaptureSequenceCompleted
318 * @see CameraDevice.CaptureCallback#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700319 */
320 public int getSequenceId() {
321 return mSequenceId;
322 }
323
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700324 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
325 * The key entries below this point are generated from metadata
326 * definitions in /system/media/camera/docs. Do not modify by hand or
327 * modify the comment blocks at the start or end.
328 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
329
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
Zhijun He9e4e4392014-08-18 11:12:32 -0700423 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700424 * <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 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700435 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
436 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
437 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
438 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700439 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700440 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700441 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
442 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700443
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>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700585 * <p>Optional. Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
586 * Otherwise will always be present.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800587 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700588 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800589 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
590 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700591 * bottom-right pixel in the active pixel array.</p>
592 * <p>The weight must range from 0 to 1000, and represents a weight
593 * for every pixel in the area. This means that a large metering area
594 * with the same weight as a smaller area will have more effect in
595 * the metering result. Metering areas can partially overlap and the
596 * camera device will add the weights in the overlap region.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800597 * <p>If all regions have 0 weight, then no specific metering area
Zhijun Hecc28a412014-02-24 15:11:23 -0800598 * needs to be used by the camera device. If the metering region is
Zhijun He14986152014-05-22 21:17:37 -0700599 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
600 * the camera device will ignore the sections outside the region and output the
601 * used sections in the result metadata.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700602 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800603 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700604 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800605 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800606 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700607 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700608 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700609 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
610 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700611
612 /**
Zhijun He379af012014-05-06 11:54:54 -0700613 * <p>Range over which fps can be adjusted to
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700614 * maintain exposure.</p>
615 * <p>Only constrains auto-exposure (AE) algorithm, not
616 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p>
Zhijun He379af012014-05-06 11:54:54 -0700617 *
618 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
619 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700620 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700621 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
622 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700623
624 /**
625 * <p>Whether the camera device will trigger a precapture
626 * metering sequence when it processes this request.</p>
627 * <p>This entry is normally set to IDLE, or is not
628 * included at all in the request settings. When included and
629 * set to START, the camera device will trigger the autoexposure
630 * precapture metering sequence.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700631 * <p>The precapture sequence should triggered before starting a
632 * high-quality still capture for final metering decisions to
633 * be made, and for firing pre-capture flash pulses to estimate
634 * scene brightness and required final capture flash power, when
635 * the flash is enabled.</p>
636 * <p>Normally, this entry should be set to START for only a
637 * single request, and the application should wait until the
638 * sequence completes before starting a new one.</p>
639 * <p>The exact effect of auto-exposure (AE) precapture trigger
640 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700641 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
642 * details.</p>
Zhijun He379af012014-05-06 11:54:54 -0700643 *
644 * @see CaptureResult#CONTROL_AE_STATE
645 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
646 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
647 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700648 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700649 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
650 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
651
652 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700653 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800654 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
655 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
656 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
657 * the algorithm states to INACTIVE.</p>
658 * <p>The camera device can do several state transitions between two results, if it is
659 * allowed by the state transition table. For example: INACTIVE may never actually be
660 * seen in a result.</p>
661 * <p>The state in the result is the state for this image (in sync with this image): if
662 * AE state becomes CONVERGED, then the image data associated with this result should
663 * be good to use.</p>
664 * <p>Below are state transition tables for different AE modes.</p>
665 * <table>
666 * <thead>
667 * <tr>
668 * <th align="center">State</th>
669 * <th align="center">Transition Cause</th>
670 * <th align="center">New State</th>
671 * <th align="center">Notes</th>
672 * </tr>
673 * </thead>
674 * <tbody>
675 * <tr>
676 * <td align="center">INACTIVE</td>
677 * <td align="center"></td>
678 * <td align="center">INACTIVE</td>
679 * <td align="center">Camera device auto exposure algorithm is disabled</td>
680 * </tr>
681 * </tbody>
682 * </table>
683 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
684 * <table>
685 * <thead>
686 * <tr>
687 * <th align="center">State</th>
688 * <th align="center">Transition Cause</th>
689 * <th align="center">New State</th>
690 * <th align="center">Notes</th>
691 * </tr>
692 * </thead>
693 * <tbody>
694 * <tr>
695 * <td align="center">INACTIVE</td>
696 * <td align="center">Camera device initiates AE scan</td>
697 * <td align="center">SEARCHING</td>
698 * <td align="center">Values changing</td>
699 * </tr>
700 * <tr>
701 * <td align="center">INACTIVE</td>
702 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
703 * <td align="center">LOCKED</td>
704 * <td align="center">Values locked</td>
705 * </tr>
706 * <tr>
707 * <td align="center">SEARCHING</td>
708 * <td align="center">Camera device finishes AE scan</td>
709 * <td align="center">CONVERGED</td>
710 * <td align="center">Good values, not changing</td>
711 * </tr>
712 * <tr>
713 * <td align="center">SEARCHING</td>
714 * <td align="center">Camera device finishes AE scan</td>
715 * <td align="center">FLASH_REQUIRED</td>
716 * <td align="center">Converged but too dark w/o flash</td>
717 * </tr>
718 * <tr>
719 * <td align="center">SEARCHING</td>
720 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
721 * <td align="center">LOCKED</td>
722 * <td align="center">Values locked</td>
723 * </tr>
724 * <tr>
725 * <td align="center">CONVERGED</td>
726 * <td align="center">Camera device initiates AE scan</td>
727 * <td align="center">SEARCHING</td>
728 * <td align="center">Values changing</td>
729 * </tr>
730 * <tr>
731 * <td align="center">CONVERGED</td>
732 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
733 * <td align="center">LOCKED</td>
734 * <td align="center">Values locked</td>
735 * </tr>
736 * <tr>
737 * <td align="center">FLASH_REQUIRED</td>
738 * <td align="center">Camera device initiates AE scan</td>
739 * <td align="center">SEARCHING</td>
740 * <td align="center">Values changing</td>
741 * </tr>
742 * <tr>
743 * <td align="center">FLASH_REQUIRED</td>
744 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
745 * <td align="center">LOCKED</td>
746 * <td align="center">Values locked</td>
747 * </tr>
748 * <tr>
749 * <td align="center">LOCKED</td>
750 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
751 * <td align="center">SEARCHING</td>
752 * <td align="center">Values not good after unlock</td>
753 * </tr>
754 * <tr>
755 * <td align="center">LOCKED</td>
756 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
757 * <td align="center">CONVERGED</td>
758 * <td align="center">Values good after unlock</td>
759 * </tr>
760 * <tr>
761 * <td align="center">LOCKED</td>
762 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
763 * <td align="center">FLASH_REQUIRED</td>
764 * <td align="center">Exposure good, but too dark</td>
765 * </tr>
766 * <tr>
767 * <td align="center">PRECAPTURE</td>
768 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
769 * <td align="center">CONVERGED</td>
770 * <td align="center">Ready for high-quality capture</td>
771 * </tr>
772 * <tr>
773 * <td align="center">PRECAPTURE</td>
774 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
775 * <td align="center">LOCKED</td>
776 * <td align="center">Ready for high-quality capture</td>
777 * </tr>
778 * <tr>
779 * <td align="center">Any state</td>
780 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
781 * <td align="center">PRECAPTURE</td>
782 * <td align="center">Start AE precapture metering sequence</td>
783 * </tr>
784 * </tbody>
785 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800786 * <p>For the above table, the camera device may skip reporting any state changes that happen
787 * without application intervention (i.e. mode switch, trigger, locking). Any state that
788 * can be skipped in that manner is called a transient state.</p>
789 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
790 * listed in above table, it is also legal for the camera device to skip one or more
791 * transient states between two results. See below table for examples:</p>
792 * <table>
793 * <thead>
794 * <tr>
795 * <th align="center">State</th>
796 * <th align="center">Transition Cause</th>
797 * <th align="center">New State</th>
798 * <th align="center">Notes</th>
799 * </tr>
800 * </thead>
801 * <tbody>
802 * <tr>
803 * <td align="center">INACTIVE</td>
804 * <td align="center">Camera device finished AE scan</td>
805 * <td align="center">CONVERGED</td>
806 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
807 * </tr>
808 * <tr>
809 * <td align="center">Any state</td>
810 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
811 * <td align="center">FLASH_REQUIRED</td>
812 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
813 * </tr>
814 * <tr>
815 * <td align="center">Any state</td>
816 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
817 * <td align="center">CONVERGED</td>
818 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
819 * </tr>
820 * <tr>
821 * <td align="center">CONVERGED</td>
822 * <td align="center">Camera device finished AE scan</td>
823 * <td align="center">FLASH_REQUIRED</td>
824 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
825 * </tr>
826 * <tr>
827 * <td align="center">FLASH_REQUIRED</td>
828 * <td align="center">Camera device finished AE scan</td>
829 * <td align="center">CONVERGED</td>
830 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
831 * </tr>
832 * </tbody>
833 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -0800834 *
835 * @see CaptureRequest#CONTROL_AE_LOCK
836 * @see CaptureRequest#CONTROL_AE_MODE
837 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
838 * @see CaptureRequest#CONTROL_MODE
839 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700840 * @see #CONTROL_AE_STATE_INACTIVE
841 * @see #CONTROL_AE_STATE_SEARCHING
842 * @see #CONTROL_AE_STATE_CONVERGED
843 * @see #CONTROL_AE_STATE_LOCKED
844 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
845 * @see #CONTROL_AE_STATE_PRECAPTURE
846 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700847 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700848 public static final Key<Integer> CONTROL_AE_STATE =
849 new Key<Integer>("android.control.aeState", int.class);
850
851 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700852 * <p>Whether auto-focus (AF) is currently enabled, and what
853 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800854 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
855 * (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 -0800856 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800857 * 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 -0800858 * in result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800859 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800860 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800861 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -0800862 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700863 * @see #CONTROL_AF_MODE_OFF
864 * @see #CONTROL_AF_MODE_AUTO
865 * @see #CONTROL_AF_MODE_MACRO
866 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
867 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
868 * @see #CONTROL_AF_MODE_EDOF
869 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700870 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700871 public static final Key<Integer> CONTROL_AF_MODE =
872 new Key<Integer>("android.control.afMode", int.class);
873
874 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800875 * <p>List of areas to use for focus
Ruben Brunkf59521d2014-02-03 17:14:33 -0800876 * estimation.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700877 * <p>Optional. Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
878 * Otherwise will always be present.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800879 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700880 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800881 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
882 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700883 * bottom-right pixel in the active pixel array.</p>
884 * <p>The weight must range from 0 to 1000, and represents a weight
885 * for every pixel in the area. This means that a large metering area
886 * with the same weight as a smaller area will have more effect in
887 * the metering result. Metering areas can partially overlap and the
888 * camera device will add the weights in the overlap region.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700889 * <p>If all regions have 0 weight, then no specific metering area
890 * needs to be used by the camera device. If the metering region is
891 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
892 * the camera device will ignore the sections outside the region and output the
893 * used sections in the result metadata.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700894 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800895 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700896 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800897 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800898 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700899 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700900 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700901 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
902 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700903
904 /**
Zhijun He379af012014-05-06 11:54:54 -0700905 * <p>Whether the camera device will trigger autofocus for this request.</p>
906 * <p>This entry is normally set to IDLE, or is not
907 * included at all in the request settings.</p>
908 * <p>When included and set to START, the camera device will trigger the
909 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
910 * <p>When set to CANCEL, the camera device will cancel any active trigger,
911 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700912 * <p>Generally, applications should set this entry to START or CANCEL for only a
913 * single capture, and then return it to IDLE (or not set at all). Specifying
914 * START for multiple captures in a row means restarting the AF operation over
915 * and over again.</p>
916 * <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 -0700917 *
918 * @see CaptureResult#CONTROL_AF_STATE
919 * @see #CONTROL_AF_TRIGGER_IDLE
920 * @see #CONTROL_AF_TRIGGER_START
921 * @see #CONTROL_AF_TRIGGER_CANCEL
922 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700923 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700924 public static final Key<Integer> CONTROL_AF_TRIGGER =
925 new Key<Integer>("android.control.afTrigger", int.class);
926
927 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700928 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800929 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
930 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
931 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
932 * the algorithm states to INACTIVE.</p>
933 * <p>The camera device can do several state transitions between two results, if it is
934 * allowed by the state transition table. For example: INACTIVE may never actually be
935 * seen in a result.</p>
936 * <p>The state in the result is the state for this image (in sync with this image): if
937 * AF state becomes FOCUSED, then the image data associated with this result should
938 * be sharp.</p>
939 * <p>Below are state transition tables for different AF modes.</p>
940 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
941 * <table>
942 * <thead>
943 * <tr>
944 * <th align="center">State</th>
945 * <th align="center">Transition Cause</th>
946 * <th align="center">New State</th>
947 * <th align="center">Notes</th>
948 * </tr>
949 * </thead>
950 * <tbody>
951 * <tr>
952 * <td align="center">INACTIVE</td>
953 * <td align="center"></td>
954 * <td align="center">INACTIVE</td>
955 * <td align="center">Never changes</td>
956 * </tr>
957 * </tbody>
958 * </table>
959 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
960 * <table>
961 * <thead>
962 * <tr>
963 * <th align="center">State</th>
964 * <th align="center">Transition Cause</th>
965 * <th align="center">New State</th>
966 * <th align="center">Notes</th>
967 * </tr>
968 * </thead>
969 * <tbody>
970 * <tr>
971 * <td align="center">INACTIVE</td>
972 * <td align="center">AF_TRIGGER</td>
973 * <td align="center">ACTIVE_SCAN</td>
974 * <td align="center">Start AF sweep, Lens now moving</td>
975 * </tr>
976 * <tr>
977 * <td align="center">ACTIVE_SCAN</td>
978 * <td align="center">AF sweep done</td>
979 * <td align="center">FOCUSED_LOCKED</td>
980 * <td align="center">Focused, Lens now locked</td>
981 * </tr>
982 * <tr>
983 * <td align="center">ACTIVE_SCAN</td>
984 * <td align="center">AF sweep done</td>
985 * <td align="center">NOT_FOCUSED_LOCKED</td>
986 * <td align="center">Not focused, Lens now locked</td>
987 * </tr>
988 * <tr>
989 * <td align="center">ACTIVE_SCAN</td>
990 * <td align="center">AF_CANCEL</td>
991 * <td align="center">INACTIVE</td>
992 * <td align="center">Cancel/reset AF, Lens now locked</td>
993 * </tr>
994 * <tr>
995 * <td align="center">FOCUSED_LOCKED</td>
996 * <td align="center">AF_CANCEL</td>
997 * <td align="center">INACTIVE</td>
998 * <td align="center">Cancel/reset AF</td>
999 * </tr>
1000 * <tr>
1001 * <td align="center">FOCUSED_LOCKED</td>
1002 * <td align="center">AF_TRIGGER</td>
1003 * <td align="center">ACTIVE_SCAN</td>
1004 * <td align="center">Start new sweep, Lens now moving</td>
1005 * </tr>
1006 * <tr>
1007 * <td align="center">NOT_FOCUSED_LOCKED</td>
1008 * <td align="center">AF_CANCEL</td>
1009 * <td align="center">INACTIVE</td>
1010 * <td align="center">Cancel/reset AF</td>
1011 * </tr>
1012 * <tr>
1013 * <td align="center">NOT_FOCUSED_LOCKED</td>
1014 * <td align="center">AF_TRIGGER</td>
1015 * <td align="center">ACTIVE_SCAN</td>
1016 * <td align="center">Start new sweep, Lens now moving</td>
1017 * </tr>
1018 * <tr>
1019 * <td align="center">Any state</td>
1020 * <td align="center">Mode change</td>
1021 * <td align="center">INACTIVE</td>
1022 * <td align="center"></td>
1023 * </tr>
1024 * </tbody>
1025 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001026 * <p>For the above table, the camera device may skip reporting any state changes that happen
1027 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1028 * can be skipped in that manner is called a transient state.</p>
1029 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1030 * state transitions listed in above table, it is also legal for the camera device to skip
1031 * one or more transient states between two results. See below table for examples:</p>
1032 * <table>
1033 * <thead>
1034 * <tr>
1035 * <th align="center">State</th>
1036 * <th align="center">Transition Cause</th>
1037 * <th align="center">New State</th>
1038 * <th align="center">Notes</th>
1039 * </tr>
1040 * </thead>
1041 * <tbody>
1042 * <tr>
1043 * <td align="center">INACTIVE</td>
1044 * <td align="center">AF_TRIGGER</td>
1045 * <td align="center">FOCUSED_LOCKED</td>
1046 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1047 * </tr>
1048 * <tr>
1049 * <td align="center">INACTIVE</td>
1050 * <td align="center">AF_TRIGGER</td>
1051 * <td align="center">NOT_FOCUSED_LOCKED</td>
1052 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1053 * </tr>
1054 * <tr>
1055 * <td align="center">FOCUSED_LOCKED</td>
1056 * <td align="center">AF_TRIGGER</td>
1057 * <td align="center">FOCUSED_LOCKED</td>
1058 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1059 * </tr>
1060 * <tr>
1061 * <td align="center">NOT_FOCUSED_LOCKED</td>
1062 * <td align="center">AF_TRIGGER</td>
1063 * <td align="center">FOCUSED_LOCKED</td>
1064 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1065 * </tr>
1066 * </tbody>
1067 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001068 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1069 * <table>
1070 * <thead>
1071 * <tr>
1072 * <th align="center">State</th>
1073 * <th align="center">Transition Cause</th>
1074 * <th align="center">New State</th>
1075 * <th align="center">Notes</th>
1076 * </tr>
1077 * </thead>
1078 * <tbody>
1079 * <tr>
1080 * <td align="center">INACTIVE</td>
1081 * <td align="center">Camera device initiates new scan</td>
1082 * <td align="center">PASSIVE_SCAN</td>
1083 * <td align="center">Start AF scan, Lens now moving</td>
1084 * </tr>
1085 * <tr>
1086 * <td align="center">INACTIVE</td>
1087 * <td align="center">AF_TRIGGER</td>
1088 * <td align="center">NOT_FOCUSED_LOCKED</td>
1089 * <td align="center">AF state query, Lens now locked</td>
1090 * </tr>
1091 * <tr>
1092 * <td align="center">PASSIVE_SCAN</td>
1093 * <td align="center">Camera device completes current scan</td>
1094 * <td align="center">PASSIVE_FOCUSED</td>
1095 * <td align="center">End AF scan, Lens now locked</td>
1096 * </tr>
1097 * <tr>
1098 * <td align="center">PASSIVE_SCAN</td>
1099 * <td align="center">Camera device fails current scan</td>
1100 * <td align="center">PASSIVE_UNFOCUSED</td>
1101 * <td align="center">End AF scan, Lens now locked</td>
1102 * </tr>
1103 * <tr>
1104 * <td align="center">PASSIVE_SCAN</td>
1105 * <td align="center">AF_TRIGGER</td>
1106 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001107 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001108 * </tr>
1109 * <tr>
1110 * <td align="center">PASSIVE_SCAN</td>
1111 * <td align="center">AF_TRIGGER</td>
1112 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001113 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001114 * </tr>
1115 * <tr>
1116 * <td align="center">PASSIVE_SCAN</td>
1117 * <td align="center">AF_CANCEL</td>
1118 * <td align="center">INACTIVE</td>
1119 * <td align="center">Reset lens position, Lens now locked</td>
1120 * </tr>
1121 * <tr>
1122 * <td align="center">PASSIVE_FOCUSED</td>
1123 * <td align="center">Camera device initiates new scan</td>
1124 * <td align="center">PASSIVE_SCAN</td>
1125 * <td align="center">Start AF scan, Lens now moving</td>
1126 * </tr>
1127 * <tr>
1128 * <td align="center">PASSIVE_UNFOCUSED</td>
1129 * <td align="center">Camera device initiates new scan</td>
1130 * <td align="center">PASSIVE_SCAN</td>
1131 * <td align="center">Start AF scan, Lens now moving</td>
1132 * </tr>
1133 * <tr>
1134 * <td align="center">PASSIVE_FOCUSED</td>
1135 * <td align="center">AF_TRIGGER</td>
1136 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001137 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001138 * </tr>
1139 * <tr>
1140 * <td align="center">PASSIVE_UNFOCUSED</td>
1141 * <td align="center">AF_TRIGGER</td>
1142 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001143 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001144 * </tr>
1145 * <tr>
1146 * <td align="center">FOCUSED_LOCKED</td>
1147 * <td align="center">AF_TRIGGER</td>
1148 * <td align="center">FOCUSED_LOCKED</td>
1149 * <td align="center">No effect</td>
1150 * </tr>
1151 * <tr>
1152 * <td align="center">FOCUSED_LOCKED</td>
1153 * <td align="center">AF_CANCEL</td>
1154 * <td align="center">INACTIVE</td>
1155 * <td align="center">Restart AF scan</td>
1156 * </tr>
1157 * <tr>
1158 * <td align="center">NOT_FOCUSED_LOCKED</td>
1159 * <td align="center">AF_TRIGGER</td>
1160 * <td align="center">NOT_FOCUSED_LOCKED</td>
1161 * <td align="center">No effect</td>
1162 * </tr>
1163 * <tr>
1164 * <td align="center">NOT_FOCUSED_LOCKED</td>
1165 * <td align="center">AF_CANCEL</td>
1166 * <td align="center">INACTIVE</td>
1167 * <td align="center">Restart AF scan</td>
1168 * </tr>
1169 * </tbody>
1170 * </table>
1171 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1172 * <table>
1173 * <thead>
1174 * <tr>
1175 * <th align="center">State</th>
1176 * <th align="center">Transition Cause</th>
1177 * <th align="center">New State</th>
1178 * <th align="center">Notes</th>
1179 * </tr>
1180 * </thead>
1181 * <tbody>
1182 * <tr>
1183 * <td align="center">INACTIVE</td>
1184 * <td align="center">Camera device initiates new scan</td>
1185 * <td align="center">PASSIVE_SCAN</td>
1186 * <td align="center">Start AF scan, Lens now moving</td>
1187 * </tr>
1188 * <tr>
1189 * <td align="center">INACTIVE</td>
1190 * <td align="center">AF_TRIGGER</td>
1191 * <td align="center">NOT_FOCUSED_LOCKED</td>
1192 * <td align="center">AF state query, Lens now locked</td>
1193 * </tr>
1194 * <tr>
1195 * <td align="center">PASSIVE_SCAN</td>
1196 * <td align="center">Camera device completes current scan</td>
1197 * <td align="center">PASSIVE_FOCUSED</td>
1198 * <td align="center">End AF scan, Lens now locked</td>
1199 * </tr>
1200 * <tr>
1201 * <td align="center">PASSIVE_SCAN</td>
1202 * <td align="center">Camera device fails current scan</td>
1203 * <td align="center">PASSIVE_UNFOCUSED</td>
1204 * <td align="center">End AF scan, Lens now locked</td>
1205 * </tr>
1206 * <tr>
1207 * <td align="center">PASSIVE_SCAN</td>
1208 * <td align="center">AF_TRIGGER</td>
1209 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001210 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001211 * </tr>
1212 * <tr>
1213 * <td align="center">PASSIVE_SCAN</td>
1214 * <td align="center">AF_TRIGGER</td>
1215 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001216 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001217 * </tr>
1218 * <tr>
1219 * <td align="center">PASSIVE_SCAN</td>
1220 * <td align="center">AF_CANCEL</td>
1221 * <td align="center">INACTIVE</td>
1222 * <td align="center">Reset lens position, Lens now locked</td>
1223 * </tr>
1224 * <tr>
1225 * <td align="center">PASSIVE_FOCUSED</td>
1226 * <td align="center">Camera device initiates new scan</td>
1227 * <td align="center">PASSIVE_SCAN</td>
1228 * <td align="center">Start AF scan, Lens now moving</td>
1229 * </tr>
1230 * <tr>
1231 * <td align="center">PASSIVE_UNFOCUSED</td>
1232 * <td align="center">Camera device initiates new scan</td>
1233 * <td align="center">PASSIVE_SCAN</td>
1234 * <td align="center">Start AF scan, Lens now moving</td>
1235 * </tr>
1236 * <tr>
1237 * <td align="center">PASSIVE_FOCUSED</td>
1238 * <td align="center">AF_TRIGGER</td>
1239 * <td align="center">FOCUSED_LOCKED</td>
1240 * <td align="center">Immediate trans. Lens now locked</td>
1241 * </tr>
1242 * <tr>
1243 * <td align="center">PASSIVE_UNFOCUSED</td>
1244 * <td align="center">AF_TRIGGER</td>
1245 * <td align="center">NOT_FOCUSED_LOCKED</td>
1246 * <td align="center">Immediate trans. Lens now locked</td>
1247 * </tr>
1248 * <tr>
1249 * <td align="center">FOCUSED_LOCKED</td>
1250 * <td align="center">AF_TRIGGER</td>
1251 * <td align="center">FOCUSED_LOCKED</td>
1252 * <td align="center">No effect</td>
1253 * </tr>
1254 * <tr>
1255 * <td align="center">FOCUSED_LOCKED</td>
1256 * <td align="center">AF_CANCEL</td>
1257 * <td align="center">INACTIVE</td>
1258 * <td align="center">Restart AF scan</td>
1259 * </tr>
1260 * <tr>
1261 * <td align="center">NOT_FOCUSED_LOCKED</td>
1262 * <td align="center">AF_TRIGGER</td>
1263 * <td align="center">NOT_FOCUSED_LOCKED</td>
1264 * <td align="center">No effect</td>
1265 * </tr>
1266 * <tr>
1267 * <td align="center">NOT_FOCUSED_LOCKED</td>
1268 * <td align="center">AF_CANCEL</td>
1269 * <td align="center">INACTIVE</td>
1270 * <td align="center">Restart AF scan</td>
1271 * </tr>
1272 * </tbody>
1273 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001274 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1275 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1276 * camera device. When a trigger is included in a mode switch request, the trigger
1277 * will be evaluated in the context of the new mode in the request.
1278 * See below table for examples:</p>
1279 * <table>
1280 * <thead>
1281 * <tr>
1282 * <th align="center">State</th>
1283 * <th align="center">Transition Cause</th>
1284 * <th align="center">New State</th>
1285 * <th align="center">Notes</th>
1286 * </tr>
1287 * </thead>
1288 * <tbody>
1289 * <tr>
1290 * <td align="center">any state</td>
1291 * <td align="center">CAF--&gt;AUTO mode switch</td>
1292 * <td align="center">INACTIVE</td>
1293 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1294 * </tr>
1295 * <tr>
1296 * <td align="center">any state</td>
1297 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1298 * <td align="center">trigger-reachable states from INACTIVE</td>
1299 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1300 * </tr>
1301 * <tr>
1302 * <td align="center">any state</td>
1303 * <td align="center">AUTO--&gt;CAF mode switch</td>
1304 * <td align="center">passively reachable states from INACTIVE</td>
1305 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1306 * </tr>
1307 * </tbody>
1308 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001309 *
1310 * @see CaptureRequest#CONTROL_AF_MODE
1311 * @see CaptureRequest#CONTROL_MODE
1312 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001313 * @see #CONTROL_AF_STATE_INACTIVE
1314 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1315 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1316 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1317 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1318 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001319 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001320 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001321 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001322 public static final Key<Integer> CONTROL_AF_STATE =
1323 new Key<Integer>("android.control.afState", int.class);
1324
1325 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001326 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001327 * latest calculated values.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001328 * <p>Note that AWB lock is only meaningful when
1329 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1330 * AWB is already fixed to a specific setting.</p>
1331 *
1332 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001333 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001334 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001335 public static final Key<Boolean> CONTROL_AWB_LOCK =
1336 new Key<Boolean>("android.control.awbLock", boolean.class);
1337
1338 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001339 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001340 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001341 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001342 * <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 -07001343 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001344 * routine is enabled, overriding the application's selected
1345 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1346 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001347 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001348 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001349 * 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 -08001350 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001351 * <p>When set to any other modes, the camera device's auto-white
1352 * balance routine is disabled. The camera device uses each
1353 * particular illumination target for white balance
1354 * adjustment. The application's values for
1355 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1356 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1357 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001358 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001359 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001360 * @see CaptureRequest#COLOR_CORRECTION_MODE
1361 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001362 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001363 * @see #CONTROL_AWB_MODE_OFF
1364 * @see #CONTROL_AWB_MODE_AUTO
1365 * @see #CONTROL_AWB_MODE_INCANDESCENT
1366 * @see #CONTROL_AWB_MODE_FLUORESCENT
1367 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1368 * @see #CONTROL_AWB_MODE_DAYLIGHT
1369 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1370 * @see #CONTROL_AWB_MODE_TWILIGHT
1371 * @see #CONTROL_AWB_MODE_SHADE
1372 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001373 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001374 public static final Key<Integer> CONTROL_AWB_MODE =
1375 new Key<Integer>("android.control.awbMode", int.class);
1376
1377 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001378 * <p>List of areas to use for illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001379 * estimation.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001380 * <p>Optional. Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
1381 * Otherwise will always be present.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001382 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001383 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001384 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1385 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001386 * bottom-right pixel in the active pixel array.</p>
1387 * <p>The weight must range from 0 to 1000, and represents a weight
1388 * for every pixel in the area. This means that a large metering area
1389 * with the same weight as a smaller area will have more effect in
1390 * the metering result. Metering areas can partially overlap and the
1391 * camera device will add the weights in the overlap region.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001392 * <p>If all regions have 0 weight, then no specific metering area
1393 * needs to be used by the camera device. If the metering region is
1394 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
Zhijun He14986152014-05-22 21:17:37 -07001395 * the camera device will ignore the sections outside the region and output the
1396 * used sections in the result metadata.</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001397 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001398 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001399 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001400 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001401 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001402 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001403 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001404 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1405 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001406
1407 /**
Zhijun He379af012014-05-06 11:54:54 -07001408 * <p>Information to the camera device 3A (auto-exposure,
1409 * auto-focus, auto-white balance) routines about the purpose
1410 * of this capture, to help the camera device to decide optimal 3A
1411 * strategy.</p>
1412 * <p>This control (except for MANUAL) is only effective if
1413 * <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 -07001414 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1415 * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Zhijun He379af012014-05-06 11:54:54 -07001416 * contains MANUAL_SENSOR.</p>
1417 *
1418 * @see CaptureRequest#CONTROL_MODE
1419 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1420 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1421 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1422 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1423 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1424 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1425 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1426 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1427 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001428 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001429 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1430 new Key<Integer>("android.control.captureIntent", int.class);
1431
1432 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001433 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001434 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1435 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1436 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1437 * the algorithm states to INACTIVE.</p>
1438 * <p>The camera device can do several state transitions between two results, if it is
1439 * allowed by the state transition table. So INACTIVE may never actually be seen in
1440 * a result.</p>
1441 * <p>The state in the result is the state for this image (in sync with this image): if
1442 * AWB state becomes CONVERGED, then the image data associated with this result should
1443 * be good to use.</p>
1444 * <p>Below are state transition tables for different AWB modes.</p>
1445 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1446 * <table>
1447 * <thead>
1448 * <tr>
1449 * <th align="center">State</th>
1450 * <th align="center">Transition Cause</th>
1451 * <th align="center">New State</th>
1452 * <th align="center">Notes</th>
1453 * </tr>
1454 * </thead>
1455 * <tbody>
1456 * <tr>
1457 * <td align="center">INACTIVE</td>
1458 * <td align="center"></td>
1459 * <td align="center">INACTIVE</td>
1460 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1461 * </tr>
1462 * </tbody>
1463 * </table>
1464 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1465 * <table>
1466 * <thead>
1467 * <tr>
1468 * <th align="center">State</th>
1469 * <th align="center">Transition Cause</th>
1470 * <th align="center">New State</th>
1471 * <th align="center">Notes</th>
1472 * </tr>
1473 * </thead>
1474 * <tbody>
1475 * <tr>
1476 * <td align="center">INACTIVE</td>
1477 * <td align="center">Camera device initiates AWB scan</td>
1478 * <td align="center">SEARCHING</td>
1479 * <td align="center">Values changing</td>
1480 * </tr>
1481 * <tr>
1482 * <td align="center">INACTIVE</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">SEARCHING</td>
1489 * <td align="center">Camera device finishes AWB scan</td>
1490 * <td align="center">CONVERGED</td>
1491 * <td align="center">Good values, not changing</td>
1492 * </tr>
1493 * <tr>
1494 * <td align="center">SEARCHING</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">CONVERGED</td>
1501 * <td align="center">Camera device initiates AWB scan</td>
1502 * <td align="center">SEARCHING</td>
1503 * <td align="center">Values changing</td>
1504 * </tr>
1505 * <tr>
1506 * <td align="center">CONVERGED</td>
1507 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1508 * <td align="center">LOCKED</td>
1509 * <td align="center">Values locked</td>
1510 * </tr>
1511 * <tr>
1512 * <td align="center">LOCKED</td>
1513 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1514 * <td align="center">SEARCHING</td>
1515 * <td align="center">Values not good after unlock</td>
1516 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001517 * </tbody>
1518 * </table>
1519 * <p>For the above table, the camera device may skip reporting any state changes that happen
1520 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1521 * can be skipped in that manner is called a transient state.</p>
1522 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1523 * listed in above table, it is also legal for the camera device to skip one or more
1524 * transient states between two results. See below table for examples:</p>
1525 * <table>
1526 * <thead>
1527 * <tr>
1528 * <th align="center">State</th>
1529 * <th align="center">Transition Cause</th>
1530 * <th align="center">New State</th>
1531 * <th align="center">Notes</th>
1532 * </tr>
1533 * </thead>
1534 * <tbody>
1535 * <tr>
1536 * <td align="center">INACTIVE</td>
1537 * <td align="center">Camera device finished AWB scan</td>
1538 * <td align="center">CONVERGED</td>
1539 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1540 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001541 * <tr>
1542 * <td align="center">LOCKED</td>
1543 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1544 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001545 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001546 * </tr>
1547 * </tbody>
1548 * </table>
1549 *
1550 * @see CaptureRequest#CONTROL_AWB_LOCK
1551 * @see CaptureRequest#CONTROL_AWB_MODE
1552 * @see CaptureRequest#CONTROL_MODE
1553 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001554 * @see #CONTROL_AWB_STATE_INACTIVE
1555 * @see #CONTROL_AWB_STATE_SEARCHING
1556 * @see #CONTROL_AWB_STATE_CONVERGED
1557 * @see #CONTROL_AWB_STATE_LOCKED
1558 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001559 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001560 public static final Key<Integer> CONTROL_AWB_STATE =
1561 new Key<Integer>("android.control.awbState", int.class);
1562
1563 /**
Zhijun He379af012014-05-06 11:54:54 -07001564 * <p>A special color effect to apply.</p>
1565 * <p>When this mode is set, a color effect will be applied
1566 * to images produced by the camera device. The interpretation
1567 * and implementation of these color effects is left to the
1568 * implementor of the camera device, and should not be
1569 * depended on to be consistent (or present) across all
1570 * devices.</p>
1571 * <p>A color effect will only be applied if
1572 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p>
1573 *
1574 * @see CaptureRequest#CONTROL_MODE
1575 * @see #CONTROL_EFFECT_MODE_OFF
1576 * @see #CONTROL_EFFECT_MODE_MONO
1577 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1578 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1579 * @see #CONTROL_EFFECT_MODE_SEPIA
1580 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1581 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1582 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1583 * @see #CONTROL_EFFECT_MODE_AQUA
1584 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001585 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001586 public static final Key<Integer> CONTROL_EFFECT_MODE =
1587 new Key<Integer>("android.control.effectMode", int.class);
1588
1589 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001590 * <p>Overall mode of 3A control
Zhijun Hecc28a412014-02-24 15:11:23 -08001591 * routines.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001592 * <p>High-level 3A control. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001593 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001594 * capture parameters itself.</p>
1595 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001596 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001597 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001598 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001599 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001600 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001601 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001602 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1603 * is that this frame will not be used by camera device background 3A statistics
1604 * update, as if this frame is never captured. This mode can be used in the scenario
1605 * where the application doesn't want a 3A manual control capture to affect
1606 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001607 *
1608 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001609 * @see #CONTROL_MODE_OFF
1610 * @see #CONTROL_MODE_AUTO
1611 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001612 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001613 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001614 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001615 public static final Key<Integer> CONTROL_MODE =
1616 new Key<Integer>("android.control.mode", int.class);
1617
1618 /**
Zhijun He379af012014-05-06 11:54:54 -07001619 * <p>A camera mode optimized for conditions typical in a particular
1620 * capture setting.</p>
1621 * <p>This is the mode that that is active when
1622 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1623 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001624 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.
1625 * The scene modes available for a given camera device are listed in
1626 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}.</p>
Zhijun He379af012014-05-06 11:54:54 -07001627 * <p>The interpretation and implementation of these scene modes is left
1628 * to the implementor of the camera device. Their behavior will not be
1629 * consistent across all devices, and any given device may only implement
1630 * a subset of these modes.</p>
1631 *
1632 * @see CaptureRequest#CONTROL_AE_MODE
1633 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001634 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001635 * @see CaptureRequest#CONTROL_AWB_MODE
1636 * @see CaptureRequest#CONTROL_MODE
1637 * @see #CONTROL_SCENE_MODE_DISABLED
1638 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1639 * @see #CONTROL_SCENE_MODE_ACTION
1640 * @see #CONTROL_SCENE_MODE_PORTRAIT
1641 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1642 * @see #CONTROL_SCENE_MODE_NIGHT
1643 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1644 * @see #CONTROL_SCENE_MODE_THEATRE
1645 * @see #CONTROL_SCENE_MODE_BEACH
1646 * @see #CONTROL_SCENE_MODE_SNOW
1647 * @see #CONTROL_SCENE_MODE_SUNSET
1648 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1649 * @see #CONTROL_SCENE_MODE_FIREWORKS
1650 * @see #CONTROL_SCENE_MODE_SPORTS
1651 * @see #CONTROL_SCENE_MODE_PARTY
1652 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1653 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07001654 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Zhijun He379af012014-05-06 11:54:54 -07001655 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001656 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001657 public static final Key<Integer> CONTROL_SCENE_MODE =
1658 new Key<Integer>("android.control.sceneMode", int.class);
1659
1660 /**
1661 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001662 * active.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001663 * <p>Video stabilization automatically translates and scales images from the camera
1664 * in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07001665 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001666 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
1667 * <p>Switching between different video stabilization modes may take several frames
1668 * to initialize, the camera device will report the current mode in capture result
1669 * metadata. For example, When "ON" mode is requested, the video stabilization modes
1670 * in the first several capture results may still be "OFF", and it will become "ON"
1671 * when the initialization is done.</p>
1672 * <p>If a camera device supports both this mode and OIS ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}),
1673 * turning both modes on may produce undesirable interaction, so it is recommended not to
1674 * enable both at the same time.</p>
Zhijun He379af012014-05-06 11:54:54 -07001675 *
Zhijun He45fa43a12014-06-13 18:29:37 -07001676 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07001677 * @see CaptureRequest#SCALER_CROP_REGION
1678 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1679 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1680 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001681 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001682 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1683 new Key<Integer>("android.control.videoStabilizationMode", int.class);
1684
1685 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001686 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001687 * enhancement.</p>
Zhijun He28079362013-12-17 10:35:40 -08001688 * <p>Edge/sharpness/detail enhancement. OFF means no
Zhijun Hecc28a412014-02-24 15:11:23 -08001689 * enhancement will be applied by the camera device.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001690 * <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 -08001691 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001692 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001693 * camera device will use the highest-quality enhancement algorithms,
1694 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08001695 * not slow down capture rate when applying edge enhancement.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001696 *
1697 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001698 * @see #EDGE_MODE_OFF
1699 * @see #EDGE_MODE_FAST
1700 * @see #EDGE_MODE_HIGH_QUALITY
1701 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001702 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001703 public static final Key<Integer> EDGE_MODE =
1704 new Key<Integer>("android.edge.mode", int.class);
1705
1706 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001707 * <p>The desired mode for for the camera device's flash control.</p>
1708 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08001709 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001710 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
1711 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
1712 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
1713 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
1714 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
1715 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001716 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08001717 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
1718 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
1719 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001720 * <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 -08001721 *
1722 * @see CaptureRequest#CONTROL_AE_MODE
1723 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1724 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08001725 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001726 * @see #FLASH_MODE_OFF
1727 * @see #FLASH_MODE_SINGLE
1728 * @see #FLASH_MODE_TORCH
1729 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001730 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001731 public static final Key<Integer> FLASH_MODE =
1732 new Key<Integer>("android.flash.mode", int.class);
1733
1734 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001735 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08001736 * unit.</p>
1737 * <p>When the camera device doesn't have flash unit
1738 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
1739 * Other states indicate the current flash status.</p>
1740 *
1741 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001742 * @see #FLASH_STATE_UNAVAILABLE
1743 * @see #FLASH_STATE_CHARGING
1744 * @see #FLASH_STATE_READY
1745 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07001746 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001747 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001748 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001749 public static final Key<Integer> FLASH_STATE =
1750 new Key<Integer>("android.flash.state", int.class);
1751
1752 /**
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001753 * <p>Set operational mode for hot pixel correction.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001754 * <p>Valid modes for this camera device are listed in
1755 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001756 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
1757 * that do not accurately encode the incoming light (i.e. pixels that
1758 * are stuck at an arbitrary value).</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001759 *
1760 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001761 * @see #HOT_PIXEL_MODE_OFF
1762 * @see #HOT_PIXEL_MODE_FAST
1763 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1764 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001765 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001766 public static final Key<Integer> HOT_PIXEL_MODE =
1767 new Key<Integer>("android.hotPixel.mode", int.class);
1768
1769 /**
Ruben Brunk57493682014-05-27 18:58:08 -07001770 * <p>A location object to use when generating image GPS metadata.</p>
1771 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001772 @PublicKey
1773 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07001774 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
1775 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
1776
1777 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001778 * <p>GPS coordinates to include in output JPEG
1779 * EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001780 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001781 */
1782 public static final Key<double[]> JPEG_GPS_COORDINATES =
1783 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
1784
1785 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001786 * <p>32 characters describing GPS algorithm to
1787 * include in EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001788 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001789 */
1790 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
1791 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
1792
1793 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001794 * <p>Time GPS fix was made to include in
1795 * EXIF</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001796 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001797 */
1798 public static final Key<Long> JPEG_GPS_TIMESTAMP =
1799 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
1800
1801 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001802 * <p>Orientation of JPEG image to
1803 * write</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001804 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001805 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001806 public static final Key<Integer> JPEG_ORIENTATION =
1807 new Key<Integer>("android.jpeg.orientation", int.class);
1808
1809 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001810 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001811 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001812 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001813 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001814 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001815 public static final Key<Byte> JPEG_QUALITY =
1816 new Key<Byte>("android.jpeg.quality", byte.class);
1817
1818 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001819 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001820 * thumbnail.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001821 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001822 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001823 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
1824 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
1825
1826 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001827 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001828 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
1829 * but the captured JPEG will still be a valid image.</p>
Zhijun He5a9ff372013-12-26 11:49:09 -08001830 * <p>When a jpeg image capture is issued, the thumbnail size selected should have
1831 * the same aspect ratio as the jpeg image.</p>
Zhijun He50f72432014-05-28 13:52:04 -07001832 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
1833 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
1834 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
1835 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
1836 * generate the thumbnail image. The thumbnail image will always have a smaller Field
1837 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001838 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001839 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001840 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
1841 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001842
1843 /**
Zhijun Hefb46c642014-01-14 17:57:23 -08001844 * <p>The ratio of lens focal length to the effective
1845 * aperture diameter.</p>
1846 * <p>This will only be supported on the camera devices that
1847 * have variable aperture lens. The aperture value can only be
1848 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
1849 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1850 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001851 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08001852 * to achieve manual exposure control.</p>
1853 * <p>The requested aperture value may take several frames to reach the
1854 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08001855 * aperture size in capture result metadata while the aperture is changing.
1856 * 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 -08001857 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1858 * the ON modes, this will be overridden by the camera device
1859 * auto-exposure algorithm, the overridden values are then provided
1860 * back to the user in the corresponding result.</p>
1861 *
Zhijun He399f05d2014-01-15 11:31:30 -08001862 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001863 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001864 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001865 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001866 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001867 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001868 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001869 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001870 public static final Key<Float> LENS_APERTURE =
1871 new Key<Float>("android.lens.aperture", float.class);
1872
1873 /**
Ruben Brunk855bae42014-01-17 10:30:32 -08001874 * <p>State of lens neutral density filter(s).</p>
1875 * <p>This will not be supported on most camera devices. On devices
1876 * where this is supported, this may only be set to one of the
1877 * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p>
1878 * <p>Lens filters are typically used to lower the amount of light the
1879 * sensor is exposed to (measured in steps of EV). As used here, an EV
1880 * step is the standard logarithmic representation, which are
1881 * non-negative, and inversely proportional to the amount of light
1882 * hitting the sensor. For example, setting this to 0 would result
1883 * in no reduction of the incoming light, and setting this to 2 would
1884 * mean that the filter is set to reduce incoming light by two stops
1885 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001886 * <p>It may take several frames before the lens filter density changes
1887 * to the requested value. While the filter density is still changing,
1888 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001889 *
1890 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001891 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001892 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001893 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001894 public static final Key<Float> LENS_FILTER_DENSITY =
1895 new Key<Float>("android.lens.filterDensity", float.class);
1896
1897 /**
Ruben Brunka20f4c22014-01-17 15:21:13 -08001898 * <p>The current lens focal length; used for optical zoom.</p>
1899 * <p>This setting controls the physical focal length of the camera
1900 * device's lens. Changing the focal length changes the field of
1901 * view of the camera device, and is usually used for optical zoom.</p>
1902 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1903 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08001904 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08001905 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1906 * be set to MOVING.</p>
1907 * <p>This is expected not to be supported on most devices.</p>
1908 *
1909 * @see CaptureRequest#LENS_APERTURE
1910 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1911 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001912 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001913 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001914 public static final Key<Float> LENS_FOCAL_LENGTH =
1915 new Key<Float>("android.lens.focalLength", float.class);
1916
1917 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001918 * <p>Distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001919 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001920 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001921 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001922 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001923 public static final Key<Float> LENS_FOCUS_DISTANCE =
1924 new Key<Float>("android.lens.focusDistance", float.class);
1925
1926 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001927 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001928 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001929 * <p>If variable focus not supported, can still report
1930 * fixed depth of field range</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001931 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001932 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07001933 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
1934 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 -07001935
1936 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08001937 * <p>Sets whether the camera device uses optical image stabilization (OIS)
1938 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001939 * <p>OIS is used to compensate for motion blur due to small
1940 * movements of the camera during capture. Unlike digital image
1941 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
1942 * makes use of mechanical elements to stabilize the camera
1943 * sensor, and thus allows for longer exposure times before
1944 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07001945 * <p>Switching between different optical stabilization modes may take several
1946 * frames to initialize, the camera device will report the current mode in
1947 * capture result metadata. For example, When "ON" mode is requested, the
1948 * optical stabilization modes in the first several capture results may still
1949 * be "OFF", and it will become "ON" when the initialization is done.</p>
1950 * <p>If a camera device supports both OIS and EIS ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}),
1951 * turning both modes on may produce undesirable interaction, so it is recommended not
1952 * to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001953 * <p>Not all devices will support OIS; see
1954 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
1955 * available controls.</p>
1956 *
1957 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
1958 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001959 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
1960 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
1961 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001962 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001963 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
1964 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
1965
1966 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08001967 * <p>Current lens status.</p>
1968 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1969 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
1970 * they may take several frames to reach the requested values. This state indicates
1971 * the current status of the lens parameters.</p>
1972 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
1973 * either because the parameters are all fixed, or because the lens has had enough
1974 * time to reach the most recently-requested values.
1975 * If all these lens parameters are not changable for a camera device, as listed below:</p>
1976 * <ul>
1977 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
1978 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
1979 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
1980 * which means the optical zoom is not supported.</li>
1981 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
1982 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
1983 * </ul>
1984 * <p>Then this state will always be STATIONARY.</p>
1985 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
1986 * is changing.</p>
1987 *
1988 * @see CaptureRequest#LENS_APERTURE
1989 * @see CaptureRequest#LENS_FILTER_DENSITY
1990 * @see CaptureRequest#LENS_FOCAL_LENGTH
1991 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1992 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1993 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1994 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
1995 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001996 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07001997 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001998 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001999 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002000 public static final Key<Integer> LENS_STATE =
2001 new Key<Integer>("android.lens.state", int.class);
2002
2003 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002004 * <p>Mode of operation for the noise reduction algorithm.</p>
Zhijun He28079362013-12-17 10:35:40 -08002005 * <p>Noise filtering control. OFF means no noise reduction
Zhijun Hecc28a412014-02-24 15:11:23 -08002006 * will be applied by the camera device.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002007 * <p>This must be set to a valid mode from
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002008 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002009 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2010 * will be applied. HIGH_QUALITY mode indicates that the camera device
2011 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002012 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08002013 * slow down capture rate when applying noise filtering.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002014 *
2015 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002016 * @see #NOISE_REDUCTION_MODE_OFF
2017 * @see #NOISE_REDUCTION_MODE_FAST
2018 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
2019 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002020 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002021 public static final Key<Integer> NOISE_REDUCTION_MODE =
2022 new Key<Integer>("android.noiseReduction.mode", int.class);
2023
2024 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002025 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002026 * final one for the capture, or only a partial that contains a
2027 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002028 * values.</p>
2029 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002030 * single capture may not overlap, except for this entry. The
2031 * FINAL buffers must retain FIFO ordering relative to the
2032 * requests that generate them, so the FINAL buffer for frame 3 must
2033 * always be sent to the framework after the FINAL buffer for frame 2, and
2034 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2035 * in any order relative to other frames, but all PARTIAL buffers for a given
2036 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002037 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002038 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002039 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002040 * @hide
2041 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002042 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002043 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2044 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2045
2046 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002047 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002048 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002049 * frameCount value).</p>
2050 * <p>Reset on release()</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002051 * @deprecated
2052 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002053 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002054 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002055 public static final Key<Integer> REQUEST_FRAME_COUNT =
2056 new Key<Integer>("android.request.frameCount", int.class);
2057
2058 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002059 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002060 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002061 * frame</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002062 * @hide
2063 */
2064 public static final Key<Integer> REQUEST_ID =
2065 new Key<Integer>("android.request.id", int.class);
2066
2067 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002068 * <p>Specifies the number of pipeline stages the frame went
2069 * through from when it was exposed to when the final completed result
2070 * was available to the framework.</p>
2071 * <p>Depending on what settings are used in the request, and
2072 * what streams are configured, the data may undergo less processing,
2073 * and some pipeline stages skipped.</p>
2074 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
2075 *
2076 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2077 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002078 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002079 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2080 new Key<Byte>("android.request.pipelineDepth", byte.class);
2081
2082 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002083 * <p>The region of the sensor to read out for this capture.</p>
2084 * <p>The crop region coordinate system is based off
2085 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2086 * top-left corner of the sensor active array.</p>
2087 * <p>Output streams use this rectangle to produce their output,
2088 * cropping to a smaller region if necessary to maintain the
2089 * stream's aspect ratio, then scaling the sensor input to
2090 * match the output's configured resolution.</p>
2091 * <p>The crop region is applied after the RAW to other color
2092 * space (e.g. YUV) conversion. Since raw streams
2093 * (e.g. RAW16) don't have the conversion stage, they are not
2094 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002095 * <p>For non-raw streams, any additional per-stream cropping will
2096 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002097 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002098 * ratio, then 4:3 streams will use the exact crop
2099 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002100 * (letterbox).</p>
2101 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002102 * outputs will crop horizontally (pillarbox), and 16:9
2103 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002104 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002105 * <p>The width and height of the crop region cannot
2106 * be set to be smaller than
2107 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2108 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2109 * <p>The camera device may adjust the crop region to account
2110 * for rounding and other hardware requirements; the final
2111 * crop region used will be included in the output capture
2112 * result.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002113 *
2114 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002115 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002116 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002117 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002118 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2119 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2120
2121 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002122 * <p>Duration each pixel is exposed to
2123 * light.</p>
2124 * <p>If the sensor can't expose this exact duration, it should shorten the
2125 * duration exposed to the nearest possible value (rather than expose longer).</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002126 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002127 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002128 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2129 new Key<Long>("android.sensor.exposureTime", long.class);
2130
2131 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002132 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002133 * start of next frame exposure.</p>
2134 * <p>The maximum frame rate that can be supported by a camera subsystem is
2135 * a function of many factors:</p>
2136 * <ul>
2137 * <li>Requested resolutions of output image streams</li>
2138 * <li>Availability of binning / skipping modes on the imager</li>
2139 * <li>The bandwidth of the imager interface</li>
2140 * <li>The bandwidth of the various ISP processing blocks</li>
2141 * </ul>
2142 * <p>Since these factors can vary greatly between different ISPs and
2143 * sensors, the camera abstraction tries to represent the bandwidth
2144 * restrictions with as simple a model as possible.</p>
2145 * <p>The model presented has the following characteristics:</p>
2146 * <ul>
2147 * <li>The image sensor is always configured to output the smallest
2148 * resolution possible given the application's requested output stream
2149 * sizes. The smallest resolution is defined as being at least as large
2150 * as the largest requested output stream size; the camera pipeline must
2151 * never digitally upsample sensor data when the crop region covers the
2152 * whole sensor. In general, this means that if only small output stream
2153 * resolutions are configured, the sensor can provide a higher frame
2154 * rate.</li>
2155 * <li>Since any request may use any or all the currently configured
2156 * output streams, the sensor and ISP must be configured to support
2157 * scaling a single capture to all the streams at the same time. This
2158 * means the camera pipeline must be ready to produce the largest
2159 * requested output size without any delay. Therefore, the overall
2160 * frame rate of a given configured stream set is governed only by the
2161 * largest requested stream resolution.</li>
2162 * <li>Using more than one output stream in a request does not affect the
2163 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002164 * <li>Certain format-streams may need to do additional background processing
2165 * before data is consumed/produced by that stream. These processors
2166 * can run concurrently to the rest of the camera pipeline, but
2167 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002168 * </ul>
2169 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002170 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2171 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002172 * These are used to determine the maximum frame rate / minimum frame
2173 * duration that is possible for a given stream configuration.</p>
2174 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002175 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002176 * device:</p>
2177 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002178 * <li>Let the set of currently configured input/output streams
2179 * be called <code>S</code>.</li>
2180 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002181 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2182 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002183 * its respective size/format). Let this set of frame durations be called
2184 * <code>F</code>.</li>
2185 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2186 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2187 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002188 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002189 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002190 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2191 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002192 * <code>F</code> determines the steady state frame rate that the application will
2193 * get if it uses <code>R</code> as a repeating request. Let this special kind
2194 * of request be called <code>Rsimple</code>.</p>
2195 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2196 * by a single capture of a new request <code>Rstall</code> (which has at least
2197 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2198 * same minimum frame duration this will not cause a frame rate loss
2199 * if all buffers from the previous <code>Rstall</code> have already been
2200 * delivered.</p>
2201 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002202 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002203 *
Igor Murashkin9c595172014-05-12 13:56:20 -07002204 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002205 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002206 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002207 public static final Key<Long> SENSOR_FRAME_DURATION =
2208 new Key<Long>("android.sensor.frameDuration", long.class);
2209
2210 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002211 * <p>The amount of gain applied to sensor data
2212 * before processing.</p>
2213 * <p>The sensitivity is the standard ISO sensitivity value,
2214 * as defined in ISO 12232:2006.</p>
2215 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2216 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2217 * is guaranteed to use only analog amplification for applying the gain.</p>
2218 * <p>If the camera device cannot apply the exact sensitivity
2219 * requested, it will reduce the gain to the nearest supported
2220 * value. The final sensitivity used will be available in the
2221 * output capture result.</p>
2222 *
2223 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2224 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002225 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002226 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002227 public static final Key<Integer> SENSOR_SENSITIVITY =
2228 new Key<Integer>("android.sensor.sensitivity", int.class);
2229
2230 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002231 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07002232 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002233 * <p>The timestamps are also included in all image
2234 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07002235 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002236 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07002237 * the timestamps measure time since an unspecified starting point,
2238 * and are monotonically increasing. They can be compared with the
2239 * timestamps for other captures from the same camera device, but are
2240 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002241 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME,
Zhijun He45fa43a12014-06-13 18:29:37 -07002242 * the timestamps measure time in the same timebase as
2243 * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2244 * compared to other timestamps from other subsystems that are using
2245 * that base.</p>
2246 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002247 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002248 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002249 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002250 public static final Key<Long> SENSOR_TIMESTAMP =
2251 new Key<Long>("android.sensor.timestamp", long.class);
2252
2253 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002254 * <p>The estimated camera neutral color in the native sensor colorspace at
2255 * the time of capture.</p>
2256 * <p>This value gives the neutral color point encoded as an RGB value in the
2257 * native sensor color space. The neutral color point indicates the
2258 * currently estimated white point of the scene illumination. It can be
2259 * used to interpolate between the provided color transforms when
2260 * processing raw sensor data.</p>
2261 * <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 -08002262 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2263 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002264 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08002265 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2266 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2267
2268 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002269 * <p>Noise model coefficients for each CFA mosaic channel.</p>
2270 * <p>This tag contains two noise model coefficients for each CFA channel
2271 * corresponding to the sensor amplification (S) and sensor readout
2272 * noise (O). These are given as pairs of coefficients for each channel
2273 * in the same order as channels listed for the CFA layout tag
2274 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
2275 * represented as an array of Pair&lt;Double, Double&gt;, where
2276 * the first member of the Pair at index n is the S coefficient and the
2277 * second member is the O coefficient for the nth color channel in the CFA.</p>
2278 * <p>These coefficients are used in a two parameter noise model to describe
2279 * the amount of noise present in the image for each CFA channel. The
2280 * noise model used here is:</p>
2281 * <p>N(x) = sqrt(Sx + O)</p>
2282 * <p>Where x represents the recorded signal of a CFA channel normalized to
2283 * the range [0, 1], and S and O are the noise model coeffiecients for
2284 * that channel.</p>
2285 * <p>A more detailed description of the noise model can be found in the
2286 * Adobe DNG specification for the NoiseProfile tag.</p>
2287 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2288 *
2289 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2290 */
2291 @PublicKey
2292 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
2293 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
2294
2295 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002296 * <p>The worst-case divergence between Bayer green channels.</p>
2297 * <p>This value is an estimate of the worst case split between the
2298 * Bayer green channels in the red and blue rows in the sensor color
2299 * filter array.</p>
2300 * <p>The green split is calculated as follows:</p>
2301 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002302 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2303 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2304 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2305 * chosen is implementation defined, and should be chosen to provide a
2306 * green split estimate that is both representative of the entire image
2307 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002308 * <li>The arithmetic mean of the green channels from the red
2309 * rows (mean_Gr) within W is computed.</li>
2310 * <li>The arithmetic mean of the green channels from the blue
2311 * rows (mean_Gb) within W is computed.</li>
2312 * <li>The maximum ratio R of the two means is computed as follows:
2313 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2314 * </ol>
2315 * <p>The ratio R is the green split divergence reported for this property,
2316 * which represents how much the green channels differ in the mosaic
2317 * pattern. This value is typically used to determine the treatment of
2318 * the green mosaic channels when demosaicing.</p>
2319 * <p>The green split value can be roughly interpreted as follows:</p>
2320 * <ul>
2321 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2322 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2323 * correction to avoid demosaic errors (3-20% divergence).</li>
2324 * <li>R &gt; 1.20 will require strong software correction to produce
2325 * a usuable image (&gt;20% divergence).</li>
2326 * </ul>
2327 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2328 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002329 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08002330 public static final Key<Float> SENSOR_GREEN_SPLIT =
2331 new Key<Float>("android.sensor.greenSplit", float.class);
2332
2333 /**
Zhijun He379af012014-05-06 11:54:54 -07002334 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2335 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2336 * <p>Each color channel is treated as an unsigned 32-bit integer.
2337 * The camera device then uses the most significant X bits
2338 * that correspond to how many bits are in its Bayer raw sensor
2339 * output.</p>
2340 * <p>For example, a sensor with RAW10 Bayer output would use the
2341 * 10 most significant bits from each color channel.</p>
2342 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2343 *
2344 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2345 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002346 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002347 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2348 new Key<int[]>("android.sensor.testPatternData", int[].class);
2349
2350 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002351 * <p>When enabled, the sensor sends a test pattern instead of
2352 * doing a real exposure from the camera.</p>
2353 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002354 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002355 * work as normal.</p>
2356 * <p>For example, if manual flash is enabled, flash firing should still
2357 * occur (and that the test pattern remain unmodified, since the flash
2358 * would not actually affect it).</p>
2359 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2360 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2361 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2362 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2363 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2364 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2365 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2366 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002367 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002368 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2369 new Key<Integer>("android.sensor.testPatternMode", int.class);
2370
2371 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07002372 * <p>Duration between the start of first row exposure
2373 * and the start of last row exposure.</p>
2374 * <p>This is the exposure time skew (in the unit of nanosecond) between the first and
2375 * last row exposure start times. The first row and the last row are the first
2376 * and last rows inside of the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2377 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
2378 * to the frame readout time.</p>
2379 *
2380 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2381 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002382 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07002383 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
2384 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
2385
2386 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002387 * <p>Quality of lens shading correction applied
2388 * to the image data.</p>
2389 * <p>When set to OFF mode, no lens shading correction will be applied by the
2390 * camera device, and an identity lens shading map data will be provided
2391 * 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 -07002392 * shading map with size specified as <code>android.lens.info.shadingMapSize = [ 4, 3 ]</code>,
2393 * the output android.statistics.lensShadingMap for this case will be an identity map
Zhijun Heba93fe62014-01-17 16:43:05 -08002394 * shown below:</p>
2395 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2396 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2397 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2398 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2399 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2400 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
2401 * </code></pre>
2402 * <p>When set to other modes, lens shading correction will be applied by the
2403 * camera device. Applications can request lens shading map data by setting
2404 * {@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 -07002405 * lens shading map data in android.statistics.lensShadingMap, with size specified
2406 * by android.lens.info.shadingMapSize; the returned shading map data will be the one
Zhijun Hefa7c7552014-05-22 16:36:02 -07002407 * applied by the camera device for this capture request.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002408 * <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 -07002409 * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in
2410 * 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),
2411 * to get best results, it is recommended that the applications wait for the AE and AWB to
2412 * be converged before using the returned shading map data.</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002413 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002414 * @see CaptureRequest#CONTROL_AE_MODE
2415 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun Heba93fe62014-01-17 16:43:05 -08002416 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2417 * @see #SHADING_MODE_OFF
2418 * @see #SHADING_MODE_FAST
2419 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002420 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002421 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08002422 public static final Key<Integer> SHADING_MODE =
2423 new Key<Integer>("android.shading.mode", int.class);
2424
2425 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002426 * <p>Control for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002427 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002428 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002429 * should output just the basic fields or the full set of
2430 * fields. Value must be one of the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002431 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p>
2432 *
2433 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002434 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2435 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2436 * @see #STATISTICS_FACE_DETECT_MODE_FULL
2437 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002438 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002439 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2440 new Key<Integer>("android.statistics.faceDetectMode", int.class);
2441
2442 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002443 * <p>List of unique IDs for detected faces.</p>
2444 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
2445 * to the camera device. A face that leaves the field of view and later returns may be
2446 * assigned a new ID.</p>
2447 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL</p>
2448 *
2449 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002450 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002451 */
2452 public static final Key<int[]> STATISTICS_FACE_IDS =
2453 new Key<int[]>("android.statistics.faceIds", int[].class);
2454
2455 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002456 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002457 * faces.</p>
2458 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2459 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
2460 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL</p>
2461 *
2462 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2463 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002464 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002465 */
2466 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
2467 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
2468
2469 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002470 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002471 * faces.</p>
2472 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2473 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
2474 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF</p>
2475 *
2476 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2477 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002478 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002479 */
2480 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
2481 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
2482
2483 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002484 * <p>List of the face confidence scores for
2485 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002486 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
2487 *
2488 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08002489 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002490 */
2491 public static final Key<byte[]> STATISTICS_FACE_SCORES =
2492 new Key<byte[]>("android.statistics.faceScores", byte[].class);
2493
2494 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002495 * <p>List of the faces detected through camera face detection
2496 * in this result.</p>
2497 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
2498 *
2499 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
2500 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002501 @PublicKey
2502 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002503 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
2504 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
2505
2506 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002507 * <p>The shading map is a low-resolution floating-point map
2508 * that lists the coefficients used to correct for vignetting, for each
2509 * Bayer color channel.</p>
2510 * <p>The least shaded section of the image should have a gain factor
2511 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002512 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08002513 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002514 * <p>The shading map is for the entire active pixel array, and is not
2515 * affected by the crop region specified in the request. Each shading map
2516 * entry is the value of the shading compensation map over a specific
2517 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2518 * map, and an active pixel array size (W x H), shading map entry
2519 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2520 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2521 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2522 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2523 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07002524 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002525 * <p>The shading map should have on the order of 30-40 rows and columns,
2526 * and must be smaller than 64x64.</p>
2527 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002528 * <pre><code>width,height = [ 4, 3 ]
2529 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002530 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002531 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2532 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2533 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2534 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2535 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002536 * </code></pre>
2537 * <p>The low-resolution scaling map images for each channel are
2538 * (displayed using nearest-neighbor interpolation):</p>
2539 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2540 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2541 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2542 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2543 * <p>As a visualization only, inverting the full-color map to recover an
2544 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2545 * <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 -08002546 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002547 * @see CaptureRequest#COLOR_CORRECTION_MODE
Ruben Brunk57493682014-05-27 18:58:08 -07002548 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002549 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07002550 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
2551 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
2552
2553 /**
2554 * <p>The shading map is a low-resolution floating-point map
2555 * that lists the coefficients used to correct for vignetting, for each
2556 * Bayer color channel.</p>
2557 * <p>The least shaded section of the image should have a gain factor
2558 * of 1; all other sections should have gains above 1.</p>
2559 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
2560 * must take into account the colorCorrection settings.</p>
2561 * <p>The shading map is for the entire active pixel array, and is not
2562 * affected by the crop region specified in the request. Each shading map
2563 * entry is the value of the shading compensation map over a specific
2564 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2565 * map, and an active pixel array size (W x H), shading map entry
2566 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2567 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2568 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2569 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2570 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
2571 * The shading map is stored in a fully interleaved format, and its size
2572 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
2573 * <p>The shading map should have on the order of 30-40 rows and columns,
2574 * and must be smaller than 64x64.</p>
2575 * <p>As an example, given a very small map defined as:</p>
2576 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
2577 * android.statistics.lensShadingMap =
2578 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
2579 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2580 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2581 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2582 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2583 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
2584 * </code></pre>
2585 * <p>The low-resolution scaling map images for each channel are
2586 * (displayed using nearest-neighbor interpolation):</p>
2587 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2588 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2589 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2590 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2591 * <p>As a visualization only, inverting the full-color map to recover an
2592 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2593 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
2594 *
2595 * @see CaptureRequest#COLOR_CORRECTION_MODE
2596 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002597 */
2598 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
2599 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
2600
2601 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002602 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08002603 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002604 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002605 * since statistics processing on data from a new frame
2606 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08002607 * applied to that frame.</p>
2608 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002609 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002610 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08002611 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002612 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002613 *
2614 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07002615 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002616 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002617 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002618 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002619 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
2620 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
2621
2622 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002623 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08002624 * calculated by the camera device's statistics units for the current
2625 * output frame.</p>
2626 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002627 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08002628 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002629 * are the best fit for the current output frame. This may
2630 * be different than the transform used for this frame, since
2631 * statistics processing on data from a new frame typically
2632 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002633 * that frame.</p>
2634 * <p>These estimates must be provided for all frames, even if
2635 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002636 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08002637 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002638 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002639 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002640 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002641 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002642 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002643 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
2644 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
2645
2646 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08002647 * <p>The camera device estimated scene illumination lighting
2648 * frequency.</p>
2649 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
2650 * that depends on the local utility power standards. This flicker must be
2651 * accounted for by auto-exposure routines to avoid artifacts in captured images.
2652 * The camera device uses this entry to tell the application what the scene
2653 * illuminant frequency is.</p>
2654 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002655 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
2656 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
2657 * antibanding, and the application can ensure it selects
2658 * exposure times that do not cause banding issues by looking
2659 * into this metadata field. See
2660 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
2661 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08002662 *
2663 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
2664 * @see CaptureRequest#CONTROL_AE_MODE
2665 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002666 * @see #STATISTICS_SCENE_FLICKER_NONE
2667 * @see #STATISTICS_SCENE_FLICKER_50HZ
2668 * @see #STATISTICS_SCENE_FLICKER_60HZ
2669 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002670 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002671 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
2672 new Key<Integer>("android.statistics.sceneFlicker", int.class);
2673
2674 /**
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002675 * <p>Operating mode for hotpixel map generation.</p>
2676 * <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 -07002677 * If set to OFF, no hotpixel map will be returned.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002678 * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p>
2679 *
2680 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2681 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2682 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002683 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002684 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2685 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2686
2687 /**
2688 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
2689 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
2690 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
2691 * bottom-right of the pixel array, respectively. The width and
2692 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
2693 * This may include hot pixels that lie outside of the active array
2694 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2695 *
2696 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2697 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2698 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002699 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002700 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
2701 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002702
2703 /**
Zhijun He379af012014-05-06 11:54:54 -07002704 * <p>Whether the camera device will output the lens
2705 * shading map in output result metadata.</p>
2706 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002707 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07002708 * the output result metadata.</p>
Zhijun He379af012014-05-06 11:54:54 -07002709 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2710 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2711 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002712 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002713 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2714 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2715
2716 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002717 * <p>Tonemapping / contrast / gamma curve for the blue
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_BLUE =
2726 new Key<float[]>("android.tonemap.curveBlue", 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 green
Igor Murashkine0060932014-01-17 17:24:11 -08002730 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2731 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002732 * <p>See android.tonemap.curveRed for more details.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002733 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002734 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002735 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002736 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002737 public static final Key<float[]> TONEMAP_CURVE_GREEN =
2738 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002739
2740 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002741 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08002742 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2743 * CONTRAST_CURVE.</p>
2744 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002745 * <pre><code>android.tonemap.curveRed =
Igor Murashkine0060932014-01-17 17:24:11 -08002746 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08002747 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Igor Murashkine0060932014-01-17 17:24:11 -08002748 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2749 * guaranteed that input values 0.0 and 1.0 are included in the list to
2750 * define a complete mapping. For input values between control points,
2751 * the camera device must linearly interpolate between the control
2752 * points.</p>
2753 * <p>Each curve can have an independent number of points, and the number
2754 * of points can be less than max (that is, the request doesn't have to
2755 * always provide a curve with number of points equivalent to
2756 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2757 * <p>A few examples, and their corresponding graphical mappings; these
2758 * only specify the red channel and the precision is limited to 4
2759 * digits, for conciseness.</p>
2760 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002761 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002762 * </code></pre>
2763 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2764 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002765 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002766 * </code></pre>
2767 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2768 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002769 * <pre><code>android.tonemap.curveRed = [
Igor Murashkine0060932014-01-17 17:24:11 -08002770 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2771 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2772 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2773 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
2774 * </code></pre>
2775 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2776 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002777 * <pre><code>android.tonemap.curveRed = [
Igor Murashkine0060932014-01-17 17:24:11 -08002778 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2779 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2780 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2781 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
2782 * </code></pre>
2783 * <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 -08002784 *
Igor Murashkine0060932014-01-17 17:24:11 -08002785 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002786 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002787 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002788 */
2789 public static final Key<float[]> TONEMAP_CURVE_RED =
2790 new Key<float[]>("android.tonemap.curveRed", float[].class);
2791
2792 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002793 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
2794 * is CONTRAST_CURVE.</p>
2795 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
2796 * channels respectively. The following example uses the red channel as an
2797 * example. The same logic applies to green and blue channel.
2798 * Each channel's curve is defined by an array of control points:</p>
2799 * <pre><code>curveRed =
2800 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
2801 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
2802 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2803 * guaranteed that input values 0.0 and 1.0 are included in the list to
2804 * define a complete mapping. For input values between control points,
2805 * the camera device must linearly interpolate between the control
2806 * points.</p>
2807 * <p>Each curve can have an independent number of points, and the number
2808 * of points can be less than max (that is, the request doesn't have to
2809 * always provide a curve with number of points equivalent to
2810 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2811 * <p>A few examples, and their corresponding graphical mappings; these
2812 * only specify the red channel and the precision is limited to 4
2813 * digits, for conciseness.</p>
2814 * <p>Linear mapping:</p>
2815 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
2816 * </code></pre>
2817 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2818 * <p>Invert mapping:</p>
2819 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
2820 * </code></pre>
2821 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2822 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2823 * <pre><code>curveRed = [
2824 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
2825 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
2826 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
2827 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
2828 * </code></pre>
2829 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2830 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2831 * <pre><code>curveRed = [
2832 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
2833 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
2834 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
2835 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
2836 * </code></pre>
2837 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
2838 *
2839 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
2840 * @see CaptureRequest#TONEMAP_MODE
2841 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002842 @PublicKey
2843 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002844 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
2845 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
2846
2847 /**
Igor Murashkine0060932014-01-17 17:24:11 -08002848 * <p>High-level global contrast/gamma/tonemapping control.</p>
2849 * <p>When switching to an application-defined contrast curve by setting
2850 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2851 * per-channel with a set of <code>(in, out)</code> points that specify the
2852 * mapping from input high-bit-depth pixel value to the output
2853 * low-bit-depth value. Since the actual pixel ranges of both input
2854 * and output may change depending on the camera pipeline, the values
2855 * are specified by normalized floating-point numbers.</p>
2856 * <p>More-complex color mapping operations such as 3D color look-up
2857 * tables, selective chroma enhancement, or other non-linear color
2858 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2859 * CONTRAST_CURVE.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002860 * <p>This must be set to a valid mode in
2861 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08002862 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002863 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08002864 * These values are always available, and as close as possible to the
2865 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07002866 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08002867 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2868 * roughly the same.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002869 *
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002870 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002871 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08002872 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002873 * @see #TONEMAP_MODE_CONTRAST_CURVE
2874 * @see #TONEMAP_MODE_FAST
2875 * @see #TONEMAP_MODE_HIGH_QUALITY
2876 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002877 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002878 public static final Key<Integer> TONEMAP_MODE =
2879 new Key<Integer>("android.tonemap.mode", int.class);
2880
2881 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002882 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002883 * that the camera is powered on and may be streaming images back to the
2884 * Application Processor. In certain rare circumstances, the OS may
2885 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002886 * any untrusted applications.</p>
2887 * <p>In particular, the LED <em>must</em> always be on when the data could be
2888 * transmitted off the device. The LED <em>should</em> always be on whenever
2889 * data is stored locally on the device.</p>
2890 * <p>The LED <em>may</em> be off if a trusted application is using the data that
2891 * doesn't violate the above rules.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002892 * @hide
2893 */
2894 public static final Key<Boolean> LED_TRANSMIT =
2895 new Key<Boolean>("android.led.transmit", boolean.class);
2896
2897 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002898 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002899 * to its current values, or is free to vary.</p>
2900 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002901 * 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 -08002902 * a change in other capture settings forced the camera device to
2903 * perform a black level reset.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002904 *
2905 * @see CaptureRequest#BLACK_LEVEL_LOCK
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002906 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002907 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002908 public static final Key<Boolean> BLACK_LEVEL_LOCK =
2909 new Key<Boolean>("android.blackLevel.lock", boolean.class);
2910
Igor Murashkin3865a842014-01-17 18:18:39 -08002911 /**
2912 * <p>The frame number corresponding to the last request
2913 * with which the output result (metadata + buffers) has been fully
2914 * synchronized.</p>
2915 * <p>When a request is submitted to the camera device, there is usually a
2916 * delay of several frames before the controls get applied. A camera
2917 * device may either choose to account for this delay by implementing a
2918 * pipeline and carefully submit well-timed atomic control updates, or
2919 * it may start streaming control changes that span over several frame
2920 * boundaries.</p>
2921 * <p>In the latter case, whenever a request's settings change relative to
2922 * the previous submitted request, the full set of changes may take
2923 * multiple frame durations to fully take effect. Some settings may
2924 * take effect sooner (in less frame durations) than others.</p>
2925 * <p>While a set of control changes are being propagated, this value
2926 * will be CONVERGING.</p>
2927 * <p>Once it is fully known that a set of control changes have been
2928 * finished propagating, and the resulting updated control settings
2929 * have been read back by the camera device, this value will be set
2930 * to a non-negative frame number (corresponding to the request to
2931 * which the results have synchronized to).</p>
2932 * <p>Older camera device implementations may not have a way to detect
2933 * when all camera controls have been applied, and will always set this
2934 * value to UNKNOWN.</p>
2935 * <p>FULL capability devices will always have this value set to the
2936 * frame number of the request corresponding to this result.</p>
2937 * <p><em>Further details</em>:</p>
2938 * <ul>
2939 * <li>Whenever a request differs from the last request, any future
2940 * results not yet returned may have this value set to CONVERGING (this
2941 * could include any in-progress captures not yet returned by the camera
2942 * device, for more details see pipeline considerations below).</li>
2943 * <li>Submitting a series of multiple requests that differ from the
2944 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
2945 * moves the new synchronization frame to the last non-repeating
2946 * request (using the smallest frame number from the contiguous list of
2947 * repeating requests).</li>
2948 * <li>Submitting the same request repeatedly will not change this value
2949 * to CONVERGING, if it was already a non-negative value.</li>
2950 * <li>When this value changes to non-negative, that means that all of the
2951 * metadata controls from the request have been applied, all of the
2952 * metadata controls from the camera device have been read to the
2953 * updated values (into the result), and all of the graphics buffers
2954 * corresponding to this result are also synchronized to the request.</li>
2955 * </ul>
2956 * <p><em>Pipeline considerations</em>:</p>
2957 * <p>Submitting a request with updated controls relative to the previously
2958 * submitted requests may also invalidate the synchronization state
2959 * of all the results corresponding to currently in-flight requests.</p>
2960 * <p>In other words, results for this current request and up to
2961 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
2962 * android.sync.frameNumber change to CONVERGING.</p>
2963 *
2964 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2965 * @see #SYNC_FRAME_NUMBER_CONVERGING
2966 * @see #SYNC_FRAME_NUMBER_UNKNOWN
2967 * @hide
2968 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07002969 public static final Key<Long> SYNC_FRAME_NUMBER =
2970 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08002971
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002972 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2973 * End generated code
2974 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07002975
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002976}